1

I know 2 options to break the line.

Option 1:

Abcdef\\
Ghijkl

Result:

Abcdef
Ghijkl

Option 2:

Abcdef

Ghijkl

Result:

Abcdef
  Ghijkl

Are there any rules when to use which?

PS: I'm using scrreprt as my document class.

  • There's also \newline and \linebreak by the way. See What is the difference between \newline and \? and also this page: Line breaks and blank spaces and the related Reference guide – Alenanno Jun 18 '15 at 23:08
  • 1
    Short answer: never use Option 1 in the regular body of your document. Use it to end the row in a tabular or align environment, for example, but not to start a new line in the main text. – cfr Jun 18 '15 at 23:11
  • \ fills the rest of the current line with white space, so LaTeX cannot fit anything else there. An blank line in your source tells LaTeX to start a new paragraph. – onewhaleid Jun 18 '15 at 23:17
  • For option 2, you should add \noindent \ unless you do want some indentation. – Bernard Jun 19 '15 at 00:04
  • This is surely a duplicate? @Bernard Usually, you shouldn't need to. If you are doing that at all often, there is something wrong with your mark up. (There is often something wrong with mine, but that just confirms the point. :() – cfr Jun 19 '15 at 00:12
  • Related: http://tex.stackexchange.com/questions/82664/when-to-use-par-and-when, comments on http://tex.stackexchange.com/questions/240938/new-line-line-breaking-a-definitive-answer?rq=1. – cfr Jun 19 '15 at 00:17
  • @cfr: I (almost) never do that. But the O.P. might want to insert a blank line for readibility of the source-code. I think I didn't get exactly what the question was. Btw, the O.P. forgot to mention \endgraf. Under some some circumstances, it works, while a blank and \ generate a complaint from the compiler. – Bernard Jun 19 '15 at 00:48
  • @Bernard Thanks. No. I think maybe *I* didn't get what the question was. I didn't realise this was about source code.... – cfr Jun 19 '15 at 00:54
  • Write \parindent0pt\parskip0pt before and you will see the same effect in both cases. Then try with \parindent1em\parskip1em and you will understand why is not the same use a line break that a new paragraph. – Fran Jun 19 '15 at 07:04
  • @cfr So what would you use in the main body? \newline or \linebreak? – Alenanno Jun 19 '15 at 16:14
  • @Alenanno Neither. I'd leave a blank line. If I want additional space before the next paragraph, I use something like \smallskip or, if really necessary, \vskip. But I wouldn't use those when writing something like a paper - only for something like teaching materials or a handout. – cfr Jun 19 '15 at 16:38
  • @Fran They are still not equivalent, though. Even in that case. – cfr Jun 19 '15 at 16:40
  • @cfr Oh interesting. – Alenanno Jun 19 '15 at 16:41
  • @cfr Of course, I did not tried to show that \ and \par could be equivalent, on the contrary, that under certain conditions \par could look like a linebreak but really have a very different purpose. – Fran Jun 20 '15 at 21:53

0 Answers0