#53 add equation in index error

closed-invalid
None
5
2013-03-30
2013-03-29
Hadi Safi aghdam
No

hello
i attach sample file.
1- when i add \index{$\alpha$}, i get error:
ERROR: CHAR: index 0 should be less than the length of the string

2-1- when i add ‎\index{$\| \cdot \|$}‎, i get error:
line 1: multiple |'s
WARNING: unknown attribute ` \cdot \$'! (ignored)

2-2- when i add \index{$\left \vert \cdot \right \vert $}‎‎, (\ change \| to \vert ) i dont get error.
what is mistake?
please help me and other that have this problem. very thanks....
i am from forum.parsilatex.com. (Iranian tex user group that produce persian packages for latex and xelatex and lualatex , ... by dr. vafa khalighi)

Discussion

  • sample file, log file, ind , idx , ... files

     
  • Joachim Schrod
    Joachim Schrod
    2013-03-30

    Placing formulas will never work out of the box - there is no defined order where formulas should be placed in an index. Should they be placed in the Symbols group, or should they be placed in an own group? If the latter, one has to define that group and merge rules or use explicit sort keys that place the formulas in that group and spell out how they are to be sorted.

    In particular, your issues:

    1. xindy ignores $, knowing that this is a special character for TeX. It also ignores unknown macros or macros where it's unclear where to place them in an index. Among these are all math characters. That means that \index{$\alpha$} is equivalent to \index{}, i.e., it is an empty index entry. Empty index entries cause the error message that you've received. If you want to put formulas in an index, you need to tell xindy where to put them, i.e., where to sort them - usually that's done by an explicit sort key: you add @ to the entry and after the @ you put the characters that shall be used for sorting.

    2.1 The vertical bar | in an index entry separates the index key from the index attribute. If you want to put it in an index, you need to use "| (that's a double quote in front of the vertical bar). That is described in all LaTeX manuals, it's the almost the same as with Makeindex; you should find users in your forum that can help you here.

    2.2 outputs the same error message as case 1, for the same reasons.

    This is no bug, but a misunderstanding how xindy works. Therefore I close this ticket. Please note that this bug ticket system is not a help forum. Often such xindy questions are answered on tex.stackexchange.com, or on the newsgroup comp.text.tex. Or they may be sent to the xindy mailing list, although that list doesn't have much subscribers.

     
  • Joachim Schrod
    Joachim Schrod
    2013-03-30

    • assigned_to: nobody --> jschrod
    • status: open --> closed-invalid