TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

If we use the book class, the output looks like the following screenshot.

enter image description here

But if we use the article class, the output looks better as follows.

enter image description here

The MWE is given as follows. Note: please enable -shell-escape!

\documentclass[12pt]{article}% please change to article and compare the output.

\begin{filecontents*}{"article sample.tex"}




% #1: length of gap,
% #2: filename with .tex, 
                \advance\x by 1
                \advance\x by 1


\immediate\write18{pdflatex "article sample"}
\MyLTXinputExample{article sample}

How to prevent book class from vertically justifying the contents? In other words, I want to use the book class but its output (only the justification is under consideration) must look like the output that article class produces.

share|improve this question

marked as duplicate by lockstep, Kurt, Thorsten, Martin Schröder, mafp Feb 15 '13 at 16:27

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 10 down vote accepted

Put a \raggedbottom into your preamble.

share|improve this answer
Today I have learnt a new thing, \raggedbottom. Thank you! – kiss my armpit Feb 15 '13 at 10:41

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