I'm trying to create a new command in LaTeX that will let me do
\begin{bmatrix}1\\2\\3\end{bmatrix}
Like this:
\m{1\\2\\3}
I can make two functions, one for the begin and one for the end bmatrix
, and that works, but I'd like to make it work with one command. The issue with that is there can be any number of variables in the command. I've looked around and found some answers showing how to do it if you have, say, an optional second variable only. I'm trying to make this work with any number of arguments.
\newcommand{\m}[1]{\begin{bmatrix}#1\end{bmatrix}}
...\m
isn't taken, lots of others are. See Short names for macros.