When I run the following code (using hyperref version 2012/09/27 v6.83g), I do not get any errors or warnings, but the metadata I set using pdfinfo doesn't appear. If I uncomment the \@firstofone line, effectively removing the group, it does.
I could not see any documentation in the manual that states one must be careful to use pdfinfo outside of all groups, so I have a feeling this might be a bug. Due to the grouping issue, I suspect this bug is caused by internal assignments in hyperref being local instead of global. I get a bit lost when reading the hyperref code, so I have so far been unable to determine the cause (and therefore a solution) to this problem.
\documentclass{article}
\usepackage{hyperref}
\makeatletter
%\@firstofone
{
\hypersetup{pdfinfo={extrainfo={yes please}}}
}
\begin{document}
Check the pdf metadata.
\end{document}
(Of course, in my actual example, I don't know how many levels deep I need to 'escape', and neither do I know any such way to escape! I cannot easily test my assumption about assignment locality as I am not aware of any trick to set a flag or something to make all assignments in a group global even if they were not defined \global, and I expect that may have other unwanted consequences anyway.)
Is anyone able to offer a fix or a workaround?
pdflatexworkflow. – cyberSingularity Oct 7 '12 at 11:14Authorinstead ofextrainfo, the setting is respected independently of grouping. The "unknown" key instead is added only if at the outer level. – egreg Oct 7 '12 at 11:20