2

I have a problem with an "onehalfspacing document". Whenever I use an math environment in this document, latex notify "Underfull \vbox (badness 10000) has occurred while \output is active []". I think there is a problem with another spacing between the text and the math environment different to onehalfspacing. Exists there a global solution for the hole document to fix these vbox-problems?

I know that \raggedbottom prevents, that latex stretchs the text to the pagebottom. But then I have gaps at the pagebottoms.

Here ist a MWE (where the problem occurs, but not so dramatically than in other situations):

\documentclass{scrbook}
\usepackage{setspace}
\onehalfspacing
\AfterTOCHead{\singlespacing}
\KOMAoptions{DIV=current}
\usepackage{amsmath}
\recalctypearea
%\raggedbottom

%Some text:
 \newcommand{\sometext}{Aureh eurhg urg uhre uh uig iugh iugril giuzz geiu griugrq u gru grilu 
 geluig igru iuegg iu eh iuu gru grilu geluig igru iuehg uh uig iugh iugr geiu griugrq u gru grilu gel
 uig igru iuegg iu gruhg rg uhg ug r gr
}

\begin{document}
hallo
\begin{equation*}
 K(y,\varepsilon)\subseteq k(y,\varepsilon)\subseteq K(y,p\varepsilon).
\end{equation*}
% Some random text:
\sometext\sometext\sometext\sometext\sometext\sometext\sometext\sometext
\sometext\sometext\sometext\sometext\sometext\sometext\sometext\sometext
\end{document}
3
  • 1
    The default text area is designed with “single line spacing” in mind. After you change the line spacing, there is no guarantee that a page “fits an integer number of lines” anymore, and hence the Underfull \vbox warning. You could try to slightly modify the text area height. Feb 20 '20 at 2:32
  • 1
    Try \usepackage[onehalfspacing]{setspace} then add \KOMAoptions{DIV=current}. In Chapter 2 of the KOMA-Script documentation: “I recommend the package setspace (see [TF11]), which is not part of KOMA-Script. You should also let typearea recalculate a new type area after changing the line spacing. However, you should switch back to the normal line spacing for the title, and preferably for the table of contents and various lists — as well as the bibliography and the index. For details, see the explanation of DIV=current.” Also the example after Table 2.3. Feb 20 '20 at 2:46
  • @RuixiZhang - Thanks for help. I've edited my MWE like you and the example after Table 2.3. suggested. Unfortunately, it doesn't work. Did I do something wrong?
    – Tobi
    Feb 20 '20 at 19:50
1

I think the problem Is solved.

  1. As Ruixi Zhang suggested, we have to add \KOMAoptions{DIV=current} after \onehalfspacing to recalculate the textarea. Then the number of lines and the textarea fits together again. But this doesnt solve the vBox-problems with the math environments.

  2. The Problem with the math environments ist rather \usepackage{setspace} than \onehalfspacing. \usepackage{setspace} redefine the command \setdisplayskipstretch. As a result \usepackage{setspace} takes some of latex's flexbility about the math environments (To see this in my MWE, delete \onehalfspacingand add \usepackage{showframe}(and more text). Than use see, \flushbottom isnt working.). For explanation see Ben Mares' answer in Equations and Double Spacing. Therefore I set \setdisplayskipstretch back to default by \usepackage{setspace}\setdisplayskipstretch{}. This solved the vBox-problems with the math environments. I don't know if that entails other problems, but so far everything works quite well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.