LaTeX forum ⇒ MakeIndex, Nomenclature, Glossaries and AcronymsMakeindex: group extra sorted subentries that have |see

Information and discussion about MakeIndex - the tool to generate subject indices for LaTeX documents.
user49915
Posts: 76
Joined: Wed Apr 17, 2019 12:51 pm

Makeindex: group extra sorted subentries that have |see

Postby user49915 » Wed Mar 25, 2020 8:35 pm

Let us create a source file mwe.tex containing

\documentclass{article}
\pagestyle{empty}
\usepackage[USenglish,ngerman]{babel}
\usepackage{makeidx}
\makeindex
\newcommand{\indexUSeWithSubsubentryAsGer}[4]{\index{000#1 #2 #3@\foreignlanguage{USenglish}{#1}!\foreignlanguage{USenglish}{#2}!\foreignlanguage{USenglish}{#3}|see{#4}}} % for 3-level USenglish English -> German "siehe" entries
\begin{document}
\index{Zustandsraum!lokaler}\emph{geteilter Zustandsraum} (engl.\@ \indexUSeWithSubsubentryAsGer{space}{state}{shared}{Zustandsraum, geteilter}\emph{\foreignlanguage{USenglish}{shared state space}})

\index{Zustandsraum!geteilter}\emph{lokaler Zustandsraum} (engl.\@ \indexUSeWithSubsubentryAsGer{space}{state}{local}{Zustandsraum, lokaler}\emph{\foreignlanguage{USenglish}{local state space}})

\printindex
\end{document}


and feed it to the loop pdflatex mwe && makeindex mwe. The intention of 000 above is to obtain first an index of English terms then followed by an index of German terms. The result is this:
page1.png
page1.png (22.89 KiB) Viewed 482 times

page2.png
page2.png (47.65 KiB) Viewed 482 times

However, you expected that the subentries would be grouped compactly, as in

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. space
  2. state
  3. local, siehe Zustandsraum, lokaler
  4. shared, siehe Zustandsraum, geteilter
  5.  
  6. Zustandsraum
  7. geteilter, 1
  8. lokaler, 1


How to make the pdflatex-makeindex loop do it? (Aside: please stay with pdflatex and makeindex programs. If possible, do not switch to [xe|lua]latex, do not abandon makeindex, and retain English-language switches (which are useful in case of differences in ligatures, microtyping in general, and hyphenation). As you might imagine, the actual, non-minimal source file is a large book with its own ecosystem of hacks around indexing that jive with each other, and switching to another setup is very likely to incur a different question.)

Crossposts: http://texwelt.de/fragen/26229 , http://golatex.de/viewtopic,p,110783.html .
Last edited by user49915 on Thu Mar 26, 2020 11:57 am, edited 3 times in total.

User avatar
Ijon Tichy
Posts: 269
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Wed Mar 25, 2020 10:29 pm


User avatar
Ijon Tichy
Posts: 269
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Thu Mar 26, 2020 12:28 am

Can you please translate the accepted answer given on TeXwelt, that the users, who do not understand German, can also read and understand it? IMHO in the principle of reciprocity this would be fair and appropriate after you've thrown the same question into at least four forums in two different languages.


Return to “MakeIndex, Nomenclature, Glossaries and Acronyms”

Who is online

Users browsing this forum: No registered users and 1 guest