在\newenvironment LaTeX中使用数字作为输入



我正在尝试创建一个构建列向量的环境,并将行之间距离的比例因子作为输入:

newenvironment{VEC}[1]{begin{Bmatrix}renewcommand{arraystretch}{#1}}
{end{Bmatrix}} 

我知道newenvironment命令只接受字符串作为输入,所以我尝试使用value{#1},但没有成功的结果。如有任何帮助,我们将不胜感激。

newenvironment或参数无关,您只需要切换顺序:

documentclass{article}
usepackage{mathtools}
newenvironment{VEC}[1]{renewcommand{arraystretch}{#1}begin{Bmatrix}}
{end{Bmatrix}} 

begin{document}
[
begin{VEC}{3}
4\
6\
end{VEC}
]
end{document}

最新更新