2

Can anybody answering why the error - Encoding file `utf8enc.def' not found is?

111.tex input file :

\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[utf8]{fontenc}
\usepackage[russian,english]{babel}

\begin{document}
АБВ ABC
\end{document}

Terminal output :

dy636363@computerdy636363 ~ $ latex 111.tex
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)
restricted \write18 enabled.
entering extended mode
(./111.tex
LaTeX2e <2011/06/27>
Babel <3.9g> and hyphenation patterns for 2 languages loaded.
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo))
(/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def
(/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.dfu)
(/usr/share/texlive/texmf-dist/tex/latex/base/ot1enc.dfu)
(/usr/share/texlive/texmf-dist/tex/latex/base/omsenc.dfu)))
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty

! Package fontenc Error: Encoding file `utf8enc.def' not found.
(fontenc)                You might have misspelt the name of the encoding.

ls program output of that directory is and it contain utf***:

dy636363@computerdy636363 ~ $ ls /usr/share/texlive/texmf-dist/tex/latex/base/
...
exscale.sty   leqno.sty     ot1cmfib.fd   t1cmdh.fd     utf8.def
fix-cm.sty    letter.cls    ot1cmfr.fd    t1cmfib.fd    utf8enc.dfu
fixltx2e.sty  letter.sty    ot1cmr.fd     t1cmfr.fd     utf8-test.tex
flafter.sty   lppl.tex      ot1cmss.fd    t1cmr.fd      utf8test.tex
Torbjørn T.
  • 206,688
  • Welcome to TeX.sx! Your post was migrated here from [so]. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. – Werner Jun 05 '14 at 17:39

3 Answers3

5

The line \usepackage[utf8]{fontenc} is incorrect: the good one is

\usepackage[T2A,T1]{fontenc}

for supporting both the Latin and the Cyrillic alphabet. However, you have to mark up where you want to use Cyrillic:

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

\begin{document}
\foreignlanguage{russian}{АБВ} ABC

\textcyrillic{АБВ} ABC
\end{document}

Which one to choose between \foreignlanguage{russian} or \textcyrillic is a matter of taste.

enter image description here

egreg
  • 1,121,712
4

Font and input encodings are different things (see fontenc vs inputenc). As such, utf8 makes sense as an option for the inputenc package (it is an input encoding), but is nonsense for fontenc (it's not a font encoding). You presumably want something like

\usepackage[T1]{fontenc}

(or perhaps T2A,T1, as you seem to have some Russian text based on your babel line).

Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
0

This seems to be a bug in the new version of the base compiler.

I had the same error using pdflatex and resolved it replacing

\usepackage[utf8]{inputenc}

by

\usepackage[utf8]{input}

Then the compiler will say it didn't find input.sty and ask for a file. Just type 'inputenc.sty'. It should be able to complete.

I'm on my way to a better fix, waiting for the next release.

Edit: Sorry about that, my problem seem to have resolved itself. This has to do with the way the fontenc package appends the file names.