| 1 |
\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em |
| 2 |
T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}} |
| 3 |
% \BibTeX command above has been stolen from \cite{Patashnik88a} |
| 4 |
\documentclass[a4paper]{article} |
| 5 |
|
| 6 |
\usepackage[T1]{fontenc} |
| 7 |
\usepackage{textcomp} |
| 8 |
\usepackage{charter} |
| 9 |
\usepackage[scaled=0.88]{beramono} |
| 10 |
\usepackage{microtype} |
| 11 |
|
| 12 |
\renewcommand{\labelitemi}{\textbullet} |
| 13 |
\newcommand{\package}[1]{\texttt{#1}} |
| 14 |
\newcommand{\authorindex}{\package{authorindex}} |
| 15 |
\newcommand{\mkindex}{\package{makeindex}} |
| 16 |
\newcommand{\perl}{\texttt{perl}} |
| 17 |
|
| 18 |
\newcommand{\file}[1]{\texttt{#1}} |
| 19 |
\newcommand{\fnext}[1]{\file{.#1}} |
| 20 |
\newcommand{\aisty}{\file{authorindex.sty}} |
| 21 |
|
| 22 |
\newcommand{\cmdline}[1]{\texttt{#1}} |
| 23 |
\newcommand{\option}[1]{\cmdline{#1}} |
| 24 |
\newcommand{\aiperl}{\cmdline{authorindex}} |
| 25 |
\newcommand{\bibtex}{\cmdline{bibtex}} |
| 26 |
|
| 27 |
\newcommand{\ltxinp}[1]{\texttt{\string#1}} |
| 28 |
|
| 29 |
\renewcommand\descriptionlabel[1]{\hspace\labelsep\normalfont\texttt{#1}} |
| 30 |
|
| 31 |
\title{The \authorindex\ Package} |
| 32 |
\author{Andreas Wettstein\\\texttt{[email protected]}} |
| 33 |
\date{August 2008} |
| 34 |
|
| 35 |
\begin{document} |
| 36 |
|
| 37 |
\maketitle |
| 38 |
|
| 39 |
\begin{abstract} |
| 40 |
The \authorindex\ package lists all authors cited in a \LaTeX\ document from |
| 41 |
the \ltxinp{\cite} entries and their associated \fnext{bib} bibliography |
| 42 |
files. It will not run with bibliographical entries (\ltxinp{\bibitem}) |
| 43 |
explicitly typed into the document. Each author entry in the generated list |
| 44 |
contains the pages where these citations occur. Alternatively, the package |
| 45 |
can list the labels of the citations that appear in the references rather |
| 46 |
than the text pages. The package requires \perl\ (version 5 or higher) to run |
| 47 |
an auxiliary script and \BibTeX. The package can be used by itself or as a |
| 48 |
preprocessor for \mkindex. It can produce separate indices and mini indices, |
| 49 |
which are merged in the bibliography. The package can run under Unix, |
| 50 |
Windows, or MS-DOS. The \authorindex\ package is compatible with the standard |
| 51 |
bibliographical styles distributed with \LaTeX\ and with \package{hyperref}. |
| 52 |
With the small patches listed here, it will also run with the |
| 53 |
\package{chapterbib}, \package{chicago}, \package{harvard}, and |
| 54 |
\package{natbib} bibliographical style packages. |
| 55 |
\end{abstract} |
| 56 |
|
| 57 |
|
| 58 |
\section{Installation} |
| 59 |
|
| 60 |
The \authorindex\ package consists of the \LaTeX\ style file \aisty\ and the |
| 61 |
\perl\ script \aiperl. It needs \LaTeX, \BibTeX\ \cite{Patashnik88a} and |
| 62 |
\perl\ (version 5 or better) to run. |
| 63 |
|
| 64 |
To install the package, move \aisty\ to a place where \LaTeX\ looks for its |
| 65 |
style files. Unix: The \perl\ script \aiperl\ must be moved to a place in your |
| 66 |
executable path and be given execution permission. You may need to modify the |
| 67 |
path to the \perl\ binary that appears in the first line of the script \aiperl, |
| 68 |
replacing \file{/usr/bin/perl} by the correct path for your system. MS-DOS: A |
| 69 |
\perl\ processor for MS-DOS such as \package{ActivePerl} can process the |
| 70 |
\LaTeX\ auxiliary file \fnext{aux} in a command window to produce the |
| 71 |
\authorindex\ file \fnext{ain}. |
| 72 |
|
| 73 |
|
| 74 |
\section{Using the package} |
| 75 |
|
| 76 |
The \LaTeX\ source code includes the \ltxinp{authorindex} package |
| 77 |
via a \ltxinp{\usepackage} statement. It may also be necessary to |
| 78 |
replace your \ltxinp{\cite} commands by \ltxinp{\aicite} |
| 79 |
commands\footnote{If you put the statement |
| 80 |
\ltxinp{\let}\ltxinp{\cite}\ltxinp{=}\ltxinp{\aicite} in the |
| 81 |
preamble after the loading of the package, \ltxinp{\cite} commands |
| 82 |
will be equivalent to \ltxinp{\aicite} commands, and you will not |
| 83 |
need to modify your text.}. The \ltxinp{\aicite} command behaves |
| 84 |
like \ltxinp{\cite} but writes additional information to the |
| 85 |
\fnext{aux} file needed to generate the author index. |
| 86 |
|
| 87 |
Additional commands are available. The command \ltxinp{\aimention} enters a |
| 88 |
name into the author index that does not appear in the bibliography file |
| 89 |
\fnext{bib}. It is not strictly a ``citation'' command because it doesn't add a |
| 90 |
citation to the text. Its argument is an author name in the \BibTeX\ name |
| 91 |
format like \ltxinp{\aimention\{Carl Friedrich Gau\{\string\ss\}\}}, for |
| 92 |
example. This command is designed to bridge the gap with keyword indices and |
| 93 |
might be useful for referring to famous people whose work (in contrast to their |
| 94 |
publications) is common knowledge. Multiple names are possible if they are |
| 95 |
separated by \ltxinp{and} as in the standard \BibTeX\ author format. The |
| 96 |
command \ltxinp{\aionly} expects a bibliography key and puts the corresponding |
| 97 |
authors in the author index without generating a citation. In a sense, it is |
| 98 |
similar to \ltxinp{\nocite}. |
| 99 |
|
| 100 |
To produce the author index, run the \perl\ script \aiperl\ and \LaTeX\ |
| 101 |
sequentially; the procedure is similar to producing the bibliography output |
| 102 |
from \BibTeX. The command \ltxinp{\printauthorindex} marks the point where the |
| 103 |
author index is to appear in the \LaTeX\ output. A typical sequence to run the |
| 104 |
tools would be \LaTeX, \BibTeX, \authorindex, \LaTeX, \authorindex, \LaTeX. For |
| 105 |
MS-DOS or Windows, the \authorindex\ step would be processed in a command |
| 106 |
window by an explicit statement like \cmdline{perl authorindex \textit{example} |
| 107 |
[cr]}, where \textit{example} is the name of the \fnext{aux} file and |
| 108 |
``\cmdline{[cr]}'' indicates the enter key. In a Unix environment, the \aiperl\ |
| 109 |
script can be invoked simply by the statement \cmdline{authorindex |
| 110 |
\textit{example} [cr]}. |
| 111 |
|
| 112 |
Options to the \authorindex\ package are available,passed to the package in the |
| 113 |
usual way \ltxinp{\usepackage[option\ldots]\{authorindex\}}. The option |
| 114 |
\ltxinp{withbib} automatically indexes the page where a bibliography entry |
| 115 |
appears in the references. There is also the possibility of generating an index |
| 116 |
that is merged into the corresponding bibliography entries themselves. This |
| 117 |
possibility is switched on by the package option \ltxinp{miniindex} discussed |
| 118 |
more below. |
| 119 |
|
| 120 |
The details of including the author index are left to the author. Unlike the |
| 121 |
commands \ltxinp{\printindex} or the \ltxinp{\thebibliography}, |
| 122 |
\ltxinp{\printauthorindex} does not create a chapter or section heading. To |
| 123 |
format the author index in multiple columns on a page in a one-column document, |
| 124 |
use an additional package like \package{multicol}. With this package, a |
| 125 |
two-column author index will be created with |
| 126 |
\begin{verbatim} |
| 127 |
\begin{multicols}{2} |
| 128 |
\printauthorindex |
| 129 |
\end{multicols} |
| 130 |
\end{verbatim} |
| 131 |
If you plan to generate several documents with author indices in a consistent |
| 132 |
style, consider redefining the \ltxinp{theauthorindex} environment to fit your |
| 133 |
needs. |
| 134 |
|
| 135 |
|
| 136 |
\section{Overall structure of the index} |
| 137 |
|
| 138 |
\subsection{Normal \fnext{ain} file} |
| 139 |
|
| 140 |
The \fnext{ain} file created by the \perl\ script \aiperl\ from the \fnext{aux} |
| 141 |
file and used by \ltxinp{\printauthorindex} will look like this: |
| 142 |
\begin{verbatim} |
| 143 |
\begin{theauthorindex} |
| 144 |
\item[May, Karl] \aipages{\aifirstpage{iv}, 2, \aibibpage{77}} |
| 145 |
\item[Musil, Robert] \aipages{7, 9, \aibibpage{\aifirstpage{77}}} |
| 146 |
\indexspace |
| 147 |
\item[Schmidt, Arno] \aipages{33, \aibibpage{78}} |
| 148 |
\item[Souter, Nathaniel] \aipages{29--\aifirstpage{36}} |
| 149 |
\end{theauthorindex} |
| 150 |
\end{verbatim} |
| 151 |
Note the provision for both text and bibliographical pages. Author names that |
| 152 |
start with different letters are separated by the statement |
| 153 |
\ltxinp{\indexspace}, which inserts a blank line between the groups. This |
| 154 |
command has no arguments but can be redefined according to your needs inside or |
| 155 |
outside the \ltxinp{theauthorindex} environment. Also, note the provision for a |
| 156 |
sequential range of pages. |
| 157 |
|
| 158 |
|
| 159 |
\subsection{Font sizes} |
| 160 |
|
| 161 |
The command \ltxinp{\aisize} controls the font size used for the author index. |
| 162 |
It expects no arguments. You can redefine it outside the |
| 163 |
\ltxinp{theauthorindex} environment to customize the font size. In most cases, |
| 164 |
it will be sufficient to use one of those options in the \authorindex\ package: |
| 165 |
\begin{description} |
| 166 |
\item[small] will cause the author index to be typeset in small size. |
| 167 |
\item[normal] (the default) will cause the author index to be typeset in the |
| 168 |
normal text size. |
| 169 |
\end{description} |
| 170 |
|
| 171 |
|
| 172 |
\subsection{Separate entries for first and other authors} |
| 173 |
\label{sec:firstandothers} |
| 174 |
|
| 175 |
By default, \authorindex\ generates exactly one entry for each author in the |
| 176 |
index. All pages with citations of the author's work go into this entry, no |
| 177 |
matter what the co-authors for the work that you cite are. |
| 178 |
|
| 179 |
Optionally, you can generate a reference to first authors in the author list of |
| 180 |
all of the author's works. To this end, you call \ltxinp{\aialso} in the |
| 181 |
preamble of your document. The command takes two string arguments. The first |
| 182 |
argument is put before first author name, the second is used as a separator. |
| 183 |
|
| 184 |
Alternatively, you can change this behavior with the \ltxinp{\aisee} command. |
| 185 |
You call \ltxinp{\aisee} in the preamble of your document with a string |
| 186 |
argument. For authors that are not the first in the author list of a work |
| 187 |
cited, \authorindex\ generates an entry with this authors name, followed by the |
| 188 |
string you have given to \ltxinp{\aisee}, followed by the name of the first |
| 189 |
author of the cited work. Entries for authors that are first (or even only) |
| 190 |
authors of a work are listed in the author index as usual. |
| 191 |
|
| 192 |
For example, if you write in German, you'd put |
| 193 |
\begin{verbatim} |
| 194 |
\aisee{, siehe } |
| 195 |
\end{verbatim} |
| 196 |
in your preamble. If you write in English, you would use ``see'' instead of |
| 197 |
``siehe''. For example, assume that we cite works with the following author |
| 198 |
lists: ``A.~Schmidt, R.~Musil, and K.~May'' (cited on page 4); ``R.~Walser and |
| 199 |
K.~May'' (and page 4 and 5); ``R.~Musil'' (on page 3); ``R.~Musil and |
| 200 |
N.~Souter'' (on page 5); ``N.~Souter and R.~Musil'' (on page 2 and 6). Then, |
| 201 |
the entries starting with ``M'' in the \fnext{ain} file look like like |
| 202 |
\begin{verbatim} |
| 203 |
\item[\aitop{May, K.}, siehe \aifirst{Schmidt, A.}] \aipages{4} |
| 204 |
\item[\airep{May, K.}, siehe \aifirst{Walser, R.}] \aipages{4, 5} |
| 205 |
\item[Musil, R.] \aipages{\aifirstpage{3}, \aifirstpage{5}} |
| 206 |
\item[\airep{Musil, R.}, siehe \aifirst{Souter, N.}] \aipages{2, 6} |
| 207 |
\item[\airep{Musil, R.}, siehe \aifirst{Schmidt, A.}] \aipages{4} |
| 208 |
\end{verbatim} |
| 209 |
|
| 210 |
|
| 211 |
\subsection{Mini indices} |
| 212 |
\label{sec:mini} |
| 213 |
|
| 214 |
Alternatively (or additionally) to the usual author index, you can use the |
| 215 |
package option \ltxinp{miniindex} in the preamble to cause \aiperl\ to merge a |
| 216 |
mini index directly into your bibliography file; that is, the merge modifies |
| 217 |
the \fnext{bbl}-file. This procedure requires that you run \aiperl\ |
| 218 |
\emph{after} you run \bibtex. The page list is put into the single argument of |
| 219 |
the command \ltxinp{\bibindex}. By default, \ltxinp{\bibindex} prints nothing |
| 220 |
if its argument is empty. Otherwise, it passes the argument to |
| 221 |
\ltxinp{\aibibindex}, which prints the pages in bold type enclosed by braces |
| 222 |
(for example, \textbf{\{10, 11, 36\}}), as in Nelson F. Beebe's author index |
| 223 |
package \cite{Beebe98}. For alternatives, you can redefine |
| 224 |
\ltxinp{\aibibindex} using \ltxinp{\renewcommand}. For obvious reasons, a mini |
| 225 |
index always contains the page numbers, even if the \ltxinp{biblabels} package |
| 226 |
option is used. |
| 227 |
|
| 228 |
Normally, the mini index is placed at the end of each item. You can change |
| 229 |
this by hacking your bibliography style file. Let it place \verb|\bibindex{}| |
| 230 |
on its own line where you want the mini index to go, and \aiperl\ will do the |
| 231 |
rest. |
| 232 |
|
| 233 |
\section{Author names} |
| 234 |
|
| 235 |
\subsection{Which names to include in the index?} |
| 236 |
|
| 237 |
There are two package options to \authorindex\ to select which type of names to |
| 238 |
include in the index: |
| 239 |
\begin{description} |
| 240 |
\item[editors] will cause the editor names to be included in the author index. |
| 241 |
\item[avoideditors] will cause the editors names to be included only if there |
| 242 |
are no author names present for a cited work |
| 243 |
\item[onlyauthors] (the default) will restrict the author index to the author names. |
| 244 |
\end{description} |
| 245 |
Previous comments concerning authors will also apply to editors when the |
| 246 |
\ltxinp{editors} option is invoked. |
| 247 |
|
| 248 |
The command |
| 249 |
\ltxinp{\aimaxauthors[}\textit{trunc\/}\verb|]{|\textit{max\/}\verb|}| limits |
| 250 |
the maximum number of authors per work that will be included in the author |
| 251 |
index. The optional first argument \textit{trunc\/} determines the number of |
| 252 |
authors to be included if the maximum number is exceeded. If it is omitted, |
| 253 |
\textit{trunc\/} is assumed equal to \textit{max}. Thus, |
| 254 |
\ltxinp{\aimaxauthors[1]}\verb|{3}| will set the maximum number of authors to |
| 255 |
3; for works with more than three authors only the first one will be included. |
| 256 |
In this example, for a work by ``A. Schmidt, R. Musil, and K. May'', all of |
| 257 |
them will appear in the author index while, for a four-author work by ``A. |
| 258 |
Schmidt, R. Musil, K. May, and N. Souter'', only Schmidt will. This usage is |
| 259 |
similar to the ``et al.'' commonly used in in bibliographies. With |
| 260 |
\ltxinp{\aimaxauthors}\verb|{3}|, on the other hand, for works with more than 3 |
| 261 |
authors, the 3 first ones will be included. For the two example author lists, |
| 262 |
in both cases, Schmidt, Musil, and May will be listed. |
| 263 |
|
| 264 |
The \authorindex\ package accepts package options for only the most important |
| 265 |
cases: |
| 266 |
\begin{description} |
| 267 |
\item[onlyfirst] sets the maximum number of authors (or editors) per work that |
| 268 |
will be included in the index to 1. It corresponds to |
| 269 |
\verb|\aimaxauthors{1}|. |
| 270 |
\item[all] (the default) sets the maximum number of authors (or editors) per |
| 271 |
work that will be included to 9999. It corresponds to |
| 272 |
\verb|\aimaxauthors{9999}|. |
| 273 |
\end{description} |
| 274 |
|
| 275 |
|
| 276 |
\subsection{Formatting and sorting} |
| 277 |
|
| 278 |
The command \ltxinp{\ainamefmt} contains the specification for formatting and |
| 279 |
ordering of names. Its argument is a string consisting of one or more parts |
| 280 |
separated by semicolons. Each part is made up of one or two components, |
| 281 |
separated by a colon. If there is only one component, the both components are |
| 282 |
assumed to be equal. Each of the two component consists of a \BibTeX-format |
| 283 |
string \cite{Patashnik88b}. The first component formats the way the names are |
| 284 |
printed in the index; the second component, the way the names are sorted. It |
| 285 |
is therefore possible to include the same name multiple times in the index, |
| 286 |
each time sorted or printed differently. One restriction is that you cannot |
| 287 |
have different printed representations that have the same sort format. Because |
| 288 |
\ltxinp{\ainamefmt} can be messy to use, a few simple cases can be selected by |
| 289 |
options to the \authorindex\ package: {\small |
| 290 |
\begin{description} |
| 291 |
\item[lastname] will only include the last name of the authors (and titles like |
| 292 |
``von'', if present). |
| 293 |
\item[firstabbrev] will also include the abbreviated first name(s) (and |
| 294 |
eventually also a ``jr.''), following the last name. |
| 295 |
\item[fullname] (the default) will spell the names in full, to the extent given |
| 296 |
in the \fnext{bib} file. |
| 297 |
\end{description}} |
| 298 |
|
| 299 |
For example, the package options \ltxinp{fullname}, \ltxinp{lastname}, and |
| 300 |
\ltxinp{firstabbrev} correspond following uses of \ltxinp{\ainamefmt}: |
| 301 |
\begin{verbatim} |
| 302 |
\ainamefmt{{vv }{ll}{, ff}{, jj}}} % fullname |
| 303 |
\ainamefmt{{vv }{ll}}} % lastname |
| 304 |
\ainamefmt{{vv }{ll}{, f.}{, jj}}} % firstabbrev |
| 305 |
\end{verbatim} |
| 306 |
|
| 307 |
For a more complex example, assume we want to format the names like for the |
| 308 |
\ltxinp{firstabbrev} option but, in addition to the normal sorting, we also |
| 309 |
want to sort in names that have a `von'-part ignoring that part. In other |
| 310 |
words, we want C. F. von Weizs\"{a}cker to appear both under ``V'' and ``W'' in |
| 311 |
the index, but nonetheless always typeset as ``von Weizs\"{a}cker, C. F.'': |
| 312 |
\begin{verbatim} |
| 313 |
\ainamefmt{% |
| 314 |
{vv }{ll}{, f.}{, jj};% |
| 315 |
{vv }{ll}{, f.}{, jj}:{ll}{vv }{, f.}{, jj}% |
| 316 |
} |
| 317 |
\end{verbatim} |
| 318 |
This approach would also work for name prefixes like ``van'' or ``de la''. |
| 319 |
|
| 320 |
Note that the command \ltxinp{\indexspace}, which separates entries that start |
| 321 |
with a different letters, is placed according to the format used for sorting. |
| 322 |
|
| 323 |
|
| 324 |
\subsection{Dealing with name variations} |
| 325 |
|
| 326 |
In different publications, the name of the same author may appear in different |
| 327 |
forms. Causes of variation are differing style conventions of various |
| 328 |
journals, inconsistencies caused by the author, or plain errors. |
| 329 |
|
| 330 |
Bibliographies should give the author names as close to what appears on the |
| 331 |
publication as the bibliography style allows. This in the interest of your |
| 332 |
readers, as is simplifies finding what you cite. But it also implies that |
| 333 |
inconsistencies carry over to the \ltxinp{author} fields of the \BibTeX\ data |
| 334 |
base. |
| 335 |
|
| 336 |
In contrast, for author indices, names should be used consistently. Readers |
| 337 |
consult the author index to find out about the works of a particular person, |
| 338 |
and should find all of them in a single entry, rather than scattered over |
| 339 |
multiple entries that correspond to different forms of the same name. |
| 340 |
|
| 341 |
To meet the conflicting needs for bibliographies and author indices, |
| 342 |
\authorindex\ supports two new fields for \BibTeX\ data base entries: |
| 343 |
\begin{description} |
| 344 |
\item[authauthor] Gives the author name list, using the authoritative form of |
| 345 |
the authors names. The format is like for the \ltxinp{author} field. |
| 346 |
\item[autheditor] Likewise, for editors. |
| 347 |
\end{description} |
| 348 |
If a new field is present in a \BibTeX\ entry, \authorindex\ uses it instead of |
| 349 |
the \ltxinp{author} or \ltxinp{editor} field. Of course, the latter fields are |
| 350 |
still required for \BibTeX. |
| 351 |
|
| 352 |
|
| 353 |
\subsection{Fonts for the names} |
| 354 |
|
| 355 |
\ltxinp{\ainame} is a command with one argument. It determines how the |
| 356 |
argument of \ltxinp{\item} inside the \ltxinp{theauthorindex} environment is |
| 357 |
printed. |
| 358 |
|
| 359 |
The command \ltxinp{\aifirst} has one argument. It is used to typeset the name |
| 360 |
of the leading author from an entry with an additional author when using the |
| 361 |
command \ltxinp{\aisee}. The command \ltxinp{\aitop} typesets the name of the |
| 362 |
first occurrence of an additional author, that is, an author name before the |
| 363 |
string defined by \ltxinp{\aisee}. |
| 364 |
|
| 365 |
Finally, \ltxinp{\airep} typesets a name that has already been used in the |
| 366 |
previous index entry. Look at the example in section~\ref{sec:firstandothers} |
| 367 |
for clarification. |
| 368 |
|
| 369 |
By redefining these commands, you can do more than just selecting fonts. One |
| 370 |
example would be to redefine |
| 371 |
\begin{verbatim} |
| 372 |
\renewcommand{\airep}[1]{---} |
| 373 |
\end{verbatim} |
| 374 |
to cause the name of an author to printed only once when it occurs in many |
| 375 |
subsequent entries. |
| 376 |
|
| 377 |
|
| 378 |
\subsection{Advanced customization} |
| 379 |
\label{sec:bsthacker} |
| 380 |
|
| 381 |
If the standard command \ltxinp{\ainamefmt} does not provide enough |
| 382 |
flexibility, you can use the command \ltxinp{\authorindexstyle} in the |
| 383 |
preamble. Its single argument is the name of some \fnext{bst}-file that you |
| 384 |
select to format the author names. |
| 385 |
|
| 386 |
If you decide to write a custom \fnext{bst}-file, it is necessary to understand |
| 387 |
hacking \fnext{bst} files, e.~g.\ by reading \cite{Patashnik88b}. Your \BibTeX\ |
| 388 |
style file needs to generate a \fnext{bbl} file that contains three lines per |
| 389 |
author-label pair, each of which is followed by a line that contains just a |
| 390 |
percent sign. The first line is the name formatted according to your taste, as |
| 391 |
it appears in the index. The second line is the name format used for |
| 392 |
sorting. The third line contains the label of the citation, or is empty. In |
| 393 |
the latter case, the label of the previous three line entry is taken; |
| 394 |
furthermore, this entry is assumed to refer to the same author as the current |
| 395 |
one --- differing only in the formatting or sorting rule. The default |
| 396 |
\fnext{bst} file used to format the names is embedded in the \perl\ script |
| 397 |
\aiperl. You could use this as template. Use the command line option |
| 398 |
\option{-k} for \aiperl\ (see Sec.~\ref{sec:Runai}). |
| 399 |
|
| 400 |
The first author of the work is expected to be dumped into the \fnext{bbl} file |
| 401 |
first. |
| 402 |
|
| 403 |
|
| 404 |
\section{Page numbers and bibliography labels} |
| 405 |
|
| 406 |
\subsection{Page numbers or bibliography labels?} |
| 407 |
|
| 408 |
You have to possibility of selecting whether you want the page numbers or the |
| 409 |
bibliography numbers of the references to appear in the index. This selection |
| 410 |
is done through the package options |
| 411 |
\begin{description} |
| 412 |
\item[biblabels] will include in the author index the reference label as it |
| 413 |
appears in the reference list instead of the page numbers. |
| 414 |
\item[pages] (the default) the pages of the citations. |
| 415 |
\end{description} |
| 416 |
With the option \ltxinp{biblabels}, every citation will be indexed. There is no |
| 417 |
need to use the special citation commands \ltxinp{\aicite}, unless you want to |
| 418 |
have a mini index as well (see section~\ref{sec:mini}). With this option, it |
| 419 |
makes no sense to use either the \ltxinp{\aimention} command or the |
| 420 |
\ltxinp{withbib} package option. |
| 421 |
|
| 422 |
While this manual has referred to ``pages, '' it also applies to the indexing |
| 423 |
of bibliography labels unless explicitly noted otherwise. |
| 424 |
|
| 425 |
|
| 426 |
\subsection{Ordering of pages and compression of page ranges} |
| 427 |
|
| 428 |
The command \ltxinp{\aipagetypeorder}\verb|{|\textit{order\/}\verb|}| can be |
| 429 |
used to determine the relative order of different types of page numbers, such |
| 430 |
as roman, arabic, and others. The argument \textit{order\/} is a string |
| 431 |
consisting of a selection of the characters \ltxinp{rRnAa}, which indicate |
| 432 |
lowercase roman, uppercase roman, arabic, uppercase alphabetic, and lowercase |
| 433 |
alphabetic page numbers, respectively. The relative order of the letters in the |
| 434 |
string determine the order of the page numbers. For example, the argument |
| 435 |
\ltxinp{rn} will sort all lowercase roman pages before the arabic pages. If you |
| 436 |
want to use lowercase alphabetic numbers, you have to use |
| 437 |
\ltxinp{\aipagetypeorder} without putting \ltxinp{r} in the string; that is, |
| 438 |
you can't use lowercase roman numbers and lowercase alphabetic numbers at the |
| 439 |
same time. The same holds for using uppercase roman and alphabetical page |
| 440 |
numbers. Composite page numbers (like ``4-17'') are split into their components |
| 441 |
(using any character that cannot be interpreted as a digit as field separator) |
| 442 |
and sorted with the priority of components decreasing from left to right. |
| 443 |
|
| 444 |
Normally, three or more adjacent page numbers are ``compressed.'' If an author |
| 445 |
citation appears on pages 4.17, 4.18, and 4.19, the page range will appear as |
| 446 |
``4.17--4.19'' in the index entry. However, a range of only two consecutive |
| 447 |
pages will not be compressed. To represent such a pair by the first page number |
| 448 |
plus some string (typically, ``f''), specify that string as the argument of |
| 449 |
\ltxinp{\aitwosuffix} in the preamble. You can suppress range compression |
| 450 |
altogether by using the \ltxinp{nocompress} package option. |
| 451 |
|
| 452 |
|
| 453 |
\subsection{Fonts used for the pages} |
| 454 |
|
| 455 |
The command \ltxinp{\aipages} determines the overall font of the page numbers. |
| 456 |
The command \ltxinp{\aibibpage} is used to switch on additional properties to |
| 457 |
mark the pages that contain the bibliography entries of works of the author --- |
| 458 |
relevant if the \ltxinp{withbib} package option is used. \ltxinp{\aifirstpage} |
| 459 |
is used to print page numbers of references in which the author is the leading |
| 460 |
author. All three commands expect one argument and can be redefined by |
| 461 |
\ltxinp{\renewcommand}. |
| 462 |
|
| 463 |
\subsection{Modifying the page numbers} |
| 464 |
\label{sec:pagerep} |
| 465 |
|
| 466 |
The command \ltxinp{\theaipage} determines the string representing the page |
| 467 |
delivered to the \perl\ script \aiperl. This does not apply to bibliography |
| 468 |
labels, even if the \ltxinp{biblabels} package option is used. By default, |
| 469 |
this is simply defined as \ltxinp{\thepage}, but you can redefine it. |
| 470 |
Originally, allowing \ltxinp{\theaipage} to differ from \ltxinp{\thepage} was |
| 471 |
intended for multi-volume books, where the page numbers in each volume do not |
| 472 |
indicate the volume number. For example, page 231 of volume II will produce |
| 473 |
only a plain ``231'' as the page number, whereas you might prefer to have the |
| 474 |
indication of the volume in the index such as ``II-231''. You can also do more |
| 475 |
sophisticated things. For example, using the \package{hyperref} package with |
| 476 |
the \ltxinp{plainpages=false} option to create hyperlinks to the page where the |
| 477 |
citation is: |
| 478 |
\begin{verbatim} |
| 479 |
\def\theaipage{\string\hyperpage{\thepage}} |
| 480 |
\end{verbatim} |
| 481 |
NB: To avoid keep \aiperl\ from interpreting the string \ltxinp{\hyperpage} as |
| 482 |
an alphabetic page number, you should not use alphabetic page numbering and |
| 483 |
tell the \perl\ script about it using \ltxinp{\aipagetypeorder}. |
| 484 |
|
| 485 |
|
| 486 |
\section{Running \aiperl} |
| 487 |
\label{sec:Runai} |
| 488 |
|
| 489 |
Having run \LaTeX\ on the properly prepared \LaTeX\ source document, you then |
| 490 |
use the \perl\ script \aiperl\ to process the generated \fnext{aux}-files, |
| 491 |
which produces the author index file (extension \fnext{ain}). |
| 492 |
|
| 493 |
The \perl\ script can be called with any number of arguments. Without |
| 494 |
arguments, \aiperl\ reads from the standard input. With several arguments, |
| 495 |
\aiperl\ appends \fnext{aux} extensions wherever necessary and processes these |
| 496 |
files. The output is written to the file whose name is extracted from the |
| 497 |
\fnext{aux}-file for the \fnext{tex}-file where \ltxinp{\printauthorindex} was |
| 498 |
given. It is necessary to give the \fnext{aux}-file produced by the |
| 499 |
\fnext{tex}-file containing \verb|\begin{document}| to \aiperl; this file |
| 500 |
passes information to the script regarding the style and content of the |
| 501 |
index. |
| 502 |
|
| 503 |
If you use \ltxinp{\include} in your \LaTeX\ source document, it is |
| 504 |
sufficient to give the master \fnext{aux}-file to \aiperl; the |
| 505 |
\fnext{aux}-files of included files are then processed automatically. |
| 506 |
|
| 507 |
\aiperl\ recognizes the following command line options: |
| 508 |
\begin{description} |
| 509 |
\item[-d] (``draft'') Adds additional information to the \fnext{ain} file: For |
| 510 |
each author, the labels of all references and the page numbers where they are |
| 511 |
cited are included as comments. This detail may help if you manually edit the |
| 512 |
generated author index. Also, some statistics are included at the bottom of |
| 513 |
the \fnext{ain} file. This option does not work with the \option{-i} option. |
| 514 |
\item[-h] (``help'') Prints out a |
| 515 |
short help text. |
| 516 |
\item[-i] (``index'') Creates a file suitable for further processing with |
| 517 |
\mkindex\ or the like. For example, you could use that to make a common |
| 518 |
author and subject index. Note the extension of the generated file still will |
| 519 |
be \fnext{ain}. (Use the \option{-p} option and redirection to send the |
| 520 |
stuff anywhere else.) |
| 521 |
\item[-k] (``keep'') Retains the temporarily generated \fnext{bst}-file after |
| 522 |
\aiperl\ finishes. This information will give you a good starting point for |
| 523 |
advanced customization of the author index (see Sec.~\ref{sec:bsthacker}). |
| 524 |
\item[-p] (``print'') Prints the result to standard output instead of writing |
| 525 |
it to the \fnext{ain}-file. |
| 526 |
\item[-r] (``do not recurse'') Does not automatically process \fnext{aux}-files |
| 527 |
produced by included files. |
| 528 |
\end{description} |
| 529 |
|
| 530 |
|
| 531 |
\section{\authorindex\ and other packages} |
| 532 |
|
| 533 |
\subsection{Compatible packages} |
| 534 |
|
| 535 |
\subsubsection{Standard distribution package} |
| 536 |
|
| 537 |
The standard \package{cite} package included with the \LaTeX\ distribution |
| 538 |
seems to work with \authorindex\ without problems. |
| 539 |
|
| 540 |
\subsubsection{chapterbib} |
| 541 |
|
| 542 |
The \package{chapterbib} package also works well with \authorindex. If you |
| 543 |
want to use the mini indices, be sure to run \aiperl\ separately on the main |
| 544 |
\fnext{aux}-file plus the \fnext{aux}-file for each chapter using the |
| 545 |
\option{-r} option (see section~\ref{sec:Runai}). In addition, you may want to |
| 546 |
run \aiperl\ on the main \fnext{aux}-file to generate an author index for all |
| 547 |
chapters. For example, you might use a sequence of the form: |
| 548 |
\begin{verbatim} |
| 549 |
authorindex -r main chapter1 |
| 550 |
authorindex -r main chapter2 |
| 551 |
authorindex main |
| 552 |
\end{verbatim} |
| 553 |
If you require chapterwise author indices, after the first two \authorindex\ |
| 554 |
runs in the above example, you should rename \file{main.ain} to something else |
| 555 |
and \ltxinp{\input} these files in the place where you want the chapterwise |
| 556 |
authorindex to appear. |
| 557 |
|
| 558 |
\subsubsection{hyperref} |
| 559 |
|
| 560 |
The script \authorindex\ works well with \package{hyperref}. In the standard |
| 561 |
version, the pages in the author index are not linked back to the page with the |
| 562 |
citation. Section~\ref{sec:pagerep} describes how to fix this problem. |
| 563 |
|
| 564 |
\subsection{Less compatible packages} |
| 565 |
|
| 566 |
Most problems with other bibliographical packages arise because the packages |
| 567 |
override or skip certain citation functions. The \authorindex\ package modifies |
| 568 |
these functions to write page information along with the citation key to the |
| 569 |
\fnext{aux} file. In the following examples, we show how to re-establish this |
| 570 |
additional output for a few specific packages. Please note that these ``fixes'' |
| 571 |
may no longer work if newer versions of these packages appear. |
| 572 |
|
| 573 |
If you use a non-compatible package that is not listed below, it is worthwile |
| 574 |
to have a look into its source code. In the simplest case, the package might |
| 575 |
include one of the listed packages (using \ltxinp{\usepackage}), and hence one |
| 576 |
of the examples below applies. Others might require more effort, but the basic |
| 577 |
strategy for a fix will be always similar to the examples below. If you |
| 578 |
encounter non-compatible packages, please notify me about them (ideally, with |
| 579 |
instructions for a fix) so that I can include them in this manual. |
| 580 |
|
| 581 |
|
| 582 |
\subsubsection{\package{chicago}} |
| 583 |
\label{sec:chicago} |
| 584 |
|
| 585 |
The standard version of the \package{chicago} package does not work with |
| 586 |
\authorindex. For this package, there is a patch that apparently makes it work |
| 587 |
with \authorindex. In the file \file{chicago.sty}, you replace the lines |
| 588 |
\begin{verbatim} |
| 589 |
\def\@citex[#1]#2{% |
| 590 |
\end{verbatim} |
| 591 |
with |
| 592 |
\begin{verbatim} |
| 593 |
\def\@citex[#1]#2{\@aicitey{#2}% |
| 594 |
\end{verbatim} |
| 595 |
and |
| 596 |
\begin{verbatim} |
| 597 |
\def\@citedatax[#1]#2{% |
| 598 |
\end{verbatim} |
| 599 |
with |
| 600 |
\begin{verbatim} |
| 601 |
\def\@citedatax[#1]#2{\@aicitey{#2}% |
| 602 |
\end{verbatim} |
| 603 |
and save the modified file under a new name, e.~g.\ \file{aichicago.sty}. Use |
| 604 |
this file in place of the file \file{chicago.sty}. |
| 605 |
|
| 606 |
|
| 607 |
\subsubsection{\package{harvard}} |
| 608 |
|
| 609 |
The \package{harvard} package can be made to work with \authorindex by adding |
| 610 |
code to the document preamble. After loading the \package{harvard} package |
| 611 |
with \ltxinp{\usepackage}, write the following lines into the preamble of your |
| 612 |
\LaTeX-source file: |
| 613 |
\begin{verbatim} |
| 614 |
\makeatletter |
| 615 |
\renewcommand{\HAR@citetoaux}[1]{% |
| 616 |
\if@filesw\immediate\write\@auxout{\string\citation{#1}}\fi% |
| 617 |
\if@filesw\@for\@citeb:=#1\do{\immediate\write\@auxout{% |
| 618 |
\string\citationpage{\@citeb}{\thepage}}}\fi}% |
| 619 |
\makeatother |
| 620 |
\end{verbatim} |
| 621 |
Then, in the main text, use the \package{harvard} citation commands |
| 622 |
\ltxinp{\cite}, \ltxinp{\citeyear}, etc., exactly as you would normally do |
| 623 |
without the \authorindex\ package. |
| 624 |
|
| 625 |
|
| 626 |
\subsubsection{\package{natbib}} |
| 627 |
|
| 628 |
Like \package{chicago}, the package \package{natbib} also conflicts with |
| 629 |
\authorindex. The following fix is based on a similar fix by Michael Friendly |
| 630 |
and Patrick W.\ Daly for Nelson Beebe's \package{authidx} package |
| 631 |
\cite{Beebe98}, plus additional support for \package{natbib}'s numerical mode |
| 632 |
as proposed by Pieter Eendebak. You insert in your \file{natbib.cfg} the |
| 633 |
following lines: |
| 634 |
\begin{verbatim} |
| 635 |
% natbib.cfg |
| 636 |
\AtBeginDocument{% |
| 637 |
\@ifpackageloaded{authorindex}{% |
| 638 |
\ifNAT@numbers |
| 639 |
\let\org@@citex\NAT@citexnum |
| 640 |
\else |
| 641 |
\let\org@@citex\NAT@citex |
| 642 |
\fi |
| 643 |
\def\@citex[#1][#2]#3{% |
| 644 |
\typeout{indexing: [#1][#2]{#3}}% |
| 645 |
\org@@citex[#1][#2]{#3}% |
| 646 |
\@aicitey{#3}}% |
| 647 |
\renewcommand\NAT@wrout[5]{% |
| 648 |
\if@filesw{% |
| 649 |
\let\protect\noexpand\let~\relax |
| 650 |
\immediate\write\@auxout{\string\aibibcite{#5}{#1}}% |
| 651 |
\immediate\write\@auxout{\string\bibcite{#5}{{#1}{#2}{{#3}}{{#4}}}}}% |
| 652 |
\fi}}{}} |
| 653 |
\endinput |
| 654 |
\end{verbatim} |
| 655 |
Please note that I tested this work-around superficially. It does not repair a |
| 656 |
conflict that occurs when the \authorindex\ package option \ltxinp{withbib} is |
| 657 |
used. |
| 658 |
|
| 659 |
\subsubsection{\package{bibunits}} |
| 660 |
|
| 661 |
To make \package{bibunits} to work with \authorindex, in \file{bibunits.sty}, |
| 662 |
replace the lines |
| 663 |
\begin{verbatim} |
| 664 |
\def\bu@@citex[#1]#2{% |
| 665 |
\end{verbatim} |
| 666 |
by |
| 667 |
\begin{verbatim} |
| 668 |
\def\bu@@citex[#1]#2{\@aicitey{#2}% |
| 669 |
\end{verbatim} |
| 670 |
and save the modfied file under a new name. |
| 671 |
|
| 672 |
|
| 673 |
\subsubsection{Other packages} |
| 674 |
|
| 675 |
\begin{description} |
| 676 |
\item[\package{monog3}] A class from Oxford University Press that used |
| 677 |
\package{chicago}. See section~\ref{sec:chicago}. |
| 678 |
\end{description} |
| 679 |
|
| 680 |
|
| 681 |
\section{Problems and restrictions} |
| 682 |
|
| 683 |
Currently, I am aware of the following problems and restrictions: |
| 684 |
\begin{itemize} |
| 685 |
\item Compression of page numbers ignores whether the pages will be printed in |
| 686 |
the same font; that is, you might get something like ``7--\textbf{9}''. |
| 687 |
\item Compression always uses the full page numbers, that is you will always |
| 688 |
get something like ``4.8--4.10'' rather than ``4.8--10''. |
| 689 |
\item Sorting of names is restricted. At this time, special characters are |
| 690 |
stripped, the case is ignored, and a normal comparison according to the |
| 691 |
ASCII~Code is done. This might not be what you want if you have accented |
| 692 |
characters. Consider using the option \option{-i} in conjunction with |
| 693 |
additional processing by a more flexible tool. |
| 694 |
\item If you use \ltxinp{\aicite} with multiple arguments and a page break |
| 695 |
occurs within the list of generated references, one part of the citations |
| 696 |
will be associated with the wrong page. |
| 697 |
\item You can not use the package when you explicitly type your bibliography in |
| 698 |
your \LaTeX\ file (\ltxinp{\bibitem}) instead of using \BibTeX. Consider |
| 699 |
using \BibTeX\ instead. It is a powerful bibliographical tool worth the |
| 700 |
small additional effort. |
| 701 |
\end{itemize} |
| 702 |
|
| 703 |
\section{Acknowledgement} |
| 704 |
|
| 705 |
I want to thank Mark A. Gordon for his substantial improvements to the language |
| 706 |
and presentation in this manual. |
| 707 |
|
| 708 |
|
| 709 |
\begin{thebibliography}{3} |
| 710 |
|
| 711 |
\bibitem{Patashnik88a} |
| 712 |
O.~Patashnik. |
| 713 |
\newblock \textit{{\BibTeX ing}} (1988). |
| 714 |
\newblock Documentation for general {\BibTeX} users. |
| 715 |
|
| 716 |
\bibitem{Beebe98} |
| 717 |
N.~H.~F. Beebe. |
| 718 |
\newblock \textit{{AUTHIDX}: An author/editor indexing package}. |
| 719 |
\newblock TUGboat \textbf{19}(1):1001--1007 (1998). |
| 720 |
|
| 721 |
\bibitem{Patashnik88b} |
| 722 |
O.~Patashnik. |
| 723 |
\newblock \textit{Designing {\BibTeX} styles} (1988). |
| 724 |
\newblock The part of \BibTeX's documentation that's not meant for general |
| 725 |
users. |
| 726 |
|
| 727 |
\end{thebibliography} |
| 728 |
|
| 729 |
\end{document} |
| 730 |
|
| 731 |
%%% Local Variables: |
| 732 |
%%% mode: latex |
| 733 |
%%% TeX-master: t |
| 734 |
%%% End: |