3

I'm working on a book document with xelatex. The document is divided into parts, and I have the occasional need to switch between two languages.

I've found that when my document contains more than one language, the part number is not displayed anymore:

\documentclass{book}

\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{french}

\begin{document}
  \selectlanguage{french}
  \selectlanguage{english}

  \part{My Part}
\end{document}

Will result in:

Not displaying part number

If I use just one language, I'm not having any problem:

\documentclass{book}

\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{french}

\begin{document}
  % \selectlanguage{french}
  \selectlanguage{english}

  \part{My Part}
\end{document}

Displaying part number

Chapters and sections work good in any case.

0

1 Answer 1

1

The french language redefines \thepart to issue nothing, because it wants “Première partie”. So if you switch to French, the command is redefined, but switching to English doesn't define it back.

\documentclass{book}

\usepackage{polyglossia}
\setdefaultlanguage{english}
\setotherlanguage{french}

\makeatletter
\let\latex@thepart\thepart
\appto\noextras@french{\let\thepart\latex@thepart}
\makeatother

\begin{document}

\selectlanguage{french}
\selectlanguage{english}

\part{My Part}

\end{document}

Save the original \thepart command and restore it when the language switches from French to another one.

2
  • Thanks a lot, it makes a lot of sense, and your solution is working great! Feb 7, 2016 at 1:01
  • From polyglossia v. 1.51, you can set the frenchpart option to false when loading the package.
    – Ivan
    Jan 20, 2021 at 9:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .