Page LayoutUmlaute in hyperref

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
tehingo
Posts: 6
Joined: Tue Oct 28, 2008 1:51 pm

Umlaute in hyperref

Post by tehingo »

Hey everbody,

I just encountered a very general error which I could not find on Google, so it might be helpful for a lot of people and I am glad to be able to post it here.

When I try to use Umlaute (Ä Ö Ü etc.) in the title of the hyperref package it does not work. I tried a workaround given in the manual using the ucs package, but can not get it to work. In the hyperref manual it says:
ucs/utf8x.def
The first time a multibyte UTF8 sequence is called, it
does some calculations and stores the result in a macro
for speeding up the next calls of that UTF8 sequence.
However this makes the first call non-expandable and
will break if used in information entries or bookmarks.
Package "ucs" offers \PrerenderUnicode or \PreloadUnicodePage
to solve this:
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage{hyperref}% or with option unicode
\PrerenderUnicode{^^c3^^b6}% or \PrerenderUnicodePage{1}
\hypersetup{pdftitle={Umlaut example: ^^c3^^b6}}
The notation with two carets avoids trouble with 8-bit bytes
for the README file, you can use the characters directly.
Here are some code snippets:

Code: Select all

\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage[pdftitle={Vorlesung W\"arme- und Stoff\"ubertragung im Bachelorstudiengang Prozesstechnik},
		pdfauthor={ },
		pdfcreator={LaTeX2e,TeXLive 2008},
		pdfsubject={Vorlesung},
		pdfkeywords={W\"armestofflehre, Skript,  Vorlesung}]{hyperref}
I really hope you can help! Thanks a lot in advance.

Cheers
Ingo

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Umlaute in hyperref

Post by gmedina »

Hi,

use the \hypersetup command:

Code: Select all

\documentclass{article}
\usepackage{ucs}
\usepackage[utf8x]{inputenc}
\usepackage{hyperref}

\hypersetup{pdftitle={Vorlesung W\"arme- und Stoff\"ubertragung im Bachelorstudiengang Prozesstechnik},
      pdfauthor={ },
      pdfcreator={LaTeX2e,TeXLive 2008},
      pdfsubject={Vorlesung},
      pdfkeywords={W\"armestofflehre, Skript,  Vorlesung}}

\begin{document}
Test
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Post Reply