42

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.

2
  • Are the numbers (1) and (2) part of an enumeration, or do they reference the equation using something like a \label?
    – Werner
    Commented Feb 24, 2012 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 Xiao
    Commented Feb 24, 2012 at 17:22

3 Answers 3

52

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}
0
32

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

16

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

1
  • 3
    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 Xiao
    Commented Feb 24, 2012 at 21:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .