# Index: Repeat first-level item on new column/page?

In my family history book, I'm using a two-level index. First level is surname, and second level is given name. Index items are defined such as the following:

\index{Doe!John}


Often a first-level will contain many second-level items (one surname, many given names). When the second-level overflows to a new column or page, I would like to repeat the first-level item. Is this possible?

Here is an example of the default behavior:

Column 1:

Doe
John, 3, 6, 9
Melvin, 6, 14, 18
Sally, 24, 32


Column 2:

    Timothy, 11, 15, 27
Victor, 5
Smith
Gary, 7, 18


Here is what I would like to see:

Column 1:

Doe
John, 3, 6, 9
Melvin, 6, 14, 18
Sally, 24, 32


Column 2:

Doe (continued)
Timothy, 11, 15, 27
Victor, 5
Smith
Gary, 7, 18


Note the "Doe (continued)" at the start of column one. This combines re-showing the level-one name, and appending text to it.

Is this possible?

Edit: Here is a minimum working example.

\documentclass[a4paper]{article}

\usepackage[paperwidth=8.5in,paperheight=3in]{geometry}

\usepackage{makeidx}
\makeindex

\begin{document}

Some text.

\index{Jones!Alvin}
\index{Jones!Billy}
\index{Jones!Carter}
\index{Jones!Dennis}

\index{Smith!Alex}
\index{Smith!Brian}
\index{Smith!Carrie}
\index{Smith!Dewey}
\index{Smith!Eric}
\index{Smith!Frank}
\index{Smith!Gary}
\index{Smith!Huey}
\index{Smith!Irma}
\index{Smith!Joey}
\index{Smith!Kevin}
\index{Smith!Louie}
\index{Smith!Martin}
\index{Smith!Ned}
\index{Smith!Opal}
\index{Smith!Paul}
\index{Smith!Quincey}
\index{Smith!Rosie}
\index{Smith!Steven}
\index{Smith!Thomas}

\index{White!Alice}
\index{White!Barney}

\printindex

\end{document}


I run it through the following:

pdflatex MWE.tex
makeindex MWE.idx
pdflatex MWE.tex


This produces a PDF where the index has "Smith" names across columns one and two on page one, and in column one on page two. I'd like to have page one, column two and page two, column one both begin with "Smith (continued)", but have yet to find any way to accomplish this.

-
+1 Very nice (and indeed useful) question! – yo' Feb 17 '13 at 8:29

The repeatindex package (from 2001) offers this functionality (note that it requires a special .ind format which may be created using the accompanying style file repeatindex.ist). However, the package README lists some known problems:

• When an item is repeated a small vertical space is included two items later
• If the last item is a subitem and the only entry on the last page of the index the repeation is omitted

Both problems are present in your modified example. A third problem is that repeatindex doesn't seem to cope with index items that exclusively point to subitems (i.e., don't feature at least one self-contained entry), so I had to to add \item{Jones}, \item{Smith}, and \item{White} to your example.

\documentclass[a4paper]{article}

\usepackage[paperwidth=8.5in,paperheight=3in]{geometry}

\usepackage{makeidx}
\makeindex

\usepackage{repeatindex}

\usepackage{filecontents}

\begin{filecontents}{\jobname.mst}
item_0 "\n  \\item ["
delim_0 "], "
\end{filecontents}

\begin{document}

Some text.

\index{Jones}
\index{Jones!Alvin}
\index{Jones!Billy}
\index{Jones!Carter}
\index{Jones!Dennis}

\index{Smith}
\index{Smith!Alex}
\index{Smith!Brian}
\index{Smith!Carrie}
\index{Smith!Dewey}
\index{Smith!Eric}
\index{Smith!Frank}
\index{Smith!Gary}
\index{Smith!Huey}
\index{Smith!Irma}
\index{Smith!Joey}
\index{Smith!Kevin}
\index{Smith!Louie}
\index{Smith!Martin}
\index{Smith!Ned}
\index{Smith!Opal}
\index{Smith!Paul}
\index{Smith!Quincey}
\index{Smith!Rosie}
\index{Smith!Steven}
\index{Smith!Thomas}

\index{White}
\index{White!Alice}
\index{White!Barney}

\printindex

\end{document}


-
This gets me very close to what I'm looking for, especially, since I can \renewcommand on \entryprefix and \entrypostfix. I'll have to see if I can figure out how to remove the page numbers from the top-level items, however. – Christopher Fritz Feb 17 '13 at 18:51
@ChristopherFritz - did you work out how to remove the page numbers from the top-level items? – richard Dec 19 '14 at 0:59