3

I am trying to put vdots at centre of each column in alignat, but I can't. This is my code.

\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}
\usepackage{fourier}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{mathtools}
\DeclarePairedDelimiter\abs{\lvert}{\rvert}
\begin{document}
    \begin{alignat*}{3}
        & \abs{a_2 - a_3}    && \leqslant \dfrac{1}{ 2}|a_1 - a_2|\\
        & \abs{a_3 - a_4}    && \leqslant \dfrac{1}{ 2}\abs{a_2 - a_3}  && \leqslant  \dfrac{1}{ 2^2}|a_1 - a_2|\\
        & \abs{a_4 - a_5}    && \leqslant \dfrac{1}{ 2}\abs{a_3 - a_4}  && \leqslant  \dfrac{1}{ 2^3}|a_1 - a_2|\\
        & \vdots    && <\vdots  && < \vdots \\
        &\abs*{a_{n} -a_{n+1}} &&   \leqslant \dfrac{1}{ 2}\abs{a_{n-1} - a_n}  && \leqslant  \dfrac{1}{ 2^{n-1}}|a_1 - a_2|
    \end{alignat*}
\end{document}

How can I put vdots at centre of each column in this alignat?

Screenshot

current_user
  • 5,235

2 Answers2

3

I'd place the vertical dots below the inequality signs, so here's the code for both methods.

\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{fourier}
\usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage{calc}

\DeclarePairedDelimiter\abs{\lvert}{\rvert}

\newcommand{\cto}[2]{%
  \mathmakebox[\widthof{$\displaystyle#1$}]{#2}%
}

\begin{document}

\begin{alignat*}{3}
  & \abs{a_2 - a_3}
  && \leqslant \frac{1}{2}|a_1 - a_2|
\\
  & \abs{a_3 - a_4}
  && \leqslant \frac{1}{2}\abs{a_2 - a_3}
  && \leqslant  \frac{1}{2^2}|a_1 - a_2|
\\
  & \abs{a_4 - a_5}
  && \leqslant \frac{1}{2}\abs{a_3 - a_4}
  && \leqslant  \frac{1}{2^3}|a_1 - a_2|
\\
  & \cto{\abs{a_2 - a_3}}{\vdots}
  && \leqslant \cto{\frac{1}{2}\abs{a_3 - a_4}}{\vdots}
  && \leqslant \cto{\frac{1}{2^3}|a_1 - a_2|}{\vdots}
\\
  & \abs*{a_{n} -a_{n+1}}
  && \leqslant \frac{1}{2}\abs{a_{n-1} - a_n}
  && \leqslant \frac{1}{2^{n-1}}|a_1 - a_2|
\end{alignat*}

\begin{alignat*}{3}
  & \abs{a_2 - a_3}
  && \leqslant \frac{1}{2}|a_1 - a_2|
\\
  & \abs{a_3 - a_4}
  && \leqslant \frac{1}{2}\abs{a_2 - a_3}
  && \leqslant  \frac{1}{2^2}|a_1 - a_2|
\\
  & \abs{a_4 - a_5}
  && \leqslant \frac{1}{2}\abs{a_3 - a_4}
  && \leqslant  \frac{1}{2^3}|a_1 - a_2|
\\
  &&& \cto{{}\leqslant{}}{\vdots}
  && \cto{{}\leqslant{}}{\vdots}
\\
  & \abs*{a_{n} -a_{n+1}}
  && \leqslant \frac{1}{2}\abs{a_{n-1} - a_n}
  && \leqslant \frac{1}{2^{n-1}}|a_1 - a_2|
\end{alignat*}

\end{document}

enter image description here

egreg
  • 1,121,712
  • Isn’t there a command \vdotswithin{\leqslant} from mathtools already that does the exact same thing? – Ruixi Zhang Sep 04 '18 at 12:07
  • @RuixiZhang Yes, but it allows just one vdots per row – egreg Sep 04 '18 at 12:29
  • I don’t think I could follow: Page 23 of the mathtools documentation demonstrates an equation with &\vdotswithin{+} &&&& \vdotswithin{+}. So I think one can use more than one vdots per row. But if you are referring to the use of \cto{<arg>}{\vdots\vdots}, then I’d agree. But this usage is not present in this example. – Ruixi Zhang Sep 04 '18 at 13:18
3

Here is solution with eqparbox. I took the liberty so simplify a bit your preamble (needless to load amsmath when you load mathtools). Also, I thought the medium-sized fractions from nccmath look nicer for numerical coefficients:

\documentclass[12pt, a4paper]{article}

\usepackage{fourier}
\usepackage[margin=2cm]{geometry}
\usepackage{mathtools, nccmath}
\DeclarePairedDelimiter\abs{\lvert}{\rvert}
\usepackage{eqparbox}
\newcommand{\eqmathbox}[2][M]{\eqmakebox[#1]{$\displaystyle#2$}}
\newcommand{\longvdots}{\raisebox{0.6ex}[0pt][0pt]{\rotatebox[origin=c]{90}{\makebox[1cm]{\dotfill}}}}

\begin{document}

\begin{alignat*}{3}
& \abs{a_2 - a_3} && \leqslant \mfrac{1}{ 2}\abs{a_1 - a_2} \\
& \abs{a_3 - a_4} && \leqslant \mfrac{1}{ 2}\abs{a_2 - a_3} && \leqslant \mfrac{1}{ 2^2}\abs{a_1 - a_2}\\
 &\eqmathbox{\abs{a_4 - a_5}} && \leqslant \mfrac{1}{ 2}\eqmathbox[M1]{\abs{a_3 - a_4}} && \leqslant \mfrac{1}{ 2^3} \eqmathbox[M2]{\abs{a_1 - a_2}} \\
& \eqmathbox{\longvdots} && \leqslant\phantom{\mfrac{1}{ 2}}\eqmathbox[M1]{\longvdots} && \leqslant\phantom{\mfrac{1}{ 2^3}} \eqmathbox[M2]{\longvdots}\\
&\abs*{a_{n} -a_{n+1}} && \leqslant \mfrac{1}{ 2}\abs{a_{n-1} - a_n} && \leqslant \mfrac{1}{ 2^{n-1}}\abs{a_1 - a_2}
\end{alignat*}

\end{document}

enter image description here

Bernard
  • 271,350