Search code examples
emacsorg-mode

When exporting to text in org-mode: Insert blank lines between headings


As I often collect lists of open question in org-mode, I want to be able to easily export the subtree to text with some space between the single headings (such that there is some space for note-taking on a printed copy).

Org-structure looks like this:

* topic xyz
** question 1
** question 2
** question 3

Expected layout of the text export containing configurable number of blank lines between (or after) headings:

━━━━━━━━━━
topic xyz
━━━━━━━━━━

question 1
══════════





question 2
══════════





question 3
══════════

Solution

  • Execute a regex replacement in the exported text file:

    replace-regex RET ^[═]+$ RET \& C-o C-o C-o

    C-o inserts the newlines. c.p. How to replace a character with a newline in Emacs?