1

I define Sans Serif fonts for text for my beamer presentation in Russian:

\usepackage{luatextra}
\usepackage{polyglossia}  
\setmainlanguage[babelshorthands=true]{russian}
\setotherlanguage{english}
\defaultfontfeatures{Renderer=Basic, Ligatures=TeX}
\newfontfamily\cyrillicfonttt{CMU Typewriter Text}
\newfontfamily\cyrillicfont{CMU Sans Serif}
\setmainfont{CMU Sans Serif}
\setsansfont{CMU Sans Serif}
\setmonofont{CMU Typewriter Text}

I would like to use Sans Serif fonts everywhere except equations. To do it, I write

\mode<presentation> {
\usefonttheme{professionalfonts} ... }

But there is the problem with option DeclareMathOperator. For instance, I write

\DeclareMathOperator{\Tr}{\mathrm{Tr}\,}

and obtain Sain Serif typesetting of this operator instead of desired Serif format. How to deal with this problem?

Bernard
  • 271,350
  • Please, make the code snippets into a full (minimal) document showing the issue. – egreg Jun 05 '19 at 22:30
  • Well, with the edit you left even less clues than before. – egreg Jun 05 '19 at 22:33
  • @egreg , it is the minimal example. I defien Sans Serif fonts for text in preambule. Than, I try to use \mathrm and it obviously uses Sans Serif font. I do not know how to fix it – Artem Alexandrov Jun 05 '19 at 22:36
  • Without a complete example showing the issue, nobody can guess. By an example I mean (minimal) code that goes from \documentclass to \end{document} and shows the issue. – egreg Jun 05 '19 at 22:37

1 Answers1

2
\documentclass[professionalfonts]{beamer}
\usepackage{unicode-math}
\usepackage{polyglossia}  
\setmainlanguage[babelshorthands=true]{russian}
\setotherlanguage{english}
\defaultfontfeatures{Renderer=Basic, Ligatures=TeX}
\newfontfamily\cyrillicfonttt{CMU Typewriter Text}
\newfontfamily\cyrillicfont{CMU Sans Serif}
\setmainfont{CMU Sans Serif}
\setsansfont{CMU Sans Serif}
\setmonofont{CMU Typewriter Text}
\setmathfont{XITS Math}

\DeclareMathOperator{\Tr}{\symrm{Tr}\,}
\begin{document}

\frame{Tr $ \Tr $ }

\end{document}

enter image description here

user187802
  • 16,850