1

I am writing a large book consisting of a base document and included chapters and have defined a special index:

\makeindex[name=artists,title=Index of artists,columns=2]

I would like to add some fixed text on the first page of only this special index (not the regular Index), under its title, of the form

Page numbers in bold refer to blahblahblah...

I've tried simply adding this text to the base book document before or after the \makeindex... command, but this doesn't work. (Nor did I really expect it to.)

How do I add such a line to a specialized index, under its title?


Thanks to @Ivan's answer below, I figured out how to place such a note in only one of the indexes: place the special text line

\setindexprenote{Page numbers in bold refer to blahblahblah...}

before printing the associated index, but afterwards "clear" it by putting in new "empty" text,

\setindexprenote{ }

or better

\noindexprenote

that gets set in other indexes.

1
  • 1
    With the updated answer below you do not need \setindexprenote{ } anymore as \indexprologue only affects the next \printindex
    – Ivan
    Mar 18, 2021 at 11:15

1 Answer 1

2

enter image description here

enter image description here

The first solution should be to use \indexprologue{...} just before the index that requires a prenote:

\documentclass{book}
\usepackage{imakeidx}
  \makeindex[name=artists,title=Index of artists,columns=2]
  \makeindex[name=locations,title=Index of locations,columns=2]

\begin{document}
 
Hello World\index[artists]{World, Hello}

St. Anford\index[locations]{St. Anford}

\indexprologue{Page numbers in bold refer to blahblahblah...}
\printindex[artists]
\printindex[locations]

\end{document}

You can achieve the same result through idxlayout and the \setindexprenote command:

\documentclass{book}
\usepackage{imakeidx}
\usepackage[totoc,columns=1]{idxlayout}
  \makeindex[name=artists,title=Index of artists,columns=2]
  \makeindex[name=locations,title=Index of locations,columns=2]

\begin{document}
 
Hello World\index[artists]{World, Hello}

St. Anford\index[locations]{St. Anford}

\setindexprenote{Page numbers in bold refer to blahblahblah...}
\printindex[artists]
\noindexprenote
\printindex[locations]

\end{document}

In this case you can limit the prenote to a particular index also by enclosing it in a group:

\begingroup
\setindexprenote{Page numbers in bold refer to blahblahblah...}
\printindex[artists]
\endgroup
\printindex[locations]
2
  • Almost... almost. I need to place this added text line on only the special index (Index of artists) but not the regular Index. Alas, your solution puts it on both. How do I limit it to just one of the several indexes? Mar 18, 2021 at 1:02
  • 1
    According to the idxlayout documentation: "With multiple indexes, use the command \noindexprenote to reset the prenote text to empty and to take care of the proper spacing between index heading and first entry.". I will update the answer.
    – Ivan
    Mar 18, 2021 at 10:33

You must log in to answer this question.

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