1

I've changed my OS (yesterday and I'm new to it) to Ubuntu 22.04, installed TeX Live and can't understand why it's not working with russian and ukrainian languages. I'm using Sublime Text as an editor


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

\begin{document}
 
Текст

\end{document}

Errors:

[Compiling /home/anmnv/Documents/text.tex]

TraditionalBuilder: Engine: pdflatex. Invoking latexmk... done.

Errors:

    /usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty:111: Package fontenc Error: Encoding file `t2aenc.def' not found. [\ProcessOptions*]
    /usr/share/texlive/texmf-dist/tex/generic/babel/babel.sty:4254: Package babel Error: Unknown option 'russian'. Either you misspelled it [\ProcessOptions*]
    /home/anmnv/Documents/text.tex:8: LaTeX Error: Unicode character Т (U+0422) [Т]
    /home/anmnv/Documents/text.tex:8: LaTeX Error: Unicode character е (U+0435) [Те]
    /home/anmnv/Documents/text.tex:8: LaTeX Error: Unicode character к (U+043A) [Тек]
    /home/anmnv/Documents/text.tex:8: LaTeX Error: Unicode character с (U+0441) [Текс]
    /home/anmnv/Documents/text.tex:8: LaTeX Error: Unicode character т (U+0442) [Текст]
    
    No warnings.
    
    /home/anmnv/Documents/text.log:1: Double-click here to open the full log.
    
    [Done!]
8
  • Works here for me if I switch T2A,T1 to T1, T2A. Strange...
    – Rmano
    Commented Jun 23, 2022 at 8:41
  • 1
    Get rid of fontenc and inputenc and recompile with (preferably) LuaLaTeX.
    – Ingmar
    Commented Jun 23, 2022 at 8:41
  • @Rmano still the same problem Commented Jun 23, 2022 at 8:44
  • @Ingmar Your suggestion gives: Errors: /usr/share/texlive/texmf-dist/tex/generic/babel/babel.sty:4254: Package babel Error: Unknown option 'russian'. Either you misspelled it [\ProcessOptions*] Commented Jun 23, 2022 at 8:44
  • 1
    You are using the debian packaged texlive, so need to install babel russian via apt or whatever linux package manager you use, as apparently you chose not to install all texlive packages originally Commented Jun 23, 2022 at 8:49

2 Answers 2

1

Thanks to @DavidCarlisle suggestion "I had to install babel russian" and also thanks to @Rmano suggestion about "switch T2A,T1 to T1, T2A" (it really works). So my solution is:

sudo aptitude -y install texlive-lang-cyrillic

\documentclass{article}
\usepackage[T1, T2A]{fontenc}
\usepackage[russian,english]{babel}

\begin{document}
 
Текст

\end{document}
2
  • 1
    I still suggest you get rid of inputenc … utf-8 has been the default for years now. (And Sublime certainly supports it.)
    – Ingmar
    Commented Jun 23, 2022 at 9:31
  • 1
    Yes, It works without You are right Commented Jun 23, 2022 at 9:50
0

This works for me on TL 2022 (Windows 10, but still):

\documentclass{article}
\usepackage[english]{babel}
\usepackage{fontspec}
\setmainfont{cmunrm.otf}

\begin{document}
 
Hello, world! Привет, мир!

\end{document}
8
  • 1
    You have the babel russian support insalled, the OP has not, so switching to luatex will still error. Commented Jun 23, 2022 at 8:47
  • Fair enough. But isn't the point of TL that it comes with everything pre-installed, so to speak? I usually don't do Russian, but it worked out of the box for me.
    – Ingmar
    Commented Jun 23, 2022 at 8:49
  • @Ingmar still many errors, like Package fontspec Error: The font "NotoSans" cannot be found. [] and /usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty:3901: Font \TU/lmr/bx/n/10=[lmroman10-bold]:+tlig; at 10pt not loadable: metric data not found or bad. [\strongfontdeclare{ \bfseries }] Commented Jun 23, 2022 at 8:49
  • 1
    @Ingmar no. doing a full install of all packages is an install time option. Commented Jun 23, 2022 at 8:52
  • 1
    @Ingmar OK but that's cheating:-) Commented Jun 23, 2022 at 9:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .