2

In this code:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath} 
\begin{document}

\begin{align*}
&A B = C   \qquad &D E = F    \qquad &G H = I \qquad &K L M = N \\
&A B C = D \qquad &E F G = H  \qquad &I J K = L M
\end{align*}

\end{document}

why is the first column aligned on left, the second on right, and the third on left?

How to have them always aligned on left (possibly by using align*, or a built-in environment but no new package)?

enter image description here

  • The number of &'s on each line is the 2n-1 where n is the number of alignment columns. So if there are 2 alignments we have 3 &'s and thus four coulumns aligned right, left (that's the first alignment pair), then & to separate the pair, then again left, right aligned (this is the second alignment pair). So on and so forth. You have four alignment columns here (you really should align on the =, it makes it easier to see what is going on. So you should have 7 & on each row, but you only have 4 (you are missing the &'s that separates the pairs) – daleif Sep 13 '18 at 10:06
  • you are not aligning the = so there really isn't any alignment needed here at all, so I would not use align or if you intended to align the = use the usual, intended, markup A B &= C not &A B = C which is making an equation with no left hand side. – David Carlisle Sep 13 '18 at 10:12
4

Your “first” column is actually the second.

That's how align works: it makes pairs of right/left aligned columns, and computes the space between the pairs according to some internal rules (there's a maximum separation, which is reduced if the display is crowded).

If you only want left aligned columns, just skip the odd numbered ones:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{align*}
&A B = C    &&D E = F    &&G H = I      &&K L M = N \\
&A B C = D  &&E F G = H  &&I J K = L M
\end{align*}

\end{document}

enter image description here

There is one thing to care about. If one of the expressions begins with an operator such as \sum, \prod, \sin, \log and so on, the alignment would be off on the left side; this is cured by adding \! after && (or & in the first column pair). This is because align starts each even numbered column with {} which triggers a thin space before operators.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.