I want to create a new matrix environment with different spacing for a matrix instead of manually typing arraystretch locally for each matrix. I am new to more advanced LaTeX coding, and have not quite figured this out. I thought that I could just do
\newenvironment{dbmatrix}{
\renewcommand*{\arraystretch}{1.5}
\ensuremath{\begin{bmatrix} \end{bmatrix}}
}}
But then, after searching through Stack, I thought maybe I need to use \bgroup
,\egroup
or \makeatletter
, \makeatother
type commands, but have not figured out how these commands really work and failed using them. It would also be great to have maybe an additional environment that took an argument to adjust \arraystretch
, like \begin{dbmatrix}{1.5} \end{dbmatrix}
. Would love some help and suggestions.
\newenvironment{dbmatrix}{\bgroup \renewcommand*{\arraystretch}{1.5} \begin{bmatrix}}{\end{bmatrix}\egroup}
\bgroup
,\egroup
. Thank you much.