5

I try to get a glossary in French. So I started with a sample (in english) from glossaries package. I run latex then makeglossaries then latex (x2), everything was fine with the sample. I run the same sample using xindy option for the glossaries package and adding \usepackage[spanish]{babel} like it's suggested in the guide of glossaries package, everything is working very well.

But here start my problem, if I change spanish by french, I get an error message from xindy:

ERROR: Syntax Error in (INDEXENTRY :TKEY (:|EMPTYSET@INDEXeNDCSNAME|) :LOCREF "{}{11}" :ATTR "pageglsnumberformat").

Here is my latex code :

 \documentclass{report}
 \usepackage[utf8]{inputenc}
 \usepackage[T1]{fontenc}

\usepackage[french]{babel}

\usepackage[xindy,toc,acronym]{glossaries}

% Define a new glossary type called notation
\newglossary[nlg]{notation}{not}{ntn}{Notation}

\makeglossaries

% Notation definitions


\newglossaryentry{not:emptyset}{type=notation,
name={$O$},
text={00},
description={The empty set},
sort={O}}

% Main glossary definitions


\newglossaryentry{gls:card}{name=cardinality,
description={The number of elements in the specified set}}

% Acronym definitions

\newacronym{nf}{NF}{new foundations}

\begin{document}
\title{Sample Document using the glossaries Package}
\author{Nicola Talbot}

\maketitle

\tableofcontents

\printglossaries

\chapter{Introduction}

$\gls{not:emptyset}$ 

\gls{gls:card}

\gls{nf}
\end{document}

I goggled this but I found nothing. Please, someone can help me?

  • 1
    Did you try to remove the .ind, *.ilg and .xdy all files related to glossaries before switching to the new language? – user31729 May 10 '14 at 17:32
  • I do not have such files. But even if I remove all the temporary files, I get the same error message. – R. N May 10 '14 at 17:36
  • 1
    Welcome to TeX.SX! What version of glossaries are you using? The only error I get with your example (thank you for providing it) is caused by babel making : active. If you replace the : characters in the labels with something else (for example a period) or simply remove them, the example works fine for me. – Nicola Talbot May 10 '14 at 17:41
  • I removed the : from labels, and that works fine. Thank you very much. – R. N May 10 '14 at 17:46
  • 1
    Yes, it's a common problem: high punctuation (; : ! ?) is made active by frenchb and that creates problems in labels and the like. One solution is to systematically replace : with, e.g. -. Or you compile with XeLaTeX, replacing babel with polyglossia: no character is made active in that case. – Bernard May 10 '14 at 18:05
3

(Converting my comment into an answer.)

When babel is used with the french setting, the colon : is converted into an active character. The glossary entry labels are used to form internal commands that store the entry data, so they can't contain any active characters. Removing the colons or replacing them with a non-active character fixes the problem. For example, replacing them with a period works fine:

\documentclass{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[french]{babel}

\usepackage[xindy,toc,acronym]{glossaries}

% Define a new glossary type called notation
\newglossary[nlg]{notation}{not}{ntn}{Notation}

\makeglossaries

% Notation definitions


\newglossaryentry{not.emptyset}{type=notation,
name={$O$},
text={00},
description={The empty set},
sort={O}}

% Main glossary definitions


\newglossaryentry{gls.card}{name=cardinality,
description={The number of elements in the specified set}}

% Acronym definitions

\newacronym{nf}{NF}{new foundations}

\begin{document}
\title{Sample Document using the glossaries Package}
\author{Nicola Talbot}

\maketitle

\tableofcontents

\printglossaries

\chapter{Introduction}

$\gls{not.emptyset}$ 

\gls{gls.card}

\gls{nf}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.