0

How would you export org headers verbatim to HTML?

My org file looks like this:

#+TITLE: my-org-file.org

An example of org-style headers:

#+begin_example
* Title1
** Subtitle1a
** Subtitle1b
* Title2
** Subtitle2a
#+end_example

The expected output when exporting to HTML (org-export-dispatch; C-c C-e h o) is:

my-org-file.org

An example of org-style headers:

* Title1
** Subtitle1a
** Subtitle1b
* Title2
** Subtitle2a

The actual output is:

my-org-file.org

An example of org-style headers:#+beginexample

1 Title1
1.1 Subtitle1a
1.2 Subtitle1b
2 Title2
2.1 Subtitle2a

#+endexample

I have tried the other export options (export ascii, quote, verse, html export) and each produces the same result.

1

Simply insert a leading space in front of each line in the example block:

#+TITLE: my-org-file.org

An example of org-style headers:

#+BEGIN_EXAMPLE
 * Title1
 ** Subtitle1a
 ** Subtitle1b
 * Title2
 ** Subtitle2a
#+END_EXAMPLE

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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