![列出包和 vbox 警告](https://linux22.com/image/268069/%E5%88%97%E5%87%BA%E5%8C%85%E5%92%8C%20vbox%20%E8%AD%A6%E5%91%8A.png)
我遇到了这么多(见下文)未完全警告,这些警告是由于使用 listing 包和创建代码\begin{lstlisting}\end{}
来使代码看起来美观而导致的。有没有什么方法可以修复这些警告?
我正在使用 IEEETran 文档类和lstlisting
设置(见下文)。可以调整它来修复问题吗?
\lstset
{
breaklines=true,
tabsize=3,
showstringspaces=false
}
\lstdefinestyle{Common}
{
extendedchars = \true,
language = {Python},
frame = single,
% ===========================================================
framesep = 3pt,%expand outward.
framerule = 0.4pt,%expand outward.
xleftmargin = 3.7pt,%make the frame fits in the text area.
xrightmargin = 3.5pt,%make the frame fits in the text area.
% ===========================================================
rulecolor=\color{Red}
}
\lstdefinestyle{B}
{
style = Common,
backgroundcolor = \color{Black},
basicstyle = \scriptsize\color{White}\ttfamily,
keywordstyle = \color{Orange},
identifierstyle = \color{Cyan},
stringstyle = \color{Red},
commentstyle = \color{Green}
}
警告:
Underfull \vbox (badness 10000) has occurred while \output is active [4]
Underfull \vbox (badness 10000) has occurred while \output is active
Underfull \vbox (badness 10000) has occurred while \output is active [5]
Underfull \vbox (badness 10000) has occurred while \output is active
Underfull \vbox (badness 10000) has occurred while \output is active [6]
Underfull \vbox (badness 10000) has occurred while \output is active [7]
Underfull \vbox (badness 10000) has occurred while \output is active
Underfull \vbox (badness 10000) has occurred while \output is active [8]
Underfull \vbox (badness 10000) has occurred while \output is active [9]
Underfull \vbox (badness 10000) has occurred while \output is active
Underfull \vbox (badness 10000) has occurred while \output is active [10]
Underfull \vbox (badness 10000) has occurred while \output is active
Underfull \vbox (badness 10000) has occurred while \output is active [11]
答案1
列表行之间没有垂直灵活性,因此如果文本高度不是行高的精确倍数(考虑到\topskip
第一行使用的高度),那么您将收到此警告(如果您有一整页没有段落分隔符,您也会在普通文本中收到此警告)。
如果您无法更改,您可以在列表之前\textheight
使用每个页面底部的选项来增加灵活性。\raggedbottom