1

Unwanted space appears before Latin language text inside an outer French environment when using Polyglossia. This does not happen when the outer environment language is English.

In my example, when compiled with xelatex, the first line inside the French environment looks fine, as no language commands are used. The second and third line have an extra space before the word verbum.

How to get rid of the unwanted space? Is there a canonical solution? Or am I using Polyglossia in a wrong way here?

MWE:

\documentclass[12pt]{article}

% Use polyglossia for many languages.
\usepackage{polyglossia}
\setdefaultlanguage{latin}
\setotherlanguage{french}

% Create a command to show Latin words in italics.
\newcommand{\lat}[1]{\textlatin{\textit{#1}}}

\begin{document}

Latine hic. Etiam pars Gallica sequitur: 

\begin{french}

% This looks OK.
En français ici. Mais \textit{verbum} en latin!

% The word verbum has extra white space before it.
En français ici. Mais \textlatin{\textit{verbum}} en latin!

% The word verbum has extra white space before it.
En français ici. Mais \lat{verbum} en latin!

\end{french}

\end{document}
1
  • 1
    Update your TeX distribution.
    – egreg
    Commented Dec 7, 2021 at 21:22

1 Answer 1

1

You're running an outdated TeX distribution where the file gloss-french.ldf has a spurious space at the end of line 438 (there's no % to mask the endline). Quite likely TeX Live 2020 or earlier.

This has been fixed in the version released around April 13, 2021 (see the changes).

You might fix it yourself, while you wait for updating your TeX distribution. Either copy the file in the working directory (you find the location in the log file) and fix the missing % or take the courage to edit the distributed file (there's no real risk and that file will no longer be updated if you use TeX Live).

\def\nofrench@capsformat{%
   % Reset chapter and part heading
   \ifcsdef{titleformat}{%
      % With titlesec
     \ifcsdef{xpg@save@part@format}{%
        \ifcsdef{H@old@part}{\let\@H@old@part\xpg@save@part@format}{\let\@part\xpg@save@part@format}
     }{}%

should become

\def\nofrench@capsformat{%
   % Reset chapter and part heading
   \ifcsdef{titleformat}{%
      % With titlesec
     \ifcsdef{xpg@save@part@format}{%
        \ifcsdef{H@old@part}{\let\@H@old@part\xpg@save@part@format}{\let\@part\xpg@save@part@format}% <---- WAS MISSING
     }{}%
1
  • Thanks! Looks like Ubuntu ships old version of it because the file looks quite different after \ifcsdef{xpg@save@part@format}{%. Back to manual installation of TeXLive again. Commented Dec 7, 2021 at 22:44

You must log in to answer this question.

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