In another, now rather confused, question, I'm struggling to get copyright information into a PDF produced by memoir
.
The investigations so far have led to this problematical MWE:
% !TEX TS-program = XeLaTeX
% !TEX encoding = UTF-8 Unicode
\documentclass{article}
\usepackage{lipsum}
\usepackage{hyperref}
\usepackage{hyperxmp}
\hypersetup{
pdfauthor={Brent Longborough},
pdftitle={O Hai},
pdfcopyright={Copyright © 2012 by Brent Longborough. All rights reserved.},
}
\begin{document}
\lipsum[1]
\end{document}
which produces a PDF with the copyright notice successfully included in the metadata, and with the "PDF Producer" set to "XeTeX 0.9997"
However, if I change the document class to:
\documentclass{memoir}
then I get no copyright notice, and the PDF Producer is now set to "xdvipdfmx (0.7.8)".
After an hour or so ploughing through memoir.sty
and memhfixc.sty
, I'm flummoxed. Does anyone have any idea where to look next?
Best Answer
This is actually a timing problem: The metadata has to be inserted before the final
\clearpage
command, otherwise, it isn't written to the PDF document any more. However,memoir
issues a\clearpage
withso the code used by
hyperxmp
is too late as
\hyxmp@find@metadata
and\hyxmp@embed@packet
are executed after\clearpage
.To solve this, you can manually issue
in your document's preamble.
Minimal test code: