3

In the following code, the result looks like this on the first page (when compiled with pdflatex)

Page 1 result

There is quite a lot of vertical space between the tabularx environments on the first page. I imagine this is because there is not enough room on the page to get the thrid paragraph on, so it shoves that to the second page, and then there is a lot of whitespace available on the first page, so the algorithm chooses a way of "evenly" spacing the elements on the page, causing them to spread.

I have several questions.

  • Is the above correct?
  • How can I manipulate the spacing?
  • Specifically, how can I manipulate the spacing in such a way that by default, whitespace gathers at the end of the page, rather than being spread out across the page?

Thanks.

\documentclass[12pt,english,twoside]{article}
\usepackage{lipsum}
\usepackage{tabularx}

\begin{document}

\begin{flushleft}

\begin{tabularx}{\textwidth}{lXr}
1.\hspace{1em} &  \lipsum[1] & \hspace{1em}(3) \\
\end{tabularx}

\begin{tabularx}{\textwidth}{lXr}
2.\hspace{1em} &  \lipsum[2] & \hspace{1em}(3) \\
\end{tabularx}

\begin{tabularx}{\textwidth}{lXr}
3.\hspace{1em} &  \lipsum[1] & \hspace{1em}(3) \\
\end{tabularx}

\end{flushleft}
\end{document}

4

If the article document class is loaded with the option twoside, the directive \flushbottom is activated. This directive tells LaTeX to make sure that the bottom edges of each pages of text are placed just above the bottom margins. That's what you're experiencing.

I can think of two remedies:

  • Don't specify the option twoside.

  • If you must set the twoside option, issue the instruction \raggedbottom in the preamble to cancel the effect of \flushbottom.

|improve this answer|||||
4

To complement a bit Mico's answer (+1):

Your document is implicitly set in \flushbottom style—for reasons explained by Mico. This means that when TeX choses a page break, it will stretch the material gathered for the page so that it spans over the full height of the page body. This way, all pages normally have the same height (that is, unless under exceptional conditions like no stretchability at all, overfull pages or use of \enlargethispage).

In your case, the only stretchable vertical glue (at top-level in the part of the main vertical list that results in page 1) is \parskip glue automatically inserted between paragraphs (the blank lines between your tabularx environments are turned into \par tokens by TeX). You can verify this assertion by using:

\tracingoutput=1
\showboxdepth=1
\showboxbreadth=\maxdimen
\tracingonline=1

With this, you'll see the following in the output:

Underfull \vbox (badness 10000) has occurred while \output is active
\vbox(548.5+0.0)x390.0, glue set 191.00003
.\write-{}
.\glue(\topskip) 0.0
.\hbox(111.75+105.74998)x390.0 []
.\glue(\parskip) 0.0 plus 1.0
.\glue(\lineskip) 1.0
.\hbox(75.5+69.49998)x390.0 []
.\glue -6.0


Completed box being shipped out [1] % this means page 1 was just output

By default, \parskip is indeed 0pt plus 1pt. The above output shows that it's the only top-level glue1 in the page body that has a stretch component (plus 1pt). Therefore, this \parskip glue stretches as much as needed so that the page has the normal height for a page using your layout settings. Since it has only 1 point of stretchability, this is too much stretching and TeX rightfully reports that the \vbox containing the page body is “underfull”.

As Mico said, you can use \raggedbottom to achieve what you asked.


Footnote

  1. By this, I mean glue at the outermost level of the \vbox that constitutes the page body.
|improve this answer|||||

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.