Next: Examples
Prev: Cross_references
Up: notation-tut
Top: Top
0.2.5. Indexing
[APRIL91: changes are envisaged; see section See multiple-indexes.]
Indexing is assumed to work with the program
`makeindex', so you should put a
a `\printindex' command where you want the
index to appear (almost always just before `\end{document}').
(A LaTeX `\makeindex' command is supplied
automagically before `\begin{document}'.)
Roughly speaking, code portions of your document are automatically
indexed, and then you index the text portion manually, with
`\index' commands.
`\index{<entry text>}' is the basic indexing command and offers a
simplified `makeindex' interface.
- • If you want just plain simple "foo" to appear in the index, use
`\index{foo}'.
- • If you want subitems in an index entry, separate them with `!'s
[useful].
- • If you want separate text for sorting and printing an index entry, put
the two texts in that order, separated by an unescaped `@'.
- • To put a `!' or `@' in your index entry, escape it with a
backslash `\'.
- • All other (semi-normal) characters work as is.
I don't encourage trying to have index entries pop out in different
fonts -- it doesn't work in plain Info files. You can write devious
LaTeX/`makeindex' code on your own...
Code-stuff in text (stuff inside `@...@') is indexed automatically,
just like "real code". What actually happens depends on the support
for your programming language -- section See Language_specific gives
all the language-specific indexing idiosyncracies. The default
bare-bones mechanism is that whitespace-free code-in-text over three
characters long (e.g., `@typecheck@') will generate an index entry.
To suppress automatic indexing of a piece of code-in-text, put a
`\noindex' immediately following, as in
`@typecheck@\noindex'.
As mentioned in section See magic-things-in-code, you can add
index entries for your code by inserting specially-formatted comments
(this depends on how well your programming language is supported).
For example, for Haskell, you might use [NB: NOT IMPLEMENTED YET (ToDo?)]:
For a chunk of code, a mini-index pointing to the definitions of the
things it refers to (one possible definition of "things:" top-level
functions) will be produced right after the code. (For the Info file,
as part of the menu for that node.)
COMMENT:-----------------------
The Info part is done; I'm still thinking about what should be done
for LaTeX.
-------------------------------
[APRIL91: this is one of the things contemplated in
section See multiple-indexes.]
At least some provision has been made for "stop lists" for the
automagical indexing (I'm not sure how well it works...). You put
words/strings that are normally picked up by the indexing into a file,
then tell the system this is your "stop list file" (`-s' option,
I think), meaning "Don't index these things -- I'm not interested."