Markup for Rich Contents

Org provides a robust markup language (like Markdown) for rich text formatting. It is used in conjunction with the Org export framework.

Paragraphs

Paragraphs are separated by at least one empty line, unlike in normal English prose where a line break and indentation can indicate a paragraph.

If you need to enforce a line break within an Org paragraph, use ‘\\’ at the end of a line.

To always preserve line breaks when exporting a document, at this in your document:

=#+OPTIONS: \n:t=

For verse

The structured units of poetry are called verse. These contains indents, line breaks and blank lines. To preserve these use:

C-c C-, v

So stretched out huge in length the land unknown
A brooding darkness spread her envious wings
For aught that good and light could be discerned
Light to the damned perpetual night."

John Milton

For Direct Quotations

C-c C-, q

Everything should be made as simple as possible,
but not any simpler —Albert Einstein

To centre text

C-c C-, c

Everything should be made as simple as possible,
but not any simpler

Note: the text does not appear centred in the Org buffer, only in the exported document.

Emphasis and Monospace

Emphasis

bold

italic

underline

strike-through

Monospace

code

verbatim

Nota Bene Text in code and verbatim do not appear formatted in any way when exported. They are exported as is.

Nota Bene Two different Monospace fonts are used.

What is the difference between code and verbatim and when would you use one or the other?

Use code when you want to display inline code snippets, function names, variables, or any small piece of code within a larger text.

Use verbatim for inline literal text when you need to show file paths, terminal commands, or URLs.

=M-x org-agenda=

This is a command that should be typed exactly as shown but it is not a piece of code.

So one should ask: Is this a piece of code?

(add-to-list 'load-path "~/.emacs.d/manual") YES

https://emacs.stackexchange.com/ NO

/home/yal/Files-2024/org-agenda-files NO

There are some exceptions, like keybindings, which are typed as code: C-c a

Fontification

When you turn off fontification in Org, text marked for emphasis will appear the same as regular text. To turn off fontification for marked up text, you can set org-fontify-emphasized-text to nil.

One can customize markup in Org via org-emphasis-alist. One can remove or even add markup.

(setq org-emphasis-alist
      '(("*" bold)
	("/" italic)
	("_" underline)
	("=" verbatim)
	("~" code)
	("+" strike-through)
	("^" superscript)
	("&" subscript)))

Escaping markup characters in markup

One may expect this whole sentence to be italicized, but the
following ~user
?variable~ contains / character, which effectively stops emphasis there./

Use zero width space (C-x 8 RET ZERO WIDTH SPACE) to obviate the problem.

One may expect this whole sentence to be italicized, but the
following user​/?variable contains / character, which effectively stops emphasis there.