36

Here is the thing, I have always used a blank space between paragraphs in order to tell latex that there is a new paragraph. But there is someone I work with very often that keeps using \\ to break a line after a paragraph...

This is really annoying so I wanted to know if there is a real advantage of using \\ over just leaving a space.

Note that I am not referring to the paragraph environment, but to the simple term paragraph.

0

2 Answers 2

59

there is absolutely no advantage to using \\ to end a paragraph, and in fact, a big disadvantage -- it doesn't actually end the paragraph; it only goes to a new line, and probably triggers an underfull line report in the log.

there are only two ways to end a paragraph in "basic" text mode: a blank line, or \par. there are some (but few, and mostly obscure) situations in which \par shouldn't be used. but it definitely puts something "visible" in the file, and if you are sending a file using a mailer that swallows or "disappears" blank lines, then \par is safer.

never try to end a paragraph with \\!

8
  • 6
    Especially liked 'the dog (or email) ate my paragraphs'! Aug 9, 2012 at 19:20
  • 11
    It is not just a "huge disadvantage" it is plain wrong as it is not ending the paragraph (i.e., no indentation). It is often used by people who want to get an empty line after a paragraph, so they go \\ followed by an empty line -- there you end up with the underfull box so this is wrong as well. Aug 10, 2012 at 10:00
  • 8
    @User17670 it is wrong be cause you are using the visual result of one constrcut to produce the appearance of a different one. A paragraph logically ends with an empty line. How it is formatted is a question of style and if you prefee nonindented paras with some space between them, this could be adjusted simply by a declaration and wouldn't need \noindent in front of every para and \\ at its end. This way reusing your text is nearly impossible. Even just moving text around means adding and deleting such commands all over the place. Sep 1, 2012 at 8:16
  • 4
    @User17670 And yes, you can ignore errors or warnings if they do not hurt the visual result, but this also means that you will miss the real earrors or warnings in the noise. Why LaTeX if you aren't interested in using logical markup as a starting point (and do the formatting largely separately through style declarations)? do you think \indent 1) bla bla \par \indent 2) ... is a good replacemented for \begin{enumerate} \item ...? Because that is somewhat similar. Sep 1, 2012 at 8:20
  • 3
    @BrunoStonek -- not frank, but a suggestion: \vspace*{1\baselineskip} after the paragraph break. (the starred form will ensure that the blank space of that height persists even at the beginning of a new page.) Sep 6, 2012 at 17:56
16

It's quite strange that every beginner's guide to LaTeX tells as soon as possible that

paragraphs should be separated from each other by a blank line

but several people use \\ to finish up a paragraph.

It's possible that the influence of word processors governs the choice of those who use \\. The path seems to be like

  1. If I hit Return in the editor window for a LaTeX file, I don't get a new paragraph

  2. In word processors, a single operation (hitting Return) does the job

  3. Since \\ seems to make TeX go to a new line, let me use \\

This is wrong, as already pointed out. But why does TeX impose hitting Return twice, in order to end a paragraph?

There are good reasons for this, that I'll try to explain.

A (La)TeX file is pure text; text reflow and formatting takes place at a different stage than typing in the copy. Line endings and spaces are completely irrelevant because this eases maintenance of the document: we don't need to worry whether we add spaces or end lines in an irregular fashion. Editors will reflow the text, if this is wanted, but it's completely optional.

A blank line in the TeX file is a very clear marker of paragraph separation. Much clearer than the simple line ending and possible following indent in a word processor (which, I suspect, is the cause for many word processor documents that use vertical space between paragraphs). A TeX file is never to be considered an approximation of the output: it's just the container for our text, whose final form will be obtained by running (La)TeX over it.

Another reason is history. We shouldn't forget that word processors did not exist when TeX was being developed: its first release was in 1978. All one had at that time was essentially the same as the TeX model: a text file was postprocessed in order to get the final output. There were typewriters able to justify text: one had to input a line and then spaces in the line were adjusted to get justification. Another asynchronous system, which was later improved by using a buffer that could hold more copy than fitted a line and moving the excess to a new one.

Essentially the same model of these typewriters was introduced by word processors, with the advantage that text reflow was easier: the entire document could be entirely held in the buffer.

In the computing world, however, text files were the vast majority and the convention of separating paragraphs with a blank line predated TeX by several years. For pure text files, where line endings are not significant and simply mark separation between words, a blank line between paragraphs was the only feasible device.

TeXnical note. A blank line is the same as typing \par. So there is a single operation for ending a paragraph.

However, hitting Return twice is just two keystrokes and \par requires four. Moreover, the input file loses in clarity and ease of maintenance. If you want to merge two paragraphs into one, you just need to remove the blank line between them.

By the way, the same system is used on this site: paragraphs are ended with a blank line. One can type in two spaces and then hit Return
getting a new line, like here. Not the best markup, in my opinion.

5
  • 1
    \par requires five unless the next paragraph starts with a non-letter.
    – cfr
    Aug 2, 2017 at 13:02
  • @cfr A blank line requires two
    – egreg
    Aug 2, 2017 at 14:14
  • Yes .... \par requires five and a blank line requires two. And \par does, strictly speaking, require four. It just requires one more than four, so saying it requires four understates your case: it almost always requires five.
    – cfr
    Aug 2, 2017 at 16:10
  • @cfr If you don't count the end of line or space following \par, then a blank line requires just one action. However, \par should never appear in a document (apart from the preamble, if necessary in a definition).
    – egreg
    Aug 2, 2017 at 16:16
  • Yes, so it is two versus five or one versus four, but not two versus four. [Is there any actual reason \par shouldn't be used? Sometimes I use it because it makes the code more robust against later tidying. But you're writing as if I'm disagreeing with you, though I'm really not sure why.]
    – cfr
    Aug 2, 2017 at 16:25

You must log in to answer this question.

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