2

Consider the following example:

\documentclass{article}

\usepackage{polyglossia}
\setdefaultlanguage{russian}
\setmainfont{CMU Serif}

\begin{document}

    \itshape Text.

\end{document}

Compiling with XeLaTeX, surprisingly, you get in italics not only Text, but also the page number 1. The same for \setdefaultlanguage{greek}, but with \setdefaultlanguage{english} everything is ok (just like in this question).

I know how to fix it, just use braces: { \itshape Text. }.

Now consider the following related example with amsthm:

\documentclass{article}

\usepackage{polyglossia}
\setdefaultlanguage{russian}
\setmainfont{CMU Serif}

\usepackage{amsthm}
\newtheorem{theorem}{Theorem}

\begin{document}

    Text.

    \vspace{52em}

    Text.

    \begin{theorem}
        Text.
    \end{theorem}

\end{document}

Again you get the page number in italics: page number in italics Why is there such a problem and is there any workaround?

  • 1
    If I may add some details: It only happens if the text ends just before the page ends forcing the "theorem" line to the second page. However, it doesn't happen if you use \newpage/ \pagebreak or if the text from the first goes a bit on the second page. – Alenanno Dec 2 '15 at 10:34
  • 1
    Imho it is a polyglossia bug, \normalfont doesn't work correctly as you can see with Text \itshape Text. \normalfont Text \normalfontlatin Text. \usepackage[russian]{babel}\usepackage{fontspec} works better. – Ulrike Fischer Dec 2 '15 at 13:37
  • @UlrikeFischer thanks for the \normalfont addition! I agree it's probably a polyglossia bug, but for Russian and other non-Latin languages polyglossia is still a better choice than babel. @Alenanno yeah, forgot to mention that; and thanks, \newpage / \pagebreak actually works as a manual workaround :) – Vadim Dec 3 '15 at 12:26
  • 1
    The russian.ldf of babel has been adapted to lualatex/xelatex, so it is imho worth a try. But if you want to stay with polyglossia you should redefine the header/footers e.g. with fancyhdr to force upright font shape (and other font features, bold would have the same problem). – Ulrike Fischer Dec 3 '15 at 14:29
1

Rather then \normalfont which doesn't work correctly as @Ulrike said you can use \upshape to change font shape for page numbering

\documentclass{article}

\usepackage{polyglossia}
\setdefaultlanguage{russian}
\setmainfont{CMU Serif}


\usepackage{amsthm}
\newtheorem{theorem}{Theorem}


\renewcommand{\thepage}{\upshape\arabic{page}}



\begin{document}

    Text.

    \vspace{52em}

    Text.

    \begin{theorem}
        Text.
    \end{theorem}

\end{document}
  • Thanks for the reminder of that problem! :) I had already solved it, but forgot to write the soluton here. My solution is essentially the same as yours but using a nice package fancyhdr. The code is: \usepackage{fancyhdr} \fancypagestyle{plain}{ \fancyhf{} \fancyfoot[C]{\textup{\thepage}} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} } \pagestyle{plain} – Vadim Jun 4 '16 at 0:20

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.