1

I want to have a block of verbatim text like

output line 0.
* info 0. a53qpb199pb
output line 1.
* info 1. 1iq01a58b39

in an org file. I tried putting the text inside #+BEGIN_SRC and #+END_SRC, but the lines starting with an asterisk (*) are folded synchronously when the other headings are folded by SHIFT-TAB or default setting. Sometimes the folding includes the lines beyond #+END_SRC and breaks the logical structure of the content. How can I let org mode to treat this block as a purely verbatim object?

My question is related to the following one in StackOverflow:

In my case, asterisks inside the source block are not fontified as headings, and they don't function fully as heading of a section. Rather, they behave as headings only with respect to folding by TAB, SHIFT-TAB, and default setting.

I tried adding text, markdown, fundamental specifications next to #+BEGIN_SRC without success. I tried #+BEGIN_EXAMPLE and #+END_EXAMPLE without success.

1
  • 1
    You "quote" such lines by prepending a , to them. See Literal Examples in the manual.
    – NickD
    Feb 13 at 15:17

1 Answer 1

1

You have to write it as follows:

#+BEGIN_EXAMPLE
output line 0.
,* info 0. a53qpb199pb
output line 1.
,* info 1. 1iq01a58b39
#+END_EXAMPLE

See Literal Examples in the manual. The commas are stripped when you export the file; they are also stripped if you edit the block with C-c ' and are properly reintroduced when you finish the edit (with another C-c ').

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.