Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I prevent LaTeX from padding spaces between paragraphs so that next section begins at top of next page?

Tags:

latex

I have a two-column paper where space restrictions are very tight.

I just looked at my last version of the manuscript and saw that the upper half contains a figure (as expected), but in the lower half there is a lot of vertical space between paragraphs (enough to squeeze 10 more lines), and that LaTeX probably added it so that in the beginning of the next page a new numbered section will begin at the top of the page.

I know there's a way to adjust this so LaTeX doesn't try so hard, but I'm not sure how. any help? Thanks!

like image 221
Uri Avatar asked Mar 13 '09 16:03

Uri


People also ask

How do I get rid of extra space between paragraphs in LaTeX?

\parskip (TeX primitive) TeX/LaTeX allow users to control that inter-paragraph spacing via the \parskip parameter command. Advice from the parskip package: The parskip package advises that directly modifying \parskip can “result in vertical spaces in unexpected places” (within a LaTeX document).

How do I stop spacing in LaTeX?

To remove random unwanted space in LaTeX-style maths in matplotlib plot, we can use "\!" which will reduce the extra spacing.

How do you remove spaces between two sections in LaTeX?

You can reduce the gap between table columns by using \setlength{\tabcolsep}{1pt}. It may also be possible to scale a whole table as you can a piece of graphics, using \resizebox{!} {5cm}{\begin{tabular} ...


2 Answers

The parameter that controls inter-paragraph spacing is called \parskip(See Paragraph Spacing ). You set it (with "rubber" values) using something like:

 \setlength{\parskip}{1cm plus4mm minus3mm} 

The defualt value of \parskip is class dependent. The "plus" and "minus" parts tell TeX how much it can adjust the value to improve the layout (that is they make the spacing elastic, thus the "rubber" designation). Reducing (or eliminating) the "plus" part of the rubber might help.

Watch out though, you can cause other layout artifacts if you constrain TeX too much.


Other things to think about:

  • The widow and club penalties probably apply section headings, and may be affecting TeX's layout choices (see https://stackoverflow.com/questions/512967/how-can-one-keep-a-section-from-being-at-the-end-of-a-page-in-latex for a discussion).
  • You may also want to consider messing with \baselineskip which controls the allowed spacing between lines of text and can also have rubber values.
  • This is a common problem, and there are probably some fairly sophisticated treatments already prepared on CTAN.
like image 173
dmckee --- ex-moderator kitten Avatar answered Oct 12 '22 21:10

dmckee --- ex-moderator kitten


\vfill before the new section worked perfectly for me.

like image 42
gilla89 Avatar answered Oct 12 '22 22:10

gilla89