XeTeXProblem with the appendix (and possibly its TOC entry)

Information and discussion about XeTeX, an alternative for pdfTeX based on e-Tex
Post Reply
JoKo
Posts: 19
Joined: Tue Aug 12, 2008 11:28 am

Problem with the appendix (and possibly its TOC entry)

Post by JoKo »

Hi, everyone,

I am trying to create a simple appendix (currently with one chapter):

Code: Select all

\appendix
\chapter{a}
\lstinputlisting{test.c}
"xelatex main" completes fine the first time, but I have to run it again, because I am using bibtex and the glossaries package. However, the second time (possibly at the creation of the table of contents) I am getting the following message:
! Undefined control sequence.
<argument> ...@chapter <\@ne \space \gr@ill@value
{\c@chapter }\else \ifnum ...
l.25 ...umber {\c@chapter }}a}{21}{appendix.Alph1
I suspect the polyglossia package is relevant to this problem (I am using it for Greek and English hyphenation), but I am too far in my writing to stop using it.

Any help/ideas?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Problem with the appendix (and possibly its TOC entry)

Post by gmedina »

Hi,

I did a test with the following code:

Code: Select all

\documentclass{book}
\usepackage{polyglossia}

\begin{document}

\tableofcontents

\appendix 
\chapter{a}

\end{document}
and got no errors. So we will need to see some actual code to detect the problem. Please post a minimal working example (MWE) that shows the undesired behaviour (following the link you will find instructions to build such a MWE).
1,1,2,3,5,8,13,21,34,55,89,144,233,...
JoKo
Posts: 19
Joined: Tue Aug 12, 2008 11:28 am

Problem with the appendix (and possibly its TOC entry)

Post by JoKo »

Point taken, let me be more clear:

I am using Greek as the text's main language and English as a second one, so I have to type something like this for the hyphenation to work:

Code: Select all

\setmainlanguage{greek}
\setotherlanguage{english}
Since it's a bit difficult the standard font to be Greek, I have also to define the fontspec package:

Code: Select all

\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{DejaVu Sans}
(I've changed my font to DejaVu Sans, a quite common font, I hope. Feel free to change it to any other font that supports Greek)

So, the minimal tex file to reproduce my problem is the following:

Code: Select all

\documentclass{book}

\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{DejaVu Sans}

\usepackage{polyglossia}
\setmainlanguage{greek}
\setotherlanguage{english}

\begin{document}

\tableofcontents

\appendix
\chapter{a}

\end{document}
The error comes again the second time I am running xelatex:
! Undefined control sequence.
<argument> ...@chapter <\@ne \space \gr@ill@value
{\c@chapter }\else \ifnum ...
l.2 ...umberline {\Greeknumber {\c@chapter }}a}{3}
gmedina, your code produces no errors, indeed. This is how I'm using the polyglossia package, though.
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Problem with the appendix (and possibly its TOC entry)

Post by gmedina »

Hi,

use the numerals=arabic option for the Greek language, as suggested in the polyglossia documentation:

Code: Select all

\documentclass{book}
\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{DejaVu Sans}

\usepackage{polyglossia}
\setmainlanguage[numerals=arabic]{greek}
\setotherlanguage{english}

\begin{document}

\tableofcontents

\appendix
\chapter{a}

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
JoKo
Posts: 19
Joined: Tue Aug 12, 2008 11:28 am

Re: Problem with the appendix (and possibly its TOC entry)

Post by JoKo »

Thanks a lot, this solved the problem...
Post Reply