Next: , Previous: , Up: Layout   [Contents][Index]


5.6 \baselineskip & \baselinestretch

The \baselineskip is a rubber length (see Lengths). It gives the leading, the normal distance between lines in a paragraph, from baseline to baseline.

Ordinarily document authors do not directly change \baselineskip while writing. Instead, it is set by the low level font selection command \fontsize (see low level font commands fontsize). The \baselineskip’s value is reset every time a font change happens and so any direct change to \baselineskip would vanish the next time there was a font switch. For how to influence line spacing, see the discussion of \baselinestretch below.

Usually, a font’s size and baseline skip is assigned by the font designer. These numbers are nominal in the sense that if, for instance, a font’s style file has the command \fontsize{10pt}{12pt} then that does not mean that the characters in the font are 10pt tall; for instance, parentheses and accented capitals may be taller. Nor does it mean that if the lines are spaced less than 12pt apart then they risk touching. Rather these numbers are typographic judgements. (Often, the \baselineskip is about twenty percent larger than the font size.)

The \baselineskip is not a property of each line but of the entire paragraph. As a result, large text in the middle of a paragraph, such as a single {\Huge Q}, will be squashed into its line. TeX will make sure it doesn’t scrape up against the line above but won’t change the \baselineskip for that one line to make extra room above. For the fix, use a \strut (see \strut).

The value of \baselineskip that TeX uses for the paragraph is the value in effect at the blank line or command that ends the paragraph unit. So if a document contains this paragraph then its lines will be scrunched together, compared to lines in surrounding paragraphs.

Many people see a page break between text and a displayed equation as 
bad style, so in effect the display is part of the paragraph.
Because this display is in footnotesize, the entire paragraph has the
baseline spacing matching that size.
{\footnotesize $$a+b = c$$}

The process for making paragraphs is that when a new line is added, if the depth of the previous line plus the height of the new line is less than \baselineskip then TeX inserts vertical glue to make up the difference. There are two fine points. The first is that if the lines would be too close together, closer than \lineskiplimit, then TeX instead uses \lineskip as the interline glue. The second is that TeX doesn’t actually use the depth of the previous line. Instead it uses \prevdepth, which usually contains that depth. But at the beginning of the paragraph (or any vertical list) or just after a rule, \prevdepth has the value -1000pt and this special value tells TeX not to insert any interline glue at the paragraph start.

In the standard classes \lineskiplimit is 0pt and \lineskip is 1pt. By the prior paragraph then, the distance between lines can approach zero but if it becomes zero (or less than zero) then the lines jump to 1pt apart.

Sometimes authors must, for editing purposes, put the document in double space or one-and-a-half space. The right way to influence the interline distance is via \baselinestretch. It scales \baselineskip, and has a default value of 1.0. It is a command, not a length, so change the scale factor as in \renewcommand{\baselinestretch}{1.5}\selectfont.

The most straightforward way to change the line spacing for an entire document is to put \linespread{factor} in the preamble. For double spacing, take factor to be 1.6 and for one-and-a-half spacing use 1.3. These number are rough: for instance, since the \baselineskip is about 1.2 times the font size, multiplying by 1.6 gives a font size to baseline ratio of about 2. (The \linespread command is defined as \renewcommand{\baselinestretch}{factor} so it won’t take effect until a font setting happens. But that always takes place at the start of a document, so there you don’t need to follow it with \selectfont.)

A simpler approach is the setspace package. The basic example:

\usepackage{setspace}
\doublespacing  % or \onehalfspacing for 1.5

In the preamble these will start the document off with that sizing. But you can also use these declarations in the document body to change the spacing from that point forward, and consequently there is \singlespacing to return the spacing to normal. In the document body, a better practice than using the declarations is to use environments, such as \begin{doublespace} ... \end{doublespace}. The package also has commands to do arbitrary spacing: \setstretch{factor} and \begin{spacing}{factor} ... \end{spacing}.


Unofficial LaTeX2e reference manual