I have two questions:

  1. Is it possible to change the titel of the printindex command? It is "Index" by default.
  2. How can I format the index as a multi column, alphabetic sorted list?

printindex title Alphabetically sorted printindex


5 Answers 5


the answers depend on what document class you're using. however,

  1. both the basic latex classes (book et al.) and and ams-latex classes (amsbook et al.) provide the command \indexname with a default value "Index". so

    \renewcommand{\indexname}{New name}

    will change the title. (the babel package does this already for a number of languages.)

  2. both book.cls and amsbook.cls provide a two-column index style. if you're creating your own class, you might consider "borrowing" the code from one of those classes. documented code is given in the .dtx files classes for basic latex and amsclass for the ams-latex classes. "human readable" versions of the documented code are given in .pdf files of the same names as the .dtx files. all are on ctan, and they are probably also on your tex installation; try typing texdoc classes or texdoc amsclass at the command line.

to get the content sorted, you need to use makeindex; that is well documented in several places, including lamport's latex manual and the "companionn", as well as with texdoc makeindex. be sure to pay attention to the use of the "sort field" for math entries, entries with accented letters, and other special cases that may cause entries to diverge from the expected alphabetical order.

addendum: the imakeidx package is a good choice if more than one index is being produced. it isn't necessary to identify an entry for the main index by anything other than the basic \index command; for an odditional index, the designation of that index is entered as an option: \index[<name>]{<entry>}. a further advantage of imakeidx is that in most cases, a second compilation pass isn't needed. there are some caveats; for details, see the package documentation.

  1. Redefine \indexname. For example:

    \renewcommand\indexname{The Index}
  2. There are imakeidx and idxlayout packages to change the style of the index. Columns and headings, and other settings.

  3. You can specify a .ist file when using makeindex program to change the output of makeindex. See the document of makeindex.

A sample .ist file:

% sample.ist
% Usage
%     makeindex -s sample.ist foo.aux
preamble "
    \\item \\textbf{#1}\\nopagebreak}

postamble "\n\n\\end{theindex}\n"

group_skip "  %\n  \\indexspace\n  %\n"

headings_flag 1
heading_prefix "  %\n  \\indexgroup{"
heading_suffix "}\n  %\n"

numhead_positive "Numbers";
numhead_negative "Numbers";
symhead_positive "Symbols";
symhead_negative "Symbols";

I'm just expanding Leo Liu's item #2 a little. imakeidx can easily help you on setting a custom index title and column numbers through (from documentation):

  • title: is the title that is typeset at the beginning of the specific index; if not specified, the \indexname value is used.

  • columns: accepts an integer representing the number of columns in the index; this is silently ignored if the original or the twocolumn options are set; the number can even be 1.

A quick addition to your document preamble:

\makeindex[title=My custom index title,columns=2]

will do the job. If you have, say, a custom mystyle.ist style, you can also use the options option as well:

  • options: is the list of options to be passed to the sorting and formatting program; this list is a balanced text of program options, separated with the syntax required by the sorting and formatting program. For example, in order to use a different makeindex sorting and formatting style mystyle.ist and avoiding any message in the screen output write options=-s mystyle.

Regarding a custom makeidx style, unfortunately I have no experience with it. I strongly recommend chapter 11 from "The LaTeX Companion" book, called Index Generation. :)

  1. Redefine \indexname like this : \renewcommand{\indexname}{My index}.

  2. You define a .ist file that stores your preferences for the style of the index. For the example you want (alphabetic list starting by the letters and dots before page numbers), you add the following lines to your .ist file :

>     heading_prefix "{\\bfseries\\hfil "
>     heading_suffix "\\hfil}\\nopagebreak\n" 
>     headings_flag 1

and also

delim_0 "\\dotfill"
delim_1 "\\dotfill"
delim_2 "\\dotfill"

If it based on a book derived class, the index will be on two columns anyway.

  • Unfortunately, it doesn't work well with LuaLatex. It provides the dots, but no the bold big letters. Do you know any solution? Commented Feb 20, 2017 at 14:58

I am using amsmidx. I had to use

\addcontentsline{toc}{chapter}{Author Index}
\renewcommand{\indexname}{Author Index}
\addcontentsline{toc}{chapter}{Subject Index}
\renewcommand{\indexname}{Subject Index}

Don't add the index name to \printindex or you will get two indexes with each name, use \renewcommand{\indexname}{My Index Name} instead. Thanks to two commenters below, but adding a \clearpage just before the second \addcontentsline made my table of contents disappear.

  • With what package for multiple indices?
    – egreg
    Commented Jan 1, 2012 at 21:35
  • The \clearpage after \backmatter is superfluous because \backmatter will issue \clearpage resp. \cleardoublepage (depending on the state of @openright). On the other hand, a \clearpage before the second \addcontentsline is missing, and this will cause a wrong page number entry in the ToC.
    – lockstep
    Commented Jan 1, 2012 at 21:40
  • amsmidx is meant to be used with amsbook, and is presumed to be incompatible with any non-ams document class. when used with amsbook, the proper access is \Printindex{author}{Author Index} \Printindex{subject}{Subject Index} (note the uppercase \Printindex); the toc entries are added automatically. amsmidx was created long before imakeidx; now that imakeidx exists, it's a much better choice. Commented Nov 8, 2014 at 13:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .