我有以下代码,这会导致行溢出。我不知道如何修复它。有什么想法吗?
\documentclass{elsarticle}
\usepackage[math-style=TeX]{unicode-math}
\usepackage{amsmath}
\setmainfont{TeX Gyre Pagella}
\setmathfont{TeX Gyre Pagella Math}
\begin{document}
For the example shown in Figure~2, assuming $c_1=$ \emph{BiasFieldCorrector} and $c_2=$ \emph{Cerebro}, initially $\operatorname{prop}\{c_{11}\}=\{$\emph{SkullStrippedImage}$\}$ where $c_{11} \in \operatorname{Input}\{c_1\}$. After forward propagation, $\operatorname{prop}\{c_{22}\}=\{\textit{SkullStrippedImage}\}$ where $c_{22} \in \operatorname{Output}\{c_{2}\}$, propagating the semantic properties forward.
\end{document}
答案1
不要使用$c=$ foo
,因为如果=
未在中缀位置使用,则会获得错误的间距,如果必须混合数学和文本,则将$c={}$foo
确保在两边获得 mathrel 间距,=
但这里\emph
似乎在逻辑上是错误的(您想要斜体而不是强调),所以我使用了c=\mathit{foo}
。但是文本根本不适合。您可以重写以使其适合,但我不会尝试这样做,因为我不太确定其含义或者对于这种“块状”文本,最好不要尝试对齐右边距:
\documentclass{elsarticle}
\usepackage[math-style=TeX]{unicode-math}
\usepackage{amsmath}
\setmainfont{TeX Gyre Pagella}
\setmathfont{TeX Gyre Pagella Math}
\begin{document}\raggedright
For the example shown in Figure~2, assuming $c_1= \mathit{BiasFieldCorrector}$ and $c_2= \mathit{Cerebro}$, initially $\operatorname{prop}\{c_{11}\}=\{\mathit{kullStrippedImage}\}$ where $c_{11} \in \operatorname{Input}\{c_1\}$. After forward propagation, $\operatorname{prop}\{c_{22}\}=\{\mathit{SkullStrippedImage}\}$ where $c_{22} \in \operatorname{Output}\{c_{2}\}$, propagating the semantic properties forward.
\end{document}
或者按照评论中提到的恢复缩进:
\documentclass{elsarticle}
\usepackage[math-style=TeX]{unicode-math}
\usepackage{amsmath}
\setmainfont{TeX Gyre Pagella}
\setmathfont{TeX Gyre Pagella Math}
\begin{document}
\noindent X\dotfill X
{\raggedright\parindent=15pt
For the example shown in Figure~2, assuming $c_1= \mathit{BiasFieldCorrector}$ and $c_2= \mathit{Cerebro}$, initially $\operatorname{prop}\{c_{11}\}=\{\mathit{kullStrippedImage}\}$ where $c_{11} \in \operatorname{Input}\{c_1\}$. After forward propagation, $\operatorname{prop}\{c_{22}\}=\{\mathit{SkullStrippedImage}\}$ where $c_{22} \in \operatorname{Output}\{c_{2}\}$, propagating the semantic properties forward.\par}
\noindent X\dotfill X
\end{document}