[Tex/LaTex] Multiple aligning symbols

align

I would like to do the closest thing there is to opening an align* environment inside another align* environment. In other words: it would be great if there were an environment, call it Align, that allows you to use to symbols to align equations in math mode using a specified number of aligning symbols &1, &2, …, &n. For example something that works like this:

\begin{Align*}[2] &1 1=1 \\ &1 4 &2= 2+2 \\ &2 = 1+1+1+1 \\ &1 7 = 7 \end{Align*} 

which I would want to look like

1 = 1
4 = 2+2 =
  = 1+1+1+1
7=7

Does there exist such an environment?

I tried looking in this guide but I couldn't find anything, and I'm just a beginner… thanks for any help!

Best Answer

If you only have a single alignment position, a regular align would suffice. For multiple alignment positions, use alignat:

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
\begin{alignat*}{3}
  1 &= 1             \\
  4 &= 2+2     & &=  \\
    &= 1+1+1+1 & &=4 \\
  7 &= 7
\end{alignat*} 
\end{document}

enter image description here

The alignat environment allows you to specify the number of alignment positions.

Herbert's mathmode document provides some informative examples on the different amsmath environments and usage. Specifically, see Part II amsmath package (p 43). An example of your output request is on p 46.

Related Question