I am trying to figure out if it is possible to (locally) redefine \\ (double backslash) within amsmath's align environment. On the one hand, I'd like to be able to dynamically insert extra columns, on the other I'd like to manipulate spacing. Here is an example, which does not work:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
\renewcommand{\\}{& x \\[1cm]}%
1 \\
2 \\
3
\end{align*}
\end{document}
The adapted \\ is active for the first line but seems to be reset afterwards so the output is
1x
2
3
Redefining the command once again after the first line makes it active for the second but stops again working after the second line.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
\renewcommand{\\}{& x \\[1cm]}%
1 \\ \renewcommand{\\}{& x \\[1cm]}%
2 \\
3 \\
4
\end{align*}
\end{document}
Similarly, if I first store away the original \\ and use that in my redefinition
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\let\mylb\\
\begin{align*}
\renewcommand{\\}{& x \mylb[1cm]}%
1 \\
2 \\
3 \\
4
\end{align*}
\end{document}
the result is not quite what I hoped for as this seems just to swallow up the linebreak:
1x2
3
4
Is there a way to achieve what I'm trying here?