0

The following code produces a rasterized font:

\documentclass{beamer}

\usepackage[OT2,OT1]{fontenc}

\newcommand{\cyr}{%
\renewcommand\encodingdefault{OT2}%
\normalfont\selectfont}
\newcommand{\lat}{%
\renewcommand\encodingdefault{OT1}%
\normalfont\selectfont}

\begin{document}

\begin{frame}
\cyr test

\begin{definition}
test
\end{definition}

\begin{theorem}
test
\end{theorem}

test \emph{test}

\lat

test \emph{test}
\end{frame}

\end{document}

However, the same code used to produce vector output before I reinstalled the operating system. I am not sure which version of MiKTeX I had before, and the current version is Portable MiKTeX 2.9.6620.

I have already tried to install cm-super package (upon an advice that I found on the internet), but that did not solve the problem.

Is there a way to restore the previous behavior? Note: I would prefer to keep the same code (or, at the very least, to make only small changes to it), that is, if there is a solution that includes writing Cyrillic script in some another way, that does not suit me.

Edit: Maybe my question was not clear enough, since the proposed solutions do not solve the problem. So let me try to rephrase it. Namely, the code given above produces the following output:

output

This is exactly the output I want to have. However, the problem is that the letters are rasterized (actually, the Cyrillic letters; the Latin ones are OK). Therefore, the question is what I should do in order to get the same output but with vector letters. Exactly the same code was working perfectly on my previous operating system; therefore, I hope that there is an easy fix for this problem.

Thank you in advance.

  • 1
    Welcome to TeX SX! Did you run updmap.exe? – Bernard Oct 20 '18 at 11:42
  • Thank you for your answer. Yes, I did run that, but with no effect. – bbasic Oct 20 '18 at 11:45
2

I doubt that your code ever worked correctly. Imho beamer always used \sfdefault as \familydefault, and so your redefinition of \rmdefault would never do anything in beamer.

Try this instead:

\documentclass{beamer}

\usepackage[OT2,OT1]{fontenc}

\newcommand{\cyr}{%
 \fontfamily{wncyss}%
 \fontencoding{OT2}%
 \selectfont}
\newcommand{\lat}{%
 \fontfamily{\familydefault}%
 \fontencoding{\encodingdefault}%
 \selectfont}

\begin{document}
\begin{frame}
\cyr
test
\lat 
test
\end{frame}
\end{document}

enter image description here

  • Thank you, but I do want sans serif cyrillic. My code above produces the font I want (though I agree that the line \renewcommand\rmdefault{wncyr}% is unnecessary, it is a leftover from a copy-paste). The only problem is the fact that the font is rasterized, and I would like vector font. – bbasic Oct 20 '18 at 12:53
  • Then use the wncyss family. I edited the code. – Ulrike Fischer Oct 20 '18 at 13:00
  • This is better, but still not satisfactory enough, since then the font is OK when it is not in a particular environment, but in begin{theorem}...\end{theorem} it reverts to latin, \emph{test} does not work etc. Probably all these issues can be fixed manually, but I would still like if there is a way to switch to vector cyrillic just by \renewcommand\encodingdefault{OT2} (it worked perfectly on my previous OS, so it should be possible, does anybody have an idea what could cause a problem now?). – bbasic Oct 20 '18 at 17:52
  • You can add \renewcommand\encodingdefault{OT2} and \renewcommand\encodingdefault{OT1}. But imho if you really want such a general command you should better use babel and a language switch. – Ulrike Fischer Oct 20 '18 at 19:08
  • But the main problem is precisely the fact that \renewcommand\encodingdefault{OT2} produces rasterized cyrillic fonts. So, my only question is whether anyone has an explanation why this is happening now and was not happening on my previous OS, and how could I make it work as before. – bbasic Oct 20 '18 at 19:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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