33

The align command from amsmath allows me to put two equations side-by-side:

\begin{align}
x = y && a = b
\end{align}

Unfortunately for my purposes, this shows both equations under one equation number:

x = y    a = b   (1)

Is there any way to give them individual numbers, so that the output looks like this?:

x = y (1)    a = b (2)
31
\usepackage{multicol}
...
\begin{multicols}{2}
  \begin{equation}
    a=b
  \end{equation}\break
  \begin{equation}
    b=c
  \end{equation}
\end{multicols}
  • The multicols method is great, but it has the little drawback that column widths cannot be adjusted. :-\ This problem is overcome with Gonzalo's minipage method. – loved.by.Jesus Dec 4 '15 at 15:50
  • 3
    @loved.by.Jesus The minipage method by Gonzalo is good but it doesn't maintain the vertical alignment of different equations. – Abhinav Jul 17 '16 at 18:11
  • 4
    @Abhinav I added \noindentbefore the first equation and removed the \break between them. This made the equations become vertically aligned. – Bashful Beluga Feb 17 '18 at 18:56
28

You can use minipages to wrap the equations:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

\noindent\begin{minipage}{.5\linewidth}
\begin{equation}
  a = b + c.
\end{equation}
\end{minipage}%
\begin{minipage}{.5\linewidth}
\begin{equation}
  d = e + f.
\end{equation}
\end{minipage}

\end{document}

enter image description here

6

Here is another attempt. The \doubleequation command has an optional argument to set labels. If used, it must be of the shape firstlabel,secondlabel.

\documentclass{article}
\usepackage{amsmath}
\usepackage{calc}
\usepackage{hyperref}
\hypersetup{colorlinks=true}

\makeatletter
\newcommand*\@dblLabelI {}
\newcommand*\@dblLabelII {}
\newcommand*\@dblequationAux {}

\def\@dblequationAux #1,#2,%
    {\def\@dblLabelI{\label{#1}}\def\@dblLabelII{\label{#2}}}

\newcommand*{\doubleequation}[3][]{%
    \par\vskip\abovedisplayskip\noindent
    \if\relax\detokenize{#1}\relax
       \let\@dblLabelI\@empty
       \let\@dblLabelII\@empty
    \else % we assume here that the optional argument
          % has the required shape A,B
       \@dblequationAux #1,%
    \fi
    \makebox[0.5\linewidth-1.5em]{%
     \hspace{\stretch2}%
     \makebox[0pt]{$\displaystyle #2$}%
     \hspace{\stretch1}%
    }%
    \makebox[0.5\linewidth-1.5em]{%
     \hspace{\stretch1}%
     \makebox[0pt]{$\displaystyle #3$}%
     \hspace{\stretch2}%
    }%
    \makebox[3em][r]{(%
  \refstepcounter{equation}\theequation\@dblLabelI, 
  \refstepcounter{equation}\theequation\@dblLabelII)}%
  \par\vskip\belowdisplayskip
}
\makeatother

\begin{document}

\begin{equation}
  \label{eq:1}
  u=v
\end{equation}
Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Cur- abitur
auctor semper nulla. Donec varius orci eget risus. Duis nibh mi, congue eu,
accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim
rutrum. 
\doubleequation[eq:2,eq:3]{a=b}{c=d}
Morbi dolor nulla, malesuada eu, pulvinar at, mollis ac, nulla. Cur- abitur
auctor semper nulla. 
\doubleequation[eq:I,eq:J]{A=B}{C=D}
Donec varius orci eget risus. Duis nibh mi, congue eu,
accumsan eleifend, sagittis quis, diam. Duis eget orci sit amet orci dignissim
rutrum. 
\begin{equation}
  \label{eq:4}
  w=z
\end{equation}
We may refer to \eqref{eq:2} or \eqref{eq:3} or \eqref{eq:I} or \eqref{eq:J},
and this is compatible with \verb|hyperref|.
\end{document}

double equation

  • the spacing is deliberately set on 1/3rd and 2/3rd anchor points, with 3em (randomly chosen) reserved space for the tag. It looks a bit odd compared to the centered equations though, perhaps. And there must be a better choice for the tag width. – user4686 Jun 23 '13 at 16:11
  • Actually this is not an answer to this but to another similar question which already has better answers than my proposal. So I will remain hidden here... – user4686 Jun 23 '13 at 16:20
5
\documentclass{article}
\usepackage{amsmath,tabularx}
\begin{document}

\noindent
\begin{tabularx}{\linewidth}{@{}XX@{}}
\begin{equation}
  a = b + c.
\end{equation}
&
\begin{equation}
  d = e + f.
\end{equation}
\end{tabularx}

\end{document}

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.