Emacs: Org Mode Markup Cheatsheet
Emacs org-mode is a markup language, similar to Markdown, but with far more features. This page shows the markup syntax.
* 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
inline code ~3 + 4~ verbatim text =like this=
#+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+
- 1st item - another item - and 3rd item
+ 1st item + another item + and 3rd item
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
Here's the link format [[http://example.com/]] or [[http://example.com/][description]]
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.
a heading can start with TODO or DONE.
*** 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.
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.
Timestamp has these syntax:
<2019-01-25 Fri>(active timestamp, where other org features may act on it, such as scheduling, agenda.)
<2019-01-25 Fri 20:08>
[2019-01-25 Fri](inactive timestamp. Simply a date/time stamp.)
Timestamp can have other syntax variation to specify a duration or repetition.
<2006-11-01 Wed 19:15>
<2006-11-02 Thu 20:00-22:00>
<2007-05-16 Wed 12:30 +1w>weekly
<2004-08-23 Mon>--<2004-08-26 Thu>range.
Each heading can have associated info of key value pairs, called properties.
Properties must immediately follow a headline. The syntax for properties start with
followed by key value pair, 1 pair per line
here's a full example:
* emacs tutorial :PROPERTIES: :ORDERED: yes :ID: 11858 :OWNER: Lee :END:
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:
something something and something
* emacs tutorial :GIFT: got it from from xah on [2019-01-25 Fri] :END:
In emacs, Alt+x
org-export-dispatch 【Ctrl+c Ctrl+e】 to export. To export to HTML, the key is 【Ctrl+c Ctrl+e h h】
Emacs Org mode has many commands, including:
- Insert any org markup.
- View expand/collapse by headings only.
- Move headings, or level up/down.
- Evaluate embedded source code.
- Insert dates, todo, tags, etc.
- Insert/compute date range, clocking time.
For a basic tutorial, see: Emacs: Outline, org-mode