I want the following code to be a new command with two parameters (x and y):
\begin{bmatrix}
x \\
y
\end{bmatrix}
how can I do that?
I want the following code to be a new command with two parameters (x and y):
\begin{bmatrix}
x \\
y
\end{bmatrix}
how can I do that?
\newcommand\ctwo[2]{%
\begin{bmatrix}
#1\\
#2
\end{bmatrix}}
then
\[
\ctwo{1}{2} + \ctwo{3}{4} = \ctwo{4}{6}
\]
\[ as I showed not $$ and as shown here you should not have to wrap each \ctwo in math unless that is the entire expression. https://tex.stackexchange.com/questions/503/why-is-preferable-to/69854#69854 for % see https://tex.stackexchange.com/questions/7453/what-is-the-use-of-percent-signs-at-the-end-of-lines-why-is-my-macro-creat
– David Carlisle
Dec 14 '21 at 17:46
\usepackage{amsmath}? – egreg Dec 14 '21 at 17:30