0

I would like to build an a few Indices for a document that contain names in several languages. I understand from reading around that the way to go is imakeidx and to use texindy for the processing...since previous packages have problems with multiple indices and even ordering on foreign languages.

I got most of it working, except for one issue -- placing dots (ellipsis) between the end of the words and the page numbers.

I first tried man texindy on a version 2.5.1 that comes with TL'20. That sends the reader to "The LaTeX Companion (2nd ed.)" of some 15 years ago ... so I got that. But that sends one to the web-site xindy.org and even after that I can't get a good hold on how to do this simple task -- fill the spaces between the end of the line and the page number with dots as in:

fruit ........ 7
   apple .....11
   banana ....13

I have been able to work it out all the way to:

\documentclass{article}
\usepackage{makeidx}
\makeindex
\let\lettergroup\textbf
\usepackage{filecontents}

\begin{document}
\begin{filecontents*}{mal-style.xdy}
(markup-index :open  "\begin{theindex}~n"
    :close "~n~n\end{theindex}~n"
    :tree)

(markup-indexentry :open "~n\item " :close "" :depth 0)
(markup-indexentry :open "~n  \subitem " :close "" :depth 1)
(markup-indexentry :open "~n    \subsubitem " :close "" :depth 2)
(markup-locclass-list :open "\dotfill " :sep ", " :close "")
(markup-locref-list   :sep ", ")
\end{filecontents*}

\index{premier niveau}
\index{niveau!1@premier}
\index{niveau!2@deuxième}
\index{niveau!1@premier!1@premier}
\index{niveau!1@premier!2@deuxième}
\index{étrangères}
\index{Ça va}
\index{À quelle}

\printindex
My first paragraph\ldots
\end{document}

which is a simplification of the code by @Mailipivo here texindy equivalence to makeindex settings.

It uses makeidx and works fine and uses the Module to produce the dots unde xindy, but I have not been able to move it to imakeidx so I can use it for multiple indexes.

3
  • I have used the tocloft package in the past for the index. And it seems to me the right choice if you want to add leading dots from the chapters to the pages. See this question (which yours is a duplicate of in my opinion): Changing the TOC style of an Article document-class
    – Alenanno
    Oct 18, 2020 at 2:47
  • @Alenanno It is definitely NOT a duplicate question - period. The style of indices under xindy are controlled by modules using the package language.. got nothing to do with tocloft which is something I do not want to use in this project. Oct 18, 2020 at 3:07
  • This may be a sub-question of texindy equivalence to makeindex settings where the answer provides an makeidx style that uses the dots and the equivalent in texindy .. but I can't still make the relation in between the two due to the sorely missing xindy documentation. Oct 18, 2020 at 3:25

1 Answer 1

1

I was finally able to get the right combination with:

\documentclass{article}

\usepackage[xindy]{imakeidx}
   \makeindex[name=std, title=Remissivo]
   \makeindex[name=not, title=Notações]
\let\lettergroup\textbf

\begin{document}

My first paragraph\ldots

\index[std]{premier niveau}
\index[std]{niveau!1@premier}
\index[std]{niveau!2@deuxième}
\index[std]{niveau!1@premier!1@premier}
\index[std]{niveau!1@premier!2@deuxième}
\index[std]{étrangères}
\index[std]{Ça va}
\index[std]{À quelle}

\index[not]{premier niveau}
\index[not]{niveau!1@premier}
\index[not]{niveau!2@deuxième}
\index[not]{niveau!1@premier!1@premier}
\index[not]{niveau!1@premier!2@deuxième}
\index[not]{étrangères}
\index[not]{Ça va}
\index[not]{À quelle}

\printindex[std]
\printindex[not]

\end{document}

and using the module:

(markup-index :open  "\begin{theindex}~n"
    :close "~n~n\end{theindex}~n"
    :tree)

(markup-indexentry :open "~n\item " :close "" :depth 0)
(markup-indexentry :open "~n  \subitem " :close "" :depth 1)
(markup-indexentry :open "~n    \subsubitem " :close "" :depth 2)
(markup-locclass-list :open "\dotfill " :sep ", " :close "")
(markup-locref-list   :sep ", ")

with the sequence of commands:

xelatex file
texindy -C utf8 -L french -M mal-style std.idx
texindy -C utf8 -L french -M mal-style not.idx
xelatex file

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .