umlaute not rendered correctly with lualatex

  • 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


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.

Tags:

Unicode

Luatex