2

Consider the code

\documentclass{book}
\usepackage{imakeidx}
\let\cleardoublepage\clearpage
\makeindex
%\usepackage[font=normalsize]{idxlayout}
\usepackage{idxlayout}
\usepackage{xcolor}

\begin{document}
\Large

This sentence is to be indexed.\index{FAMOUS QUOTES@\textbf{FAMOUS QUOTES}!01@ \textbf{\textit{\color{red}{Ich bin ein Berliner}}} \textit{See also}, \textbf{DOUGHNUT}}

Another to be indexed. 
\index{FAMOUS QUOTES@\textbf{FAMOUS QUOTES}!02@ \textbf{\textit{\color{red}{Denkansto{\ss}}}}}
\idxlayout{columns=1}
\printindex
\end{document}

which produces the index:

enter image description here

I would like to place the "See also DOUGHNUT" comment a little to the right of the page number, and on the same line as "Ich bin ein Berliner". How may I accomplish this?

Thank you.

3
  • your see also is just entered as free text so rather hard to control, why not use makeindex |see markup so the system at least knows this is a cross reference Dec 9, 2021 at 17:49
  • @David Carlisle I tried that. When I put |see{\textbf{DOUGHNUT}} immediately to the left of the last closing brace, the page number disappears. Moreover, |see gives see and not see also. And alas, if I place |see{\textbf{DOUGHNUT}} outside of the said closing brace, the comment does not appear at all. Hence, the makeshift way of the MWE.
    – DDS
    Dec 9, 2021 at 19:08
  • 1
    |see just executes \see which is defined as \newcommand*\see[2]{\emph{\seename} #1} there is also |seealso defined as \providecommand*\seealso[2]{\emph{\alsoname} #1} and you could define |seealsowithpage that didn't discard #2. Dec 9, 2021 at 19:12

1 Answer 1

3

You want a version of |see that does not discard the page number:

enter image description here

\documentclass{book}
\usepackage{imakeidx}
\let\cleardoublepage\clearpage% hmmm
\makeindex
%\usepackage[font=normalsize]{idxlayout}
\usepackage{idxlayout}
\usepackage{xcolor}

\newcommand\seezz[2]{#2\quad\textit{see also} #1}

\begin{document}
\Large

This sentence is to be indexed.\index{FAMOUS QUOTES@\textbf{FAMOUS QUOTES}!01@ \textbf{\textit{\color{red}{Ich bin ein Berliner}}}|seezz{\textbf{DOUGHNUT}}}

Another to be indexed. 
\index{FAMOUS QUOTES@\textbf{FAMOUS QUOTES}!02@ \textbf{\textit{\color{red}{Denkansto{\ss}}}}}
\idxlayout{columns=1}
\printindex
\end{document}
1
  • Thank you once again for your help.
    – DDS
    Dec 9, 2021 at 20:43

You must log in to answer this question.

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