2

I am trying to align three equations in two lines. How can I do it using \begin{align*}?

I want it to look like this:

enter image description here

But mine looks like this:

enter image description here

My code:

\begin{align*}
A^2 &= A, B^2 &= C, C^2 &= B,\\
AB &= B, AC &= C, BC &=A, 
\end{align*}
  • you need to indicate a column break after each comma, and add space there as well. – barbara beeton Aug 17 '16 at 14:35
  • In short: n alignment groups require 2n - 1 ampersands. – Bernard Aug 17 '16 at 16:25
3

Quick fix:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
 \begin{align*}
   A^2 &= A, & B^2 &= C, & C^2 &= B,\\
   AB &= B, & AC &= C, & BC &= A,
 \end{align*}
\end{document}
0
\documentclass{article}

\usepackage{amsmath}

\begin{document}
\begin{alignat}{4} A^2 &= A, & \quad & B^2 &= C, &\quad& C^2 &= B,\\AB &= B,&& AC &= C,&& BC &= A, \end{alignat}

\end{document}
  • Is there a way to do it without "alignat"? – user19405892 Aug 17 '16 at 14:27
  • @user19405892 there is also alignedat inside equation* or just array or a table or minipages. If you have some restrictions, you should tell us before and explain why! – LaRiFaRi Aug 17 '16 at 14:28

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.