12

The following document gives the error

 ! Argument of \MT@res@a has an extra }.

The source of the error is the accent command \"L (which doesn't make much sense, I only use it in the examples as it always use \accent even with T1 encoding).

The second source of the problem is the fact that hyperref is loaded in \AtBeginDocument behind the code of microtype. Loading microtype later (or hyperref earlier), avoids the error.

But I wonder if there is a better solution to protect the argument of pdfauthor than fine tuning the loading order (which is a pain with hyperref anyway).

\documentclass{article}
\usepackage[T1]{fontenc}

\usepackage{microtype}

\AtBeginDocument{%
  \RequirePackage[%
    pdfauthor={Max \"Labc}
  ]{hyperref}
}

\begin{document}
ablub
\end{document}
  • 4
    (1) frankly, loading a package \AtBeginDocument seems to be somewhat outside the specs; (2) you'd get also get an error (albeit a different one, but for the same reasons) if your pdfauthor contained, e.g., \textcopyright, so it's not microtype's fault. – Robert Mar 25 '16 at 21:55
  • @Robert I wished I hadn't to load it this way, but this is in a class, and it's the only way to load hyperref as late as possible. It is quite a pain. – Ulrike Fischer Mar 25 '16 at 22:08
  • @Robert: You are right that one get similar error also without microtype (I didn't want to blame it anyway). – Ulrike Fischer Mar 26 '16 at 9:52
14

Using \hypersetup to set the author instead of supplying it directly at load time seems to work fine, which is recommended practice anyway when using special characters:

\documentclass{article}
\usepackage[T1]{fontenc}

\usepackage{microtype}

\AtBeginDocument{%
  \usepackage{hyperref}
  \hypersetup{pdfauthor={Max \"Labc}}
}

\begin{document}
ablub
\end{document}
  • You are completly right. Using hypersetup is naturally much better. – Ulrike Fischer Mar 26 '16 at 9:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.