# Vertical alignment of \vdots in an align environment - a shift of \vdots by half the width of "+"

In an align environment, I have a sum of an arbitrary number of terms. I want to use \vdots to display the ellipses indicating the presence of terms that are not displayed. As I am vertically aligning the +, I would like to have the ellipses displayed by \vdots to be centered with respect to +. In TikZ, thee are commands like \newlength\width_of_plus_sign and \settowidth{\width_of_plus_sign}{$+$} to do this. Is there an analog for the \align environment?

\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}

\begin{document}

For each integer $2 \leq i \leq n$,
\begin{align*}
\frac{1}{n^{i}} \binom{n}{i} &= \frac{1}{n^{i}} \frac{n!}{i!(n-i)!} \\
&= \frac{1}{n^{i}} \frac{n(n - 1)(n - 2) \cdots (n - i + 1)}{i!} \\
&= \frac{1}{i!} \frac{n(n - 1) (n - 2) \cdots (n - (i - 1))}{n^{i}} \\
&= \frac{1}{i!} \left(1 - \frac{1}{n}\right) \left(1 - \frac{2}{n}\right) \cdots \left(1 - \frac{i - 1}{n}\right) .
\end{align*}
So,
\begin{align*}
&\sum_{i=k+1}^{n} \frac{1}{n^{i}} \binom{n}{i} \\
&\qquad = \sum_{i=k+1}^{n} \frac{1}{i!} \left(1 - \frac{1}{n}\right) \left(1 - \frac{2}{n}\right) \cdots \left(1 - \frac{i - 1}{n}\right) \\
&\qquad = \frac{1}{(k+1)!} \left(1 - \frac{1}{n}\right) \left(1 - \frac{2}{n}\right) \cdots \left(1 - \frac{k}{n}\right) \\
&+ \frac{1}{(k+2)!} \left(1 - \frac{1}{n}\right) \left(1 - \frac{2}{n}\right) \cdots \left(1 - \frac{k+1}{n}\right) \\
&+ \frac{1}{(k+3)!} \left(1 - \frac{1}{n}\right) \left(1 - \frac{2}{n}\right) \cdots \left(1 - \frac{k+2}{n}\right) \\
&+ \ldots + \frac{1}{n!} \left(1 - \frac{1}{n}\right) \left(1 - \frac{2}{n}\right) \cdots \left(1 - \frac{n-1}{n}\right) .
\end{aligned} \\
&\qquad = \frac{1}{k!} \left(1 - \frac{1}{n}\right) \left(1 - \frac{2}{n}\right) \cdots \left(1 - \frac{k}{n}\right) \\
&\left[\frac{1}{k+1} \left(1 - \frac{k}{n}\right) \right. \\
&\hphantom{\left[\vphantom{\frac{1}{k+1}}\right.}+ \frac{1}{(k+1)(k+2)}  \left(1 - \frac{k}{n}\right) \left(1 - \frac{k+1}{n}\right) \\
&\hphantom{\left[\vphantom{\frac{1}{k+1}}\right.}+ \frac{1}{(k+1)(k+2)(k+3)}  \left(1 - \frac{k}{n}\right) \left(1 - \frac{k+1}{n}\right) \left(1 - \frac{k+2}{n}\right) \\
&\hphantom{\left[\vphantom{\frac{1}{k+1}}\right.}+ \ldots \\
&\hphantom{\left[\vphantom{\frac{1}{k+1}}\right.}\left.
+ \frac{1}{(k+1)(k+2) \cdots n} \left(1 - \frac{k}{n}\right) \left(1 - \frac{k+1}{n}\right) \cdots \left(1 - \frac{n-1}{n}\right)
\right] .
\end{aligned}

\end{document}

• Perhaps you might want to look at \vdotswithin from the mathtools package Commented Dec 31, 2015 at 13:50
• @daleif I put \usepackage{mathtools} into the preamble and \vdotswithin{+} in the align environment. The ellipses are aligned with the center of the first two +. It is not aligned with the other two +. (Take a look at the code that I give in my answer.) Commented Dec 31, 2015 at 14:11
• @daleif Wait two minutes for me to post an answer. Commented Dec 31, 2015 at 14:11
• Probably because it is meant for relations not bin ops. You might need to copy the definition and in the new version replace mathrel with mathbin Commented Dec 31, 2015 at 14:18
• @daleif I do not know what you intend by "copy the definition and in the new version replace mathrel with mathbin." May you do this for me? (I can post this as another question.) Commented Dec 31, 2015 at 14:44

With some simplifications, both for easing the input and for getting output as intended:

\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}

\newcommand{\pterm}[1]{\left(1-\frac{#1}{n}\right)}
\newcommand{\inv}[1]{\frac{1}{#1}}

\begin{document}

\begin{align*}
\mathmakebox[2em][l]{\sum_{i=k+1}^{n} \inv{n^{i}} \binom{n}{i} \lvert x \rvert^{i}} \\
&= \sum_{i=k+1}^{n} \inv{i!} \pterm{1} \pterm{2} \dots \pterm{i - 1} \\
&= \inv{(k+1)!} \pterm{1} \pterm{2} \dots \pterm{k} \\
&+ \inv{(k+2)!} \pterm{1} \pterm{2} \dots \pterm{k+1} \\
&+ \inv{(k+3)!} \pterm{1} \pterm{2} \dots \pterm{k+2} \\
&+ \dots + \inv{n!} \pterm{1} \pterm{2} \dots \pterm{n-1} .
\end{aligned} \\
&= \!\begin{aligned}[t]
\inv{k!}
& \pterm{1} \pterm{2} \dots \pterm{k} \\
&\biggl[\inv{k+1} \pterm{k}\\
&\hphantom{\biggl[} + \inv{(k+1)(k+2)}  \pterm{k} \pterm{k+1} \\
&\hphantom{\biggl[}+ \inv{(k+1)(k+2)(k+3)}  \pterm{k} \pterm{k+1} \pterm{k+2} \\
&\phantom{\biggl[}+ {} \\[-2ex]
&\hphantom{\biggl[}\vdotswithin{+} \\[-2ex]
&\phantom{\biggl[}+ {}\\
&\hphantom{\biggl[}
+ \inv{(k+1)(k+2) \dots n} \pterm{k} \pterm{k+1} \dots \pterm{n-1}\biggr] .
\end{aligned}
\end{align*}

\end{document}


I changed all \ldots and \cdots to \dots; you seem to be using them the other way around than usual.

• The first "thing" I noticed about your code is that you replaced the left. with \biggl[. It does give me the display that I want. (Are\biggl( and \biggr) designed to give parentheses around a displayed fraction?) My concern is that this code will not apply to quotients in which I have a quotient, in displaystyle, in the "numerator" and a quotient, in displaystyle, in the "denominator." In that case, I would have to use the pair \left( and \right) or the pair \left. and \right). Commented Dec 31, 2015 at 14:59
• @user74973 \biggl and \biggr do “manual sizing”. Not sure about the rest of the comment. Commented Dec 31, 2015 at 15:00
• What do you intend by "manual sizing"? I thought that I remember reading in the TeX manual that \biggl gave a parenthesis or brace of an exact size, dependent on the font. Commented Dec 31, 2015 at 15:03
• @user74973 Yes, that's the idea: you choose the size, not like with \left and \right. Commented Dec 31, 2015 at 15:04
• It seems that LaTeX puts in some extra horizontal spacing with \left.. The ellipses and plus signs in my code should be aligned. Well, for this display, your suggestion does give me what I want. Commented Dec 31, 2015 at 15:13

The following code is prompted by the comment from daleif. I had to add mathtools to the preamble.

\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}

\begin{document}

\begin{align*}
&\sum_{i=k+1}^{n} \frac{1}{n^{i}} \binom{n}{i} \vert x \vert^{i} \\
&\qquad = \sum_{i=k+1}^{n} \frac{1}{i!} \left(1 - \frac{1}{n}\right) \left(1 - \frac{2}{n}\right) \cdots \left(1 - \frac{i - 1}{n}\right) \\
&\qquad = \frac{1}{(k+1)!} \left(1 - \frac{1}{n}\right) \left(1 - \frac{2}{n}\right) \cdots \left(1 - \frac{k}{n}\right) \\
&+ \frac{1}{(k+2)!} \left(1 - \frac{1}{n}\right) \left(1 - \frac{2}{n}\right) \cdots \left(1 - \frac{k+1}{n}\right) \\
&+ \frac{1}{(k+3)!} \left(1 - \frac{1}{n}\right) \left(1 - \frac{2}{n}\right) \cdots \left(1 - \frac{k+2}{n}\right) \\
&+ \ldots + \frac{1}{n!} \left(1 - \frac{1}{n}\right) \left(1 - \frac{2}{n}\right) \cdots \left(1 - \frac{n-1}{n}\right) .
\end{aligned} \\
&\qquad = \frac{1}{k!} \left(1 - \frac{1}{n}\right) \left(1 - \frac{2}{n}\right) \cdots \left(1 - \frac{k}{n}\right) \\
&\left[\frac{1}{k+1} \left(1 - \frac{k}{n}\right) \right. \\
&\hphantom{\left[\vphantom{\frac{1}{k+1}}\right.}+ \frac{1}{(k+1)(k+2)}  \left(1 - \frac{k}{n}\right) \left(1 - \frac{k+1}{n}\right) \\
&\hphantom{\left[\vphantom{\frac{1}{k+1}}\right.}+ \frac{1}{(k+1)(k+2)(k+3)}  \left(1 - \frac{k}{n}\right) \left(1 - \frac{k+1}{n}\right) \left(1 - \frac{k+2}{n}\right) \\
&\hphantom{\left[\vphantom{\frac{1}{k+1}}\right.}+ \\
&\hphantom{\left[\vphantom{\frac{1}{k+1}}\right.}\vdotswithin{+} \\
&\hphantom{\left[\vphantom{\frac{1}{k+1}}\right.}+ \\
&\hphantom{\left[\vphantom{\frac{1}{k+1}}\right.}\left.
+ \frac{1}{(k+1)(k+2) \cdots n} \left(1 - \frac{k}{n}\right) \left(1 - \frac{k+1}{n}\right) \cdots \left(1 - \frac{n-1}{n}\right)
\right] .
\end{aligned}
\end{align*}

\end{document}

• Why are all the plus signs not vertically aligned? Commented Dec 31, 2015 at 14:15