Richard Heck
2011-07-16 19:59:01 UTC
I'm not sure this is really a good idea. I
worry that there are too many cases where a label would be changed
incorrectly, or not changed.
For example? I also thought about this but no case comes into my mindworry that there are too many cases where a label would be changed
incorrectly, or not changed.
where this would fail.
Why? Because you want to reference the section the subsection is in. Now
if you change it to a chapter, what should happen?
I tend e.g. not to put labels into section
headings, but immediately following them, and those would not, and
should not, be affected, since one has no clear way to know with what
they are supposed to go.
But putting them in the current style is more or less standard and youheadings, but immediately following them, and those would not, and
should not, be affected, since one has no clear way to know with what
they are supposed to go.
even have to do this for many styles. Take for example the theorems.
An example: insert a problem in a book (svmono) class. If you want to
reference it, the label has to be inside the problem style. Adding it
below would not have th desired effect: when clicking in the PDF on
the reference, it jumps to a slightly wrong position because the
anchor is not in the problem.
the active counter, which it only is inside that environment. But
commands are different, generally speaking.
Speaking of which, I sometimes wonder if LyX shouldn't output:
\section{This is the section title}\label{sec:labelname}
rather than:
\section{\label{sec:labelname}This is the section title}
The label inside a moving argument just makes me worry, which is one
reason I don't put it there.
Moreover, when adding the label below the section heading, you cannot
benefit from LyX's automatic label naming. You get as proposal the
text behind the label, but you want of course the title of the section.
Attached is an example file.
Yes, of course, but I always delete what LyX suggests anyway.benefit from LyX's automatic label naming. You get as proposal the
text behind the label, but you want of course the title of the section.
Attached is an example file.
But also when you put the label behind the section heading, I don't
see a reason why its prefix should not be changed when the section is
made a subsection or something else.
It's asking for trouble to start changing things in paragraphs I haven'tsee a reason why its prefix should not be changed when the section is
made a subsection or something else.
changed myself.
Even changing a section to a subsection, you might not always want
the label to change.
The label shout not change, but is prefix. I mean the prefix is usedthe label to change.
to have a style for each reference type. So when you have two
different styles for sections and subsection, you of course want to
have the style of the subsection when changing a section into a
subsection. Currently you have to change the prefix manually which is
for larger documents a pain.
a section to something else. All the references to that label should
update automatically when the label itself is changed.
(There is a bug about this somewhere, but I haven't yet figured out
exactly what triggers it. I think maybe the label updating doesn't
always start from the master, but maybe just from the parent?)
What would really solve this is the "auto-label" feature we have
sometimes discussed, and which really ought not be that hard to
implement.
I missed this discussion. What it the idea of this?sometimes discussed, and which really ought not be that hard to
implement.
references to, say, sections, without the user having to put a label
there. LyX would automatically insert the label at output, presumably
with an appropriate prefix. OOo and similar programs do this kind of
thing. This could be extended to all kinds of things: Tables, figures,
theorems, etc.
Richard