# Compilation error when using &

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?

• the patch there, or just put \relax before the & Aug 2 at 16:44
• @DavidCarlisle Thank you very much! :-) Should I delete the question? Aug 2 at 16:45
• No I guess I should answer, someone else may be looking Aug 2 at 16:53

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