# Vertical dotted line in an equation

I am trying to get vertical dotted/dashed lines in between of equation. I used \vdots and got this, but I want the dotted line to be bigger.

Following is what I've done.

 \begin{equation*}
\begin{aligned}
1|2|\dots|r \ \ \ \  r+1|r+2|\dots|k \vdots \ \ \ \ k+1|k+2|\dots|k+r
\end{aligned}
\end{equation*}


This is what I've got as output.

I want something like this with dotted or dashed lines (anything is fine)

Any help is appreciated.

• Welcome to TeX.SE.
– Mico
Jun 10 at 5:12

Take the definition of \vdots from fontmath.ltx and adapt it:

% from fontmath.ltx
\DeclareRobustCommand\vdots{%
\vbox{%
\baselineskip4\p@ \lineskiplimit\z@
\kern6\p@
\hbox{.}\hbox{.}\hbox{.}
}%
}


You want more dots and that they are centered with respect to the formula axis, so the first step is to change \vbox into \vcenter. Now add as many dots you like (here nine) and make the symbol a math relation to go along with \mid.

\documentclass{article}
\usepackage{amsmath}  % for 'equation*' env.

\newcommand{\tallvdots}{%
\vcenter{%
\baselineskip=4pt \lineskiplimit=0pt
\hbox{.}\hbox{.}\hbox{.}
\hbox{.}\hbox{.}\hbox{.}
\hbox{.}\hbox{.}\hbox{.}
}%
}
\makeatother

\begin{document}

\begin{equation*}
1 \mid 2 \mid \dots \mid r
r+1 \mid r+2 \mid \dots \mid k
\mathrel{\tallvdots}
k+1 \mid k+2 \mid \dots \mid k+r
\end{equation*}

\end{document}


You can define \tallvdots by:

\def\tallvdots{%
\mathrel{\vcenter{\offinterlineskip
\kern-1.4ex\hbox{$\vdots$}\kern-.7ex\hbox{$\vdots$}%
}}%
}


No array, no rotatebox. Only two \vdots one above second. The \kerns are here because the height of the default \vdots character has bad metric.

Something like this?

Note that in addition to creating and using a macro called \tallvdots, I've also replaced all instances of | with \mid.

\documentclass{article}
\usepackage{amsmath}  % for 'equation*' env.
\usepackage{graphicx} % for 'rotatebox' macro

% to be used in math mode:
\newcommand\xvdots{\vcenter{\hbox{$\vdots$}}}
\newcommand\tallvdots{%
\mathrel{\begin{array}{@{}c@{}}
\xvdots \\ \rotatebox{180}{$\xvdots$}
\end{array}
}
}

\begin{document}

\begin{equation*}
1 \mid 2 \mid \dots \mid r