Based on Ulrike's answer, here is one way to invoke xindy
to get it to sort .idx
files created by Xe/LuaLaTeX. The trick is to use xindy
directly (instead of texindy
) and pass the -C utf8
flag.
Minimal Example
\documentclass{article}
\usepackage{luatextra}
\usepackage{makeidx}
\makeindex
\begin{document}
üäö
start
\index{a}\index{b}\index{ä}\index{ü}
end
\printindex
\end{document}
Compilation
lualatex filename.tex
xindy -M texindy -C utf8 -L german-duden filename.idx
lualatex filename.tex
In (pdf)latex
you can use UTF-8 encoding and xindy in the following way:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{makeidx}
\makeindex
\begin{document}
start
\index{a}\index{b}\index{ä}\index{ü}
end
\printindex
\end{document}
And then simply run texindy -L ⟨language⟩ ⟨filename⟩.idx
.
In LuaTeX you can also use the luainputenc
package to use legacy encodings.
\documentclass{article}
\usepackage{fontspec}
\usepackage[utf8]{luainputenc}
\usepackage{makeidx}
\makeindex
\begin{document}
start
\index{a}\index{b}\index{ä}\index{ü}
end
\printindex
\end{document}
Again, run texindy -L ⟨language⟩ ⟨filename⟩.idx
.
Here the result for both examples: