8

I'm trying to compile a template babel based presentation on my machine. And I can not get cyrillic symbols displayed.

The problem is that it won't produce any useful output. Build process seems to end without any errors, but text is not displayed.

I also tried to build it with pdflatex and I succeeded. Usually I use XeTeX.

Any ideas on how can I fix it? It's not that I need to use XeTeX too much, but I've wasted few hours on that and I'm curious.

Here's the MWE:

\documentclass{beamer}
\usepackage{lmodern}
\usepackage[english,russian]{babel}

% Стиль презентации

\usetheme{Warsaw}
\begin{document}
\title{Все что вы хотели знать о сферическом коне в вакууме, но боялись спросить}  
\author{Олень Северный}
\institute{Научно исследовательский институт физико-матетматических проблем}
\date{Москва, 2010} 
% Создание заглавной страницы
\frame{\titlepage} 
% Автоматическая генерация содержания
\frame{\frametitle{Содержание}\tableofcontents} 
\end{document}
4
  • 2
    Try to add \usepackage[utf8]{inputenc} -- that should bring the right encoding given that your file is saved in utf8 encoding...
    – user31729
    Apr 28, 2017 at 23:13
  • XeTeX ignores it. It actually displays a warning, when this command is issued.
    – Roman
    Apr 29, 2017 at 13:09
  • You asked for pdflatex
    – user31729
    Apr 29, 2017 at 13:47
  • Sorry, but I've mentioned that pdflatex built it. And my actual question was whether I can build it with XeTeX or not.
    – Roman
    Apr 30, 2017 at 12:17

2 Answers 2

9

You're using the lmodern package, which sets the document fonts to Latin Modern, but it doesn't have support for cyrillic letters. There's Computer Modern Uncode for cyrillic and greek.

For XeLaTeX, add

\usepackage{fontspec}
\setmainfont[
  Ligatures=TeX,
  Extension=.otf,
  BoldFont=cmunbx,
  ItalicFont=cmunti,
  BoldItalicFont=cmunbi,
]{cmunrm}
\setsansfont[
  Ligatures=TeX,
  Extension=.otf,
  BoldFont=cmunsx,
  ItalicFont=cmunsi,
]{cmunss}

just before \usepackage[english,russian]{babel}, assuming that cm-unicode is installed into your TeX distribution.

For LuaLaTeX it's sufficient to add

\usepackage{fontspec}
\setmainfont{CMU Serif}[Ligatures=TeX]
\setsansfont{CMU Sans Serif}[Ligatures=TeX]

and if you want to use good old pdfLaTeX, just add the usual

\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}

(in all cases remove the \usepackage{lmodern} line).

Note, that for pdfLaTeX the correct fonts are selected automagically after you specify the font encoding (T2A), but for LuaLaTeX and XeLaTeX you'd have to set them explicitly which is a pity.

4

I've compiled with OVERLEAF. I hope I have helped you.

enter image description here

\documentclass{beamer}
\usepackage{lmodern}
\usepackage[english,russian]{babel}
\usepackage[T1,T2A]{fontenc}
\usepackage[utf8]{inputenc}
% Стиль презентации

\usetheme{Warsaw}
\begin{document}
\title{Все что вы хотели знать о сферическом коне в вакууме, но боялись спросить}  
\author{Олень Северный}
\institute{Научно исследовательский институт физико-матетматических проблем}
\date{Москва, 2010} 
% Создание заглавной страницы
\frame{\titlepage} 
% Автоматическая генерация содержания
\frame{\frametitle{Содержание}\tableofcontents} 
\end{document}

You must log in to answer this question.

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