Emacs: Outline, org-mode
org-mode is bundled with emacs since emacs 22 (2007). This page is a basic tutorial.


Open a file, then
Alt+x org-mode
to start it.
Org Mode Markup Cheatsheet
Org Mode is a markup language, similar to Markdown, but more rich. Here's a cheat sheet.
Emacs: Org Mode Markup Cheatsheet
Have a look at the cheatsheet first.
The following shows you the commands to automatically insert the markup, and commands that navigate/manipulate the markup.
Create Headings
Heading starts with asterisk *, followed by a space.
Here's a sample org mode file.
* on the Musicality of Mathematics ** Abstract Over the past thousand years, humanity has worked on on music and math. ** the Meaning of Musicality One of the central problem is the definition of musicality. ** the Meaning of Math The meaning of math is a ancient question. Here, we take a meta-physiology approach. * on the Philosophy of Musicality ** Introduction Of course, talk is cheap. But, is it, really? But before we can talk about it, we have to think about it. Does it imply thinking is cheaper? Here we prove the fundamental theorem of musicality. * the Absca Project “I'm going to be lucky today, and my methodology is happy-go-lucky” —anonymous. A wise man has said, but, we cut it directly by introducing the Absca project. ** Components of the Absca System xyz. ** Absca System and Logic * the Relation of Absca, Musicality, and Math xyz.
Copy and paste the above in a file and save it
as test.org
.
Now, open the file. File ending in “.org” opens in org mode by default.
or Alt+x org-mode
, to activate org mode in any buffer.
Show/Hide Sections
- Tab
- Show/hide the heading's content. The cursor must be on the heading. Press it again to cycle show/hide its subsections.
- Shift+Tab
- Cycle show/hide heading content of the whole file.
Create New Heading
- Alt+Enter
- Insert a new heading at the cursor position.
- Ctrl+Enter
- Insert a new heading at the end of the current branch.
Move Tree Branch
Here are commands that move heading (and its content).
- {Alt+Shift+↑, Alt+Shift+↓}
- Move branch up/down but keep in same level.
- {Alt+Shift+←, Alt+Shift+→}
- Move branch up/down a level.
Move Heading
Here's a command that moves just the heading (not moving its content and sub-headings.).
- {Alt+←, Alt+→}
- {promote, demote} a heading one level.
Open Files in org-mode Automatically
If you name your file ending in “.org”, emacs will open it in org-mode
automatically.
You can also put this line as the first line of the file:
-*- mode: org -*-
Emacs will start org-mode
when the file is opened.
If you want any file ending in “.txt” open in org-mode
, add this line to your emacs init file:
(add-to-list 'auto-mode-alist '("\\.txt\\'" . org-mode))
Export to HTML
One great feature of org-mode is export to HTML.
- Alt+x
org-export-dispatch
【Ctrl+c Ctrl+e】 - Show org export choices.
- Ctrl+c Ctrl+e h h
- Export the file to HTML.
The newly generated file have the same name as your org file, but with “.html” extension, in the same directory.
Use Graphical Menu
When in org-mode
, there's a menu [Org]. Try it. From the menu, you can learn the most useful commands and the key shortcuts.

To find what's command name of a menu item,
Alt+x
describe-key
, then pull a menu.
Reference
Org mode is written by Carsten Dominik https://staff.science.uva.nl/c.dominik/
You can see a fun video interview of Carsten Dominik by Sacha Chua at http://sachachua.com/blog/2013/03/emacs-chat-carsten-dominik/
Org mode is lead by Bastien Guerry for over 10 years. You can see a fun video interview of Bastien Guerry by Sacha Chua at http://sachachua.com/blog/2013/05/emacs-chat-bastien-guerry/