# Eqnumbering with polyglossia

This short code results in an equation enumerated with italic font when the equation is inside a theorem environment. How to get it written by normal font? If I delete the segment \setdefaultlanguage[Script=Cyrillic]{serbian}, then I get what I need, but I need this segment to be in the preamble, so any other solution would help.

\documentclass[10pt, b5paper]{book}

\usepackage[no-math]{fontspec}
\usepackage{polyglossia}

\usepackage{amsmath, amssymb, ntheorem}

\setdefaultlanguage[Script=Cyrillic]{serbian}

\newfontfamily{\serbianfont}[Mapping=ascii-to-serbian, Script=Cyrillic, Language=Serbian]{DejaVu Serif}
%\newfontfamily{\serbianfonttt}{DejaVu Serif}

\theorembodyfont{\itshape}
\theoremseparator{.}
\newtheorem{theorem}{Teorema}[section]

\begin{document}

\begin{theorem}Th.....

$$a=b$$
\end{theorem}

\end{document}


A solution with mathtools and ntheorem: I define a tag style which does the job, and incorporate it in theorem-like environments with the \theoremprework command:

\documentclass[10pt, b5paper]{book}

\usepackage[no-math]{fontspec}
\usepackage{polyglossia}

\usepackage{mathtools, amssymb, ntheorem}

\newtagform{thm}{\upshape(}{)}

\setdefaultlanguage[Script=Cyrillic]{serbian}

\newfontfamily{\serbianfont}[Mapping=ascii-to-serbian, Script=Cyrillic, Language=Serbian]{DejaVu Serif}
%\newfontfamily{\serbianfonttt}{DejaVu Serif}
\theoremprework{\usetagform{thm}}
\theorembodyfont{\itshape}
\theoremseparator{.}
\newtheorem{theorem}{Teorema}[section]

\begin{document}

\begin{theorem}Th.....
$$a=b$$
\end{theorem}

\end{document}


• This solution works perfectly. THX! – Zoran Sep 11 '17 at 1:11

I'd say it's a bug in Polyglossia, which redefines \normalfont (it has to), but not to the point it imposes upright shape and medium series.

For instance, \textbf{abc\normalfont def} would print everything in boldface.

I'm not completely sure the patch I propose is the best, but in the particular case it works.

\documentclass[10pt, b5paper]{book}

\usepackage{amsmath, amssymb, ntheorem}
\usepackage[no-math]{fontspec}
\usepackage{polyglossia}
\usepackage{xpatch} % for the following patch

\setdefaultlanguage[Script=Cyrillic]{serbian}

% the patch to the redefined \normalfont
\AtBeginDocument{%
\xapptocmd\normalfont
{\fontshape{\shapedefault}%
\fontseries{\seriesdefault}%
\selectfont}
{}{}%
}

\newfontfamily{\serbianfont}[
Mapping=ascii-to-serbian,
Script=Cyrillic,
Language=Serbian,
Extension=.ttf,
UprightFont=*,
ItalicFont=*-Italic,
BoldFont=*-Bold,
BoldItalicFont=*-BoldItalic,
]{DejaVuSerif}
%\newfontfamily{\serbianfonttt}{DejaVu Serif}

\theorembodyfont{\itshape}
\theoremseparator{.}
\newtheorem{theorem}{Teorema}[section]

\begin{document}

\textbf{abc\normalfont def}

\begin{theorem}
Th.....
$$a=b$$
\end{theorem}

\end{document}