stephan beal wrote:

@lyx developers,

i'd look at doing this fix myself, but i'm on a dialup line, paying for each minute online, and the lyx tarball is 5M+.

For the Qt interface, it seems it would be trivial to fix the Index Item entry dialog to automatically escape any illegal characters, like "_".

Careful now. _Only_ autoescaping will render impossible all
the stuff we do today with _ and | and \ and so on when writing index entries.
(All the symbols that gave you grief is usable in indexes - they are very useful
when used right! ) Of course autoescaping is ok _if_ some other way
is provided for accessing the advandec functionality of makeindex.


Note that _ and \ is equally troublesome/useful in the main tex - but it is autoescaped
there, and the ERT box is available for those who need it.


The ideal solution is an index entry that allow most of the stuff that works
in the main text (except for sectioning and floats). In other words:
* Escape special symbols the user just types in, as is done for the main text
* Allow math editor in an index entry (My book on algorithm complexity
have an index entry for $\Omega$, for example. A math paper might
index lots of formulas. Chemistry uses _ a lot in formulas too.
* Allow formatting like emphasize, bold and "character styles" inside an index entry,
and translate to the mechanism makeindex uses for this. This would save a lot
of latex currently used to get bold/emphasized index entries.
* Allow ERT boxes inside index entries so experts still can do everything latex
can do.
* Perhaps let the index entry GUI have special support for some things, like:
- the "'see' something else" index entry
- the mechanism for special formatting of the page number, by providing a
separate field with the text "pagenumber" so the user can use the ordinary
editing GUI to create bold/emphasized/colored numbers.
- GUI mechanisms for specifying ranges so we get entries like
entry: 5,7,8-12,76-233,314
- GUI mechansim for dealing with cases when sort order and
presentation is very different. This is important in many cases, for
example when indexing math. (I put my $\Omega$ index both among symbols
(correctly placed in relation to other greek stuff) as well as alphabetically where
the word "Omega" would go.


Doing _all_ of this is probably a lot of work. If you implement autoescaping,
possibly by reusing autoescape code used for main text, then at least the
ERT inside an index entry is necessary. Expert users can then kludge all
the rest in ERT, similar to how they now kludge it in todays index entries. The rest
can then come with time.


The fact that the dialog allows one to enter invalid data has caused me NO END of grief. Adding a single underscore to one index entry causes errors in completely unrelated parts of the doc when exporting, and tracking down the problem is really difficult (as is shown by my frustrated posts on the topic), especially since Idx entries aren't visible until clicked on (maybe an Expand/View Index Entries option, like the one for Footnotes, is feasible?).

The current system could use some warnings as well as a reference to
litterature on makeindex syntax . . .

IMO a dialog box should not allow you to enter data which is itself illegal for the program the dialog is serving, especially when it *silently* does so.


Well, a _ is a perfectly legal character in an index entry, when used
right.  Example index entries that works fine:
foo\_bar
$C_2H_5OH$-(ethanol)

I agree that the current way is not userfriendly, but don't _remove_
existing possibilities just to make your own case easier.

Helge Hafting

Reply via email to