I'm writing a text where there will be several index entries for short biographies. The index entries for persons are supposed to be in small caps and the biography entries will get page numbers in italics, so I have these definitions:
\newcommand{\ii}[1]{{\it #1}}
\newcommand{\ppindex}[1]{\index{#1@\textsc{#1}|ii}}
I can thus simply write \ppindex{Hilbert, David}
to generate the entry I want. So far, so good.
However, I also have
suffix_2p "\\nohyperpage{\\,f.}"
suffix_3p "\\nohyperpage{\\,ff.}"
in the .ist
file and these biographies will always be exactly two pages long, so the entry for, say, Hilbert should be numbered '42f.' and not just '42'. I can achieve this by inserting two \ppindex
commands in the text, but I am wondering if there is a way to automate this so that one instance of \ppindex
takes care of an index entry for the current page and the following one?
I was asked to provide a MWE, so here it is. I didn't provide the .ist
file because it is tangential to my problem.
\documentclass{article}
\usepackage{imakeidx}
\newcommand{\ii}[1]{{\it #1}}
\newcommand{\ppindex}[1]{\index{#1@\textsc{#1}|ii}}
\makeindex
\begin{document}
Text \ppindex{Zappa, Frank}
\clearpage
More text
\ppindex{Zappa, Frank} % get rid of this command
\clearpage
Text \ppindex{Cantor, Georg}
\clearpage
More text
\ppindex{Cantor, Georg} % and this one
\printindex
\end{document}
What I'm looking for is a modified version of \ppindex
so that I get exactly the same index if the two lines with comments are removed.