26

Say I have a set of equations:

(1)

\begin{align}
wx&=u\\
wy&=v\\
w&=10
\end{align}

(2)

\begin{align}
x&=u/w\\
y&=v/w\\
\end{align}

How can I do the following: put (1) and (2) in the same line but in two separate columns, and add a \leftrightarrow between them? i.e., something like

enter image description here

I tried putting (1) (2) and arrow in three minipage environments, but the width of minipage is hard to tune when (1) (2) have different width and looks quite ugly as above.

  • Are the numbers (1) and (2) part of an enumeration, or do they reference the equation using something like a \label? – Werner Feb 24 '12 at 17:17
  • 2
    (1) and (2) are just used to refer to the two block of equations in this article, I want to put the two blocks in one line. – Ivan Z. Xiao Feb 24 '12 at 17:22
30

Try the aligned environment from the amsmath package.

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
\begin{aligned}[c]
wx&=u\\
wy&=v\\
w&=10
\end{aligned}
\qquad\Longleftrightarrow\qquad
\begin{aligned}[c]
x&=u/w\\
y&=v/w\\
\end{aligned}
\end{equation*}
\end{document}
18

Also from the amsmath package, and closely related to Ian Thompson's answer, is one using the split environment:

\begin{equation}
  \begin{split}
    wu &= ax+by+c\\
    wv &= dx+ey+f\\
    w &= gx+hy+i
  \end{split}
\quad\leftrightarrow\quad
  \begin{split}
    ax+by+c-xug-uyh-ui &= 0\\
    dx+ey+f-xvg-yvh-vi &= 0
  \end{split}
\end{equation}

enter image description here

13

For the sake of completeness, and perhaps an educative measure in terms of boxing (since the OP mentioned it), here's some minipage usage:

enter image description here

\documentclass{article}
\begin{document}
Here is some preceding text:
\[
\begin{minipage}{.35\linewidth}
  \centering
  $\begin{array}{r@{{}\mathrel{=}{}}l}
    wx & u \\[\jot]
    wy & v \\[\jot]
    w  & 10
  \end{array}$
\end{minipage}%
\begin{minipage}{.3\linewidth}
\centering (1)~$\leftrightarrow$~(2)
\end{minipage}%
\begin{minipage}{.35\linewidth}
  \centering
  $\begin{array}{r@{{}\mathrel{=}{}}l}
    x & u/w \\[\jot]
    y & v/w
  \end{array}$
\end{minipage}
\]
Here is some text following the above boxed expression.
\end{document}

Note that the minipage widths sum to \linewidth and are evenly distributed across it. The use of arrays just make the vertical alignment easier.

If you're interested in seeing the boxes used in the above construction, wrap each minipage inside an \fbox (after setting \setlength{\fboxsep}{-\fboxrule} to avoid changes when visualizing the boxes):

enter image description here

  • 2
    This is the original approach I wanna try, however later I think hand-tuning and hardcoding the width of minipage may not a good idea. Thanks anyway. – Ivan Z. Xiao Feb 24 '12 at 21:57

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.