[Tex/LaTex] How to write two equations side-by-side, with each equation numbered and with text in between

equationsmath-mode

The closest I could get is:

\documentclass{iopart}

\usepackage{iopams}
\usepackage[utf8]{inputenc}
\usepackage{mathtools}

\begin{document}
    \begin{minipage}{.38\textwidth}
        \begin{equation} \label{eq:ComptonWavelength}
            E'_\gamma = \frac{E_\gamma}{1 + \frac{E_\gamma}{m_e c^2}(1 - \cos{\theta})}
        \end{equation}
    \end{minipage}
    \begin{minipage}{.1\textwidth} \hfill
        \text{or}
    \end{minipage}
    \begin{minipage}{.38\textwidth}
        \begin{equation}
            \Delta\lambda = \frac{h}{m_e c^2}(1 - \cos{\theta})
        \end{equation}
    \end{minipage}

\end{document}

but the they aren't aligned perfectly and require tweaking the minipage widths which seems like a very inelegant non-LaTeX solution.

I've tried \align, \multicols and \minipage, but they all have problems related to vertical alignment or equation numbering.

Best Answer

enter image description here

If that is what you had in mind, here is the code:

\documentclass{article}

\usepackage{amsmath}

\begin{document}
\begin{align} \label{eq:ComptonWavelength}
        \Delta\lambda &= \frac{h}{m_e c^2}(1 - \cos{\theta)}
\intertext{or}
    \theta &= \arccos{\biggl(1 + m_e c^2 \biggl(\frac{1}{E_\gamma} - \frac{1}{E'_\gamma} \biggr) \biggr)}
\end{align}
\end{document}

If you want the vertical spacing around the "or" to be less, you can use \shortintertext instead of \intertext, but then you need the package mathtools instead of amsmath.

To place the equations side by side (I do not recommend this), you can try two minipages with [t] alignment:

enter image description here

But you'll need a \vphantom{\bigg(} so that the tops line up.

Here is the code:

\documentclass{article}

\usepackage{mathtools}

\begin{document}

\begin{minipage}[t]{.35\textwidth}
\begin{equation} \label{eq:ComptonWavelength}
   \vphantom{\bigg(}\Delta\lambda = \frac{h}{m_e c^2}(1 - \cos{\theta)}
\end{equation}
\end{minipage}
\begin{minipage}[t]{.6\textwidth}
\begin{equation}
  \text{or\quad}  \theta = \arccos{\biggl(1 + m_e c^2 \biggl(\frac{1}{E_\gamma} - \frac{1}{E'_\gamma} \biggr) \biggr)}
\end{equation}
\end{minipage}
\end{document}

You'll have to play around with the widths of the minipages. But I think it looks cramped all on one line.

Related Question