I'm trying to write a macro in which one of the arguments is a double backslash, to obtain a column matrix, but I'm unable to escape the \
character. Here's a simple example that throws an error. It also throws an error if I try \myBmatrix{z_1 \\ z_2}
or \myBmatrix{z_1 \\\\\\ z_2}
(The actual macro I'm trying to write is more complex but I thought I'd start with this silly one)
\documentclass{amsart}
\def\myBmatrix#1{
\begin{bmatrix}
{{#1}}
\end{bmatrix}
}
\begin{document}
\begin{align}
\myBmatrix{z_1 \\\\ z_2}
\end{align}
\end{document}