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 sample 2019-01-25

Heading

* first level heading begin with a asterisk

This is a paragraph. With no markup. Belongs under the heading above it.

** second level heading begin with 2 asterisks

*** third level heading

(Copy the above, paste into a file. Name the file “test.org”. Then open it in emacs. Or, Alt+x org-mode.)

Inline Code

inline code ~3 + 4~

verbatim text =like this=

Code Block

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

Press 【< e Tab】to insert the markup for example.

Source Code markup of specific language

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

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

To insert markup for source code, 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, Programing Language Code Markup

Bold, Italic, Underline, Verbatim, Code, Strike Thru

* Italic, Bold, …

*bold*

/italic/

_underlined_

=verbatim=

~code~

+strike-through+

List

Unordered list

- 1st item
- another item
- and 3rd item

or

+ 1st item
+ another item
+ and 3rd item

Ordered List

1. 1st item
2. another item
3. and 3rd item

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

- RGB :: rainbow color LEDS
- Cherry MX :: key switch by Cherry corp.

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

- [ ] visit temple
- [X] visit high rise
- [ ] visit lake

Link

Here's the link format

[[http://example.com/]]

or

[[http://example.com/][description]]

Image

[[/path/to/img.jpg]]

Tags

Tags are keywords attached to headline.

Tags must be at the end of headline, like this:

* learn golang :work:
** mom's birthday :family:

there can be multiple.

* Project xyz      :work:code:

The keyword can be any words, without space.

** travel :day1:
** travel :day2:

You can define your own set of tag words, so tag words are always just one of them.

https://orgmode.org/manual/Tags.html#Tags

Todo

a heading can start with TODO or DONE.

example:

*** TODO see mom

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

You can define your own set of todo words.

Priority Mark

A heading can have priority mark.

It follows immediately after TODO:

*** TODO [#A] Tim

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.

https://orgmode.org/manual/Dates-and-times.html#Dates-and-times

Properties

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

Properties must immediately follow a headline. The syntax for properties start with

:PROPERTIES:

followed by key value pair, 1 pair per line

:ORDERED: yes :ID: 1656c :OWNER: Lee

followed by

:END:

here's a full example:

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

https://orgmode.org/manual/Properties-and-Columns.html#Properties-and-Columns

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.)

Syntax: drawer must immediately follow a heading, like this:

:DRAWERNAME: something something and something :END:

* emacs tutorial
:GIFT:
got it from from xah on [2019-01-25 Fri]
:END:

https://orgmode.org/manual/Drawers.html#Drawers

Export

In emacs, Alt+x org-export-dispatchCtrl+c Ctrl+e】 to 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 Topic

  1. Org Mode Markup Cheatsheet
  2. org-mode Tutorial
  3. Source Code Markup
  4. Org Mode for Todo
  5. Org Mode Customization
  6. Elisp: Parse Org Mode

If you have a question, put $5 at patreon and message me.
Or Buy Xah Emacs Tutorial
Or buy a nice keyboard: Best Keyboards for Emacs

Emacs

Emacs Lisp

Misc