## LaTeX forum ⇒ LyX ⇒ Beamer doesn't compile because of inputenc Topic is solved

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
tygrysuav
Posts: 14
Joined: Mon Oct 01, 2018 8:34 pm

### Beamer doesn't compile because of inputenc

Recently beamer presentations have stopped compiling if they are not in English. But I need them in Polish and here is the problem. Articles work normally in both languages.

Nothing I found on the web is working. Neither changing the preamble nor setting the LyX itself. I also tried to change the coding in the external program.

I get this message:

Package inputenc Error: Invalid UTF-8 byte 179.
\DeclareFontEncoding{PD1}{}{}

The document does not appear to be in UTF-8 encoding.
Try adding \UseRawInputEncoding as the first line of the file
or specify an encoding such as \usepackage [latin1]{inputenc}
in the document preamble.
Alternatively, save the file in UTF-8 using your editor or another tool

I can not use old files or create new ones. I know it's about UTF-8, but I can not deal with it and I really, really need help.

Below is the code of the sample .lyx file

\documentclass[polish]{beamer}\usepackage[T1]{fontenc}\usepackage[latin2]{inputenc}\setcounter{secnumdepth}{3}\setcounter{tocdepth}{3} \makeatletter%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.% this default might be overridden by plain title style\newcommand\makebeamertitle{\frame{\maketitle}}%% (ERT) argument for the TOC\AtBeginDocument{%  \let\origtableofcontents=\tableofcontents  \def\tableofcontents{\@ifnextchar[{\origtableofcontents}{\gobbletableofcontents}}  \def\gobbletableofcontents#1{\origtableofcontents}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.\usetheme{Singapore}\usecolortheme{seahorse}\usepackage{tikz}\usepackage{pgf}\usetikzlibrary{shapes.geometric}\usepackage{lmodern} \makeatother \usepackage{babel}\begin{document}\author{Imię i nazwisko}\title{Tytuł prezentacji}\makebeamertitle\begin{frame}{Slajd 1} Zażółć gęślą jaźń.\end{frame}% \end{document}

Stefan Kottwitz
Posts: 9329
Joined: Mon Mar 10, 2008 9:44 pm
Hi,

welcome to the forum!

Why do you use latin2 encoding? It works completely fine for me with utf8:

\usepackage[utf8]{inputenc}

Stefan

tygrysuav
Posts: 14
Joined: Mon Oct 01, 2018 8:34 pm
And how to disable latin2 in LyX? Because this line is what LyX adds.

Stefan Kottwitz
Posts: 9329
Joined: Mon Mar 10, 2008 9:44 pm
In the menu go to Document -> Language and change the Coding from default to Others and check what is available.

Stefan

tygrysuav
Posts: 14
Joined: Mon Oct 01, 2018 8:34 pm
In Document->Settings->Language I've changed coding to utf8. Now I get this errors:

LaTeX Error: Missing \begin{document}
Undefined control sequence.

Other options also do not work.

Stefan Kottwitz
Posts: 9329
Joined: Mon Mar 10, 2008 9:44 pm
Perhaps post the .log file here, as attachment to a post. The "Attachments" link is below the text edit field, when writing a post.

Stefan

tygrysuav
Posts: 14
Joined: Mon Oct 01, 2018 8:34 pm
I added the log file. This version had the language option set to "utf8"
Attachments
test.log

Stefan Kottwitz
Posts: 9329
Joined: Mon Mar 10, 2008 9:44 pm
Strange, as the code works for me fine with utf8. If there's not something different in your actual code than already shown here, it could be an error in a package (pd21enc.def?) of your TeX installation. It seems to be up to date though. Just perhaps, maybe you could try TeX Live instead of MiKTeX.

Stefan

tygrysuav
Posts: 14
Joined: Mon Oct 01, 2018 8:34 pm
The last time I compiled the beamer presentation a few months ago. Then everything worked. I do not understand what has changed since then, apart from the updates of LyX, MiKTeX and Windows 10.

Can this package pd21enc.def be reinstalled?

tygrysuav
Posts: 14
Joined: Mon Oct 01, 2018 8:34 pm
I have uninstalled MiKTeX and installed TeXLive 2018. The problem has disappeared. Case closed.