1

I have created my own command that creates labelled column vectors using the blkarray environment. Vertical spacing issues arises when the command is used inside the align environment. It generated too much vertical space.

I have used \\[-3em] right after \begin{align} and just before \end{align}; but I don't want to adjust it manually every time. Moreover, I took a look at this, but the problem still persists.

Output

\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}

Thanks in advance :)

1

Here is is workaround, with \useshortskip from nccmath for the above spacing, and a simplle \vskip -2ex for the space below:

\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} 

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.