6

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

2 Answers 2

7

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.

1
  • 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 Nov 15, 2011 at 21:10
5

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}
2
  • 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. Nov 15, 2011 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, 2012 at 13:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .