多种数学表达式中的换行

多种数学表达式中的换行

我该如何对齐论文的这一部分:

\subsection{Decision variables}

\noindent$y_{pij}^{mk}=\left\{\begin{array}{ll} 1, & \;\;\; \hbox{ If the robot
loads or uloades a part to/from machine $m$ in position $p$ and gripper one
holds a part that should be loaded on machine $i\in \mathcal{M}$ and gripper
two holds a part that should be loaded on machine $j\in \mathcal{M}$}, \\
    0, &\;\;\; \hbox{Otherwise} \end{array} \right.
    $

如下图这样发布。

在此处输入图片描述

正如你所见,这个二进制变量的描述的结尾已经超出了页面范围。

谢谢。

答案1

您应该做几件事:

  1. 使用显示样式的数学环境,如\[ ... \]
  2. 使用cases环境排版数学案例。
  3. 使用\parbox允许您的文本排版在多行上。

话虽如此,你可以这样做:

\[y_{pij}^{mk} = \begin{cases}
1, & \parbox{5cm}{If the robot loads or uloades a part to/from machine $m$ in position $p$ and gripper one holds a part that should be loaded on machine $i\in \mathcal{M}$ and gripper two holds a part that should be loaded on machine $j\in \mathcal{M}$} \\
0, & \text{Otherwise}
\end{cases}\]

结果是:

您可以调整宽度\parbox以更好地满足您的需要。

为了使第一行\parbox与“1”的高度相同,您可以为命令提供\parbox一些选项:

\parbox[t][][t]{length}{Your text}

(在此处找到:表格、parbox、垂直对齐

结果:

答案2

例如:

\documentclass{article}

\usepackage{mathtools}

\begin{document}

\begin{equation*}
    \left\{%
        \begin{array}{ll}
            1 & \text{\parbox[t][][t]{0.8\textwidth}{If the robot loads or uploads a part to/from machine $m$ in position $p$ and gripper one holds a part that should be loaded on machine $i\in \mathcal{M}$ and gripper two holds a part that should be loaded on machine $j\in \mathcal{M}$}}, \\
            0 & \text{Otherwise}
        \end{array}%
    \right.
\end{equation*}

\end{document}

答案3

flalign*使用 mathtools和环境的简单代码dcases*

\documentclass{article}

\usepackage{mathtools}
\usepackage[showframe]{geometry}

\begin{document}

\begin{flalign*}
  & y_{pij}^{mk}=\begin{dcases*} 1, & \parbox[t]{0.863\linewidth}{ If the robot loads or uloades a part to/from machine $m$ in position $p$ and gripper one holds a part that should be loaded on machine $i ∈ \mathcal{M}$ and gripper two holds a part that should be loaded on machine $j ∈ \mathcal{M}$}, \\ 0, &Otherwise
  \end{dcases*}
\end{flalign*}

\end{document} 

在此处输入图片描述

相关内容