当 \output 在我的回忆录章节样式中处于活动状态时,如何修复发生的 Underfull \vbox 问题?

当 \output 在我的回忆录章节样式中处于活动状态时,如何修复发生的 Underfull \vbox 问题?

Underfull \vbox (badness 2573) has occurred while \output is active在研究了这个问题的警告几个小时后如何抑制“Underfull \vbox (badness 10000) ... while \output is active”?我了解并修复了文档中的几个此类警告,除了这一个。

接下来是我提取的最小示例,它重现了我在实际文档中遇到的问题。分析此示例后,我注意到当此距离较大时会出现警告,如下图所示:

在此处输入图片描述

如果我填充更多文字如下:

在此处输入图片描述

这是生成警告的最小代码:

\documentclass[11pt,a4paper]{memoir}

\makeatletter
% how to suppress “Underfull \vbox (badness 10000) … while \output is active”?
% https://tex.stackexchange.com/questions/62296/how-to-suppress-underfull
\def\@textbottom{\vskip \z@ \@plus 1pt}
\let\@texttop\relax

\newcommand\thickhrulefill{\leavevmode \leaders \hrule height 1ex \hfill \kern \z@}
\makechapterstyle{VZ14}
{
    % \thispagestyle{empty}
    \setlength\beforechapskip{50pt}
    \setlength\midchapskip{20pt}
    \setlength\afterchapskip{20pt}
    \renewcommand\chapternamenum{}
    \renewcommand\printchaptername{}
    \renewcommand\chapnamefont{\Huge\scshape}
    \renewcommand\printchapternum
    {%
        \chapnamefont\null\thickhrulefill\quad
        \@chapapp\space\thechapter\quad\thickhrulefill
    }
    \renewcommand\printchapternonum
    {%
        \par\thickhrulefill\par\vskip\midchapskip
        \hrule\vskip\midchapskip
    }
    \renewcommand\chaptitlefont{\huge\scshape\centering}
    \renewcommand\afterchapternum
    {%
        \par\nobreak\vskip\midchapskip\hrule\vskip\midchapskip
    }
    \renewcommand\afterchaptertitle
    {%
        \par\vskip\midchapskip\hrule\nobreak\vskip\afterchapskip
    }
}
\makeatother

% Memoir: Warnings “The material used in the headers is too large” w/ accented titles
% https://tex.stackexchange.com/questions/387293/how-to-change-the-page-layout-with-memoir
\setheadfoot{30.0pt}{\footskip}
\checkandfixthelayout

\usepackage[showframe,pass]{geometry}
\chapterstyle{VZ14}

\makeatletter
\newcommand{\showfont}
{%
    (encoding: \f@encoding{},
    family: \f@family{},
    series: \f@series{},
    shape: \f@shape{},
    size: \f@size{},
    baseline: \f@baselineskip{})
    %tfsize: \tf@size{},
    %sfsize: \sf@size{},
    %sssize: \ssf@size{}
}
\makeatother

\setcounter{secnumdepth}{5}
\newcommand{\subsubsubsection}{\paragraph}

\begin{document}

% ----------------------------------------------------------
\chapter[Nullam elementum urna vel imperdiet sodales elit ipsum]{Nullam
    elementum urna vel imperdiet sodales elit ipsum pharetra ligula
    ac pretium ante justo a nulla curabitur tristique arcu eu metus}
% ----------------------------------------------------------
1. How to display the font size in use in the final output,
2. How to display the font size in use in the final output,
3. How to display the font size in use in the final output,
4. How to display the font size in use in the final output,
5. How to display the font size in use in the final output,
6. How to display the font size in use in the final output,
7. How to display the font size in use in the final output,
8. How to display the font size in use in the final output,
9. How to display the font size in use in the final output,

\begin{verbatim}
\makeatletter
original: \f@size
\verb+\small+ \small \f@size
\verb+\normalsize+ \normalsize \f@size
\verb+\large+ \large \f@size
\verb+\Huge+ \Huge \f@size
\makeatother
\end{verbatim}

\section[Some encoding tests]{showfont}
\subsection{showfont}
\subsubsection{showfont}
\subsubsubsection{showfont}

\end{document}

另外,如果我通过删除填充文本将所有内容放在一页中,则不会出现任何警告:

在此处输入图片描述

这是来自真实文档的图片,显示了它是如何生成警告的:

在此处输入图片描述

这是我的文档上的代码,它生成了上面的图像:

% ----------------------------------------------------------
\chapter[Nullam elementum urna vel imperdiet sodales elit ipsum]{Nullam 
    elementum urna vel imperdiet sodales elit ipsum pharetra ligula
    ac pretium ante justo a nulla curabitur tristique arcu eu metus}
% ----------------------------------------------------------

1. How to display the font size in use in the final output,
2. How to display the font size in use in the final output,
3. How to display the font size in use in the final output,
4. How to display the font size in use in the final output,
5. How to display the font size in use in the final output,
6. How to display the font size in use in the final output,


\section[Some encoding tests]{\showfont}
\subsection{\showfont}
\subsubsection{\showfont}
\subsubsubsection{\showfont}



Lipsum me [55-57]

使用的命令\showfont是这样的:

\makeatletter
\newcommand{\showfont}
{%
    (encoding: \f@encoding{},
    family: \f@family{},
    series: \f@series{},
    shape: \f@shape{},
    size: \f@size{},
    baseline: \f@baselineskip{})
    %tfsize: \tf@size{},
    %sfsize: \sf@size{},
    %sssize: \ssf@size{}
}
\makeatother

如果您将所有文本都放在一页中,警告就会消失。但是我们不想将所有章节文本都放在一页中,也就是章节的封面。

我该如何修复此页面上的警告?我已经使用此修复程序如何抑制“Underfull \vbox (badness 10000) ... while \output is active”?修复Underfull \vbox (badness) has occurred while \output is active我文档上的其他问题。但是这个似乎与其他问题不同。

\def\@textbottom{\vskip \z@ \@plus 1pt}
\let\@texttop\relax

答案1

谢谢@Bernard评论,添加\raggedbottom修复了此警告。在搜索它时,我发现了以下问题:

  1. \flushbottom 与 \raggedbottom
  2. 我是否需要关心坏盒子?
  3. 从报告类别转换为书籍类别时出现不良消息
  4. \raggedbottom 在书中。这是正确的方法吗?
  5. 使用 Koma 脚本类之一时恢复默认的 \raggedbottom 脚注行为

用文本填充特定页面也解决了警告问题。基本上,页面内容以某种方式被推到下一页,从而在原始页面上留下一个大空白。

在此版本中,通过填充文本修复了警告:

% ----------------------------------------------------------
\chapter[Nullam elementum urna vel imperdiet sodales elit ipsum]{Nullam elementum urna vel imperdiet sodales elit ipsum pharetra ligula
    ac pretium ante justo a nulla curabitur tristique arcu eu metus}
% ----------------------------------------------------------

\showfont
\section[Some encoding tests]{\showfont}

1. How to display the font size in use in the final output,
2. How to display the font size in use in the final output,
3. How to display the font size in use in the final output,
4. How to display the font size in use in the final output,
5. How to display the font size in use in the final output,
6. How to display the font size in use in the final output,

7. How to display the font size in use in the final output,
8. How to display the font size in use in the final output,
9. How to display the font size in use in the final output,
10. How to display the font size in use in the final output,
11. How to display the font size in use in the final output,
12. How to display the font size in use in the final output,

\subsection{\showfont}

1. How to display the font size in use in the final output,
2. How to display the font size in use in the final output,
3. How to display the font size in use in the final output,
4. How to display the font size in use in the final output,
5. How to display the font size in use in the final output,
6. How to display the font size in use in the final output,

7. How to display the font size in use in the final output,
8. How to display the font size in use in the final output,
9. How to display the font size in use in the final output,
10. How to display the font size in use in the final output,
11. How to display the font size in use in the final output,
12. How to display the font size in use in the final output,

\subsubsection{\showfont}

1. How to display the font size in use in the final output,
2. How to display the font size in use in the final output,
3. How to display the font size in use in the final output,
4. How to display the font size in use in the final output,
5. How to display the font size in use in the final output,
6. How to display the font size in use in the final output,

7. How to display the font size in use in the final output,
8. How to display the font size in use in the final output,
9. How to display the font size in use in the final output,
10. How to display the font size in use in the final output,
11. How to display the font size in use in the final output,
12. How to display the font size in use in the final output,

\subsubsubsection{\showfont}

1. How to display the font size in use in the final output,
2. How to display the font size in use in the final output,
3. How to display the font size in use in the final output,
4. How to display the font size in use in the final output,
5. How to display the font size in use in the final output,
6. How to display the font size in use in the final output,
7. How to display the font size in use in the final output,

8. How to display the font size in use in the final output,
9. How to display the font size in use in the final output,
10. How to display the font size in use in the final output,
11. How to display the font size in use in the final output,
12. How to display the font size in use in the final output,


Lipsum me [55-57]

在此处输入图片描述

我更喜欢这个替代方案,而不是使用 禁用页面底部对齐\raggedbottom。我相信问题是由于问题末尾显示的堆积空白部分引起的,这会以某种方式将所有空白部分推到下一页,从而在第一页底部创建整体:

% ----------------------------------------------------------
\chapter[Nullam elementum urna vel imperdiet sodales elit ipsum]{Nullam 
    elementum urna vel imperdiet sodales elit ipsum pharetra ligula
    ac pretium ante justo a nulla curabitur tristique arcu eu metus}
% ----------------------------------------------------------

\showfont
\section[Some encoding tests]{\showfont}
\subsection{\showfont}
\subsubsection{\showfont}
\subsubsubsection{\showfont}

在此处输入图片描述

上述情况的解决方案是\newpage在发出警告的页面上手动插入命令。在这种情况下,文档将如下所示:

% ----------------------------------------------------------
\chapter[Nullam elementum urna vel imperdiet sodales elit ipsum]{Nullam 
    elementum urna vel imperdiet sodales elit ipsum pharetra ligula
    ac pretium ante justo a nulla curabitur tristique arcu eu metus}
% ----------------------------------------------------------

\showfont
\newpage

\section[Some encoding tests]{\showfont}
\subsection{\showfont}
\subsubsection{\showfont}
\subsubsubsection{\showfont}

请注意,最后这个示例只有附加到我的主文档时才有效。单独复制时,不会出现空白页:

在此处输入图片描述

这可能是由于我的主文档类中嵌入了其他设置。

答案2

两种方法:

  1. \newpage在相应页面中添加
  2. 添加这个神奇的命令\addtolength{\textheight}{\topskip}

相关内容