(eplain.info)Indexing


Next: Justification Prev: Equation references Up: User definitions
Enter node , (file) or (file)node

4.12 Indexing
=============

Eplain provides support for generating raw material for an index, and
for typesetting a sorted index. A separate program must do the actual
collection and sorting of terms, because TeX itself has no support for
sorting.

   Eplain can create hypertext links pointing from the index to the
index terms (Note: Index hyperlinks).

   Eplain's indexing commands were designed to work with the program
MakeIndex, available from CTAN hosts in
'tex-archive/indexing/makeindex'; MakeIndex is also commonly included in
prepackaged TeX distributions. It is beyond the scope of this manual to
explain how to run MakeIndex, and all of its many options. See
<http://www.ctan.org/tex-archive/indexing/makeindex>.

   The basic strategy for indexing works like this:

  1. For a document 'foo.tex', Eplain's indexing commands (e.g., '\idx';
     see the section 'Indexing terms' below) write the raw index
     material to 'foo.idx'.

  2. MakeIndex reads 'foo.idx', collects and sorts the index, and writes
     the result to 'foo.ind'.

  3. Eplain reads and typesets 'foo.ind' on a subsequent run of TeX. See
     the section 'Typesetting an index' below.

The 'texi2dvi' program can help you automate this process (Note:
Invoking Eplain).

   If your document needs more than one index, each must have its own
file. Therefore, Eplain provides the command '\defineindex', which takes
an argument that is a single letter, which replaces 'i' in the filenames
and in the indexing command names described below. For example,

     \defineindex{m}

defines the command '\mdx' to write to the file 'foo.mdx'. Eplain simply
does '\defineindex{i}' to define the default commands.

   Note that MakeIndex does not use the above naming scheme for multiple
indexes. Unless instructed otherwise, MakeIndex always writes its output
to a file with extension '.ind'. For example, if you define an
additional index with the command '\defineindex{j}', you'll need to run
MakeIndex like this:

     $ makeindex book.jdx -o book.jnd

   For each index defined with '\defineindex{N}', Eplain provides a
switch '\ifNdx' which controls whether indexing commands write index
entries to the corresponding index file. However, even when index term
writing is disabled, indexing commands still do all other processing of
their arguments, including typesetting of proof index terms (Note:
Proofing index terms.

   For example, if you write '\idxfalse' near the beginning of a
document 'foo.tex' (before the first indexing command), Eplain will not
open the default index file ('foo.idx') and the corresponding indexing
commands ('\idx', '\sidx', etc.) will not write index entries there.
This may be useful for draft compilations of a manuscript, e.g., to
avoid the overhead of index file input/output.

Indexing terms
Specifying what to index.
Typesetting an index
Printing the sorted output.
Customizing indexing
Creating commands and specifying extra actions.

automatically generated by info2www version 1.2.2.9