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

xMris
  • 361
  • 1
  • 3
  • 3

3 Answers3

35

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

jagrg
  • 3,824
  • 4
  • 19
nichijou
  • 1,158
  • 10
  • 14
  • 3
    what if I only want this option for a specific section? – xeruf Nov 23 '20 at 22:00
  • @xeruf I don't mean to be rude. But couldn't you just correct those sections in the org doc itself. – Dhawan Gayash Sep 23 '22 at 03:04
  • @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 '22 at 05: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 https://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`. – Dhawan Gayash Sep 23 '22 at 07: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.

CantrianBear
  • 359
  • 1
  • 10
  • thank you, as I understand now, each paragraph is limited to a single line? or not.. – xMris Apr 10 '16 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). – CantrianBear Apr 10 '16 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)