2

I understand that using \\ is not a good idea. It's better to use just the "enter" key or the \par command. Anyway, I don't like what I get. I would like to have a blank line between two pieces of text all over my text, where I want. Something like this:

...some text here.

Some othe text here...

I noticed that \par~\par does the job. Is a good practice to use this? I was also wondering if I can define my own command as follows:

\newcommand{\nl}{\par~\par}

so that I can use \nl at the end of the text.

Is this good or there are some pitfalls here?

  • 2
    This is a very bad way to go. Look instead at the parskip package. – jon Apr 28 '15 at 20:15
  • 1
    Most definitely not good. If you want to signal a paragraph break in the typeset ouput with an empty line instead of indentation, have a look to the parskip package or equivalent options provided by certain "heavyweight" document classes. (Edit: ninja'd by jon... :-)) – Paul Gessler Apr 28 '15 at 20:16
  • 2
    Ha, by like two seconds.... – jon Apr 28 '15 at 20:19
  • I don't get any "badness" warnings from the compiler. So why not? What is the problem? I want to understand please. – the_candyman Apr 28 '15 at 20:20
  • 2
    Think about what will happen if this "paragraph" falls at a page break, for one: you'll get extra space at either the bottom or the top of the page. – Paul Gessler Apr 28 '15 at 20:22
  • 3
    It's an example of 'ad hoc' markup, which is totally unmaintainable in general. If you want a 'global' design setting, use a command in the preamble and then input the document as you normally would. The parskip package fills that need in your case. – jon Apr 28 '15 at 20:23
  • Note that if you need this between certain text blocks but not all paragraphs, rather than using parskip, you can put e.g. \smallskip, \medskip or \bigskip before the blank line (or \par) to insert extra spacing. This is much better than \par~\par but should nonetheless be used with caution since it is less maintainable and makes it harder to achieve consistent formatting. – cfr Apr 28 '15 at 23:10
  • Thank you very much for the answer in Math.SE. – Sebastiano Sep 29 '20 at 10:03

1 Answers1

2

TeX excels at laying out a page with well-formed paragraphs, so let the program do what it does best. Leave a blank line between paragraphs in your source code. TeX interprets the blank line as a \par instruction, so you don't need to write that command explicitly. The \\ command is simply not intended for use in ordinary text; instead it is used in tabular and verse environments, among others.

If you want to use white space as an occasional section break, then you could define \newcommand{\sectionbreak}{\vspace*{\baselineskip}} in the preamble and then just write \sectionbreak in the document where you need it. (You can also use larger values like 2\baselineskip or you could use the commands \smallskip, \medskip, or \bigskip.)

...end of paragraph.

\sectionbreak

Next paragraph...

If you want white space between every paragraph as part of the design of your document, then really you want to increase the value of \parskip, but doing that manually can cause problems because TeX relies on there being a certain amount of "glue" to adjust between vertically stacked boxes in order to lay out the page. Instead, you can simply write \usepackage{parskip} and the package will adjust the values properly. In the memoir class, there is a \nonzeroparskip command that does something similar.

In a least-optimal scenario (because it doesn't separate content from presentation and locks you into a particular layout), if you have a short series of text lines which you would like separated by white space, you can use a tabular environment. You can use \\[1ex] at the end of the line to get an extra blank line. (With the booktabs package you can just write \addlinespace.)

\begin{tabular}{l} 
First line\\[1ex] 
Second line\\ 
\end{tabular}
musarithmia
  • 12,463