如何处理导致寡妇/孤儿的不必要的空白?

如何处理导致寡妇/孤儿的不必要的空白?

我正在使用 TexMaker 撰写论文,以下是发生的情况:

在此处输入图片描述

我在段落“B”之前得到了不必要的空白。由于不必要的空白,我在下一页的开头得到了一个方程式引用的遗漏/孤立。我几乎已经完全搞不懂这里的问题是什么了。

以下是该段落和相应方程部分的 LaTeX 代码:

\subsection{Computing Tester/Developer Payoffs}
\label{subsec:payoffs}

In a security game defenders may employ mixed strategies i.e., selecting a
particular action with some probability as opposed to a deterministic
choice. This distribution decreases predictability of choice of
actions that may be exploited by an adversary. For our testing game we
refer to the set of distributions as a \textit{coverage vector}, $C$
that gives the probability, $c_t$, that a particular test suite $t$,
covering a particular requirement will be executed. We then compute
the expected payoffs for the testers and developers as shown in
Equations~\eqref{eqn:tC-EU} through ~\eqref{eqn:attack-set}

\begin{IEEEeqnarray}{c}
    \label{eqn:tC-EU} U_\tester(t,C) = c_t \cdot \testercovered + (1-c_t)\cdot \testeruncovered \\
    \label{eqn:CA-EU} U_\tester(C,\reqvector) = \sum_{t \in T} \attackprob \cdot (c_t \cdot \testercovered + (1-c_t)\cdot \testeruncovered) \\
    \label{eqn:attack-set} \Gamma (C) = \{t:U_\dev(t,C) \geq U_\dev(t',C)\, \forall t' \in T\}
\end{IEEEeqnarray}
%...remaining text

在我看来,代码中没有什么异常。为什么会发生这种情况,我该如何修复它(空格 + 孤行/空白)?编辑论文后突然出现这种情况。我猜这与 LaTeX 的自动布局有关,而不是代码中的问题。

PS:如果有用的话,这里是上面屏幕截图中的表格的代码:

{\begin{table*}[!t]
\caption{Compact representation of game showing tester and developer utilities}
\label{table:game}
\renewcommand\arraystretch{1.5}
\begin{tabular}{*{11}{|c}|}
\cline{2-11}
\multicolumn{1}{c|}{}& \multicolumn{2}{c|}{Requirement 1} & \multicolumn{2}{c|}{Requirement 2} & \multicolumn{2}{c|}{Requirement 3} & \multicolumn{2}{c|}{Requirement 4} & \multicolumn{2}{c|}{Requirement 5}\\ \cline{2-11}
\multicolumn{1}{c|}{}& Covered & Uncovered                & Covered & Uncovered                & Covered & Uncovered                & Covered & Uncovered                & Covered & Uncovered               \\ \hline
Tester's utility     & 2 & -10                            & 7 & -4                             & 6 & -1                             & 9 & -9                             & 9 & -9                            \\ \hline
Developer's utility  & -7 & 4                             & -1 & 3                             & -6 & 5                             & -3 & 7                             & -10 & 3                           \\ \hline
\end{tabular}
\end{table*}} 

答案1

由于您并没有真正将IEEEeqnarray环境中的元素彼此对齐,因此一种选择是equation为每个方程式使用单独的环境,以便 TeX 在需要时自然地在它们之间中断:

在此处输入图片描述

\documentclass{IEEEtran}% http://ctan.org/pkg/IEEEtran
\usepackage{amsmath,lipsum}% http://ctan.org/pkg/{amsmath,lipsum}
\newcommand{\tester}{\tau}
\newcommand{\testercovered}{U_\tester^c(t)}
\newcommand{\testeruncovered}{U_\tester^\omega(t)}
\newcommand{\reqvector}{R}
\newcommand{\attackprob}{r_t}
\newcommand{\dev}{d}

\begin{document}

\subsection{Introduction}
\vspace{10\baselineskip}
\lipsum[1-8]

\subsection{Computing Tester/Developer Payoffs}
\label{subsec:payoffs}

In a security game defenders may employ mixed strategies i.e., selecting a
particular action with some probability as opposed to a deterministic
choice. This distribution decreases predictability of choice of
actions that may be exploited by an adversary. For our testing game we
refer to the set of distributions as a \textit{coverage vector}, $C$
that gives the probability, $c_t$, that a particular test suite $t$,
covering a particular requirement will be executed. We then compute
the expected payoffs for the testers and developers as shown in
Equations~\eqref{eqn:tC-EU} through~\eqref{eqn:attack-set}
%\begin{IEEEeqnarray}{c}
%  \label{eqn:tC-EU} U_\tester(t,C) = c_t \cdot \testercovered + (1-c_t)\cdot \testeruncovered \\
%  \label{eqn:CA-EU} U_\tester(C,\reqvector) = \sum_{t \in T} \attackprob \cdot (c_t \cdot \testercovered + (1-c_t)\cdot \testeruncovered) \\
%  \label{eqn:attack-set} \Gamma (C) = \{t:U_\dev(t,C) \geq U_\dev(t',C)\, \forall t' \in T\}
%\end{IEEEeqnarray}
\begin{equation}
  \label{eqn:tC-EU} U_\tester(t,C) = c_t \cdot \testercovered + (1-c_t)\cdot \testeruncovered
\end{equation}
\begin{equation}
  \label{eqn:CA-EU} U_\tester(C,\reqvector) = \sum_{t \in T} \attackprob \cdot (c_t \cdot \testercovered + (1-c_t)\cdot \testeruncovered)
\end{equation}
\begin{equation}
  \label{eqn:attack-set} \Gamma (C) = \{t:U_\dev(t,C) \geq U_\dev(t',C)\, \forall t' \in T\}
\end{equation}
%...remaining text
\end{document}

取消注释IEEEtran上述环境内容以重新创建原始有问题的布局。

答案2

请注意,这种标记ugh ~\eqref{eqn:在最好的情况下是不正确的,它会导致双倍空格,或者如果你运气不好(如这里),它可能会导致数字在一行上结束。你需要

ugh~\eqref{eqn:

之前没有空格~

另外,通常来说,在显示的数学环境前不应该留有空行(我不确定 IEEE 版本是否避免了这个问题,在标准或显示数学环境前留有空行eqnarray肯定是错误的。eqnarray

(请始终发布完全的显示问题的小文档(而不仅仅是片段),它使测试可能的答案变得更加容易)

因此,以 Werner 的例子为例,但将 eqnarray 放回去,带有和不带有不好的空白:

在此处输入图片描述

\documentclass{IEEEtran}% http://ctan.org/pkg/IEEEtran
\usepackage{amsmath,lipsum}% http://ctan.org/pkg/{amsmath,lipsum}
\newcommand{\tester}{\tau}
\newcommand{\testercovered}{U_\tester^c(t)}
\newcommand{\testeruncovered}{U_\tester^\omega(t)}
\newcommand{\reqvector}{R}
\newcommand{\attackprob}{r_t}
\newcommand{\dev}{d}

\begin{document}

\subsection{Introduction}
\vspace{10\baselineskip}
\lipsum[1-8]

\subsection{Computing Tester/Developer Payoffs}
\label{subsec:payoffs}

In a security game defenders may employ mixed strategies i.e., selecting a
particular action with some probability as opposed to a deterministic
choice. This distribution decreases predictability of choice of
actions that may be exploited by an adversary. For our testing game we
refer to the set of distributions as a \textit{coverage vector}, $C$
that gives the probability, $c_t$, that a particular test suite $t$,
covering a particular requirement will be executed. We then compute
the expected payoffs for the testers and developers as shown in
Equations~\eqref{eqn:tC-EU} through~\eqref{eqn:attack-set}
\begin{IEEEeqnarray}{c}
  \label{eqn:tC-EU} U_\tester(t,C) = c_t \cdot \testercovered + (1-c_t)\cdot \testeruncovered \\
  \label{eqn:CA-EU} U_\tester(C,\reqvector) = \sum_{t \in T} \attackprob \cdot (c_t \cdot \testercovered + (1-c_t)\cdot \testeruncovered) \\
  \label{eqn:attack-set} \Gamma (C) = \{t:U_\dev(t,C) \geq U_\dev(t',C)\, \forall t' \in T\}
\end{IEEEeqnarray}
%...remaining text
\end{document}

相关内容