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.

I am using floats throughout the text perhaps this messes with spacing. It seems such an easy thing to adjust, yet I find no answer.

share|improve this question
2  
I've supplied a generic answer to your problem addressing lengths between text elements and headings/floats. You need to provide more detail in order to obtain an adequate solution. For example, what document class are you using? You mention both floats and headings; is this correct? Perhaps you can include an image of the desired and current output to highlight your problem. See How can I upload an image to be included in a question or answer? –  Werner Nov 25 '12 at 18:00
add comment

1 Answer

As a general guide, the layouts documentation provides the different lengths associated with various elements within a document.

Section layout:

In the default LaTeX document classes (article, book and report), sections are set using \@startsection. Here's a take with some description of when each argument means if you wish to change \subsubsection, say (taken directly from the layouts documentation):

\makeatletter
\renewcommand{\subsubsection}{\@startsection%
  {subsubsection}% name
  {3}% level
  {0mm}% indent
  {-\baselineskip}% beforeskip
  {0.5\baselineskip}% afterskip
  {\large\itshape}}% style
\makeatother

A visual representation of the length locations/usage within the context of the heading (two different types, depending on whether afterskip is positive/negative ~ display/run-in):

enter image description here

There's also the titlesec and sectsty packages that could help in adjusting these values.

Floats layout:

Lengths affecting the location of textual content with respect to floats are \floatsep, \textfloatsep and \intextsep. Their default values, as set in latex.ltx, are:

\newskip\floatsep
\newskip\textfloatsep
\newskip\intextsep
\setlength\floatsep    {12\p@ \@plus 2\p@ \@minus 2\p@}% 12pt plus 2pt minus 2pt
\setlength\textfloatsep{20\p@ \@plus 2\p@ \@minus 4\p@}% 20pt plus 2pt minus 4pt
\setlength\intextsep   {12\p@ \@plus 2\p@ \@minus 2\p@}% 12pt plus 2pt minus 2pt

A visual representation of their locationa amongst other document elements are given in Figure 13:

enter image description here

You can modify this in the preamble of your LyX document. For example, adding

\setlength{\textfloatsep}{\baselineskip}

would fix the separation between top/bottom floats to a line of text.


Note that all these modifications, if applied, will have a global effect on your document. This is a good thing, for the sake of consistency. However, manual modifications are also possible (not recommended), and should be left until the end of your document production.

share|improve this answer
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.