Abdelrazak Younes wrote:

> 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.

This is your opinion. But as you can see from Enricos answer users may want
to place the label exactly where they want, even if another place would be
equivalent.

>>>> 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...

But we do not. And it is not 100% clear to me how the best fix for bug 1624
would look like. Please don't justify existing code with a hypothetical
extension.

>>> 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.

Maybe, or solved otherwise, but I don't want to open another discussion now.

>>> 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.

I am not sure if that is the best way. For example, what happens if a user
wants to delete a section that is referenced somewhere? If there is a real
label inset (which may have been created automatically, but otherwise is
not special at all) he sees that there might be a reference. If we had a
special automatic label we would have to show this somehow. And we would
need a file format change, because we would need to store these labels
somehow in the file.
As I wrote above I am not sure how the best solution would look like.
Currently I prefer this one:
In the Cross reference dialog, list in addition to existing labels all
sections, figures etc. (maybe in different lists). If the user chooses to
reference such a section, insert a normal label in that section und use
that. Then the user can for example change the automaticially generated
label later if he does not like the automatically generated text.

>> 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.

I don't understand. If we do 2) there will simply not be any label in a
position that does not work with latex.

> 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 we both did not take into account is that labels are not always
forbidden in sections, and that people like Enrico who probably never
writes hungarian want to put them in sections. This was possible before,
but is not possible now anymore.


Georg

Reply via email to