段落第 25-27 行的 \hbox 未满(badness 10000)

段落第 25-27 行的 \hbox 未满(badness 10000)
\documentclass[lettersize,journal]{IEEEtran}
\usepackage{amsmath,amsfonts}
\usepackage{algorithmic}
\usepackage{algorithm}
\usepackage{array}
\usepackage[caption=false,font=normalsize,labelfont=sf,textfont=sf]{subfig}
\usepackage{textcomp}
\usepackage{stfloats}
\usepackage{url}
\usepackage{verbatim}
\usepackage{graphicx}
\usepackage{cite}
\hyphenation{op-tical net-works semi-conduc-tor IEEE-Xplore}
% updated with editorial comments 8/9/2021

\begin{document}

\section{Introduction}

\section{Some Common Elements}
\subsection{Sections and Subsections}


\subsection{Citations to the Bibliography}
For multiple citations code as follows: {\tt{$\backslash$cite\{ref1,ref2,ref3\}}}
 which will produce . For reference ranges that are not consecutive code as {\tt{$\backslash$cite\{ref1,ref2,ref3,ref9\}}} which will produce  

\vspace{11pt}

\vfill

\end{document}

问题:为什么上述代码会生成警告“第 25-27 行的段落中的 \hbox(badness 10000)未满”?

我发现的每个有关“Underfull \hbox”的 Tex.StackExchange 问题都与换行有关,但我没有在第 25-27 行使用\\nor \newline。还有什么可能导致错误?我正在使用 Overleaf。

答案1

编辑后,警告是这些框的不良程度为 10000(这是最大不良程度)

在此处输入图片描述

这说明空白处已经过度拉伸,正如您在输出中可以清楚看到的那样。您使用的是等宽字体\cite (出于某种原因,使用\tt30 年来在 LaTeX 中未默认定义的设置,\texttt{..这是正常的 LaTeX 语法)。但是由于等宽文本不会换行,因此必须转到下一行,因此空格过度拉伸以对齐行。

你必须决定做什么,你可以忽略警告,你可以添加手动换行符,你可以\parfillskip使用 ieeetran 设置恢复正​​常,两行段落几乎总是会产生未满的框,或者你可以更改措辞以使其更好地适应空间

在此处输入图片描述

\documentclass[lettersize,journal]{IEEEtran}
\usepackage{amsmath,amsfonts}
\usepackage{algorithmic}
\usepackage{algorithm}
\usepackage{array}
\usepackage[caption=false,font=normalsize,labelfont=sf,textfont=sf]{subfig}
\usepackage{textcomp}
\usepackage{stfloats}
\usepackage{url}
\usepackage{verbatim}
\usepackage{graphicx}
\usepackage{cite}
\hyphenation{op-tical net-works semi-conduc-tor IEEE-Xplore}
% updated with editorial comments 8/9/2021
\raggedbottom

\begin{document}

\section{Introduction}

\section{Some Common Elements}
\subsection{Sections and Subsections}


\subsection{Citations to the Bibliography}

1

For multiple citations code as follows:
\texttt{\textbackslash cite\{ref1,ref2,ref3\}} which will produce . For
reference ranges that are not consecutive code as
\texttt{\textbackslash cite\{ref1,ref2,ref3,ref9\}} which will produce

\bigskip

2

For multiple citations code as follows:
\texttt{\textbackslash cite\{ref1,\linebreak ref2,ref3\}} which will produce . For
reference ranges that are not consecutive code as
\texttt{\textbackslash cite\{ref1,\linebreak ref2,ref3,ref9\}} which will produce

\bigskip

3

\begin{sloppypar}
For multiple citations code as follows:
\texttt{\textbackslash cite\{ref1,ref2,ref3\}} which will produce . For
reference ranges that are not consecutive code as
\texttt{\textbackslash cite\{ref1,ref2,ref3,ref9\}} which will produce
\end{sloppypar}


\bigskip

4

For multiple citations, you may code as follows:
\texttt{\textbackslash cite\{ref1,ref2,ref3\}} which will produce . For
reference ranges that are not consecutive code as
\texttt{\textbackslash cite\{ref1,ref2,ref3,ref9\}} which will produce


\bigskip

{\setlength\parfillskip{0pt plus 1fill}

5
  
For multiple citations code as follows:
\texttt{\textbackslash cite\{ref1,ref2,ref3\}} which will produce . For
reference ranges that are not consecutive code as
\texttt{\textbackslash cite\{ref1,ref2,ref3,ref9\}} which will produce

}
\bigskip

\vfill

\end{document}

相关内容