0

I want to end a paragraph with a blank line and start a new paragraph.

When I use

first paragraph\\

second paragraph

I get an underfull hbox error.

When I use

first paragraph\par

second paragraph

It doesn't insert a blank line.

How do I do this correctly?

stimulate
  • 107
  • 2
    What do you mean "end a paragraph with a blank line"? A paragraph is a block of text. Do you want a blank line after the paragraph ends? Are you really wanting to have a bit more separation between your paragraphs? – Teepeemm Sep 16 '23 at 14:31
  • @Teepeemm yes I want to separate two paragraphs with a blank line – stimulate Sep 16 '23 at 14:33
  • 3
    And do you want the first line of each paragraph to get indented or not? – José Carlos Santos Sep 16 '23 at 14:40
  • 4
    Please post a complete example. Are you using LaTeX? If so, does parskip do what you want? (Depends on your answer to @JoséCarlosSantos, probably.) – cfr Sep 16 '23 at 14:47
  • @JoséCarlosSantos I know about \noindent. parskip doesn't seem to do the trick. – stimulate Sep 16 '23 at 14:53
  • 3
    You can always use \bigskip or \vspace{30pt} or similar to have a certain amount of white space. If you want to have the same amount of white space after each paragraph, as already mentioned, \parskip is the way to go. // See e.g. here: https://en.wikibooks.org/wiki/LaTeX/Paragraph_Formatting#Paragraph_indent . – MS-SPO Sep 16 '23 at 15:01
  • 1
    @MS-SPO ah, now the parskip package works.. for some reason it didn't work earlier, maybe I didn't reload it correctly – stimulate Sep 16 '23 at 15:12
  • 3
    Fine. However, \parskip is a length defined inside Latex, not a package. That said ... https://ctan.org/pkg/parskip ... but just use the length. // That's why we don't stop ASKING for complete MWE's ... ;-) – MS-SPO Sep 16 '23 at 15:15
  • 1
    @MS-SPO there is a parskip package, but that seems to insert the \parskip length at every blank line in the tex file or something like that. I am now going with setting the \parskip length aswell, without the package. – stimulate Sep 16 '23 at 15:17
  • Well, a blank in the tex file is a paragraph break, so you should expect a \parskip length at that point. If you're getting \parskip where you think you shouldn't, then show us an example and we can talk about it. – Teepeemm Sep 16 '23 at 15:32
  • 1
    https://tex.stackexchange.com/questions/334246/what-does-the-phrase-underfull-hbox-badness-10000-in-paragraph-actually-mea/334249#334249 – David Carlisle Sep 16 '23 at 16:28
  • 1
    It's simply wrong to end a paragramp with \\. See When to use \par and when \\ for more information Iand likely duplicate), If you want an actual blank line, after a blank line in the input, add \vspace{\baselineskip} and then another blank line. – barbara beeton Sep 16 '23 at 18:16
  • @barbarabeeton whats weird is that this is how it is usually taught all over the internet. Even the overleaf tutorial for linebreaks uses it as the top recommendation https://de.overleaf.com/learn/latex/Line_breaks_and_blank_spaces Its all very confusing and frustrating, as it is a very common and supposedly "simple" operation. – stimulate Sep 16 '23 at 18:40
  • 1
    @stimulate -- Thanks for the pointer to the Overleaf tutorial. The information it gives is technically accurate, but woefully incomplete -- it should first introduce the concept of correct paragraph breaks, and only then introduce the exceptions. I'll complain. In the meantime, take a look at the paper I wrote for TUG'23 on "What every (La)TeX newbie should know" (https://tug.org/members/TUGboat/tb44-2/tb137beeton-basic.pdf). I think it's not restricted, but if it is, please ping me with another comment. – barbara beeton Sep 16 '23 at 20:22
  • @barbarabeeton I get a request for a username and password so it is restricted. But thanks for all the great help on the ecosystem! – stimulate Sep 17 '23 at 16:33
  • @stimulate -- If you send me email (tnt (at) tug (dot) org) I'll send you a pdf copy. – barbara beeton Sep 17 '23 at 17:13
  • @barbarabeeton can't seem to send it to you, but its fine for now. I think I will find my way around. – stimulate Sep 17 '23 at 17:26
  • 1
    @stimulate -- Ugh. Somehow I typed it wrong. (My laptop and I are having a "misunderstanding".) The first part should be my initials, bnb . Sorry about that. The slides fro my talk might also be interesting (https://tug.org/tug2023/files/fr-04-beeton-newbie/beeton-newbie-slides.pdf) but the paper is organized better. – barbara beeton Sep 17 '23 at 22:45
  • @barbarabeeton thank you! – stimulate Sep 18 '23 at 00:53

1 Answers1

9

LaTeX separates paragraphs every time you add at least one empty line between texts. Then, how paragraphs are formatted depends on you. Here's a good helpful website: How to change paragraph spacing in LaTeX.

The length name \parskip controls extra spacing between all paragraphs in the document. In standard classes, it is set to 0pt meaning no extra spacing is issued. For instance,

\setlength\parskip{6pt}

would cause LaTeX to add a distance of 6pt between all paragraphs.

If you read through the website, you will come across the name \baselineskip, which hold a distance between two baselines. Therefore, \setlength\parskip{\baselineskip} would separate paragraphs exactly by one empty line.

The macros \smallskip, \medskip, and \bigskip also add extra space in the place of issue but are meant for rather one-time usage. The amount of extra space they insert is held in three length names: \smallskipamount, \mdeskipamount and \bigskipamount. You could also use any of the names to insert \<xxx>skip between all paragraphs. For instance

\setlength\parskip{\bigskipamopunt}

would again add one empty line between all paragraphs.

Here's a small MWE to test paragraph skips:

\documentclass{article}
\usepackage{blindtext}

\setlength\parskip{\baselineskip}

\begin{document} \Blinddocument \end{document}

EDIT. BTW, \\ is not a correct way to separate paragraphs. Use either \par or empty lines (which are converted to \par).

For an arbitrary skip, insert \vspace{<length>} where <length> is a unit length s.a. 12pt, 1cm, 3em or 2ex etc. (*). However, this macro will work between paragraphs. In order to add skip at the beginning of a document e.g. before the title, or at the top of a new page you should use a starred version \vspace*{<length>} (thanks for pointing at details in comments).

(*) Keep in mind there are fixed and relative unit lengths, some of which are consider horizontal and the other vertical (thanks to bring this in comments). I found a couple of answers which may help you to understand it e.g. check this answer and this answer.

Celdor
  • 9,058
  • 1
    Two suggested adjustments: 1) \vspace* also persists after a page break. 2) em is really a horizontal measure; ex is the corresponding (although not equal in distance) vertical measure. – barbara beeton Sep 16 '23 at 20:57
  • @barbarabeeton thanks for the suggestions. I added details to the answer. – Celdor Sep 17 '23 at 06:54