63

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)
1
  • I'm trying the same thing except that I'm not intersted in having equation numbers. However, there is no space between the two equations. Am I missing something?
    – Harsha J K
    Dec 4, 2023 at 5:17

4 Answers 4

54
\usepackage{multicol}
...
\begin{multicols}{2}
  \begin{equation}
    a=b
  \end{equation}\break
  \begin{equation}
    b=c
  \end{equation}
\end{multicols}
5
  • 2
    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
  • 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, 2016 at 18:11
  • 16
    @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?
    – alper
    Apr 24, 2022 at 15:42
  • Additionally, in order to break the column properly, you should use \columnbreak instead of \break.
    – Tony Power
    Apr 15, 2023 at 14:51
62

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

0
10

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

2
  • 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
  • 1
    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
7
\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}

You must log in to answer this question.

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