# Incorrect Russian character in xelatex CMU Concrete

MWE in XeLaTex:

\documentclass[12pt]{article}
\usepackage[a4paper]{geometry}
\geometry{tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}
\usepackage[russian]{babel}
\begin{document}
Б\'{о}льший №
\end{document}


Output:

The same code in ordinary LaTeX is correct:

\documentclass[12pt]{article}
\usepackage[a4paper]{geometry}
\geometry{tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}
\usepackage[russian]{babel}
\begin{document}
Б\'{о}льший №
\end{document}


What is the cause? Font?

\documentclass[12pt]{article}
\usepackage[a4paper]{geometry}
\geometry{tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}
\usepackage{fontspec}
\usepackage{noto}
\setmainfont{Noto Serif} % <- Error
\usepackage[main=russian,english]{babel}
\begin{document}
\noindent
Б\'{о}льший №\\
\textsf{Sans serif text}\\
{\tt True type text}
\end{document}


Update with CMU Concrete font

\documentclass[12pt]{article}
\usepackage[a4paper]{geometry}
\geometry{tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}
\usepackage[russian]{babel}
\usepackage{fontspec}
\tracinglostchars=2
\babelfont{rm}[Script=Cyrillic, Language=Russian]{CMU Concrete}
\begin{document}
\setmainfont{CMU Concrete}[Script=Cyrillic, Language=Russian]
Б\'{о}льший №
\end{document}


Still the same:

• That's a font problem, if you use a font that supports different languages, like Noto (\usepackage{noto-serif}) the text appears as expected. – DG' Sep 20 at 21:14
• your title says cmu concrete but you don't load that font so you get latin modern (which doesn't cover Cyrillic at all) and you don't get the output you show? For your updated example using Noto, that is a freely available font you can install it if you do not have it available – David Carlisle Sep 20 at 21:50
• @DavidCarlisle Yes, but even if I try CMU concrete, I still get the same. – user4035 Sep 23 at 9:34

Use a font, that properly supports the languages, you are using. Here is a solution with Noto:

\documentclass[12pt]{article}
\usepackage{noto-serif}
\usepackage{noto-sans}
\usepackage{noto-mono}
\usepackage[russian]{babel}
\begin{document}

\textrm{Б\'{о}льший №}
\textsf{Б\'{о}льший №}
\texttt{Б\'{о}льший №}

\end{document}


• Can you show how to use Not? I liked it. To set all types of fonts: rm, sf and tt? – user4035 Sep 20 at 21:18
• And what are the names of the fonts? I tried \babelfont{rm}{Noto Serif}, but it can't find. Or maybe, it's not good for monospace? – user4035 Sep 20 at 21:21
• I was adding "noto" :-).....successively :-) +1 – Sebastiano Sep 20 at 21:23
• I added sans and mono – DG' Sep 20 at 21:29
• @DG' I have done a mistake clicking on delete :-( excuse me:-( Now there is my answer. – Sebastiano Sep 20 at 21:32

You didn’t actually load CMU Concrete. This MWE works fine in TeX Live 2020:

\documentclass[12pt]{article}
\usepackage[a4paper]{geometry}
\geometry{tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}
\usepackage[russian]{babel}

\tracinglostchars=2
\babelfont{rm}{CMU Concrete}

\begin{document}
Б\'{о}льший №
\end{document}


One advantage \babelfont has over the other approaches is that babel will load the font with Script=Cyrillic and Language=Russian, and switch to them whenever you select the Russian language. On LuaLaTeX, you could even switch automatically whenever you type in Cyrillic, with no other commands.

Cyrillic is enough like Latin that you can often get by with the default settings, but some fonts will give you Bulgarian letters instead of Russian unless you select the language as an OpenType font feature.

• It is impossible not give you an upvoted to your answer. :-) – Sebastiano Sep 21 at 11:44
• No, this doesn't work for me: gives empty squares. – user4035 Sep 21 at 12:48
• @Davislor Can you show, how to get Script=Cyrillic and Language=Russian? – user4035 Sep 21 at 12:49
• @user4035 I did. The \babelfont command takes care of that. With polyglossia, it would be something like \newfontfamily\russianfont{CMU Concrete}[Scale=Matchlowercase, Script=Cyrillic, Language=Russian]. – Davislor Sep 21 at 12:55
• @user4035 Or, if your document is all in Russian, you could \setmainfont{CMU Concrete}[Script=Cyrillic, Language=Russian]. – Davislor Sep 21 at 12:57

I think that being in XeLaTeX and the characters are in unicode...it is necessary to use,

\usepackage{fontspec}
\setmainfont{Arial} %<---- a random set of characters.


\documentclass[12pt]{article}
\usepackage[a4paper]{geometry}
\usepackage[russian]{babel}
\usepackage{fontspec}
\setmainfont{Arial}
\geometry{tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}

\begin{document}
Б\'{о}льший №
\end{document}


Using Noto Serif,

\documentclass[12pt]{article}
\usepackage[a4paper]{geometry}
\usepackage[russian]{babel}
\usepackage{fontspec}
\setmainfont{Noto Serif}
\geometry{tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}

\begin{document}
Б\'{о}льший №
\end{document}

• Can you try Noto? I liked it. To set all types of fonts: rm, sf and tt? – user4035 Sep 20 at 21:17
• @user4035 Yes of course, hoping to find the solution :-) – Sebastiano Sep 20 at 21:19
• \setmainfont[Ligatures=TeX]{Noto Serif} doesn't work for me. I used \usepackage{noto}, and it worked for rm, sf and tt fonts. – user4035 Sep 20 at 21:28
• Nope, still Package fontspec Error: The font "Noto Serif" cannot be found.. Maybe, it's not needed at all? I'll update the question, so you could reproduce. – user4035 Sep 20 at 21:33
• The noto package should install TrueType versions of the font family. The font’s download page is here. – Davislor Sep 21 at 6:25

I can't reproduce your picture from the first example you give and just the last glyph appears, because it is present in Latin Modern Roman.

On the other hand, the following code reproduces the font (CMU Concrete) with no strange box, both with XeLaTeX and LuaLaTeX.

\documentclass[12pt]{article}
\usepackage[a4paper]{geometry}
\geometry{tmargin=2cm,bmargin=2cm,lmargin=2cm,rmargin=2cm}
\usepackage[russian]{babel}
\usepackage{fontspec}

\setmainfont{CMU Concrete}[Script=Cyrillic]

\begin{document}

Б\'{о}льший №

\end{document}


• For me your code shows the boxes. \$ xelatex -v XeTeX 3.14159265-2.6-0.999992 (TeX Live 2020) kpathsea version 6.3.2 , Linux Slackware 14.2. Why such differences? – user4035 Sep 23 at 11:48
• @user4035 Possibly the fonts? – egreg Sep 23 at 13:00
• "Possibly the fonts?" - how to fix? This font was shipped with Latex, and I didn't install it. – user4035 Sep 24 at 11:44