summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/tlc2/indexexa.ltx
blob: 61823aa406b53ad07bab79697de533b719554155 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
\documentclass{article}
\setlength\textwidth{260pt}
\setlength\marginparwidth{90pt}
\usepackage{makeidx,showidx}
\newcommand\bs{\symbol{'134}}% print backslash
\newcommand\Com[1]{\texttt{\bs#1}%
                   \index{#1@\texttt{\bs#1}}}
\newcommand\Prog[1]{\texttt{#1}%
                    \index{#1@\texttt{#1} program}}
\makeindex
\begin{document}
\section{Generating an Index}
Using the \textsf{showidx} package users can
see where they define index entries.
\par Entries are entered into the index by the
\Com{index} command. More precisely, the argument
of the \Com{index} command is written literally into
the auxiliary file \texttt{idx}. Note, however, that
information is actually written into that file only
when the \Com{makeindex} command was given in the
document preamble.

\section{Preparing the Index}
To prepare the index for printing, the
\texttt{idx} file has to be transformed by an external
program, such as \Prog{makeindex}.
This program writes the \texttt{ind} file.
\begin{verbatim}
makeindex filename
\end{verbatim}

\section{Printing the Index}

During the final production run of a document the
index can be included by putting a \Com{printindex}
command at the position in the text where you want
the index to appear (normally at the end).
This command will input the \texttt{ind} file
prepared by the index processor and \LaTeX{} will
typeset the information.
\printindex
\end{document}