The Org Manual

Short Table of Contents

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

Org Mode Manual

This manual is for Org version 9.0.3 (release_9.0.3).

Copyright © 2004–2016 Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover Texts being “A GNU Manual,” and with the Back-Cover Texts as in (a) below. A copy of the license is included in the section entitled “GNU Free Documentation License.”

(a) The FSF’s Back-Cover Text is: “You have the freedom to copy and modify this GNU manual.”


Next: , Up: Top   [Contents][Index]

1 Introduction


Next: , Up: Introduction   [Contents][Index]

1.1 Summary

Org is a mode for keeping notes, maintaining TODO lists, and project planning with a fast and effective plain-text system. It also is an authoring system with unique support for literate programming and reproducible research.

Org is implemented on top of Outline mode, which makes it possible to keep the content of large files well structured. Visibility cycling and structure editing help to work with the tree. Tables are easily created with a built-in table editor. Plain text URL-like links connect to websites, emails, Usenet messages, BBDB entries, and any files related to the projects.

Org develops organizational tasks around notes files that contain lists or information about projects as plain text. Project planning and task management makes use of metadata which is part of an outline node. Based on this data, specific entries can be extracted in queries and create dynamic agenda views that also integrate the Emacs calendar and diary. Org can be used to implement many different project planning schemes, such as David Allen’s GTD system.

Org files can serve as a single source authoring system with export to many different formats such as HTML, LaTeX, Open Document, and Markdown. New export backends can be derived from existing ones, or defined from scratch.

Org files can include source code blocks, which makes Org uniquely suited for authoring technical documents with code examples. Org source code blocks are fully functional; they can be evaluated in place and their results can be captured in the file. This makes it possible to create a single file reproducible research compendium.

Org keeps simple things simple. When first fired up, it should feel like a straightforward, easy to use outliner. Complexity is not imposed, but a large amount of functionality is available when needed. Org is a toolbox. Many users actually run only a (very personal) fraction of Org’s capabilities, and know that there is more whenever they need it.

All of this is achieved with strictly plain text files, the most portable and future-proof file format. Org runs in Emacs. Emacs is one of the most widely ported programs, so that Org mode is available on every major platform.

There is a website for Org which provides links to the newest version of Org, as well as additional information, frequently asked questions (FAQ), links to tutorials, etc. This page is located at http://orgmode.org.

An earlier version (7.3) of this manual is available as a paperback book from Network Theory Ltd.


Next: , Previous: , Up: Introduction   [Contents][Index]

1.2 Installation

Org is part of recent distributions of GNU Emacs, so you normally don’t need to install it. If, for one reason or another, you want to install Org on top of this pre-packaged version, there are three ways to do it:

We strongly recommend to stick to a single installation method.

Using Emacs packaging system

Recent Emacs distributions include a packaging system which lets you install Elisp libraries. You can install Org with M-x package-install RET org.

Important: you need to do this in a session where no .org file has been visited, i.e., where no Org built-in function have been loaded. Otherwise autoload Org functions will mess up the installation.

Then, to make sure your Org configuration is taken into account, initialize the package system with (package-initialize) in your Emacs init file before setting any Org option. If you want to use Org’s package repository, check out the Org ELPA page.

Downloading Org as an archive

You can download Org latest release from Org’s website. In this case, make sure you set the load-path correctly in your Emacs init file:

(add-to-list 'load-path "~/path/to/orgdir/lisp")

The downloaded archive contains contributed libraries that are not included in Emacs. If you want to use them, add the contrib directory to your load-path:

(add-to-list 'load-path "~/path/to/orgdir/contrib/lisp" t)

Optionally, you can compile the files and/or install them in your system. Run make help to list compilation and installation options.

Using Org’s git repository

You can clone Org’s repository and install Org like this:

$ cd ~/src/
$ git clone git://orgmode.org/org-mode.git
$ make autoloads

Note that in this case, make autoloads is mandatory: it defines Org’s version in org-version.el and Org’s autoloads in org-loaddefs.el.

Remember to add the correct load-path as described in the method above.

You can also compile with make, generate the documentation with make doc, create a local configuration with make config and install Org with make install. Please run make help to get the list of compilation/installation options.

For more detailed explanations on Org’s build system, please check the Org Build System page on Worg.


Next: , Previous: , Up: Introduction   [Contents][Index]

1.3 Activation

Org mode buffers need font-lock to be turned on: this is the default in Emacs1.

There are compatibility issues between Org mode and some other Elisp packages, please take the time to check the list (see Conflicts).

The four Org commands org-store-link, org-capture, org-agenda, and org-iswitchb should be accessible through global keys (i.e., anywhere in Emacs, not just in Org buffers). Here are suggested bindings for these keys, please modify the keys to your own liking.

(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cc" 'org-capture)
(global-set-key "\C-cb" 'org-iswitchb)

Files with the .org extension use Org mode by default. To turn on Org mode in a file that does not have the extension .org, make the first line of a file look like this:

MY PROJECTS    -*- mode: org; -*-

which will select Org mode for this buffer no matter what the file’s name is. See also the variable org-insert-mode-line-in-empty-file.

Many commands in Org work on the region if the region is active. To make use of this, you need to have transient-mark-mode turned on, which is the default. If you do not like transient-mark-mode, you can create an active region by using the mouse to select a region, or pressing C-SPC twice before moving the cursor.


Next: , Previous: , Up: Introduction   [Contents][Index]

1.4 Feedback

If you find problems with Org, or if you have questions, remarks, or ideas about it, please mail to the Org mailing list emacs-orgmode@gnu.org. You can subscribe to the list on this web page. If you are not a member of the mailing list, your mail will be passed to the list after a moderator has approved it2.

For bug reports, please first try to reproduce the bug with the latest version of Org available—if you are running an outdated version, it is quite possible that the bug has been fixed already. If the bug persists, prepare a report and provide as much information as possible, including the version information of Emacs (M-x emacs-version RET) and Org (M-x org-version RET), as well as the Org related setup in the Emacs init file. The easiest way to do this is to use the command

M-x org-submit-bug-report RET

which will put all this information into an Emacs mail buffer so that you only need to add your description. If you are not sending the Email from within Emacs, please copy and paste the content into your Email program.

Sometimes you might face a problem due to an error in your Emacs or Org mode setup. Before reporting a bug, it is very helpful to start Emacs with minimal customizations and reproduce the problem. Doing so often helps you determine if the problem is with your customization or with Org mode itself. You can start a typical minimal session with a command like the example below.

$ emacs -Q -l /path/to/minimal-org.el

However if you are using Org mode as distributed with Emacs, a minimal setup is not necessary. In that case it is sufficient to start Emacs as emacs -Q. The minimal-org.el setup file can have contents as shown below.

;;; Minimal setup to load latest 'org-mode'

;; activate debugging
(setq debug-on-error t
      debug-on-signal nil
      debug-on-quit nil)

;; add latest org-mode to load path
(add-to-list 'load-path (expand-file-name "/path/to/org-mode/lisp"))
(add-to-list 'load-path (expand-file-name "/path/to/org-mode/contrib/lisp" t))

If an error occurs, a backtrace can be very useful (see below on how to create one). Often a small example file helps, along with clear information about:

  1. What exactly did you do?
  2. What did you expect to happen?
  3. What happened instead?

Thank you for helping to improve this program.

How to create a useful backtrace

If working with Org produces an error with a message you don’t understand, you may have hit a bug. The best way to report this is by providing, in addition to what was mentioned above, a backtrace. This is information from the built-in debugger about where and how the error occurred. Here is how to produce a useful backtrace:

  1. Reload uncompiled versions of all Org mode Lisp files. The backtrace contains much more information if it is produced with uncompiled code. To do this, use
    C-u M-x org-reload RET
    

    or select Org -> Refresh/Reload -> Reload Org uncompiled from the menu.

  2. Go to the Options menu and select Enter Debugger on Error.
  3. Do whatever you have to do to hit the error. Don’t forget to document the steps you take.
  4. When you hit the error, a *Backtrace* buffer will appear on the screen. Save this buffer to a file (for example using C-x C-w) and attach it to your bug report.

Previous: , Up: Introduction   [Contents][Index]

1.5 Typesetting conventions used in this manual

TODO keywords, tags, properties, etc.

Org mainly uses three types of keywords: TODO keywords, tags and property names. In this manual we use the following conventions:

TODO
WAITING

TODO keywords are written with all capitals, even if they are user-defined.

boss
ARCHIVE

User-defined tags are written in lowercase; built-in tags with special meaning are written with all capitals.

Release
PRIORITY

User-defined properties are capitalized; built-in properties with special meaning are written with all capitals.

Moreover, Org uses option keywords (like #+TITLE to set the title) and environment keywords (like #+BEGIN_EXPORT html to start a HTML environment). They are written in uppercase in the manual to enhance its readability, but you can use lowercase in your Org file.

Key bindings and commands

The manual suggests a few global key bindings, in particular C-c a for org-agenda and C-c c for org-capture. These are only suggestions, but the rest of the manual assumes that these key bindings are in place in order to list commands by key access.

Also, the manual lists both the keys and the corresponding commands for accessing a functionality. Org mode often uses the same key for different functions, depending on context. The command that is bound to such keys has a generic name, like org-metaright. In the manual we will, wherever possible, give the function that is internally called by the generic command. For example, in the chapter on document structure, M-right will be listed to call org-do-demote, while in the chapter on tables, it will be listed to call org-table-move-column-right. If you prefer, you can compile the manual without the command names by unsetting the flag cmdnames in org.texi.


Next: , Previous: , Up: Top   [Contents][Index]

2 Document structure

Org is based on Outline mode and provides flexible commands to edit the structure of the document.


Next: , Up: Document structure   [Contents][Index]

2.1 Outlines

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.


Next: , Previous: , Up: Document structure   [Contents][Index]

2.2 Headlines

Headlines define the structure of an outline tree. The headlines in Org start with one or more stars, on the left margin3 4. For example:

* Top level headline
** Second level
*** 3rd level
    some text
*** 3rd level
    more text

* Another top level headline

Note that a headline named after org-footnote-section, which defaults to ‘Footnotes’, is considered as special. A subtree with this headline will be silently ignored by exporting functions.

Some people find the many stars too noisy and would prefer an outline that has whitespace followed by a single star as headline starters. Clean 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.


Next: , Previous: , Up: Document structure   [Contents][Index]

2.3 Visibility cycling


Next: , Up: Visibility cycling   [Contents][Index]

2.3.1 Global and local cycling

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.

TAB     (org-cycle)

Subtree cycling: Rotate current subtree among the states

,-> FOLDED -> CHILDREN -> SUBTREE --.
'-----------------------------------'

The cursor must be on a headline for this to work5. 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)6. Also when called with a prefix argument (C-u TAB), global cycling is invoked.

S-TAB     (org-global-cycle)
C-u TAB

Global cycling: Rotate the entire buffer among the states

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

C-u C-u TAB     (org-set-startup-visibility)

Switch back to the startup visibility of the buffer (see Initial visibility).

C-u C-u C-u TAB     (outline-show-all)

Show all, including drawers.

C-c C-r     (org-reveal)

Reveal context around point, showing the current entry, the following heading and the hierarchy above. Useful for working near a location that has been exposed by a sparse tree command (see Sparse trees) or an agenda command (see Agenda commands). With a prefix argument show, on each level, all sibling headings. With a double prefix argument, also show the entire subtree of the parent.

C-c C-k     (outline-show-branches)

Expose all the headings of the subtree, CONTENT view for just one subtree.

C-c TAB     (outline-show-children)

Expose all direct children of the subtree. With a numeric prefix argument N, expose all children down to level N.

C-c C-x b     (org-tree-to-indirect-buffer)

Show the current subtree in an indirect buffer7. With a numeric prefix argument N, go up to level N and then take that tree. If N is negative then go up that many levels. With a C-u prefix, do not remove the previously used indirect buffer.

C-c C-x v     (org-copy-visible)

Copy the visible text in the region into the kill ring.


Next: , Previous: , Up: Visibility cycling   [Contents][Index]

2.3.2 Initial visibility

When Emacs first visits an Org file, the global state is set to OVERVIEW, i.e., only the top level headlines are visible8. 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 Properties and columns) will get their visibility adapted accordingly. Allowed values for this property are folded, children, content, and all.

C-u C-u TAB     (org-set-startup-visibility)

Switch back to the startup visibility of the buffer, i.e., whatever is requested by startup options and ‘VISIBILITY’ properties in individual entries.


Previous: , Up: Visibility cycling   [Contents][Index]

2.3.3 Catching invisible edits

Sometimes you may inadvertently edit an invisible part of the buffer and be confused on what has been edited and how to undo the mistake. Setting org-catch-invisible-edits to non-nil will help prevent this. See the docstring of this option on how Org should catch invisible edits and process them.


Next: , Previous: , Up: Document structure   [Contents][Index]

2.4 Motion

The following commands jump to other headlines in the buffer.

C-c C-n     (org-next-visible-heading)

Next heading.

C-c C-p     (org-previous-visible-heading)

Previous heading.

C-c C-f     (org-forward-same-level)

Next heading same level.

C-c C-b     (org-backward-same-level)

Previous heading same level.

C-c C-u     (outline-up-heading)

Backward to higher level heading.

C-c C-j     (org-goto)

Jump to a different place without changing the current outline visibility. Shows the document structure in a temporary buffer, where you can use the following keys to find your destination:

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-auto-isearch
n / p        Next/previous visible headline.
f / b        Next/previous headline same level.
u            One level up.
0-9          Digit argument.
q            Quit

See also the option org-goto-interface.


Next: , Previous: , Up: Document structure   [Contents][Index]

2.5 Structure editing

M-RET     (org-insert-heading)

Insert a new heading/item with the same level as the one at point.

If the command is used at the beginning of a line, and if there is a heading or a plain list item (see Plain lists) at point, the new heading/item is created before the current line. When used at the beginning of a regular line of text, turn that line into a heading.

When this command is used in the middle of a line, the line is split and the rest of the line becomes the new item or headline. If you do not want the line to be split, customize org-M-RET-may-split-line.

Calling the command with a C-u prefix unconditionally inserts a new heading at the end of the current subtree, thus preserving its contents. With a double C-u C-u prefix, the new heading is created at the end of the parent subtree instead.

C-RET     (org-insert-heading-respect-content)

Insert a new heading at the end of the current subtree.

M-S-RET     (org-insert-todo-heading)

Insert new TODO entry with same level as current heading. See also the variable org-treat-insert-todo-heading-as-state-change.

C-S-RET     (org-insert-todo-heading-respect-content)

Insert new TODO entry with same level as current heading. Like C-RET, the new headline will be inserted after the current subtree.

TAB     (org-cycle)

In a new entry with no text yet, the first TAB demotes the entry to become a child of the previous one. The next TAB makes it a parent, and so on, all the way to top level. Yet another TAB, and you are back to the initial level.

M-left     (org-do-promote)

Promote current heading by one level.

M-right     (org-do-demote)

Demote current heading by one level.

M-S-left     (org-promote-subtree)

Promote the current subtree by one level.

M-S-right     (org-demote-subtree)

Demote the current subtree by one level.

M-S-up     (org-move-subtree-up)

Move subtree up (swap with previous subtree of same level).

M-S-down     (org-move-subtree-down)

Move subtree down (swap with next subtree of same level).

M-h     (org-mark-element)

Mark the element at point. Hitting repeatedly will mark subsequent elements of the one just marked. E.g., hitting M-h on a paragraph will mark it, hitting M-h immediately again will mark the next one.

C-c @     (org-mark-subtree)

Mark the subtree at point. Hitting repeatedly will mark subsequent subtrees of the same level than the marked subtree.

C-c C-x C-w     (org-cut-subtree)

Kill subtree, i.e., remove it from buffer but save in kill ring. With a numeric prefix argument N, kill N sequential subtrees.

C-c C-x M-w     (org-copy-subtree)

Copy subtree to kill ring. With a numeric prefix argument N, copy the N sequential subtrees.

C-c C-x C-y     (org-paste-subtree)

Yank subtree from kill ring. This does modify the level of the subtree to make sure the tree fits in nicely at the yank position. The yank level can also be specified with a numeric prefix argument, or by yanking after a headline marker like ‘****’.

C-y     (org-yank)

Depending on the options 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.

C-c C-x c     (org-clone-subtree-with-time-shift)

Clone a subtree by making a number of sibling copies of it. You will be prompted for the number of copies to make, and you can also specify if any timestamps in the entry should be shifted. This can be useful, for example, to create a number of tasks related to a series of lectures to prepare. For more details, see the docstring of the command org-clone-subtree-with-time-shift.

C-c C-w     (org-refile)

Refile entry or region to a different location. See Refile and copy.

C-c ^     (org-sort)

Sort same-level entries. When there is an active region, all entries in the region will be sorted. Otherwise the children of the current headline are sorted. The command prompts for the sorting method, which can be alphabetically, numerically, by time (first timestamp with active preferred, creation time, scheduled time, deadline time), by priority, by TODO keyword (in the sequence the keywords have been defined in the setup) or by the value of a property. Reverse sorting is possible as well. You can also supply your own function to extract the sorting key. With a C-u prefix, sorting will be case-sensitive.

C-x n s     (org-narrow-to-subtree)

Narrow buffer to current subtree.

C-x n b     (org-narrow-to-block)

Narrow buffer to current block.

C-x n w     (widen)

Widen buffer to remove narrowing.

C-c *     (org-toggle-heading)

Turn a normal line or plain list item into a headline (so that it becomes a subheading at its location). Also turn a headline into a normal line by removing the stars. If there is an active region, turn all lines in the region into headlines. If the first line in the region was an item, turn only the item lines into headlines. Finally, if the first line is a headline, remove the stars from all headlines in the region.

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 Tables), the Meta-Cursor keys have different functionality.


Next: , Previous: , Up: Document structure   [Contents][Index]

2.6 Sparse trees

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 it9. Just try it out and you will see immediately how it works.

Org mode contains several commands for creating such trees, all these commands can be accessed through a dispatcher:

C-c /     (org-sparse-tree)

This prompts for an extra key to select a sparse-tree creating command.

C-c / r  or  C-c / /     (org-occur)

Prompts for a regexp and shows a sparse tree with all matches. If the match is in a headline, the headline is made visible. If the match is in the body of an entry, headline and body are made visible. In order to provide minimal context, also the full hierarchy of headlines above the match is shown, as well as the headline following the match. Each match is also highlighted; the highlights disappear when the buffer is changed by an editing command10, or by pressing C-c C-c. When called with a C-u prefix argument, previous highlights are kept, so several calls to this command can be stacked.

M-g n  or  M-g M-n     (next-error)

Jump to the next sparse tree match in this buffer.

M-g p  or  M-g M-p     (previous-error)

Jump to the previous sparse tree match in this buffer.

For frequently used sparse trees of specific search strings, you can use the option org-agenda-custom-commands to define fast keyboard access to specific sparse trees. These commands will then be accessible through the agenda dispatcher (see 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. Or you can use C-c C-e C-v to export only the visible part of the document and print the resulting file.


Next: , Previous: , Up: Document structure   [Contents][Index]

2.7 Plain lists

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 Checkboxes). Org supports editing such lists, and every exporter (see Exporting) can parse and format them.

Org knows ordered lists, unordered lists, and description lists.

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. An item ends before the next line that is less or equally indented than its bullet/number.

A list ends whenever every item has ended, which means before any line less or equally indented than items at top level. It also ends before two blank lines15. In that case, all items are closed. 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 Astin :: 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, and by exporting them properly (see Exporting). Since indentation is what governs the structure of these lists, many structural constructs like #+BEGIN_... blocks can be indented to signal that they belong to a particular 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. To get a greater difference of indentation between items and their sub-items, customize org-list-indent-offset.

The following commands act on items when the cursor is in the first line of an item (the line with the bullet or number). Some of them imply the application of automatic rules to keep list structure intact. If some of these actions get in your way, configure org-list-automatic-rules to disable them individually.

TAB     (org-cycle)

Items can be folded just like headline levels. Normally this works only if the cursor is on a plain list item. For more details, see the variable org-cycle-include-plain-lists. If this variable is set to integrate, plain list items will be treated like low-level headlines. 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. In a new item with no text yet, the first TAB demotes the item to become a child of the previous one. Subsequent TABs move the item to meaningful levels in the list and eventually get it back to its initial position.

M-RET     (org-insert-heading)

Insert new item at current level. With a prefix argument, force a new heading (see Structure editing). If this command is used in the middle of an item, that item is split in two, and the second part becomes the new item16. If this command is executed before item’s body, the new item is created before the current one.

M-S-RET

Insert a new item with a checkbox (see Checkboxes).

S-up
S-down

Jump to the previous/next item in the current list17, but only if 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.

M-up
M-down

Move the item including subitems up/down18 (swap with previous/next item of same indentation). If the list is ordered, renumbering is automatic.

M-left
M-right

Decrease/increase the indentation of an item, leaving children alone.

M-S-left
M-S-right

Decrease/increase the indentation of the item, including subitems. Initially, the item tree is selected based on current indentation. When these commands are executed several times in direct succession, the initially selected region is used, even if the new indentation would imply a different hierarchy. To use the new hierarchy, break the command chain with a cursor motion or so.

As a special case, using this command on the very first item of a list will move the whole list. This behavior can be disabled by configuring org-list-automatic-rules. The global indentation of a list has no influence on the text after the list.

C-c C-c

If there is a checkbox (see Checkboxes) in the item line, toggle the state of the checkbox. In any case, verify bullets and indentation consistency in the whole list.

C-c -

Cycle the entire list level through the different itemize/enumerate bullets (‘-’, ‘+’, ‘*’, ‘1.’, ‘1)’) or a subset of them, depending on org-plain-list-ordered-item-terminator, the type of list, and its indentation. With a numeric prefix argument N, select the Nth bullet from this list. If there is an active region when calling this, all selected lines are converted to list items. With a prefix argument, selected text is changed into a single item. If the first line already was a list item, any item marker will be removed from the list. Finally, even without an active region, a normal line will be converted into a list item.

C-c *

Turn a plain list item into a headline (so that it becomes a subheading at its location). See Structure editing, for a detailed explanation.

C-c C-*

Turn the whole plain list into a subtree of the current heading. Checkboxes (see Checkboxes) will become TODO (resp. DONE) keywords when unchecked (resp. checked).

S-left/right

This command also cycles bullet styles when the cursor in on the bullet or anywhere in an item line, details depending on org-support-shift-select.

C-c ^

Sort the plain list. You will be prompted for the sorting method: numerically, alphabetically, by time, by checked status for check lists, or by a custom function.


Next: , Previous: , Up: Document structure   [Contents][Index]

2.8 Drawers

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. They can contain anything but a headline and another drawer. Drawers look like this:

** This is a headline
   Still outside the drawer
   :DRAWERNAME:
   This is inside the drawer.
   :END:
   After the drawer.

You can interactively insert drawers at point by calling org-insert-drawer, which is bound to C-c C-x d. With an active region, this command will put the region inside the drawer. With a prefix argument, this command calls org-insert-property-drawer and add a property drawer right below the current headline. Completion over drawer keywords is also possible using M-TAB.

Visibility cycling (see 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 Properties and columns), and you can also arrange for state change notes (see Tracking TODO state changes) and clock times (see 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 to state changes, use

C-c C-z

Add a time-stamped note to the LOGBOOK drawer.

You can select the name of the drawers which should be exported with org-export-with-drawers. In that case, drawer contents will appear in export output. Property drawers are not affected by this variable: configure org-export-with-properties instead.


Next: , Previous: , Up: Document structure   [Contents][Index]

2.9 Blocks

Org mode uses begin...end blocks for various purposes from including source code examples (see Literal examples) to capturing time logging information (see 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 option org-hide-block-startup or on a per-file basis by using

#+STARTUP: hideblocks
#+STARTUP: nohideblocks

Next: , Previous: , Up: Document structure   [Contents][Index]

2.10 Footnotes

Org mode supports the creation of footnotes.

A footnote is started by a footnote marker in square brackets in column 0, no indentation allowed. It ends at the next footnote definition, headline, or after two consecutive empty lines. The footnote reference is simply the marker in square brackets, inside text. Markers always start with fn:. 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. Here are the valid references:

[fn:name]

A named footnote reference, where name is a unique label word, or, for simplicity of automatic creation, a number.

[fn::This is the inline definition of this footnote]

A LaTeX-like anonymous footnote where the definition is given directly at the reference point.

[fn:name:a definition]

An inline definition of a footnote, which also specifies a name for the note. Since Org allows multiple references to the same note, you can then use [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:

C-c C-x f

The footnote action command.

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 option org-footnote-define-inline19, the definition will be placed right into the text as part of the reference, or separately into the location determined by the option 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-section.  Automatic
    sorting after each insertion/deletion can be configured using the
    option org-footnote-auto-adjust.
r   Renumber the simple fn:N footnotes.  Automatic renumbering
    after each insertion/deletion can be configured using the option
    org-footnote-auto-adjust.
S   Short for first r, then s action.
n   Normalize the footnotes by collecting all definitions (including
    inline definitions) into a special section, and then numbering them
    in sequence.  The references will then also be numbers.
d   Delete the footnote at point, and all definitions of and references
    to it.

Depending on the variable org-footnote-auto-adjust20, renumbering and sorting footnotes can be automatic after each insertion or deletion.

C-c C-c

If the cursor is on a footnote reference, jump to the definition. If it is a the definition, jump back to the reference. When called at a footnote location with a prefix argument, offer the same menu as C-c C-x f.

C-c C-o or mouse-1/2

Footnote labels are also links to the corresponding definition/reference, and you can use the usual commands to follow these links.

C-c '
C-c '

Edit the footnote definition corresponding to the reference at point in a seperate window. The window can be closed by pressing C-c '.


Next: , Previous: , Up: Document structure   [Contents][Index]

2.11 The Orgstruct minor mode

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 RET, or turn it on by default, for example in Message mode, with one of:

(add-hook 'message-mode-hook 'turn-on-orgstruct)
(add-hook 'message-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 shadows.

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.

You can also use Org structure editing to fold and unfold headlines in any file, provided you defined orgstruct-heading-prefix-regexp: the regular expression must match the local prefix to use before Org’s headlines. For example, if you set this variable to ";; " in Emacs Lisp files, you will be able to fold and unfold headlines in Emacs Lisp commented lines. Some commands like org-demote are disabled when the prefix is set, but folding/unfolding will work correctly.


Previous: , Up: Document structure   [Contents][Index]

2.12 Org syntax

A reference document providing a formal description of Org’s syntax is available as a draft on Worg, written and maintained by Nicolas Goaziou. It defines Org’s core internal concepts such as headlines, sections, affiliated keywords, (greater) elements and objects. Each part of an Org file falls into one of the categories above.

To explore the abstract structure of an Org buffer, run this in a buffer:

M-: (org-element-parse-buffer) RET

It will output a list containing the buffer’s content represented as an abstract structure. The export engine relies on the information stored in this list. Most interactive commands (e.g., for structure editing) also rely on the syntactic meaning of the surrounding context.

You can check syntax in your documents using org-lint command.


Next: , Previous: , Up: Top   [Contents][Index]

3 Tables

Org comes with a fast and intuitive table editor. Spreadsheet-like calculations are supported using the Emacs calc package (see Calc in Gnu Emacs Calculator Manual).


Next: , Up: Tables   [Contents][Index]

3.1 The built-in table editor

Org makes it easy to format tables in plain ASCII. Any line with ‘|’ as the first non-whitespace character is considered part of a table. ‘|’ is also the column separator21. A table might look like this:

| Name  | Phone | Age |
|-------+-------+-----|
| Peter |  1234 |  17 |
| Anna  |  4321 |  25 |

A table is re-aligned automatically each time you press TAB or RET or C-c C-c inside the table. TAB also moves to the next field (RET to the next row) and creates new table rows at the end of the table or before horizontal lines. The indentation of the table is set by the first line. Any line starting with ‘|-’ is considered as a horizontal separator line and will be expanded on the next re-align to span the whole table width. So, to create the above table, you would only type

|Name|Phone|Age|
|-

and then press TAB to align the table and start filling in fields. Even faster would be to type |Name|Phone|Age followed by C-c RET.

When typing text into a field, Org treats DEL, Backspace, and all character keys in a special way, so that inserting and deleting avoids shifting other fields. Also, when typing immediately after the cursor was moved into a new field with TAB, S-TAB or RET, the field is automatically made blank. If this behavior is too unpredictable for you, configure the options org-enable-table-editor and org-table-auto-blank-field.

Creation and conversion
C-c |     (org-table-create-or-convert-from-region)

Convert the active region to a table. If every line contains at least one TAB character, the function assumes that the material is tab separated. If every line contains a comma, comma-separated values (CSV) are assumed. If not, lines are split at whitespace into fields. You can use a prefix argument to force a specific separator: C-u forces CSV, C-u C-u forces TAB, C-u C-u C-u will prompt for a regular expression to match the separator, and a numeric argument N indicates that at least N consecutive spaces, or alternatively a TAB will be the separator.
If there is no active region, this command creates an empty Org table. But it is easier just to start typing, like |Name|Phone|Age RET |- TAB.

Re-aligning and field motion
C-c C-c     (org-table-align)

Re-align the table and don’t move to another field.

C-c SPC     (org-table-blank-field)

Blank the field at point.

<TAB>     (org-table-next-field)

Re-align the table, move to the next field. Creates a new row if necessary.

S-TAB     (org-table-previous-field)

Re-align, move to previous field.

RET     (org-table-next-row)

Re-align the table and move down to next row. Creates a new row if necessary. At the beginning or end of a line, RET still does NEWLINE, so it can be used to split a table.

M-a     (org-table-beginning-of-field)

Move to beginning of the current table field, or on to the previous field.

M-e     (org-table-end-of-field)

Move to end of the current table field, or on to the next field.

Column and row editing
M-left     (org-table-move-column-left)
M-right     (org-table-move-column-right)

Move the current column left/right.

M-S-left     (org-table-delete-column)

Kill the current column.

M-S-right     (org-table-insert-column)

Insert a new column to the left of the cursor position.

M-up     (org-table-move-row-up)
M-down     (org-table-move-row-down)

Move the current row up/down.

M-S-up     (org-table-kill-row)

Kill the current row or horizontal line.

M-S-down     (org-table-insert-row)

Insert a new row above the current row. With a prefix argument, the line is created below the current one.

C-c -     (org-table-insert-hline)

Insert a horizontal line below current row. With a prefix argument, the line is created above the current line.

C-c RET     (org-table-hline-and-move)

Insert a horizontal line below current row, and move the cursor into the row below that line.

C-c ^     (org-table-sort-lines)

Sort the table lines in the region. The position of point indicates the column to be used for sorting, and the range of lines is the range between the nearest horizontal separator lines, or the entire table. If point is before the first column, you will be prompted for the sorting column. If there is an active region, the mark specifies the first line and the sorting column, while point should be in the last line to be included into the sorting. The command prompts for the sorting type (alphabetically, numerically, or by time). You can sort in normal or reverse order. You can also supply your own key extraction and comparison functions. When called with a prefix argument, alphabetic sorting will be case-sensitive.

Regions
C-c C-x M-w     (org-table-copy-region)

Copy a rectangular region from a table to a special clipboard. Point and mark determine edge fields of the rectangle. If there is no active region, copy just the current field. The process ignores horizontal separator lines.

C-c C-x C-w     (org-table-cut-region)

Copy a rectangular region from a table to a special clipboard, and blank all fields in the rectangle. So this is the “cut” operation.

C-c C-x C-y     (org-table-paste-rectangle)

Paste a rectangular region into a table. The upper left corner ends up in the current field. All involved fields will be overwritten. If the rectangle does not fit into the present table, the table is enlarged as needed. The process ignores horizontal separator lines.

M-RET     (org-table-wrap-region)

Split the current field at the cursor position and move the rest to the line below. If there is an active region, and both point and mark are in the same column, the text in the column is wrapped to minimum width for the given number of lines. A numeric prefix argument may be used to change the number of desired lines. If there is no region, but you specify a prefix argument, the current field is made blank, and the content is appended to the field above.

Calculations
C-c +     (org-table-sum)

Sum the numbers in the current column, or in the rectangle defined by the active region. The result is shown in the echo area and can be inserted with C-y.

S-RET     (org-table-copy-down)

When current field is empty, copy from first non-empty field above. When not empty, copy current field down to next row and move cursor along with it. Depending on the option org-table-copy-increment, integer field values will be incremented during copy. Integers that are too large will not be incremented. Also, a 0 prefix argument temporarily disables the increment. This key is also used by shift-selection and related modes (see Conflicts).

Miscellaneous
C-c `     (org-table-edit-field)

Edit the current field in a separate window. This is useful for fields that are not fully visible (see Column width and alignment). When called with a C-u prefix, just make the full field visible, so that it can be edited in place. When called with two C-u prefixes, make the editor window follow the cursor through the table and always show the current field. The follow mode exits automatically when the cursor leaves the table, or when you repeat this command with C-u C-u C-c `.

M-x org-table-import RET

Import a file as a table. The table should be TAB or whitespace separated. Use, for example, to import a spreadsheet table or data from a database, because these programs generally can write TAB-separated text files. This command works by inserting the file into the buffer and then converting the region to a table. Any prefix argument is passed on to the converter, which uses it to determine the separator.

C-c |     (org-table-create-or-convert-from-region)

Tables can also be imported by pasting tabular text into the Org buffer, selecting the pasted text with C-x C-x and then using the C-c | command (see above under Creation and conversion).

M-x org-table-export RET

Export the table, by default as a TAB-separated file. Use for data exchange with, for example, spreadsheet or database programs. The format used to export the file can be configured in the option org-table-export-default-format. You may also use properties TABLE_EXPORT_FILE and TABLE_EXPORT_FORMAT to specify the file name and the format for table export in a subtree. Org supports quite general formats for exported tables. The exporter format is the same as the format used by Orgtbl radio tables, see Translator functions, for a detailed description.

If you don’t like the automatic table editor because it gets in your way on lines which you would like to start with ‘|’, you can turn it off with

(setq org-enable-table-editor nil)

Then the only table command that still works is C-c C-c to do a manual re-align.


Next: , Previous: , Up: Tables   [Contents][Index]

3.2 Column width and alignment

The width of columns is automatically determined by the table editor. And also the alignment of a column is determined automatically from the fraction of number-like versus non-number fields in the column.

Sometimes a single field or a few fields need to carry more text, leading to inconveniently wide columns. Or maybe you want to make a table with several columns having a fixed width, regardless of content. To set the width of a column, one field anywhere in the column may contain just the string ‘<N>’ where ‘N’ is an integer specifying the width of the column in characters. The next re-align will then set the width of this column to this value.

|---+------------------------------|               |---+--------|
|   |                              |               |   | <6>    |
| 1 | one                          |               | 1 | one    |
| 2 | two                          |     ----\     | 2 | two    |
| 3 | This is a long chunk of text |     ----/     | 3 | This=> |
| 4 | four                         |               | 4 | four   |
|---+------------------------------|               |---+--------|

Fields that are wider become clipped and end in the string ‘=>’. Note that the full text is still in the buffer but is hidden. To see the full text, hold the mouse over the field—a tool-tip window will show the full content. To edit such a field, use the command C-c ` (that is C-c followed by the grave accent). This will open a new window with the full field. Edit it and finish with C-c C-c.

When visiting a file containing a table with narrowed columns, the necessary character hiding has not yet happened, and the table needs to be aligned before it looks nice. Setting the option org-startup-align-all-tables will realign all tables in a file upon visiting, but also slow down startup. You can also set this option on a per-file basis with:

#+STARTUP: align
#+STARTUP: noalign

If you would like to overrule the automatic alignment of number-rich columns to the right and of string-rich columns to the left, you can use ‘<r>’, ‘<c>22 or ‘<l>’ in a similar fashion. You may also combine alignment and field width like this: ‘<r10>’.

Lines which only contain these formatting cookies will be removed automatically when exporting the document.


Next: , Previous: , Up: Tables   [Contents][Index]

3.3 Column groups

When Org exports tables, it does so by default without vertical lines because that is visually more satisfying in general. Occasionally however, vertical lines can be useful to structure a table into groups of columns, much like horizontal lines can do for groups of rows. In order to specify column groups, you can use a special row where the first field contains only ‘/’. The further fields can either contain ‘<’ to indicate that this column should start a group, ‘>’ to indicate the end of a group, or ‘<>’ (no space between ‘<’ and ‘>’) to make a column a group of its own. Boundaries between column groups will upon export be marked with vertical lines. Here is an example:

| N | N^2 | N^3 | N^4 | ~sqrt(n)~ | ~sqrt[4](N)~ |
|---+-----+-----+-----+-----------+--------------|
| / |   < |     |   > |         < |            > |
| 1 |   1 |   1 |   1 |         1 |            1 |
| 2 |   4 |   8 |  16 |    1.4142 |       1.1892 |
| 3 |   9 |  27 |  81 |    1.7321 |       1.3161 |
|---+-----+-----+-----+-----------+--------------|
#+TBLFM: $2=$1^2::$3=$1^3::$4=$1^4::$5=sqrt($1)::$6=sqrt(sqrt(($1)))

It is also sufficient to just insert the column group starters after every vertical line you would like to have:

|  N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
|----+-----+-----+-----+---------+------------|
| /  | <   |     |     | <       |            |

Next: , Previous: , Up: Tables   [Contents][Index]

3.4 The Orgtbl minor mode

If you like the intuitive way the Org table editor works, you might also want to use it in other modes like Text mode or Mail mode. The minor mode Orgtbl mode makes this possible. You can always toggle the mode with M-x orgtbl-mode RET. To turn it on by default, for example in Message mode, use

(add-hook 'message-mode-hook 'turn-on-orgtbl)

Furthermore, with some special setup, it is possible to maintain tables in arbitrary syntax with Orgtbl mode. For example, it is possible to construct LaTeX tables with the underlying ease and power of Orgtbl mode, including spreadsheet capabilities. For details, see Tables in arbitrary syntax.


Next: , Previous: , Up: Tables   [Contents][Index]

3.5 The spreadsheet

The table editor makes use of the Emacs calc package to implement spreadsheet-like capabilities. It can also evaluate Emacs Lisp forms to derive fields from other fields. While fully featured, Org’s implementation is not identical to other spreadsheets. For example, Org knows the concept of a column formula that will be applied to all non-header fields in a column without having to copy the formula to each relevant field. There is also a formula debugger, and a formula editor with features for highlighting fields in the table corresponding to the references at the point in the formula, moving these references by arrow keys


Next: , Up: The spreadsheet   [Contents][Index]

3.5.1 References

To compute fields in the table from other fields, formulas must reference other fields or ranges. In Org, fields can be referenced by name, by absolute coordinates, and by relative coordinates. To find out what the coordinates of a field are, press C-c ? in that field, or press C-c } to toggle the display of a grid.

Field references

Formulas can reference the value of another field in two ways. Like in any other spreadsheet, you may reference fields with a letter/number combination like B3, meaning the 2nd field in the 3rd row. However, Org prefers23 to use another, more general representation that looks like this:

@row$column

Column specifications can be absolute like $1, $2,...$N, or relative to the current column (i.e., the column of the field which is being computed) like $+1 or $-2. $< and $> are immutable references to the first and last column, respectively, and you can use $>>> to indicate the third column from the right.

The row specification only counts data lines and ignores horizontal separator lines (hlines). Like with columns, you can use absolute row numbers @1, @2,...@N, and row numbers relative to the current row like @+3 or @-1. @< and @> are immutable references the first and last24 row in the table, respectively. You may also specify the row relative to one of the hlines: @I refers to the first hline, @II to the second, etc. @-I refers to the first such line above the current line, @+I to the first such line below the current line. You can also write @III+2 which is the second data line after the third hline in the table.

@0 and $0 refer to the current row and column, respectively, i.e., to the row/column for the field being computed. Also, if you omit either the column or the row part of the reference, the current row/column is implied.

Org’s references with unsigned numbers are fixed references in the sense that if you use the same reference in the formula for two different fields, the same field will be referenced each time. Org’s references with signed numbers are floating references because the same reference operator can reference different fields depending on the field being calculated by the formula.

Here are a few examples:

@2$3      2nd row, 3rd column (same as C2)
$5        column 5 in the current row (same as E&)
@2        current column, row 2
@-1$-3    the field one row up, three columns to the left
@-I$2     field just under hline above current row, column 2
@>$5      field in the last row, in column 5

Range references

You may reference a rectangular range of fields by specifying two field references connected by two dots ‘..’. If both fields are in the current row, you may simply use ‘$2..$7’, but if at least one field is in a different row, you need to use the general @row$column format at least for the first field (i.e the reference must start with ‘@’ in order to be interpreted correctly). Examples:

$1..$3        first three fields in the current row
$P..$Q        range, using column names (see under Advanced)
$<<<..$>>     start in third column, continue to the last but one
@2$1..@4$3    6 fields between these two fields (same as A2..C4)
@-1$-2..@-1   3 fields in the row above, starting from 2 columns on the left
@I..II        between first and second hline, short for @I..@II

Range references return a vector of values that can be fed into Calc vector functions. Empty fields in ranges are normally suppressed, so that the vector contains only the non-empty fields. For other options with the mode switches ‘E’, ‘N’ and examples see Formula syntax for Calc.

Field coordinates in formulas

One of the very first actions during evaluation of Calc formulas and Lisp formulas is to substitute @# and $# in the formula with the row or column number of the field where the current result will go to. The traditional Lisp formula equivalents are org-table-current-dline and org-table-current-column. Examples:

if(@# % 2, $#, string(""))

Insert column number on odd rows, set field to empty on even rows.

$2 = '(identity remote(FOO, @@#$1))

Copy text or values of each row of column 1 of the table named FOO into column 2 of the current table.

@3 = 2 * remote(FOO, @1$$#)

Insert the doubled value of each column of row 1 of the table named FOO into row 3 of the current table.

For the second/third example, the table named FOO must have at least as many rows/columns as the current table. Note that this is inefficient25 for large number of rows/columns.

Named references

$name’ is interpreted as the name of a column, parameter or constant. Constants are defined globally through the option org-table-formula-constants, and locally (for the file) through a line like

#+CONSTANTS: c=299792458. pi=3.14 eps=2.4e-6

Also properties (see Properties and columns) can be used as constants in table formulas: for a property ‘:Xyz:’ use the name ‘$PROP_Xyz’, and the property will be searched in the current outline entry and in the hierarchy above it. If you have the constants.el package, it will also be used to resolve constants, including natural constants like ‘$h’ for Planck’s constant, and units like ‘$km’ for kilometers26. Column names and parameters can be specified in special table lines. These are described below, see Advanced features. All names must start with a letter, and further consist of letters and numbers.

Remote references

You may also reference constants, fields and ranges from a different table, either in the current file or even in a different file. The syntax is

remote(NAME-OR-ID,REF)

where NAME can be the name of a table in the current file as set by a #+NAME: Name line before the table. It can also be the ID of an entry, even in a different file, and the reference then refers to the first table in that entry. REF is an absolute field or range reference as described above for example @3$3 or $somename, valid in the referenced table.

Indirection of NAME-OR-ID: When NAME-OR-ID has the format @ROW$COLUMN it will be substituted with the name or ID found in this field of the current table. For example remote($1, @>$2) => remote(year_2013, @>$1). The format B3 is not supported because it can not be distinguished from a plain table name or ID.


Next: , Previous: , Up: The spreadsheet   [Contents][Index]

3.5.2 Formula syntax for Calc

A formula can be any algebraic expression understood by the Emacs Calc package. Note that calc has the non-standard convention that ‘/’ has lower precedence than ‘*’, so that ‘a/b*c’ is interpreted as ‘a/(b*c)’. Before evaluation by calc-eval (see Calling Calc from Your Lisp Programs in GNU Emacs Calc Manual), variable substitution takes place according to the rules described above. The range vectors can be directly fed into the Calc vector functions like ‘vmean’ and ‘vsum’.

A formula can contain an optional mode string after a semicolon. This string consists of flags to influence Calc and other modes during execution. By default, Org use