LaTeX forum ⇒ XeTeXPolyglossia and toc

Information and discussion about XeTeX, an alternative for pdfTeX based on e-Tex
Posts: 3
Joined: Mon Nov 11, 2013 2:36 pm

Polyglossia and toc

Postby vangelis » Mon Nov 11, 2013 2:44 pm


I've got a problem with the formatting of the table of contents, using xetex and the package polyglossia (language : french). I don' manage to get the number of parts before the title ...

Here is an ECM to understand this :
  1. \documentclass[a4paper,12pt]{book}
  2. \XeTeXinputencoding iso-8859-1
  3. \usepackage{polyglossia}
  4. \setmainlanguage{french}
  5. \setotherlanguage{latin}
  6. \setotherlanguage[variant=ancient]{greek}
  8. \begin{document}
  9. \tableofcontents
  10. \part{Part title}
  11. \chapter{Chapter title}
  12. \section{section title}
  13. \part{another part}
  14. \end{document}

With this code here is the appearance of the toc :
Part title (without number ...)
1 chapter title
1.1. Section


And I would like this formatting :
I. Title
1 Chapter title
1.1 Section title ...

What should I do to have the "I" enabled in the toc ? Can somebody help me ?

Posts: 3
Joined: Mon Nov 11, 2013 2:36 pm

Postby vangelis » Mon Nov 11, 2013 9:52 pm

The problem is solved with the following code in the preamble :

  1. \makeatletter
  2. % avoid the redefinition of `\thepart`
  3. \patchcmd{\captionsfrench}{\def\thepart{}}{}{}{}
  4. % patch \@part not to print the part number
  5. \patchcmd{\@part}{\nobreakspace\thepart}{}{}{}
  6. \makeatother

User avatar
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Tue Nov 12, 2013 11:00 am

Just for information to other users for awareness of possibly already existing solutions. The question has also been posted to {TeX} SX. Please read what our administrator thinks about that.

Board Rules wrote:A crossposting is always contra-productive. But there is nothing really against it as long as it is mentioned. This means that a direct link has to be added. So other users who want to help are preserved from double efforts and waste of time.

Such kind of x-posting without notification represents a direct violation of our rules and has to be prevented absolutely in future questions.

It is suggestive to contact the package maintainer because with babel this behaviour does not occur.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

Return to “XeTeX”

Who is online

Users browsing this forum: No registered users and 1 guest