diff options
author | Karl Berry <karl@freefriends.org> | 2017-09-13 22:07:57 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-09-13 22:07:57 +0000 |
commit | 09386405a3f7b1064ac18e3b15094fd0104fe562 (patch) | |
tree | 74ee524b51b646f6b349883d40517f7ac8295196 /Master/texmf-dist/doc/latex/robustindex | |
parent | b82d4c39f1b663053307ba40a6044a5176697a7b (diff) |
robustindex (14sep17)
git-svn-id: svn://tug.org/texlive/trunk@45294 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/robustindex')
-rw-r--r-- | Master/texmf-dist/doc/latex/robustindex/README.md | 5 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/robustindex/multisample.pdf | bin | 0 -> 187903 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/robustindex/multisample.tex | 347 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/robustindex/robustmanual.pdf | bin | 103616 -> 109222 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/robustindex/robustmanual.tex | 37 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/robustindex/robustsample.pdf | bin | 178667 -> 178667 bytes | |||
-rw-r--r-- | Master/texmf-dist/doc/latex/robustindex/stind.html | 11 |
7 files changed, 398 insertions, 2 deletions
diff --git a/Master/texmf-dist/doc/latex/robustindex/README.md b/Master/texmf-dist/doc/latex/robustindex/README.md index 542ee83337a..4fba9984300 100644 --- a/Master/texmf-dist/doc/latex/robustindex/README.md +++ b/Master/texmf-dist/doc/latex/robustindex/README.md @@ -1,4 +1,4 @@ -Package robustindex.sty, Wilberd van der Kallen Feb 2017. +Package robustindex.sty, Wilberd van der Kallen 2017. This package uses \pageref to ensure that the page numbers in the index are synchronous with the manuscript, even when a third party changes the page numbers and fails to @@ -8,6 +8,9 @@ Package robustindex.sty, Wilberd van der Kallen Feb 2017. https://www.staff.science.uu.nl/~kalle101/stind.html + There is an option multind for multiple indices with pagerefs. + It uses just one index file and disables even more features of makeindex. + % Copyright 2005, 2017 Wilberd van der Kallen % % This file may be distributed under the conditions of the LaTeX Project Public diff --git a/Master/texmf-dist/doc/latex/robustindex/multisample.pdf b/Master/texmf-dist/doc/latex/robustindex/multisample.pdf Binary files differnew file mode 100644 index 00000000000..e4a1084a034 --- /dev/null +++ b/Master/texmf-dist/doc/latex/robustindex/multisample.pdf diff --git a/Master/texmf-dist/doc/latex/robustindex/multisample.tex b/Master/texmf-dist/doc/latex/robustindex/multisample.tex new file mode 100644 index 00000000000..39e57112dff --- /dev/null +++ b/Master/texmf-dist/doc/latex/robustindex/multisample.tex @@ -0,0 +1,347 @@ +% multisample.tex +\documentclass{book} + +\usepackage{makeidx} +\usepackage[multind]{robustindex} +\usepackage{robustglossary} +\usepackage[plainpages=false,hyperindex=false]{hyperref} + + +\title {A file with several indexes} + +\author{Wilberd van der Kallen\index{Wilberd}} +\date{2017} + +\makeindex % obligatory with robustindex +\makeglossary % obligatory with robustglossary +\begin{document} + +\renewcommand\thepage{\roman{page}} + + +\setindex{b1} + + +\maketitle + +\tableofcontents +\addcontentsline{toc}{chapter}{Contents} + + + + +\chapter*{Preface} + +\addcontentsline{toc}{chapter}{Preface} +\markboth{Preface}{Preface} +This file illustrates some features of the \verb!robustindex! package with option \verb!multind!. This option + supports multiple indexes, albeit in a plain style only. + +Although this is not a book, we have chosen the book style for illustration. +Let us say we want to use four indexes. First we choose tags to identify them. +In this file we use the tags \verb|main|, \verb|bis|, \verb|a1|, \verb|b1|. +With the \verb!\setindex! command we activate an index. +Thus \verb!\setindex{main}! tells \LaTeX\ that the active index is now the index identified by the tag +\verb|main|, until the next \verb!\setindex! command. If a tag has not been encountered +before, then a new index with that tag is created. The tag \verb|main| is always known and +the index with tag \verb|main| becomes active at the \verb|\begin{document}|. +The \verb!\index! command and +the \verb|\printindex| commands write to/from the active index. +This is all you need to know about the option \verb!multind!.\\ + +If you wish you may use \verb!\sindex[bis]{!\emph{entry}\verb!}! as shorthand for\\ + +\hspace{5em} \verb!\setindex{bis}\index{!\emph{entry}\verb!}!\\ + +and \verb!\sindex{!\emph{entry}\verb!}! as shorthand for\\ + + \hspace{5em} \verb!\setindex{main}\index{!\emph{entry}\verb!}!.\\ + + +To see how option \verb|multind| may be used, you may also compare the file +\verb|multisample.tex| with the output. + +This preface has an \emph{indexed term}.\setindex{b1}\index{indexed term} (You see this in the source file only.) + +\chapter{Introduction}\sloppy +\renewcommand\thepage{\arabic{page}} +\addtocounter{page}{-2}% Just to get overlap in roman and arabic page numbers. +This introduction has another indexed term +\setindex{a1} +\index{other term!cited twice on same page}% +as well as the old indexed term.\setindex{b1}\index{indexed term} +The page number is again 5, but now in arabic. +If you index the same term twice on the same page, then one simply gets +a repeat in the index.\setindex{a1}\index{other term!cited twice on same page} +That is inherent in our method. +Indeed we had to disable the implicit page range formation of makeindex. + +Of course the index file {\it filename}.\texttt{ind} +may be edited to remedy such flaws, but our hacking has made this file pretty unreadable. +Use the option \verb!multind! only if you are willing to keep the indexes simple. Even without editing the index file +one may create complicated effects like the page ranges on +page \pageref{range}, which use several fonts in their page numbers. +That is bad style, but it is possible. Note that if you open a page range you must close +it again with the same index active as when you opened the range. + +We have hacked various mechanisms of makeindex. +Subentries are still supported. We illustrate this in +\verb|multisample.tex| and appendix \ref{appendix} with alpha, beta and gamma. +This also illustrates the use of \verb|\gobblepageref|. +\setindex{a1}\index{alpha!see beta} +\index{alpha!see also gamma\gobblepageref} + +After running \LaTeX\ on {\it filename}.\verb!tex! one must run makeindex on {\it +filename} to get the index entries in {\it filename}.\texttt{ind}. +Before this there may be error messages about labels or names. +Do not exclude any relevant files. For instance, do not use +\verb|\includeonly|. + +The package \verb|hyperref| may break our code. Therefore +one must use the option +\verb|hyperindex=false|, as in +\verb|\usepackage[hyperindex=false]{hyperref}|. +Note that \verb|robustindex| already puts +hyperlinks in the index. Alternatively one may go against the advice of +\verb|hyperref| and put \verb|robustindex| later in the preamble. +In the file \verb|multisample.tex| we actually used +\verb|\usepackage[plainpages=false,hyperindex=false]{hyperref}| +because of the roman page numbers in the beginning. + +\setindex{b1}\index{page range!risky@this $\vert$is$\vert$ complicated|(textbf}% +\index{page range|(textbf}% +\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|(}% + +\appendix +\chapter{Structure of the \LaTeX\ file}\label{appendix} +\begin{verbatim} +\documentclass{book} + +\usepackage{makeidx} +\usepackage[multind]{robustindex} +... +...\author{Wilberd van der Kallen\index{Wilberd}} +... +\makeindex % obligatory with robustindex + +\begin{document} +... +\tableofcontents +...\index{indexed term} % on page v +... +...\index{other term!cited twice on same page} % on page 5 +...\index{indexed term} % on page 5 +...\index{other term!cited twice on same page} % on page 5 +... +\setindex{a1}\index{alpha!see beta} % on page 5 +\index{alpha!see also gamma\gobblepageref} % on page 5 +... +... +\indexincontents % before the index. +\setindex{main} +\printindex + +\renewcommand{\indexname}{Index bis} +.... +\end{document} +\end{verbatim} + +\index{c1int@as! t@is} + +\index{998b@998} + +\index{997b@tris} + +\setindex{main}\index{alpha} + +\setindex{a1}\index{gamma} + +\setindex{bis}\index{bis} + +\setindex{main}\index{hier@vardelta} + +%\setindex{main}\index{hier@animal!than@fish} +\setindex{main}\index{hier@animal!than@fish} + +\setindex{main}\index{hier@animal!ruminant!cow} + +\setindex{main}\index{time!here@now} + + +\setindex{b1}\index{page range!risky@this $\vert$is$\vert$ complicated|)textit} + +\chapter{Purpose of \texttt{robustindex.sty}}\label{purpose} +Amazingly often a third party changes the page numbers without rerunning +makeindex. It is much nicer to have indexes that adapt themselves to all +changes that do not involve +\verb|\index{|\textit{entry}\verb|}| commands. + +The package achieves this +by invoking the \verb|\pageref| mechanism on automatically generated labels +of the form \verb|ind.2|, \verb|ind.4|, \dots. + +Only after adding/deleting/modifying an \verb|\index{|\textit{entry}\verb|}| +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. + +With option \verb!multind! the package supports multiple indexes. But one still works with the standard compilation sequence\\ +latex \emph{filename}.tex, makeindex \emph{filename}, latex \emph{filename}.tex. + +\index{page range|)textit}% +%\setindex{b1}\index{page range!risky@this $\vert$is$\vert$ complicated|texttt} +\sindex[b1]{page range!risky@this $\vert$is$\vert$ complicated|texttt} + +% +\setindex{b1}\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|)}% +% 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$} + +% Let us pretend this page explains $H^0(X,\mathcal L)$. +\glossary{$H^0(X,\mathcal L)$&the sections of the vector bundle +$\mathcal L|_X$ over $X$} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Our glossary entries are given in the format +% \glossaryentry{$B$&Borel subgroup}{page number} +% which would be generated by \glossary{$B$&Borel subgroup} +% and written into the filename.glo file. +% So the & separates the formula from its explanation. +% We assume the explanation fits on the line. +% +% Our implementation: + +\def\itemamp#1{% + \mbox{% + \hbox to 10em{% + #1% the formula + \hss + }% + }% + #2% its explanation +}% + +\def\glossaryentry#1#2{% + {\itemamp #1{\unskip, #2}% + }\par +}% + +\newenvironment{theglossary}{\parindent0pt\parskip0pt}{} + +\chapter*{Glossary of Notations} + +\begin{theglossary}\addcontentsline{toc}{chapter}{Glossary of Notations} + +% Now we copy from filename.glo, making changes as appropriate. +% In this example we just changed the order of the entries. + +\glossaryentry{$H^0(X,\mathcal L)$&the sections of the vector bundle $\mathcal +L +|_X$ over $X$}{\glopageref{4}} + +\glossaryentry{$\mathrm{Ext}^i_B(M,N)$&Ext group in the category $\mathcal +C_B$} +{\glopageref{2}} + +\end{theglossary} + +% 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 + +\let\oldpage\newpage + +%\def\newpage{\relax} + +\renewcommand{\indexname}{Index} +\setindex{main} +\printindex + +\renewcommand{\indexname}{Index bis} +\setindex{bis} +\printindex + +\renewcommand{\indexname}{Index with tag a1} +\setindex{a1} +\printindex + +\renewcommand{\indexname}{Index with tag b1} +\setindex{b1} +\printindex + +\chapter*{Indexes get plain layout}\addcontentsline{toc}{chapter}{Indexes get plain layout} +Our option \verb!multind! breaks yet another mechanisms of makeindex. +Recall that \verb!robustindex! breaks automatic page ranges. The option \verb!multind! prevents +makeindex from inserting + \verb!\indexspace! commands at appropriate points in the index file. +This makes the layout of an index more plain. +Let us compare the index produced by \verb!\robustmanual.tex! with the same index produced +after the package +\verb!robustindex! is called with the option \verb!multind!. +Curiously the order changes a little too. +To get them in the same order replace \verb!\index{Wilberd}! with \verb!\index{wilberd@Wilberd}!. + +\renewcommand{\indexname}{First without option } +\begin{theindex} + + \item alpha, 1 + \subitem see also gamma + \subitem see beta, 2 + \item \&, {\textbf2} + + \indexspace + + \item discussion, 1--2 + + \indexspace + + \item gamma, {\textbf2} + + \indexspace + + \item Wilberd, 1 + +\end{theindex} + +\renewcommand{\indexname}{Next with option \texttt {multind} } +\setindex{main} +\begin{theindex} + +\item Wilberd, 1 + + + \item alpha, 1 + \subitem see also gamma + \subitem see beta, 2 + \item \&, {\textbf2} + + + \item discussion, 1--2 + + + + \item gamma, {\textbf2} + + + +\end{theindex} + +\end{document} diff --git a/Master/texmf-dist/doc/latex/robustindex/robustmanual.pdf b/Master/texmf-dist/doc/latex/robustindex/robustmanual.pdf Binary files differindex 829b5961b42..fedb495a1a2 100644 --- a/Master/texmf-dist/doc/latex/robustindex/robustmanual.pdf +++ b/Master/texmf-dist/doc/latex/robustindex/robustmanual.pdf diff --git a/Master/texmf-dist/doc/latex/robustindex/robustmanual.tex b/Master/texmf-dist/doc/latex/robustindex/robustmanual.tex index df3a549df5f..9f1b76b1595 100644 --- a/Master/texmf-dist/doc/latex/robustindex/robustmanual.tex +++ b/Master/texmf-dist/doc/latex/robustindex/robustmanual.tex @@ -100,6 +100,41 @@ $$\verb!\indexincontents!$$ somewhere before the \verb!\printindex!. \index{alpha!see beta} -We now use $\verb!\printindex!$ to get an index (on a new page). +Before discussing the \verb|multind| option we now use $\verb!\printindex!$ to get an index (on a new page). \printindex + +\section*{The \texttt{multind} option} +The \verb!multind! option provides +support for multiple indexes, albeit in a plain index style. +Suppose the preamble contains \verb!\usepackage[multind]{robustindex}!. + +Let us say we want to use four indexes. First we choose tags to identify them. +Say we use the tags \verb|main|, \verb|bis|, \verb|a1|, \verb|b1|. +The tag \verb|main| is always known and +the index with tag \verb|main| becomes active at the \verb|\begin{document}|. + +With the \verb!\setindex! command we activate an index. +Thus \verb!\setindex{bis}! tells \LaTeX\ that the active index is now the index identified by the tag +\verb|bis|, until the next \verb!\setindex! command. The other indexes are inactivated. +If a tag has not been encountered +before, then a new index with that tag is created. +The \verb!\index! command and +the \verb|\printindex| commands write to/from the active index. +This is all you need to know about option \verb!multind!.\\ + + +To see how option \verb!multind! may be used, you may also compare the file +\verb|multisample.tex| with the output after + +latex multisample.tex + +makeindex multisample + +latex multisample.tex + +latex multisample.tex + + + + \end{document} diff --git a/Master/texmf-dist/doc/latex/robustindex/robustsample.pdf b/Master/texmf-dist/doc/latex/robustindex/robustsample.pdf Binary files differindex 9c5280400c2..ce25c5da10d 100644 --- a/Master/texmf-dist/doc/latex/robustindex/robustsample.pdf +++ b/Master/texmf-dist/doc/latex/robustindex/robustsample.pdf diff --git a/Master/texmf-dist/doc/latex/robustindex/stind.html b/Master/texmf-dist/doc/latex/robustindex/stind.html index ca9ab179a01..601a1f8291e 100644 --- a/Master/texmf-dist/doc/latex/robustindex/stind.html +++ b/Master/texmf-dist/doc/latex/robustindex/stind.html @@ -35,6 +35,17 @@ It also requires the package </DL> you should have something like <A HREF="robustsample.pdf">this PDF file</A>. +<P>If you want multiple indexes with pagerefs you may try + \usepackage[multind]{robustindex}. + +<P>After +<DL> +<DD>pdflatex <A HREF="multisample.tex">multisample.tex</A> +<DD>makeindex multisample +<DD>pdflatex multisample.tex +<DD>pdflatex multisample.tex +</DL> +you should have something like <A HREF="multisample.pdf">this PDF file</A>. <BR> |