The order is controlled by the page number. The feature "see" is implemented as encapsulating command:
\index{quantifiers|textbf}% bold page number
\index{quantifiers|see{numbers, cardinal}}%
Makeindex appends the page number, thus the following macro is called in \printindex
:
\textbf{1} and \see{numbers, cardinal}{1}
The implementation of \see
ignores the page number, but Makeindex sorts the page numbers. With them, the page numbers and see statements are sorted.
The following example defines \indexsee{<index entry>}{<see entry>}
that writes the index entry with a quite large page number to sort it at the end.
Also the page number is increased each time to avoid warnings of Makeindex, if it sees different encapsulating commands for the same entry.
Macro \index
reads it argument in verbatim mode. Therefore \indexsee
should do the same to avoid different outcome of the same index keys (more less spaces, expansion, ...).
\documentclass{article}
\usepackage{makeidx}
\makeindex
\makeatletter
\newcommand*{\indexsee}{%
\@bsphack
\begingroup
\@sanitize
\@wrindexsee
}
\newcommand*{\@wrindexsee}[2]{%
\stepcounter{indexsee@page}%
\protected@write\@indexfile{}{%
\string\indexentry{#1|see{#2}}{\the\value{indexsee@page}}%
}%
\endgroup
\@esphack
}
\newcounter{indexsee@page}
\setcounter{indexsee@page}{10000}
\makeatother
\begin{document}
Hello
\index{numbers, cardinal}
\index{numbers, funny}
\indexsee{quantifiers}{numbers, funny}
\newpage
World
\index{quantifiers}
\newpage
\null
\indexsee{quantifiers}{numbers, cardinal}
\printindex
\end{document}
File test.idx
, written by the LaTeX run:
\indexentry{numbers, cardinal}{1}
\indexentry{numbers, funny}{1}
\indexentry{quantifiers|see{numbers, funny}}{10001}
\indexentry{quantifiers}{2}
\indexentry{quantifiers|see{numbers, cardinal}}{10002}
File test.ind
, generated by Makeindex:
\begin{theindex}
\item numbers, cardinal, 1
\item numbers, funny, 1
\indexspace
\item quantifiers, 2, \see{numbers, funny}{10001},
\see{numbers, cardinal}{10002}
\end{theindex}