Text FormattingHow do I control spaces between lines?

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
joeschmidt
Posts: 4
Joined: Sat Jan 17, 2009 6:34 pm

How do I control spaces between lines?

Post by joeschmidt »

I have a \documentclass{article} and I want to be able to control the spacing between lines, although not a constant spacing between each line, just spacing where I need it. For example, when I output the document, everything is single-spaced, but I want some lines to have space between them and some to not have them. Is there a way to make it such that pressing "enter" after a line will create space between those lines?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: How do I control spaces between lines?

Post by localghost »

I'm afraid your request is not clear enough (for me). Please describe more precisely where you want the space exactly to appear (between paragraphs, list items, ...) and where not.


Best regards and welcome to the board
Thorsten¹
joeschmidt
Posts: 4
Joined: Sat Jan 17, 2009 6:34 pm

Re: How do I control spaces between lines?

Post by joeschmidt »

Sorry, here's what I need.
I have the following text:

sin(306)=-sin(54)
sin(234)=-sin(54)=-cos(36)
sin(162)=sin(18)
sin(90)=cos(0)

sin\theta - sin(54) - cos(36) + sin(18) + cos(0) = 0
sin18 - sin(54) - cos(36) + sin(18) + cos(0) = 0

However when I turn it into a pdf, it shows up like this.

sin(306)=-sin(54) sin(234)=-sin(54)=-
cos(36) sin(162)=sin(18) sin(90)=cos(0)
sin − sin(54) − cos(36) + sin(18) + cos(0) = 0sin18 − sin(54) − cos(36) +
sin(18) + cos(0) = 0

I cannot get spacing between lines, and I was wondering if it is possible to get spacing by pressing "enter". Basically I want to have the spacing that I put in appear in the project to be in the pdf, so if I press enter 5 times between paragraphs in the project, there will be 5 lines of blank space between those paragraphs in the pdf.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

How do I control spaces between lines?

Post by localghost »

I assume that you typeset this text as a mathematical expression and therefore use a suitable environment. Take this as an example.

Code: Select all

\begin{align*}
  \sin(306)&=-\sin(54) \\
  \sin(234)&=-\sin(54)=-\cos(36) \\
  \sin(162)&=\sin(18) \\
  \sin(90)&=\cos(0) \\[2\jot]
  \sin\theta - \sin(54) - \cos(36) + \sin(18) + \cos(0) &= 0 \\
  \sin18 - \sin(54) - \cos(36) + \sin(18) + \cos(0) &= 0
\end{align*}
Pay attention to the additional (optional) space at the end of the fourth line. The length \jot is the space that is inserted automatically between lines in math mode. Here we doubled it and separated the last lines a little bit from the first four. You can triple it by replacing the "2" with "3" (and so on). More useful information about typesetting complex mathematical expressions is available with the "Math mode" document.
Post Reply