9

Im using the the KOMA-Script documentclass scrreprt with luatex.

With the fontspec package the umlauts are printed correct in the chapters and sections but the hyperref package does print the umlauts wrong in the bookmarks of the pdf.

MWE

\documentclass{scrreprt}

\usepackage{fontspec}
\usepackage{hyperref}

\begin{document}

\chapter{Test Ü}
\chapter{Test Ä}

\end{document}

Result

Umlauts in PDF bookmarks

How to print the bookmarks correct?

1 Answer 1

15

Solution

Use \usepackage[pdfencoding=auto]{hyperref} in your preamble.

MWE

\documentclass{scrreprt}

\usepackage{fontspec}
\usepackage[pdfencoding=auto]{hyperref}

\begin{document}

\chapter{Test Ü}
\chapter{Test Ä}

\end{document}

Explanation

The PDF format allows two encodings for bookmarks and entries in the information dictionary: PDFDocEncoding and Unicode as UTF-16BE. Option ”pdfencoding” selects between these encodings:

  • ”pdfdoc” uses PDFDocEncoding. It uses just one byte per character, but the supported characters are limited (244 in PDF-1.7).

  • ”unicode” sets Unicode. It is encoded as UTF-16BE. Two bytes are used for most characters, surrogates need four bytes.

  • ”auto” PDFDocEncoding if the string does not contain characters outside the encoding and Unicode otherwise.

Credit

same topic discussed in german forum and hyperref package manual

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .