2

What I want to archieve:

Layout where \raggedbottom is in effect and parskip stretches the paragraphs as far as it is configured to do. Like so:

\raggedbottom
\setlength{\parskip}{11pt plus 5pt minus 5pt}

I would expect that parskip would stretch out the paragraphs up to 5pt (or shrink thema by 5pt), but what happens is: nothing.

If I use \flushbottom the paragraphs are stretched to fit the page no matter what I use. The only difference is the report of badness depending on if parskip is overstretching or not.

So my question would be: Is there a way to archieve the desired result of parskip stretching to the given values but not more regardless if \flushbottom is archieved or not?

Edit per request:

No stretching at all:

\documentclass{article}
\addtolength\textheight{-10.7\baselineskip}
\setlength{\parskip}{0pt plus 11pt}
%\flushbottom
\begin{document}
   aaaa\\aaaa\\aaaa\\aaaa\\aaaa\\aaaa\\aaaa\\aaaa\\aaaa\\aaaa\\aaaa\\aaaa

bbb\\bbb\\bbb\\bbb\\bbb\\bbb\\bbb\\bbb\\bbb\\bbb\\bbb\\bbb\\bbb
\pagebreak
ccc
\end{document}

Stretched to the max (far more than "allowed" by parskip):

\documentclass{article}
\addtolength\textheight{-10.7\baselineskip}
\setlength{\parskip}{0pt plus 11pt}
\flushbottom
\begin{document}
aaaa\\aaaa\\aaaa\\aaaa\\aaaa\\aaaa\\aaaa\\aaaa\\aaaa\\aaaa\\aaaa\\aaaa

bbb\\bbb\\bbb\\bbb\\bbb\\bbb\\bbb\\bbb\\bbb\\bbb\\bbb\\bbb\\bbb
\pagebreak
ccc
\end{document}

I would like it to be somewhat in the middle: stretch as far as parskip allows but not further.

(Example shamelessly borrowed from How do parskip and similar parameters behave)

1
  • 2
    Can you edit your question and provide a minimum working example that demonstrates the issue? Commented Aug 26, 2021 at 12:27

1 Answer 1

4

by default \raggedbottom adds

plus.0001fil

glue to the bottom of the page, this is infinite order so no finite order glue will stretch so your \parskip is effectively 0pt.

So you can redefine \@textbottom to use finite glue (eg 0pt plus \textheight) or define \parskip to have fil glue (which would allow it to grow without limit without accumulating badness)

So probably you want

\def\@textbottom{\vskip \z@ \@plus \textheight}

so the stretch is distributed between the bottom of the page and between paragraphs.

Note however that if glue stretches you can not give it an upper bound

\setlength{\parskip}{0pt plus 11pt}

Does not mean that the glue may stretch to at most 11pt, the plus value is used in the badness calculation, so as the glue expands beyond that the badness of the page increases rapidly, but it will still stretch beyond that if that is needed.

All finite glue will stretch by the same factor so the end of page space will stretch more than the inter-paragraph space by the same ratio as \textwidth to 11pt.


If there is only one paragraph break and textbottom has full textheight stretch the parskip stretches a bit but is just noticable

enter image description here

If you only give .4\textheight at the bottom, you get more stretch in parskip

enter image description here

If you only allow .1 textheight, then parskip stretches more but now there is not enough stretch to fill the page without an underfull box warning

Underfull \vbox (badness 1253) has occurred while \output is active

enter image description here

\documentclass{article}
\addtolength\textheight{-10.7\baselineskip}
\setlength{\parskip}{0pt plus 11pt}
%\flushbottom
\makeatletter
\def\@textbottom{\vskip \z@ \@plus .1\textheight}
\makeatother
\begin{document}
   aaaa\\aaaa\\aaaa\\aaaa\\aaaa\\aaaa\\aaaa\\aaaa\\aaaa\\aaaa\\aaaa\\aaaa

bbb\\bbb\\bbb\\bbb\\bbb\\bbb\\bbb\\bbb\\bbb\\bbb\\bbb\\bbb\\bbb
\pagebreak
ccc
\end{document}
5
  • 1
    Nice peek under the bonnet* of \@textbottom. Thanks. (*"hood" in American English) Commented Aug 26, 2021 at 13:26
  • Thanks for the quick reply. I think I can see where you came from but unfortunately it doesn't work. With \raggedbottom active an your def nothing changes an the bottom box still stretches to the max an d the paragraphs do not stretch at all.
    – tim
    Commented Aug 26, 2021 at 14:06
  • 1
    @tim I meant to redefine textbottom to use the finite stretch or to use that def instead of raggedbottom. If you issue \raggedbottom after defining \@textbottom then it will of course reset the definition. Commented Aug 26, 2021 at 14:16
  • 1
    @tim I added full examples Commented Aug 26, 2021 at 14:24
  • Works! I had an issue withe the \makeatletter command and the effect using full \textheight was indeed very subtle. Thanks a lot!
    – tim
    Commented Aug 26, 2021 at 18:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .