4

Consider the following document:

\documentclass{article}
\usepackage{amsmath}
\newcommand{\expr}[1]{\begin{pmatrix}x_#1\\y_#1\end{pmatrix}}
\begin{document}
\begin{equation}
  c = a \cdot b
\end{equation}
\begin{align*}
  a&=\expr{a} & b&=\expr{b}
\end{align*}
\end{document}

which displays like this:

equation + align* environments

I.e. the first (part of the) equation is centered, the second part is set in two columns with a third of the free space located before, in between and after.

I would like to have the same setup, but with the equation(s) in one environment.

I have tried several combinations of multi-equation environments in amsmath, but without luck. For instance:

\begin{align}
  \begin{aligned}
    c = a \cdot b
  \end{aligned} \\
  \nonumber
  \begin{aligned}a&=\expr{a}\end{aligned} & & \begin{aligned}b&=\expr{b}\end{aligned}
\end{align}

displays like this:

align environment

with the two "sub-equations" being fine, but the main equation at the top is not centered. The following:

\begin{gather}
  c = a \cdot b \\
  \begin{aligned}
    \nonumber
    a&=\expr{a} & b&=\expr{b}
  \end{aligned}
\end{gather}

results in the two "sub-equations" being set too tight:

gather environment

David Carlisle
  • 757,742
RolKau
  • 465

2 Answers2

3

How about

enter image description here

\documentclass{article}
\usepackage{amsmath}
\newcommand{\expr}[1]{\begin{pmatrix}x_#1\\y_#1\end{pmatrix}}

\begin{document}

\begin{align}
        &           &   c   &= a \cdot b\\
    a   &=\expr{a}  &       &           & b &=\expr{b}\nonumber
\end{align}

\end{document}
David Carlisle
  • 757,742
  • Problem is: This is not the equation to which I plan to apply it. The right-hand sides are much larger expressions so there'll have to be some overlap between the first and the second (sub-)equation. – RolKau Mar 27 '12 at 07:50
  • Could you explain the reason for wanting all in one environment? – Stephan Lehmke Mar 27 '12 at 08:08
  • Proximity to the original equation; same reason as for using gather instead of multiple equations. – RolKau Apr 13 '12 at 08:25
2

It turns out this is allowed:

\begin{gather}
  \begin{align}
    c = a \cdot b
  \end{align} \\
  \begin{align*}
    a&=\expr{a} & b&=\expr{b} &
  \end{align*}
\end{gather}

resulting in:

gather+align

David Carlisle
  • 757,742
RolKau
  • 465