12

I'm creating a presentation with LaTeX beamer in German.

I've read this answer about Umlaute: German character not rendered to pdf

But I still have some issues.

This is my LaTeX document:

\documentclass[aspectratio=169]{beamer}
\usepackage[utf8]{inputenc}
\usepackage[german]{babel}
\usepackage[T1]{fontenc}  
\begin{document}
\section{äöüßÄÖÜ "a"o"u"s"A"O"U}
\begin{frame}{ä ö ü ß Ä Ö Ü "a "o "u "s "A "O "U} 
\tableofcontents
\Huge
ä ö ü ß Ä Ö Ü "a "o "u "s "A "O "U
\end{frame}
\end{document}

and this is the resulting PDF translated with LuaLaTeX:

enter image description here

as you can see there are 2 issues:

  1. The UTF-8 ß is always resolved to SS while all the other Umlaute render correctly.
  2. The PDF content view never renders UTF-8 Umlaute correctly.

my latex version is:

$ lualatex --version
This is LuaTeX, Version beta-0.80.0 (TeX Live 2015/Debian) (rev 5238)

how can I fix the Umlaut problem other than changing all Umlaute to their "x form?

[edit] The answer given here Using LuaTeX as a replacement for pdfTeX solves the problem, but does not address the "Umlaut" problem explicitly so that I was not able to find it.

12
  • The bookmarks are fixed with hyperref option unicode or pdfencoding=auto. The options can be given to option hyperref of class beamer that passes the options to the package hyperref.

  • Assuming the text is written in UTF-8, package inputenc must be removed for LuaLaTeX or XeLaTeX. Both are already using UTF-8.

  • Font encoding T1 is better than OT1 with non-Unicode TeX compilers, because it supports some accented letters (umlauts). The recommendation for LuaTeX or XeTeX is package fontspec, because they support TrueType and OpenType Unicode fonts. The default fonts are then Latin Modern, which are derived from the Computer Modern fonts (e.g., a much larger range of accented characters are supported).

Full example:

\documentclass[aspectratio=169,hyperref={unicode}]{beamer}
\usepackage{fontspec}
\usepackage[german]{babel}
\begin{document}
\section{äöüßÄÖÜ "a"o"u"s"A"O"U}
\begin{frame}{ä ö ü ß Ä Ö Ü "a "o "u "s "A "O "U}
\tableofcontents
\Huge
ä ö ü ß Ä Ö Ü "a "o "u "s "A "O "U
\end{frame}
\end{document}

Result

  • is it possible to set the ,hyperref={unicode} option in the preamble instead of the documentclass itself? – Timothy Truckle Nov 12 '16 at 15:23
  • 3
    @TimothyTruckle No, it's to late after \documentclass, because hyperref is already loaded by the class. Alternatives: The option can be specified in a configuration file hyperref.cfg or it can be given before \documentclass by \PassOptionsToPackage{unicode}{hyperref}. – Heiko Oberdiek Nov 12 '16 at 15:41
  • I'd like to invite you to this follow up question. – thewaywewalk Nov 12 '16 at 16:17
  • +1: I have the same problem but I use the newer \usepackage{bookmark}. The options you mention (unicode and pdfencoding=auto) are not mentioned in the (bookmark) manual and throw an (useful) error message. I now added the hyperref package and this solved the problem but I am not sure if that's the way you intended to use the bookmark package (using hyperref and bookmark at the same time). – Dr. Manuel Kuehner Feb 13 '18 at 10:28
  • 1
    The options unicode or pdfencoding=auto belong to package hyperref. Package bookmark loads package hyperref (because of \pdfstringdef). – Heiko Oberdiek Feb 13 '18 at 18:48
11

If you use lualatex but you're not planning to use unicode fonts by means of loading the fontspec package, you should load

\usepackage[utf8]{luainputenc}

instead of inputenc.

If you actually want to use unicode fonts, loading fontspec is sufficient and neither luainputenc nor fontenc are needed.


Apart from that, I disagree with the often given general recommendation not to load fontenc in case lualatex is used.*

Because the necessity of this package does not depend on the compiler used, but whether or not the fontspec package is loaded.

The majority of people use lualatex because of the fontspec package, as it enables the use of unicode fonts. But there are people, like me, using lualatex because of the ability to deal with lua-code (and other advantages...), but don't like to use unicode fonts (as it is slow, and other disadvantages...). In the latter case you still could need fontenc.

*Here you can find a further discussion on this topic.

  • 1
    @AlanMunn You're right, I hope my edit made it clearer. What bothers me is the phrase for "for most users the advice to use fontspec ... is more practical" - which I read very often, because it implies that you should load fontspec when you use lualatex, which is absolutely not the case. Working in a language with lots of umlauts using lualatex saves you so much problems, but fontspec creates so much new problems. I got into that trap and tried so solve them, before I found out, not using fontspec is much more convenient and faster. – thewaywewalk Nov 12 '16 at 14:46
  • 1
    Thanks, that makes it much clearer. I'll delete my original comment. – Alan Munn Nov 12 '16 at 15:16

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.