# Two equations with sub equations

I would like to produce the following format.

A=A B=B

C=C D=D E=E

I tried using align. However, I failed to get the required output. Please correct me.

\begin{align*}  A&=A & B&B \\     C&=C  & D&=D  &E&E    \end{align*}


• I would say that you need the same number of & on each lines to align them together. Do you have the amsmath loaded in your preamble? – Ludovic C. Jun 19 '13 at 12:08
• \begin {align*}  A&=A & B&=B \\     C&=C  & D&=D  & E&=E    \end{align*} – Steven B. Segletes Jun 19 '13 at 12:09
• Hi Steven. Thanks for the correction. This is of great help. – learner123 Jun 19 '13 at 12:30

If you're just looking for centred, gathered equations, then use gather*:

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
Some text before
\begin{gather*}
\end{gather*}
and some text after.
\end{document}


For more horizontally-aligned content, align* works fine, but you'll have a dangling equation (in the second row):

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
Some text before
\begin{align*}
A &= A & B &= B \\
C &= C & D &= D & E &= E
\end{align*}
and some text after.
\end{document}


There are options as well, depending on whether you want them numbered or aligned.

• Hi Werner, Thanks for giving me the more generic one. It has educated me. – learner123 Jun 19 '13 at 12:30