The following minimal example doesn't compile when the optional argument to \macro
is used:
\documentclass{article}
\usepackage{xparse,amsmath}
\NewDocumentCommand{\macro}{o}{A\IfValueT{#1}{(#1)}}%
\begin{document}
\begin{align}
abc \macro \\
def \macro[A]% Error
\end{align}
\end{document}
I'm using the following file list:
*File List* article.cls 2014/09/29 v1.4h Standard LaTeX document class size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option) xparse.sty 2016/03/26 v6466 L3 Experimental document command parser expl3.sty 2016/03/26 v6466 L3 programming layer (loader) expl3-code.tex 2016/03/26 v6466 L3 programming layer l3pdfmode.def 2016/03/26 v6465 L3 Experimental driver: PDF mode amsmath.sty 2016/03/03 v2.15a AMS math features amstext.sty 2000/06/29 v2.01 AMS text amsgen.sty 1999/11/30 v2.0 generic functions amsbsy.sty 1999/11/29 v1.2d Bold Symbols amsopn.sty 1999/12/14 v2.01 operator names ***********
I'm not sure whether the problem may lie, as both xparse
and amsmath
was recently updated.
expl3
has madexparse
buggy in that respect; today's update ofl3packages
makes it completely unusable.:(