# Problematic interaction between fontspec and beamer?

There seems to be some problem in the way fontspec passes font info to beamer. The following example compiles and displays as it it should in XeLaTeX

% !Mode:: "TeX:UTF-8"
\documentclass{article}
\usepackage{unicode-math}
\usepackage{polyglossia}
\setmainfont{XITS}
\setdefaultlanguage{russian}
\begin{document}

This is a test.

Это тест
\end{document}


However, if I replace the document class with

 \documentclass{beamer}


I get the error

! Package polyglossia Error: The current roman font does not contain the Cyrillic script! Please define \cyrillicfont with \newfontfamily.

See the polyglossia package documentation for explanation. Type H for immediate help. ...

l.3 \select@language {russian}

?

I compile with MiKTeX 2.9, with all current updates.
Any suggestions would be very appreciated

beamer uses the sffamily by default, so you need to define the \cyryllicfontsf using \newfontfamily:

\documentclass{beamer}
\usepackage{unicode-math}
\usepackage{polyglossia}
\setmainfont{STIX}
\newfontfamily{\cyrillicfontsf}{XITS}

\setdefaultlanguage{russian}
\begin{document}

This is a test.

Это тест
\end{document}


(I have the actual STIX fonts installed, so I haven't tested this with XITS but it should work the same.)

If you want to use a sans serif font, then Herbert's solution is the correct one. I assumed you wanted to make the default Beamer font to use XITS.

• Very good, thank you. I also have MiKTeX's Stix package installed, but for some reason it fails to compile. XITS version works fine, though – Mikhail Kagalenko Nov 15 '11 at 21:10

define also the sans serif font:

\documentclass{beamer}
\usepackage{unicode-math}
\usepackage{polyglossia}
\setmainfont{XITS}
\setsansfont{Myriad Pro}% or any other sans serif font
\setdefaultlanguage{russian}
\begin{document}

This is a test.

Это тест

\end{document}

• That is closer to what I had in mind. I would like to use XITS in the math, as better-looking alternative to Computer Modern, and keep the rest of the text somehow close in style to the formulas. – Mikhail Kagalenko Nov 15 '11 at 21:15
• Thank you! I've thought that it's a bug in Polyglossia or Beamer and they can't be used together until your post. I've added \setsansfont{Arial} and everything got worked! – Kirill Mar 18 '12 at 13:55