Go to the first, previous, next, last section, table of contents.

Typesetting an index

The command \readindexfile{i} reads and typesets the `.ind' file that MakeIndex outputs (from the `.idx' file which the indexing commands in the previous sections write). Eplain defines a number of commands that support the default MakeIndex output.

More precisely, \readindexfile reads \indexfilebasename.index-letternd, where the index-letter is the argument. \indexfilebasename is \jobname by default, but if you have different indexes in different parts of a book, you may wish to change it, just as with bibliographies (see section Citations).

MakeIndex was designed to work with LaTeX; therefore, by default the `.ind' file starts with \begin{theindex} and ends with \end{theindex}. If no \begin has been defined, Eplain defines one to ignore its argument and set up for typesetting the index (see below), and also defines a \end to ignore its argument. (In a group, naturally, since there is a primitive \end).

Eplain calls \indexfonts, sets \parindent = 0pt, and does \doublecolumns (see section Multiple columns) at the \begin{theindex}. \indexfonts does nothing by default; it's just there for you to override. (Indexes are usually typeset in smaller type than the main text.)

It ends the setup with \hookrun{beginindex}, so you can override anything you like in that hook (see section Hooks). For example:

\hookaction{beginindex}{\triplecolumns}

MakeIndex turns each main index entry into an \item, subentries into \subitem, and subsubentries into \subsubitem. By default, the first line of main entries are not indented, and subentries are indented 1em per level. Main entries are preceded by a \vskip of \aboveitemskipamount, 0pt plus2pt by default. Page breaks are encouraged before main entries (\penalty -100), but prohibited afterwards--Eplain has no provision for "continued" index entries.

All levels do the following:

\hangindent = 1em
\raggedright
\hyphenpenalty = 10000

Each entry ends with \hookrun{indexitem}, so you can change any of this. For example, to increase the allowable rag:

\hookaction{indexitem}{\advance\rightskip by 2em}

Finally, MakeIndex outputs \indexspace between each group of entries in the `.ind' file. Eplain makes this equivalent to \bigbreak.


Go to the first, previous, next, last section, table of contents.