Alas, all is not well with the proposed solution using
\gobbletwo
afer all. After each use of
\seeonly
,
\also
or
\Also
that involve
\gobbletwo
, the next index entry is printed run-on to the end of that "see also" or "See also" line. Here's the source:
Code: Select all
\documentclass{article}
\usepackage{makeidx}
\makeindex
\newcommand\gobbletwo[2]{}
\newcommand*{\seeonly}[2]{(\emph{see} #1)}
\newcommand*{\also}[2]{(\emph{see also} #1)}
\newcommand{\Also}[2]{\emph{See also} #1}
\begin{document}
This is a short book. It's about zero.
\index{zero elements}
\index{zero \seeonly{zero elements}|gobbletwo}
\index{additive identity \seeonly{zero elements}|gobbletwo}
\index{additive subtraction}
Therefore, it's also about nothing.
\index{nothing}
\index{nothing!zz@\also{zero elements}|gobbletwo}
Which means null.
\index{null}\index{nothing!nil}
That's the same as zilch.
\index{zilch}
\index{zilch!zero}
\index{zilch!\Also{nothing}|gobbletwo}
\newpage
Another name for zilch is nil.\index{zilch}
\printindex
\end{document}
The printed index looks roughly like this (in the proper font, and with "see", "see also", and "See also" in italics, of course):
Code: Select all
additive identity (see zero elements) ad-
ditive subraction, 1
nothing, 1
nil, 1
(see also zero elements) null, 1
zero (see zero elements) zero elements,
1
zilch, 1, 2
See also nothing zero, 1
Notice how the top-level entry "additive subtraction" is run-on with the preceding entry. Likewise the top-level entries "null" and "zero elements".