1

MWE:

\documentclass{article}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian, english]{babel}
\usepackage{droid}
\begin{document}
Some meaningful text.

Какой-то осмысленный текст.
\end{document}

When I run:

$ xelatex temp.tex 

It shows this:

enter image description here

The problem is missing Russian glyphs in the font. I can use the Arian font and it will work:

\setmainfont{Arial Unicode MS}

But I don't like how it looks. Is it possible to use some Latex fonts instead? I read this discussion: What fonts are compatible with T2A (Cyrillic) encoding?, and saw that the author said "This fonts are great (especially droid, for me).". I tried to use droid package, but it doesn't work for me.

How to use the fonts with cyrillic support, shipped with TeX Live in xelatex?

Update

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[russian, english]{babel}
\usepackage{fontspec}
\usepackage[T2A]{fontenc}
\usepackage[default]{droidserif}
\usepackage[defaultsans]{droidsans}
\begin{document}
Some meaningful text.

Какой-то осмысленный текст.
\end{document}
7
  • \usepackage[T2A]{fontenc} should not be used with xelatex. If you want to use xelatex use fontspec and \setmainfont. If you don't like Arial find another one. Apr 23, 2020 at 8:35
  • @UlrikeFischer "If you don't like Arial find another one." - is it possible to use fonts shipped with Latex or only those installed in my system?
    – user4035
    Apr 23, 2020 at 9:03
  • You can use all fonts in fonts/opentype and fonts/truetype in your tex system, but I don't know which of them support cyrillic. You will have to check. Apr 23, 2020 at 9:07
  • @UlrikeFischer egreg in his answer gives a listing of fonts. He mentions droid package. How to use them? ``\usepackage{droid}` doesn't work.
    – user4035
    Apr 23, 2020 at 9:23
  • Hm. This package is not completly bugfree, droidmono seems to be missing. Try \usepackage[default]{droidserif}\usepackage[defaultsans]{droidsans} and report the error to the maintainer. Apr 23, 2020 at 9:30

2 Answers 2

3

Here is how to do it:

\documentclass{article}

\usepackage[russian, english]{babel}

\babelfont{rm}{Droid Serif}
\babelfont{sf}{Droid Sans}

\begin{document}

Some meaningful text.

Какой-то осмысленный текст.

\end{document}

See the babel manual for further details, because you may need to switch the language somehow with the Russian text.

enter image description here

4
  • It it possible to use Computer modern font in TeXLive 2020 out of the box? I had to install it manually from font squirrel.
    – user4035
    Apr 23, 2020 at 15:53
  • Then this worked: \setmainfont{CMU Concrete}.
    – user4035
    Apr 23, 2020 at 16:02
  • The equivalents to Computer Modern are CMU Serif and CMU Sans Serif. Apr 23, 2020 at 16:23
  • I meant: do I need to install Computer modern family manually or it is somehow shipped with TeXLive?
    – user4035
    Apr 23, 2020 at 18:21
2

don't use \usepackage[T2A]{fontenc} with xelatex

This here should work

\documentclass{article}
\usepackage[default]{droidserif}
\usepackage[defaultsans]{droidsans}
\begin{document}
Какой-то осмысленный текст.
\sffamily 

Какой-то осмысленный текст.
\end{document}

enter image description here

4
  • Nope, it gave me an empty pdf. What can be wrong? Using TeX Live 2018.
    – user4035
    Apr 23, 2020 at 9:39
  • LaTeX Font Warning: Font shape TU/fdr/m/n' undefined (Font) using TU/lmr/m/n' instead on input line 4.
    – user4035
    Apr 23, 2020 at 9:41
  • Then your system is too old. I have texlive 2020. Apr 23, 2020 at 9:47
  • 1
    I installed TexLive 2020, now your code works. But is it possible to use computer modern like font? I like it.
    – user4035
    Apr 23, 2020 at 11:35

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.