[Tex/LaTex] Problems with xindy and glossaries

glossariesindexingmactexxindy

I'm having a bit of a problem creating a glossary.
I'm working with a MacBook using Mountain Lion OS 10.8.3, I've installed MacTeX 2012 and details about xindy are:

xindy release: 2.4
xindy script version: 1.16
xindy kernel version: 3.0
CLISP version 2.48 (2009-07-28) (built on richard-kochs-computer.local [10.0.1.2])
architecture: X86_64

When I try to run this programme

\documentclass[10pt,twoside,a4paper,fleqn]{book}
\usepackage[utf8]{inputenc}
\usepackage{ifthen, xkeyval, xfor, amsgen}
\usepackage[xindy]{glossaries}
\usepackage{translator}
\makeglossaries

\begin{document}

\newglossaryentry{real number}
{
    name={real number},
    description={include both rational numbers and irrational numbers},
    symbol={\ensuremath{\mathbb{R}}}
}

\newglossaryentry{Agypten}
{
name = {{Ä}gypten}
description = {German:Egypt}
}

\chapter{Model chapter for a report}

This is the first chapter of the report. Most certainly it will have
    some \glspl{real number}. Maybe there will be
    something in German, like \gls{Agypten}

\printglossary

\end{document}

Now when I run makeindex in the terminal like this:

pdflatex document
makeindex document.glo -s document.ist -t document.glg -o document.gls
pdflatex document

it would work if I hadn't used Umlauts. Considering my Bachelor's thesis will most certainly be in German that would be rather suboptimal. Upon finding out that xindy works multilinguallx, I tried that as well:

pdflatex test
xindy -L german -I xindy -M test -t test.glg -o test.gls test.glo
pdflatex test

For which I receive:

Cannot locate xindy module for language german.

Well considering I can locate that module I thought I might tell her where it is, but unfortunately I couldn't find out how. The other way would be copying that module in a directory xindy is using to find the modules but I couldn't figure that out either.

Of course I also tried the simple version:

makeglossaries test

Where the output was:

No \@istfilename found in 'test.aux'.
Did your LaTeX run fail?
Did your LaTeX run produce any output?
Did you remember to use \makeglossaries? 

Funny thing is: A couple of lines above that statement I saw this:

\@istfilename{test.xdy}

But when I looked into test.aux, it wasn't there. When I put it there and ran the command again there was simply no compiler output, which was probably because of xindy I guess.

I hope someone of you can help me with that.

Best Answer

You must set document language to german to let glossaries know how it should sort entries. Due to xindy bug, you also have to set encoding manually:

\documentclass[10pt,twoside,a4paper,fleqn]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[german]{babel}
\usepackage{ifthen, xkeyval, xfor, amsgen}
\usepackage[xindy]{glossaries}
\GlsSetXdyCodePage{duden-utf8}
\usepackage{translator}
\makeglossaries

\begin{document}

\newglossaryentry{real number}
{
    name={real number},
    description={include both rational numbers and irrational numbers},
    symbol={\ensuremath{\mathbb{R}}}
}

\newglossaryentry{Agypten}
{
    name = {{Ä}gypten},
    description = {German:Egypt}
}

\chapter{Model chapter for a report}

This is the first chapter of the report. Most certainly it will have
    some \glspl{real number}. Maybe there will be
    something in German, like \gls{Agypten}

\printglossary

\end{document}  

Important lines are \usepackage[german]{babel} and \GlsSetXdyCodePage{duden-utf8}. Note that you missed comma in Agypten glossary entry.

Edit: if makeglossaries still don't work, try this:

xindy -M lang/german/duden-utf8 -I xindy -M test -t test.glg -o test.gls test.glo