# How to align a single long equation split into multiple lines?

I have a long equation that I need to wrap into multiple lines. I want to know what is the idiomatic way to align the multiple lines. I made two attempts at it and the results do not look good.

### Example 1

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
\frac{100 (100 + 1)}{2}
& = 1 + 2 + 3 + 4 + 5 \\
& + 6 + 7 + 8 + 9 + 10 \\
& \vdots \\
& + 96 + 97 + 98 + 99 + 100.
\end{align*}
\end{document}


Here is the output:

Here all the + signs are aligned with = sign and that of course does not look good. In most mathematics books I see that the + sign is aligned with the first expression after the = sign, i.e., 1 in this case. So I made another attempt at it shown in the next example.

### Example 2

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
\frac{100 (100 + 1)}{2}
= & 1 + 2 + 3 + 4 + 5 \\
& + 6 + 7 + 8 + 9 + 10 \\
& \vdots \\
& + 96 + 97 + 98 + 99 + 100.
\end{align*}
\end{document}


Here is the output:

This is closer to what I find in mathematics books but this is far from perfect. The = sign is sticking too close to the 1 after it. The \vdots appears misaligned.

I am wondering if there is an idiomatic way to typeset something like this in LaTeX? If yes, I would like to learn about it and use that.

\documentclass[preview,border=12pt,12pt]{standalone}
\usepackage{mathtools}

\begin{document}
\begin{align*}
\frac{100 (100 + 1)}{2}
&= \begin{aligned}[t]
1
&+ 2 + 3 + 4 + 5 \\
&+ 6 + 7 + 8 + 9 + 10 \\
&\,\;\vdots \\
&+ 95 + 96 + 97 + 98 + 99 + 100
\end{aligned}\\
&= 5050
\end{align*}
\end{document}


# Edit

And don't forget to follow the suggestion of Mico below:

Do consider replacing \,\;\vdots with \shortvdotswithin{+}.

• Do consider replacing \,\;\vdots with \shortvdotswithin{+}.
– Mico
May 2 at 14:56
• @Mico: Thank you. Doing so will make my answer just another example of plagiarism of the other answers. :-) May 3 at 0:51
• Naah, no reason to fear being accused of plagiarism! Just leave a comment that you implemented somebody's suggestion. Honestly, the more examples future readers see of the nifty \shortvdotswithin macro in action, the better. :-)
– Mico
May 3 at 1:06

The alignment point needn't be at =.

\documentclass{article}
\usepackage{amsmath,mathtools}

\begin{document}

\begin{equation*}
\begin{split}
\frac{100 (100 + 1)}{2} =
1 &+ 2 + 3 + 4 + 5 \\
&+ 6 + 7 + 8 + 9 + 10 \\
& \shortvdotswithin{+}
&+ 95 + 96 + 97 + 98 + 99 + 100.
\end{split}
\end{equation*}

\end{document}


• Very nice the \mathtoolsset{shortvdotsadjustabove=3pt,shortvdotsadjustbelow=-1pt}. I have seen the documentation and I not known this approach :-). May 2 at 11:51

One of the following two solutions should be ok. They both use \vdotswithin rather than \vdots, to align the vertical dots on the + symbols. They differ in how the right-hand side of the first row is aligned relative to the right-hand side of the second row.

\documentclass{article}
\usepackage{mathtools} % for \vdotswithin macro
\begin{document}

\begin{align*}
\frac{100 (100 + 1)}{2}
& = 1 + 2 + 3 + 4 + 5 \\
&\quad + 6 + 7 + 8 + 9 + 10 \\