Next: , Previous: , Up: Markup  

11.3 Literal examples

You can include literal examples that should not be subjected to markup. Such examples will be typeset in monospace, so this is well suited for source code and similar examples.

Some example from a text file.

For simplicity when using small examples, you can also start the example lines with a colon followed by a space. There may also be additional whitespace before the colon:

Here is an example
   : Some example from a text file.

For source code from a programming language, or any other text that can be marked up by font-lock in Emacs, you can ask for it to look like the fontified Emacs buffer

#+BEGIN_SRC emacs-lisp
(defun org-xor (a b)
   "Exclusive or."
   (if a (not b) b))

To edit the example in a special buffer supporting this language, use C-c ' to both enter and leave the editing buffer.