110

Possible Duplicate:
Is there an easy way to have my whole document with a space between paragraphs rather than indentation?

Googling didn't give required results. (Many, but not applicable or code doesn't work)

Essentially, what I want to do is the same formatting I just did with this question.

What I use at the moment is \\\\. Being from developers' circle I tend to deal with all kinds of warning. These four slashes give me badboxes. How to produce exactly same correct formatting I just did now with this text.

I appreciate your help.

UPDATE:

I upvoted all the answers, thanks for the contribution. All of your examples work. It seems for two years I never left two empty spaces to break the text...

Aubergine
  • 1,609
  • 2
    Somehow I think we are missing a few things as you seem to reference something "this question" "this text" but without links to them. A MWE may be of some help here. – ArTourter Mar 24 '12 at 00:54
  • 2
    Do you mean "end a paragraph and start a new one with some space in between"? – cgnieder Mar 24 '12 at 00:54
  • I don't miss anything. Can you see this question? This question is this question with four empty lines - I refer to the formatting of this question, I need to represent exactly the same. – Aubergine Mar 24 '12 at 00:58
  • 6
    If you just leave a blank line between paragraphs that will start a new paragraph. If it does not for you, please compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages. – Peter Grill Mar 24 '12 at 01:03
  • @percusse: Why did you edit \\\\ to \\\\\\\\? – hpekristiansen Mar 24 '12 at 01:10
  • Ok \ is not escape in inline code. – hpekristiansen Mar 24 '12 at 01:12
  • @percusse: No, the original sources just did not contain the backticks I have put in. – krlmlr Mar 24 '12 at 01:12
  • I will take a note of that , thanks ;-) – Aubergine Mar 24 '12 at 01:16
  • @Aubergine: You are right about the steep learning curve. But I must admit that I don't really understand what you want to achieve. – krlmlr Mar 24 '12 at 01:18
  • What going on in my comment to @percusse - \ is being eaten by the back tick. TEST 1:\ 2:\\ 3:\\\ 4:\\\\ – hpekristiansen Mar 24 '12 at 01:18
  • @percusse: http://tex.stackexchange.com/revisions/49188/2 – krlmlr Mar 24 '12 at 01:21
  • 1
    Please see the updated question, what I tried for long time is reinvent the wheel. Sins of 'word' I guess. Anyway I got bunch of good solutions which I will keep record of. – Aubergine Mar 24 '12 at 01:21
  • @percusse: Like this tick char: ` !? But it is not still a bit strange, that the first tick disappears from a string like tbbbt (t=tick and b=backslach)? – hpekristiansen Mar 24 '12 at 01:27
  • 2
    @Aubergine: This renders my answer rather irrelevant for the question, please consider accepting Peter's answer instead. – krlmlr Mar 24 '12 at 01:30
  • @percusse: How is bbbb written? - I can not see it in the question edits. Test: \\ – hpekristiansen Mar 24 '12 at 01:34
  • Ok, however I am still puzzled what is the actual use case of \ if we can just skip two spaces? – Aubergine Mar 24 '12 at 01:34
  • @Hans-PeterE.Kristiansen and Aubergine I would humbly invite you to the chat room for further discussion :) We are really contaminating here. – percusse Mar 24 '12 at 01:37
  • If you want to have a free line between two specific paragraphs and not all, this helps: Paragraph (newline) {\ } % this creates an empty paragraph (newline) Paragraph – Someone Jan 05 '24 at 10:12

3 Answers3

86

Here is the content of your question:

\documentclass{article}
\setlength{\parskip}{\baselineskip}%
\setlength{\parindent}{0pt}%
\begin{document}
Googling didnt give required results.(many, but not applicable or code doesn't work)

Essentially, what I want to do is the same formatting I just did with this question.

I am really sceptical about LaTeX whenever you encounter problem which can't be solved in 30 minutes means that you are unlikely to find correct solution.

What I use at the moment is \verb|'\\\\'|. Being from developers' circle I tend to deal with all kind of warning. These four slashes give me 'badboxes'. How to produce exactly same correct formatting I just did now with this text.

I appreciate your help and not critics. These kind of operations should not be a ritual dance around the fire in the first place.
\end{document}
Peter Grill
  • 223,288
  • 13
    The parskip package is preferable to \parskip=\baselineskip; see http://tex.stackexchange.com/a/14565/9092. Also, parskip implements the option parfill, which helps to identify paragraph boundaries. – Chel Mar 24 '12 at 01:29
  • 2
    @Chel parskip deliberately breaks paragraph indenting, though — see https://tex.stackexchange.com/questions/181451/. – Skippy le Grand Gourou Sep 05 '17 at 13:15
63

This answers the original question on how to make \\\\ compile properly. The other replies address vertical space between paragraphs.

Option 1: Add a non-breaking space between the line terminators:

\\~\\

Option 2: Introduce additional vertical space:

\\[12pt]

To achieve this for every paragraph, look at the parskip package. If you want to do this for every line, consider using the setspace package.

krlmlr
  • 12,530
  • Both slashes should be backslashes. option 1 produces bad box. Option 2 works. Please update your question or justify your forward slashes, so I will accept your question. – Aubergine Mar 24 '12 at 01:04
  • Yes of course, thanks. But option 1 worked for me in many cases. Would you mind posting a MWE that shows where it doesn't work? – krlmlr Mar 24 '12 at 01:06
  • what iss the difference between breaking space \ \hfill\ and non brakeing space \~\? Do they not achieve the same effect? – user71207 Jun 21 '21 at 13:19
25

It should hardly ever be necessary in normal text to use \\ (or newline).

If I am right assuming you want a space between paragraphs you can either use the parskip option if you're using a KOMA class (like scrartcl) or set the length \parskip to a value you like, if you're using a standard class. (I just see that Peter Grill already mentioned the latter in his answer so below's just the example for a KOMA class).

Edit: I just learned from here it is better not to set \parskip yourself but use the parskip package with the standard classes.

\documentclass[parskip=full]{scrartcl}
\begin{document}

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita
kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem
ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos
et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea
takimata sanctus est Lorem ipsum dolor sit amet.

Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam
voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita
kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem
ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor
invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos
et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea
takimata sanctus est Lorem ipsum dolor sit amet.

\end{document}
cgnieder
  • 66,645