Emacs: Outline, org-mode

By Xah Lee. Date: . Last updated: .

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

emacs org mode outline2
org mode, outline, showing 1st and 2nd level headers.
emacs org mode outline1
org mode, outline, showing 1st level.

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


** Absca System and Logic

* the Relation of Absca, Musicality, and Math


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

Show/hide the heading's content. The cursor must be on the heading. Press it again to cycle show/hide its subsections.
Cycle show/hide heading content of the whole file.

Create New Heading

Insert a new heading at the cursor position.
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-dispatchCtrl+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.

emacs org mode gui menu 2017 06 21
emacs org mode GUI menu.

To find what's command name of a menu item, Alt+x describe-key, then pull a menu.



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/

Org Mode

ErgoEmacs mascot-s276x226
Buy Xah Emacs Tutorial

Emacs Tutorial

Quick Start


Split Window



Find Replace




Rectangle Edit

Line Wrap


View Special File

Editing Brackets

Org Mode


Emacs Efficiency