GeneralEliminating the space before a vbox at the top of a new page

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
gkamel
Posts: 25
Joined: Thu Oct 30, 2008 1:53 pm

Eliminating the space before a vbox at the top of a new page

Post by gkamel »

I would like to ensure certain (large) blocks of text in my document are kept together on the same page. Having experimented with a number of techniques, I have found

Code: Select all

\vbox{block of text to keep together...}
to be quite promising. However, the only problem I am having with it is that when the block of text happens to appear at the top of a new page, a small vertical space (roughly about 12pt) is left between the top margin and the text, which I would like to eliminate. This vertical space does not appear when there is text before the vbox.

Here are some bits of pre-amble I am using, which may or may not be related to the issue:

Code: Select all

\setlength{\parskip}{16pt}
\raggedbottom
\addtolength{\topskip}{0pt plus 100pt}
How can I avoid this unwanted vertical space?

George
George Kamel

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Eliminating the space before a vbox at the top of a new page

Post by localghost »

I wonder why you want to use this \vbox instead of the \parbox command or the minipage environment. Both prevent their contents from splitting. Moreover they allow more parameters for customization.


Best regards
Thorsten¹
gkamel
Posts: 25
Joined: Thu Oct 30, 2008 1:53 pm

Eliminating the space before a vbox at the top of a new page

Post by gkamel »

Dear Thorsten,

Many thanks for your reply and suggestion to use parbox instead of vbox. I have tried it, and it worked a charm, and actually produced better output than vbox. :)

I am still experiencing a similar problem as before, though. Now, when a parbox comes directly after a subsection, i.e.:

Code: Select all

\subsection{Subsection Title}
\parbox{Block of text to keep together...}
there is a larger gap between the subsection heading and the parbox than if text not placed in a parbox were to come after a subsection.

Below are some of the line-spacing-related parameters I have set in the preamble (I'm not sure if any of these are related to the problem):

Code: Select all

\setlength{\baselineskip}{0pt}
\setlength{lineskiplimit}{0pt}
\setlength{\lineskip}{16pt}
\setlength{parskip}{16pt}
Thanks a lot,

George
George Kamel
Post Reply