[Tex/LaTex] How to Position the Equation Number in begin{equation} environment for a parametric equation ( i.e. x = { a or b )

equationsnumbering

I have a parametric equation, which is numbered automatically by the begin{equation} environment. My issue is, the number appears on the next line down, below the equation. Since there is enough space on the second line of the split equation, I want the equation number to appear there instead. Does anyone know how I could do this?

This is similar to some previous questions, but I have tried their solutions of \notag for the top line, and using negative \hspace, neither of which work, I think because I use an array. My code is below:

\documentclass[a4paper,twoside,12pt]{article}
\usepackage{multicol}

\begin{document}

\begin{multicols*}{2}

Using Poisson's equation for gravity,

\begin{equation} \label{eq: phi}
\Phi(r) = \left\{
\begin{array}{lr}
    \frac{GM_{tot}}{Rvir}[\ln\left(\frac{r}{R_{vir}}\right) - 1] : r < R_{vir} \\
    \\
    \frac{-GM_{tot}}{r} : r > R_{vir} . 
\end{array} 
\right.
\end{equation}

\end{multicols*}
\end{document}

Thanks in advance!

EDIT: I can't use a different document format (e.g. [twocolumn]) since parts of my report are done in a single column. I do not wish to have my r < Rvir on a different line. I was thinking ideally that I could shift along the r > Rvir clause, so that the Equation number could be in line with the second equation, since there is room on that line. Can anybody do this?

Best Answer

Use a single column array:

\documentclass[]{article}
\usepackage{amsmath}
\usepackage{multicol}

\newcommand{\tsub}[1]{_{\mathrm{#1}}}

\begin{document}

\begin{multicols*}{2}

Using Poisson's equation for gravity,
\begin{equation} \label{eq: phi}
\Phi(r) =
\left\{
\begin{array}{@{}r@{}}
\dfrac{GM\tsub{tot}}{R\tsub{vir}}
  \biggl[\ln\biggl(\frac{r}{R\tsub{vir}}\biggr) - 1\biggr]
  \\
  r < R\tsub{vir}
\\[2ex]
\dfrac{-GM\tsub{tot}}{r} \hfill r > R\tsub{vir} . 
\end{array}
\right.
\end{equation}

\end{multicols*}

\end{document}

Textual subscripts should be in upright type and so I set them.

enter image description here

On the other hand, with the twocolumn option the text width is wider and you can use a better way.

\documentclass[twocolumn]{article}
\usepackage{amsmath,mathtools}

\newcommand{\tsub}[1]{_{\mathrm{#1}}}

\begin{document}

Using Poisson's equation for gravity,
\begin{equation} \label{eq: phi}
\Phi(r) =
\begin{dcases}
\dfrac{GM\tsub{tot}}{R\tsub{vir}}
  \biggl[\ln\biggl(\frac{r}{R\tsub{vir}}\biggr) - 1\biggr]
  &
  r < R\tsub{vir}
\\
\dfrac{-GM\tsub{tot}}{r} & r > R\tsub{vir} . 
\end{dcases}
\end{equation}

\end{document}

enter image description here