It is not clear to me what kind of issues you are experiencing, so I will give you complete example on how to use modern LaTeX
engine (lualatex
or xelatex
) with xindy
. With pdflatex
, there might be some problems with accented characters, see this answer for some details.
So in our example, we have utf8 file with some Czech language index and glossary entries:
\documentclass{article}
\usepackage[]{fontspec}
\usepackage[czech]{babel}
\usepackage[xindy={language=czech, codepage=utf8}, style=altlist]{glossaries}
\usepackage[xindy, splitindex]{imakeidx}
\usepackage[itemlayout=singlepar]{idxlayout}
\setmainfont{TeX Gyre Termes}
\makeglossaries
\def\xindylangopt{-M lang/czech/utf8-lang}
\makeindex[options=\xindylangopt]
\makeindex[name=nameindex,title = Index of names, options=\xindylangopt]
\newglossaryentry{first}{name = ddd, description = {První položka}}
\newglossaryentry{second}{name = čokoláda, description = {Druhá položka}}
\newglossaryentry{third}{name = cosi, description = {Třetí položka}}
\begin{document}
Hello worls, \gls{first}, \gls{second} and \gls{third}
\index[nameindex]{Čapek, Karel}
\index[nameindex]{Hašek, Jaroslav}
\index[nameindex]{Cílek, Václav}
\index[nameindex]{Deml, Jakub}
\index[nameindex]{Chalupa, Václav}
\index{Hello|see{Entry}}
\index{Entry!Subentry}
\index{Entry!Another subentry}
\index{What|textbf}
\printglossary
\printindex[nameindex]
\printindex
\end{document}
Some important points:
\usepackage[xindy={language=czech, codepage=utf8}, style=altlist]{glossaries}
glossaries
package have built in xindy support, we only have to set xindy option and pass correct arguments for language and codepage. makeglossaries
script will take care of correct xindy call for us.
\usepackage[xindy, splitindex]{imakeidx}
...
\def\xindylangopt{-M lang/czech/utf8-lang}
\makeindex[options=\xindylangopt]
\makeindex[name=nameindex,title = Index of names, options=\xindylangopt]
for index creation, we use imakeidx
package. There we create two indexes, one general and other for names. xindy
option will call xindy automatically on LaTeX
run
\xindylangopt
macro defines xindy options for language processing, -M lang/czech/utf8-lang
will use xindy module for the Czech language in utf8
encoding.
two uses of \makeindex
will create two indexes, there are many options which can be used for formatting of these indexes, see imakeidx
manual.
For example of another mean of controlling index appearance, I used also
\usepackage[itemlayout=singlepar]{idxlayout}
which will result in index in run-in style. I don't like it much, I just wanted to show you what can be done :). idxlayout
package really isn't necessary, but maybe you will find it useful.
Now how to compile the example:
lualatex sample.tex
makeglossaries sample
lualatex -shell-escape sample.tex
first lualatex
run will write glossary and index entries, makeglossaries
script will compile the glossary, second lualatex
run is with -shell-escape
option, so indexes are creaed by imakeidx
automatically.
The result:
Best Answer
Could it be that you are using a file with windows line endings? If I create a perso.ist with CR+LF line endings I get:
but with just LF it works ok:
If you are using texlive on windows, I think this qualifies as a bug in the included makeindex.