5

I need to write a long list of numbered equations. I know that I could use the environments gather or align, but either with the gather environment I cannot have any alignment or with the align environment I should have a point of alignment which is good for all my equations, which is not the case.

For example, let us say that I have four equations, and I would like to align the equal signs of equations (1) and (2) and the two equal signs of equations (3) and (4). But I do not want to align the equal signs of equation (2) and (3). Now if I write two align environments with two equations each, the vertical space between equation (2) and equation (3) is bigger than the vertical space between equations (1)-(2) and (3)-(4). How can I avoid this and get coherent vertical spacing? Or alternatively, is there a more clever way to align a long list of equations with different aligning points?

Mico
  • 506,678
antonio
  • 341

1 Answers1

7

Is something like that you want?

\documentclass[11pt]{article}

\usepackage[utf8]{inputenc}
\usepackage{fourier}
\usepackage{mathtools}

\begin{document}

\begin{gather*}
   \begin{align}
      a  &  = b + c \\
      d &  = e + f
\end{align} \\
   \begin{align}
        (b + c)³   &  = b³  + 3b² c + 3bc²  + c³  \\
        (e + f)³   &  =  e³   + 3e² f + 3ef²  + f³ 
      \end{align}  
\end{gather*}

\end{document}

enter image description here

Bernard
  • 271,350
  • Yes, thanks! It was indeed easy... I was convinced that it was not allowed to nest gather and align environments. – antonio Jun 25 '14 at 08:16
  • Me too… until I tried since there seemed to be no other simple solution. – Bernard Jun 25 '14 at 08:23
  • Actually, this doesn't quite work. If you add \label{} to all four equations, then amsmath gives an error "Multiple \label's". I think because inside the gather* environment you can't have more than one \label. – antonio Jun 26 '14 at 08:09
  • This seems to be a bug. See also here – antonio Jun 26 '14 at 08:33
  • @antonio: I confess I didn't think of checking whether there was a problem with the labels. Mybe a hack with subequations and the way it is numbered would help? – Bernard Jun 26 '14 at 08:48