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.