1

Since I upgraded my release to Ubuntu 20.04 and therefore latex in the following version:

pdflatex -version
pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian)
kpathsea version 6.3.1
Copyright 2019 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.37; using libpng 1.6.37
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.01

using german umlaut signs in titles do not work as before anymore, if listings and hyperref packages are used.

As a minimal example is:

\documentclass[12pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{listings}

\usepackage[pdftitle={Ä test}, hidelinks]{hyperref}

\title{Ä test}

\begin{document}

This is a test

\end{document}

which results in

...
(/usr/share/texlive/texmf-dist/tex/latex/auxhook/auxhook.sty)
(/usr/share/texlive/texmf-dist/tex/latex/kvoptions/kvoptions.sty)
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def)
(/usr/share/texlive/texmf-dist/tex/generic/intcalc/intcalc.sty)
(/usr/share/texlive/texmf-dist/tex/generic/etexcmds/etexcmds.sty)
! Argument of \def has an extra }.
<inserted text> 
                \par 
l.4421 \ProcessKeyvalOptions{Hyp}

?

When I replace Ä by AE, it works, and but if I replace Ä by {\A} like suggested e.g. in How to write “ä” and other umlauts and accented letters in bibliography? errors appear.

Is there way of savely using umlaut characters, listings and hyperref in current pdflatex?

1 Answers1

2

The problem is in timing. If you load \usepackage[T1]{fontenc}, then Ä can become the correct character through expansion. However, other special characters might lead to the same issue, so this is not fully safe.

Use \hypersetup instead.

On the other hand, using the T1 encoding is recommended for German.

\documentclass[12pt]{scrartcl}
%\usepackage[utf8]{inputenc} % no longer necessary
\usepackage[T1]{fontenc} % recommended for German
\usepackage[ngerman]{babel}
\usepackage{listings}

\usepackage{hyperref} \hypersetup{ pdftitle={Ä test}, hidelinks, }

\title{Ä test}

\begin{document}

This is a test

\end{document}

enter image description here

egreg
  • 1,121,712