TeX - LaTeX Asked on August 7, 2021
I had to
I had to define (because of beamer and interference with other languages) the environment for Cyrillic. How can I now make the Cyrillic appear in a nicer Cyrilic font?
MWE:
documentclass{article}
usepackage[utf8]{inputenc}
usepackage[OT2, T1]{fontenc}
newcommand{textcyr}[1]{
{donothyphenatefontencoding{OT2}selectfont #1}}
newlanguagenohyphensnewcommand{donothyphenate}{
language=nohyphens}
begin{document}
Russia textcyr{izmenitp1} emph{izmenit} (tr.) ‘change’
end{document}```
I'd use babel
for disabling hyphenation, but your method is good as well.
The key is to use the font family wncyr
that has Type1 fonts compatible with Computer Modern, if you're tied to transliterated input.
documentclass{article}
usepackage[base]{babel}
usepackage[OT2, T1]{fontenc}
DeclareFontFamilySubstitution{OT2}{cmr}{wncyr}
newcommand{textcyr}[1]{%
begin{hyphenrules}{nohyphenation}%
fontencoding{OT2}selectfont #1%
end{hyphenrules}%
}
begin{document}
Russian textcyr{izmenitp1} emph{izmenit} (tr.) ‘change’
end{document}
Correct answer by egreg on August 7, 2021
The approach in https://tex.stackexchange.com/a/215454/ works also for beamer
. I'm not sure this fits your requirements but maybe it can be a starting point. The font is similar to Times. The MWE below shows sans serif (default in beamer
) and serif (using the rmfamily
font switch).
documentclass{beamer}
usepackage[utf8]{inputenc}
usepackage[T1,T2A]{fontenc}
usepackage{paratype}
usepackage{tgpagella}
usepackage[russian]{babel}
usepackage{substitutefont}
substitutefont{T2A}{rmdefault}{PTSerif-TLF}
begin{document}
begin{frame}{Russian in texttt{beamer}}
Russia изменить emph{izmenit} (tr.) ‘change’
rmfamily Russia изменить emph{izmenit} (tr.) ‘change’
end{frame}
end{document}
Result:
Note that you have the option of choosing an arbitrary font if you use XeLaTeX or LuaLaTeX, see for example the second part of the answer in Change font in Beamer to a more modern, sleek font.
Answered by Marijn on August 7, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP