There are two different ways to change line spacing in LaTeX. One is simpler, the other requires a package, but is more flexible.
Let’s start easy.
The linespread-command:
To change the line spacing for the entire document, you can use the linespread
command in your preamble:
\linespread{<factor>}
The factor
is somewhat confusing. For double-spacing you have to use 1.6
and for one-and-a-half spacing 1.3. Not very intuitive, but I’m sure there is a reason for it.
The setspace-package:
Personally, I prefer the setspace
package, which is more straight forward in usage, provides more flexibility and is easy to use as well:
\usepackage{setspace} \singlespacing \onehalfspacing \doublespacing \setstretch{<factor>} % for custom spacing
You can change spacing back and forth within your document using the commands above.
However, in order to stay on top of things, it’s usually better using an environment to change vertical spacing locally.
\begin{doublespace} ... \end{doublespace}
or
\begin{spacing}{2.0} ... \end{spacing}
Finally, the package provides improved vertical spacing on top and below of itemize
and quote
environments, for any other than single-space content:
\usepackage{setspace} \doublespacing ... \begin{singlespace*} \begin{quote} Quote \end{quote} \end{singlespace*}
And that’s the difference:
The package is documented within the style-file
Ole J. Forsberg, Ph.D.
Thank you. I use this package all of the time. I did not, however, know about the asterisk options. Thanks.
N.N.
I was curious about why the \linespread factor is as it is so I asked a question: http://tex.stackexchange.com/questions/30073/why-is-the-linespread-factor-as-it-is
tom
Cool, thanks :-). Tom.
Vadim
You have a misprint:
\setstrech{}
should be\setstretch{}
.Thanks for post, it was useful.
tom
Thanks for letting me know. I corrected it. Best, Tom.
Latex page, line and font settings « LaTeX Matters
[…] see my previous post on that topic for more details on line […]
Luís Martins
Hello. I noticed that \usepackage{setspace}
\onehalfspacing (in my case) is in conflict with hyperref package. In my case when I add a footnote, the hyperlink send me to the wrong page. Beyond that it’s very useful| Thank you!
tom
Hi there!
Thanks for your comment. I am not aware of any conflict between the
setspace
andhyperref
packages and footnotes. Make sure you always loadhyperref
as the last package. Would you mind to send a minimal working example that illustrates your issue.Best, Tom.
Luís Martins
Hi. After some trials I found the conflict and I solved it. You’re right. When I loaded hyperref as the last package the file was successfully compiled. Thank you!
Sean Allred (@vermiculus)
Sorry to dredge up an old post, but it may be interesting to note that a `linespread=1.618` is almost *exactly* double-spacing. Does this ratio look familiar to you? 😉
tom
Thanks, I didn’t realize it while writing the post.
r
Thanks a lot for the post.
Zeeshan Shareef
How can I set the 16pt line spacing using \setstretch while my font size is 12pt.
Thanks
tom
To change the default line spacing, use:
Cheers, Tom
asghar khosh-jamal
I want generate space between twoo footnotes. if we use \setlength or \vspace, it effect on sections and other body text. I dont want it. I want only vertical space between two footnetes. please help me.
thanks
tom
Hi there,
By changing
\footnotesep
, you can add extra vertical space between footnotes. Here is an example:Instead of
\baselineskip
, you could also use a number (e.g.10pt
). See the answer to a similar question here for more details.HTH,
Tom
Abhiram Chandrashekhar
Miktex package manager doesn’t have the setspace.sty, what is the alternate way of getting it?
tom
Hi Abhiram,
You can download it here on CTAN and place it in your main project directory. If you’d like to permanently install it, follow the guide here.
HTH,
Tom
Sumukh Desu
I am using setspace package with the fontsize. For a particular group of text I am using \fontsize and setting to a size(say 8pt) different from the document fontsize(say 12pt) but the spacing between the text is still being rendered with respect to the document’s fontsize hence I am using \setstretch which gives me a spacing of 0 but sets the fontsize back to the document fontsize.
tom
I’m having a hard time to understand what the problem is and to reproduce what you describe. Please provide a minimal working example and I’ll be very happy to help.
Best,
Tom
Sumukh Desu
I’m hoping this should clear things out. So when I use \setstretch, the font size goes back to 12pt but if I comment \setstretch, the fontsize works fine but there is a problem with the line spacing.
Thanks,
Sumukh
tom
Hi Sumukh,
Thanks for the example. Below is another approach that produces the different font sizes correctly. Let me know if this is not what you were looking for.
Best, Tom.
Sumukh Desu
It works perfectly fine.
Thank you Tom.