# XeLaTeX + polyglossia + Russian or Greek = page number in italics

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: Why is there such a problem and is there any workaround?

• 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
• 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
• 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

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}
