In a document class for XeLaTeX, I invoke hyperref in \AtBeginDocument so that it gets loaded last, and I reset the link colours at the same time. I then use \hypersetup in \maketitle to set the PDF metadata.

In the MWE below, I don't get any PDF metadata in the output (pdfinfo returns no title or author). I have obviously misunderstood something about \hypersetup with metadata, but what?

test.cls =========================================================================================

\ProvidesClass{test}[v0.1 test hypersetup]

test.tex =================================================================================

\title{Test document}
\author{A.N. Author}
Here is a link on some \href{http://latex.silmaril.ie}{text}

(Also, very weirdly, it fails to honour the colour purple, despite the xcolor documentation sayin that it's available by default).

  • as you are not loading xcolor it isn't really relevant what the documentation says about purple. Commented May 31, 2020 at 22:28
  • I assumed hyperref would load xcolor like it normally does because I requested [colorlinks]. Most of the time hyperref does load xcolor, and barfs because if you need a palette, you have to force it in with \PassOptionsToPackage to avoid the clash. Commented Jun 1, 2020 at 14:03
  • hyperref never loads xcolor. Commented Jun 1, 2020 at 14:16

1 Answer 1


Currently hyperref will write the metadata at the end of the first page to the pdf. Your \hypersetup is after the titlepage environment and so on the second page. This is too late.

  • Ooh, thank you. I had missed that. Commented Jun 1, 2020 at 14:03

You must log in to answer this question.

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