umlaute not rendered correctly with lualatex
The bookmarks are fixed with
hyperref
optionunicode
orpdfencoding=auto
. The options can be given to optionhyperref
of classbeamer
that passes the options to the packagehyperref
.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 thanOT1
with non-Unicode TeX compilers, because it supports some accented letters (umlauts). The recommendation for LuaTeX or XeTeX is packagefontspec
, 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}
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.