I want an index using makeindex to have entries like the following (where I've used ~~~ and ~~~~~~ to indicate indenting for subentries and sub subentries):
~~~ nil, 1
~~~~~~ and zero, 1
~~~~~~ (see also null elements}
~~~ null, 1
~~~ See also zero elements
null elements, 1
zero (see zero elements)
zero elements, 1
Note the following formatting requirements shown:
- A "See also ..." for a main entry begins with an upper-case "S".
- A "(see also ...)" for a subentry is indented below the subentry and enclosed in parens.
- A "(see ...)" cross-reference is enclosed in parens.
- A "(see ...)" cross-reference does not include a comma after the (sub)entry on its line.
- A "see" or "see also"/"See also" entry does not end with a page number.
A working source file that produces the result
The following source file will accomplish that:
Simplification & improvement sought
Can this be simplified by suitable definitions that would avoid having to explicitly include the `|gobbleone` in each "see only" and "see" entry? And it would even be better if I did not have to explicitly include the `zzzzz@` sort key that puts the "see also" subentries after all others.
I would strongly prefer definitions written in LaTeX (using `newcommand`) rather than at lower-level TeX (using `\def`).
These related postings unfortunately do not seem to accomplish what I need: