I've met today a bad interaction between microtype
, csquotes
autoquotes, and the itemize
environment, essentially leading to a "forgotten \endgroup
" error.
A MWE:
\documentclass{article}
\usepackage{microtype}
\usepackage{csquotes}
\MakeAutoQuote{“}{”}
\begin{document}
\begin{itemize}
\item “foo”
\end{itemize}
\end{document}
Which leads to error:
./document.tex:11: Extra }, or forgotten \endgroup.
<recently read> }
l.11 \item “
foo”
./document.tex:12: Missing } inserted.
<inserted text>
}
l.12 \end{itemize}
I can only reproduce when both packages are loaded and the active quote immediately follows \item
(passing an empty optional argument to it does not change things).
Am I missing something, or is this really a bad interaction between the packages? (I'm pretty sure this used to work, but my memory is known to have failed in similar instances…). If it is indeed, I suppose a report is due. I'd gladly do it, but I'm not sure whom to with this. Pointers in that regard are welcome. As is some temporary workaround.
Best Answer
EDIT: This has been fixed in
microtype
version 3.0a.Beginning with version 3.0,
microtype
applies some patches to improve protrusion at "inner margins", e.g. at the beginning of\item
s (see chapter 9 of themicrotype
doc). This requires some gymnastics, and here the active character fromcsquotes
interferes. A quick fix would be to prevent the patching with\microtypesetup{nopatch=item}
, either for the whole document or only the problematic case. A better fix (which will be included in the next version) would be to patch the pertinentmicrotype
command:(In a real document, you'd move the
\MT@get@prot
patch to the preamble, of course.)