When using the spacing
environment from the setspace
package, it appears that rubber lengths in \abovedisplayskip
and \belowdisplayskip
are being ignored.
\documentclass{article}
\usepackage[nopar]{lipsum}
\usepackage{setspace}
\flushbottom
\begin{document}
%\begin{spacing}{1.0}
\setlength{\abovedisplayskip}{12pt plus 1000pt}%
\setlength{\belowdisplayskip}{12pt plus 1000pt}%
\lipsum[1]
\par
\lipsum[2]
%
\[a^2+b^2=c^2\]
%
\lipsum[3]
\par
\lipsum[4]
%
\[
\begin{array}{c}a\\b\\c\\d\\e\\f\\g\\h\\i\end{array}
\]
%\end{spacing}
\end{document}
My MWE is designed such that the second fomula with the very tall array forces an unpleasant page break. Due to the big rubber lengths in \abovedisplayskip
and \belowdisplayskip
, lots of space is introduced around the first formula instead of spreading the paragraphs. This behavior is as expected. (Side question: Why does it not work, when I set the lengths before \begin{document}
?)
However, when I add the two commented out lines that begin and end the spacing
environment, then for some reason the rubber lenghts are ignored. When I output the value of the length, the rubber is there, but the space just doesnt't want to stretch.
This happens irrespective of the stretch value passed to the spacing
environment. (A spread of 1.0 is obviously nonsensical and just for illustration). What can I do to correct this behavior?
setspace
package, I stubled over this issue that seems related to my problem. Adding\setdisplayskipstretch{}
as suggested there, indeed restores the stretching behavior before and after display math. However, this also disables the automatic stretching of space around equations together with the line spreading, which then has to be done manually. Hence, this is only a partial solution.lipsum
paragraph ends with\par
, and a paragraph break before a display environment wreaks havoc with the vertical spacing. That may not be the problem with your actual project, but it would cause the results of a test to be unreliable.nopar
option of thelipsum
package to get rid of the\par
. The problem persists without change, however.