0

I wish to align these equation by their respective equals sign or arrow so it looks like a table (3 rows, 2 columns). How can I get the second expression to move to the right more so that it looks normal?

\begin{align}
\sum_{n=1}^{\infty} \frac{1}{n} & \rightarrow \infty 
\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n} &=\ln(2) \\
\sum_{n=1}^{\infty} \frac{1}{2n} & \rightarrow \infty
\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{2n} & = \frac{\ln(2)}{2} \\
\sum_{n=0}^{\infty} \frac{1}{2n+1} &\rightarrow \infty
\sum{n=0}^{\infty} \frac{(-1)^{n}}{2n+1} & = \frac{\pi}{4}
\end{align}

Here is what it currently looks like:

enter image description here

3
  • (Regarding your note at the end of the question:) Here in TeX.SE we don't have MathJax enabled, so the equations don't render here. This is because here we are more interested in the code. I edited your question accordingly. Dec 27, 2018 at 23:40
  • Do you want to align what? The equal signs? The arrows?
    – Sigur
    Dec 27, 2018 at 23:44
  • @Sigur I found what I was looking for. I've explained it in the answer below. Dec 27, 2018 at 23:45

2 Answers 2

3

You're missing an alignment point.

On the other hand, I'd recommend using the second scheme, because aligning at the arrows and the equals signs makes for very unbalanced formulas.

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\begin{align}
\sum_{n=1}^{\infty} \frac{1}{n} & \rightarrow \infty &
  \sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n} &=\ln(2) \\
\sum_{n=1}^{\infty} \frac{1}{2n} & \rightarrow \infty &
  \sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{2n} & = \frac{\ln(2)}{2} \\
\sum_{n=0}^{\infty} \frac{1}{2n+1} &\rightarrow \infty &
  \sum_{n=0}^{\infty} \frac{(-1)^{n}}{2n+1} & = \frac{\pi}{4}
\end{align}

\begin{align}
&\sum_{n=1}^{\infty} \frac{1}{n} \rightarrow \infty &&
  \sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n} =\ln(2) \\
&\sum_{n=1}^{\infty} \frac{1}{2n} \rightarrow \infty &&
  \sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{2n}  = \frac{\ln(2)}{2} \\
&\sum_{n=0}^{\infty} \frac{1}{2n+1} \rightarrow \infty &&
  \sum_{n=0}^{\infty} \frac{(-1)^{n}}{2n+1}  = \frac{\pi}{4}
\end{align}

\end{document}

enter image description here

2
  • Thanks, I like the second set better. How do I add the equation numbers (1) - (6)? Dec 27, 2018 at 23:51
  • 1
    @zerosofthezeta That's align. However, numbers are not added with MathJax and you have to add them yourself with \tag{1} and so on.
    – egreg
    Dec 27, 2018 at 23:52
3

I found an answer by experimenting myself. I added another & symbol before the second sum:

\begin{align}
\sum_{n=1}^{\infty} \frac{1}{n} & \rightarrow \infty 
&\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{n} &=\ln(2) \\
\sum_{n=1}^{\infty} \frac{1}{2n} & \rightarrow \infty
&\sum_{n=1}^{\infty} \frac{(-1)^{n+1}}{2n} & = \frac{\ln(2)}{2} \\
\sum_{n=0}^{\infty} \frac{1}{2n+1} &\rightarrow \infty
&\sum{n=0}^{\infty} \frac{(-1)^{n}}{2n+1} & = \frac{\pi}{4}
\end{align}

That gave me this:

enter image description here

1
  • Nice! This is how align block works. The first & is to set the alignment symbol, the second one, to change to another alignment column, the third one, to the symbol again, and so on.
    – Sigur
    Dec 27, 2018 at 23:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .