Emacs: Org Mode Markup Cheatsheet

By Xah Lee. Date: . Last updated: .

Emacs org-mode is a markup language, similar to Markdown, but with far more features. This page shows the markup syntax.

org mode sample 2019-01-25 dr5xg
org mode markup syntax 2019-01-25

Alt+x org-mode to start org mode.

Heading

Heading starts with a asterisk, like this:

* text
first level heading
** text
second level heading
*** text
third level heading

Inline Code

~text~
Source Code
=text=
Verbatim text

Code Block

#+BEGIN_EXAMPLE var x = 3 x + 4 #+END_EXAMPLE

In emacs 26, press < e Tab to insert the markup.

In emacs 27, to insert the markup, press Ctrl+c Ctrl+, (org-insert-structure-template)

Source Code Block

Example of python code:

#+BEGIN_SRC python x = 3 return x + 2 #+END_SRC

example of emacs lisp code:

#+BEGIN_SRC emacs-lisp (+ 3 4) #+END_SRC

In emacs 27, to insert the markup, press Ctrl+c Ctrl+, (org-insert-structure-template)

In emacs 26, to insert the markup, press < s Tab, type first char of your language name, then press Ctrl+Alt+i. Press that again to switch to next lang.

For how to eval source code, see: Emacs: Org Mode, Work with Source Code

Text Decoration

*text*
Bold
/text/
Italic
_text_
Underlined
=text=
Verbatim
~text~
Code
+text+
Strike-through

List

Unordered list

- item - item - item

or

+ item + item + item

Ordered List

1. item 2. item 3. item

Description list, is just like list, but with :: separating the term and its description. Often used for definition.

- term :: description - term :: description

Checkboxes can be added to list items, right after the list marker.

- [ ] description - [X] description - [ ] description

Link

[[URL]]

or

[[URL][description]]

Image

[[image_file_path]]

org-toggle-inline-imagesCtrl+c Ctrl+x Ctrl+v
Display images

Tags

Tags are keywords attached to headline. Tags must be at the end of headline. Example:

* learn golang :tag_word:

there can be multiple.

* Project xyz :tag_word:tag_word:

tag_word can be any word, such as “work”, “code”, “family”, but space is not allowed in tag word.

Todo

a heading can start with TODO or DONE.

example:

** TODO text

These are for todo features. By default, the keyword are TODO or DONE.

[see Emacs: Using Org Mode for Todo]

Priority Mark

A heading can have priority mark. It follows immediately after TODO:

** TODO [#A] text

The syntax is

Priority mark is used for todo/agenda features in org mode.

Date Time

Timestamp has these syntax:

Timestamp can have other syntax variation to specify a duration or repetition.

Keys:

Ctrl+c .
org-time-stamp. Insert a time stamp
Ctrl+c !
org-time-stamp-inactive

Properties

Each heading can have associated info of key value pairs, called properties.

Here's syntax for properties:

* emacs tutorial :PROPERTIES: :ORDERED: yes :ID: 11858 :OWNER: Lee :END:

Properties must immediately follow a headline.

:PROPERTIES:

Followed by key value pair, 1 pair per line.

Followed by

:END:

Drawer

Drawer lets you attach info to a heading. It's similar to properties, but instead of key value pairs, you have arbitrary text.

The difference of drawer content and heading's content is that drawer's content are normally hidden from view. (so, drawer is used for associated info you do not always want to see to prevent clutter.)

Drawer must immediately follow a heading.

Drawer syntax is like this:

* heading :DRAWERNAME: drawer_text :END:

Export

Alt+x org-export-dispatchCtrl+c Ctrl+e
Export. To export to HTML, the key is Ctrl+c Ctrl+e h h

Org Commands

Emacs Org mode has many commands, including:

For a basic tutorial, see: Emacs: Outline, org-mode

Org Mode

Put $5 at https://www.patreon.com/xahlee , or goto paypal.com and pay to Xah@XahLee.org . Message me on XahLee discord, say so, ask me questions.
Or Buy Xah Emacs Tutorial

Emacs Tutorial

Emacs Init

Emacs Keys

ELisp

ELisp Examples

ELisp Write Major Mode


Emacs Tutorial

Quick Start

Manage Windows

File

Buffer

Find Replace

Copy/Paste

Unicode

Whitespace

Rectangle Edit

Line Wrap

Shell

View Special File

Editing Brackets

Org Mode

HTML

Emacs Efficiency

Misc