[Tex/LaTex] Same height for list of comma-separated vectors

math-modematricesvertical alignment

I am trying to typeset a list of vectors spanning a multidimensional space, using the notation
span{v_1,v_2,...,v_n} (I haven't found out how to inline it as rendered latex)

i.e.:

span \{
  \begin{pmatrix} 1      \\ \vdots \\ \vdots \\ 1      \\ 1      \end{pmatrix},
  \begin{pmatrix} 0      \\ 1      \\ \vdots \\ \vdots \\ 1      \end{pmatrix},
  \begin{pmatrix} 0      \\ 0      \\      1 \\ \vdots \\ 1      \end{pmatrix}
  \begin{matrix}  \cdots \\        \\ \ddots \\ \ddots \\ \cdots \end{matrix}
  \begin{pmatrix} 0      \\ \vdots \\ \vdots \\      0 \\ 1      \end{pmatrix}
\}

but the fourth "vector", consisting of only various dots does not have the same size as the other vectors, since the dots take up more vertical space than 1 or 0 do.

I understand LaTeX doesn't know how to align them since they are all independent matrices but I'm not satisfied with the result. Is there any way to make them all have the same height?

Best Answer

You may want to take a look at easybmat:

\documentclass{article}
\usepackage{easybmat}

%\usepackage{etex} % if you also want tikz, then you also need etex,
%\usepackage{tikz} % and they have to be loaded AFTER easybmat

\newenvironment{bvec}[1]{\begin{BMAT}(r)[0pt]{c}{#1}}{\end{BMAT}}
\newenvironment{pbvec}[1]{\left(\begin{bvec}{#1}}{\end{bvec}\right)}

\begin{document}
$span \{
\begin{pbvec}{ccccc} 1      \\ \vdots \\ \vdots \\ 1      \\ 1      \end{pbvec},
  \begin{pbvec}{ccccc} 0      \\ 1      \\ \vdots \\ \vdots \\ 1      \end{pbvec},
  \begin{pbvec}{ccccc} 0      \\ 0      \\      1 \\ \vdots \\ 1      \end{pbvec}
  \begin{bvec}{ccccc}  \cdots \\  {}      \\ \ddots \\ \ddots \\ \cdots \end{bvec}
  \begin{pbvec}{ccccc} 0      \\ \vdots \\ \vdots \\      0 \\ 1      \end{pbvec}
\}$
\end{document}

which results in

alt text

There are a few annoying things with BMAT:

  • You must declare the number of columns at the top (I have no idea why, but I guess this has to do with the fact that they can be align differently or something)
  • You cannot have empty rows (see {} in the fourth line).