summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/robustindex/robustsample.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/robustindex/robustsample.tex')
-rw-r--r--Master/texmf-dist/doc/latex/robustindex/robustsample.tex60
1 files changed, 37 insertions, 23 deletions
diff --git a/Master/texmf-dist/doc/latex/robustindex/robustsample.tex b/Master/texmf-dist/doc/latex/robustindex/robustsample.tex
index 9e88837557c..14cf57ea1ec 100644
--- a/Master/texmf-dist/doc/latex/robustindex/robustsample.tex
+++ b/Master/texmf-dist/doc/latex/robustindex/robustsample.tex
@@ -25,18 +25,21 @@
\chapter*{Preface}
\addcontentsline{toc}{chapter}{Preface}
\markboth{Preface}{Preface}
+This file illustrates some features of the \verb!robustindex! package.
+
+Although this is not a book, we have chosen the book style for illustration.
+
We will recall the purpose of \verb|robustindex.sty| in appendix
\ref{purpose}.
-Although this is not a book, we have chosen the book style for illustration.
If you want to see how \verb|robustindex.sty| may be used, compare the file
\verb|robustsample.tex| or appendix \ref{appendix} with the output.
If you are interested in our usage of \verb|robustglossary.sty|, you must read
-the file \verb|robustsample.tex|.
+the source file \verb|robustsample.tex|.
-This preface has an \emph{indexed term}.\index{indexed term}
+This preface has an \emph{indexed term}.\index{indexed term} (You see this in the source file only.)
% Let us pretend this page explains $\mathrm{Ext}^i_B(M,N)$.
\glossary{$\mathrm{Ext}^i_B(M,N)$&Ext group in the category $\mathcal C_B$}
@@ -60,13 +63,15 @@ Of course the index file {\it filename}.\texttt{ind}
may be edited to remedy such flaws. Such editing will actually be the
recommended way to achieve more complicated effects like the page ranges on
page \pageref{range}, which also use several fonts in their page numbers.
+That is actually bad style, but this file just illustrates features.
Traditionally page ranges and fonts for page numbers could be done with the
encapsulating construction of makeindex, but that construction is broken by our
package.
(The encapsulating construction uses the encap character $|$ in the argument of
\verb|\index|.)
-We have restored it to some extent, sufficient for common practice,
+
+We have restored encapsulating to some extent, sufficient for common practice,
but our rules are more naive than those of makeindex.
See the file \verb|robustsample.tex| for details.
@@ -112,9 +117,9 @@ because of the roman page numbers in the beginning.
% 2. One of the brackets "(" or ")", or one of those brackets followed by
% a sequence as in type 1.
% Any "(" must be matched by its ")", and this ")" must occur in a later
-% \index command that shares the part before the "|". No intervening \index
-% command may have this same part before the "|".
-% So here we deviate from makeindex.
+% \index command that shares the part before the "|".
+% If an intervening \index command has this same part before the "|",
+% then it does not appear in the index.
%
% Makeindex also attaches special meanings to @, !, ". These meanings stay,
% but " can no longer be used to escape |. One must simply replace | with
@@ -126,10 +131,17 @@ because of the roman page numbers in the beginning.
% The name "risky" of the subentry is used for sorting by makeindex, and will
% not be printed.
%
+%
\index{page range|(textbf}%
-% This belongs to the entry "page range". The previous
+% This belongs to the entry "page range" in the index. The previous
% \index command started a subentry of this entry.
%
+% The next three index commands do not contribute, as they occur
+% before the page range is ended.
+\index{page range!risky@this $\vert$is$\vert$ complicated|textbf}%
+\index{page range!risky@this $\vert$is$\vert$ complicated}%
+\index{page range!risky@this $\vert$is$\vert$ complicated|textbf}%
+%
\index{simpler!page range|(}%
\index{simplest page range|(}%
% encapsulating to be continued below
@@ -142,7 +154,7 @@ because of the roman page numbers in the beginning.
\usepackage{makeidx}
\usepackage{robustindex}
...
-...\index{Wilberd}} % on page i
+...\author{Wilberd van der Kallen\index{Wilberd}}
...
\makeindex % obligatory with robustindex
@@ -158,26 +170,25 @@ because of the roman page numbers in the beginning.
\index{alpha!see also gamma\gobblepageref} % on page 5
...
% For special effects you could simply edit filename.ind
-% If you insist on using encapsulation,...
-\index{...|...}... % on page 5
+% We illustrate our poor man's encapsulation.
+\index{...|...}... % on page 6
\index{...|...}... % on page 7
\index{...|...}... % on page 9
....
-\indexincontents % always put this before the index.
+\indexincontents % before the index.
\printindex
\end{document}
\end{verbatim}
% continuation of encapsulating
-%
+% We close a page range, but now the page number is in italic.
+% This is bad style, but we are just illustrating a feature.
\index{page range!risky@this $\vert$is$\vert$ complicated|)textit}
% encapsulating to be continued below
\chapter{Purpose of \texttt{robustindex.sty}}\label{purpose}
-The package \texttt{robustindex} tries to remedy two problems.
-\begin{itemize}
-\item Amazingly often a third party changes the page numbers without rerunning
+Amazingly often a third party changes the page numbers without rerunning
makeindex. It is much nicer to have an index that adapts itself to all
changes that do not involve
\verb|\index{|\textit{entry}\verb|}| commands.
@@ -191,11 +202,6 @@ command, or after changing the order of \verb|\index{|\textit{entry}\verb|}|
commands, does one have to run makeindex. But then it is important that you
do run makeindex, even when no warning is issued. The robustness has its
limits.
-\item The \texttt{theindex} environment lacks a destination for hyperlinks.
-That is a nuisance when one wants add the index to
-the bookmarks or to the table of contents in a pdf file: When one clicks on the
-link that displays the word Index, one wants to end up in the index.
-\end{itemize}
% continuation of encapsulating
%
@@ -203,7 +209,7 @@ link that displays the word Index, one wants to end up in the index.
\index{page range!risky@this $\vert$is$\vert$ complicated|texttt}
%
\index{page range!with risky label\label{range}}
-%
+% This label actually works and was used above in a \pageref{range} command.
%
\index{simpler!page range|)}%
\index{simplest page range|)}%
@@ -255,6 +261,14 @@ C_B$}
\end{theglossary}
-\indexincontents % always put this before the index.
+% If you want the index in the table of contents, you may do
+%
+% \clearpage
+% \phantomsection
+% \addcontentsline{toc}{chapter}{\indexname}
+%
+% We have a command for this:
+
+\indexincontents % before \printindex
\printindex
\end{document}