3

Code

Consider the following example:

\documentclass{article}

\usepackage{amsmath}
\usepackage{xcolor}

\newcommand{\tegn}[1]{\mathcolor{red}{#1}}

\begin{document}

\begin{align}
  1
  &= 1 \\
  1 \tegn{\cdot} 1 \tegn{:} \tegn{(}  1 \tegn{+} 1 \tegn{)}
  &= \frac{1}{2}
\end{align}

\end{document}

Error

When I try to compile, I get the following error:

! Argument of \token_if_expandable:NTF has an extra }.
<inserted text> 
                \par 
l.15 \end{align}

Question

The code in the (almost) MEW doesn't compile but when I remove the only the last &, everything is fine. (The first & doesn't cause any problems at all.)

How can I make the code compilable when aligning the equations?

4

1 Answer 1

6

This is a bug, fixed for the next release see

https://github.com/latex3/latex2e/issues/901

There is a full patch there or simply guard the & with a \relax before the &.

You must log in to answer this question.

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