[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [Search] [Page Top / Page Bottom] [?] |
Org is based on Outline mode and provides flexible commands to edit the structure of the document.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [Search] [Page Top / Page Bottom] [?] |
Org is implemented on top of Outline mode. Outlines allow a document to be organized in a hierarchical structure, which (at least for me) is the best representation of notes and thoughts. An overview of this structure is achieved by folding (hiding) large parts of the document to show only the general document structure and the parts currently being worked on. Org greatly simplifies the use of outlines by compressing the entire show/hide functionality into a single command, org-cycle
, which is bound to the TAB key.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [Search] [Page Top / Page Bottom] [?] |
Headlines define the structure of an outline tree. The headlines in Org start with one or more stars, on the left margin(1). For example:
* Top level headline ** Second level *** 3rd level some text *** 3rd level more text * Another top level headline |
Some people find the many stars too noisy and would prefer an outline that has whitespace followed by a single star as headline starters. 15.7 A cleaner outline view, describes a setup to realize this.
An empty line after the end of a subtree is considered part of it and will be hidden when the subtree is folded. However, if you leave at least two empty lines, one empty line will remain visible after folding the subtree, in order to structure the collapsed view. See the variable org-cycle-separator-lines
to modify this behavior.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [Search] [Page Top / Page Bottom] [?] |
Outlines make it possible to hide parts of the text in the buffer. Org uses just two commands, bound to TAB and S-TAB to change the visibility in the buffer.
,-> FOLDED -> CHILDREN -> SUBTREE --. '-----------------------------------' |
The cursor must be on a headline for this to work(2). When the cursor is at the beginning of the buffer and the first line is not a headline, then TAB actually runs global cycling (see below)(3). Also when called with a prefix argument (C-u TAB), global cycling is invoked.
,-> OVERVIEW -> CONTENTS -> SHOW ALL --. '--------------------------------------' |
When S-TAB is called with a numeric prefix argument N, the CONTENTS view up to headlines of level N will be shown. Note that inside tables, S-TAB jumps to the previous field.
When Emacs first visits an Org file, the global state is set to OVERVIEW, i.e. only the top level headlines are visible. This can be configured through the variable org-startup-folded
, or on a per-file basis by adding one of the following lines anywhere in the buffer:
#+STARTUP: overview #+STARTUP: content #+STARTUP: showall #+STARTUP: showeverything |
Furthermore, any entries with a `VISIBILITY' property (see section 7. Properties and columns) will get their visibility adapted accordingly. Allowed values for this property are folded
, children
, content
, and all
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [Search] [Page Top / Page Bottom] [?] |
TAB Cycle visibility.
down / up Next/previous visible headline.
RET Select this location.
/ Do a Sparse-tree search
The following keys work if you turn off
|
org-goto-interface
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [Search] [Page Top / Page Bottom] [?] |
org-treat-insert-todo-heading-as-state-change
.
org-yank-adjusted-subtrees
and org-yank-folded-subtrees
, Org's internal yank
command will paste subtrees folded and in a clever way, using the same command as C-c C-x C-y. With the default settings, no level adjustment will take place, but the yanked tree will be folded unless doing so would swallow text previously visible. Any prefix argument to this command will force a normal yank
to be executed, with the prefix passed along. A good way to force a normal yank is C-u C-y. If you use yank-pop
after a yank, it will yank previous kill items plainly, without adjustment and folding.
org-clone-subtree-with-time-shift
.
When there is an active region (Transient Mark mode), promotion and demotion work on all headlines in the region. To select a region of headlines, it is best to place both point and mark at the beginning of a line, mark at the beginning of the first headline, and point at the line just after the last headline to change. Note that when the cursor is inside a table (see section 3. Tables), the Meta-Cursor keys have different functionality.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [Search] [Page Top / Page Bottom] [?] |
An important feature of Org-mode is the ability to construct sparse trees for selected information in an outline tree, so that the entire document is folded as much as possible, but the selected information is made visible along with the headline structure above it(6). Just try it out and you will see immediately how it works.
Org-mode contains several commands creating such trees, all these commands can be accessed through a dispatcher:
For frequently used sparse trees of specific search strings, you can use the variable org-agenda-custom-commands
to define fast keyboard access to specific sparse trees. These commands will then be accessible through the agenda dispatcher (see section 10.2 The agenda dispatcher). For example:
(setq org-agenda-custom-commands '(("f" occur-tree "FIXME"))) |
will define the key C-c a f as a shortcut for creating a sparse tree matching the string `FIXME'.
The other sparse tree commands select headings based on TODO keywords, tags, or properties and will be discussed later in this manual.
To print a sparse tree, you can use the Emacs command ps-print-buffer-with-faces
which does not print invisible parts of the document (8). Or you can use the command C-c C-e v to export only the visible part of the document and print the resulting file.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [Search] [Page Top / Page Bottom] [?] |
Within an entry of the outline tree, hand-formatted lists can provide additional structure. They also provide a way to create lists of checkboxes (see section 5.6 Checkboxes). Org supports editing such lists, and the HTML exporter (see section 12. Exporting) parses and formats them.
Org knows ordered lists, unordered lists, and description lists.
[@start:20]
. Items belonging to the same list must have the same indentation on the first line. In particular, if an ordered list reaches number `10.', then the 2--digit numbers must be written left-aligned with the other numbers in the list. Indentation also determines the end of a list item. It ends before the next line that is indented like the bullet/number, or less. Empty lines are part of the previous item, so you can have several paragraphs in one item. If you would like an empty line to terminate all currently open plain lists, configure the variable org-empty-line-terminates-plain-lists
. Here is an example:
** Lord of the Rings My favorite scenes are (in this order) 1. The attack of the Rohirrim 2. Eowyn's fight with the witch king + this was already my favorite scene in the book + I really like Miranda Otto. 3. Peter Jackson being shot by Legolas - on DVD only He makes a really funny face when it happens. But in the end, no individual scenes matter but the film as a whole. Important actors in this film are: - Elijah Wood :: He plays Frodo - Sean Austin :: He plays Sam, Frodo's friend. I still remember him very well from his role as Mikey Walsh in The Goonies. |
Org supports these lists by tuning filling and wrapping commands to deal with them correctly(10), and by exporting them properly (see section 12. Exporting). Since indentation is what governs the structure of these lists, many structural constructs like #+BEGIN_...
blocks can be indented to signal that they should be part of a list item.
If you find that using a different bullet for a sub-list (than that used for the current list-level) improves readability, customize the variable org-list-demote-modify-bullet
.
The following commands act on items when the cursor is in the first line of an item (the line with the bullet or number).
org-cycle-include-plain-lists
. to integrate
, plain list items will be treated like low-level. The level of an item is then given by the indentation of the bullet/number. Items are always subordinate to real headlines, however; the hierarchies remain completely separated.
If org-cycle-include-plain-lists
has not been set, TAB fixes the indentation of the current line in a heuristic way.
org-support-shift-select
is off. If not, you can still use paragraph jumping commands like C-up and C-down to quite similar effect.
org-support-shift-select
.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [Search] [Page Top / Page Bottom] [?] |
Sometimes you want to keep information associated with an entry, but you normally don't want to see it. For this, Org-mode has drawers. Drawers need to be configured with the variable org-drawers
(12). Drawers look like this:
** This is a headline Still outside the drawer :DRAWERNAME: This is inside the drawer. :END: After the drawer. |
Visibility cycling (see section 2.3 Visibility cycling) on the headline will hide and show the entry, but keep the drawer collapsed to a single line. In order to look inside the drawer, you need to move the cursor to the drawer line and press TAB there. Org-mode uses the PROPERTIES
drawer for storing properties (see section 7. Properties and columns), and you can also arrange for state change notes (see section 5.3.2 Tracking TODO state changes) and clock times (see section 8.4 Clocking work time) to be stored in a drawer LOGBOOK
. If you want to store a quick note in the LOGBOOK drawer, in a similar way as this is done by state changes, use
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [Search] [Page Top / Page Bottom] [?] |
Org-mode uses begin...end blocks for various purposes from including source code examples (see section 11.3 Literal examples) to capturing time logging information (see section 8.4 Clocking work time). These blocks can be folded and unfolded by pressing TAB in the begin line. You can also get all blocks folded at startup by configuring the variable org-hide-block-startup
or on a per-file basis by using
#+STARTUP: hideblocks #+STARTUP: nohideblocks |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [Search] [Page Top / Page Bottom] [?] |
Org-mode supports the creation of footnotes. In contrast to the `footnote.el' package, Org-mode's footnotes are designed for work on a larger document, not only for one-off documents like emails. The basic syntax is similar to the one used by `footnote.el', i.e. a footnote is defined in a paragraph that is started by a footnote marker in square brackets in column 0, no indentation allowed. If you need a paragraph break inside a footnote, use the LaTeX idiom `\par'. The footnote reference is simply the marker in square brackets, inside text. For example:
The Org homepage[fn:1] now looks a lot better than it used to. ... [fn:1] The link is: http://orgmode.org |
Org-mode extends the number-based syntax to named footnotes and optional inline definition. Using plain numbers as markers (as `footnote.el' does) is supported for backward compatibility, but not encouraged because of possible conflicts with LaTeX snippets (see section 11.7 Embedded LaTeX). Here are the valid references:
[1]
[fn:name]
name
is a unique label word, or, for simplicity of automatic creation, a number.[fn:: This is the inline definition of this footnote]
[fn:name: a definition]
[fn:name]
to create additional references. Footnote labels can be created automatically, or you can create names yourself. This is handled by the variable org-footnote-auto-label
and its corresponding #+STARTUP
keywords, see the docstring of that variable for details.
The following command handles footnotes:
When the cursor is on a footnote reference, jump to the definition. When it is at a definition, jump to the (first) reference.
Otherwise, create a new footnote. Depending on the variable org-footnote-define-inline
(13), the definition will be placed right into the text as part of the reference, or separately into the location determined by the variable org-footnote-section
.
When this command is called with a prefix argument, a menu of additional options is offered:
s Sort the footnote definitions by reference sequence. During editing, Org makes no effort to sort footnote definitions into a particular sequence. If you want them sorted, use this command, which will also move entries according to |
org-footnote-auto-adjust
(14), renumbering and sorting footnotes can be automatic after each insertion or deletion.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [Search] [Page Top / Page Bottom] [?] |
If you like the intuitive way the Org-mode structure editing and list formatting works, you might want to use these commands in other modes like Text mode or Mail mode as well. The minor mode orgstruct-mode
makes this possible. Toggle the mode with M-x orgstruct-mode, or turn it on by default, for example in Mail mode, with one of:
(add-hook 'mail-mode-hook 'turn-on-orgstruct) (add-hook 'mail-mode-hook 'turn-on-orgstruct++) |
When this mode is active and the cursor is on a line that looks to Org like a headline or the first line of a list item, most structure editing commands will work, even if the same keys normally have different functionality in the major mode you are using. If the cursor is not in one of those special lines, Orgstruct mode lurks silently in the shadow. When you use orgstruct++-mode
, Org will also export indentation and autofill settings into that mode, and detect item context after the first line of an item.
[ << ] | [ >> ] | [Top] | [Contents] | [Index] | [Search] [Page Top / Page Bottom] [?] |