0

Several times I have seen this advice (or words to this effect): "Never use \\ to break lines outside special contexts such as tabular." (for example, Pass a 's' (star) parameter to a macro). I cannot find a source for this advice.

Indeed, "The LaTeX Companion" (page 104) has this:

"Other ways of typesetting paragraphs are flush right and centered, with the flushright and center environments, respectively. In these cases the line breaks are usually indicated with the \\ command, whereas for ragged-right text (the flushleft environment discussed above) you can let LaTeX do the line breaking itself (if you are happy with the resulting quality)."

Moreover, instances of the use of \\ to format paragraphs are legion. Why is this use of \\ ill-advised?

Torbjørn T.
  • 206,688
sgmoye
  • 8,586
  • 3
    But \\ doesn't create a new paragraph, it creates a newline. – Bernard Aug 02 '17 at 12:44
  • I think that goes without saying, or at least ought to do. – sgmoye Aug 02 '17 at 12:48
  • 3
  • Probably related: https://tex.stackexchange.com/questions/82664/when-to-use-par-and-when-or-blank-lines https://tex.stackexchange.com/questions/66495/best-choice-between-using-or-leaving-space-after-each-paragraph-to-end-the-pa – Torbjørn T. Aug 02 '17 at 12:51
  • 2
    The question asks about using it to format paragraphs, but in the comment above you say you know it doesn't create a new paragraph. If the question is about paragraphs, it is probably a duplicate of one of the questions linked above. If it is not about paragraphs, it needs to be clarified to say what it is about. – cfr Aug 02 '17 at 13:05
  • 1
    One of the interactions I didn't understand as a newbie was how the last fontsize active at the end of a paragraph defined the parameters for the whole paragraph, in spite of any \ that would otherwise occur. It was very non-intuitive. \documentclass{article} \begin{document} \parbox{3in}{\normalsize This\\ \Huge is a test\\ \normalsize of the emergency\\ \tiny broadcast system}\qquad \parbox{3in}{\normalsize This\\ \Huge is a test\\ \normalsize of the emergency\\ \tiny broadcast system\normalsize} \end{document} – Steven B. Segletes Aug 02 '17 at 13:09
  • If you change the \ to \par in my above MWE, you will see the first 3 lines of the two examples are spaced identically (only the last is affected). My example is more about fontsizes than \, but a lack of understanding on how \ works can definitely lead to unexpected results. – Steven B. Segletes Aug 02 '17 at 13:12
  • 2
    it isn't that using \\ to end a paragraph is ill-advised, it is just that it does not end a paragraph, so if you want to end a paragraph you need to do something else (leave a blank line normally) – David Carlisle Aug 02 '17 at 13:19
  • 1
    flushright and center (and verse) are special contexts. They are environments which are often used when you want to manually break lines e.g. in a title to get a pleasing result. It is outside of such special context that you should avoid \\ as you almost want a paragraph break instead in such places. – Ulrike Fischer Aug 02 '17 at 13:19

0 Answers0