# vertical dotted line in column vector / amsmath matrix

I would like to typeset the following set of equations:

... but with contiguous, vertical dotted lines in the column vectors, such that the top and bottom rows of the matrix and of the vectors are well aligned.

\vdots doesn't seem to be the right choice here, as I used it to produce the graphic above. The code is the following:

\documentclass{article}
\usepackage{amsmath}

\begin{document}
$$\begin{pmatrix} a_1 & b_1 & & & &\\ c_2 & a_2 & b_2 & & &\\ & c_3 & a_3 & b_3 & &\\ & & c_4 & a_4 & b_4 &\\ & & & c_5 & a_5 & b_5\\ & & & & c_6 & a_6 \end{pmatrix} \begin{pmatrix} T_1\\ \vdots\\ \vdots\\ \vdots\\ \vdots\\ T_6 \end{pmatrix}= \begin{pmatrix} d_1\\ \vdots\\ \vdots\\ \vdots\\ \vdots\\ d_6 \end{pmatrix}$$
\end{document}


If this isn't good style in terms of mathematical notation conventions (which I don't know), then, of course, I would write out the elements of the vectors. Clarification would be welcome.

You can do it like this, provided your main matrix has no unusually big objects (otherwise you can play with the first argument to \dottedcolumn that also accepts decimal numbers).

\documentclass{article}
\usepackage{amsmath}

\newcommand{\dottedcolumn}[3]{%
\settowidth{\dimen0}{$#1$}
\settowidth{\dimen2}{$#2$}
\ifdim\dimen2>\dimen0 \dimen0=\dimen2 \fi
\begin{pmatrix}\,
\vcenter{
\kern.6ex
\vbox to \dimexpr#1\normalbaselineskip-1.2ex{
\hbox{$#2$}
\kern3pt
\kern1pt
\hbox{$#3$}
}\kern.6ex}\,
\end{pmatrix}
}

\begin{document}
$$\begin{pmatrix} a_1 & b_1 & & & &\\ c_2 & a_2 & b_2 & & &\\ & c_3 & a_3 & b_3 & &\\ & & c_4 & a_4 & b_4 &\\ & & & c_5 & a_5 & b_5\\ & & & & c_6 & a_6 \end{pmatrix} \dottedcolumn{6}{T_1}{T_6}=\dottedcolumn{6}{d_1}{d_6}$$
\end{document}


Taking some code from How to get a good "divisible by" symbol?, you can create your own \vdots that has any number of predefined dots. Here I've defined \sixvdots:

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\newcommand{\sixvdots}{%
\vbox{\baselineskip1ex\lineskiplimit0pt%
\hbox{.}\hbox{.}\hbox{.}\hbox{.}\hbox{.}\hbox{.}}}
\begin{document}
$$\begin{pmatrix} a_1 & b_1 & & & &\\ c_2 & a_2 & b_2 & & &\\ & c_3 & a_3 & b_3 & &\\ & & c_4 & a_4 & b_4 &\\ & & & c_5 & a_5 & b_5\\ & & & & c_6 & a_6 \end{pmatrix} \begin{pmatrix} T_1\\ \sixvdots\\ T_6 \end{pmatrix}= \begin{pmatrix} d_1\\ \sixvdots\\ d_6 \end{pmatrix}$$
\end{document}


Increasing the value of \baselineskip stretches out the dots.

• Lesser artists borrow, great artists steal. ;-) – egreg May 17 '13 at 15:28
• I will have to play with the \baselineskip value? Isn't there some automatic way to ensure exactly equal heights of all matrices + vectors? – AlexG May 17 '13 at 15:28
• nice, but i think a bit more space between the top line and the dots would be an improvement. maybe the same amount of space that separates rows of the matrix would look best. – barbara beeton May 17 '13 at 15:29
• @AlexG: egreg seems to have delivered with a rough estimate, as expected... Since the context is not fully known, there is some user-intervention required to optimize the result. You want to avoid cluttering the interface with box measurements (to extract the height, say) if it is not really needed. – Werner May 17 '13 at 16:32

I suggest using the package nicematrix which has functionalities dedicated to this problem.

Just with adding in the preamble:

\usepackage{nicematrix}
\NiceMatrixOptions{transparent,nullify-dots}


we obtain:

Here is the complete code.

 \documentclass{article}
\usepackage{amsmath}

\usepackage{nicematrix}
\NiceMatrixOptions{transparent,nullify-dots}

\begin{document}
$$\begin{pmatrix} a_1 & b_1 & & & &\\ c_2 & a_2 & b_2 & & &\\ & c_3 & a_3 & b_3 & &\\ & & c_4 & a_4 & b_4 &\\ & & & c_5 & a_5 & b_5\\ & & & & c_6 & a_6 \end{pmatrix} \begin{pmatrix} T_1\\ \vdots\\ \vdots\\ \vdots\\ \vdots\\ T_6 \end{pmatrix}= \begin{pmatrix} d_1\\ \vdots\\ \vdots\\ \vdots\\ \vdots\\ d_6 \end{pmatrix}$$
\end{document}