LaTeX forum ⇒ LyXBeamer 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

Postby tygrysuav » Mon Oct 01, 2018 8:59 pm

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

  1. \documentclass[polish]{beamer}
  2. \usepackage[T1]{fontenc}
  3. \usepackage[latin2]{inputenc}
  4. \setcounter{secnumdepth}{3}
  5. \setcounter{tocdepth}{3}
  6.  
  7. \makeatletter
  8. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
  9. % this default might be overridden by plain title style
  10. \newcommand\makebeamertitle{\frame{\maketitle}}%
  11. % (ERT) argument for the TOC
  12. \AtBeginDocument{%
  13. \let\origtableofcontents=\tableofcontents
  14. \def\tableofcontents{\@ifnextchar[{\origtableofcontents}{\gobbletableofcontents}}
  15. \def\gobbletableofcontents#1{\origtableofcontents}
  16. }
  17.  
  18. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
  19. \usetheme{Singapore}
  20. \usecolortheme{seahorse}
  21. \usepackage{tikz}
  22. \usepackage{pgf}
  23. \usetikzlibrary{shapes.geometric}
  24. \usepackage{lmodern}
  25.  
  26. \makeatother
  27.  
  28. \usepackage{babel}
  29. \begin{document}
  30. \author{Imię i nazwisko}
  31. \title{Tytuł prezentacji}
  32. \makebeamertitle
  33. \begin{frame}{Slajd 1}
  34.  
  35. Zażółć gęślą jaźń.
  36. \end{frame}
  37. %
  38.  
  39. \end{document}

User avatar
Stefan Kottwitz
Site Admin
Posts: 9344
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Mon Oct 01, 2018 10:26 pm

Hi,

welcome to the forum!

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

\usepackage[utf8]{inputenc}

Stefan
Site admin

tygrysuav
Posts: 14
Joined: Mon Oct 01, 2018 8:34 pm

Postby tygrysuav » Mon Oct 01, 2018 10:58 pm

And how to disable latin2 in LyX? Because this line is what LyX adds.

User avatar
Stefan Kottwitz
Site Admin
Posts: 9344
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Mon Oct 01, 2018 11:04 pm

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

Stefan
Site admin

tygrysuav
Posts: 14
Joined: Mon Oct 01, 2018 8:34 pm

Postby tygrysuav » Tue Oct 02, 2018 8:38 am

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: 9344
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Tue Oct 02, 2018 9:06 am

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
Site admin

tygrysuav
Posts: 14
Joined: Mon Oct 01, 2018 8:34 pm

Postby tygrysuav » Tue Oct 02, 2018 9:20 pm

I added the log file. This version had the language option set to "utf8"
Attachments
test.log
(44.77 KiB) Downloaded 54 times

User avatar
Stefan Kottwitz
Site Admin
Posts: 9344
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Tue Oct 02, 2018 11:10 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
Site admin

tygrysuav
Posts: 14
Joined: Mon Oct 01, 2018 8:34 pm

Postby tygrysuav » Wed Oct 03, 2018 10:31 am

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

Postby tygrysuav » Thu Oct 04, 2018 10:37 pm

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


Return to “LyX”

Who is online

Users browsing this forum: No registered users and 4 guests