3

I want to emphasize a particular bit of text that contains a poem. The way I'm trying to do that is by inserting multiple line breaks

something \\ \\ \\ poem

However in html it renders the same way

something \ \ \ poem

How do I insert multiple line breaks to emphasize a piece of text in org mode

3 Answers3

5

Please check your setting of org-export-preserve-breaks value. The following is in-buffer setting of the variable.

#+OPTIONS: \n:t

The following code become enabled in ox-html.el when the variable is t.

(setq output
    (replace-regexp-in-string
     "\\(\\\\\\\\\\)?[ \t]*\n"
     (concat (org-html-close-tag "br" nil info) "\n") output))

This means \\ at end of line only export to <br>.

Therefore,

something \\
\\
\\
poem

will export to:

something<br>
<br>
<br>
poem

Please see https://orgmode.org/manual/Export-settings.html

msnoigrs
  • 51
  • 1
  • 2
4

The \\ works only in LaTeX.

Try this:

something
#+HTML: <br>
#+HTML: <br>
#+HTML: <br>
poem

An even better solution that would work for different exports would be to define your own NEWLINE macro. [Source].

#+MACRO: NEWLINE @@latex:\\@@ @@html:<br>@@ @@ascii:|@@
something {{{NEWLINE}}}{{{NEWLINE}}}{{{NEWLINE}}}
poem
Kaushal Modi
  • 25,203
  • 3
  • 74
  • 179
0

what about the followings both to LaTeX and HTML.

something \\
\\
\\
poem
RUserPassingBy
  • 1,078
  • 7
  • 14