26

I have an org-mode file, some sub-sections have some big paragraphs. When I export as html the whole paragraphs are displayed as single lines.

I understand that I have to put a '\\' on every line, a bit PITA, its around 4000 lines there. Is there any way, a parameter perhaps, that forces new line to each line that sits between paragraphs?

thx

3 Answers 3

37

is #+OPTIONS: \n:t what you want (see org-export-preserve-breaks)?

place this line anywhere in your org-file to preserve line breaks.

ref: The Org Manual/Exporting/Export settings

4
  • 4
    what if I only want this option for a specific section?
    – xeruf
    Nov 23, 2020 at 22:00
  • @xeruf I don't mean to be rude. But couldn't you just correct those sections in the org doc itself. Sep 23, 2022 at 3:04
  • 1
    @Dhawan I think it's a fair demand, say, a dedicated section for poem? some people like their text being compact visually. @xeruf usually for each file-scope #+keyword, there is a corresponding subtree property EXPORT_keyword, but unfortunately, AFAIK, not for this #+OPTIONS one.
    – nichijou
    Sep 23, 2022 at 5:24
  • @nichijou Aah! I see, now. Thank you. So the ask is to override the global variable org-export-preserve-breaks from nil to t. If this is the ask, then it might be possible to set override the orgmode.org/manual/Export-Settings.html the argument at sub section if we set the property org-export-preserve-breaks to t inside the sub-section using the command org-set-property where the property name is ORG-EXPORT-PERSERVE-BREAKS and the value being t. Sep 23, 2022 at 7:11
9

To separate paragraphs by a single line all you need is to add an empty line between each paragraph in your org-file like following:

First paragraph

Second paragraph

\\ is only required to add additional empty lines.

2
  • thank you, as I understand now, each paragraph is limited to a single line? or not..
    – xMris
    Apr 10, 2016 at 18:53
  • 1
    Each paragraph can be as long as you want. To create a new paragraph, you need to press enter twice in your org-file(== one empty line in-between). If you just press enter once, you'll only see a whitespace between those lines in your exported html file (since according to org-mode, you didn't create a new paragraph). Apr 10, 2016 at 19:05
3

Any number of \\, @@latex:\\@@ or OPTIONS: \n:t did not work for me. I think this is because of the way LaTeX handles paragraphs (can't have many linebreaks between two paragraphs).

I solved it by using \bigskip (there's also smallskip and medskip, see here, no need to use @@latex: @@ here)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.