# Placement of seealso-cross refs (with xindy)

Is there a way to have seealso cross references at the end of the index entry as the very last \subitem? They should look something like this:

Fruit
Apples, 3
Bananas, 4
Oranges, 9-10


By default, they are put right at the top of the index entry.

\documentclass{article}
\usepackage{makeidx}
\makeindex
\begin{document}
.\index{Fruit!Apples}\index{Vegetables}\index{Fruit|seealso{Vegetables}}
\printindex
\end{document}


I use xindy and currently have something like this as a custom module:

(markup-crossref-list :class "seealso" :open "~n\subitem\seealso{" :sep "; " :close "}{}")
(define-location-class-order ("roman-page-numbers" "see" "seealso"))


I could, of course, change the order of the subitem entries by hand in the *.ind file since I have to edit it for optimized line and page breaks anyway.

-

Use like below code:

\documentclass{article}
\usepackage{makeidx}
\makeindex
\begin{document}

.\index{Fruit!Apples}\index{Vegetables}

\index{Fruit!Orange}

\printindex
\end{document}

-
Or \index{Fruit!zzzzzzz@\textit{see also} Vegetables}, just in case that there is a Zig-zag vine or Ziziphus zizyphus in the fruit basket. – Stephen Mar 27 '12 at 15:12
@Stephen :-) Zucchini. There is also Zyzomys, but this is no vegetable at all … ;-) – Speravir Apr 15 '12 at 14:18
@Speravir :-)) But they could be found in a fruit basket, don't they? Maybe the owners of the basked would not want them to be there, but at least "zyz..." is a very good example! (Is there even a word (English or otherwise) after Zyzomys in the alphabet?) – Stephen Apr 15 '12 at 18:08
@Stephen: In Australian fruit baskets actually. Regarding a useful word after “zyzomys” – don’t know, I’m German as you. – Speravir Apr 15 '12 at 19:25
Caveat! In the Index "Z" might be sorted after "z"! In that case "zzzzzzz" should be replaced by "ZZZZZZZ", of course. – Stephen May 6 '12 at 18:03

I don’t know, whether this works with xindy, but with makeindex you can do one simple thing as workaround:

Put this index entry somewhere later in the document, where you are sure, that there is a new page created. At the place, where it thematically belongs, you could then add a comment as hint.

Edit:

This MWE works fine here with makeindex. Try it out with xindy.

\documentclass{article}
\usepackage[latin,english]{babel} % needed for "blindtext",
% "english" is the active language
\usepackage{blindtext,lipsum,kantlipsum}

\usepackage{makeidx}
\makeindex

\begin{document}

\section*{Package \texttt{blindtext}}

\subsection*{English blindtext}\index{blindtext (package)!english}
%%% see below before section "kantlipsum" for
%%% \index{blindtext (package)!english|seealso{kantlipsum}}
\blindtext[1]

\subsection*{Latin blindtext}\index{blindtext (package)!latin}
%%% see below before section "kantlipsum" for
%%% \index{blindtext (package)!latin|seealso{lipsum}}
{\selectlanguage{latin}% note the grouping
\blindtext[1]}

\newpage

\index{blindtext (package)!english|seealso{kantlipsum}}
\index{blindtext (package)!latin|seealso{lipsum}}

\section*{Package \texttt{kantlipsum}}\index{kantlipsum}
%%% see below before "\printindex" for
%%% \index{kantlipsum|seealso{blindtext (package) with english option}}
\kant[123]

\section*{Package \texttt{lipsum}}\index{lipsum}
%%% see below before "\printindex" for
%%% \index{lipsum|seealso{blindtext (package) with latin option}}
{\selectlanguage{latin}% actually not needed here
\lipsum[123]}% note the grouping again

\newpage

\index{kantlipsum|seealso{blindtext (package) with english option}}
\index{lipsum|seealso{blindtext (package) with latin option}}

\printindex

\end{document}


The comments with three percent signs are these, what I called “hints”. If this does not work with xindy, then I’m as clueless as you.

But should there be a reason, that this is not possible with xindy?

-
I'm sorry, I don't understand. In my real-life project (well over 200 pages long) I have all \index commands containing seealso cross references at the end of the document, right before the \printindex command. – Till A. Heilmann Feb 20 '12 at 1:18
@TillA.Heilmann: See my edit. If this doesn’t work with xindy I can’t help you. – Speravir Feb 20 '12 at 16:10
Thanks for the clarification! I now see that my question was probably not clear enough and has caused a misunderstanding: My cross references are neither in nor for sub entries (they always belong to the main index entry) but should only be displayed the same way as sub entries and be put after them. Sorry for all the work you put in. – Till A. Heilmann Feb 20 '12 at 19:16
@TillA.Heilmann: Ah, now I understand … – Speravir Feb 20 '12 at 19:55