Georg Baum wrote:
Am Donnerstag, 1. Februar 2007 21:05 schrieb Abdelrazak Younes:

Why would a user put a label in the middle of the section title? LyX is about automatic formatting. It is about doing _the_ _right_ _thing_. There is no logic to put the label in the middle of the text for a
section.

So why is it a problem if putting a label in the middle of a section is not possible? This is actually a very good argument for disabling label insertion in sections :-)

No, you misunderstood me. I mean there is no reason why a user would prefer the label before, after or in the middle of the section; he should not care and this should be done automatically for him.


If inserting a label in a section is not possible, because the button is greyed out the user more likely sees that this was done on purpose.
I strongly disagree. It is very natural to insert a label when the cursor is inside a section. The label is a _markup_... the concept is not very far from the numbering of the caption labels. Do we have user complaining about not being able to change the section number by hand?
The answer is no because they learned about the LyX way.

But in contrast to section numbers labels need to be inserted manually, so there is a fundamental difference.

Unless we insert them automatically...


I really would prefer to educate the user rather than doing
undocumented
black magic (as I wrote here: http://bugzilla.lyx.org/show_bug.cgi?id=2154#c5).
This is not black magic. Or the automatic caption creation upon float creation is also "back magic" for example.

Yes, it is, and it annoyed me already a lot, because I always have to delete the caption before I can insert the contents of the float. It is simply my style of work to first insert the figure and later think about a caption (or not - not all figures need one).

This could easily be made configurable.


I could say the same for dEPM, automatic enumerate, etc.

dEPM is a border case, but automatic enumerate is definitely not something I would consider as black magic.

I would like to go even further and insert labels automatically upon section and caption creation. When we do that, we can even say bye-bye to this caption label.

That is something different IMHO: http://bugzilla.lyx.org/show_bug.cgi?id=1624 Being able to use cross references without knowing how the LaTeX label mechanism works would be very nice.

Indeed. I think that using "special automatic labels" is the way to go here.

However, if a user needs to insert a label manually this should be straightforward without surprises.

Of course.


Fact is that labels in sections do not always work in LaTeX. If we meet LaTeX restrictions, we usually do one of two things:

1) Generate LaTeX code to overcome them. An example for this is the fix for footnotes in tables that I have in my personal branch. 2) If we are not able to do 1), forbid the creation of constructs that would lead to invalid LaTeX code. An example for this are multiple paragraphs in table cells.

I do not see any reason to do it differently in this case. In fact, if 1) would be possible I would prefer it over disabling the labels.

If we do the automatic label, I would agree to do 2). In fact 1) will also be done in a way because we will insert the label at the right place automatically in the LateX export.

In the mean time, I still think that my commit is an improvement over current situation. It is nice to say that we should educate the user but, IMHO, the less thing he has to learn in order to use LyX, the better.

What do others think?

Abdel.

Reply via email to