# Welcome to Al-gul

The Middle East and More

## LaTex Indexing Tips–Fix Ascending Sub-Entries

1. If you are creating an index in LaTex where there will sub-entries, keep in mind that the order of the sub-entries must be descending so that they display properly.  So the syntax is

\index{c!b!a}
or
\index{Civil War!Battles!Gettysburg}
and not the other way around.
2. To create the index you must:
a. Run LaTex (or XeLaTex, or PDFLaTex or whatever engine you prefer)
b. Run makeindex (from the command line if your LaTex front-end doesn’t support it)
c. Run LaTex again.
While these two points are pretty basic, I did not find them displayed clearly while rummaging around in the documentation.
Finally, if like me you indexed a long document putting the sub-entries in the wrong order, I can post a Python script that will fix things. Thanks to Tizen on Fiverr.com!

Written by mokane

March 25, 2013 at 7:30 am

Posted in Uncategorized