# side-by-side equations, with equation numbers for each

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)


\usepackage{multicol}
...
\begin{multicols}{2}
$$a=b$$\break
$$b=c$$
\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. Dec 4, 2015 at 15:50
• @loved.by.Jesus The minipage method by Gonzalo is good but it doesn't maintain the vertical alignment of different equations. Jul 17, 2016 at 18:11
• @Abhinav I added \noindentbefore the first equation and removed the \break between them. This made the equations become vertically aligned. Feb 17, 2018 at 18:56
• Can this solution applied for the whole page? Apr 24 at 15:42

You can use minipages to wrap the equations:

\documentclass{article}
\usepackage{amsmath}

\begin{document}

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

\end{document}


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}

\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}

$$\label{eq:1} u=v$$
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.
$$\label{eq:4} w=z$$
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}


• 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, 2013 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, 2013 at 16:20
\documentclass{article}
\usepackage{amsmath,tabularx}
\begin{document}

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

\end{document}