2

Org-mode is great for getting light markup and organization done, and the exporting is great too. However, I'm having trouble getting a simple formatting option done.

I'd like to cast a whole block in monospace, and if possible, get the nice framing (in HTML export) that comes from the EXAMPLE environment:

#+BEGIN_EXAMPLE
some stuff that goes on and on forever right off the edge of any page or browser frame 443okkfq3jg0jg
#+END_EXAMPLE

Unfortunately, as in Markdown here, wrapping is lost in a verbatim environment.

I would most like to just turn on wrapping within this environment. If that doesn't work, I at least want the ability to place just a delimited block in a monospace font (so that I can get the wrapping from the plain text). How can I achieve one or both of these?

2

For HTML export, you can use your own block names which will export as a div element with the block name as a class:

#+begin_monoblock
This is some text.
#+end_monoblock

Now you can add your format 2 ways:

1: by adding a CSS style definition for all such blocks at the top of your org document

#+HTML_HEAD: <style>.monoblock {font-family:courier;}</style>

... other things

#+begin_monoblock
This is some text.
#+end_monoblock

2: by adding style or other HTML attributes individually to each block:

#+attr_html: :style font-family:courier;
#+begin_monoblock
This is some text.
#+end_monoblock

Or, a combination of both, with some common style for all blocks, plus extra style individually.

  • Where is this documented? Thanks! – Musa Al-hassy Aug 17 '18 at 2:20

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.