# Centering of vdots in a set of aligned equations

I wish to center the 3 vertical dots and align this equation but am not able to do so in the below code.
How shall I do it?

\begin{multline}
%\begin{center}
\dot{x}=x_1 \\
\dot{x_1}=x_2 \\
\vdots \\
\dot{x_n}= -\frac{f_0}{f_n}x_1  -\frac{f_1}{f_n}x_2- \cdots -\frac{f_{n-1}}{f_n}x_n
%\end{center}
\end{multline}

• Can you please give the complete code how to do it
– ShJ
Mar 21 '18 at 12:39

## 3 Answers

mathtools (an extension to amsmath) provides a macro for this:

\documentclass[12pt]{article}

\usepackage{mathtools} % loads amsmath

\begin{document}

\begin{align*}
\dot{x} &= x_1 \\
\dot{x}_1 & =x_2 \\
&\vdotswithin{=} \\
\MTFlushSpaceAbove
\dot{x}_n& = -\frac{f_0}{f_n} x_1  -\frac{f_1}{f_n}x_2- \cdots -\frac{f_{n-1}}{f_n}x_n
\end{align*}

\end{document}


The tweak with \MTFlushSpaceAbove is needed because of the fractions in the last line. Note furthermore that I replaced \dot{x_1} by \dot{x}_1.

• Just use & \shortvdotswithin{=}  with no \\ at the end, then it uses even less space Mar 21 '18 at 18:44
• @daleif I had tried it, but it felt too tight to me. But I can add it out of completeness. Mar 22 '18 at 8:09
• I upvote you also for my previous errors :-)+1. Mar 24 '18 at 20:41

A tabular stack could work here, in lieu of aligned.

\documentclass{article}
\usepackage{tabstackengine}
\TABstackMath
\begin{document}
$$\setstacktabulargap{0pt}% Horz. gap between columns \setstackgap{L}{1.2\baselineskip}% Vert. baselineskip between rows \TABbinary% apply {} before and after each cell to set proper = spacing \tabularCenterstack{rcl}{ \dot{x}&=&x_1 \\ \dot{x_1}&=&x_2 \\ &\vdots&}$$
\end{document}


Use the array environment:

$$\begin{array}{c @{\thickspace}c @{\thickspace}c l} \dot{x} &= & x_{1} & \\ \dot{x}_{1} &= & x_{2} & \\ &\vdots& \\ \dot{x}_n &= & - & \hspace{-3mm} \frac{f_0}{f_n} x_1 -\frac{f_1}{f_n}x_2- \cdots -\frac{f_{n-1}}{f_n}x_n \end{array}$$

• Thanks for the suggestion. Now it is handling appropriately by doing further customizations to the columns. Mar 21 '18 at 13:04
• the first minus sign in the last line should be a unary minus. you can tidy that up by wrapping that minus in braces. Mar 21 '18 at 17:49