15

I want to be sure that I understood this command as it was meant:

  • the `\linespread` command offers just two values: 1.6 (two blank lines) and 1.3 (1 1/2 blank lines)
  • set in the preamble, it affects the whole document
  • to limit this to just an area, I must use:
\linespread{value}\selectfont   % sets (new) value for extra vertical space between lines
text input words input text
\linespread{1}\selectfont   % resets to value set in preamble OR default level

So here my questions:

Is there a way to set, say, a value of 0.2 or negative values with this command, but without using extra packages?

I am right at the beginning of learning LaTeX, and want to stick to the basic commands and basic functions as long as I could before I start using packages, extensions, etc. All I could find up to now was packages, or workarounds that seem a bit far from where I am at the moment.

4
  • 7
    It's not a good strategy, IMO. Packages were born to fill a necessity. In the case of linespacing, there is setspace that does much more than simply modifying the interline skip. But please, don't enlarge your interline skip.
    – egreg
    Commented Jun 25, 2012 at 17:20
  • @egreg — Unless you're changing it by a small amount to accommodate your specific choice in font. E.g., 5%–10% more for Palatino. Commented Jun 26, 2012 at 4:17
  • @WillRobertson That's not "enlarging", but rather "adjusting". :) You're right, I should have said it in a better way.
    – egreg
    Commented Jun 26, 2012 at 8:30
  • @egreg — I knew you knew that; just wanted to clarify for others :) Commented Jun 27, 2012 at 2:04

2 Answers 2

22

You are mistaken (and I have no idea where you got the information that \linespread only supports those two values) it supports any value (but not every value makes sense). As mentioned by @egreg there is usually more to adjust than just a linespread and packages bundle this kind of work for you and provide adequate interfaces.

However, to understand how things work, consider the following small little document and look at its result:

\documentclass{article}

\newcommand\test[1]{\linespread{#1}\selectfont
This paragraph uses linespread=#1:
Some text to try out the result of linespread. A little more to have a least three lines on this measure. 
Finish off with a paragraph end so that linebreaking happens.\par\bigskip}

\begin{document}

\test{1}
\test{2}

\linespread{1}\selectfont % reset

{\itshape Going very small means that the baselineskip might become smaller than the text height, but by default a different mechanism will then kick in and keep the lines apart by a minimum of \verb=\lineskip= so nothing overlaps here not even with -1.}

\bigskip

\test{0.5}
\test{0.1}
\test{-1}

{\itshape But if we disable \LaTeX{} setting that keeps lines apart then we get overlaps. Or even a reversal of lines.}

\setlength\lineskiplimit{-1000pt} % allow boxes to overlap by this much

\bigskip

\test{0.5}

\vspace{1cm} % extra space to see what's happening

\test{0.1}

\vspace{1.5cm} % extra space to see what's happening

\test{-1}  % this is now reversed
\end{document}

If you run this you will get:

enter image description here

The result of the negative value (and already the small values) is funny, but one needs to realize what happens here: The typesetting position is at the baseline of the last text line of the paragraph when it is finished, which is not the bottom line of the page. This is the reason why I had to add these extra \vspace commands to jump over text already typeset so this is not really useful at all.

4
  • this helped a lot! Just one thing: I can't get to negative values. As far as I understand it, I can't get below a level of 0.8. According to the calculating sceme, where the value is based upon the font size level and the distance between baselines (fontsize:10pt baselineskip:12pt thus: ratio:1.2), this should be the limit (-20%; i.e. 0.8). Is there a way to go beyond this level or is this the limit. As far as I understand your very helpful .tex file, you define a 'custom command' and alter the value. Is there a way to do this with line-spread itself or just with such a workaround?
    – el_olmo
    Commented Jun 26, 2012 at 16:17
  • The custom command is only there to save me typing things. As you can see it only sets the \linespread, then displays its value and some text to make the trial. Instead of the command you could just do it directly in the text. As to the negative values: Read the text in the example. TEX is not getting the lines closer than \lineskiplimit. So only when you change that value (which I did half way through the example) negative values have an effect. But be aware of what this means! (last part of my answer). Commented Jun 26, 2012 at 17:30
  • the \lineskiplimit did all the magic. I must have overread this (quite some times).
    – el_olmo
    Commented Jun 26, 2012 at 17:59
  • If this (or another) answer solved your question then you should consider checkmarking it to indicate the your question is answered (also on other questions you posed). Commented Jun 26, 2012 at 18:39
8

Here is some information regarding \linespread, taken verbatim from Why doesn’t \linespread work?:

The command \linespread{<factor>} is supposed to multiply the current \baselineskip by <factor>; but, to all appearances, it doesn’t.

In fact, the command is equivalent to \renewcommand{\baselinestretch}{<factor>}: written that way, it somehow feels less surprising that the effect isn’t immediate. The \baselinestretch factor is only used when a font is selected; a mere change of \baselinestretch doesn’t change the font, any more than does the command \fontsize{<size>}{<baselineskip>} — you have to follow either command with \selectfont. So:

\fontsize{10}{12}%
\selectfont

or:

\linespread{1.2}%
\selectfont

Of course, a package such as setspace, whose job is to manage the baseline, will deal with all this stuff — see “managing double-spaced documents”. If you want to avoid setspace, beware the behaviour of \linespread changes within a paragraph: read “\baselineskip is a paragraph parameter”.

The last comment refers to the fact that TeX actually sets lines/sentences by first assembling all the text of a paragraph and then breaking it into lines. So, sometimes, changing things like \baselineskip or \linespread only has effect for a paragraph an not a line.

In specific "answer" to your bullets:

  • No, \linespread takes any factor, not just 1.6 or 1.3 or 1. I'm not sure what the benefit would be in using very small or negative values for \linespread.
  • True.
  • Or you can use grouping via braces { ... } or \begingroup ... \endgroup.

Regarding packages in general: It is actually a good idea to use them (if allowed), since they provide interfaces to changing things without having to worry about the nitty-gritty. Moreover, it leaves your code clean and readable.

Finally, I would suggest reading through setspace.sty and see how much is done in the background to maintain consistency in the document. Also see Why is the \linespread factor as it is? for more on the intricacies associated with \linespread in different document font sizes.

5
  • 3
    As you say \linespread really works on paragraph-level. The important point to note here is that in turn the \baselinskip for a paragraph is only determined when the \par (or empty line) is seen. This means that when using {...} one has to make sure that the paragraph is finished before the brace is closed. Commented Jun 25, 2012 at 17:42
  • You say "I'm not sure what the benefit would be in using very small or negative values for \linespread" — the answer to this is that fonts with large x-heights need more leading than fonts with small x-heights. E.g., I highly recommend \usepackage{mathpazo} to be followed by \linespread{1.1} (or a little less). Commented Jun 26, 2012 at 4:16
  • @Will but that is not small or negative values, that is small or negative adjustments :-). Small values means you overprint (or they do not have an effect when \lineskiplimit prevents things from happening) and negative values mean that your typesetting direction is actually reversed but not in a useful way. Commented Jun 26, 2012 at 17:33
  • @FrankMittelbach — Oops, I misread! Need to go back to English class. Thanks :) Commented Jun 27, 2012 at 2:05
  • This might be interesting to discuss, it's taken from LaTeX Beginner's Guide, "For Palatino, a slightly higher line of spacing is recommended. So, a typical way to load Palatino together with Paso is... \linespread{1.05}
    – user12711
    Commented Mar 26, 2015 at 17:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .