\sidx{term}[subterm]
makes an index entry for
term, optionally with subterm subterm.
\idx{term}
also produces term as output. Example:
\sidx{truth}[beauty of] The beauty of truth is \idx{death}.
\idxnameseparator
.
\idxname{First M.}{von Last} also produces First M. von
Last as output. (These commands are useful special cases of \idx
and \sidx
.) Example:
\sidxname{Richard}{Stark} \idxname{Donald}{Westlake} has written many kinds of novels, under almost as many names.
\sidxmarked\cs{term}[subterm]
makes an index
entry for term[subterm]
, but term will be put
in the index as \cs{term}
, but still sorted as just
term. \idxmarked\cs{term}
also typesets
\cs{term}
. This provides for the usual ways of changing
the typesetting of index entries. Example:
\def\article#1{"#1"} \sidxmarked\article{Miss Elsa and Aunt Sophie} Peter Drucker's \idxmarked\article{The Polanyis} is a remarkable essay about a remarkable family.
\sidxsubmarked{term}\cs{subterm}
makes an index
entry for term, subterm as usual, but also puts subterm in
the index as \cs{term}
.
\idxsubmarked{term}\cs{subterm}
also typesets
term \cs{subterm}
, in the unlikely event that your
syntax is convoluted enough to make this useful. Example:
\def\title#1{{\sl #1}} \sidxsubmarked{Anderson, Laurie}\title{Strange Angels} The \idxsubmarked{Anderson}\title{Carmen} is a strange twist.
The commands above rely on MakeIndex's feature for separating sorting of
an index entry's from its typesetting. You can use this directly by
specifying an index entry as sort@typeset
. For
example:
\sidx{Ap-weight@$A_\pi$-weight}
will sort as Ap-weight
, but print with the proper math.
The @
here is MakeIndex's default character for this purpose.
See section `Style File-MakeIndex' in MakeIndex. To make an index
entry with an @
in it, you have to escape it with a backslash;
Eplain provides no macros for doing this.
After any index command, Eplain runs
\hookaction{afterindexterm}
. Because the index commands always
add a whatsit item to the current list, you may wish to preserve a
penalty or space past the new item. For example, given a conditional
\if@aftersctnhead
set true when you're at a section heading, you
could do:
\hookaction{afterindexterm}{\if@aftersctnhead \nobreak \fi}