[Tex/LaTex] Force equation numbering to the same line of case equation

labelsline-breakingpdftex

It seems that the column is so narrow that it can not bear the whole equation:

\begin{equation}
        R(p_i|G) =
        \begin{cases}
            ep_{p_i} + (1- UA(p_i|G))\cdot ({r_G - ep_{p_i}})
            &\text{ if } ep \leq r_G \\
            ep_{p_i} + UA(p_i|G)\cdot ({r_G - ep_{p_i}})
            &\text{ if } ep > r_G 
        \end{cases}
        \label{eq:dis}
    \end{equation}

The result is:

enter image description here

Question: how can I force (7) to the same line with the equation.

Best Answer

Something like this?

enter image description here

\documentclass[twocolumn]{article}
\usepackage{amsmath} % for '\text' macro
\newcommand\mcr[1]{\multicolumn{1}{@{}r@{}}{#1}} % handy shortcut macro

\begin{document}
\begin{equation}
\medmuskip=2mu   % reduce spacing around binary operators
\thickmuskip=3mu % reduce spacing around relational operators
\renewcommand\arraystretch{1.5}
R(p_i\mid G) =
\left\{\begin{array}{@{}l@{}}
   \textit{ep}_{p_i} + (1- \textit{UA}(p_i\mid G)) ({r_G - \textit{ep}_{p_i}})\\
   \mcr{\text{if  $\textit{ep} \leq r_G$}} \\[1ex]
   \textit{ep}_{p_i} + \textit{UA}(p_i\mid G) ({r_G - \textit{ep}_{p_i}}) \\
   \mcr{\text{ if $\textit{ep} > r_G$}}
   \end{array}\right.
        \label{eq:dis}
    \end{equation}
\end{document}