I am trying to generate a PDF file (using pdflatex) with hyperref references; both the title and author should be visible as pdf properties, and both contain accents or non us-ASCII. The rest of the document compiles fine using \documentclass[a4paper,openright]{book}, \usepackage[utf8]{inputenc} and \usepackage[spanish]{babel}.

I would expect this to work:

    % ...
    pdftitle={Título con acentos o eñes},

-- it generates around 54 warnings and outputs something like

Title:          T19 tulo con acentos o en126 nes
Author:         Miguela19 an126 nez
Creator:        LaTeX with hyperref package
Producer:       pdfTeX-1.40.10

I have also tried leaving the pdfauthor empty and later using






But all variants result in errors instead of warnings.

  • You can define pdfstringdef like that: \pdfstringdef\mtGEP{gedit \176/.profile} where \176 in this example is octal notation of tilde character. Sep 3, 2013 at 6:34

3 Answers 3


Try setting the properties with the command \hypersetup{...} instead of supplying them directly when loading hyperref (hyperref manual, page 4):

\hypersetup{pdftitle={A Perfect Day}}

As seen in the previous example, information entries (pdftitle, pdfauthor, . . . ) should be set after the package is loaded. Otherwise LaTeX expands the values of these options prematurely.

So the following code works fine for me, with the correct author and title displayed in Adobe Reader:

\hypersetup{pdftitle={Título con acentos o eñes},pdfauthor={Migueláñez}}
    The document
  • Works like a charm. And I thought I had tried all the variants. Thanks!
    – tucuxi
    Mar 9, 2011 at 9:26

While I think diabonas answer is preferable for Spanish or other non-English documents which anyway use inputenc and babel I like to post an answer which works without them. Just in case of a English-only document written by someone with non-ASCII letters in its name. Especially journals like when you minimize the number of used packages.

The trick is to escape the non-ASCII characters in the following way. Please note, that you can't use them as package option because the LaTeX kernel expands the \<number> sequences first and complains about that e.g. \3 is not defined. Inside \hypersetup they work fine:

    pdftitle={T\355tulo con acentos o e\361es}

Result (output of pdfinfo file.pdf):

Title:          Título con acentos o eñes
Author:         Migueláñez

A list of the needed numbers of special characters can be found e.g. under: http://www.pjb.com.au/comp/diacritics.html

  • Thanks Martin - wish I could vote two answers as correct, but diabonas' is slightly easier (no arcane reference for PDF characters required)
    – tucuxi
    Mar 9, 2011 at 9:25
  • @tucuxi: No problem. As I already wrote diabonas answer is normally preferable. I just wanted to add an alternative for other people which want to avoid e.g. babel etc. Mar 9, 2011 at 9:57
  • 1
    With variants like xetex that accept full unicode input (I think) could you just type the name in the document using the real unicode characters? Jun 28, 2012 at 11:36

I know that two answers have already been provided but I think mine is different and really handy. Why loading something in the preamble? If one uses inputs it is good to specify the TITLE in the real DOCUMENT FILE, as it logically goes there. If you edit your file with UTF-8 and unicode settings just use

\usepackage[unicode=true,,]{hyperref} %with more options specified if you like

then there is no problem in doing

\newcommand\longtitle{Właśnie tu długi tytuł} %translation: long title
\newcommand\authors{Przemysław Majewski}
\newcommand\headtitle{A tu króciutki} %translation: short title for headers

and then simply stating

%pdf authors and titles for hyperref ---> document specific

Does it work?

  • 1
    Welcome to TeX.sx!
    – Mensch
    Feb 7, 2013 at 19:20
  • thanks for the "unicode=true" option! without this option my characters were transliterated into latin letters.
    – MariusM
    Feb 4, 2016 at 16:12
  • 1
    The accepted solution does not work with LuaLaTeX. This one works with LuaLaTeX, while PDFLaTeX and XeLaTeX still work. So I might add [unicode=true] from now on by default. Or has it any drawbacks?
    – John
    Feb 8, 2018 at 8:03

You must log in to answer this question.

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