270

What is the difference between \par, \newline, \\ and blank lines?
When should I use which one?

5
  • 11
    Well, use \par when you want a new paragraph (and don't wan to insert a blank line for some reason, such as in macro/environment definitions), and use \\ in array and tabular. That's the rules I have been following. Commented Nov 14, 2012 at 0:57
  • 1
    @PeterGrill Thanks for the comment, what about \newline then?
    – zyy
    Commented Jan 25, 2021 at 2:46
  • 1
    @zyy: Hmm. I think that would make a good question as I don't use \newline much. I think the only place I use that is within the todonotes package macros (which are not part of the final document). Commented Jan 25, 2021 at 8:31
  • you may want to read TeX by topic, Sec. 2.9,
    – am70
    Commented Nov 23, 2022 at 17:37
  • See also David's comment on this -- if I understood correctly, ⟨blank line⟩\noindent mostly (except when \parskip is nonzero) works the same as \`, but \` is better semantically in case a new paragraph is not "intended".
    – user202729
    Commented Apr 11, 2023 at 14:31

2 Answers 2

238

\par is a TeX primitive and is the same as a blank line (except in special environments such as verbatim where the usual rules don't apply). It ends horizontal mode, causes TeX to break the horizontal text into lines placed on the current vertical list, and exercises the page breaker which may possibly cause the next page to be shipped out.

\\ is different in almost every respect. It is a macro not a primitive, and its definition changes wildly in almost every LaTeX definition. The definition in normal text, a center environment, a flushleft environment and a table are all different.

In normal running text when it forces a linebreak it is essentially a shorthand for \newline. This does not end horizontal mode or end the paragraph. It just inserts some glue and penalties at that point into the horizontal material, so that when the paragraph does end, a line-break will occur at that point, with the short line padded with white space.

\\ at the end of a paragraph causes bad output with an empty, maximally under-full, box, and so you get a warning about badness 10000, the visual effect looks a bit like extra vertical space but it is not: it is an extra spurious line at the end of the paragraph, and for example it is not dropped at a page break and will break widow/club line calculations.

You should rarely need to use \\ in documents apart from its use in alignments (where it is a macro based on the \cr primitive), and you should rarely need \par in documents as a blank line should suffice.

21
  • 28
    a consequence of using \\ instead of paragraph breaks is that (la)tex continues to load text into memory, and doesn't actually output anything until an actual paragraph break occurs. this may not be so important now, with memory capacity being so large, but when memory was a much more scarce resource, failing to use paragraph breaks was a sure way to run out of memory and crash the job before it finished. it will still slow down the processing when the "paragraphs" are very long. Commented May 2, 2014 at 1:39
  • 1
    @JonasStein hmm I would have said better to ask a new question but someone did that but it was closed as duplicate of this (not by me:-) so OK if you edit the question to ask about blank lines I'll add something here (basically they are the same as \par except in verbatim and other special cases) Commented Aug 29, 2016 at 5:40
  • 3
    @cfr \\ at the end of a paragraph causes spectacularly bad output with an empty, maximally underfull, box, and so you get a warning about badness 10000, if that is what you mean. I wouldn't say that \\ itself makes the warning, as that makes it sound like it is some kind of spurious warning and the warning itself is the issue. Commented Jul 9, 2018 at 6:54
  • 1
    \\ mid paragraph usually doesn't generate anything that will generate a warning it is \\ at the end of a paragraph forcing a line break after the last text in the paragraph so forcing the following line to be empty Commented Jul 9, 2018 at 22:25
  • 1
    @zyy it is best to dispel any miscomprehension that blank lines can be used for cosmetic "pretty print" fomatting of the source file, as they can in some languages. It is an explicit instruction to end a paragraph. Of the hundreds of thousands of example documents posted here for example, I do not see any where text is all on one line separated by \par, almost everyone uses the intended, natural, markup for end of paragraph, which is a blank line. Commented Oct 14, 2022 at 14:07
59

In text mode, \par starts a new paragraph, while \\ ends the current line.

So when to use each one?

\\ should be used with parsimony, when you want to break of the rhythm of your current argumentation, but without jumping to a new idea / argument (which would require starting a new paragraph).

\par should actually be used even less frequently. Not that you do not want to start new paragraphs (you do want to keep paragraphs to reasonable lengths!), but you should start new paragraphs by leaving an empty line in your TeX code. This has the exact same effect as using \par, but will make your code much more readable. \par is therefore mostly used when defining macros.


Note that outside of text mode, \par will usually lead to an error, while \\ usually works as expected to start a new line (like while in an tabular or array).

7
  • \` in text usually works except when it says ! LaTeX Error: There's no line here to end. (e.g., dual \` to produce two blank lines in a paragraph ... there are more reliable ways to do that.) [gosh — don't understand where that Commented Jan 12, 2015 at 20:04
  • 1
    the previous one by me showed my non-understanding of markdown (or whatever it is). i was trying to use backslashes, and the output was all to pot ... and in the allowed 5 minutes i couldn't sort the problem. must remember to keep my mouth shut in future... :-( Commented Jan 15, 2015 at 10:13
  • 3
    @wasteofspace to put a double backslash in code markdown you need to type backtick, dobule backslash, space, backtick. This yields \\ . I guess you comment above was meant to be «\\ in text usually works except when it says ! LaTeX Error: There's no line here to end. (e.g., dual \\ to produce two blank lines in a paragraph ... there are more reliable ways to do that.)», right?
    – MickG
    Commented May 29, 2015 at 9:49
  • Thanks for the answer, so your suggestion is to use blank lines as much as possible, and \` and \par` should only be used in environments or macro definition, is that right? What about \newline then?
    – zyy
    Commented Jan 25, 2021 at 2:49
  • 1
    @zyy a blank line is reported as \par so if you change the definiton of \par you change the definition of blank lines. There is no sense in which \par is more explicit. Blank line is the standard markup for end of paragraph in latex, the fact that \paralso works is an implementation detail. Commented May 20, 2022 at 14:22

You must log in to answer this question.

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