Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

This is almost duplicate to question Random unwanted space between paragraphs but I don't even use \par.

I'm using pdflatex to compile a .tex file. As I wrote my text I noticed a sudden change in how the paragraphs of my document were spaced. From being just indented there appeared a huge gap between paragraphs. The only change between the two versions was a single word.

Edit: Here is a MWE:

\documentclass[openright]{scrbook}[2007/12/24]

\begin{document}
\chapter{Lorem}
Ipsum dolor et amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. 
At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. 
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. 

Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. 
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.   

Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet. ipsum dolor sit amet. Dor sit amet. 
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum delenit augue duis dolore te feugait nulla facilisi.   

 Dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum delenit augue duis dolore te feugait nulla facilisi.   

 At vero eos et accusam et justo. Stet no sea ipsum dolor sit amet. Lorem ipsum dolor sit amet, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. 

At et et ea rebum. Stet clita, no sea takimata sanctus est Lorem ipsum dolor sit amet.   
 Clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor.

%\textbf{Test}

\section{Second}
\subsection{Second.1}
\section{Third}
\subsection{Third.1}
\section{Fourth}
\subsection{Fourth.1}
\end{document}

When the comment character in the line before \section{Second} is removed the weird spacing happens.

Images of the problem:

Before

Correct paragraph spacing

After

paragraph spacing too large

After inserting the word "Test" everything messed up. The paragraphs dropped way below their predecessors. I also noted that when the \section{Second} is changed to \chapter{...} the spacing is back to normal. What is happening?

share|improve this question
6  
Unless someone has their crystal ball polished I suspect that the question is not answerable in this form. try to make a minimal complete document that shows the effect so we can reproduce. Just delete stuff until the problem goes away and post the smallest version with the problem. Usually by doing this you spot what is wrong and so don't need to ask, but if you do need to ask, it gives us a chance to answer. –  David Carlisle Dec 7 '12 at 11:23
    
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Stephan Lehmke Dec 7 '12 at 11:45
6  
I suspect you have a large unbreakable object at the bottom of the second page. By inserting one word, the paragraph spanning the page break gets one line longer, so the large object is moved to the next page. The "flushbottom" property of the book class results in the paragraphs getting dragged apart. Ok, let's see how good my crystal ball is ;-) –  Stephan Lehmke Dec 7 '12 at 11:48
4  
@BandGap It's bad mojo to say "I don't have time" on forums where you are likely to ask questions :) –  recluze Dec 7 '12 at 13:53
2  
And with the MWE it's easy. A page break is absolutely forbidden directly after a section title, so the empty section titles are "glued" together. As soon as you start inserting text there, the problems will disappear. Maybe you can just write todo or something just to have some text. –  Stephan Lehmke Dec 8 '12 at 13:41
show 12 more comments

1 Answer

up vote 5 down vote accepted

A page break is absolutely forbidden directly after a section title, so the empty section titles are "glued" together.

Without the "Test", the block of section titles just fits on the page, after inserting "Test" it doesn't fit. As there is no breakpoint inbetween, the whole block of section titles goes to the next page:

enter image description here

The strange "stretching out" of paragraphs on the first page is caused by the fact that books are by default set flush bottom. That means, if there is any stretchability at all on the page, everything will be stretched such that the bottom of the content sits exactly on the bottom of the page.

You can get a different behaviour by adding the declaration \raggedbottom to the preamble of your document. This leads to:

enter image description here

But beware! It is usually not desired that all pages in a book end on a different height!

Anyway, the real "problem" is the empty body of the sections, which is surely not considered as a long-term situation. As soon as you start inserting text there, the problems will disappear. Maybe you can write "todo" there or something just to have some text.

Even if I just add \leavevmode I get this result (without \raggedbottom):

enter image description here

Here's the modified MWE:

\documentclass[openright]{scrbook}[2007/12/24]

\begin{document}
\chapter{Lorem}
Ipsum dolor et amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. 
At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. 
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. 

Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. 
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.   

Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.
Lorem ipsum dolor sit amet. ipsum dolor sit amet. Dor sit amet. 
Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum delenit augue duis dolore te feugait nulla facilisi.   

 Dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum delenit augue duis dolore te feugait nulla facilisi.   

 At vero eos et accusam et justo. Stet no sea ipsum dolor sit amet. Lorem ipsum dolor sit amet, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. 

At et et ea rebum. Stet clita, no sea takimata sanctus est Lorem ipsum dolor sit amet.   
 Clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor.

\textbf{Test}

\section{Second}
\leavevmode
\subsection{Second.1}
\leavevmode
\section{Third}
\leavevmode
\subsection{Third.1}
\leavevmode
\section{Fourth}
\leavevmode
\subsection{Fourth.1}
\leavevmode
\end{document}
share|improve this answer
1  
And now we have something that is useful for everyone :) –  recluze Dec 9 '12 at 9:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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