Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to use Cyrillic sans-serif font in a beamer presentation. I make it using LyX 2.0.0. The code produced by LyX (exported as plain LaTeX) is

%% LyX 2.0.0 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[russian]{beamer}
\usepackage[T1]{fontenc}
\usepackage[koi8-r]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\DeclareRobustCommand{\cyrtext}{%
  \fontencoding{T2A}\selectfont\def\encodingdefault{T2A}}
\DeclareRobustCommand{\textcyr}[1]{\leavevmode{\cyrtext #1}}
\AtBeginDocument{\DeclareFontEncoding{T2A}{}{}}

%% A simple dot to overcome graphicx limitations
\newcommand{\lyxdot}{.}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
 % this default might be overridden by plain title style
 \newcommand\makebeamertitle{\frame{\maketitle}}%
 \AtBeginDocument{
   \let\origtableofcontents=\tableofcontents
   \def\tableofcontents{\@ifnextchar[{\origtableofcontents}{\gobbletableofcontents}}
   \def\gobbletableofcontents#1{\origtableofcontents}
 }
 \long\def\lyxframe#1{\@lyxframe#1\@lyxframestop}%
 \def\@lyxframe{\@ifnextchar<{\@@lyxframe}{\@@lyxframe<*>}}%
 \def\@@lyxframe<#1>{\@ifnextchar[{\@@@lyxframe<#1>}{\@@@lyxframe<#1>[]}}
 \def\@@@lyxframe<#1>[{\@ifnextchar<{\@@@@@lyxframe<#1>[}{\@@@@lyxframe<#1>[<*>][}}
 \def\@@@@@lyxframe<#1>[#2]{\@ifnextchar[{\@@@@lyxframe<#1>[#2]}{\@@@@lyxframe<#1>[#2][]}}
 \long\def\@@@@lyxframe<#1>[#2][#3]#4\@lyxframestop#5\lyxframeend{%
   \frame<#1>[#2][#3]{\frametitle{#4}#5}}
 \def\lyxframeend{} % In case there is a superfluous frame end

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{listings}
\usetheme{Warsaw}
%\usepackage{helvet}
% or ...
%\usetheme{Antibes} % tree outline, neat
%\usetheme{JuanLesPins} % like Antibes, with shading
%\usetheme{Bergen}  % outline on side
%\usetheme{Luebeck} % like Warsaw, square sides
%\usetheme{Berkeley}    % interesting left bar outline
%\usetheme{Madrid}  % clean, nice.  7/12 page numbers
%\usetheme{Berlin}  % dots show slide number
%\usetheme{Malmoe}  % OK, plain, unshaded
%\usetheme{Boadilla}    % nice, white bg, no top bar
%\usetheme{Marburg} % nice, outline on right
%\usetheme{boxes}   % ???
%\usetheme{Montpellier} % tree outline on top, plainish white
%\usetheme{Copenhagen}  % like Warsaw
%\usetheme{PaloAlto}    % looks good
%\usetheme{Darmstadt}   % like Warsaw with circle outline
%\usetheme{Pittsburgh}
%\usetheme{default}
%\usetheme{Rochester}   % like boxy, unshaded warsaw
%\usetheme{Dresden} % circle outline on top
%\usetheme{Singapore}   % purple gradient top
%\usetheme{Frankfurt}   % like Warsaw with circle outline on top
%\usetheme{Szeged}
%\usetheme{Goettingen}  % light purple right bar outline
%\usetheme{Warsaw}
%\usetheme{Hannover}    % like Goett with bar on left
%\usetheme{compatibility}
%\usetheme{Ilmenau}

\setbeamercovered{transparent}
% or whatever (possibly just delete it)

%\usecolortheme{seahorse}
%\usecolortheme{rose}

% seems to fix typewriter font in outline header:
\usepackage{ae,aecompl}
\beamertemplatenavigationsymbolsempty
%\pgfdeclareimage[height=1cm]{institution-logo}{hint-logo-mn.jpg}

\makeatother

\usepackage{babel}
\begin{document}

\title[Высокогорные леса]{Историческое использование\\высокогорных лесов}


\subtitle{современное значение\\на государственном и местном уровнях}


\author[S\o{}veig; Наумов]{Robert S\o{}veig, Владимир Наумов}


\institute{Niht}


\date{5 сентября 2012}

\makebeamertitle
%\beamerdefaultoverlayspecification{<+->}


\lyxframeend{}\lyxframe{Robert S\o{}veig}

\begin{center}
\par\end{center}
\begin{block}
{}
\begin{itemize}
\item место работы: 
\item специализация:
\item опыт:
\end{itemize}
\end{block}

\note[item]{Начало доклада}


\note[item]{Теперь я перейду собственно к нашему докладу.}


\lyxframeend{}
\end{document}

The problem is that the font in the output is not sans-serif, although I know that by default beamer uses sans serif font. F.ex. this code:

\documentclass[russian]{beamer}

\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\begin{document}
  \begin{frame}
    ПРИВЕТ! Этот текст написан шрифтом без засечек.
  \end{frame}
\end{document}

works flawlessly in plain LaTeX.

I suppose that the problem is in font encoding.

How to force LyX to use correct font encoding, e.g. to produce beamer presentation with sans serif cyrillic fonts?

share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

The first code example is rather messy and, in my opinion, a good demostration why LyX should not be used as it complicates things rather than simplifying them.

In the second code you are forgetting to load babel

\documentclass{beamer}

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

\begin{document}
  \begin{frame}
    ПРИВЕТ! Этот текст написан шрифтом без засечек.
  \end{frame}
\end{document}

In general I prefer to pass the language option to babel rather than to the class (you may have surprises if you want to use multiple languages).

enter image description here

Here's a "more correct" version of the first code (I used utf8 instead of koi8-r). The ae and aecompl packages are obsolete.

\documentclass{beamer}
\usepackage[T1,T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian]{babel}

% \usepackage{listings}

\usetheme{Warsaw}

\setbeamercovered{transparent}
\beamertemplatenavigationsymbolsempty

\begin{document}

\title[Высокогорные леса]{Историческое использование\\высокогорных лесов}


\subtitle{современное значение\\на государственном и местном уровнях}


\author[S\o{}veig; Наумов]{Robert S\o{}veig, Владимир Наумов}


\institute{Niht}


\date{5 сентября 2012}

\begin{frame}
\maketitle
\end{frame}

%\beamerdefaultoverlayspecification{<+->}


\begin{frame}
\frametitle{Robert S\o{}veig}

\begin{block}{}
\begin{itemize}
\item место работы: 
\item специализация:
\item опыт:
\end{itemize}
\end{block}

\note[item]{Начало доклада}


\note[item]{Теперь я перейду собственно к нашему докладу.}

\end{frame}
\end{document}
share|improve this answer
    
Thanks. What do you advise to use instead of LyX? Text editors like vi? –  Vladimir Oct 29 '12 at 9:26
2  
@VladimirNaumov Definitely a (La)TeX front end; if you're comfortable with vi, it has a "TeX mode". But something like TeXStudio or TeXworks can get you started. –  egreg Oct 29 '12 at 9:28
    
thanks for the hint! –  Vladimir Oct 29 '12 at 9:34
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.