Edit Links |
Tips /
IndexingCategories: Index << | Page list | >>This page is for adding tips about writing an index. feel free to add to it. Note: A good starting point is the User's Guide, section 6.6, where index handling is described (also, many of the things described here are already documented in the User's Guide). Table of contents (hide) 1. LinksDiscussions on the users' list:
2. Index entriesIn LyX, index entries are added with Insert --> Index Entry. This will create a collapsible inset (similar to a footnote) that marks the index entry in your document. Click on that box to open and fine-tune your entry. In markup, you would have to write \index{foo}
for any entry that you want to appear in your index. Since LyX takes care of the \index command and the braces, you need to specify the 'foo' part only. Note: Most of what is described in what follows in supported without the need of these tricks as of LyX 2.4. Please consult the UserGuide for deatils! Here is a handy list of arguments you can put in LyX's index entry box, and of what they produce. To avoid struggling, it should be noted that:
The Index List is added to your document with Insert --> List/TOC --> Index List. This will create an Index box . If you want to modify the font face or font size of the printed index, select the Index box and then apply the desired font as usual in the Text Style dialogue. The index heading can be changed by adding the command \renewcommand{\indexname}{foo} to the preamble of your document, with ' With the KOMA classes, it is also possible to put a preamble right before the index entries. To do so, add \setindexpreamble{foo} to your document preamble. 3. Tips for creating indexes3.1 Multiple indicesIn some fields, it is common to have more than one index; for instance, in the field of law, one often needs a Table of Cases and Table of Statutes as well as a regular index. In the humanities, the index is often split into an index of terms (index rerum) and an index of names (index nominum). LyX 2.0 finally introduces native support for multiple indices (see http://wiki.lyx.org/LyX/NewInLyX20#indices). Using the Memoir class (LyX 2.0 to 2.4)Memoir's own index implementation is fundamentally incompatible with
In LyX:
You will now find an inset for name index entries in Insert→Custom Insets and an inset for the actual inset in Insert→List/Content/References. To change the header of the second index, put in TeX mode \renewcommand{\indexname}{Name Index} right before it If you want a different second index than a nameindex, adjust this accordingly. 3.2 Multiple indices with older versions of LyX (< LyX 2.0)In earlier versions (up to LyX 1.6.x), multiple indices require manual fiddling. Here is some short HowTo. a.) Using the Memoir classThis simple example is to add one new index called index2 with the Memoir class:
b.) Using other classesWith other classes, the splitindex package can be used. For example, we want to have an additional "Index of Names":
If you're running LyX 1.6, you can also use this module. Save it in the layouts folder of your personal LyX directory, run Tools>Reconfigure in LyX, restart and then select "Index of Names" from Document>Settings>Modules. Then you can insert entries to the Index of Names via Insert>Custom Insets>NameIndex. If you need a different (or an additional) Index, change the module file accordingly. 3.3 Nested Index Entries(Tip from Chris Lale.) Note: This feature is also described in the User Guide, section 6.6.2. Insert the index entries in the normal way
Separate the entry text from the sub-entry text with an exclamation mark ("!"). Insert the index list at the end of the document as usual.
For instance, these index entries
produce this index list
3.4 Semi-automatic indexingDespite the problematics of automatically generated indexes (see the discussion below), here's a package that allows you to do this, provided that you use XeTeX: http://tug.ctan.org/cgi-bin/ctanPackageInformation.py?id=xeindex 3.5 Emails from the thread that started this pageThis page was started from this thread. Below are some of the mails in the thread. Ed Sawicki: I love LyX but I dislike the way an index is created. The indexed words are turned into boxes on the screen that I find annoying. I'd also like a bit more automation to make indexing easier. I'm wondering whether I'm overlooking a capability in LyX and whether someone has already created a solution. If there's no other solution, here's what I plan: 1. When the book is finished, convert it to ASCII and LaTex. 2. From the ASCII file, create a word list that consists of all the words in the book. Pare this list down to only the words that should be indexed using some automation and manual inspection and editing. 3. Add phrases that should be indexed to the list. I'll have to maintain a list of phrases manually as I write the book. 4. Have a script automatically insert indexing markup into the LaTeX file. 5. Fix any problems with manual editing of the LaTeX file. 6. Use the marked up LaTeX file to print the final book. Whenever changes to the book are needed, I modify the LyX version of the book. When finished, I go to step 1. Jean-Pierre: Seems to me that a good index need more than simply indexing words and that index substructuring and typographic control is quite important, and should be made while writing. The contents of the index tags is quite important IMHO Helge Hafting: Be careful with "fully automated indexing". Indexing every page where some word occur usually makes for a poor index. It is easy, because all you need is to pick the words and let the computer do the rest. But the result is rarely good, as a normal text contain many indexable words in places people aren't interested in looking up. I've got the following advice on index creation: 1. Try to not index more than three locations for a word. People simply don't try 20 locations, so it is a waste *even* if all of them are equally relevant. There may be exceptions to this depending on what you're writing - this is the general advice. 2. Avoid foo:56,57,58,59 (or foo:56--59) Simply index the start of the range, people will go there and read through it. 3. Index only the important places a word is used. People looking in the index for "foo" want to find the important pieces about "foo", not everytime the word was used. This advice is more work and stands in the way of automation. Still, it usually results in better books. |