[Tex/LaTex] Two equations on the same line

equationsline

I have seen some posts close to what I need, but not quite what I need.

I would like to produce two equations on the same line with one equation number adjusted to left and one to the right. Both equations should be multiline.

And I want to generate a \tag for both equation labels.

So the output should look like what is produced by the code below.

\begin{array}{llrr}
      &    a=b                  &      x=y    &   \\
(eq1) &    c=d                  &      y=z    & (eq2)     \\
      &    e=f                 &       u=v
\end{array}

Best Answer

I propose this solution, with a code borrowed on this site from @DavidCarlisle:

\documentclass{article}
\usepackage[utf8]{inputenc}%
\usepackage{tabularx} 
\usepackage{mathtools, nccmath}

\makeatletter
\newcommand{\leqnomode}{\tagsleft@true\let\veqno\@@leqno}%
\newcommand{\reqnomode}{\tagsleft@false\let\veqno\@@eqno}%
\newcommand*{\compress}{\@minipagetrue}
\makeatother

\begin{document}

Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text.

{\centering\compress
\begin{tabularx}{\linewidth}{>{\leqnomode}XX}
\begin{equation}
\begin{aligned}
       a & =b \\
    c & =d \\
       e & =f
\end{aligned}
\end{equation}
 &
 \begin{equation}
\begin{aligned}
x & =y \\
 y & =z \\
u & =v
\end{aligned}
\end{equation}
\end{tabularx} \vspace{-\baselineskip}}

 Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text. Some more text.

\end{document} 

enter image description here

Related Question