LyXBeamer doesn't compile because of inputenc

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

Beamer doesn't compile because of inputenc

Post by tygrysuav »

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

Code: Select all

\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}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Beamer doesn't compile because of inputenc

Post by Stefan Kottwitz »

Hi,

welcome to the forum!

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

\usepackage[utf8]{inputenc}

Stefan
LaTeX.org admin
tygrysuav
Posts: 16
Joined: Mon Oct 01, 2018 8:34 pm

Beamer doesn't compile because of inputenc

Post by tygrysuav »

And how to disable latin2 in LyX? Because this line is what LyX adds.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Beamer doesn't compile because of inputenc

Post by Stefan Kottwitz »

In the menu go to Document -> Language and change the Coding from default to Others and check what is available.

Stefan
LaTeX.org admin
tygrysuav
Posts: 16
Joined: Mon Oct 01, 2018 8:34 pm

Beamer doesn't compile because of inputenc

Post by tygrysuav »

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.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Beamer doesn't compile because of inputenc

Post by Stefan Kottwitz »

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
LaTeX.org admin
tygrysuav
Posts: 16
Joined: Mon Oct 01, 2018 8:34 pm

Beamer doesn't compile because of inputenc

Post by tygrysuav »

I added the log file. This version had the language option set to "utf8"
Attachments
test.log
(44.77 KiB) Downloaded 563 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Beamer doesn't compile because of inputenc

Post by Stefan Kottwitz »

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
LaTeX.org admin
tygrysuav
Posts: 16
Joined: Mon Oct 01, 2018 8:34 pm

Beamer doesn't compile because of inputenc

Post by tygrysuav »

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: 16
Joined: Mon Oct 01, 2018 8:34 pm

Beamer doesn't compile because of inputenc

Post by tygrysuav »

I have uninstalled MiKTeX and installed TeXLive 2018. The problem has disappeared. Case closed.
Post Reply