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
    Jun 23 at 8:41
  • 1
    Get rid of fontenc and inputenc and recompile with (preferably) LuaLaTeX.
    – Ingmar
    Jun 23 at 8:41
  • @Rmano still the same problem Jun 23 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*] Jun 23 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 Jun 23 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
    Jun 23 at 9:31
  • 1
    Yes, It works without You are right Jun 23 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. Jun 23 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
    Jun 23 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 }] Jun 23 at 8:49
  • 1
    @Ingmar no. doing a full install of all packages is an install time option. Jun 23 at 8:52
  • 1
    @Ingmar OK but that's cheating:-) Jun 23 at 9:00

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.