3
$\begingroup$

What's the code for multiple alignment in MathJAX? An analogous question for Latex is at https://tex.stackexchange.com/questions/43464/multiple-alignment-in-equations, but it doesn't appear to function here. Thank you.

Objective:
$A = B$
$\qquad B = C$
$\qquad \qquad C = D$
$\qquad \qquad \qquad E = F$

Attempt: $$\begin{align*} A = B\\\ &B = C\\\ &&C =D\\\ &&&E= F \end{align*}$$

Code for Attempt: $$\begin{align*} A = B\\\
&B = C\\\
&&C =D\\\
&&&E= F
\end{align*}$$

$\endgroup$

2 Answers 2

5
$\begingroup$

Another option is to abuse the alignat environment.

$$\newcommand{\myeqa}{=}
    \begin{alignat}{5}
    A & \myeqa & B                                     \\
      &       & B & \myeqa & C                         \\
      &       &   &       & C & \myeqa & D             \\
      &       &   &       &   &       & D & \myeqa & E 
    \end{alignat}$$

To adjust spacing you can put spacing commands on either side of the equals sign, such as \newcommand{\myeqa}{~=~} instead to get some more spacing.

$$\newcommand{\myeqa}{=} \begin{alignat}{5} A & \myeqa & B \\ & & B & \myeqa & C \\ & & & & C & \myeqa & D \\ & & & & & & D & \myeqa & E \end{alignat}$$

$\endgroup$
3
$\begingroup$

This is pretty hack-ish, but

$$\newcommand{\myeq}{\!\!=\!\!}
\begin{array}{ccccccccc}
A & \myeq & B                                     \\
  &       & B & \myeq & C                         \\
  &       &   &       & C & \myeq & D             \\
  &       &   &       &   &       & D & \myeq & E 
\end{array}$$

produces

$$\newcommand{\myeq}{\!\!=\!\!} \begin{array}{ccccccccc} A & \myeq & B \\ & & B & \myeq & C \\ & & & & C & \myeq & D \\ & & & & & & D & \myeq & E \end{array}$$ Is that like what you want?

$\endgroup$
2
  • 1
    $\begingroup$ Pretty doesn't come close to how hack-ish this is. $\endgroup$
    – Asaf Karagila Mod
    Nov 8, 2013 at 9:44
  • $\begingroup$ +1. Many thanks. Yes. Is there a way to lessen the space between the equal sign and the letters? $\endgroup$
    – user53259
    Nov 8, 2013 at 9:52

You must log in to answer this question.