Skip to main content
replaced http://math.stackexchange.com/ with https://math.stackexchange.com/
Source Link

For this postthis post I'd like to align some euqations so that matching terms are arranged in columns. But both alternatives that I could think of didn't work as intended:

Using \begin{array}{rlcrrrrrrr} I get too much space between the columns, i,.e. in front of the operators:

$$\begin{array}{rlcrrrrrrr} \exp(x) &= \sum_{n=0}^\infty\frac{x^n}{n!} &=& 1 &+ x &+ \frac{x^2}{2!} &+ \frac{x^3}{3!} &+ \frac{x^4}{4!} &+ \frac{x^5}{5!} &+ \cdots \\ \sin(x) &= \sum_{n=0}^\infty\frac{(-1)^nx^{2n+1}}{(2n+1)!} &=&& x &&- \frac{x^3}{3!} &&+ \frac{x^5}{5!} &- \cdots \\ \cos(x) &= \sum_{n=0}^\infty\frac{(-1)^nx^{2n}}{(2n)!} &=& 1 &&- \frac{x^2}{2!} &&+ \frac{x^4}{4!} &&- \cdots \end{array}$$

Using \begin{alignat*}{9} I get too little space. Apparently my operators don't get the spacing they usually do.

\begin{alignat*}{9} \exp(x) &\,= \sum_{n=0}^\infty\frac{x^n}{n!} &=& 1 &+& x &+& \frac{x^2}{2!} &+& \frac{x^3}{3!} &+& \frac{x^4}{4!} &+& \frac{x^5}{5!} &+& \;\cdots \\ \sin(x) &\,= \sum_{n=0}^\infty\frac{(-1)^nx^{2n+1}}{(2n+1)!} &=&&& x &&&-& \frac{x^3}{3!} &&&+& \frac{x^5}{5!} &-& \;\cdots \\ \cos(x) &\,= \sum_{n=0}^\infty\frac{(-1)^nx^{2n}}{(2n)!} &=& 1 &&&-& \frac{x^2}{2!} &&&+& \frac{x^4}{4!} &&&-& \;\cdots \end{alignat*}

If this were $\LaTeX$, I'd use @{} in or @{\,} in the array approach, but MathJax does not seem to understand this.

Is there a way to obtain this level of control over the horizontal spacing of custom-aligned equations, without placing all the \, manually on both sides of each operator?

For this post I'd like to align some euqations so that matching terms are arranged in columns. But both alternatives that I could think of didn't work as intended:

Using \begin{array}{rlcrrrrrrr} I get too much space between the columns, i,.e. in front of the operators:

$$\begin{array}{rlcrrrrrrr} \exp(x) &= \sum_{n=0}^\infty\frac{x^n}{n!} &=& 1 &+ x &+ \frac{x^2}{2!} &+ \frac{x^3}{3!} &+ \frac{x^4}{4!} &+ \frac{x^5}{5!} &+ \cdots \\ \sin(x) &= \sum_{n=0}^\infty\frac{(-1)^nx^{2n+1}}{(2n+1)!} &=&& x &&- \frac{x^3}{3!} &&+ \frac{x^5}{5!} &- \cdots \\ \cos(x) &= \sum_{n=0}^\infty\frac{(-1)^nx^{2n}}{(2n)!} &=& 1 &&- \frac{x^2}{2!} &&+ \frac{x^4}{4!} &&- \cdots \end{array}$$

Using \begin{alignat*}{9} I get too little space. Apparently my operators don't get the spacing they usually do.

\begin{alignat*}{9} \exp(x) &\,= \sum_{n=0}^\infty\frac{x^n}{n!} &=& 1 &+& x &+& \frac{x^2}{2!} &+& \frac{x^3}{3!} &+& \frac{x^4}{4!} &+& \frac{x^5}{5!} &+& \;\cdots \\ \sin(x) &\,= \sum_{n=0}^\infty\frac{(-1)^nx^{2n+1}}{(2n+1)!} &=&&& x &&&-& \frac{x^3}{3!} &&&+& \frac{x^5}{5!} &-& \;\cdots \\ \cos(x) &\,= \sum_{n=0}^\infty\frac{(-1)^nx^{2n}}{(2n)!} &=& 1 &&&-& \frac{x^2}{2!} &&&+& \frac{x^4}{4!} &&&-& \;\cdots \end{alignat*}

If this were $\LaTeX$, I'd use @{} in or @{\,} in the array approach, but MathJax does not seem to understand this.

Is there a way to obtain this level of control over the horizontal spacing of custom-aligned equations, without placing all the \, manually on both sides of each operator?

For this post I'd like to align some euqations so that matching terms are arranged in columns. But both alternatives that I could think of didn't work as intended:

Using \begin{array}{rlcrrrrrrr} I get too much space between the columns, i,.e. in front of the operators:

$$\begin{array}{rlcrrrrrrr} \exp(x) &= \sum_{n=0}^\infty\frac{x^n}{n!} &=& 1 &+ x &+ \frac{x^2}{2!} &+ \frac{x^3}{3!} &+ \frac{x^4}{4!} &+ \frac{x^5}{5!} &+ \cdots \\ \sin(x) &= \sum_{n=0}^\infty\frac{(-1)^nx^{2n+1}}{(2n+1)!} &=&& x &&- \frac{x^3}{3!} &&+ \frac{x^5}{5!} &- \cdots \\ \cos(x) &= \sum_{n=0}^\infty\frac{(-1)^nx^{2n}}{(2n)!} &=& 1 &&- \frac{x^2}{2!} &&+ \frac{x^4}{4!} &&- \cdots \end{array}$$

Using \begin{alignat*}{9} I get too little space. Apparently my operators don't get the spacing they usually do.

\begin{alignat*}{9} \exp(x) &\,= \sum_{n=0}^\infty\frac{x^n}{n!} &=& 1 &+& x &+& \frac{x^2}{2!} &+& \frac{x^3}{3!} &+& \frac{x^4}{4!} &+& \frac{x^5}{5!} &+& \;\cdots \\ \sin(x) &\,= \sum_{n=0}^\infty\frac{(-1)^nx^{2n+1}}{(2n+1)!} &=&&& x &&&-& \frac{x^3}{3!} &&&+& \frac{x^5}{5!} &-& \;\cdots \\ \cos(x) &\,= \sum_{n=0}^\infty\frac{(-1)^nx^{2n}}{(2n)!} &=& 1 &&&-& \frac{x^2}{2!} &&&+& \frac{x^4}{4!} &&&-& \;\cdots \end{alignat*}

If this were $\LaTeX$, I'd use @{} in or @{\,} in the array approach, but MathJax does not seem to understand this.

Is there a way to obtain this level of control over the horizontal spacing of custom-aligned equations, without placing all the \, manually on both sides of each operator?

Source Link
MvG
  • 43.5k
  • 22
  • 29

Horizontal spacing in aligned equations

For this post I'd like to align some euqations so that matching terms are arranged in columns. But both alternatives that I could think of didn't work as intended:

Using \begin{array}{rlcrrrrrrr} I get too much space between the columns, i,.e. in front of the operators:

$$\begin{array}{rlcrrrrrrr} \exp(x) &= \sum_{n=0}^\infty\frac{x^n}{n!} &=& 1 &+ x &+ \frac{x^2}{2!} &+ \frac{x^3}{3!} &+ \frac{x^4}{4!} &+ \frac{x^5}{5!} &+ \cdots \\ \sin(x) &= \sum_{n=0}^\infty\frac{(-1)^nx^{2n+1}}{(2n+1)!} &=&& x &&- \frac{x^3}{3!} &&+ \frac{x^5}{5!} &- \cdots \\ \cos(x) &= \sum_{n=0}^\infty\frac{(-1)^nx^{2n}}{(2n)!} &=& 1 &&- \frac{x^2}{2!} &&+ \frac{x^4}{4!} &&- \cdots \end{array}$$

Using \begin{alignat*}{9} I get too little space. Apparently my operators don't get the spacing they usually do.

\begin{alignat*}{9} \exp(x) &\,= \sum_{n=0}^\infty\frac{x^n}{n!} &=& 1 &+& x &+& \frac{x^2}{2!} &+& \frac{x^3}{3!} &+& \frac{x^4}{4!} &+& \frac{x^5}{5!} &+& \;\cdots \\ \sin(x) &\,= \sum_{n=0}^\infty\frac{(-1)^nx^{2n+1}}{(2n+1)!} &=&&& x &&&-& \frac{x^3}{3!} &&&+& \frac{x^5}{5!} &-& \;\cdots \\ \cos(x) &\,= \sum_{n=0}^\infty\frac{(-1)^nx^{2n}}{(2n)!} &=& 1 &&&-& \frac{x^2}{2!} &&&+& \frac{x^4}{4!} &&&-& \;\cdots \end{alignat*}

If this were $\LaTeX$, I'd use @{} in or @{\,} in the array approach, but MathJax does not seem to understand this.

Is there a way to obtain this level of control over the horizontal spacing of custom-aligned equations, without placing all the \, manually on both sides of each operator?