我该如何对齐论文的这一部分:
\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
您应该做几件事:
- 使用显示样式的数学环境,如
\[ ... \]
。 - 使用
cases
环境排版数学案例。 - 使用
\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}