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}
3
  • 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, 2016 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. Mar 25, 2016 at 22:08
  • @Robert: You are right that one get similar error also without microtype (I didn't want to blame it anyway). Mar 26, 2016 at 9:52

1 Answer 1

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}
1
  • You are completly right. Using hypersetup is naturally much better. Mar 26, 2016 at 9:51

You must log in to answer this question.

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