On Fri, 21 Sep 2007, Helge Hafting wrote:

[EMAIL PROTECTED] wrote:
 On Tue, 18 Sep 2007, Yann Disser wrote:

> It would be nice if you considered implementing the possibility of > cross-referencing to sections etc without the need of inserting ugly > labels - the use of labels should in my opinion be reduced to an > absolute minimum. My works are often full of labels for > cross-referencing to other parts of themselves (and equations and > figures and tables etc). This makes the text less readable.

 Similar issues were discussed a while back. So as a user, I think your
 input would be appreciated. What's your tought on thinks like these:

 * Is the problem that the labels are shown, or that they exist?

For me, the problem is the hassle of having to insert them. This is very occationally useful.

Hi Helge,

I agree, having to insert and having to come up with a name.

<snip>

No need - make LyX work (mostly) without inserted labels. LyX can autogenerate a latex label during latex code export, when some entity happens to have a reference.

I haven't thought about it yet, but would this work with a multi-file document? Isn't it a problem if label names are regenerated all the time? I'm also worried about "silent errors", where a reference suddenly goes to a completely different label that suddenly happens to have matching name.

 * How do you envison a user referring to a section? This is the case
   when cross-referencing it without (exlicitly) using a label.

Insert->reference, using the normal dialog. But now the dialog will list every referable entity in the entire document. I.e. all headings, enumerations and so on.

Hmm... I'm not sure how you'd "list" an entity such as an enumeration..?

When I asked the question, I actually had another idea that I didn't mention so as to be impartial. The user would have the dialog for inserting references open, but be able to navigate the document and 'drag' a label into the document at the desired location. Alternatively, he could place the cursor at the desired location and press a button in the dialog that says something like "Insert label at cursor location".

With a ToC dialog automatically popped up, I was hoping that navigating to a specific section would be very quick. To be really useful, the name of the label should be created automatically.

 * Is it problematic having to come up with "names" for the labels?

 * If labels are generated automatically, how should they get their
   "name"?

A LyX user won't see the label name at all, so it doesn't matter much. For the benefit of latex users, perhaps some simple scheme based on category, i.e. sect1, sect2, subsect5, part9, enum12, formula67, ...

 * What should happen if for instance a label is automatically inserted
   in a section heading based on the title of that heading, and the
   heading is subsequently deleted?

You can do that today with manual labels, and LyX will then leave a xref to a label that doesn't exist. Latex will then print "??". I wouldn't want auto-deletion of the xref, as I might want to paste that heading somewhere else and still have it referenced.

I don't understand:
        as I might want to paste that heading somewhere else and still
        have it referenced.

Does this imply that the hidden label in the part that was cut should keep it's automatically generated label?

   Or even worse, if that section is deleted and another section is
   created later that happen to have the same heading?

I think an auto-label should behave very much like an explicit label, except that you don't actally see it. Well, LyX could put a tiny label icon in the margin next to the heading to indicate the fact. It might be useful, and won't clutter up the main window.

A small icon is a good idea. Then, clicking on this icon could take you to the cross reference. Or pop up a dialog with several cross references to choose from.

So, if the section is deleted, the label dies with it. If it is pasted once, then the autolabel is pasted too. If it is pasted more, then LyX should refrain from creating an identical label. The easy way is to just drop the label then. The advanced way will be to check if a reference exists inside the pasted content, and then create a new label/reference pair. (Similiar to how spreadsheets paste formulas with cell references.) But this part can wait, it is only UI refinement.

Finally, if a section is created manually with identical text to some previous section, then of course no label is created.

I think the user might get a bit confused in this last example. What about the following scenario:

* I have a section 'A' that I refer to from section 'B'.
* I remove section 'A'.
* I (manually) write a new section 'A' with the same text, perhaps
  in a new location.

There is now a xref in section B that's not working. I click on it and ... what will the dialog tell me? To where is it referring? If the label name can somehow be used to infer that it points to 'A', I might be even more confused as this may or may not still be correct.

Best regards
/Christian

--
Christian Ridderström, +46-8-768 39 44               http://www.md.kth.se/~chr

Reply via email to