2

After reading polyglossia documentation here is what I ended with

\documentclass{book}
\usepackage{polyglossia}
\setmainlanguage{french}
\begin{document}
\gappto\captionsfrench{\renewcommand\chaptername{CHANGED}}
\chapter{Test}
Lorem ipsum.
\end{document}

but the chapter name has not changed. What is wrong ?

3
  • You need to issue \gappto\captionsfrench{\renewcommand\chaptername{CHANGED}} in the preamble. Move the line between \setmainlanguage{french} and \begin{document}
    – DG'
    Nov 30 '20 at 9:27
  • or add a \selectlanguage{french} after your redefinition, that will reset the caption names. Nov 30 '20 at 9:36
  • @Ulrike : this is the accepted comment. Your solution sticks to the question and allows to keep the \gappto... out of the preamble. Changing the chapter name only for some chapters is made possible. Nov 30 '20 at 20:39
1

This is general setup, so it should be performed in the preamble, not in the document body.

A change to \captionsfrench will only take effect the next time a \selectlanguage{french} declaration is issued.

Since French is your main language, the declaration will be issued at begin document.

\documentclass{book}
\usepackage{polyglossia}

\setmainlanguage{french}
\gappto\captionsfrench{\renewcommand\chaptername{CHANGED}}

\begin{document}

\chapter{Test}
Lorem ipsum.

\end{document}

enter image description here

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.