TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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}
share|improve this question
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 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 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 at 9:52
up vote 13 down vote accepted

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}
share|improve this answer
    
You are completly right. Using hypersetup is naturally much better. – Ulrike Fischer Mar 26 at 9:51

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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