Regression in master

Enrico Forestieri forenr at lyx.org
Mon Dec 30 16:02:59 UTC 2019


In master, labels put inside sections are output outside of the section
latex command. This is a regression that breaks existing documents like
the attached one.

As it is easy to put a label outside of a section title but it is now
impossible to put it inside, I think that this new behavior is harmful.

In general, a program should not try to outsmart a user. Please, can
this regression be resolved? Thanks.

-- 
Enrico
-------------- next part --------------
#LyX 1.5.0svn created this file. For more info see http://www.lyx.org/
\lyxformat 258
\begin_document
\begin_header
\textclass IEEEtran
\begin_preamble
\usepackage{color}
\def\mysectmark{sec}
\def\markiflabeledsect#1:#2\endmarker{%
  \def\leer{#1}\ifx\leer\mysectmark\color{blue}\fi}
\let\oldlabel\label
\renewcommand{\label}[1]{\oldlabel{#1}
 \ifCLASSOPTIONdraft\expandafter\markiflabeledsect#1\endmarker\fi}
\end_preamble
\options draft
\language english
\inputencoding auto
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\paperfontsize default
\spacing single
\papersize default
\use_geometry false
\use_amsmath 1
\use_esint 1
\cite_engine basic
\use_bibtopic false
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\author "Enrico Forestieri" 
\end_header

\begin_body

\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open

\begin_layout Standard
\begin_inset Box Shadowbox
position "t"
hor_pos "c"
has_inner_box 1
inner_pos "t"
use_parbox 1
width "100col%"
special "none"
height "1in"
height_special "totalheight"
status open

\begin_layout Standard
\align center
Figure goes here
\end_layout

\end_inset


\end_layout

\begin_layout Standard
\begin_inset Caption

\begin_layout Standard
\begin_inset LatexCommand label
name "fig:foo"

\end_inset

Caption
\end_layout

\end_inset


\end_layout

\begin_layout Standard

\end_layout

\end_inset


\end_layout

\begin_layout Section
\begin_inset LatexCommand label
name "sec:foo"

\end_inset

Section title
\end_layout

\begin_layout Standard
In draft mode I will see highlighted in blue the Sections I labeled, such
 as Section 
\begin_inset LatexCommand ref
reference "sec:foo"

\end_inset

, but not captions in figures, such as Fig.\InsetSpace ~

\begin_inset LatexCommand ref
reference "fig:foo"

\end_inset

.
 So, it is important that the label is in the Section field.
 Removing the draft option from Document->Settings, the 
\backslash
label command behaves as usual.
\end_layout

\end_body
\end_document


More information about the lyx-devel mailing list