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 ?

  • 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 09:27
  • or add a \selectlanguage{french} after your redefinition, that will reset the caption names. – Ulrike Fischer Nov 30 '20 at 09: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. – Jérôme LAURENS Nov 30 '20 at 20:39

1 Answers1

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

egreg
  • 1,121,712