The authorindex Package

Andreas Wettstein

January 1998

Abstract

The authorindex Package is intended to generate a list of all authors cited in a work along with a list of pages where these citations occur. Alternatively, the labels of the works that appear in the references can be listed instead of the pages. The package needs perl to run. The use of BibTEX is mandatory. The package can be used stand alone or as a preprocessor for makeindex.

1 Installation

The authorindex-Package consists of the L^{A}TEX style file authorindex.sty and the perl script authorindex. It needs L^{A}TEX 2ε, BibTEX [1] and perl to run.

To install the package, move authorindex.sty to a place where L^{A}TEX looks for its style files. The perl script authorindex must be moved to a place in your executable path and be given execution permission. You might also have to modify the path to the perl binary that appears in the first line of the script authorindex, replacing /usr/bin/perl by the correct path.

2 Using the package

2.1 Modifications in your Text

2.1.1 Preamble

To use the authorindex-Package, in the preamble say

\usepackage{authorindex}

The package accepts several options.

• Concerning the appearance of the author index:

small will cause the author index to be set in small size.

normal will cause the author index to be set in the normal text size. This is the default.

• To control which names make it into the index:

editors will cause the editor names to be included in the author index.

onlyauthors will restrict the author index to the author names. This is, of course, the default.

onlyfirst will include only the leading author (or editor) of each publication in the index.

all will include all authors (or editors) of each work in the index (default).

• To control how the names are formatted:

lastname will only include the last name of the authors (and titles like “von”, if present).

firstabbrev will also include the abbreviated first name(s) (and eventually also a “jr.”), following the last name.

fullname finally will spell out the names in full (as complete as the names are present in the database). This is the default.

• To choose what kind of references appear in the index:

withbib will (apart from the pages where citations occur) also list the page of the bibliography entry where an author appears in the index.

biblabels will include the label of the works (as it appears in the references) the author has written into the authorindex

pages the pages of citations occur in the references (default)

Optionally, you can use \authorindexstyle{somestyle} in the preamble, which causes the file somestyle.bst to be used to format the author names. This can be useful if the options described above still are not enough for you to get the format of the author names the way you like. To generate own formatter files, see Sec. 3.2 below.

Also optionally, \aipagetypeorder{order} determines the relative order of different types of page numbers. order is a string that consists of one of the characters rRnAa, which stand for lowercase roman, uppercase roman, arabic, uppercase alphabetic and lowercase alphabetic page numbers. The relative order of the page numbers is given by the order of the letters in the string. rn, for example, will sort all lowercase roman pages before the arabic pages. If you want to use lowercase alphabetic numbers, you have to use \aipagetypeorder and must not put r in the string, that is, you can’t use lowercase roman numbers and lowercase alphabetic numbers at the same time (but you can use uppercase roman and alphabetical page numbers together). Composite page numbers (like “4-17”) are split into their components (using any character that cannot be interpreted as a digit as field separator) and sorted with priority of components decreasing from left to right.

2.1.2 In the text

If you use the biblabels option, any citation will generate an entry in the author index.

If you don’t use the biblabels option, within the text, wherever you make a citation the author of which should go into the index, instead if using \cite, you must use \aicite.^{1} This command has exactly the same syntax as \cite. As an additional possibility you can use the command \aimention. Its single argument is an author name in BibTEX name format (or more of them, separated BibTEX-like by and. I don’t recommend giving more than one author here, however, because when using the option onlyfirst, you probably won’t get what you want.)

At the place where you want the author index to appear, put

\printauthorindex

in your source. This will later simply include the list the authors and the pages on which they are cited. Note that no chapter (or section) is started and the page layout is unchanged. It is up to you to do that according to your needs, either by explicitly putting necessary stuff in front or by customizing according to Sec. 3.1. Note also that you won’t use \printauthorindex when using authorindex as a preprocessor for makeindex (see Sec. 2.2).

2.2 Running authorindex

After having run L^{A}TEX on the properly prepared L^{A}TEX-source, you have to process the generated .aux-files to generate the author index file (extension .ain). This is done by the perl script authorindex. The script can be called with any number of arguments.

With zero arguments, authorindex reads from the standard input. With several arguments, authorindex appends .aux extensions wherever necessary and processes these files. The output is written to the file whose name is extracted from the .aux-file where \printauthorindex was given. It is necessary to give the .aux-file containing \begin{document} to authorindex, as via this file information regarding style and content of the index is passed to the script. If you give no arguments at all, standard input is read.

If you use \include in your L^{A}TEX-source, it is sufficient to give the master .aux-file to authorindex; the .aux-files of included files are processed then automatically.

authorindex recognizes the following options:

-d (“draft”) Add additional information to the .ain file: For each author, the labels of all her works and the page numbers where they are cited are included as comments. This is meant to help you when manually editing the generated author index. Also, a little bit of statistics is included at the bottom of the .ain file. This does not work together with the -i option.

1If you put \let\cite=\aicite in the preamble after the loading of the package, you can make \cite behave like \aicite.

-h (“help”) Print out small help.

-i (“index”) Create a file suitable for further processing with makeindex; for example, you could use that to make a common author and subject index. Note the extension of the generated file still will be .ain. (Use the -p option and redirection to send the stuff anywhere else.)

-k (“keep”) The temporarily generated .bst-file is not deleted after authorindex finishes. This is intended to give you a good start point for advanced customization of the author index (see Sec. 3.2).

-p (“print”) Print the result to standard output instead of writing it to the .ain-file.

-r (“(don’t) recurse”) Do not automatically process .aux-files produced by included files.

3 Customization

3.1 Customizing the appearance

The author index is implemented via a special environment theauthorindex. For example, the file created by authorindex will create a file with the following content:

\begin{theauthorindex}
\item[Muster, Heinz] \aipages{7, 9, 23, \aibibpage{77}}
\item[M\"uller, Fritz] \aipages{iv, 2, \aibibpage{77}}
\indexspace
\item[Schmitt, August] \aipages{33, \aibibpage{78}}
\end{theauthorindex}

You can now change the appearance of the author index by

• Using \renewenvironment to redefine the entire environment. This is useful to include titles, switching to multi column mode, and redefining

     \indexspace;

• Redefining \aipages by \renewcommand to change the appearance of the page numbers;

• Redefining \aibibpage by \renewcommand to change the appearance of the page number of the bibliography entry (only used in connection with the withbib package option);

• Redefining \ainame, which is used by \item to format the names of the authors (one argument);

• Redefining \aisize, which switches to the font size in which the author index is printed.

3.2 Customizing the formatting of the names

If you want to do that, you have to know a little about .bst file hacking, e. g. by reading [2]. Your BibTEX style file has to generate a .bbl that contains two lines for each author. The first line is the name formatted according to your taste. The second line contains the label of the citation. The default .bst file used to format the names is embedded in the perl script authorindex. You probably can use this as template. To use your own style, use \authorindexstyle described in Sec. 2.1. To get a staring point for developing your own .bst file, use -k for authorindex (see Sec. 2.2).

4 If you have problems…

… it is probably my fault. I have tried out the package just on Linux and solaris and I don’t know much about problems you might have on other systems, especially non-Unix.

Apart from that, I am aware of the following problems and restrictions:

• If you use \aicite with multiple arguments and a page break occurs within the list of generated references, one part of the citations will be associated with the wrong page.

• The package will fail for very long author names above 79 characters long (including spaces, commas, etc) or very long citation labels (at that point they force a line break in BibTEX output).

• You can not use the package when you explicitly type in your bibliography in your L^{A}TEX file instead of using BibTEX.

References

[1] Oren Patashnik. BibTEXing, 8 February 1988. Documentation for general BibTEX users.

[2] Oren Patashnik. Designing BibTEX styles, 8 February 1988. The part of BibTEX’s documentation that’s not meant for general users.