我已经创建了自己的命令,使用以下命令创建标记列向量blkarray
环境。当命令在align
环境内使用时,会出现垂直间距问题。它产生了太多的垂直空间。
我曾经使用过\\[-3em]
right after\begin{align}
和 just before \end{align}
;但我不想每次都手动调整。此外,我看了看这,但问题仍然存在。
\documentclass{article}
\usepackage{blkarray}
\usepackage{amsmath}
\setlength{\parindent}{0pt}
\newcommand{\colVectorLabelled}[2]{
\ensuremath{\mathrm{#1} =
\begin{blockarray}{*{1}{c} l}
\begin{block}{*{1}{>{$\footnotesize}c<{$}} l} & \\\end{block}
\begin{block}{[c]>{$\footnotesize}l<{$}}#2\end{block}
\end{blockarray}
}
}
\begin{document}
\textbf{The} \verb|\blockarray| \textbf{environment alone}: Some filler text
some filler text some filler text some filler text some filler text some filler text.\\
\colVectorLabelled{X}{1 & $0_{2}$\\0 & $1_{2}$\\}
\textbf{The} \verb|\blockarray| \textbf{environment inside} \verb|\align|
\textbf{environment}: Some filler text some filler text some filler text some
filler text some filler text some filler text.\\
\begin{align}
\colVectorLabelled{X}{1 & $0_{2}$\\0 & $1_{2}$\\}
\end{align}
More filler text filler text filler text filler text filler text filler text filler text
\end{document}
提前致谢 :)
答案1
这是解决方法,使用\useshortskip
fromnccmath
来处理上面的间距,并使用 simplle\vskip -2ex
来处理下面的空间:
\documentclass{article}
\usepackage{blkarray}
\usepackage{amsmath, nccmath}
\setlength{\parindent}{0pt}
\newcommand{\colVectorLabelled}[2]{
\ensuremath{\mathrm{#1} =
\begin{blockarray}{*{1}{c} l}
\begin{block}{*{1}{>{$\footnotesize}c<{$}} l} & \\\end{block}
\begin{block}{[c]>{$\footnotesize}l<{$}}#2\end{block}
\end{blockarray}
}
}
\begin{document}
\textbf{The} \verb|\blockarray| \textbf{environment alone}: Some filler text
some filler text some filler text some filler text some filler text some filler text.\\
\colVectorLabelled{X}{1 & $0_{2}$\\0 & $1_{2}$\\}
\textbf{The} \verb|\blockarray| \textbf{environment inside} \verb|\align|
\textbf{environment}: Some filler text some filler text some filler text some
filler text some filler text some filler text some filler text some filler text some filler text.\useshortskip
\begin{align}
\colVectorLabelled{X}{1 & $0_{2}$\\0 & $1_{2}$\\}
\end{align}\vskip-2ex
More filler text filler text filler text filler text filler text filler text filler text
\end{document}