You can measure the two parts, add some space for the equation number and typeset the thing using minipages.
The optional argument to doubleequation
is for the left indentation.
On the other hand, the last way, with align
seems clearer.
\documentclass{article}
\usepackage{amsmath}
\usepackage{lipsum} % for context
\ExplSyntaxOn
\NewDocumentEnvironment{doubleequation}{O{2em}b}
{
\anirban_doubleequation:nn { #1 } { #2 }
}
{}
\seq_new:N \l__anirban_doubleequation_seq
\dim_new:N \l__anirban_doubleequation_a_dim
\dim_new:N \l__anirban_doubleequation_b_dim
\box_new:N \l__anirban_doubleequation_a_box
\box_new:N \l__anirban_doubleequation_b_box
\box_new:N \l__anirban_doubleequation_eqnum_box
\cs_new_protected:Nn \anirban_doubleequation:nn
{
$$ % yes!
\seq_set_split:Nnn \l__anirban_doubleequation_seq { \nextequation } { #2 }
\hbox_set:Nn \l__anirban_doubleequation_eqnum_box { \theequation }
\hbox_set:Nn \l__anirban_doubleequation_a_box
{
$\displaystyle\seq_item:Nn \l__anirban_doubleequation_seq { 1 }$
}
\dim_set:Nn \l__anirban_doubleequation_a_dim
{ \box_wd:N \l__anirban_doubleequation_a_box + 4em + \box_wd:N \l__anirban_doubleequation_eqnum_box }
\hbox_set:Nn \l__anirban_doubleequation_b_box
{
$\displaystyle\seq_item:Nn \l__anirban_doubleequation_seq { 2 }$
}
\dim_set:Nn \l__anirban_doubleequation_b_dim
{ \box_wd:N \l__anirban_doubleequation_b_box + 4em + \box_wd:N \l__anirban_doubleequation_eqnum_box }
\hspace{#1}
\begin{minipage}{\l__anirban_doubleequation_a_dim}
\noindent
\begin{equation}
\hspace{0pt}
\seq_item:Nn \l__anirban_doubleequation_seq { 1 }
\hspace{10000pt minus 1fil}
\end{equation}
\end{minipage}
\hspace{10000pt minus 1fil}
\begin{minipage}{\l__anirban_doubleequation_b_dim}
\noindent
\begin{equation}
\hspace{0pt}
\seq_item:Nn \l__anirban_doubleequation_seq { 2 }
\hspace{10000pt minus 1fil}
\end{equation}
\end{minipage}
$$
}
\ExplSyntaxOff
\begin{document}
\eqref{A} and \eqref{B}
\lipsum[1][1-5]
\begin{doubleequation}
\begin{aligned}
W^+_\mu&=\frac{W^1_\mu-iW^2_\mu}{\sqrt{2}}\\
W^-_\mu&=\frac{W^1_\mu+iW^2_\mu}{\sqrt{2}}
\end{aligned}\label{A}
\nextequation
\begin{aligned}
Z^0_\mu&=\cos{\theta_w} W^3_\mu-\sin{\theta_w} B_\mu\\
A_\mu&=\sin{\theta_w} W^3_\mu+\cos{\theta_w} B_\mu
\end{aligned}\label{B}
\end{doubleequation}
\lipsum[2][1-5]\setcounter{equation}{123}
\begin{doubleequation}[1em]
\begin{aligned}
W^+_\mu&=\frac{W^1_\mu-iW^2_\mu}{\sqrt{2}}\\
W^-_\mu&=\frac{W^1_\mu+iW^2_\mu}{\sqrt{2}}
\end{aligned}
\nextequation
\begin{aligned}
Z^0_\mu&=\cos{\theta_w} W^3_\mu-\sin{\theta_w} B_\mu\\
A_\mu&=\sin{\theta_w} W^3_\mu+\cos{\theta_w} B_\mu
\end{aligned}
\end{doubleequation}
\lipsum[3][1-5]
\begin{align}
& W^+_\mu=\frac{W^1_\mu-iW^2_\mu}{\sqrt{2}}
&& W^-_\mu=\frac{W^1_\mu+iW^2_\mu}{\sqrt{2}}
\\[1ex]
& Z^0_\mu=\cos{\theta_w} W^3_\mu-\sin{\theta_w} B_\mu
&& A_\mu=\sin{\theta_w} W^3_\mu+\cos{\theta_w} B_\mu
\end{align}
\lipsum[4][1-5]
\end{document}
A few tricks are used…