力方程式編號到案例方程式的同一行

力方程式編號到案例方程式的同一行

看起來這個柱子太窄了,無法承受整個方程式:

\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}

結果是:

在此輸入影像描述

問題:如何迫使 (7) 與方程式在同一直線上。

答案1

像這樣的東西嗎?

在此輸入影像描述

\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}

相關內容