3 @setfilename ../../info/org
4 @settitle The Org Manual
9 @c Version and Contact Info
10 @set MAINTAINERSITE @uref{http://orgmode.org,maintainers webpage}
11 @set AUTHOR Carsten Dominik
12 @set MAINTAINER Carsten Dominik
13 @set MAINTAINEREMAIL @email{carsten at orgmode dot org}
14 @set MAINTAINERCONTACT @uref{mailto:carsten at orgmode dot org,contact the maintainer}
20 @c @hyphenation{time-stamp time-stamps time-stamp-ing time-stamp-ed}
35 @c Subheadings inside a table.
36 @macro tsubheading{text}
46 This manual is for Org version @value{VERSION}.
48 Copyright @copyright{} 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation
51 Permission is granted to copy, distribute and/or modify this document
52 under the terms of the GNU Free Documentation License, Version 1.3 or
53 any later version published by the Free Software Foundation; with no
54 Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
55 and with the Back-Cover Texts as in (a) below. A copy of the license
56 is included in the section entitled ``GNU Free Documentation License.''
58 (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
59 modify this GNU manual. Buying copies from the FSF supports it in
60 developing GNU and promoting software freedom.''
62 This document is part of a collection distributed under the GNU Free
63 Documentation License. If you want to distribute this document
64 separately from the collection, you can do so by adding a copy of the
65 license to the document, as described in section 6 of the license.
71 * Org Mode: (org). Outline-based notes management and organizer
77 @subtitle Release @value{VERSION}
78 @author by Carsten Dominik
80 @c The following two commands start the copyright page.
82 @vskip 0pt plus 1filll
86 @c Output the table of contents at the beginning.
90 @node Top, Introduction, (dir), (dir)
97 * Introduction:: Getting started
98 * Document Structure:: A tree works like your brain
99 * Tables:: Pure magic for quick formatting
100 * Hyperlinks:: Notes in context
101 * TODO Items:: Every tree branch can be a TODO item
102 * Tags:: Tagging headlines and matching sets of tags
103 * Properties and Columns:: Storing information about an entry
104 * Dates and Times:: Making items useful for planning
105 * Capture - Refile - Archive:: The ins and outs for projects
106 * Agenda Views:: Collecting information into views
107 * Markup:: Prepare text for rich export
108 * Exporting:: Sharing and publishing of notes
109 * Publishing:: Create a web site of linked Org files
110 * Miscellaneous:: All the rest which did not fit elsewhere
111 * Hacking:: How to hack your way around
112 * MobileOrg:: Viewing and capture on a mobile device
113 * History and Acknowledgments:: How Org came into being
114 * Main Index:: An index of Org's concepts and features
115 * Key Index:: Key bindings and where they are described
116 * Variable Index:: Variables mentioned in the manual
119 --- The Detailed Node Listing ---
123 * Summary:: Brief summary of what Org does
124 * Installation:: How to install a downloaded version of Org
125 * Activation:: How to activate Org for certain buffers
126 * Feedback:: Bug reports, ideas, patches etc.
127 * Conventions:: Type-setting conventions in the manual
131 * Outlines:: Org is based on Outline mode
132 * Headlines:: How to typeset Org tree headlines
133 * Visibility cycling:: Show and hide, much simplified
134 * Motion:: Jumping to other headlines
135 * Structure editing:: Changing sequence and level of headlines
136 * Sparse trees:: Matches embedded in context
137 * Plain lists:: Additional structure within an entry
138 * Drawers:: Tucking stuff away
139 * Blocks:: Folding blocks
140 * Footnotes:: How footnotes are defined in Org's syntax
141 * Orgstruct mode:: Structure editing outside Org
145 * Built-in table editor:: Simple tables
146 * Column width and alignment:: Overrule the automatic settings
147 * Column groups:: Grouping to trigger vertical lines
148 * Orgtbl mode:: The table editor as minor mode
149 * The spreadsheet:: The table editor has spreadsheet capabilities
150 * Org-Plot:: Plotting from org tables
154 * References:: How to refer to another field or range
155 * Formula syntax for Calc:: Using Calc to compute stuff
156 * Formula syntax for Lisp:: Writing formulas in Emacs Lisp
157 * Field formulas:: Formulas valid for a single field
158 * Column formulas:: Formulas valid for an entire column
159 * Editing and debugging formulas:: Fixing formulas
160 * Updating the table:: Recomputing all dependent fields
161 * Advanced features:: Field names, parameters and automatic recalc
165 * Link format:: How links in Org are formatted
166 * Internal links:: Links to other places in the current file
167 * External links:: URL-like links to the world
168 * Handling links:: Creating, inserting and following
169 * Using links outside Org:: Linking from my C source code?
170 * Link abbreviations:: Shortcuts for writing complex links
171 * Search options:: Linking to a specific location
172 * Custom searches:: When the default search is not enough
176 * Radio targets:: Make targets trigger links in plain text
180 * TODO basics:: Marking and displaying TODO entries
181 * TODO extensions:: Workflow and assignments
182 * Progress logging:: Dates and notes for progress
183 * Priorities:: Some things are more important than others
184 * Breaking down tasks:: Splitting a task into manageable pieces
185 * Checkboxes:: Tick-off lists
187 Extended use of TODO keywords
189 * Workflow states:: From TODO to DONE in steps
190 * TODO types:: I do this, Fred does the rest
191 * Multiple sets in one file:: Mixing it all, and still finding your way
192 * Fast access to TODO states:: Single letter selection of a state
193 * Per-file keywords:: Different files, different requirements
194 * Faces for TODO keywords:: Highlighting states
195 * TODO dependencies:: When one task needs to wait for others
199 * Closing items:: When was this entry marked DONE?
200 * Tracking TODO state changes:: When did the status change?
204 * Tag inheritance:: Tags use the tree structure of the outline
205 * Setting tags:: How to assign tags to a headline
206 * Tag searches:: Searching for combinations of tags
208 Properties and Columns
210 * Property syntax:: How properties are spelled out
211 * Special properties:: Access to other Org mode features
212 * Property searches:: Matching property values
213 * Property inheritance:: Passing values down the tree
214 * Column view:: Tabular viewing and editing
215 * Property API:: Properties for Lisp programmers
219 * Defining columns:: The COLUMNS format property
220 * Using column view:: How to create and use column view
221 * Capturing column view:: A dynamic block for column view
225 * Scope of column definitions:: Where defined, where valid?
226 * Column attributes:: Appearance and content of a column
230 * Timestamps:: Assigning a time to a tree entry
231 * Creating timestamps:: Commands which insert timestamps
232 * Deadlines and scheduling:: Planning your work
233 * Clocking work time:: Tracking how long you spend on a task
234 * Effort estimates:: Planning work effort in advance
235 * Relative timer:: Notes with a running timer
239 * The date/time prompt:: How Org mode helps you entering date and time
240 * Custom time format:: Making dates look different
242 Deadlines and scheduling
244 * Inserting deadline/schedule:: Planning items
245 * Repeated tasks:: Items that show up again and again
247 Capture - Refile - Archive
249 * Remember:: Capture new tasks/ideas with little interruption
250 * Attachments:: Add files to tasks.
251 * RSS Feeds:: Getting input from RSS feeds
252 * Protocols:: External (e.g. Browser) access to Emacs and Org
253 * Refiling notes:: Moving a tree from one place to another
254 * Archiving:: What to do with finished projects
258 * Setting up Remember for Org:: Some code for .emacs to get things going
259 * Remember templates:: Define the outline of different note types
260 * Storing notes:: Directly get the note to where it belongs
264 * Moving subtrees:: Moving a tree to an archive file
265 * Internal archiving:: Switch off a tree but keep i in the file
269 * Agenda files:: Files being searched for agenda information
270 * Agenda dispatcher:: Keyboard access to agenda views
271 * Built-in agenda views:: What is available out of the box?
272 * Presentation and sorting:: How agenda items are prepared for display
273 * Agenda commands:: Remote editing of Org trees
274 * Custom agenda views:: Defining special searches and views
275 * Exporting Agenda Views:: Writing a view to a file
276 * Agenda column view:: Using column view for collected entries
278 The built-in agenda views
280 * Weekly/daily agenda:: The calendar page with current tasks
281 * Global TODO list:: All unfinished action items
282 * Matching tags and properties:: Structured information with fine-tuned search
283 * Timeline:: Time-sorted view for single file
284 * Keyword search:: Finding entries by keyword
285 * Stuck projects:: Find projects you need to review
287 Presentation and sorting
289 * Categories:: Not all tasks are equal
290 * Time-of-day specifications:: How the agenda knows the time
291 * Sorting of agenda items:: The order of things
295 * Storing searches:: Type once, use often
296 * Block agenda:: All the stuff you need in a single buffer
297 * Setting Options:: Changing the rules
299 Markup for rich export
301 * Structural markup elements:: The basic structure as seen by the exporter
302 * Images and tables:: Tables and Images will be included
303 * Literal examples:: Source code examples with special formatting
304 * Include files:: Include additional files into a document
305 * Macro replacement:: Use macros to create complex output
306 * Embedded LaTeX:: LaTeX can be freely used inside Org documents
308 Structural markup elements
310 * Document title:: Where the title is taken from
311 * Headings and sections:: The document structure as seen by the exporter
312 * Table of contents:: The if and where of the table of contents
313 * Initial text:: Text before the first heading?
315 * Paragraphs:: Paragraphs
316 * Footnote markup:: Footnotes
317 * Emphasis and monospace:: Bold, italic, etc.
318 * Horizontal rules:: Make a line
319 * Comment lines:: What will *not* be exported
323 * Special symbols:: Greek letters and other symbols
324 * Subscripts and superscripts:: Simple syntax for raising/lowering text
325 * LaTeX fragments:: Complex formulas made easy
326 * Previewing LaTeX fragments:: What will this snippet look like?
327 * CDLaTeX mode:: Speed up entering of formulas
331 * Selective export:: Using tags to select and exclude trees
332 * Export options:: Per-file export settings
333 * The export dispatcher:: How to access exporter commands
334 * ASCII export:: Exporting to plain ASCII
335 * HTML export:: Exporting to HTML
336 * LaTeX and PDF export:: Exporting to La@TeX{}, and processing to PDF
337 * DocBook export:: Exporting to DocBook
338 * XOXO export:: Exporting to XOXO
339 * iCalendar export:: Exporting in iCalendar format
343 * HTML Export commands:: How to invoke HTML export
344 * Quoting HTML tags:: Using direct HTML in Org mode
345 * Links in HTML export:: How links will be interpreted and formatted
346 * Tables in HTML export:: How to modify the formatting of tables
347 * Images in HTML export:: How to insert figures into HTML output
348 * Text areas in HTML export:: An alternative way to show an example
349 * CSS support:: Changing the appearance of the output
350 * Javascript support:: Info and Folding in a web browser
352 La@TeX{} and PDF export
354 * LaTeX/PDF export commands:: Which key invokes which commands
355 * Quoting LaTeX code:: Incorporating literal La@TeX{} code
356 * Sectioning structure:: Changing sectioning in La@TeX{} output
357 * Tables in LaTeX export:: Options for exporting tables to La@TeX{}
358 * Images in LaTeX export:: How to insert figures into La@TeX{} output
362 * DocBook export commands:: How to invoke DocBook export
363 * Quoting DocBook code:: Incorporating DocBook code in Org files
364 * Recursive sections:: Recursive sections in DocBook
365 * Tables in DocBook export:: Tables are exported as HTML tables
366 * Images in DocBook export:: How to insert figures into DocBook output
367 * Special characters:: How to handle special characters
371 * Configuration:: Defining projects
372 * Uploading files:: How to get files up on the server
373 * Sample configuration:: Example projects
374 * Triggering publication:: Publication commands
378 * Project alist:: The central configuration variable
379 * Sources and destinations:: From here to there
380 * Selecting files:: What files are part of the project?
381 * Publishing action:: Setting the function doing the publishing
382 * Publishing options:: Tweaking HTML export
383 * Publishing links:: Which links keep working after publishing?
384 * Project page index:: Publishing a list of project files
388 * Simple example:: One-component publishing
389 * Complex example:: A multi-component publishing example
393 * Completion:: M-TAB knows what you need
394 * Customization:: Adapting Org to your taste
395 * In-buffer settings:: Overview of the #+KEYWORDS
396 * The very busy C-c C-c key:: When in doubt, press C-c C-c
397 * Clean view:: Getting rid of leading stars in the outline
398 * TTY keys:: Using Org on a tty
399 * Interaction:: Other Emacs packages
401 Interaction with other packages
403 * Cooperation:: Packages Org cooperates with
404 * Conflicts:: Packages that lead to conflicts
408 * Hooks:: Who to reach into Org's internals
409 * Add-on packages:: Available extensions
410 * Adding hyperlink types:: New custom link types
411 * Context-sensitive commands:: How to add functionality to such commands
412 * Tables in arbitrary syntax:: Orgtbl for La@TeX{} and other programs
413 * Dynamic blocks:: Automatically filled blocks
414 * Special agenda views:: Customized views
415 * Extracting agenda information:: Postprocessing of agenda information
416 * Using the property API:: Writing programs that use entry properties
417 * Using the mapping API:: Mapping over all or selected entries
419 Tables and lists in arbitrary syntax
421 * Radio tables:: Sending and receiving radio tables
422 * A LaTeX example:: Step by step, almost a tutorial
423 * Translator functions:: Copy and modify
424 * Radio lists:: Doing the same for lists
428 * Setting up the staging area:: Where to interact with the mobile device
429 * Pushing to MobileOrg:: Uploading Org files and agendas
430 * Pulling from MobileOrg:: Integrating captured and flagged items
435 @node Introduction, Document Structure, Top, Top
436 @chapter Introduction
440 * Summary:: Brief summary of what Org does
441 * Installation:: How to install a downloaded version of Org
442 * Activation:: How to activate Org for certain buffers
443 * Feedback:: Bug reports, ideas, patches etc.
444 * Conventions:: Type-setting conventions in the manual
447 @node Summary, Installation, Introduction, Introduction
451 Org is a mode for keeping notes, maintaining TODO lists, and doing
452 project planning with a fast and effective plain-text system.
454 Org develops organizational tasks around NOTES files that contain
455 lists or information about projects as plain text. Org is
456 implemented on top of Outline mode, which makes it possible to keep the
457 content of large files well structured. Visibility cycling and
458 structure editing help to work with the tree. Tables are easily created
459 with a built-in table editor. Org supports TODO items, deadlines,
460 timestamps, and scheduling. It dynamically compiles entries into an
461 agenda that utilizes and smoothly integrates much of the Emacs calendar
462 and diary. Plain text URL-like links connect to websites, emails,
463 Usenet messages, BBDB entries, and any files related to the projects.
464 For printing and sharing of notes, an Org file can be exported as a
465 structured ASCII file, as HTML, or (TODO and agenda items only) as an
466 iCalendar file. It can also serve as a publishing tool for a set of
469 An important design aspect that distinguishes Org from, for example,
470 Planner/Muse is that it encourages you to store every piece of information
471 only once. In Planner, you have project pages, day pages and possibly
472 other files, duplicating some information such as tasks. In Org,
473 you only have notes files. In your notes you mark entries as tasks, and
474 label them with tags and timestamps. All necessary lists, like a
475 schedule for the day, the agenda for a meeting, tasks lists selected by
476 tags, etc., are created dynamically when you need them.
478 Org keeps simple things simple. When first fired up, it should
479 feel like a straightforward, easy to use outliner. Complexity is not
480 imposed, but a large amount of functionality is available when you need
481 it. Org is a toolbox and can be used in different ways, for
485 @r{@bullet{} an outline extension with visibility cycling and structure editing}
486 @r{@bullet{} an ASCII system and table editor for taking structured notes}
487 @r{@bullet{} an ASCII table editor with spreadsheet-like capabilities}
488 @r{@bullet{} a TODO list editor}
489 @r{@bullet{} a full agenda and planner with deadlines and work scheduling}
490 @pindex GTD, Getting Things Done
491 @r{@bullet{} an environment to implement David Allen's GTD system}
492 @r{@bullet{} a basic database application}
493 @r{@bullet{} a simple hypertext system, with HTML and La@TeX{} export}
494 @r{@bullet{} a publishing tool to create a set of interlinked webpages}
497 Org's automatic, context-sensitive table editor with spreadsheet
498 capabilities can be integrated into any major mode by activating the
499 minor Orgtbl mode. Using a translation step, it can be used to maintain
500 tables in arbitrary file types, for example in La@TeX{}. The structure
501 editing and list creation capabilities can be used outside Org with
502 the minor Orgstruct mode.
505 There is a website for Org which provides links to the newest
506 version of Org, as well as additional information, frequently asked
507 questions (FAQ), links to tutorials, etc@. This page is located at
508 @uref{http://orgmode.org}.
513 @node Installation, Activation, Summary, Introduction
514 @section Installation
518 @b{Important:} @i{If you are using a version of Org that is part of the Emacs
519 distribution or an XEmacs package, please skip this section and go directly
520 to @ref{Activation}.}
522 If you have downloaded Org from the Web, either as a distribution @file{.zip}
523 or @file{.tar} file, or as a Git archive, you must take the following steps
524 to install it: go into the unpacked Org distribution directory and edit the
525 top section of the file @file{Makefile}. You must set the name of the Emacs
526 binary (likely either @file{emacs} or @file{xemacs}), and the paths to the
527 directories where local Lisp and Info files are kept. If you don't have
528 access to the system-wide directories, you can simply run Org directly from
529 the distribution directory by adding the @file{lisp} subdirectory to the
530 Emacs load path. To do this, add the following line to @file{.emacs}:
533 (setq load-path (cons "~/path/to/orgdir/lisp" load-path))
537 If you plan to use code from the @file{contrib} subdirectory, do a similar
538 step for this directory:
541 (setq load-path (cons "~/path/to/orgdir/contrib/lisp" load-path))
546 XEmacs users now need to install the file @file{noutline.el} from
547 the @file{xemacs} sub-directory of the Org distribution. Use the
551 make install-noutline
556 @noindent Now byte-compile the Lisp files with the shell command:
562 @noindent If you are running Org from the distribution directory, this is
563 all. If you want to install Org into the system directories, use (as
570 Installing Info files is system dependent, because of differences in the
571 @file{install-info} program. In Debian it copies the info files into the
572 correct directory and modifies the info directory file. In many other
573 systems, the files need to be copied to the correct directory separately, and
574 @file{install-info} then only modifies the directory file. Check your system
575 documentation to find out which of the following commands you need:
579 make install-info-debian
582 Then add the following line to @file{.emacs}. It is needed so that
583 Emacs can autoload functions that are located in files not immediately loaded
584 when Org-mode starts.
586 (require 'org-install)
589 Do not forget to activate Org as described in the following section.
592 @node Activation, Feedback, Installation, Introduction
596 @cindex global key bindings
597 @cindex key bindings, global
600 @b{Important:} @i{If you use copy-and-paste to copy Lisp code from the
601 PDF documentation as viewed by some PDF viewers to your @file{.emacs} file, the
602 single-quote character comes out incorrectly and the code will not work.
603 You need to fix the single-quotes by hand, or copy from Info
607 Add the following lines to your @file{.emacs} file. The last three lines
608 define @emph{global} keys for the commands @command{org-store-link},
609 @command{org-agenda}, and @command{org-iswitchb}---please choose suitable
613 ;; The following lines are always needed. Choose your own keys.
614 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
615 (global-set-key "\C-cl" 'org-store-link)
616 (global-set-key "\C-ca" 'org-agenda)
617 (global-set-key "\C-cb" 'org-iswitchb)
620 Furthermore, you must activate @code{font-lock-mode} in Org
621 buffers, because significant functionality depends on font-locking being
622 active. You can do this with either one of the following two lines
623 (XEmacs users must use the second option):
625 (global-font-lock-mode 1) ; for all buffers
626 (add-hook 'org-mode-hook 'turn-on-font-lock) ; Org buffers only
629 @cindex Org mode, turning on
630 With this setup, all files with extension @samp{.org} will be put
631 into Org mode. As an alternative, make the first line of a file look
635 MY PROJECTS -*- mode: org; -*-
638 @vindex org-insert-mode-line-in-empty-file
639 @noindent which will select Org mode for this buffer no matter what
640 the file's name is. See also the variable
641 @code{org-insert-mode-line-in-empty-file}.
643 Many commands in Org work on the region if the region is @i{active}. To make
644 use of this, you need to have @code{transient-mark-mode}
645 (@code{zmacs-regions} in XEmacs) turned on. In Emacs 23 this is the default,
646 in Emacs 22 you need to do this yourself with
648 (transient-mark-mode 1)
650 @noindent If you do not like @code{transient-mark-mode}, you can create an
651 active region by using the mouse to select a region, or pressing
652 @kbd{C-@key{SPC}} twice before moving the cursor.
654 @node Feedback, Conventions, Activation, Introduction
661 If you find problems with Org, or if you have questions, remarks, or ideas
662 about it, please mail to the Org mailing list @email{emacs-orgmode@@gnu.org}.
663 If you are not a member of the mailing list, your mail will be passed to the
664 list after a moderator has approved it.
666 For bug reports, please provide as much information as possible, including
667 the version information of Emacs (@kbd{M-x emacs-version @key{RET}}) and Org
668 (@kbd{M-x org-version @key{RET}}), as well as the Org related setup in
669 @file{.emacs}. The easiest way to do this is to use the command
671 @kbd{M-x org-submit-bug-report}
673 @noindent which will put all this information into an Emacs mail buffer so
674 that you only need to add your description. If you re not sending the Email
675 from within Emacs, please copy and paste the content into your Email program.
677 If an error occurs, a backtrace can be very useful (see below on how to
678 create one). Often a small example file helps, along with clear information
682 @item What exactly did you do?
683 @item What did you expect to happen?
684 @item What happened instead?
686 @noindent Thank you for helping to improve this mode.
688 @subsubheading How to create a useful backtrace
690 @cindex backtrace of an error
691 If working with Org produces an error with a message you don't
692 understand, you may have hit a bug. The best way to report this is by
693 providing, in addition to what was mentioned above, a @emph{backtrace}.
694 This is information from the built-in debugger about where and how the
695 error occurred. Here is how to produce a useful backtrace:
699 Reload uncompiled versions of all Org-mode Lisp files. The backtrace
700 contains much more information if it is produced with uncompiled code.
703 C-u M-x org-reload RET
706 or select @code{Org -> Refresh/Reload -> Reload Org uncompiled} from the
709 Go to the @code{Options} menu and select @code{Enter Debugger on Error}
710 (XEmacs has this option in the @code{Troubleshooting} sub-menu).
712 Do whatever you have to do to hit the error. Don't forget to
713 document the steps you take.
715 When you hit the error, a @file{*Backtrace*} buffer will appear on the
716 screen. Save this buffer to a file (for example using @kbd{C-x C-w}) and
717 attach it to your bug report.
720 @node Conventions, , Feedback, Introduction
721 @section Typesetting conventions used in this manual
723 Org uses three types of keywords: TODO keywords, tags, and property
724 names. In this manual we use the following conventions:
729 TODO keywords are written with all capitals, even if they are
733 User-defined tags are written in lowercase; built-in tags with special
734 meaning are written with all capitals.
737 User-defined properties are capitalized; built-in properties with
738 special meaning are written with all capitals.
741 @node Document Structure, Tables, Introduction, Top
742 @chapter Document Structure
743 @cindex document structure
744 @cindex structure of document
746 Org is based on Outline mode and provides flexible commands to
747 edit the structure of the document.
750 * Outlines:: Org is based on Outline mode
751 * Headlines:: How to typeset Org tree headlines
752 * Visibility cycling:: Show and hide, much simplified
753 * Motion:: Jumping to other headlines
754 * Structure editing:: Changing sequence and level of headlines
755 * Sparse trees:: Matches embedded in context
756 * Plain lists:: Additional structure within an entry
757 * Drawers:: Tucking stuff away
758 * Blocks:: Folding blocks
759 * Footnotes:: How footnotes are defined in Org's syntax
760 * Orgstruct mode:: Structure editing outside Org
763 @node Outlines, Headlines, Document Structure, Document Structure
768 Org is implemented on top of Outline mode. Outlines allow a
769 document to be organized in a hierarchical structure, which (at least
770 for me) is the best representation of notes and thoughts. An overview
771 of this structure is achieved by folding (hiding) large parts of the
772 document to show only the general document structure and the parts
773 currently being worked on. Org greatly simplifies the use of
774 outlines by compressing the entire show/hide functionality into a single
775 command, @command{org-cycle}, which is bound to the @key{TAB} key.
777 @node Headlines, Visibility cycling, Outlines, Document Structure
781 @vindex org-special-ctrl-a/e
783 Headlines define the structure of an outline tree. The headlines in
784 Org start with one or more stars, on the left margin@footnote{See
785 the variable @code{org-special-ctrl-a/e} to configure special behavior
786 of @kbd{C-a} and @kbd{C-e} in headlines.}. For example:
796 * Another top level headline
799 @noindent Some people find the many stars too noisy and would prefer an
800 outline that has whitespace followed by a single star as headline
801 starters. @ref{Clean view}, describes a setup to realize this.
803 @vindex org-cycle-separator-lines
804 An empty line after the end of a subtree is considered part of it and
805 will be hidden when the subtree is folded. However, if you leave at
806 least two empty lines, one empty line will remain visible after folding
807 the subtree, in order to structure the collapsed view. See the
808 variable @code{org-cycle-separator-lines} to modify this behavior.
810 @node Visibility cycling, Motion, Headlines, Document Structure
811 @section Visibility cycling
812 @cindex cycling, visibility
813 @cindex visibility cycling
814 @cindex trees, visibility
815 @cindex show hidden text
818 Outlines make it possible to hide parts of the text in the buffer.
819 Org uses just two commands, bound to @key{TAB} and
820 @kbd{S-@key{TAB}} to change the visibility in the buffer.
822 @cindex subtree visibility states
823 @cindex subtree cycling
824 @cindex folded, subtree visibility state
825 @cindex children, subtree visibility state
826 @cindex subtree, subtree visibility state
830 @emph{Subtree cycling}: Rotate current subtree among the states
833 ,-> FOLDED -> CHILDREN -> SUBTREE --.
834 '-----------------------------------'
837 @vindex org-cycle-emulate-tab
838 @vindex org-cycle-global-at-bob
839 The cursor must be on a headline for this to work@footnote{see, however,
840 the option @code{org-cycle-emulate-tab}.}. When the cursor is at the
841 beginning of the buffer and the first line is not a headline, then
842 @key{TAB} actually runs global cycling (see below)@footnote{see the
843 option @code{org-cycle-global-at-bob}.}. Also when called with a prefix
844 argument (@kbd{C-u @key{TAB}}), global cycling is invoked.
846 @cindex global visibility states
847 @cindex global cycling
848 @cindex overview, global visibility state
849 @cindex contents, global visibility state
850 @cindex show all, global visibility state
854 @emph{Global cycling}: Rotate the entire buffer among the states
857 ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
858 '--------------------------------------'
861 When @kbd{S-@key{TAB}} is called with a numeric prefix argument N, the
862 CONTENTS view up to headlines of level N will be shown. Note that inside
863 tables, @kbd{S-@key{TAB}} jumps to the previous field.
865 @cindex show all, command
866 @kindex C-u C-u C-u @key{TAB}
867 @item C-u C-u C-u @key{TAB}
868 Show all, including drawers.
871 Reveal context around point, showing the current entry, the following heading
872 and the hierarchy above. Useful for working near a location that has been
873 exposed by a sparse tree command (@pxref{Sparse trees}) or an agenda command
874 (@pxref{Agenda commands}). With a prefix argument show, on each
875 level, all sibling headings.
878 Show the current subtree in an indirect buffer@footnote{The indirect
881 (@pxref{Indirect Buffers,,,emacs,GNU Emacs Manual})
884 (see the Emacs manual for more information about indirect buffers)
886 will contain the entire buffer, but will be narrowed to the current
887 tree. Editing the indirect buffer will also change the original buffer,
888 but without affecting visibility in that buffer.}. With a numeric
889 prefix argument N, go up to level N and then take that tree. If N is
890 negative then go up that many levels. With a @kbd{C-u} prefix, do not remove
891 the previously used indirect buffer.
894 @vindex org-startup-folded
895 @cindex @code{overview}, STARTUP keyword
896 @cindex @code{content}, STARTUP keyword
897 @cindex @code{showall}, STARTUP keyword
898 @cindex @code{showeverything}, STARTUP keyword
900 When Emacs first visits an Org file, the global state is set to
901 OVERVIEW, i.e. only the top level headlines are visible. This can be
902 configured through the variable @code{org-startup-folded}, or on a
903 per-file basis by adding one of the following lines anywhere in the
910 #+STARTUP: showeverything
913 @cindex property, VISIBILITY
915 Furthermore, any entries with a @samp{VISIBILITY} property (@pxref{Properties
916 and Columns}) will get their visibility adapted accordingly. Allowed values
917 for this property are @code{folded}, @code{children}, @code{content}, and
920 @kindex C-u C-u @key{TAB}
921 @item C-u C-u @key{TAB}
922 Switch back to the startup visibility of the buffer, i.e. whatever is
923 requested by startup options and @samp{VISIBILITY} properties in individual
927 @node Motion, Structure editing, Visibility cycling, Document Structure
929 @cindex motion, between headlines
930 @cindex jumping, to headlines
931 @cindex headline navigation
932 The following commands jump to other headlines in the buffer.
943 Next heading same level.
946 Previous heading same level.
949 Backward to higher level heading.
952 Jump to a different place without changing the current outline
953 visibility. Shows the document structure in a temporary buffer, where
954 you can use the following keys to find your destination:
955 @vindex org-goto-auto-isearch
957 @key{TAB} @r{Cycle visibility.}
958 @key{down} / @key{up} @r{Next/previous visible headline.}
959 @key{RET} @r{Select this location.}
960 @kbd{/} @r{Do a Sparse-tree search}
961 @r{The following keys work if you turn off @code{org-goto-auto-isearch}}
962 n / p @r{Next/previous visible headline.}
963 f / b @r{Next/previous headline same level.}
965 0-9 @r{Digit argument.}
968 @vindex org-goto-interface
970 See also the variable @code{org-goto-interface}.
973 @node Structure editing, Sparse trees, Motion, Document Structure
974 @section Structure editing
975 @cindex structure editing
976 @cindex headline, promotion and demotion
977 @cindex promotion, of subtrees
978 @cindex demotion, of subtrees
979 @cindex subtree, cut and paste
980 @cindex pasting, of subtrees
981 @cindex cutting, of subtrees
982 @cindex copying, of subtrees
983 @cindex sorting, of subtrees
984 @cindex subtrees, cut and paste
989 @vindex org-M-RET-may-split-line
990 Insert new heading with same level as current. If the cursor is in a
991 plain list item, a new item is created (@pxref{Plain lists}). To force
992 creation of a new headline, use a prefix argument, or first press @key{RET}
993 to get to the beginning of the next line. When this command is used in
994 the middle of a line, the line is split and the rest of the line becomes
995 the new headline@footnote{If you do not want the line to be split,
996 customize the variable @code{org-M-RET-may-split-line}.}. If the
997 command is used at the beginning of a headline, the new headline is
998 created before the current line. If at the beginning of any other line,
999 the content of that line is made the new heading. If the command is
1000 used at the end of a folded subtree (i.e. behind the ellipses at the end
1001 of a headline), then a headline like the current one will be inserted
1002 after the end of the subtree.
1005 Just like @kbd{M-@key{RET}}, except when adding a new heading below the
1006 current heading, the new heading is placed after the body instead of before
1007 it. This command works from anywhere in the entry.
1008 @kindex M-S-@key{RET}
1010 @vindex org-treat-insert-todo-heading-as-state-change
1011 Insert new TODO entry with same level as current heading. See also the
1012 variable @code{org-treat-insert-todo-heading-as-state-change}.
1013 @kindex C-S-@key{RET}
1015 Insert new TODO entry with same level as current heading. Like
1016 @kbd{C-@key{RET}}, the new headline will be inserted after the current
1018 @kindex M-@key{left}
1020 Promote current heading by one level.
1021 @kindex M-@key{right}
1023 Demote current heading by one level.
1024 @kindex M-S-@key{left}
1025 @item M-S-@key{left}
1026 Promote the current subtree by one level.
1027 @kindex M-S-@key{right}
1028 @item M-S-@key{right}
1029 Demote the current subtree by one level.
1030 @kindex M-S-@key{up}
1032 Move subtree up (swap with previous subtree of same
1034 @kindex M-S-@key{down}
1035 @item M-S-@key{down}
1036 Move subtree down (swap with next subtree of same level).
1039 Kill subtree, i.e. remove it from buffer but save in kill ring.
1040 With a numeric prefix argument N, kill N sequential subtrees.
1043 Copy subtree to kill ring. With a numeric prefix argument N, copy the N
1044 sequential subtrees.
1047 Yank subtree from kill ring. This does modify the level of the subtree to
1048 make sure the tree fits in nicely at the yank position. The yank level can
1049 also be specified with a numeric prefix argument, or by yanking after a
1050 headline marker like @samp{****}.
1053 @vindex org-yank-adjusted-subtrees
1054 @vindex org-yank-folded-subtrees
1055 Depending on the variables @code{org-yank-adjusted-subtrees} and
1056 @code{org-yank-folded-subtrees}, Org's internal @code{yank} command will
1057 paste subtrees folded and in a clever way, using the same command as @kbd{C-c
1058 C-x C-y}. With the default settings, no level adjustment will take place,
1059 but the yanked tree will be folded unless doing so would swallow text
1060 previously visible. Any prefix argument to this command will force a normal
1061 @code{yank} to be executed, with the prefix passed along. A good way to
1062 force a normal yank is @kbd{C-u C-y}. If you use @code{yank-pop} after a
1063 yank, it will yank previous kill items plainly, without adjustment and
1067 Clone a subtree by making a number of sibling copies of it. You will be
1068 prompted for the number of copies to make, and you can also specify if any
1069 timestamps in the entry should be shifted. This can be useful, for example,
1070 to create a number of tasks related to a series of lectures to prepare. For
1071 more details, see the docstring of the command
1072 @code{org-clone-subtree-with-time-shift}.
1075 Refile entry or region to a different location. @xref{Refiling notes}.
1078 Sort same-level entries. When there is an active region, all entries in the
1079 region will be sorted. Otherwise the children of the current headline are
1080 sorted. The command prompts for the sorting method, which can be
1081 alphabetically, numerically, by time (first timestamp with active preferred,
1082 creation time, scheduled time, deadline time), by priority, by TODO keyword
1083 (in the sequence the keywords have been defined in the setup) or by the value
1084 of a property. Reverse sorting is possible as well. You can also supply
1085 your own function to extract the sorting key. With a @kbd{C-u} prefix,
1086 sorting will be case-sensitive. With two @kbd{C-u C-u} prefixes, duplicate
1087 entries will also be removed.
1090 Narrow buffer to current subtree.
1093 Widen buffer to remove narrowing.
1096 Turn a normal line or plain list item into a headline (so that it becomes a
1097 subheading at its location). Also turn a headline into a normal line by
1098 removing the stars. If there is an active region, turn all lines in the
1099 region into headlines. If the first line in the region was an item, turn
1100 only the item lines into headlines. Finally, if the first line is a
1101 headline, remove the stars from all headlines in the region.
1104 @cindex region, active
1105 @cindex active region
1106 @cindex transient mark mode
1107 When there is an active region (Transient Mark mode), promotion and
1108 demotion work on all headlines in the region. To select a region of
1109 headlines, it is best to place both point and mark at the beginning of a
1110 line, mark at the beginning of the first headline, and point at the line
1111 just after the last headline to change. Note that when the cursor is
1112 inside a table (@pxref{Tables}), the Meta-Cursor keys have different
1116 @node Sparse trees, Plain lists, Structure editing, Document Structure
1117 @section Sparse trees
1118 @cindex sparse trees
1119 @cindex trees, sparse
1120 @cindex folding, sparse trees
1121 @cindex occur, command
1123 @vindex org-show-hierarchy-above
1124 @vindex org-show-following-heading
1125 @vindex org-show-siblings
1126 @vindex org-show-entry-below
1127 An important feature of Org mode is the ability to construct @emph{sparse
1128 trees} for selected information in an outline tree, so that the entire
1129 document is folded as much as possible, but the selected information is made
1130 visible along with the headline structure above it@footnote{See also the
1131 variables @code{org-show-hierarchy-above}, @code{org-show-following-heading},
1132 @code{org-show-siblings}, and @code{org-show-entry-below} for detailed
1133 control on how much context is shown around each match.}. Just try it out
1134 and you will see immediately how it works.
1136 Org mode contains several commands creating such trees, all these
1137 commands can be accessed through a dispatcher:
1142 This prompts for an extra key to select a sparse-tree creating command.
1145 @vindex org-remove-highlights-with-change
1146 Occur. Prompts for a regexp and shows a sparse tree with all matches. If
1147 the match is in a headline, the headline is made visible. If the match is in
1148 the body of an entry, headline and body are made visible. In order to
1149 provide minimal context, also the full hierarchy of headlines above the match
1150 is shown, as well as the headline following the match. Each match is also
1151 highlighted; the highlights disappear when the buffer is changed by an
1152 editing command@footnote{This depends on the option
1153 @code{org-remove-highlights-with-change}}, or by pressing @kbd{C-c C-c}.
1154 When called with a @kbd{C-u} prefix argument, previous highlights are kept,
1155 so several calls to this command can be stacked.
1159 @vindex org-agenda-custom-commands
1160 For frequently used sparse trees of specific search strings, you can
1161 use the variable @code{org-agenda-custom-commands} to define fast
1162 keyboard access to specific sparse trees. These commands will then be
1163 accessible through the agenda dispatcher (@pxref{Agenda dispatcher}).
1167 (setq org-agenda-custom-commands
1168 '(("f" occur-tree "FIXME")))
1171 @noindent will define the key @kbd{C-c a f} as a shortcut for creating
1172 a sparse tree matching the string @samp{FIXME}.
1174 The other sparse tree commands select headings based on TODO keywords,
1175 tags, or properties and will be discussed later in this manual.
1178 @cindex printing sparse trees
1179 @cindex visible text, printing
1180 To print a sparse tree, you can use the Emacs command
1181 @code{ps-print-buffer-with-faces} which does not print invisible parts
1182 of the document @footnote{This does not work under XEmacs, because
1183 XEmacs uses selective display for outlining, not text properties.}.
1184 Or you can use the command @kbd{C-c C-e v} to export only the visible
1185 part of the document and print the resulting file.
1187 @node Plain lists, Drawers, Sparse trees, Document Structure
1188 @section Plain lists
1190 @cindex lists, plain
1191 @cindex lists, ordered
1192 @cindex ordered lists
1194 Within an entry of the outline tree, hand-formatted lists can provide
1195 additional structure. They also provide a way to create lists of
1196 checkboxes (@pxref{Checkboxes}). Org supports editing such lists,
1197 and the HTML exporter (@pxref{Exporting}) parses and formats them.
1199 Org knows ordered lists, unordered lists, and description lists.
1202 @emph{Unordered} list items start with @samp{-}, @samp{+}, or
1203 @samp{*}@footnote{When using @samp{*} as a bullet, lines must be indented or
1204 they will be seen as top-level headlines. Also, when you are hiding leading
1205 stars to get a clean outline view, plain list items starting with a star are
1206 visually indistinguishable from true headlines. In short: even though
1207 @samp{*} is supported, it may be better to not use it for plain list items.}
1210 @emph{Ordered} list items start with a numeral followed by either a period or
1211 a right parenthesis, such as @samp{1.} or @samp{1)}.
1213 @emph{Description} list items are like unordered list items, but contain the
1214 separator @samp{ :: } to separate the description @emph{term} from the
1218 @vindex org-empty-line-terminates-plain-lists
1219 Items belonging to the same list must have the same indentation on the first
1220 line. In particular, if an ordered list reaches number @samp{10.}, then the
1221 2--digit numbers must be written left-aligned with the other numbers in the
1222 list. Indentation also determines the end of a list item. It ends before
1223 the next line that is indented like the bullet/number, or less. Empty lines
1224 are part of the previous item, so you can have several paragraphs in one
1225 item. If you would like an empty line to terminate all currently open plain
1226 lists, configure the variable @code{org-empty-line-terminates-plain-lists}.
1231 ** Lord of the Rings
1232 My favorite scenes are (in this order)
1233 1. The attack of the Rohirrim
1234 2. Eowyn's fight with the witch king
1235 + this was already my favorite scene in the book
1236 + I really like Miranda Otto.
1237 3. Peter Jackson being shot by Legolas
1239 He makes a really funny face when it happens.
1240 But in the end, no individual scenes matter but the film as a whole.
1241 Important actors in this film are:
1242 - @b{Elijah Wood} :: He plays Frodo
1243 - @b{Sean Austin} :: He plays Sam, Frodo's friend. I still remember
1244 him very well from his role as Mikey Walsh in @i{The Goonies}.
1248 Org supports these lists by tuning filling and wrapping commands to deal with
1249 them correctly@footnote{Org only changes the filling settings for Emacs. For
1250 XEmacs, you should use Kyle E. Jones' @file{filladapt.el}. To turn this on,
1251 put into @file{.emacs}: @code{(require 'filladapt)}}, and by exporting them
1252 properly (@pxref{Exporting}). Since indentation is what governs the
1253 structure of these lists, many structural constructs like @code{#+BEGIN_...}
1254 blocks can be indented to signal that they should be part of a list item.
1256 The following commands act on items when the cursor is in the first line
1257 of an item (the line with the bullet or number).
1262 @vindex org-cycle-include-plain-lists
1263 Items can be folded just like headline levels. Normally this works only if
1264 the cursor is on a plain list item. For more details, see the variable
1265 @code{org-cycle-include-plain-lists}. to @code{integrate}, plain list items
1266 will be treated like low-level. The level of an item is then given by the
1267 indentation of the bullet/number. Items are always subordinate to real
1268 headlines, however; the hierarchies remain completely separated.
1270 If @code{org-cycle-include-plain-lists} has not been set, @key{TAB}
1271 fixes the indentation of the current line in a heuristic way.
1274 @vindex org-M-RET-may-split-line
1275 Insert new item at current level. With a prefix argument, force a new
1276 heading (@pxref{Structure editing}). If this command is used in the middle
1277 of a line, the line is @emph{split} and the rest of the line becomes the new
1278 item@footnote{If you do not want the line to be split, customize the variable
1279 @code{org-M-RET-may-split-line}.}. If this command is executed in the
1280 @emph{whitespace before a bullet or number}, the new item is created
1281 @emph{before} the current item. If the command is executed in the white
1282 space before the text that is part of an item but does not contain the
1283 bullet, a bullet is added to the current line.
1284 @kindex M-S-@key{RET}
1286 Insert a new item with a checkbox (@pxref{Checkboxes}).
1288 @kindex S-@key{down}
1291 @cindex shift-selection-mode
1292 @vindex org-support-shift-select
1293 Jump to the previous/next item in the current list, but only if
1294 @code{org-support-shift-select} is off. If not, you can still use paragraph
1295 jumping commands like @kbd{C-@key{up}} and @kbd{C-@key{down}} to quite
1297 @kindex M-S-@key{up}
1298 @kindex M-S-@key{down}
1300 @itemx M-S-@key{down}
1301 Move the item including subitems up/down (swap with previous/next item
1302 of same indentation). If the list is ordered, renumbering is
1304 @kindex M-S-@key{left}
1305 @kindex M-S-@key{right}
1306 @item M-S-@key{left}
1307 @itemx M-S-@key{right}
1308 Decrease/increase the indentation of the item, including subitems.
1309 Initially, the item tree is selected based on current indentation.
1310 When these commands are executed several times in direct succession,
1311 the initially selected region is used, even if the new indentation
1312 would imply a different hierarchy. To use the new hierarchy, break
1313 the command chain with a cursor motion or so.
1316 If there is a checkbox (@pxref{Checkboxes}) in the item line, toggle the
1317 state of the checkbox. If not, this command makes sure that all the
1318 items on this list level use the same bullet. Furthermore, if this is
1319 an ordered list, make sure the numbering is OK.
1322 Cycle the entire list level through the different itemize/enumerate bullets
1323 (@samp{-}, @samp{+}, @samp{*}, @samp{1.}, @samp{1)}). With a numeric prefix
1324 argument N, select the Nth bullet from this list. If there is an active
1325 region when calling this, all lines will be converted to list items. If the
1326 first line already was a list item, any item markers will be removed from the
1327 list. Finally, even without an active region, a normal line will be
1328 converted into a list item.
1331 Turn a plain list item into a headline (so that it becomes a subheading at
1332 its location). @xref{Structure editing}, for a detailed explanation.
1333 @kindex S-@key{left}
1334 @kindex S-@key{right}
1335 @item S-@key{left}/@key{right}
1336 @vindex org-support-shift-select
1337 This command also cycles bullet styles when the cursor in on the bullet or
1338 anywhere in an item line, details depending on
1339 @code{org-support-shift-select}.
1342 Sort the plain list. You will be prompted for the sorting method:
1343 numerically, alphabetically, by time, or by custom function.
1346 @node Drawers, Blocks, Plain lists, Document Structure
1350 @cindex visibility cycling, drawers
1353 Sometimes you want to keep information associated with an entry, but you
1354 normally don't want to see it. For this, Org mode has @emph{drawers}.
1355 Drawers need to be configured with the variable
1356 @code{org-drawers}@footnote{You can define drawers on a per-file basis
1357 with a line like @code{#+DRAWERS: HIDDEN PROPERTIES STATE}}. Drawers
1361 ** This is a headline
1362 Still outside the drawer
1364 This is inside the drawer.
1369 Visibility cycling (@pxref{Visibility cycling}) on the headline will hide and
1370 show the entry, but keep the drawer collapsed to a single line. In order to
1371 look inside the drawer, you need to move the cursor to the drawer line and
1372 press @key{TAB} there. Org mode uses the @code{PROPERTIES} drawer for
1373 storing properties (@pxref{Properties and Columns}), and you can also arrange
1374 for state change notes (@pxref{Tracking TODO state changes}) and clock times
1375 (@pxref{Clocking work time}) to be stored in a drawer @code{LOGBOOK}.
1377 @node Blocks, Footnotes, Drawers, Document Structure
1380 @vindex org-hide-block-startup
1381 @cindex blocks, folding
1382 Org-mode uses begin...end blocks for various purposes from including source
1383 code examples (@pxref{Literal examples}) to capturing time logging
1384 information (@pxref{Clocking work time}). These blocks can be folded and
1385 unfolded by pressing TAB in the begin line. You can also get all blocks
1386 folded at startup by configuring the variable @code{org-hide-block-startup}
1387 or on a per-file basis by using
1389 @cindex @code{hideblocks}, STARTUP keyword
1390 @cindex @code{nohideblocks}, STARTUP keyword
1392 #+STARTUP: hideblocks
1393 #+STARTUP: nohideblocks
1396 @node Footnotes, Orgstruct mode, Blocks, Document Structure
1400 Org mode supports the creation of footnotes. In contrast to the
1401 @file{footnote.el} package, Org mode's footnotes are designed for work on a
1402 larger document, not only for one-off documents like emails. The basic
1403 syntax is similar to the one used by @file{footnote.el}, i.e. a footnote is
1404 defined in a paragraph that is started by a footnote marker in square
1405 brackets in column 0, no indentation allowed. If you need a paragraph break
1406 inside a footnote, use the La@TeX{} idiom @samp{\par}. The footnote reference
1407 is simply the marker in square brackets, inside text. For example:
1410 The Org homepage[fn:1] now looks a lot better than it used to.
1412 [fn:1] The link is: http://orgmode.org
1415 Org mode extends the number-based syntax to @emph{named} footnotes and
1416 optional inline definition. Using plain numbers as markers (as
1417 @file{footnote.el} does) is supported for backward compatibility, but not
1418 encouraged because of possible conflicts with La@TeX{} snippets (@pxref{Embedded
1419 LaTeX}). Here are the valid references:
1423 A plain numeric footnote marker. Compatible with @file{footnote.el}, but not
1424 recommended because somthing like @samp{[1]} could easily be part of a code
1427 A named footnote reference, where @code{name} is a unique label word, or, for
1428 simplicity of automatic creation, a number.
1429 @item [fn:: This is the inline definition of this footnote]
1430 A La@TeX{}-like anonymous footnote where the definition is given directly at the
1432 @item [fn:name: a definition]
1433 An inline definition of a footnote, which also specifies a name for the note.
1434 Since Org allows multiple references to the same note, you can then use
1435 @code{[fn:name]} to create additional references.
1438 @vindex org-footnote-auto-label
1439 Footnote labels can be created automatically, or you can create names yourself.
1440 This is handled by the variable @code{org-footnote-auto-label} and its
1441 corresponding @code{#+STARTUP} keywords, see the docstring of that variable
1444 @noindent The following command handles footnotes:
1449 The footnote action command.
1451 When the cursor is on a footnote reference, jump to the definition. When it
1452 is at a definition, jump to the (first) reference.
1454 @vindex org-footnote-define-inline
1455 @vindex org-footnote-section
1456 @vindex org-footnote-auto-adjust
1457 Otherwise, create a new footnote. Depending on the variable
1458 @code{org-footnote-define-inline}@footnote{The corresponding in-buffer
1459 setting is: @code{#+STARTUP: fninline} or @code{#+STARTUP: nofninline}}, the
1460 definition will be placed right into the text as part of the reference, or
1461 separately into the location determined by the variable
1462 @code{org-footnote-section}.
1464 When this command is called with a prefix argument, a menu of additional
1467 s @r{Sort the footnote definitions by reference sequence. During editing,}
1468 @r{Org makes no effort to sort footnote definitions into a particular}
1469 @r{sequence. If you want them sorted, use this command, which will}
1470 @r{also move entries according to @code{org-footnote-section}. Automatic}
1471 @r{sorting after each insertion/deletion can be configured using the}
1472 @r{variable @code{org-footnote-auto-adjust}.}
1473 r @r{Renumber the simple @code{fn:N} footnotes. Automatic renumbering}
1474 @r{after each insertion/deletion can be configured using the variable}
1475 @r{@code{org-footnote-auto-adjust}.}
1476 S @r{Short for first @code{r}, then @code{s} action.}
1477 n @r{Normalize the footnotes by collecting all definitions (including}
1478 @r{inline definitions) into a special section, and then numbering them}
1479 @r{in sequence. The references will then also be numbers. This is}
1480 @r{meant to be the final step before finishing a document (e.g. sending}
1481 @r{off an email). The exporters do this automatically, and so could}
1482 @r{something like @code{message-send-hook}.}
1483 d @r{Delete the footnote at point, and all definitions of and references}
1486 Depending on the variable @code{org-footnote-auto-adjust}@footnote{the
1487 corresponding in-buffer options are @code{fnadjust} and @code{nofnadjust}.},
1488 renumbering and sorting footnotes can be automatic after each insertion or
1493 If the cursor is on a footnote reference, jump to the definition. If it is a
1494 the definition, jump back to the reference. When called at a footnote
1495 location with a prefix argument, offer the same menu as @kbd{C-c C-x f}.
1499 @item C-c C-o @r{or} mouse-1/2
1500 Footnote labels are also links to the corresponding definition/reference, and
1501 you can use the usual commands to follow these links.
1504 @node Orgstruct mode, , Footnotes, Document Structure
1505 @section The Orgstruct minor mode
1506 @cindex Orgstruct mode
1507 @cindex minor mode for structure editing
1509 If you like the intuitive way the Org mode structure editing and list
1510 formatting works, you might want to use these commands in other modes like
1511 Text mode or Mail mode as well. The minor mode @code{orgstruct-mode} makes
1512 this possible. Toggle the mode with @kbd{M-x orgstruct-mode}, or
1513 turn it on by default, for example in Mail mode, with one of:
1516 (add-hook 'mail-mode-hook 'turn-on-orgstruct)
1517 (add-hook 'mail-mode-hook 'turn-on-orgstruct++)
1520 When this mode is active and the cursor is on a line that looks to Org like a
1521 headline or the first line of a list item, most structure editing commands
1522 will work, even if the same keys normally have different functionality in the
1523 major mode you are using. If the cursor is not in one of those special
1524 lines, Orgstruct mode lurks silently in the shadow. When you use
1525 @code{orgstruct++-mode}, Org will also export indentation and autofill
1526 settings into that mode, and detect item context after the first line of an
1529 @node Tables, Hyperlinks, Document Structure, Top
1532 @cindex editing tables
1534 Org comes with a fast and intuitive table editor. Spreadsheet-like
1535 calculations are supported in connection with the Emacs @file{calc}
1538 (@pxref{Top,Calc,,Calc,Gnu Emacs Calculator Manual}).
1541 (see the Emacs Calculator manual for more information about the Emacs
1546 * Built-in table editor:: Simple tables
1547 * Column width and alignment:: Overrule the automatic settings
1548 * Column groups:: Grouping to trigger vertical lines
1549 * Orgtbl mode:: The table editor as minor mode
1550 * The spreadsheet:: The table editor has spreadsheet capabilities
1551 * Org-Plot:: Plotting from org tables
1554 @node Built-in table editor, Column width and alignment, Tables, Tables
1555 @section The built-in table editor
1556 @cindex table editor, built-in
1558 Org makes it easy to format tables in plain ASCII. Any line with
1559 @samp{|} as the first non-whitespace character is considered part of a
1560 table. @samp{|} is also the column separator. A table might look like
1564 | Name | Phone | Age |
1565 |-------+-------+-----|
1566 | Peter | 1234 | 17 |
1567 | Anna | 4321 | 25 |
1570 A table is re-aligned automatically each time you press @key{TAB} or
1571 @key{RET} or @kbd{C-c C-c} inside the table. @key{TAB} also moves to
1572 the next field (@key{RET} to the next row) and creates new table rows
1573 at the end of the table or before horizontal lines. The indentation
1574 of the table is set by the first line. Any line starting with
1575 @samp{|-} is considered as a horizontal separator line and will be
1576 expanded on the next re-align to span the whole table width. So, to
1577 create the above table, you would only type
1584 @noindent and then press @key{TAB} to align the table and start filling in
1585 fields. Even faster would be to type @code{|Name|Phone|Age} followed by
1586 @kbd{C-c @key{RET}}.
1588 @vindex org-enable-table-editor
1589 @vindex org-table-auto-blank-field
1590 When typing text into a field, Org treats @key{DEL},
1591 @key{Backspace}, and all character keys in a special way, so that
1592 inserting and deleting avoids shifting other fields. Also, when
1593 typing @emph{immediately after the cursor was moved into a new field
1594 with @kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}}, the
1595 field is automatically made blank. If this behavior is too
1596 unpredictable for you, configure the variables
1597 @code{org-enable-table-editor} and @code{org-table-auto-blank-field}.
1600 @tsubheading{Creation and conversion}
1603 Convert the active region to table. If every line contains at least one
1604 TAB character, the function assumes that the material is tab separated.
1605 If every line contains a comma, comma-separated values (CSV) are assumed.
1606 If not, lines are split at whitespace into fields. You can use a prefix
1607 argument to force a specific separator: @kbd{C-u} forces CSV, @kbd{C-u
1608 C-u} forces TAB, and a numeric argument N indicates that at least N
1609 consecutive spaces, or alternatively a TAB will be the separator.
1611 If there is no active region, this command creates an empty Org
1612 table. But it's easier just to start typing, like
1613 @kbd{|Name|Phone|Age @key{RET} |- @key{TAB}}.
1615 @tsubheading{Re-aligning and field motion}
1618 Re-align the table without moving the cursor.
1622 Re-align the table, move to the next field. Creates a new row if
1627 Re-align, move to previous field.
1631 Re-align the table and move down to next row. Creates a new row if
1632 necessary. At the beginning or end of a line, @key{RET} still does
1633 NEWLINE, so it can be used to split a table.
1637 Move to beginning of the current table field, or on to the previous field.
1640 Move to end of the current table field, or on to the next field.
1642 @tsubheading{Column and row editing}
1643 @kindex M-@key{left}
1644 @kindex M-@key{right}
1646 @itemx M-@key{right}
1647 Move the current column left/right.
1649 @kindex M-S-@key{left}
1650 @item M-S-@key{left}
1651 Kill the current column.
1653 @kindex M-S-@key{right}
1654 @item M-S-@key{right}
1655 Insert a new column to the left of the cursor position.
1658 @kindex M-@key{down}
1661 Move the current row up/down.
1663 @kindex M-S-@key{up}
1665 Kill the current row or horizontal line.
1667 @kindex M-S-@key{down}
1668 @item M-S-@key{down}
1669 Insert a new row above the current row. With a prefix argument, the line is
1670 created below the current one.
1674 Insert a horizontal line below current row. With a prefix argument, the line
1675 is created above the current line.
1677 @kindex C-c @key{RET}
1679 Insert a horizontal line below current row, and move the cursor into the row
1684 Sort the table lines in the region. The position of point indicates the
1685 column to be used for sorting, and the range of lines is the range
1686 between the nearest horizontal separator lines, or the entire table. If
1687 point is before the first column, you will be prompted for the sorting
1688 column. If there is an active region, the mark specifies the first line
1689 and the sorting column, while point should be in the last line to be
1690 included into the sorting. The command prompts for the sorting type
1691 (alphabetically, numerically, or by time). When called with a prefix
1692 argument, alphabetic sorting will be case-sensitive.
1694 @tsubheading{Regions}
1697 Copy a rectangular region from a table to a special clipboard. Point and
1698 mark determine edge fields of the rectangle. If there is no active region,
1699 copy just the current field. The process ignores horizontal separator lines.
1703 Copy a rectangular region from a table to a special clipboard, and
1704 blank all fields in the rectangle. So this is the ``cut'' operation.
1708 Paste a rectangular region into a table.
1709 The upper left corner ends up in the current field. All involved fields
1710 will be overwritten. If the rectangle does not fit into the present table,
1711 the table is enlarged as needed. The process ignores horizontal separator
1716 Wrap several fields in a column like a paragraph. If there is an active
1717 region, and both point and mark are in the same column, the text in the
1718 column is wrapped to minimum width for the given number of lines. A numeric
1719 prefix argument may be used to change the number of desired lines. If there
1720 is no region, the current field is split at the cursor position and the text
1721 fragment to the right of the cursor is prepended to the field one line
1722 down. If there is no region, but you specify a prefix argument, the current
1723 field is made blank, and the content is appended to the field above.
1725 @tsubheading{Calculations}
1726 @cindex formula, in tables
1727 @cindex calculations, in tables
1728 @cindex region, active
1729 @cindex active region
1730 @cindex transient mark mode
1733 Sum the numbers in the current column, or in the rectangle defined by
1734 the active region. The result is shown in the echo area and can
1735 be inserted with @kbd{C-y}.
1739 @vindex org-table-copy-increment
1740 When current field is empty, copy from first non-empty field above. When not
1741 empty, copy current field down to next row and move cursor along with it.
1742 Depending on the variable @code{org-table-copy-increment}, integer field
1743 values will be incremented during copy. Integers that are too large will not
1744 be incremented. Also, a @code{0} prefix argument temporarily disables the
1745 increment. This key is also used by shift-selection and related modes
1746 (@pxref{Conflicts}).
1748 @tsubheading{Miscellaneous}
1751 Edit the current field in a separate window. This is useful for fields that
1752 are not fully visible (@pxref{Column width and alignment}). When called with
1753 a @kbd{C-u} prefix, just make the full field visible, so that it can be
1756 @item M-x org-table-import
1757 Import a file as a table. The table should be TAB or whitespace
1758 separated. Use, for example, to import a spreadsheet table or data
1759 from a database, because these programs generally can write
1760 TAB-separated text files. This command works by inserting the file into
1761 the buffer and then converting the region to a table. Any prefix
1762 argument is passed on to the converter, which uses it to determine the
1765 Tables can also be imported by pasting tabular text into the Org
1766 buffer, selecting the pasted text with @kbd{C-x C-x} and then using the
1767 @kbd{C-c |} command (see above under @i{Creation and conversion}).
1769 @item M-x org-table-export
1770 @vindex org-table-export-default-format
1771 Export the table, by default as a TAB-separated file. Use for data
1772 exchange with, for example, spreadsheet or database programs. The format
1773 used to export the file can be configured in the variable
1774 @code{org-table-export-default-format}. You may also use properties
1775 @code{TABLE_EXPORT_FILE} and @code{TABLE_EXPORT_FORMAT} to specify the file
1776 name and the format for table export in a subtree. Org supports quite
1777 general formats for exported tables. The exporter format is the same as the
1778 format used by Orgtbl radio tables, see @ref{Translator functions}, for a
1779 detailed description.
1782 If you don't like the automatic table editor because it gets in your
1783 way on lines which you would like to start with @samp{|}, you can turn
1787 (setq org-enable-table-editor nil)
1790 @noindent Then the only table command that still works is
1791 @kbd{C-c C-c} to do a manual re-align.
1793 @node Column width and alignment, Column groups, Built-in table editor, Tables
1794 @section Column width and alignment
1795 @cindex narrow columns in tables
1796 @cindex alignment in tables
1798 The width of columns is automatically determined by the table editor. And
1799 also the alignment of a column is determined automatically from the fraction
1800 of number-like versus non-number fields in the column.
1802 Sometimes a single field or a few fields need to carry more text,
1803 leading to inconveniently wide columns. To limit@footnote{This feature
1804 does not work on XEmacs.} the width of a column, one field anywhere in
1805 the column may contain just the string @samp{<N>} where @samp{N} is an
1806 integer specifying the width of the column in characters. The next
1807 re-align will then set the width of this column to no more than this
1812 |---+------------------------------| |---+--------|
1814 | 1 | one | | 1 | one |
1815 | 2 | two | ----\ | 2 | two |
1816 | 3 | This is a long chunk of text | ----/ | 3 | This=> |
1817 | 4 | four | | 4 | four |
1818 |---+------------------------------| |---+--------|
1823 Fields that are wider become clipped and end in the string @samp{=>}.
1824 Note that the full text is still in the buffer, it is only invisible.
1825 To see the full text, hold the mouse over the field---a tool-tip window
1826 will show the full content. To edit such a field, use the command
1827 @kbd{C-c `} (that is @kbd{C-c} followed by the backquote). This will
1828 open a new window with the full field. Edit it and finish with @kbd{C-c
1831 @vindex org-startup-align-all-tables
1832 When visiting a file containing a table with narrowed columns, the
1833 necessary character hiding has not yet happened, and the table needs to
1834 be aligned before it looks nice. Setting the option
1835 @code{org-startup-align-all-tables} will realign all tables in a file
1836 upon visiting, but also slow down startup. You can also set this option
1837 on a per-file basis with:
1844 If you would like to overrule the automatic alignment of number-rich columns
1845 to the right and of string-rich column to the left, you and use @samp{<r>} or
1846 @samp{<l>} in a similar fashion. You may also combine alignment and field
1847 width like this: @samp{<l10>}.
1849 @node Column groups, Orgtbl mode, Column width and alignment, Tables
1850 @section Column groups
1851 @cindex grouping columns in tables
1853 When Org exports tables, it does so by default without vertical
1854 lines because that is visually more satisfying in general. Occasionally
1855 however, vertical lines can be useful to structure a table into groups
1856 of columns, much like horizontal lines can do for groups of rows. In
1857 order to specify column groups, you can use a special row where the
1858 first field contains only @samp{/}. The further fields can either
1859 contain @samp{<} to indicate that this column should start a group,
1860 @samp{>} to indicate the end of a column, or @samp{<>} to make a column
1861 a group of its own. Boundaries between column groups will upon export be
1862 marked with vertical lines. Here is an example:
1865 | | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
1866 |---+----+-----+-----+-----+---------+------------|
1867 | / | <> | < | | > | < | > |
1868 | # | 1 | 1 | 1 | 1 | 1 | 1 |
1869 | # | 2 | 4 | 8 | 16 | 1.4142 | 1.1892 |
1870 | # | 3 | 9 | 27 | 81 | 1.7321 | 1.3161 |
1871 |---+----+-----+-----+-----+---------+------------|
1872 #+TBLFM: $3=$2^2::$4=$2^3::$5=$2^4::$6=sqrt($2)::$7=sqrt(sqrt(($2)))
1875 It is also sufficient to just insert the column group starters after
1876 every vertical line you'd like to have:
1879 | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
1880 |----+-----+-----+-----+---------+------------|
1884 @node Orgtbl mode, The spreadsheet, Column groups, Tables
1885 @section The Orgtbl minor mode
1887 @cindex minor mode for tables
1889 If you like the intuitive way the Org table editor works, you
1890 might also want to use it in other modes like Text mode or Mail mode.
1891 The minor mode Orgtbl mode makes this possible. You can always toggle
1892 the mode with @kbd{M-x orgtbl-mode}. To turn it on by default, for
1893 example in mail mode, use
1896 (add-hook 'mail-mode-hook 'turn-on-orgtbl)
1899 Furthermore, with some special setup, it is possible to maintain tables
1900 in arbitrary syntax with Orgtbl mode. For example, it is possible to
1901 construct La@TeX{} tables with the underlying ease and power of
1902 Orgtbl mode, including spreadsheet capabilities. For details, see
1903 @ref{Tables in arbitrary syntax}.
1905 @node The spreadsheet, Org-Plot, Orgtbl mode, Tables
1906 @section The spreadsheet
1907 @cindex calculations, in tables
1908 @cindex spreadsheet capabilities
1909 @cindex @file{calc} package
1911 The table editor makes use of the Emacs @file{calc} package to implement
1912 spreadsheet-like capabilities. It can also evaluate Emacs Lisp forms to
1913 derive fields from other fields. While fully featured, Org's
1914 implementation is not identical to other spreadsheets. For example,
1915 Org knows the concept of a @emph{column formula} that will be
1916 applied to all non-header fields in a column without having to copy the
1917 formula to each relevant field.
1920 * References:: How to refer to another field or range
1921 * Formula syntax for Calc:: Using Calc to compute stuff
1922 * Formula syntax for Lisp:: Writing formulas in Emacs Lisp
1923 * Field formulas:: Formulas valid for a single field
1924 * Column formulas:: Formulas valid for an entire column
1925 * Editing and debugging formulas:: Fixing formulas
1926 * Updating the table:: Recomputing all dependent fields
1927 * Advanced features:: Field names, parameters and automatic recalc
1930 @node References, Formula syntax for Calc, The spreadsheet, The spreadsheet
1931 @subsection References
1934 To compute fields in the table from other fields, formulas must
1935 reference other fields or ranges. In Org, fields can be referenced
1936 by name, by absolute coordinates, and by relative coordinates. To find
1937 out what the coordinates of a field are, press @kbd{C-c ?} in that
1938 field, or press @kbd{C-c @}} to toggle the display of a grid.
1940 @subsubheading Field references
1941 @cindex field references
1942 @cindex references, to fields
1944 Formulas can reference the value of another field in two ways. Like in
1945 any other spreadsheet, you may reference fields with a letter/number
1946 combination like @code{B3}, meaning the 2nd field in the 3rd row.
1947 @c Such references are always fixed to that field, they don't change
1948 @c when you copy and paste a formula to a different field. So
1949 @c Org's @code{B3} behaves like @code{$B$3} in other spreadsheets.
1952 Org also uses another, more general operator that looks like this:
1954 @@@var{row}$@var{column}
1958 Column references can be absolute like @samp{1}, @samp{2},...@samp{@var{N}},
1959 or relative to the current column like @samp{+1} or @samp{-2}.
1961 The row specification only counts data lines and ignores horizontal
1962 separator lines (hlines). You can use absolute row numbers
1963 @samp{1}...@samp{@var{N}}, and row numbers relative to the current row like
1964 @samp{+3} or @samp{-1}. Or specify the row relative to one of the
1965 hlines: @samp{I} refers to the first hline@footnote{Note that only
1966 hlines are counted that @emph{separate} table lines. If the table
1967 starts with a hline above the header, it does not count.}, @samp{II} to
1968 the second, etc@. @samp{-I} refers to the first such line above the
1969 current line, @samp{+I} to the first such line below the current line.
1970 You can also write @samp{III+2} which is the second data line after the
1971 third hline in the table.
1973 @samp{0} refers to the current row and column. Also, if you omit
1974 either the column or the row part of the reference, the current
1975 row/column is implied.
1977 Org's references with @emph{unsigned} numbers are fixed references
1978 in the sense that if you use the same reference in the formula for two
1979 different fields, the same field will be referenced each time.
1980 Org's references with @emph{signed} numbers are floating
1981 references because the same reference operator can reference different
1982 fields depending on the field being calculated by the formula.
1984 As a special case, references like @samp{$LR5} and @samp{$LR12} can be used
1985 to refer in a stable way to the 5th and 12th field in the last row of the
1988 Here are a few examples:
1991 @@2$3 @r{2nd row, 3rd column}
1992 C2 @r{same as previous}
1993 $5 @r{column 5 in the current row}
1994 E& @r{same as previous}
1995 @@2 @r{current column, row 2}
1996 @@-1$-3 @r{the field one row up, three columns to the left}
1997 @@-I$2 @r{field just under hline above current row, column 2}
2000 @subsubheading Range references
2001 @cindex range references
2002 @cindex references, to ranges
2004 You may reference a rectangular range of fields by specifying two field
2005 references connected by two dots @samp{..}. If both fields are in the
2006 current row, you may simply use @samp{$2..$7}, but if at least one field
2007 is in a different row, you need to use the general @code{@@row$column}
2008 format at least for the first field (i.e the reference must start with
2009 @samp{@@} in order to be interpreted correctly). Examples:
2012 $1..$3 @r{First three fields in the current row.}
2013 $P..$Q @r{Range, using column names (see under Advanced)}
2014 @@2$1..@@4$3 @r{6 fields between these two fields.}
2015 A2..C4 @r{Same as above.}
2016 @@-1$-2..@@-1 @r{3 numbers from the column to the left, 2 up to current row}
2019 @noindent Range references return a vector of values that can be fed
2020 into Calc vector functions. Empty fields in ranges are normally
2021 suppressed, so that the vector contains only the non-empty fields (but
2022 see the @samp{E} mode switch below). If there are no non-empty fields,
2023 @samp{[0]} is returned to avoid syntax errors in formulas.
2025 @subsubheading Named references
2026 @cindex named references
2027 @cindex references, named
2028 @cindex name, of column or field
2029 @cindex constants, in calculations
2032 @vindex org-table-formula-constants
2033 @samp{$name} is interpreted as the name of a column, parameter or
2034 constant. Constants are defined globally through the variable
2035 @code{org-table-formula-constants}, and locally (for the file) through a
2039 #+CONSTANTS: c=299792458. pi=3.14 eps=2.4e-6
2043 @vindex constants-unit-system
2044 @pindex constants.el
2045 Also properties (@pxref{Properties and Columns}) can be used as
2046 constants in table formulas: for a property @samp{:Xyz:} use the name
2047 @samp{$PROP_Xyz}, and the property will be searched in the current
2048 outline entry and in the hierarchy above it. If you have the
2049 @file{constants.el} package, it will also be used to resolve constants,
2050 including natural constants like @samp{$h} for Planck's constant, and
2051 units like @samp{$km} for kilometers@footnote{@file{constants.el} can
2052 supply the values of constants in two different unit systems, @code{SI}
2053 and @code{cgs}. Which one is used depends on the value of the variable
2054 @code{constants-unit-system}. You can use the @code{#+STARTUP} options
2055 @code{constSI} and @code{constcgs} to set this value for the current
2056 buffer.}. Column names and parameters can be specified in special table
2057 lines. These are described below, see @ref{Advanced features}. All
2058 names must start with a letter, and further consist of letters and
2061 @subsubheading Remote references
2062 @cindex remote references
2063 @cindex references, remote
2064 @cindex references, to a different table
2065 @cindex name, of column or field
2066 @cindex constants, in calculations
2069 You may also reference constants, fields and ranges from a different table,
2070 either in the current file or even in a different file. The syntax is
2073 remote(NAME-OR-ID,REF)
2077 where NAME can be the name of a table in the current file as set by a
2078 @code{#+TBLNAME: NAME} line before the table. It can also be the ID of an
2079 entry, even in a different file, and the reference then refers to the first
2080 table in that entry. REF is an absolute field or range reference as
2081 described above for example @code{@@3$3} or @code{$somename}, valid in the
2084 @node Formula syntax for Calc, Formula syntax for Lisp, References, The spreadsheet
2085 @subsection Formula syntax for Calc
2086 @cindex formula syntax, Calc
2087 @cindex syntax, of formulas
2089 A formula can be any algebraic expression understood by the Emacs
2090 @file{Calc} package. @b{Note that @file{calc} has the
2091 non-standard convention that @samp{/} has lower precedence than
2092 @samp{*}, so that @samp{a/b*c} is interpreted as @samp{a/(b*c)}.} Before
2093 evaluation by @code{calc-eval} (@pxref{Calling Calc from
2094 Your Programs,calc-eval,Calling Calc from Your Lisp Programs,Calc,GNU
2095 Emacs Calc Manual}),
2096 @c FIXME: The link to the Calc manual in HTML does not work.
2097 variable substitution takes place according to the rules described above.
2098 @cindex vectors, in table calculations
2099 The range vectors can be directly fed into the Calc vector functions
2100 like @samp{vmean} and @samp{vsum}.
2102 @cindex format specifier
2103 @cindex mode, for @file{calc}
2104 @vindex org-calc-default-modes
2105 A formula can contain an optional mode string after a semicolon. This
2106 string consists of flags to influence Calc and other modes during
2107 execution. By default, Org uses the standard Calc modes (precision
2108 12, angular units degrees, fraction and symbolic modes off). The display
2109 format, however, has been changed to @code{(float 8)} to keep tables
2110 compact. The default settings can be configured using the variable
2111 @code{org-calc-default-modes}.
2114 p20 @r{switch the internal precision to 20 digits}
2115 n3 s3 e2 f4 @r{normal, scientific, engineering, or fixed display format}
2116 D R @r{angle modes: degrees, radians}
2117 F S @r{fraction and symbolic modes}
2118 N @r{interpret all fields as numbers, use 0 for non-numbers}
2119 T @r{force text interpretation}
2120 E @r{keep empty fields in ranges}
2125 In addition, you may provide a @code{printf} format specifier to
2126 reformat the final result. A few examples:
2129 $1+$2 @r{Sum of first and second field}
2130 $1+$2;%.2f @r{Same, format result to two decimals}
2131 exp($2)+exp($1) @r{Math functions can be used}
2132 $0;%.1f @r{Reformat current cell to 1 decimal}
2133 ($3-32)*5/9 @r{Degrees F -> C conversion}
2134 $c/$1/$cm @r{Hz -> cm conversion, using @file{constants.el}}
2135 tan($1);Dp3s1 @r{Compute in degrees, precision 3, display SCI 1}
2136 sin($1);Dp3%.1e @r{Same, but use printf specifier for display}
2137 vmean($2..$7) @r{Compute column range mean, using vector function}
2138 vmean($2..$7);EN @r{Same, but treat empty fields as 0}
2139 taylor($3,x=7,2) @r{taylor series of $3, at x=7, second degree}
2142 Calc also contains a complete set of logical operations. For example
2145 if($1<20,teen,string("")) @r{``teen'' if age $1 less than 20, else empty}
2148 @node Formula syntax for Lisp, Field formulas, Formula syntax for Calc, The spreadsheet
2149 @subsection Emacs Lisp forms as formulas
2150 @cindex Lisp forms, as table formulas
2152 It is also possible to write a formula in Emacs Lisp; this can be useful
2153 for string manipulation and control structures, if Calc's
2154 functionality is not enough. If a formula starts with a single-quote
2155 followed by an opening parenthesis, then it is evaluated as a Lisp form.
2156 The evaluation should return either a string or a number. Just as with
2157 @file{calc} formulas, you can specify modes and a printf format after a
2158 semicolon. With Emacs Lisp forms, you need to be conscious about the way
2159 field references are interpolated into the form. By default, a
2160 reference will be interpolated as a Lisp string (in double-quotes)
2161 containing the field. If you provide the @samp{N} mode switch, all
2162 referenced elements will be numbers (non-number fields will be zero) and
2163 interpolated as Lisp numbers, without quotes. If you provide the
2164 @samp{L} flag, all fields will be interpolated literally, without quotes.
2165 I.e., if you want a reference to be interpreted as a string by the Lisp
2166 form, enclose the reference operator itself in double-quotes, like
2167 @code{"$3"}. Ranges are inserted as space-separated fields, so you can
2168 embed them in list or vector syntax. A few examples, note how the
2169 @samp{N} mode is used when we do computations in Lisp.
2172 @r{Swap the first two characters of the content of column 1}
2173 '(concat (substring $1 1 2) (substring $1 0 1) (substring $1 2))
2174 @r{Add columns 1 and 2, equivalent to Calc's @code{$1+$2}}
2176 @r{Compute the sum of columns 1-4, like Calc's @code{vsum($1..$4)}}
2177 '(apply '+ '($1..$4));N
2180 @node Field formulas, Column formulas, Formula syntax for Lisp, The spreadsheet
2181 @subsection Field formulas
2182 @cindex field formula
2183 @cindex formula, for individual table field
2185 To assign a formula to a particular field, type it directly into the
2186 field, preceded by @samp{:=}, for example @samp{:=$1+$2}. When you
2187 press @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in
2188 the field, the formula will be stored as the formula for this field,
2189 evaluated, and the current field replaced with the result.
2192 Formulas are stored in a special line starting with @samp{#+TBLFM:}
2193 directly below the table. If you typed the equation in the 4th field of
2194 the 3rd data line in the table, the formula will look like
2195 @samp{@@3$4=$1+$2}. When inserting/deleting/swapping column and rows
2196 with the appropriate commands, @i{absolute references} (but not relative
2197 ones) in stored formulas are modified in order to still reference the
2198 same field. Of course this is not true if you edit the table structure
2199 with normal editing commands---then you must fix the equations yourself.
2200 The left-hand side of a formula may also be a named field (@pxref{Advanced
2201 features}), or a last-row reference like @samp{$LR3}.
2203 Instead of typing an equation into the field, you may also use the
2209 Install a new formula for the current field. The command prompts for a
2210 formula with default taken from the @samp{#+TBLFM:} line, applies
2211 it to the current field, and stores it.
2214 @node Column formulas, Editing and debugging formulas, Field formulas, The spreadsheet
2215 @subsection Column formulas
2216 @cindex column formula
2217 @cindex formula, for table column
2219 Often in a table, the same formula should be used for all fields in a
2220 particular column. Instead of having to copy the formula to all fields
2221 in that column, Org allows you to assign a single formula to an entire
2222 column. If the table contains horizontal separator hlines, everything
2223 before the first such line is considered part of the table @emph{header}
2224 and will not be modified by column formulas.
2226 To assign a formula to a column, type it directly into any field in the
2227 column, preceded by an equal sign, like @samp{=$1+$2}. When you press
2228 @key{TAB} or @key{RET} or @kbd{C-c C-c} with the cursor still in the field,
2229 the formula will be stored as the formula for the current column, evaluated
2230 and the current field replaced with the result. If the field contains only
2231 @samp{=}, the previously stored formula for this column is used. For each
2232 column, Org will only remember the most recently used formula. In the
2233 @samp{#+TBLFM:} line, column formulas will look like @samp{$4=$1+$2}. The left-hand
2234 side of a column formula cannot currently be the name of column, it
2235 must be the numeric column reference.
2237 Instead of typing an equation into the field, you may also use the
2243 Install a new formula for the current column and replace current field with
2244 the result of the formula. The command prompts for a formula, with default
2245 taken from the @samp{#+TBLFM} line, applies it to the current field and
2246 stores it. With a numeric prefix argument(e.g. @kbd{C-5 C-c =}) the command
2247 will apply it to that many consecutive fields in the current column.
2250 @node Editing and debugging formulas, Updating the table, Column formulas, The spreadsheet
2251 @subsection Editing and debugging formulas
2252 @cindex formula editing
2253 @cindex editing, of table formulas
2255 @vindex org-table-use-standard-references
2256 You can edit individual formulas in the minibuffer or directly in the
2257 field. Org can also prepare a special buffer with all active
2258 formulas of a table. When offering a formula for editing, Org
2259 converts references to the standard format (like @code{B3} or @code{D&})
2260 if possible. If you prefer to only work with the internal format (like
2261 @code{@@3$2} or @code{$4}), configure the variable
2262 @code{org-table-use-standard-references}.
2269 Edit the formula associated with the current column/field in the
2270 minibuffer. See @ref{Column formulas}, and @ref{Field formulas}.
2271 @kindex C-u C-u C-c =
2273 Re-insert the active formula (either a
2274 field formula, or a column formula) into the current field, so that you
2275 can edit it directly in the field. The advantage over editing in the
2276 minibuffer is that you can use the command @kbd{C-c ?}.
2279 While editing a formula in a table field, highlight the field(s)
2280 referenced by the reference at the cursor position in the formula.
2283 Toggle the display of row and column numbers for a table, using
2284 overlays. These are updated each time the table is aligned; you can
2285 force it with @kbd{C-c C-c}.
2288 Toggle the formula debugger on and off. See below.
2291 Edit all formulas for the current table in a special buffer, where the
2292 formulas will be displayed one per line. If the current field has an
2293 active formula, the cursor in the formula editor will mark it.
2294 While inside the special buffer, Org will automatically highlight
2295 any field or range reference at the cursor position. You may edit,
2296 remove and add formulas, and use the following commands:
2302 Exit the formula editor and store the modified formulas. With @kbd{C-u}
2303 prefix, also apply the new formulas to the entire table.
2306 Exit the formula editor without installing changes.
2309 Toggle all references in the formula editor between standard (like
2310 @code{B3}) and internal (like @code{@@3$2}).
2313 Pretty-print or indent Lisp formula at point. When in a line containing
2314 a Lisp formula, format the formula according to Emacs Lisp rules.
2315 Another @key{TAB} collapses the formula back again. In the open
2316 formula, @key{TAB} re-indents just like in Emacs Lisp mode.
2319 Complete Lisp symbols, just like in Emacs Lisp mode.
2321 @kindex S-@key{down}
2322 @kindex S-@key{left}
2323 @kindex S-@key{right}
2324 @item S-@key{up}/@key{down}/@key{left}/@key{right}
2325 Shift the reference at point. For example, if the reference is
2326 @code{B3} and you press @kbd{S-@key{right}}, it will become @code{C3}.
2327 This also works for relative references and for hline references.
2328 @kindex M-S-@key{up}
2329 @kindex M-S-@key{down}
2330 @item M-S-@key{up}/@key{down}
2331 Move the test line for column formulas in the Org buffer up and
2334 @kindex M-@key{down}
2335 @item M-@key{up}/@key{down}
2336 Scroll the window displaying the table.
2339 Turn the coordinate grid in the table on and off.
2343 Making a table field blank does not remove the formula associated with
2344 the field, because that is stored in a different line (the @samp{#+TBLFM}
2345 line)---during the next recalculation the field will be filled again.
2346 To remove a formula from a field, you have to give an empty reply when
2347 prompted for the formula, or to edit the @samp{#+TBLFM} line.
2350 You may edit the @samp{#+TBLFM} directly and re-apply the changed
2351 equations with @kbd{C-c C-c} in that line or with the normal
2352 recalculation commands in the table.
2354 @subsubheading Debugging formulas
2355 @cindex formula debugging
2356 @cindex debugging, of table formulas
2357 When the evaluation of a formula leads to an error, the field content
2358 becomes the string @samp{#ERROR}. If you would like see what is going
2359 on during variable substitution and calculation in order to find a bug,
2360 turn on formula debugging in the @code{Tbl} menu and repeat the
2361 calculation, for example by pressing @kbd{C-u C-u C-c = @key{RET}} in a
2362 field. Detailed information will be displayed.
2364 @node Updating the table, Advanced features, Editing and debugging formulas, The spreadsheet
2365 @subsection Updating the table
2366 @cindex recomputing table fields
2367 @cindex updating, table
2369 Recalculation of a table is normally not automatic, but needs to be
2370 triggered by a command. See @ref{Advanced features}, for a way to make
2371 recalculation at least semi-automatic.
2373 In order to recalculate a line of a table or the entire table, use the
2379 Recalculate the current row by first applying the stored column formulas
2380 from left to right, and all field formulas in the current row.
2386 Recompute the entire table, line by line. Any lines before the first
2387 hline are left alone, assuming that these are part of the table header.
2389 @kindex C-u C-u C-c *
2390 @kindex C-u C-u C-c C-c
2392 @itemx C-u C-u C-c C-c
2393 Iterate the table by recomputing it until no further changes occur.
2394 This may be necessary if some computed fields use the value of other
2395 fields that are computed @i{later} in the calculation sequence.
2398 @node Advanced features, , Updating the table, The spreadsheet
2399 @subsection Advanced features
2401 If you want the recalculation of fields to happen automatically, or if
2402 you want to be able to assign @i{names} to fields and columns, you need
2403 to reserve the first column of the table for special marking characters.
2407 Rotate the calculation mark in first column through the states @samp{ },
2408 @samp{#}, @samp{*}, @samp{!}, @samp{$}. When there is an active region,
2409 change all marks in the region.
2412 Here is an example of a table that collects exam results of students and
2413 makes use of these features:
2417 |---+---------+--------+--------+--------+-------+------|
2418 | | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note |
2419 |---+---------+--------+--------+--------+-------+------|
2420 | ! | | P1 | P2 | P3 | Tot | |
2421 | # | Maximum | 10 | 15 | 25 | 50 | 10.0 |
2422 | ^ | | m1 | m2 | m3 | mt | |
2423 |---+---------+--------+--------+--------+-------+------|
2424 | # | Peter | 10 | 8 | 23 | 41 | 8.2 |
2425 | # | Sam | 2 | 4 | 3 | 9 | 1.8 |
2426 |---+---------+--------+--------+--------+-------+------|
2427 | | Average | | | | 29.7 | |
2428 | ^ | | | | | at | |
2429 | $ | max=50 | | | | | |
2430 |---+---------+--------+--------+--------+-------+------|
2431 #+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(@@-II..@@-I);%.1f
2435 @noindent @b{Important}: please note that for these special tables,
2436 recalculating the table with @kbd{C-u C-c *} will only affect rows that
2437 are marked @samp{#} or @samp{*}, and fields that have a formula assigned
2438 to the field itself. The column formulas are not applied in rows with
2441 @cindex marking characters, tables
2442 The marking characters have the following meaning:
2445 The fields in this line define names for the columns, so that you may
2446 refer to a column as @samp{$Tot} instead of @samp{$6}.
2448 This row defines names for the fields @emph{above} the row. With such
2449 a definition, any formula in the table may use @samp{$m1} to refer to
2450 the value @samp{10}. Also, if you assign a formula to a names field, it
2451 will be stored as @samp{$name=...}.
2453 Similar to @samp{^}, but defines names for the fields in the row
2456 Fields in this row can define @emph{parameters} for formulas. For
2457 example, if a field in a @samp{$} row contains @samp{max=50}, then
2458 formulas in this table can refer to the value 50 using @samp{$max}.
2459 Parameters work exactly like constants, only that they can be defined on
2462 Fields in this row are automatically recalculated when pressing
2463 @key{TAB} or @key{RET} or @kbd{S-@key{TAB}} in this row. Also, this row
2464 is selected for a global recalculation with @kbd{C-u C-c *}. Unmarked
2465 lines will be left alone by this command.
2467 Selects this line for global recalculation with @kbd{C-u C-c *}, but
2468 not for automatic recalculation. Use this when automatic
2469 recalculation slows down editing too much.
2471 Unmarked lines are exempt from recalculation with @kbd{C-u C-c *}.
2472 All lines that should be recalculated should be marked with @samp{#}
2475 Do not export this line. Useful for lines that contain the narrowing
2476 @samp{<N>} markers or column group markers.
2479 Finally, just to whet your appetite for what can be done with the
2480 fantastic @file{calc.el} package, here is a table that computes the Taylor
2481 series of degree @code{n} at location @code{x} for a couple of
2486 |---+-------------+---+-----+--------------------------------------|
2487 | | Func | n | x | Result |
2488 |---+-------------+---+-----+--------------------------------------|
2489 | # | exp(x) | 1 | x | 1 + x |
2490 | # | exp(x) | 2 | x | 1 + x + x^2 / 2 |
2491 | # | exp(x) | 3 | x | 1 + x + x^2 / 2 + x^3 / 6 |
2492 | # | x^2+sqrt(x) | 2 | x=0 | x*(0.5 / 0) + x^2 (2 - 0.25 / 0) / 2 |
2493 | # | x^2+sqrt(x) | 2 | x=1 | 2 + 2.5 x - 2.5 + 0.875 (x - 1)^2 |
2494 | * | tan(x) | 3 | x | 0.0175 x + 1.77e-6 x^3 |
2495 |---+-------------+---+-----+--------------------------------------|
2496 #+TBLFM: $5=taylor($2,$4,$3);n3
2500 @node Org-Plot, , The spreadsheet, Tables
2502 @cindex graph, in tables
2503 @cindex plot tables using gnuplot
2506 Org-Plot can produce 2D and 3D graphs of information stored in org tables
2507 using @file{Gnuplot} @uref{http://www.gnuplot.info/} and @file{gnuplot-mode}
2508 @uref{http://cars9.uchicago.edu/~ravel/software/gnuplot-mode.html}. To see
2509 this in action, ensure that you have both Gnuplot and Gnuplot mode installed
2510 on your system, then call @code{org-plot/gnuplot} on the following table.
2514 #+PLOT: title:"Citas" ind:1 deps:(3) type:2d with:histograms set:"yrange [0:]"
2515 | Sede | Max cites | H-index |
2516 |-----------+-----------+---------|
2517 | Chile | 257.72 | 21.39 |
2518 | Leeds | 165.77 | 19.68 |
2519 | Sao Paolo | 71.00 | 11.50 |
2520 | Stockholm | 134.19 | 14.33 |
2521 | Morelia | 257.56 | 17.67 |
2525 Notice that Org Plot is smart enough to apply the table's headers as labels.
2526 Further control over the labels, type, content, and appearance of plots can
2527 be exercised through the @code{#+PLOT:} lines preceding a table. See below
2528 for a complete list of Org-plot options. For more information and examples
2529 see the Org-plot tutorial at
2530 @uref{http://orgmode.org/worg/org-tutorials/org-plot.php}.
2532 @subsubheading Plot Options
2536 Specify any @command{gnuplot} option to be set when graphing.
2539 Specify the title of the plot.
2542 Specify which column of the table to use as the @code{x} axis.
2545 Specify the columns to graph as a Lisp style list, surrounded by parentheses
2546 and separated by spaces for example @code{dep:(3 4)} to graph the third and
2547 fourth columns (defaults to graphing all other columns aside from the @code{ind}
2551 Specify whether the plot will be @code{2d}, @code{3d}, or @code{grid}.
2554 Specify a @code{with} option to be inserted for every col being plotted
2555 (e.g. @code{lines}, @code{points}, @code{boxes}, @code{impulses}, etc...).
2556 Defaults to @code{lines}.
2559 If you want to plot to a file, specify @code{"@var{path/to/desired/output-file}"}.
2562 List of labels to be used for the deps (defaults to the column headers if
2566 Specify an entire line to be inserted in the Gnuplot script.
2569 When plotting @code{3d} or @code{grid} types, set this to @code{t} to graph a
2570 flat mapping rather than a @code{3d} slope.
2573 Specify format of Org-mode timestamps as they will be parsed by Gnuplot.
2574 Defaults to @samp{%Y-%m-%d-%H:%M:%S}.
2577 If you want total control, you can specify a script file (place the file name
2578 between double-quotes) which will be used to plot. Before plotting, every
2579 instance of @code{$datafile} in the specified script will be replaced with
2580 the path to the generated data file. Note: even if you set this option, you
2581 may still want to specify the plot type, as that can impact the content of
2585 @node Hyperlinks, TODO Items, Tables, Top
2589 Like HTML, Org provides links inside a file, external links to
2590 other files, Usenet articles, emails, and much more.
2593 * Link format:: How links in Org are formatted
2594 * Internal links:: Links to other places in the current file
2595 * External links:: URL-like links to the world
2596 * Handling links:: Creating, inserting and following
2597 * Using links outside Org:: Linking from my C source code?
2598 * Link abbreviations:: Shortcuts for writing complex links
2599 * Search options:: Linking to a specific location
2600 * Custom searches:: When the default search is not enough
2603 @node Link format, Internal links, Hyperlinks, Hyperlinks
2604 @section Link format
2606 @cindex format, of links
2608 Org will recognize plain URL-like links and activate them as
2609 clickable links. The general link format, however, looks like this:
2612 [[link][description]] @r{or alternatively} [[link]]
2616 Once a link in the buffer is complete (all brackets present), Org
2617 will change the display so that @samp{description} is displayed instead
2618 of @samp{[[link][description]]} and @samp{link} is displayed instead of
2619 @samp{[[link]]}. Links will be highlighted in the face @code{org-link},
2620 which by default is an underlined face. You can directly edit the
2621 visible part of a link. Note that this can be either the @samp{link}
2622 part (if there is no description) or the @samp{description} part. To
2623 edit also the invisible @samp{link} part, use @kbd{C-c C-l} with the
2626 If you place the cursor at the beginning or just behind the end of the
2627 displayed text and press @key{BACKSPACE}, you will remove the
2628 (invisible) bracket at that location. This makes the link incomplete
2629 and the internals are again displayed as plain text. Inserting the
2630 missing bracket hides the link internals again. To show the
2631 internal structure of all links, use the menu entry
2632 @code{Org->Hyperlinks->Literal links}.
2634 @node Internal links, External links, Link format, Hyperlinks
2635 @section Internal links
2636 @cindex internal links
2637 @cindex links, internal
2638 @cindex targets, for links
2640 @cindex property, CUSTOM_ID
2641 If the link does not look like a URL, it is considered to be internal in the
2642 current file. The most important case is a link like
2643 @samp{[[#my-custom-id]]} which will link to the entry with the
2644 @code{CUSTOM_ID} property @samp{my-custom-id}. Such custom IDs are very good
2645 for HTML export (@pxref{HTML export}) where they produce pretty section
2646 links. You are responsible yourself to make sure these custom IDs are unique
2649 Links such as @samp{[[My Target]]} or @samp{[[My Target][Find my target]]}
2650 lead to a text search in the current file.
2652 The link can be followed with @kbd{C-c C-o} when the cursor is on the link,
2653 or with a mouse click (@pxref{Handling links}). Links to custom IDs will
2654 point to the corresponding headline. The preferred match for a text link is
2655 a @i{dedicated target}: the same string in double angular brackets. Targets
2656 may be located anywhere; sometimes it is convenient to put them into a
2657 comment line. For example
2663 @noindent In HTML export (@pxref{HTML export}), such targets will become
2664 named anchors for direct access through @samp{http} links@footnote{Note that
2665 text before the first headline is usually not exported, so the first such
2666 target should be after the first headline, or in the line directly before the
2669 If no dedicated target exists, Org will search for the words in the link. In
2670 the above example the search would be for @samp{my target}. Links starting
2671 with a star like @samp{*My Target} restrict the search to
2672 headlines@footnote{To insert a link targeting a headline, in-buffer
2673 completion can be used. Just type a star followed by a few optional letters
2674 into the buffer and press @kbd{M-@key{TAB}}. All headlines in the current
2675 buffer will be offered as completions. @xref{Handling links}, for more
2676 commands creating links.}. When searching, Org mode will first try an
2677 exact match, but then move on to more and more lenient searches. For
2678 example, the link @samp{[[*My Targets]]} will find any of the following:
2682 ** TODO my targets are bright
2683 ** my 20 targets are
2687 Following a link pushes a mark onto Org's own mark ring. You can
2688 return to the previous position with @kbd{C-c &}. Using this command
2689 several times in direct succession goes back to positions recorded
2693 * Radio targets:: Make targets trigger links in plain text
2696 @node Radio targets, , Internal links, Internal links
2697 @subsection Radio targets
2698 @cindex radio targets
2699 @cindex targets, radio
2700 @cindex links, radio targets
2702 Org can automatically turn any occurrences of certain target names
2703 in normal text into a link. So without explicitly creating a link, the
2704 text connects to the target radioing its position. Radio targets are
2705 enclosed by triple angular brackets. For example, a target @samp{<<<My
2706 Target>>>} causes each occurrence of @samp{my target} in normal text to
2707 become activated as a link. The Org file is scanned automatically
2708 for radio targets only when the file is first loaded into Emacs. To
2709 update the target list during editing, press @kbd{C-c C-c} with the
2710 cursor on or at a target.
2712 @node External links, Handling links, Internal links, Hyperlinks
2713 @section External links
2714 @cindex links, external
2715 @cindex external links
2716 @cindex links, external
2724 @cindex WANDERLUST links
2726 @cindex USENET links
2731 Org supports links to files, websites, Usenet and email messages,
2732 BBDB database entries and links to both IRC conversations and their
2733 logs. External links are URL-like locators. They start with a short
2734 identifying string followed by a colon. There can be no space after
2735 the colon. The following list shows examples for each link type.
2738 http://www.astro.uva.nl/~dominik @r{on the web}
2739 file:/home/dominik/images/jupiter.jpg @r{file, absolute path}
2740 /home/dominik/images/jupiter.jpg @r{same as above}
2741 file:papers/last.pdf @r{file, relative path}
2742 ./papers/last.pdf @r{same as above}
2743 file:projects.org @r{another Org file}
2744 file:projects.org::some words @r{text search in Org file}
2745 file:projects.org::*task title @r{heading search in Org file}
2746 id:B7423F4D-2E8A-471B-8810-C40F074717E9 @r{Link to heading by ID}
2747 news:comp.emacs @r{Usenet link}
2748 mailto:adent@@galaxy.net @r{Mail link}
2749 vm:folder @r{VM folder link}
2750 vm:folder#id @r{VM message link}
2751 vm://myself@@some.where.org/folder#id @r{VM on remote machine}
2752 wl:folder @r{WANDERLUST folder link}
2753 wl:folder#id @r{WANDERLUST message link}
2754 mhe:folder @r{MH-E folder link}
2755 mhe:folder#id @r{MH-E message link}
2756 rmail:folder @r{RMAIL folder link}
2757 rmail:folder#id @r{RMAIL message link}
2758 gnus:group @r{Gnus group link}
2759 gnus:group#id @r{Gnus article link}
2760 bbdb:R.*Stallman @r{BBDB link (with regexp)}
2761 irc:/irc.com/#emacs/bob @r{IRC link}
2762 shell:ls *.org @r{A shell command}
2763 elisp:org-agenda @r{Interactive Elisp command}
2764 elisp:(find-file-other-frame "Elisp.org") @r{Elisp form to evaluate}
2767 A link should be enclosed in double brackets and may contain a
2768 descriptive text to be displayed instead of the URL (@pxref{Link
2769 format}), for example:
2772 [[http://www.gnu.org/software/emacs/][GNU Emacs]]
2776 If the description is a file name or URL that points to an image, HTML
2777 export (@pxref{HTML export}) will inline the image as a clickable
2778 button. If there is no description at all and the link points to an
2780 that image will be inlined into the exported HTML file.
2782 @cindex square brackets, around links
2783 @cindex plain text external links
2784 Org also finds external links in the normal text and activates them
2785 as links. If spaces must be part of the link (for example in
2786 @samp{bbdb:Richard Stallman}), or if you need to remove ambiguities
2787 about the end of the link, enclose them in square brackets.
2789 @node Handling links, Using links outside Org, External links, Hyperlinks
2790 @section Handling links
2791 @cindex links, handling
2793 Org provides methods to create a link in the correct syntax, to
2794 insert it into an Org file, and to follow the link.
2798 @cindex storing links
2800 Store a link to the current location. This is a @emph{global} command (you
2801 must create the key binding yourself) which can be used in any buffer to
2802 create a link. The link will be stored for later insertion into an Org
2803 buffer (see below). What kind of link will be created depends on the current
2806 @b{Org-mode buffers}@*
2807 For Org files, if there is a @samp{<<target>>} at the cursor, the link points
2808 to the target. Otherwise it points to the current headline, which will also
2811 @vindex org-link-to-org-use-id
2812 @cindex property, CUSTOM_ID
2813 @cindex property, ID
2814 If the headline has a @code{CUSTOM_ID} property, a link to this custom ID
2815 will be stored. In addition or alternatively (depending on the value of
2816 @code{org-link-to-org-use-id}), a globally unique @code{ID} property will be
2817 created and/or used to construct a link. So using this command in Org
2818 buffers will potentially create two links: a human-readable from the custom
2819 ID, and one that is globally unique and works even if the entry is moved from
2820 file to file. Later, when inserting the link, you need to decide which one
2823 @b{Email/News clients: VM, Rmail, Wanderlust, MH-E, Gnus}@*
2824 Pretty much all Emacs mail clients are supported. The link will point to the
2825 current article, or, in some GNUS buffers, to the group. The description is
2826 constructed from the author and the subject.
2828 @b{Web browsers: W3 and W3M}@*
2829 Here the link will be the current URL, with the page title as description.
2831 @b{Contacts: BBDB}@*
2832 Links created in a BBDB buffer will point to the current entry.
2835 @vindex org-irc-link-to-logs
2836 For IRC links, if you set the variable @code{org-irc-link-to-logs} to
2837 @code{t}, a @samp{file:/} style link to the relevant point in the logs for
2838 the current conversation is created. Otherwise an @samp{irc:/} style link to
2839 the user/channel/server under the point will be stored.
2842 For any other files, the link will point to the file, with a search string
2843 (@pxref{Search options}) pointing to the contents of the current line. If
2844 there is an active region, the selected words will form the basis of the
2845 search string. If the automatically created link is not working correctly or
2846 accurately enough, you can write custom functions to select the search string
2847 and to do the search for particular file types---see @ref{Custom searches}.
2848 The key binding @kbd{C-c l} is only a suggestion---see @ref{Installation}.
2851 When the cursor is in an agenda view, the created link points to the
2852 entry referenced by the current line.
2856 @cindex link completion
2857 @cindex completion, of links
2858 @cindex inserting links
2860 @vindex org-keep-stored-link-after-insertion
2861 Insert a link@footnote{ Note that you don't have to use this command to
2862 insert a link. Links in Org are plain text, and you can type or paste them
2863 straight into the buffer. By using this command, the links are automatically
2864 enclosed in double brackets, and you will be asked for the optional
2865 descriptive text.}. This prompts for a link to be inserted into the buffer.
2866 You can just type a link, using text for an internal link, or one of the link
2867 type prefixes mentioned in the examples above. The link will be inserted
2868 into the buffer@footnote{After insertion of a stored link, the link will be
2869 removed from the list of stored links. To keep it in the list later use, use
2870 a triple @kbd{C-u} prefix argument to @kbd{C-c C-l}, or configure the option
2871 @code{org-keep-stored-link-after-insertion}.}, along with a descriptive text.
2872 If some text was selected when this command is called, the selected text
2873 becomes the default description.
2875 @b{Inserting stored links}@*
2876 All links stored during the
2877 current session are part of the history for this prompt, so you can access
2878 them with @key{up} and @key{down} (or @kbd{M-p/n}).
2880 @b{Completion support}@* Completion with @key{TAB} will help you to insert
2881 valid link prefixes like @samp{http:} or @samp{ftp:}, including the prefixes
2882 defined through link abbreviations (@pxref{Link abbreviations}). If you
2883 press @key{RET} after inserting only the @var{prefix}, Org will offer
2884 specific completion support for some link types@footnote{This works by
2885 calling a special function @code{org-PREFIX-complete-link}.} For
2886 example, if you type @kbd{file @key{RET}}, file name completion (alternative
2887 access: @kbd{C-u C-c C-l}, see below) will be offered, and after @kbd{bbdb
2888 @key{RET}} you can complete contact names.
2890 @cindex file name completion
2891 @cindex completion, of file names
2893 When @kbd{C-c C-l} is called with a @kbd{C-u} prefix argument, a link to
2894 a file will be inserted and you may use file name completion to select
2895 the name of the file. The path to the file is inserted relative to the
2896 directory of the current Org file, if the linked file is in the current
2897 directory or in a sub-directory of it, or if the path is written relative
2898 to the current directory using @samp{../}. Otherwise an absolute path
2899 is used, if possible with @samp{~/} for your home directory. You can
2900 force an absolute path with two @kbd{C-u} prefixes.
2902 @item C-c C-l @r{(with cursor on existing link)}
2903 When the cursor is on an existing link, @kbd{C-c C-l} allows you to edit the
2904 link and description parts of the link.
2906 @cindex following links
2909 @item C-c C-o @r{or} @key{RET}
2910 @vindex org-file-apps
2911 Open link at point. This will launch a web browser for URLs (using
2912 @command{browse-url-at-point}), run VM/MH-E/Wanderlust/Rmail/Gnus/BBDB for
2913 the corresponding links, and execute the command in a shell link. When the
2914 cursor is on an internal link, this commands runs the corresponding search.
2915 When the cursor is on a TAG list in a headline, it creates the corresponding
2916 TAGS view. If the cursor is on a timestamp, it compiles the agenda for that
2917 date. Furthermore, it will visit text and remote files in @samp{file:} links
2918 with Emacs and select a suitable application for local non-text files.
2919 Classification of files is based on file extension only. See option
2920 @code{org-file-apps}. If you want to override the default application and
2921 visit the file with Emacs, use a @kbd{C-u} prefix. If you want to avoid
2922 opening in Emacs, use a @kbd{C-u C-u} prefix.@*
2923 If the cursor is on a headline, but not on a link, offer all links in the
2924 headline and entry text.
2930 On links, @kbd{mouse-2} will open the link just as @kbd{C-c C-o}
2931 would. Under Emacs 22, @kbd{mouse-1} will also follow a link.
2935 @vindex org-display-internal-link-with-indirect-buffer
2936 Like @kbd{mouse-2}, but force file links to be opened with Emacs, and
2937 internal links to be displayed in another window@footnote{See the
2938 variable @code{org-display-internal-link-with-indirect-buffer}}.
2943 Push the current position onto the mark ring, to be able to return
2944 easily. Commands following an internal link do this automatically.
2946 @cindex links, returning to
2949 Jump back to a recorded position. A position is recorded by the
2950 commands following internal links, and by @kbd{C-c %}. Using this
2951 command several times in direct succession moves through a ring of
2952 previously recorded positions.
2956 @cindex links, finding next/previous
2959 Move forward/backward to the next link in the buffer. At the limit of
2960 the buffer, the search fails once, and then wraps around. The key
2961 bindings for this are really too long, you might want to bind this also
2962 to @kbd{C-n} and @kbd{C-p}
2964 (add-hook 'org-load-hook
2966 (define-key 'org-mode-map "\C-n" 'org-next-link)
2967 (define-key 'org-mode-map "\C-p" 'org-previous-link)))
2971 @node Using links outside Org, Link abbreviations, Handling links, Hyperlinks
2972 @section Using links outside Org
2974 You can insert and follow links that have Org syntax not only in
2975 Org, but in any Emacs buffer. For this, you should create two
2976 global commands, like this (please select suitable global keys
2980 (global-set-key "\C-c L" 'org-insert-link-global)
2981 (global-set-key "\C-c o" 'org-open-at-point-global)
2984 @node Link abbreviations, Search options, Using links outside Org, Hyperlinks
2985 @section Link abbreviations
2986 @cindex link abbreviations
2987 @cindex abbreviation, links
2989 Long URLs can be cumbersome to type, and often many similar links are
2990 needed in a document. For this you can use link abbreviations. An
2991 abbreviated link looks like this
2994 [[linkword:tag][description]]
2998 @vindex org-link-abbrev-alist
2999 where the tag is optional. The @i{linkword} must be a word; letter, numbers,
3000 @samp{-}, and @samp{_} are allowed here. Abbreviations are resolved
3001 according to the information in the variable @code{org-link-abbrev-alist}
3002 that relates the linkwords to replacement text. Here is an example:
3006 (setq org-link-abbrev-alist
3007 '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=")
3008 ("google" . "http://www.google.com/search?q=")
3009 ("ads" . "http://adsabs.harvard.edu/cgi-bin/
3010 nph-abs_connect?author=%s&db_key=AST")))
3014 If the replacement text contains the string @samp{%s}, it will be
3015 replaced with the tag. Otherwise the tag will be appended to the string
3016 in order to create the link. You may also specify a function that will
3017 be called with the tag as the only argument to create the link.
3019 With the above setting, you could link to a specific bug with
3020 @code{[[bugzilla:129]]}, search the web for @samp{OrgMode} with
3021 @code{[[google:OrgMode]]} and find out what the Org author is
3022 doing besides Emacs hacking with @code{[[ads:Dominik,C]]}.
3024 If you need special abbreviations just for a single Org buffer, you
3025 can define them in the file with
3029 #+LINK: bugzilla http://10.1.2.9/bugzilla/show_bug.cgi?id=
3030 #+LINK: google http://www.google.com/search?q=%s
3034 In-buffer completion (@pxref{Completion}) can be used after @samp{[} to
3035 complete link abbreviations. You may also define a function
3036 @code{org-PREFIX-complete-link} that implements special (e.g. completion)
3037 support for inserting such a link with @kbd{C-c C-l}. Such a function should
3038 not accept any arguments, and return the full link with prefix.
3040 @node Search options, Custom searches, Link abbreviations, Hyperlinks
3041 @section Search options in file links
3042 @cindex search option in file links
3043 @cindex file links, searching
3045 File links can contain additional information to make Emacs jump to a
3046 particular location in the file when following a link. This can be a
3047 line number or a search option after a double@footnote{For backward
3048 compatibility, line numbers can also follow a single colon.} colon. For
3049 example, when the command @kbd{C-c l} creates a link (@pxref{Handling
3050 links}) to a file, it encodes the words in the current line as a search
3051 string that can be used to find this line back later when following the
3052 link with @kbd{C-c C-o}.
3054 Here is the syntax of the different ways to attach a search to a file
3055 link, together with an explanation:
3058 [[file:~/code/main.c::255]]
3059 [[file:~/xx.org::My Target]]
3060 [[file:~/xx.org::*My Target]]
3061 [[file:~/xx.org::/regexp/]]
3068 Search for a link target @samp{<<My Target>>}, or do a text search for
3069 @samp{my target}, similar to the search in internal links, see
3070 @ref{Internal links}. In HTML export (@pxref{HTML export}), such a file
3071 link will become an HTML reference to the corresponding named anchor in
3074 In an Org file, restrict search to headlines.
3076 Do a regular expression search for @code{regexp}. This uses the Emacs
3077 command @code{occur} to list all matches in a separate window. If the
3078 target file is in Org mode, @code{org-occur} is used to create a
3079 sparse tree with the matches.
3080 @c If the target file is a directory,
3081 @c @code{grep} will be used to search all files in the directory.
3084 As a degenerate case, a file link with an empty file name can be used
3085 to search the current file. For example, @code{[[file:::find me]]} does
3086 a search for @samp{find me} in the current file, just as
3087 @samp{[[find me]]} would.
3089 @node Custom searches, , Search options, Hyperlinks
3090 @section Custom Searches
3091 @cindex custom search strings
3092 @cindex search strings, custom
3094 The default mechanism for creating search strings and for doing the
3095 actual search related to a file link may not work correctly in all
3096 cases. For example, Bib@TeX{} database files have many entries like
3097 @samp{year="1993"} which would not result in good search strings,
3098 because the only unique identification for a Bib@TeX{} entry is the
3101 @vindex org-create-file-search-functions
3102 @vindex org-execute-file-search-functions
3103 If you come across such a problem, you can write custom functions to set
3104 the right search string for a particular file type, and to do the search
3105 for the string in the file. Using @code{add-hook}, these functions need
3106 to be added to the hook variables
3107 @code{org-create-file-search-functions} and
3108 @code{org-execute-file-search-functions}. See the docstring for these
3109 variables for more information. Org actually uses this mechanism
3110 for Bib@TeX{} database files, and you can use the corresponding code as
3111 an implementation example. See the file @file{org-bibtex.el}.
3113 @node TODO Items, Tags, Hyperlinks, Top
3117 Org mode does not maintain TODO lists as separate documents@footnote{Of
3118 course, you can make a document that contains only long lists of TODO items,
3119 but this is not required.}. Instead, TODO items are an integral part of the
3120 notes file, because TODO items usually come up while taking notes! With Org
3121 mode, simply mark any entry in a tree as being a TODO item. In this way,
3122 information is not duplicated, and the entire context from which the TODO
3123 item emerged is always present.
3125 Of course, this technique for managing TODO items scatters them
3126 throughout your notes file. Org mode compensates for this by providing
3127 methods to give you an overview of all the things that you have to do.
3130 * TODO basics:: Marking and displaying TODO entries
3131 * TODO extensions:: Workflow and assignments
3132 * Progress logging:: Dates and notes for progress
3133 * Priorities:: Some things are more important than others
3134 * Breaking down tasks:: Splitting a task into manageable pieces
3135 * Checkboxes:: Tick-off lists
3138 @node TODO basics, TODO extensions, TODO Items, TODO Items
3139 @section Basic TODO functionality
3141 Any headline becomes a TODO item when it starts with the word
3142 @samp{TODO}, for example:
3145 *** TODO Write letter to Sam Fortune
3149 The most important commands to work with TODO entries are:
3153 @cindex cycling, of TODO states
3155 Rotate the TODO state of the current item among
3158 ,-> (unmarked) -> TODO -> DONE --.
3159 '--------------------------------'
3162 The same rotation can also be done ``remotely'' from the timeline and
3163 agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
3167 Select a specific keyword using completion or (if it has been set up)
3168 the fast selection interface. For the latter, you need to assign keys
3169 to TODO states, see @ref{Per-file keywords}, and @ref{Setting tags}, for
3172 @kindex S-@key{right}
3173 @kindex S-@key{left}
3174 @vindex org-treat-S-cursor-todo-selection-as-state-change
3177 Select the following/preceding TODO state, similar to cycling. Useful
3178 mostly if more than two TODO states are possible (@pxref{TODO
3179 extensions}). See also @ref{Conflicts}, for a discussion of the interaction
3180 with @code{shift-selection-mode}. See also the variable
3181 @code{org-treat-S-cursor-todo-selection-as-state-change}.
3184 @cindex sparse tree, for TODO
3187 @vindex org-todo-keywords
3188 View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}). Folds the
3189 entire buffer, but shows all TODO items and the headings hierarchy above
3190 them. With a prefix argument, search for a specific TODO. You will be
3191 prompted for the keyword, and you can also give a list of keywords like
3192 @code{KWD1|KWD2|...} to list entries that match any one of these keywords.
3193 With numeric prefix argument N, show the tree for the Nth keyword in the
3194 variable @code{org-todo-keywords}. With two prefix arguments, find all TODO
3198 Show the global TODO list. Collects the TODO items from all agenda
3199 files (@pxref{Agenda Views}) into a single buffer. The new buffer will
3200 be in @code{agenda-mode}, which provides commands to examine and
3201 manipulate the TODO entries from the new buffer (@pxref{Agenda
3202 commands}). @xref{Global TODO list}, for more information.
3203 @kindex S-M-@key{RET}
3205 Insert a new TODO entry below the current one.
3209 @vindex org-todo-state-tags-triggers
3210 Changing a TODO state can also trigger tag changes. See the docstring of the
3211 option @code{org-todo-state-tags-triggers} for details.
3213 @node TODO extensions, Progress logging, TODO basics, TODO Items
3214 @section Extended use of TODO keywords
3215 @cindex extended TODO keywords
3217 @vindex org-todo-keywords
3218 By default, marked TODO entries have one of only two states: TODO and
3219 DONE. Org mode allows you to classify TODO items in more complex ways
3220 with @emph{TODO keywords} (stored in @code{org-todo-keywords}). With
3221 special setup, the TODO keyword system can work differently in different
3224 Note that @i{tags} are another way to classify headlines in general and
3225 TODO items in particular (@pxref{Tags}).
3228 * Workflow states:: From TODO to DONE in steps
3229 * TODO types:: I do this, Fred does the rest
3230 * Multiple sets in one file:: Mixing it all, and still finding your way
3231 * Fast access to TODO states:: Single letter selection of a state
3232 * Per-file keywords:: Different files, different requirements
3233 * Faces for TODO keywords:: Highlighting states
3234 * TODO dependencies:: When one task needs to wait for others
3237 @node Workflow states, TODO types, TODO extensions, TODO extensions
3238 @subsection TODO keywords as workflow states
3239 @cindex TODO workflow
3240 @cindex workflow states as TODO keywords
3242 You can use TODO keywords to indicate different @emph{sequential} states
3243 in the process of working on an item, for example@footnote{Changing
3244 this variable only becomes effective after restarting Org mode in a
3248 (setq org-todo-keywords
3249 '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
3252 The vertical bar separates the TODO keywords (states that @emph{need
3253 action}) from the DONE states (which need @emph{no further action}). If
3254 you don't provide the separator bar, the last state is used as the DONE
3256 @cindex completion, of TODO keywords
3257 With this setup, the command @kbd{C-c C-t} will cycle an entry from TODO
3258 to FEEDBACK, then to VERIFY, and finally to DONE and DELEGATED. You may
3259 also use a numeric prefix argument to quickly select a specific state. For
3260 example @kbd{C-3 C-c C-t} will change the state immediately to VERIFY.
3261 Or you can use @kbd{S-@key{left}} to go backward through the sequence. If you
3262 define many keywords, you can use in-buffer completion
3263 (@pxref{Completion}) or even a special one-key selection scheme
3264 (@pxref{Fast access to TODO states}) to insert these words into the
3265 buffer. Changing a TODO state can be logged with a timestamp, see
3266 @ref{Tracking TODO state changes}, for more information.
3268 @node TODO types, Multiple sets in one file, Workflow states, TODO extensions
3269 @subsection TODO keywords as types
3271 @cindex names as TODO keywords
3272 @cindex types as TODO keywords
3274 The second possibility is to use TODO keywords to indicate different
3275 @emph{types} of action items. For example, you might want to indicate
3276 that items are for ``work'' or ``home''. Or, when you work with several
3277 people on a single project, you might want to assign action items
3278 directly to persons, by using their names as TODO keywords. This would
3279 be set up like this:
3282 (setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE")))
3285 In this case, different keywords do not indicate a sequence, but rather
3286 different types. So the normal work flow would be to assign a task to a
3287 person, and later to mark it DONE. Org mode supports this style by adapting
3288 the workings of the command @kbd{C-c C-t}@footnote{This is also true for the
3289 @kbd{t} command in the timeline and agenda buffers.}. When used several
3290 times in succession, it will still cycle through all names, in order to first
3291 select the right type for a task. But when you return to the item after some
3292 time and execute @kbd{C-c C-t} again, it will switch from any name directly
3293 to DONE. Use prefix arguments or completion to quickly select a specific
3294 name. You can also review the items of a specific TODO type in a sparse tree
3295 by using a numeric prefix to @kbd{C-c C-v}. For example, to see all things
3296 Lucy has to do, you would use @kbd{C-3 C-c C-v}. To collect Lucy's items
3297 from all agenda files into a single buffer, you would use the numeric prefix
3298 argument as well when creating the global TODO list: @kbd{C-3 C-c t}.
3300 @node Multiple sets in one file, Fast access to TODO states, TODO types, TODO extensions
3301 @subsection Multiple keyword sets in one file
3302 @cindex TODO keyword sets
3304 Sometimes you may want to use different sets of TODO keywords in
3305 parallel. For example, you may want to have the basic
3306 @code{TODO}/@code{DONE}, but also a workflow for bug fixing, and a
3307 separate state indicating that an item has been canceled (so it is not
3308 DONE, but also does not require action). Your setup would then look
3312 (setq org-todo-keywords
3313 '((sequence "TODO" "|" "DONE")
3314 (sequence "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED")
3315 (sequence "|" "CANCELED")))
3318 The keywords should all be different, this helps Org mode to keep track
3319 of which subsequence should be used for a given entry. In this setup,
3320 @kbd{C-c C-t} only operates within a subsequence, so it switches from
3321 @code{DONE} to (nothing) to @code{TODO}, and from @code{FIXED} to
3322 (nothing) to @code{REPORT}. Therefore you need a mechanism to initially
3323 select the correct sequence. Besides the obvious ways like typing a
3324 keyword or using completion, you may also apply the following commands:
3327 @kindex C-S-@key{right}
3328 @kindex C-S-@key{left}
3329 @kindex C-u C-u C-c C-t
3330 @item C-u C-u C-c C-t
3331 @itemx C-S-@key{right}
3332 @itemx C-S-@key{left}
3333 These keys jump from one TODO subset to the next. In the above example,
3334 @kbd{C-u C-u C-c C-t} or @kbd{C-S-@key{right}} would jump from @code{TODO} or
3335 @code{DONE} to @code{REPORT}, and any of the words in the second row to
3336 @code{CANCELED}. Note that the @kbd{C-S-} key binding conflict with
3337 @code{shift-selection-mode} (@pxref{Conflicts}).
3338 @kindex S-@key{right}
3339 @kindex S-@key{left}
3342 @kbd{S-@key{<left>}} and @kbd{S-@key{<right>}} and walk through @emph{all}
3343 keywords from all sets, so for example @kbd{S-@key{<right>}} would switch
3344 from @code{DONE} to @code{REPORT} in the example above. See also
3345 @ref{Conflicts}, for a discussion of the interaction with
3346 @code{shift-selection-mode}.
3349 @node Fast access to TODO states, Per-file keywords, Multiple sets in one file, TODO extensions
3350 @subsection Fast access to TODO states
3352 If you would like to quickly change an entry to an arbitrary TODO state
3353 instead of cycling through the states, you can set up keys for
3354 single-letter access to the states. This is done by adding the section
3355 key after each keyword, in parentheses. For example:
3358 (setq org-todo-keywords
3359 '((sequence "TODO(t)" "|" "DONE(d)")
3360 (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")
3361 (sequence "|" "CANCELED(c)")))
3364 @vindex org-fast-tag-selection-include-todo
3365 If you then press @code{C-c C-t} followed by the selection key, the entry
3366 will be switched to this state. @key{SPC} can be used to remove any TODO
3367 keyword from an entry.@footnote{Check also the variable
3368 @code{org-fast-tag-selection-include-todo}, it allows you to change the TODO
3369 state through the tags interface (@pxref{Setting tags}), in case you like to
3370 mingle the two concepts. Note that this means you need to come up with
3371 unique keys across both sets of keywords.}
3373 @node Per-file keywords, Faces for TODO keywords, Fast access to TODO states, TODO extensions
3374 @subsection Setting up keywords for individual files
3375 @cindex keyword options
3376 @cindex per-file keywords
3381 It can be very useful to use different aspects of the TODO mechanism in
3382 different files. For file-local settings, you need to add special lines
3383 to the file which set the keywords and interpretation for that file
3384 only. For example, to set one of the two examples discussed above, you
3385 need one of the following lines, starting in column zero anywhere in the
3389 #+TODO: TODO FEEDBACK VERIFY | DONE CANCELED
3391 @noindent (you may also write @code{#+SEQ_TODO} to be explicit about the
3392 interpretation, but it means the same as @code{#+TODO}), or
3394 #+TYP_TODO: Fred Sara Lucy Mike | DONE
3397 A setup for using several sets in parallel would be:
3401 #+TODO: REPORT BUG KNOWNCAUSE | FIXED
3405 @cindex completion, of option keywords
3407 @noindent To make sure you are using the correct keyword, type
3408 @samp{#+} into the buffer and then use @kbd{M-@key{TAB}} completion.
3410 @cindex DONE, final TODO keyword
3411 Remember that the keywords after the vertical bar (or the last keyword
3412 if no bar is there) must always mean that the item is DONE (although you
3413 may use a different word). After changing one of these lines, use
3414 @kbd{C-c C-c} with the cursor still in the line to make the changes
3415 known to Org mode@footnote{Org mode parses these lines only when
3416 Org mode is activated after visiting a file. @kbd{C-c C-c} with the
3417 cursor in a line starting with @samp{#+} is simply restarting Org mode
3418 for the current buffer.}.
3420 @node Faces for TODO keywords, TODO dependencies, Per-file keywords, TODO extensions
3421 @subsection Faces for TODO keywords
3422 @cindex faces, for TODO keywords
3424 @vindex org-todo @r{(face)}
3425 @vindex org-done @r{(face)}
3426 @vindex org-todo-keyword-faces
3427 Org mode highlights TODO keywords with special faces: @code{org-todo}
3428 for keywords indicating that an item still has to be acted upon, and
3429 @code{org-done} for keywords indicating that an item is finished. If
3430 you are using more than 2 different states, you might want to use
3431 special faces for some of them. This can be done using the variable
3432 @code{org-todo-keyword-faces}. For example:
3436 (setq org-todo-keyword-faces
3437 '(("TODO" . org-warning)
3438 ("DEFERRED" . shadow)
3439 ("CANCELED" . (:foreground "blue" :weight bold))))
3443 While using a list with face properties as shown for CANCELED
3444 @emph{should} work, this does not aways seem to be the case. If
3445 necessary, define a special face and use that.
3447 @node TODO dependencies, , Faces for TODO keywords, TODO extensions
3448 @subsection TODO dependencies
3449 @cindex TODO dependencies
3450 @cindex dependencies, of TODO states
3452 @vindex org-enforce-todo-dependencies
3453 @cindex property, ORDERED
3454 The structure of Org files (hierarchy and lists) makes it easy to define TODO
3455 dependencies. Usually, a parent TODO task should not be marked DONE until
3456 all subtasks (defined as children tasks) are marked as DONE. And sometimes
3457 there is a logical sequence to a number of (sub)tasks, so that one task
3458 cannot be acted upon before all siblings above it are done. If you customize
3459 the variable @code{org-enforce-todo-dependencies}, Org will block entries
3460 from changing state to DONE while they have children that are not DONE.
3461 Furthermore, if an entry has a property @code{ORDERED}, each of its children
3462 will be blocked until all earlier siblings are marked DONE. Here is an
3466 * TODO Blocked until (two) is done
3475 ** TODO b, needs to wait for (a)
3476 ** TODO c, needs to wait for (a) and (b)
3482 @vindex org-track-ordered-property-with-tag
3483 @cindex property, ORDERED
3484 Toggle the @code{ORDERED} property of the current entry. A property is used
3485 for this behavior because this should be local to the current entry, not
3486 inherited like a tag. However, if you would like to @i{track} the value of
3487 this property with a tag for better visibility, customize the variable
3488 @code{org-track-ordered-property-with-tag}.
3489 @kindex C-u C-u C-u C-c C-t
3490 @item C-u C-u C-u C-c C-t
3491 Change TODO state, circumventing any state blocking.
3494 @vindex org-agenda-dim-blocked-tasks
3495 If you set the variable @code{org-agenda-dim-blocked-tasks}, TODO entries
3496 that cannot be closed because of such dependencies will be shown in a dimmed
3497 font or even made invisible in agenda views (@pxref{Agenda Views}).
3499 @cindex checkboxes and TODO dependencies
3500 @vindex org-enforce-todo-dependencies
3501 You can also block changes of TODO states by looking at checkboxes
3502 (@pxref{Checkboxes}). If you set the variable
3503 @code{org-enforce-todo-checkbox-dependencies}, an entry that has unchecked
3504 checkboxes will be blocked from switching to DONE.
3506 If you need more complex dependency structures, for example dependencies
3507 between entries in different trees or files, check out the contributed
3508 module @file{org-depend.el}.
3511 @node Progress logging, Priorities, TODO extensions, TODO Items
3512 @section Progress logging
3513 @cindex progress logging
3514 @cindex logging, of progress
3516 Org mode can automatically record a timestamp and possibly a note when
3517 you mark a TODO item as DONE, or even each time you change the state of
3518 a TODO item. This system is highly configurable, settings can be on a
3519 per-keyword basis and can be localized to a file or even a subtree. For
3520 information on how to clock working time for a task, see @ref{Clocking
3524 * Closing items:: When was this entry marked DONE?
3525 * Tracking TODO state changes:: When did the status change?
3528 @node Closing items, Tracking TODO state changes, Progress logging, Progress logging
3529 @subsection Closing items
3531 The most basic logging is to keep track of @emph{when} a certain TODO
3532 item was finished. This is achieved with@footnote{The corresponding
3533 in-buffer setting is: @code{#+STARTUP: logdone}}.
3536 (setq org-log-done 'time)
3540 Then each time you turn an entry from a TODO (not-done) state into any
3541 of the DONE states, a line @samp{CLOSED: [timestamp]} will be inserted
3542 just after the headline. If you turn the entry back into a TODO item
3543 through further state cycling, that line will be removed again. If you
3544 want to record a note along with the timestamp, use@footnote{The
3545 corresponding in-buffer setting is: @code{#+STARTUP: lognotedone}}
3548 (setq org-log-done 'note)
3552 You will then be prompted for a note, and that note will be stored below
3553 the entry with a @samp{Closing Note} heading.
3555 In the timeline (@pxref{Timeline}) and in the agenda
3556 (@pxref{Weekly/daily agenda}), you can then use the @kbd{l} key to
3557 display the TODO items with a @samp{CLOSED} timestamp on each day,
3558 giving you an overview of what has been done.
3560 @node Tracking TODO state changes, , Closing items, Progress logging
3561 @subsection Tracking TODO state changes
3562 @cindex drawer, for state change recording
3564 @vindex org-log-states-order-reversed
3565 @vindex org-log-into-drawer
3566 @cindex property, LOG_INTO_DRAWER
3567 When TODO keywords are used as workflow states (@pxref{Workflow states}), you
3568 might want to keep track of when a state change occurred and maybe take a
3569 note about this change. You can either record just a timestamp, or a
3570 time-stamped note for a change. These records will be inserted after the
3571 headline as an itemized list, newest first@footnote{See the variable
3572 @code{org-log-states-order-reversed}}. When taking a lot of notes, you might
3573 want to get the notes out of the way into a drawer (@pxref{Drawers}).
3574 Customize the variable @code{org-log-into-drawer} to get this
3575 behavior---the recommended drawer for this is called @code{LOGBOOK}. You can
3576 also overrule the setting of this variable for a subtree by setting a
3577 @code{LOG_INTO_DRAWER} property.
3579 Since it is normally too much to record a note for every state, Org mode
3580 expects configuration on a per-keyword basis for this. This is achieved by
3581 adding special markers @samp{!} (for a timestamp) and @samp{@@} (for a note)
3582 in parentheses after each keyword. For example, with the setting
3585 (setq org-todo-keywords
3586 '((sequence "TODO(t)" "WAIT(w@@/!)" "|" "DONE(d!)" "CANCELED(c@@)")))
3590 @vindex org-log-done
3591 you not only define global TODO keywords and fast access keys, but also
3592 request that a time is recorded when the entry is set to
3593 DONE@footnote{It is possible that Org mode will record two timestamps
3594 when you are using both @code{org-log-done} and state change logging.
3595 However, it will never prompt for two notes---if you have configured
3596 both, the state change recording note will take precedence and cancel
3597 the @samp{Closing Note}.}, and that a note is recorded when switching to
3598 WAIT or CANCELED. The setting for WAIT is even more special: the
3599 @samp{!} after the slash means that in addition to the note taken when
3600 entering the state, a timestamp should be recorded when @i{leaving} the
3601 WAIT state, if and only if the @i{target} state does not configure
3602 logging for entering it. So it has no effect when switching from WAIT
3603 to DONE, because DONE is configured to record a timestamp only. But
3604 when switching from WAIT back to TODO, the @samp{/!} in the WAIT
3605 setting now triggers a timestamp even though TODO has no logging
3608 You can use the exact same syntax for setting logging preferences local
3611 #+TODO: TODO(t) WAIT(w@@/!) | DONE(d!) CANCELED(c@@)
3614 @cindex property, LOGGING
3615 In order to define logging settings that are local to a subtree or a
3616 single item, define a LOGGING property in this entry. Any non-empty
3617 LOGGING property resets all logging settings to nil. You may then turn
3618 on logging for this specific tree using STARTUP keywords like
3619 @code{lognotedone} or @code{logrepeat}, as well as adding state specific
3620 settings like @code{TODO(!)}. For example
3623 * TODO Log each state with only a time
3625 :LOGGING: TODO(!) WAIT(!) DONE(!) CANCELED(!)
3627 * TODO Only log when switching to WAIT, and when repeating
3629 :LOGGING: WAIT(@@) logrepeat
3631 * TODO No logging at all
3637 @node Priorities, Breaking down tasks, Progress logging, TODO Items
3641 If you use Org mode extensively, you may end up enough TODO items that
3642 it starts to make sense to prioritize them. Prioritizing can be done by
3643 placing a @emph{priority cookie} into the headline of a TODO item, like
3647 *** TODO [#A] Write letter to Sam Fortune
3651 By default, Org mode supports three priorities: @samp{A}, @samp{B}, and
3652 @samp{C}. @samp{A} is the highest priority. An entry without a cookie
3653 is treated as priority @samp{B}. Priorities make a difference only in
3654 the agenda (@pxref{Weekly/daily agenda}); outside the agenda, they have
3655 no inherent meaning to Org mode.
3657 Priorities can be attached to any outline tree entries; they do not need
3663 Set the priority of the current headline. The command prompts for a
3664 priority character @samp{A}, @samp{B} or @samp{C}. When you press
3665 @key{SPC} instead, the priority cookie is removed from the headline.
3666 The priorities can also be changed ``remotely'' from the timeline and
3667 agenda buffer with the @kbd{,} command (@pxref{Agenda commands}).
3670 @kindex S-@key{down}
3673 @vindex org-priority-start-cycle-with-default
3674 Increase/decrease priority of current headline@footnote{See also the option
3675 @code{org-priority-start-cycle-with-default}.}. Note that these keys are
3676 also used to modify timestamps (@pxref{Creating timestamps}). See also
3677 @ref{Conflicts}, for a discussion of the interaction with
3678 @code{shift-selection-mode}.
3681 @vindex org-highest-priority
3682 @vindex org-lowest-priority
3683 @vindex org-default-priority
3684 You can change the range of allowed priorities by setting the variables
3685 @code{org-highest-priority}, @code{org-lowest-priority}, and
3686 @code{org-default-priority}. For an individual buffer, you may set
3687 these values (highest, lowest, default) like this (please make sure that
3688 the highest priority is earlier in the alphabet than the lowest
3691 @cindex #+PRIORITIES
3696 @node Breaking down tasks, Checkboxes, Priorities, TODO Items
3697 @section Breaking tasks down into subtasks
3698 @cindex tasks, breaking down
3699 @cindex statistics, for TODO items
3701 @vindex org-agenda-todo-list-sublevels
3702 It is often advisable to break down large tasks into smaller, manageable
3703 subtasks. You can do this by creating an outline tree below a TODO item,
3704 with detailed subtasks on the tree@footnote{To keep subtasks out of the
3705 global TODO list, see the @code{org-agenda-todo-list-sublevels}.}. To keep
3706 the overview over the fraction of subtasks that are already completed, insert
3707 either @samp{[/]} or @samp{[%]} anywhere in the headline. These cookies will
3708 be updates each time the todo status of a child changes, or when pressing
3709 @kbd{C-c C-c} on the cookie. For example:
3712 * Organize Party [33%]
3713 ** TODO Call people [1/2]
3717 ** DONE Talk to neighbor
3720 @cindex property, COOKIE_DATA
3721 If a heading has both checkboxes and TODO children below it, the meaning of
3722 the statistics cookie become ambiguous. Set the property
3723 @code{COOKIE_DATA} to either @samp{checkbox} or @samp{todo} to resolve
3726 @vindex org-hierarchical-todo-statistics
3727 If you would like to have the statistics cookie count any TODO entries in the
3728 subtree (not just direct children), confgure the variable
3729 @code{org-hierarchical-todo-statistics}. To do this for a single subtree,
3730 include the word @samp{recursive} into the value of the @code{COOKIE_DATA}
3734 * Parent capturing statistics [2/20]
3736 :COOKIE_DATA: todo recursive
3740 If you would like a TODO entry to automatically change to DONE
3741 when all children are done, you can use the following setup:
3744 (defun org-summary-todo (n-done n-not-done)
3745 "Switch entry to DONE when all subentries are done, to TODO otherwise."
3746 (let (org-log-done org-log-states) ; turn off logging
3747 (org-todo (if (= n-not-done 0) "DONE" "TODO"))))
3749 (add-hook 'org-after-todo-statistics-hook 'org-summary-todo)
3753 Another possibility is the use of checkboxes to identify (a hierarchy of) a
3754 large number of subtasks (@pxref{Checkboxes}).
3757 @node Checkboxes, , Breaking down tasks, TODO Items
3761 Every item in a plain list (@pxref{Plain lists}) can be made into a
3762 checkbox by starting it with the string @samp{[ ]}. This feature is
3763 similar to TODO items (@pxref{TODO Items}), but is more lightweight.
3764 Checkboxes are not included into the global TODO list, so they are often
3765 great to split a task into a number of simple steps. Or you can use
3766 them in a shopping list. To toggle a checkbox, use @kbd{C-c C-c}, or
3767 use the mouse (thanks to Piotr Zielinski's @file{org-mouse.el}).
3769 Here is an example of a checkbox list.
3772 * TODO Organize party [2/4]
3773 - [-] call people [1/3]
3778 - [ ] think about what music to play
3779 - [X] talk to the neighbors
3782 Checkboxes work hierarchically, so if a checkbox item has children that
3783 are checkboxes, toggling one of the children checkboxes will make the
3784 parent checkbox reflect if none, some, or all of the children are
3787 @cindex statistics, for checkboxes
3788 @cindex checkbox statistics
3789 @cindex property, COOKIE_DATA
3790 @vindex org-hierarchical-checkbox-statistics
3791 The @samp{[2/4]} and @samp{[1/3]} in the first and second line are cookies
3792 indicating how many checkboxes present in this entry have been checked off,
3793 and the total number of checkboxes present. This can give you an idea on how
3794 many checkboxes remain, even without opening a folded entry. The cookies can
3795 be placed into a headline or into (the first line of) a plain list item.
3796 Each cookie covers checkboxes of direct children structurally below the
3797 headline/item on which the cookie appears@footnote{Set the variable
3798 @code{org-hierarchical-checkbox-statistics} if you want such cookies to
3799 represent the all checkboxes below the cookie, not just the direct
3800 children.}. You have to insert the cookie yourself by typing either
3801 @samp{[/]} or @samp{[%]}. With @samp{[/]} you get an @samp{n out of m}
3802 result, as in the examples above. With @samp{[%]} you get information about
3803 the percentage of checkboxes checked (in the above example, this would be
3804 @samp{[50%]} and @samp{[33%]}, respectively). In a headline, a cookie can
3805 count either checkboxes below the heading or TODO states of children, and it
3806 will display whatever was changed last. Set the property @code{COOKIE_DATA}
3807 to either @samp{checkbox} or @samp{todo} to resolve this issue.
3809 @cindex blocking, of checkboxes
3810 @cindex checkbox blocking
3811 @cindex property, ORDERED
3812 If the current outline node has an @code{ORDERED} property, checkboxes must
3813 be checked off in sequence, and an error will be thrown if you try to check
3814 off a box while there are unchecked boxes above it.
3816 @noindent The following commands work with checkboxes:
3821 Toggle checkbox status or (with prefix arg) checkbox presence at point. With
3822 double prefix argument, set it to @samp{[-]}, which is considered to be an
3826 Toggle checkbox status or (with prefix arg) checkbox presence at point. With
3827 double prefix argument, set it to @samp{[-]}, which is considered to be an
3831 If there is an active region, toggle the first checkbox in the region
3832 and set all remaining boxes to the same status as the first. With a prefix
3833 arg, add or remove the checkbox for all items in the region.
3835 If the cursor is in a headline, toggle checkboxes in the region between
3836 this headline and the next (so @emph{not} the entire subtree).
3838 If there is no active region, just toggle the checkbox at point.
3840 @kindex M-S-@key{RET}
3842 Insert a new item with a checkbox.
3843 This works only if the cursor is already in a plain list item
3844 (@pxref{Plain lists}).
3847 @vindex org-track-ordered-property-with-tag
3848 @cindex property, ORDERED
3849 Toggle the @code{ORDERED} property of the entry, to toggle if checkboxes must
3850 be checked off in sequence. A property is used for this behavior because
3851 this should be local to the current entry, not inherited like a tag.
3852 However, if you would like to @i{track} the value of this property with a tag
3853 for better visibility, customize the variable
3854 @code{org-track-ordered-property-with-tag}.
3857 Update the statistics cookie in the current outline entry. When called with
3858 a @kbd{C-u} prefix, update the entire file. Checkbox statistic cookies are
3859 updated automatically if you toggle checkboxes with @kbd{C-c C-c} and make
3860 new ones with @kbd{M-S-@key{RET}}. TODO statistics cookies update when
3861 changing TODO states. If you delete boxes/entries or add/change them by
3862 hand, use this command to get things back into sync. Or simply toggle any
3863 entry twice (checkboxes with @kbd{C-c C-c}).
3866 @node Tags, Properties and Columns, TODO Items, Top
3869 @cindex headline tagging
3870 @cindex matching, tags
3871 @cindex sparse tree, tag based
3873 An excellent way to implement labels and contexts for cross-correlating
3874 information is to assign @i{tags} to headlines. Org mode has extensive
3877 @vindex org-tag-faces
3878 Every headline can contain a list of tags; they occur at the end of the
3879 headline. Tags are normal words containing letters, numbers, @samp{_}, and
3880 @samp{@@}. Tags must be preceded and followed by a single colon, e.g.,
3881 @samp{:work:}. Several tags can be specified, as in @samp{:work:urgent:}.
3882 Tags will by default be in bold face with the same color as the headline.
3883 You may specify special faces for specific tags using the variable
3884 @code{org-tag-faces}, in much the same way as you can for TODO keywords
3885 (@pxref{Faces for TODO keywords}).
3888 * Tag inheritance:: Tags use the tree structure of the outline
3889 * Setting tags:: How to assign tags to a headline
3890 * Tag searches:: Searching for combinations of tags
3893 @node Tag inheritance, Setting tags, Tags, Tags
3894 @section Tag inheritance
3895 @cindex tag inheritance
3896 @cindex inheritance, of tags
3897 @cindex sublevels, inclusion into tags match
3899 @i{Tags} make use of the hierarchical structure of outline trees. If a
3900 heading has a certain tag, all subheadings will inherit the tag as
3901 well. For example, in the list
3904 * Meeting with the French group :work:
3905 ** Summary by Frank :boss:notes:
3906 *** TODO Prepare slides for him :action:
3910 the final heading will have the tags @samp{:work:}, @samp{:boss:},
3911 @samp{:notes:}, and @samp{:action:} even though the final heading is not
3912 explicitly marked with those tags. You can also set tags that all entries in
3913 a file should inherit just as if these tags were defined in a hypothetical
3914 level zero that surrounds the entire file. Use a line like this@footnote{As
3915 with all these in-buffer settings, pressing @kbd{C-c C-c} activates any
3916 changes in the line.}:
3920 #+FILETAGS: :Peter:Boss:Secret:
3924 @vindex org-use-tag-inheritance
3925 @vindex org-tags-exclude-from-inheritance
3926 To limit tag inheritance to specific tags, or to turn it off entirely, use
3927 the variables @code{org-use-tag-inheritance} and
3928 @code{org-tags-exclude-from-inheritance}.
3930 @vindex org-tags-match-list-sublevels
3931 When a headline matches during a tags search while tag inheritance is turned
3932 on, all the sublevels in the same tree will (for a simple match form) match
3933 as well@footnote{This is only true if the search does not involve more
3934 complex tests including properties (@pxref{Property searches}).}. The list
3935 of matches may then become very long. If you only want to see the first tags
3936 match in a subtree, configure the variable
3937 @code{org-tags-match-list-sublevels} (not recommended).
3939 @node Setting tags, Tag searches, Tag inheritance, Tags
3940 @section Setting tags
3941 @cindex setting tags
3942 @cindex tags, setting
3945 Tags can simply be typed into the buffer at the end of a headline.
3946 After a colon, @kbd{M-@key{TAB}} offers completion on tags. There is
3947 also a special command for inserting tags:
3952 @cindex completion, of tags
3953 @vindex org-tags-column
3954 Enter new tags for the current headline. Org mode will either offer
3955 completion or a special single-key interface for setting tags, see
3956 below. After pressing @key{RET}, the tags will be inserted and aligned
3957 to @code{org-tags-column}. When called with a @kbd{C-u} prefix, all
3958 tags in the current buffer will be aligned to that column, just to make
3959 things look nice. TAGS are automatically realigned after promotion,
3960 demotion, and TODO state changes (@pxref{TODO basics}).
3963 When the cursor is in a headline, this does the same as @kbd{C-c C-q}.
3966 @vindex org-tag-alist
3967 Org will support tag insertion based on a @emph{list of tags}. By
3968 default this list is constructed dynamically, containing all tags
3969 currently used in the buffer. You may also globally specify a hard list
3970 of tags with the variable @code{org-tag-alist}. Finally you can set
3971 the default tags for a given file with lines like
3975 #+TAGS: @@work @@home @@tennisclub
3976 #+TAGS: laptop car pc sailboat
3979 If you have globally defined your preferred set of tags using the
3980 variable @code{org-tag-alist}, but would like to use a dynamic tag list
3981 in a specific file, add an empty TAGS option line to that file:
3987 @vindex org-tag-persistent-alist
3988 If you have a preferred set of tags that you would like to use in every file,
3989 in addition to those defined on a per-file basis by TAGS option lines, then
3990 you may specify a list of tags with the variable
3991 @code{org-tag-persistent-alist}. You may turn this off on a per-file basis
3992 by adding a STARTUP option line to that file:
3998 By default Org mode uses the standard minibuffer completion facilities for
3999 entering tags. However, it also implements another, quicker, tag selection
4000 method called @emph{fast tag selection}. This allows you to select and
4001 deselect tags with just a single key press. For this to work well you should
4002 assign unique letters to most of your commonly used tags. You can do this
4003 globally by configuring the variable @code{org-tag-alist} in your
4004 @file{.emacs} file. For example, you may find the need to tag many items in
4005 different files with @samp{:@@home:}. In this case you can set something
4009 (setq org-tag-alist '(("@@work" . ?w) ("@@home" . ?h) ("laptop" . ?l)))
4012 @noindent If the tag is only relevant to the file you are working on, then you
4013 can instead set the TAGS option line as:
4016 #+TAGS: @@work(w) @@home(h) @@tennisclub(t) laptop(l) pc(p)
4019 @noindent The tags interface will show the available tags in a splash
4020 window. If you want to start a new line after a specific tag, insert
4021 @samp{\n} into the tag list
4024 #+TAGS: @@work(w) @@home(h) @@tennisclub(t) \n laptop(l) pc(p)
4027 @noindent or write them in two lines:
4030 #+TAGS: @@work(w) @@home(h) @@tennisclub(t)
4031 #+TAGS: laptop(l) pc(p)
4035 You can also group together tags that are mutually exclusive by using
4039 #+TAGS: @{ @@work(w) @@home(h) @@tennisclub(t) @} laptop(l) pc(p)
4042 @noindent you indicate that at most one of @samp{@@work}, @samp{@@home},
4043 and @samp{@@tennisclub} should be selected. Multiple such groups are allowed.
4045 @noindent Don't forget to press @kbd{C-c C-c} with the cursor in one of
4046 these lines to activate any changes.
4049 To set these mutually exclusive groups in the variable @code{org-tags-alist},
4050 you must use the dummy tags @code{:startgroup} and @code{:endgroup} instead
4051 of the braces. Similarly, you can use @code{:newline} to indicate a line
4052 break. The previous example would be set globally by the following
4056 (setq org-tag-alist '((:startgroup . nil)
4057 ("@@work" . ?w) ("@@home" . ?h)
4058 ("@@tennisclub" . ?t)
4060 ("laptop" . ?l) ("pc" . ?p)))
4063 If at least one tag has a selection key then pressing @kbd{C-c C-c} will
4064 automatically present you with a special interface, listing inherited tags,
4065 the tags of the current headline, and a list of all valid tags with
4066 corresponding keys@footnote{Keys will automatically be assigned to tags which
4067 have no configured keys.}. In this interface, you can use the following
4072 Pressing keys assigned to tags will add or remove them from the list of
4073 tags in the current line. Selecting a tag in a group of mutually
4074 exclusive tags will turn off any other tags from that group.
4077 Enter a tag in the minibuffer, even if the tag is not in the predefined
4078 list. You will be able to complete on all tags present in the buffer.
4081 Clear all tags for this line.
4084 Accept the modified set.
4086 Abort without installing changes.
4088 If @kbd{q} is not assigned to a tag, it aborts like @kbd{C-g}.
4090 Turn off groups of mutually exclusive tags. Use this to (as an
4091 exception) assign several tags from such a group.
4093 Toggle auto-exit after the next change (see below).
4094 If you are using expert mode, the first @kbd{C-c} will display the
4099 This method lets you assign tags to a headline with very few keys. With
4100 the above setup, you could clear the current tags and set @samp{@@home},
4101 @samp{laptop} and @samp{pc} tags with just the following keys: @kbd{C-c
4102 C-c @key{SPC} h l p @key{RET}}. Switching from @samp{@@home} to
4103 @samp{@@work} would be done with @kbd{C-c C-c w @key{RET}} or
4104 alternatively with @kbd{C-c C-c C-c w}. Adding the non-predefined tag
4105 @samp{Sarah} could be done with @kbd{C-c C-c @key{TAB} S a r a h
4106 @key{RET} @key{RET}}.
4108 @vindex org-fast-tag-selection-single-key
4109 If you find that most of the time you need only a single key press to
4110 modify your list of tags, set the variable
4111 @code{org-fast-tag-selection-single-key}. Then you no longer have to
4112 press @key{RET} to exit fast tag selection---it will immediately exit
4113 after the first change. If you then occasionally need more keys, press
4114 @kbd{C-c} to turn off auto-exit for the current tag selection process
4115 (in effect: start selection with @kbd{C-c C-c C-c} instead of @kbd{C-c
4116 C-c}). If you set the variable to the value @code{expert}, the special
4117 window is not even shown for single-key tag selection, it comes up only
4118 when you press an extra @kbd{C-c}.
4120 @node Tag searches, , Setting tags, Tags
4121 @section Tag searches
4122 @cindex tag searches
4123 @cindex searching for tags
4125 Once a system of tags has been set up, it can be used to collect related
4126 information into special lists.
4133 Create a sparse tree with all headlines matching a tags search. With a
4134 @kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
4137 Create a global list of tag matches from all agenda files.
4138 @xref{Matching tags and properties}.
4141 @vindex org-tags-match-list-sublevels
4142 Create a global list of tag matches from all agenda files, but check
4143 only TODO items and force checking subitems (see variable
4144 @code{org-tags-match-list-sublevels}).
4147 These commands all prompt for a match string which allows basic Boolean logic
4148 like @samp{+boss+urgent-project1}, to find entries with tags @samp{boss} and
4149 @samp{urgent}, but not @samp{project1}, or @samp{Kathy|Sally} to find entries
4150 which are tagged, like @samp{Kathy} or @samp{Sally}. The full syntax of the search
4151 string is rich and allows also matching against TODO keywords, entry levels
4152 and properties. For a complete description with many examples, see
4153 @ref{Matching tags and properties}.
4156 @node Properties and Columns, Dates and Times, Tags, Top
4157 @chapter Properties and Columns
4160 Properties are a set of key-value pairs associated with an entry. There
4161 are two main applications for properties in Org mode. First, properties
4162 are like tags, but with a value. Second, you can use properties to
4163 implement (very basic) database capabilities in an Org buffer. For
4164 an example of the first application, imagine maintaining a file where
4165 you document bugs and plan releases for a piece of software. Instead of
4166 using tags like @code{:release_1:}, @code{:release_2:}, one can use a
4167 property, say @code{:Release:}, that in different subtrees has different
4168 values, such as @code{1.0} or @code{2.0}. For an example of the second
4169 application of properties, imagine keeping track of your music CDs,
4170 where properties could be things such as the album, artist, date of
4171 release, number of tracks, and so on.
4173 Properties can be conveniently edited and viewed in column view
4174 (@pxref{Column view}).
4177 * Property syntax:: How properties are spelled out
4178 * Special properties:: Access to other Org mode features
4179 * Property searches:: Matching property values
4180 * Property inheritance:: Passing values down the tree
4181 * Column view:: Tabular viewing and editing
4182 * Property API:: Properties for Lisp programmers
4185 @node Property syntax, Special properties, Properties and Columns, Properties and Columns
4186 @section Property syntax
4187 @cindex property syntax
4188 @cindex drawer, for properties
4190 Properties are key-value pairs. They need to be inserted into a special
4191 drawer (@pxref{Drawers}) with the name @code{PROPERTIES}. Each property
4192 is specified on a single line, with the key (surrounded by colons)
4193 first, and the value after it. Here is an example:
4198 *** Goldberg Variations
4200 :Title: Goldberg Variations
4201 :Composer: J.S. Bach
4203 :Publisher: Deutsche Grammophon
4208 You may define the allowed values for a particular property @samp{:Xyz:}
4209 by setting a property @samp{:Xyz_ALL:}. This special property is
4210 @emph{inherited}, so if you set it in a level 1 entry, it will apply to
4211 the entire tree. When allowed values are defined, setting the
4212 corresponding property becomes easier and is less prone to typing
4213 errors. For the example with the CD collection, we can predefine
4214 publishers and the number of disks in a box like this:
4219 :NDisks_ALL: 1 2 3 4
4220 :Publisher_ALL: "Deutsche Grammophon" Philips EMI
4224 If you want to set properties that can be inherited by any entry in a
4225 file, use a line like
4226 @cindex property, _ALL
4229 #+PROPERTY: NDisks_ALL 1 2 3 4
4232 @vindex org-global-properties
4233 Property values set with the global variable
4234 @code{org-global-properties} can be inherited by all entries in all
4238 The following commands help to work with properties:
4243 After an initial colon in a line, complete property keys. All keys used
4244 in the current file will be offered as possible completions.
4247 Set a property. This prompts for a property name and a value. If
4248 necessary, the property drawer is created as well.
4249 @item M-x org-insert-property-drawer
4250 Insert a property drawer into the current entry. The drawer will be
4251 inserted early in the entry, but after the lines with planning
4252 information like deadlines.
4255 With the cursor in a property drawer, this executes property commands.
4257 Set a property in the current entry. Both the property and the value
4258 can be inserted using completion.
4259 @kindex S-@key{right}
4260 @kindex S-@key{left}
4261 @item S-@key{left}/@key{right}
4262 Switch property at point to the next/previous allowed value.
4264 Remove a property from the current entry.
4266 Globally remove a property, from all entries in the current file.
4268 Compute the property at point, using the operator and scope from the
4269 nearest column format definition.
4272 @node Special properties, Property searches, Property syntax, Properties and Columns
4273 @section Special properties
4274 @cindex properties, special
4276 Special properties provide an alternative access method to Org mode
4277 features, like the TODO state or the priority of an entry, discussed in the
4278 previous chapters. This interface exists so that you can include
4279 these states in a column view (@pxref{Column view}), or to use them in
4280 queries. The following property names are special and should not be
4281 used as keys in the properties drawer:
4283 @cindex property, special, TODO
4284 @cindex property, special, TAGS
4285 @cindex property, special, ALLTAGS
4286 @cindex property, special, CATEGORY
4287 @cindex property, special, PRIORITY
4288 @cindex property, special, DEADLINE
4289 @cindex property, special, SCHEDULED
4290 @cindex property, special, CLOSED
4291 @cindex property, special, TIMESTAMP
4292 @cindex property, special, TIMESTAMP_IA
4293 @cindex property, special, CLOCKSUM
4294 @c guessing that ITEM is needed in this area; also, should this list be sorted?
4295 @cindex property, special, ITEM
4297 TODO @r{The TODO keyword of the entry.}
4298 TAGS @r{The tags defined directly in the headline.}
4299 ALLTAGS @r{All tags, including inherited ones.}
4300 CATEGORY @r{The category of an entry.}
4301 PRIORITY @r{The priority of the entry, a string with a single letter.}
4302 DEADLINE @r{The deadline time string, without the angular brackets.}
4303 SCHEDULED @r{The scheduling timestamp, without the angular brackets.}
4304 CLOSED @r{When was this entry closed?}
4305 TIMESTAMP @r{The first keyword-less timestamp in the entry.}
4306 TIMESTAMP_IA @r{The first inactive timestamp in the entry.}
4307 CLOCKSUM @r{The sum of CLOCK intervals in the subtree. @code{org-clock-sum}}
4308 @r{must be run first to compute the values.}
4309 ITEM @r{The content of the entry.}
4312 @node Property searches, Property inheritance, Special properties, Properties and Columns
4313 @section Property searches
4314 @cindex properties, searching
4315 @cindex searching, of properties
4317 To create sparse trees and special lists with selection based on properties,
4318 the same commands are used as for tag searches (@pxref{Tag searches}).
4324 Create a sparse tree with all matching entries. With a
4325 @kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
4328 Create a global list of tag/property matches from all agenda files.
4329 @xref{Matching tags and properties}.
4332 @vindex org-tags-match-list-sublevels
4333 Create a global list of tag matches from all agenda files, but check
4334 only TODO items and force checking of subitems (see variable
4335 @code{org-tags-match-list-sublevels}).
4338 The syntax for the search string is described in @ref{Matching tags and
4341 There is also a special command for creating sparse trees based on a
4347 Create a sparse tree based on the value of a property. This first
4348 prompts for the name of a property, and then for a value. A sparse tree
4349 is created with all entries that define this property with the given
4350 value. If you enclose the value into curly braces, it is interpreted as
4351 a regular expression and matched against the property values.
4354 @node Property inheritance, Column view, Property searches, Properties and Columns
4355 @section Property Inheritance
4356 @cindex properties, inheritance
4357 @cindex inheritance, of properties
4359 @vindex org-use-property-inheritance
4360 The outline structure of Org-mode documents lends itself for an
4361 inheritance model of properties: if the parent in a tree has a certain
4362 property, the children can inherit this property. Org mode does not
4363 turn this on by default, because it can slow down property searches
4364 significantly and is often not needed. However, if you find inheritance
4365 useful, you can turn it on by setting the variable
4366 @code{org-use-property-inheritance}. It may be set to @code{t} to make
4367 all properties inherited from the parent, to a list of properties
4368 that should be inherited, or to a regular expression that matches
4369 inherited properties.
4371 Org mode has a few properties for which inheritance is hard-coded, at
4372 least for the special applications for which they are used:
4374 @cindex property, COLUMNS
4377 The @code{:COLUMNS:} property defines the format of column view
4378 (@pxref{Column view}). It is inherited in the sense that the level
4379 where a @code{:COLUMNS:} property is defined is used as the starting
4380 point for a column view table, independently of the location in the
4381 subtree from where columns view is turned on.
4383 @cindex property, CATEGORY
4384 For agenda view, a category set through a @code{:CATEGORY:} property
4385 applies to the entire subtree.
4387 @cindex property, ARCHIVE
4388 For archiving, the @code{:ARCHIVE:} property may define the archive
4389 location for the entire subtree (@pxref{Moving subtrees}).
4391 @cindex property, LOGGING
4392 The LOGGING property may define logging settings for an entry or a
4393 subtree (@pxref{Tracking TODO state changes}).
4396 @node Column view, Property API, Property inheritance, Properties and Columns
4397 @section Column view
4399 A great way to view and edit properties in an outline tree is
4400 @emph{column view}. In column view, each outline node is turned into a
4401 table row. Columns in this table provide access to properties of the
4402 entries. Org mode implements columns by overlaying a tabular structure
4403 over the headline of each item. While the headlines have been turned
4404 into a table row, you can still change the visibility of the outline
4405 tree. For example, you get a compact table by switching to CONTENTS
4406 view (@kbd{S-@key{TAB} S-@key{TAB}}, or simply @kbd{c} while column view
4407 is active), but you can still open, read, and edit the entry below each
4408 headline. Or, you can switch to column view after executing a sparse
4409 tree command and in this way get a table only for the selected items.
4410 Column view also works in agenda buffers (@pxref{Agenda Views}) where
4411 queries have collected selected items, possibly from a number of files.
4414 * Defining columns:: The COLUMNS format property
4415 * Using column view:: How to create and use column view
4416 * Capturing column view:: A dynamic block for column view
4419 @node Defining columns, Using column view, Column view, Column view
4420 @subsection Defining columns
4421 @cindex column view, for properties
4422 @cindex properties, column view
4424 Setting up a column view first requires defining the columns. This is
4425 done by defining a column format line.
4428 * Scope of column definitions:: Where defined, where valid?
4429 * Column attributes:: Appearance and content of a column
4432 @node Scope of column definitions, Column attributes, Defining columns, Defining columns
4433 @subsubsection Scope of column definitions
4435 To define a column format for an entire file, use a line like
4439 #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
4442 To specify a format that only applies to a specific tree, add a
4443 @code{:COLUMNS:} property to the top node of that tree, for example:
4446 ** Top node for columns view
4448 :COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
4452 If a @code{:COLUMNS:} property is present in an entry, it defines columns
4453 for the entry itself, and for the entire subtree below it. Since the
4454 column definition is part of the hierarchical structure of the document,
4455 you can define columns on level 1 that are general enough for all
4456 sublevels, and more specific columns further down, when you edit a
4457 deeper part of the tree.
4459 @node Column attributes, , Scope of column definitions, Defining columns
4460 @subsubsection Column attributes
4461 A column definition sets the attributes of a column. The general
4462 definition looks like this:
4465 %[@var{width}]@var{property}[(@var{title})][@{@var{summary-type}@}]
4469 Except for the percent sign and the property name, all items are
4470 optional. The individual parts have the following meaning:
4473 @var{width} @r{An integer specifying the width of the column in characters.}
4474 @r{If omitted, the width will be determined automatically.}
4475 @var{property} @r{The property that should be edited in this column.}
4476 (title) @r{The header text for the column. If omitted, the}
4477 @r{property name is used.}
4478 @{@var{summary-type}@} @r{The summary type. If specified, the column values for}
4479 @r{parent nodes are computed from the children.}
4480 @r{Supported summary types are:}
4481 @{+@} @r{Sum numbers in this column.}
4482 @{+;%.1f@} @r{Like @samp{+}, but format result with @samp{%.1f}.}
4483 @{$@} @r{Currency, short for @samp{+;%.2f}.}
4484 @{:@} @r{Sum times, HH:MM:SS, plain numbers are hours.}
4485 @{X@} @r{Checkbox status, @samp{[X]} if all children are @samp{[X]}.}
4486 @{X/@} @r{Checkbox status, @samp{[n/m]}.}
4487 @{X%@} @r{Checkbox status, @samp{[n%]}.}
4488 @{min@} @r{Smallest number in column.}
4489 @{max@} @r{Largest number.}
4490 @{mean@} @r{Arithmetic mean of numbers.}
4491 @{:min@} @r{Smallest time value in column.}
4492 @{:max@} @r{Largest time value.}
4493 @{:mean@} @r{Arithmetic mean of time values.}
4497 Here is an example for a complete columns definition, along with allowed
4501 :COLUMNS: %25ITEM %9Approved(Approved?)@{X@} %Owner %11Status \@footnote{Please note that the COLUMNS definition must be on a single line---it is wrapped here only because of formatting constraints.}
4502 %10Time_Estimate@{:@} %CLOCKSUM
4503 :Owner_ALL: Tammy Mark Karl Lisa Don
4504 :Status_ALL: "In progress" "Not started yet" "Finished" ""
4505 :Approved_ALL: "[ ]" "[X]"
4509 The first column, @samp{%25ITEM}, means the first 25 characters of the
4510 item itself, i.e. of the headline. You probably always should start the
4511 column definition with the @samp{ITEM} specifier. The other specifiers
4512 create columns @samp{Owner} with a list of names as allowed values, for
4513 @samp{Status} with four different possible values, and for a checkbox
4514 field @samp{Approved}. When no width is given after the @samp{%}
4515 character, the column will be exactly as wide as it needs to be in order
4516 to fully display all values. The @samp{Approved} column does have a
4517 modified title (@samp{Approved?}, with a question mark). Summaries will
4518 be created for the @samp{Time_Estimate} column by adding time duration
4519 expressions like HH:MM, and for the @samp{Approved} column, by providing
4520 an @samp{[X]} status if all children have been checked. The
4521 @samp{CLOCKSUM} column is special, it lists the sum of CLOCK intervals
4524 @node Using column view, Capturing column view, Defining columns, Column view
4525 @subsection Using column view
4528 @tsubheading{Turning column view on and off}
4531 @vindex org-columns-default-format
4532 Turn on column view. If the cursor is before the first headline in the file,
4533 column view is turned on for the entire file, using the @code{#+COLUMNS}
4534 definition. If the cusor is somewhere inside the outline, this command
4535 searches the hierarchy, up from point, for a @code{:COLUMNS:} property that
4536 defines a format. When one is found, the column view table is established
4537 for the tree starting at the entry that contains the @code{:COLUMNS:}
4538 property. If no such property is found, the format is taken from the
4539 @code{#+COLUMNS} line or from the variable @code{org-columns-default-format},
4540 and column view is established for the current entry and its subtree.
4543 Recreate the column view, to include recent changes made in the buffer.
4550 @tsubheading{Editing values}
4551 @item @key{left} @key{right} @key{up} @key{down}
4552 Move through the column view from field to field.
4553 @kindex S-@key{left}
4554 @kindex S-@key{right}
4555 @item S-@key{left}/@key{right}
4556 Switch to the next/previous allowed value of the field. For this, you
4557 have to have specified allowed values for a property.
4559 Directly select the nth allowed value, @kbd{0} selects the 10th value.
4563 Same as @kbd{S-@key{left}/@key{right}}
4566 Edit the property at point. For the special properties, this will
4567 invoke the same interface that you normally use to change that
4568 property. For example, when editing a TAGS property, the tag completion
4569 or fast selection interface will pop up.
4572 When there is a checkbox at point, toggle it.
4575 View the full value of this property. This is useful if the width of
4576 the column is smaller than that of the value.
4579 Edit the list of allowed values for this property. If the list is found
4580 in the hierarchy, the modified values is stored there. If no list is
4581 found, the new value is stored in the first entry that is part of the
4582 current column view.
4583 @tsubheading{Modifying the table structure}
4587 Make the column narrower/wider by one character.
4588 @kindex S-M-@key{right}
4589 @item S-M-@key{right}
4590 Insert a new column, to the left of the current column.
4591 @kindex S-M-@key{left}
4592 @item S-M-@key{left}
4593 Delete the current column.
4596 @node Capturing column view, , Using column view, Column view
4597 @subsection Capturing column view
4599 Since column view is just an overlay over a buffer, it cannot be
4600 exported or printed directly. If you want to capture a column view, use
4601 a @code{columnview} dynamic block (@pxref{Dynamic blocks}). The frame
4602 of this block looks like this:
4604 @cindex #+BEGIN, columnview
4607 #+BEGIN: columnview :hlines 1 :id "label"
4612 @noindent This dynamic block has the following parameters:
4616 This is the most important parameter. Column view is a feature that is
4617 often localized to a certain (sub)tree, and the capture block might be
4618 at a different location in the file. To identify the tree whose view to
4619 capture, you can use 4 values:
4620 @cindex property, ID
4622 local @r{use the tree in which the capture block is located}
4623 global @r{make a global view, including all headings in the file}
4624 "file:@var{path-to-file}"
4625 @r{run column view at the top of this file}
4626 "@var{ID}" @r{call column view in the tree that has an @code{:ID:}}
4627 @r{property with the value @i{label}. You can use}
4628 @r{@kbd{M-x org-id-copy} to create a globally unique ID for}
4629 @r{the current entry and copy it to the kill-ring.}
4632 When @code{t}, insert an hline after every line. When a number @var{N}, insert
4633 an hline before each headline with level @code{<= @var{N}}.
4635 When set to @code{t}, force column groups to get vertical lines.
4637 When set to a number, don't capture entries below this level.
4638 @item :skip-empty-rows
4639 When set to @code{t}, skip rows where the only non-empty specifier of the
4640 column view is @code{ITEM}.
4645 The following commands insert or update the dynamic block:
4650 Insert a dynamic block capturing a column view. You will be prompted
4651 for the scope or ID of the view.
4656 Update dynamic block at point. The cursor needs to be in the
4657 @code{#+BEGIN} line of the dynamic block.
4658 @kindex C-u C-c C-x C-u
4659 @item C-u C-c C-x C-u
4660 Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
4661 you have several clock table blocks in a buffer.
4664 You can add formulas to the column view table and you may add plotting
4665 instructions in front of the table---these will survive an update of the
4666 block. If there is a @code{#+TBLFM:} after the table, the table will
4667 actually be recalculated automatically after an update.
4669 An alternative way to capture and process property values into a table is
4670 provided by Eric Schulte's @file{org-collector.el} which is a contributed
4671 package@footnote{Contributed packages are not part of Emacs, but are
4672 distributed with the main distribution of Org (visit
4673 @uref{http://orgmode.org}).}. It provides a general API to collect
4674 properties from entries in a certain scope, and arbitrary Lisp expressions to
4675 process these values before inserting them into a table or a dynamic block.
4677 @node Property API, , Column view, Properties and Columns
4678 @section The Property API
4679 @cindex properties, API
4680 @cindex API, for properties
4682 There is a full API for accessing and changing properties. This API can
4683 be used by Emacs Lisp programs to work with properties and to implement
4684 features based on them. For more information see @ref{Using the
4687 @node Dates and Times, Capture - Refile - Archive, Properties and Columns, Top
4688 @chapter Dates and Times
4694 To assist project planning, TODO items can be labeled with a date and/or
4695 a time. The specially formatted string carrying the date and time
4696 information is called a @emph{timestamp} in Org mode. This may be a
4697 little confusing because timestamp is often used as indicating when
4698 something was created or last changed. However, in Org mode this term
4699 is used in a much wider sense.
4702 * Timestamps:: Assigning a time to a tree entry
4703 * Creating timestamps:: Commands which insert timestamps
4704 * Deadlines and scheduling:: Planning your work
4705 * Clocking work time:: Tracking how long you spend on a task
4706 * Effort estimates:: Planning work effort in advance
4707 * Relative timer:: Notes with a running timer
4711 @node Timestamps, Creating timestamps, Dates and Times, Dates and Times
4712 @section Timestamps, deadlines, and scheduling
4714 @cindex ranges, time
4719 A timestamp is a specification of a date (possibly with a time or a range of
4720 times) in a special format, either @samp{<2003-09-16 Tue>} or
4721 @samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16 Tue
4722 12:00-12:30>}@footnote{This is inspired by the standard ISO 6801 date/time
4723 format. To use an alternative format, see @ref{Custom time format}.}. A
4724 timestamp can appear anywhere in the headline or body of an Org tree entry.
4725 Its presence causes entries to be shown on specific dates in the agenda
4726 (@pxref{Weekly/daily agenda}). We distinguish:
4729 @item Plain timestamp; Event; Appointment
4731 A simple timestamp just assigns a date/time to an item. This is just
4732 like writing down an appointment or event in a paper agenda. In the
4733 timeline and agenda displays, the headline of an entry associated with a
4734 plain timestamp will be shown exactly on that date.
4737 * Meet Peter at the movies <2006-11-01 Wed 19:15>
4738 * Discussion on climate change <2006-11-02 Thu 20:00-22:00>
4741 @item Timestamp with repeater interval
4742 @cindex timestamp, with repeater interval
4743 A timestamp may contain a @emph{repeater interval}, indicating that it
4744 applies not only on the given date, but again and again after a certain
4745 interval of N days (d), weeks (w), months (m), or years (y). The
4746 following will show up in the agenda every Wednesday:
4749 * Pick up Sam at school <2007-05-16 Wed 12:30 +1w>
4752 @item Diary-style sexp entries
4753 For more complex date specifications, Org mode supports using the
4754 special sexp diary entries implemented in the Emacs calendar/diary
4755 package. For example
4758 * The nerd meeting on every 2nd Thursday of the month
4759 <%%(diary-float t 4 2)>
4762 @item Time/Date range
4765 Two timestamps connected by @samp{--} denote a range. The headline
4766 will be shown on the first and last day of the range, and on any dates
4767 that are displayed and fall in the range. Here is an example:
4770 ** Meeting in Amsterdam
4771 <2004-08-23 Mon>--<2004-08-26 Thu>
4774 @item Inactive timestamp
4775 @cindex timestamp, inactive
4776 @cindex inactive timestamp
4777 Just like a plain timestamp, but with square brackets instead of
4778 angular ones. These timestamps are inactive in the sense that they do
4779 @emph{not} trigger an entry to show up in the agenda.
4782 * Gillian comes late for the fifth time [2006-11-01 Wed]
4787 @node Creating timestamps, Deadlines and scheduling, Timestamps, Dates and Times
4788 @section Creating timestamps
4789 @cindex creating timestamps
4790 @cindex timestamps, creating
4792 For Org mode to recognize timestamps, they need to be in the specific
4793 format. All commands listed below produce timestamps in the correct
4799 Prompt for a date and insert a corresponding timestamp. When the cursor is
4800 at an existing timestamp in the buffer, the command is used to modify this
4801 timestamp instead of inserting a new one. When this command is used twice in
4802 succession, a time range is inserted.
4806 Like @kbd{C-c .}, but insert an inactive timestamp that will not cause
4813 @vindex org-time-stamp-rounding-minutes
4814 Like @kbd{C-c .} and @kbd{C-c !}, but use the alternative format which
4815 contains date and time. The default time can be rounded to multiples of 5
4816 minutes, see the option @code{org-time-stamp-rounding-minutes}.
4820 Insert a timestamp corresponding to the cursor date in the Calendar.
4824 Access the Emacs calendar for the current date. If there is a
4825 timestamp in the current line, go to the corresponding date
4830 Access the agenda for the date given by the timestamp or -range at
4831 point (@pxref{Weekly/daily agenda}).
4833 @kindex S-@key{left}
4834 @kindex S-@key{right}
4836 @itemx S-@key{right}
4837 Change date at cursor by one day. These key bindings conflict with
4838 shift-selection and related modes (@pxref{Conflicts}).
4841 @kindex S-@key{down}
4844 Change the item under the cursor in a timestamp. The cursor can be on a
4845 year, month, day, hour or minute. When the timestamp contains a time range
4846 like @samp{15:30-16:30}, modifying the first time will also shift the second,
4847 shifting the time block with constant length. To change the length, modify
4848 the second time. Note that if the cursor is in a headline and not at a
4849 timestamp, these same keys modify the priority of an item.
4850 (@pxref{Priorities}). The key bindings also conflict with shift-selection and
4851 related modes (@pxref{Conflicts}).
4854 @cindex evaluate time range
4856 Evaluate a time range by computing the difference between start and end.
4857 With a prefix argument, insert result after the time range (in a table: into
4858 the following column).
4863 * The date/time prompt:: How Org mode helps you entering date and time
4864 * Custom time format:: Making dates look different
4867 @node The date/time prompt, Custom time format, Creating timestamps, Creating timestamps
4868 @subsection The date/time prompt
4869 @cindex date, reading in minibuffer
4870 @cindex time, reading in minibuffer
4872 @vindex org-read-date-prefer-future
4873 When Org mode prompts for a date/time, the default is shown in default
4874 date/time format, and the prompt therefore seems to ask for a specific
4875 format. But it will in fact accept any string containing some date and/or
4876 time information, and it is really smart about interpreting your input. You
4877 can, for example, use @kbd{C-y} to paste a (possibly multi-line) string
4878 copied from an email message. Org mode will find whatever information is in
4879 there and derive anything you have not specified from the @emph{default date
4880 and time}. The default is usually the current date and time, but when
4881 modifying an existing timestamp, or when entering the second stamp of a
4882 range, it is taken from the stamp in the buffer. When filling in
4883 information, Org mode assumes that most of the time you will want to enter a
4884 date in the future: if you omit the month/year and the given day/month is
4885 @i{before} today, it will assume that you mean a future date@footnote{See the
4886 variable @code{org-read-date-prefer-future}. You may set that variable to
4887 the symbol @code{time} to even make a time before now shift the date to
4888 tomorrow.}. If the date has been automatically shifted into the future, the
4889 time prompt will show this with @samp{(=>F).}
4891 For example, let's assume that today is @b{June 13, 2006}. Here is how
4892 various inputs will be interpreted, the items filled in by Org mode are
4896 3-2-5 --> 2003-02-05
4897 14 --> @b{2006}-@b{06}-14
4898 12 --> @b{2006}-@b{07}-12
4899 Fri --> nearest Friday (defaultdate or later)
4900 sep 15 --> @b{2006}-09-15
4901 feb 15 --> @b{2007}-02-15
4902 sep 12 9 --> 2009-09-12
4903 12:45 --> @b{2006}-@b{06}-@b{13} 12:45
4904 22 sept 0:34 --> @b{2006}-09-22 0:34
4905 w4 --> ISO week for of the current year @b{2006}
4906 2012 w4 fri --> Friday of ISO week 4 in 2012
4907 2012-w04-5 --> Same as above
4910 Furthermore you can specify a relative date by giving, as the
4911 @emph{first} thing in the input: a plus/minus sign, a number and a
4912 letter ([dwmy]) to indicate change in days, weeks, months, or years. With a
4913 single plus or minus, the date is always relative to today. With a
4914 double plus or minus, it is relative to the default date. If instead of
4915 a single letter, you use the abbreviation of day name, the date will be
4916 the nth such day. E.g.
4921 +4d --> four days from today
4922 +4 --> same as above
4923 +2w --> two weeks from today
4924 ++5 --> five days from default date
4925 +2tue --> second Tuesday from now.
4928 @vindex parse-time-months
4929 @vindex parse-time-weekdays
4930 The function understands English month and weekday abbreviations. If
4931 you want to use unabbreviated names and/or other languages, configure
4932 the variables @code{parse-time-months} and @code{parse-time-weekdays}.
4934 @cindex calendar, for selecting date
4935 @vindex org-popup-calendar-for-date-prompt
4936 Parallel to the minibuffer prompt, a calendar is popped up@footnote{If
4937 you don't need/want the calendar, configure the variable
4938 @code{org-popup-calendar-for-date-prompt}.}. When you exit the date
4939 prompt, either by clicking on a date in the calendar, or by pressing
4940 @key{RET}, the date selected in the calendar will be combined with the
4941 information entered at the prompt. You can control the calendar fully
4942 from the minibuffer:
4947 @kindex S-@key{right}
4948 @kindex S-@key{left}
4949 @kindex S-@key{down}
4951 @kindex M-S-@key{right}
4952 @kindex M-S-@key{left}
4955 > / < @r{Scroll calendar forward/backward by one month.}
4956 mouse-1 @r{Select date by clicking on it.}
4957 S-@key{right}/@key{left} @r{One day forward/backward.}
4958 S-@key{down}/@key{up} @r{One week forward/backward.}
4959 M-S-@key{right}/@key{left} @r{One month forward/backward.}
4960 @key{RET} @r{Choose date in calendar.}
4963 @vindex org-read-date-display-live
4964 The actions of the date/time prompt may seem complex, but I assure you they
4965 will grow on you, and you will start getting annoyed by pretty much any other
4966 way of entering a date/time out there. To help you understand what is going
4967 on, the current interpretation of your input will be displayed live in the
4968 minibuffer@footnote{If you find this distracting, turn the display of with
4969 @code{org-read-date-display-live}.}.
4971 @node Custom time format, , The date/time prompt, Creating timestamps
4972 @subsection Custom time format
4973 @cindex custom date/time format
4974 @cindex time format, custom
4975 @cindex date format, custom
4977 @vindex org-display-custom-times
4978 @vindex org-time-stamp-custom-formats
4979 Org mode uses the standard ISO notation for dates and times as it is
4980 defined in ISO 8601. If you cannot get used to this and require another
4981 representation of date and time to keep you happy, you can get it by
4982 customizing the variables @code{org-display-custom-times} and
4983 @code{org-time-stamp-custom-formats}.
4988 Toggle the display of custom formats for dates and times.
4992 Org mode needs the default format for scanning, so the custom date/time
4993 format does not @emph{replace} the default format---instead it is put
4994 @emph{over} the default format using text properties. This has the
4995 following consequences:
4998 You cannot place the cursor onto a timestamp anymore, only before or
5001 The @kbd{S-@key{up}/@key{down}} keys can no longer be used to adjust
5002 each component of a timestamp. If the cursor is at the beginning of
5003 the stamp, @kbd{S-@key{up}/@key{down}} will change the stamp by one day,
5004 just like @kbd{S-@key{left}/@key{right}}. At the end of the stamp, the
5005 time will be changed by one minute.
5007 If the timestamp contains a range of clock times or a repeater, these
5008 will not be overlayed, but remain in the buffer as they were.
5010 When you delete a timestamp character-by-character, it will only
5011 disappear from the buffer after @emph{all} (invisible) characters
5012 belonging to the ISO timestamp have been removed.
5014 If the custom timestamp format is longer than the default and you are
5015 using dates in tables, table alignment will be messed up. If the custom
5016 format is shorter, things do work as expected.
5020 @node Deadlines and scheduling, Clocking work time, Creating timestamps, Dates and Times
5021 @section Deadlines and scheduling
5023 A timestamp may be preceded by special keywords to facilitate planning:
5027 @cindex DEADLINE keyword
5029 Meaning: the task (most likely a TODO item, though not necessarily) is supposed
5030 to be finished on that date.
5032 @vindex org-deadline-warning-days
5033 On the deadline date, the task will be listed in the agenda. In
5034 addition, the agenda for @emph{today} will carry a warning about the
5035 approaching or missed deadline, starting
5036 @code{org-deadline-warning-days} before the due date, and continuing
5037 until the entry is marked DONE. An example:
5040 *** TODO write article about the Earth for the Guide
5041 The editor in charge is [[bbdb:Ford Prefect]]
5042 DEADLINE: <2004-02-29 Sun>
5045 You can specify a different lead time for warnings for a specific
5046 deadlines using the following syntax. Here is an example with a warning
5047 period of 5 days @code{DEADLINE: <2004-02-29 Sun -5d>}.
5050 @cindex SCHEDULED keyword
5052 Meaning: you are planning to start working on that task on the given
5055 @vindex org-agenda-skip-scheduled-if-done
5056 The headline will be listed under the given date@footnote{It will still
5057 be listed on that date after it has been marked DONE. If you don't like
5058 this, set the variable @code{org-agenda-skip-scheduled-if-done}.}. In
5059 addition, a reminder that the scheduled date has passed will be present
5060 in the compilation for @emph{today}, until the entry is marked DONE.
5061 I.e. the task will automatically be forwarded until completed.
5064 *** TODO Call Trillian for a date on New Years Eve.
5065 SCHEDULED: <2004-12-25 Sat>
5069 @b{Important:} Scheduling an item in Org mode should @i{not} be
5070 understood in the same way that we understand @i{scheduling a meeting}.
5071 Setting a date for a meeting is just a simple appointment, you should
5072 mark this entry with a simple plain timestamp, to get this item shown
5073 on the date where it applies. This is a frequent misunderstanding by
5074 Org users. In Org mode, @i{scheduling} means setting a date when you
5075 want to start working on an action item.
5078 You may use timestamps with repeaters in scheduling and deadline
5079 entries. Org mode will issue early and late warnings based on the
5080 assumption that the timestamp represents the @i{nearest instance} of
5081 the repeater. However, the use of diary sexp entries like
5083 @code{<%%(diary-float t 42)>}
5085 in scheduling and deadline timestamps is limited. Org mode does not
5086 know enough about the internals of each sexp function to issue early and
5087 late warnings. However, it will show the item on each day where the
5091 * Inserting deadline/schedule:: Planning items
5092 * Repeated tasks:: Items that show up again and again
5095 @node Inserting deadline/schedule, Repeated tasks, Deadlines and scheduling, Deadlines and scheduling
5096 @subsection Inserting deadlines or schedules
5098 The following commands allow you to quickly insert a deadline or to schedule
5105 Insert @samp{DEADLINE} keyword along with a stamp. The insertion will
5106 happen in the line directly following the headline. When called with a
5107 prefix arg, an existing deadline will be removed from the entry.
5108 @c FIXME Any CLOSED timestamp will be removed.????????
5112 Insert @samp{SCHEDULED} keyword along with a stamp. The insertion will
5113 happen in the line directly following the headline. Any CLOSED
5114 timestamp will be removed. When called with a prefix argument, remove
5115 the scheduling date from the entry.
5121 Mark the current entry for agenda action. After you have marked the entry
5122 like this, you can open the agenda or the calendar to find an appropriate
5123 date. With the cursor on the selected date, press @kbd{k s} or @kbd{k d} to
5124 schedule the marked item.
5127 @cindex sparse tree, for deadlines
5129 @vindex org-deadline-warning-days
5130 Create a sparse tree with all deadlines that are either past-due, or
5131 which will become due within @code{org-deadline-warning-days}.
5132 With @kbd{C-u} prefix, show all deadlines in the file. With a numeric
5133 prefix, check that many days. For example, @kbd{C-1 C-c / d} shows
5134 all deadlines due tomorrow.
5138 Sparse tree for deadlines and scheduled items before a given date.
5142 Sparse tree for deadlines and scheduled items after a given date.
5145 @node Repeated tasks, , Inserting deadline/schedule, Deadlines and scheduling
5146 @subsection Repeated tasks
5147 @cindex tasks, repeated
5148 @cindex repeated tasks
5150 Some tasks need to be repeated again and again. Org mode helps to
5151 organize such tasks using a so-called repeater in a DEADLINE, SCHEDULED,
5152 or plain timestamp. In the following example
5154 ** TODO Pay the rent
5155 DEADLINE: <2005-10-01 Sat +1m>
5158 the @code{+1m} is a repeater; the intended interpretation is that the task
5159 has a deadline on <2005-10-01> and repeats itself every (one) month starting
5160 from that time. If you need both a repeater and a special warning period in
5161 a deadline entry, the repeater should come first and the warning period last:
5162 @code{DEADLINE: <2005-10-01 Sat +1m -3d>}.
5164 Deadlines and scheduled items produce entries in the agenda when they
5165 are over-due, so it is important to be able to mark such an entry as
5166 completed once you have done so. When you mark a DEADLINE or a SCHEDULE
5167 with the TODO keyword DONE, it will no longer produce entries in the
5168 agenda. The problem with this is, however, that then also the
5169 @emph{next} instance of the repeated entry will not be active. Org mode
5170 deals with this in the following way: When you try to mark such an entry
5171 DONE (using @kbd{C-c C-t}), it will shift the base date of the repeating
5172 timestamp by the repeater interval, and immediately set the entry state
5173 back to TODO. In the example above, setting the state to DONE would
5174 actually switch the date like this:
5177 ** TODO Pay the rent
5178 DEADLINE: <2005-11-01 Tue +1m>
5181 @vindex org-log-repeat
5182 A timestamp@footnote{You can change this using the option
5183 @code{org-log-repeat}, or the @code{#+STARTUP} options @code{logrepeat},
5184 @code{lognoterepeat}, and @code{nologrepeat}. With @code{lognoterepeat}, you
5185 will also be prompted for a note.} will be added under the deadline, to keep
5186 a record that you actually acted on the previous instance of this deadline.
5188 As a consequence of shifting the base date, this entry will no longer be
5189 visible in the agenda when checking past dates, but all future instances
5192 With the @samp{+1m} cookie, the date shift will always be exactly one
5193 month. So if you have not paid the rent for three months, marking this
5194 entry DONE will still keep it as an overdue deadline. Depending on the
5195 task, this may not be the best way to handle it. For example, if you
5196 forgot to call you father for 3 weeks, it does not make sense to call
5197 him 3 times in a single day to make up for it. Finally, there are tasks
5198 like changing batteries which should always repeat a certain time
5199 @i{after} the last time you did it. For these tasks, Org mode has
5200 special repeaters markers with @samp{++} and @samp{.+}. For example:
5204 DEADLINE: <2008-02-10 Sun ++1w>
5205 Marking this DONE will shift the date by at least one week,
5206 but also by as many weeks as it takes to get this date into
5207 the future. However, it stays on a Sunday, even if you called
5208 and marked it done on Saturday.
5209 ** TODO Check the batteries in the smoke detectors
5210 DEADLINE: <2005-11-01 Tue .+1m>
5211 Marking this DONE will shift the date to one month after
5215 You may have both scheduling and deadline information for a specific
5216 task---just make sure that the repeater intervals on both are the same.
5218 An alternative to using a repeater is to create a number of copies of a task
5219 subtree, with dates shifted in each copy. The command @kbd{C-c C-x c} was
5220 created for this purpose, it is described in @ref{Structure editing}.
5223 @node Clocking work time, Effort estimates, Deadlines and scheduling, Dates and Times
5224 @section Clocking work time
5226 Org mode allows you to clock the time you spend on specific tasks in a
5227 project. When you start working on an item, you can start the clock.
5228 When you stop working on that task, or when you mark the task done, the
5229 clock is stopped and the corresponding time interval is recorded. It
5230 also computes the total time spent on each subtree of a project.
5232 Normally, the clock does not survive exiting and re-entering Emacs, but you
5233 can arrange for the clock information to persist across Emacs sessions with
5236 (setq org-clock-persist t)
5237 (org-clock-persistence-insinuate)
5243 @vindex org-clock-into-drawer
5244 Start the clock on the current item (clock-in). This inserts the CLOCK
5245 keyword together with a timestamp. If this is not the first clocking of
5246 this item, the multiple CLOCK lines will be wrapped into a
5247 @code{:LOGBOOK:} drawer (see also the variable
5248 @code{org-clock-into-drawer}). When called with a @kbd{C-u} prefix argument,
5249 select the task from a list of recently clocked tasks. With two @kbd{C-u
5250 C-u} prefixes, clock into the task at point and mark it as the default task.
5251 The default task will always be available when selecting a clocking task,
5252 with letter @kbd{d}.@*
5253 @cindex property: CLOCK_MODELINE_TOTAL
5254 @cindex property: LAST_REPEAT
5255 @vindex org-clock-modeline-total
5256 While the clock is running, the current clocking time is shown in the mode
5257 line, along with the title of the task. The clock time shown will be all
5258 time ever clocked for this task and its children. If the task has an effort
5259 estimate (@pxref{Effort estimates}), the mode line displays the current
5260 clocking time against it@footnote{To add an effort estimate ``on the fly'',
5261 hook a function doing this to @code{org-clock-in-prepare-hook}.} If the task
5262 is a repeating one (@pxref{Repeated tasks}), only the time since the last
5263 reset of the task @footnote{as recorded by the @code{LAST_REPEAT} property}
5264 will be shown. More control over what time is shown can be exercised with
5265 the @code{CLOCK_MODELINE_TOTAL} property. It may have the values
5266 @code{current} to show only the current clocking instance, @code{today} to
5267 show all time clocked on this tasks today (see also the variable
5268 @code{org-extend-today-until}), @code{all} to include all time, or
5269 @code{auto} which is the default@footnote{See also the variable
5270 @code{org-clock-modeline-total}.}.@* Clicking with @kbd{mouse-1} onto the
5271 mode line entry will pop up a menu with clocking options.
5274 @vindex org-log-note-clock-out
5275 Stop the clock (clock-out). This inserts another timestamp at the same
5276 location where the clock was last started. It also directly computes
5277 the resulting time in inserts it after the time range as @samp{=>
5278 HH:MM}. See the variable @code{org-log-note-clock-out} for the
5279 possibility to record an additional note together with the clock-out
5280 timestamp@footnote{The corresponding in-buffer setting is:
5281 @code{#+STARTUP: lognoteclock-out}}.
5284 Update the effort estimate for the current clock task.
5287 @item C-c C-y @ @ @r{or}@ @ C-c C-c
5288 Recompute the time interval after changing one of the timestamps. This
5289 is only necessary if you edit the timestamps directly. If you change
5290 them with @kbd{S-@key{cursor}} keys, the update is automatic.
5293 Changing the TODO state of an item to DONE automatically stops the clock
5294 if it is running in this same item.
5297 Cancel the current clock. This is useful if a clock was started by
5298 mistake, or if you ended up working on something else.
5301 Jump to the entry that contains the currently running clock. With a
5302 @kbd{C-u} prefix arg, select the target task from a list of recently clocked
5306 @vindex org-remove-highlights-with-change
5307 Display time summaries for each subtree in the current buffer. This
5308 puts overlays at the end of each headline, showing the total time
5309 recorded under that heading, including the time of any subheadings. You
5310 can use visibility cycling to study the tree, but the overlays disappear
5311 when you change the buffer (see variable
5312 @code{org-remove-highlights-with-change}) or press @kbd{C-c C-c}.
5315 Insert a dynamic block (@pxref{Dynamic blocks}) containing a clock
5316 report as an Org-mode table into the current file. When the cursor is
5317 at an existing clock table, just update it. When called with a prefix
5318 argument, jump to the first clock report in the current document and
5320 @cindex #+BEGIN, clocktable
5322 #+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file
5326 If such a block already exists at point, its content is replaced by the
5327 new table. The @samp{BEGIN} line can specify options:
5329 :maxlevel @r{Maximum level depth to which times are listed in the table.}
5330 :emphasize @r{When @code{t}, emphasize level one and level two items.}
5331 :scope @r{The scope to consider. This can be any of the following:}
5332 nil @r{the current buffer or narrowed region}
5333 file @r{the full current buffer}
5334 subtree @r{the subtree where the clocktable is located}
5335 tree@var{N} @r{the surrounding level @var{N} tree, for example @code{tree3}}
5336 tree @r{the surrounding level 1 tree}
5337 agenda @r{all agenda files}
5338 ("file"..) @r{scan these files}
5339 file-with-archives @r{current file and its archives}
5340 agenda-with-archives @r{all agenda files, including archives}
5341 :block @r{The time block to consider. This block is specified either}
5342 @r{absolute, or relative to the current time and may be any of}
5344 2007-12-31 @r{New year eve 2007}
5345 2007-12 @r{December 2007}
5346 2007-W50 @r{ISO-week 50 in 2007}
5347 2007 @r{the year 2007}
5348 today, yesterday, today-@var{N} @r{a relative day}
5349 thisweek, lastweek, thisweek-@var{N} @r{a relative week}
5350 thismonth, lastmonth, thismonth-@var{N} @r{a relative month}
5351 thisyear, lastyear, thisyear-@var{N} @r{a relative year}
5352 @r{Use @kbd{S-@key{left}/@key{right}} keys to shift the time interval.}
5353 :tstart @r{A time string specifying when to start considering times.}
5354 :tend @r{A time string specifying when to stop considering times.}
5355 :step @r{@code{week} or @code{day}, to split the table into chunks.}
5356 @r{To use this, @code{:block} or @code{:tstart}, @code{:tend} are needed.}
5357 :link @r{Link the item headlines in the table to their origins.}
5358 :formula @r{Content of a @code{#+TBLFM} line to be added and evaluated.}
5359 @r{As a special case, @samp{:formula %} adds a column with % time.}
5360 @r{If you do not specify a formula here, any existing formula.}
5361 @r{below the clock table will survive updates and be evaluated.}
5362 :timestamp @r{A timestamp for the entry, when available. Look for SCHEDULED,}
5363 @r{DEADLINE, TIMESTAMP and TIMESTAMP_IA, in this order.}
5365 To get a clock summary of the current level 1 tree, for the current
5366 day, you could write
5368 #+BEGIN: clocktable :maxlevel 2 :block today :scope tree1 :link t
5372 and to use a specific time range you could write@footnote{Note that all
5373 parameters must be specified in a single line---the line is broken here
5374 only to fit it into the manual.}
5376 #+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>"
5377 :tend "<2006-08-10 Thu 12:00>"
5380 A summary of the current subtree with % times would be
5382 #+BEGIN: clocktable :scope subtree :link t :formula %
5389 Update dynamic block at point. The cursor needs to be in the
5390 @code{#+BEGIN} line of the dynamic block.
5391 @kindex C-u C-c C-x C-u
5392 @item C-u C-c C-x C-u
5393 Update all dynamic blocks (@pxref{Dynamic blocks}). This is useful if
5394 you have several clock table blocks in a buffer.
5395 @kindex S-@key{left}
5396 @kindex S-@key{right}
5398 @itemx S-@key{right}
5399 Shift the current @code{:block} interval and update the table. The cursor
5400 needs to be in the @code{#+BEGIN: clocktable} line for this command. If
5401 @code{:block} is @code{today}, it will be shifted to @code{today-1} etc.
5404 The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
5405 the agenda (@pxref{Weekly/daily agenda}) to show which tasks have been
5406 worked on or closed during a day.
5408 @node Effort estimates, Relative timer, Clocking work time, Dates and Times
5409 @section Effort estimates
5410 @cindex effort estimates
5412 @cindex property, Effort
5413 @vindex org-effort-property
5414 If you want to plan your work in a very detailed way, or if you need to
5415 produce offers with quotations of the estimated work effort, you may want to
5416 assign effort estimates to entries. If you are also clocking your work, you
5417 may later want to compare the planned effort with the actual working time, a
5418 great way to improve planning estimates. Effort estimates are stored in a
5419 special property @samp{Effort}@footnote{You may change the property being
5420 used with the variable @code{org-effort-property}.}. You can set the effort
5421 for an entry with the following commands:
5426 Set the effort estimate for the current entry. With a numeric prefix
5427 argument, set it to the NTH allowed value (see below). This command is also
5428 accessible from the agenda with the @kbd{e} key.
5431 Modify the effort estimate of the item currently being clocked.
5434 Clearly the best way to work with effort estimates is through column view
5435 (@pxref{Column view}). You should start by setting up discrete values for
5436 effort estimates, and a @code{COLUMNS} format that displays these values
5437 together with clock sums (if you want to clock your time). For a specific
5441 #+PROPERTY: Effort_ALL 0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00 8:00
5442 #+COLUMNS: %40ITEM(Task) %17Effort(Estimated Effort)@{:@} %CLOCKSUM
5446 @vindex org-global-properties
5447 @vindex org-columns-default-format
5448 or, even better, you can set up these values globally by customizing the
5449 variables @code{org-global-properties} and @code{org-columns-default-format}.
5450 In particular if you want to use this setup also in the agenda, a global
5451 setup may be advised.
5453 The way to assign estimates to individual items is then to switch to column
5454 mode, and to use @kbd{S-@key{right}} and @kbd{S-@key{left}} to change the
5455 value. The values you enter will immediately be summed up in the hierarchy.
5456 In the column next to it, any clocked time will be displayed.
5458 @vindex org-agenda-columns-add-appointments-to-effort-sum
5459 If you switch to column view in the daily/weekly agenda, the effort column
5460 will summarize the estimated work effort for each day@footnote{Please note
5461 the pitfalls of summing hierarchical data in a flat list (@pxref{Agenda
5462 column view}).}, and you can use this to find space in your schedule. To get
5463 an overview of the entire part of the day that is committed, you can set the
5464 option @code{org-agenda-columns-add-appointments-to-effort-sum}. The
5465 appointments on a day that take place over a specified time interval will
5466 then also be added to the load estimate of the day.
5468 Effort estimates can be used in secondary agenda filtering that is triggered
5469 with the @kbd{/} key in the agenda (@pxref{Agenda commands}). If you have
5470 these estimates defined consistently, two or three key presses will narrow
5471 down the list to stuff that fits into an available time slot.
5473 @node Relative timer, , Effort estimates, Dates and Times
5474 @section Taking notes with a relative timer
5475 @cindex relative timer
5477 When taking notes during, for example, a meeting or a video viewing, it can
5478 be useful to have access to times relative to a starting time. Org provides
5479 such a relative timer and make it easy to create timed notes.
5484 Insert a relative time into the buffer. The first time you use this, the
5485 timer will be started. When called with a prefix argument, the timer is
5489 Insert a description list item with the current relative time. With a prefix
5490 argument, first reset the timer to 0.
5493 Once the timer list is started, you can also use @kbd{M-@key{RET}} to insert
5497 Pause the timer, or continue it if it is already paused.
5498 @c removed the sentence because it is redundant to the following item
5499 @kindex C-u C-c C-x ,
5501 Stop the timer. After this, you can only start a new timer, not continue the
5502 old one. This command also removes the timer from the mode line.
5505 Reset the timer without inserting anything into the buffer. By default, the
5506 timer is reset to 0. When called with a @kbd{C-u} prefix, reset the timer to
5507 specific starting offset. The user is prompted for the offset, with a
5508 default taken from a timer string at point, if any, So this can be used to
5509 restart taking notes after a break in the process. When called with a double
5510 prefix argument @kbd{C-c C-u}, change all timer strings in the active region
5511 by a certain amount. This can be used to fix timer strings if the timer was
5512 not started at exactly the right moment.
5515 @node Capture - Refile - Archive, Agenda Views, Dates and Times, Top
5516 @chapter Capture - Refile - Archive
5519 An important part of any organization system is the ability to quickly
5520 capture new ideas and tasks, and to associate reference material with them.
5521 Org uses the @file{remember.el} package to create tasks, and stores files
5522 related to a task (@i{attachments}) in a special directory. Once in the
5523 system, tasks and projects need to be moved around. Moving completed project
5524 trees to an archive file keeps the system compact and fast.
5527 * Remember:: Capture new tasks/ideas with little interruption
5528 * Attachments:: Add files to tasks.
5529 * RSS Feeds:: Getting input from RSS feeds
5530 * Protocols:: External (e.g. Browser) access to Emacs and Org
5531 * Refiling notes:: Moving a tree from one place to another
5532 * Archiving:: What to do with finished projects
5535 @node Remember, Attachments, Capture - Refile - Archive, Capture - Refile - Archive
5537 @cindex @file{remember.el}
5539 The Remember package by John Wiegley lets you store quick notes with little
5540 interruption of your work flow. It is an excellent way to add new notes and
5541 tasks to Org files. The @code{remember.el} package is part of Emacs 23, not
5542 Emacs 22. See @uref{http://www.emacswiki.org/cgi-bin/wiki/RememberMode} for
5545 Org significantly expands the possibilities of Remember: you may define
5546 templates for different note types, and associate target files and headlines
5547 with specific templates. It also allows you to select the location where a
5548 note should be stored interactively, on the fly.
5551 * Setting up Remember for Org:: Some code for .emacs to get things going
5552 * Remember templates:: Define the outline of different note types
5553 * Storing notes:: Directly get the note to where it belongs
5556 @node Setting up Remember for Org, Remember templates, Remember, Remember
5557 @subsection Setting up Remember for Org
5559 The following customization will tell Remember to use Org files as
5560 target, and to create annotations compatible with Org links.
5563 (org-remember-insinuate)
5564 (setq org-directory "~/path/to/my/orgfiles/")
5565 (setq org-default-notes-file (concat org-directory "/notes.org"))
5566 (define-key global-map "\C-cr" 'org-remember)
5570 The last line binds the command @code{org-remember} to a global
5571 key@footnote{Please select your own key, @kbd{C-c r} is only a
5572 suggestion.}. @code{org-remember} basically just calls Remember,
5573 but it makes a few things easier: if there is an active region, it will
5574 automatically copy the region into the Remember buffer. It also allows
5575 to jump to the buffer and location where Remember notes are being
5576 stored: just call @code{org-remember} with a prefix argument. If you
5577 use two prefix arguments, Org jumps to the location where the last
5578 remember note was stored.
5580 The Remember buffer will actually use @code{org-mode} as its major mode, so
5581 that all editing features of Org mode are available. In addition to this, a
5582 minor mode @code{org-remember-mode} is turned on, for the single purpose that
5583 you can use its keymap @code{org-remember-mode-map} to overwrite some of
5584 Org mode's key bindings.
5586 You can also call @code{org-remember} in a special way from the agenda,
5587 using the @kbd{k r} key combination. With this access, any timestamps
5588 inserted by the selected Remember template (see below) will default to
5589 the cursor date in the agenda, rather than to the current date.
5591 @node Remember templates, Storing notes, Setting up Remember for Org, Remember
5592 @subsection Remember templates
5593 @cindex templates, for Remember
5595 In combination with Org, you can use templates to generate
5596 different types of Remember notes. For example, if you would like
5597 to use one template to create general TODO entries, another one for
5598 journal entries, and a third one for collecting random ideas, you could
5602 (setq org-remember-templates
5603 '(("Todo" ?t "* TODO %?\n %i\n %a" "~/org/TODO.org" "Tasks")
5604 ("Journal" ?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org")
5605 ("Idea" ?i "* %^@{Title@}\n %i\n %a" "~/org/JOURNAL.org" "New Ideas")))
5608 @vindex org-remember-default-headline
5609 @vindex org-directory
5610 @noindent In these entries, the first string is just a name, and the
5611 character specifies how to select the template. It is useful if the
5612 character is also the first letter of the name. The next string specifies
5613 the template. Two more (optional) strings give the file in which, and the
5614 headline under which, the new note should be stored. The file (if not present
5615 or @code{nil}) defaults to @code{org-default-notes-file}, the heading to
5616 @code{org-remember-default-headline}. If the file name is not an absolute
5617 path, it will be interpreted relative to @code{org-directory}. The heading
5618 can also be the symbols @code{top} or @code{bottom} to send notes as level 1
5619 entries to the beginning or end of the file, respectively.
5621 An optional sixth element specifies the contexts in which the user can select
5622 the template. This element can be a list of major modes or a function.
5623 @code{org-remember} will first check whether the function returns @code{t} or
5624 if we are in any of the listed major modes, and exclude templates for which
5625 this condition is not fulfilled. Templates that do not specify this element
5626 at all, or that use @code{nil} or @code{t} as a value will always be
5632 (setq org-remember-templates
5633 '(("Bug" ?b "* BUG %?\n %i\n %a" "~/org/BUGS.org" "Bugs" (emacs-lisp-mode))
5634 ("Journal" ?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org" "X" my-check)
5635 ("Idea" ?i "* %^@{Title@}\n %i\n %a" "~/org/JOURNAL.org" "New Ideas")))
5639 The first template will only be available when invoking @code{org-remember}
5640 from an buffer in @code{emacs-lisp-mode}. The second template will only be
5641 available when the function @code{my-check} returns @code{t}. The third
5642 template will be proposed in any context.
5644 When you call @kbd{M-x org-remember} (or @kbd{M-x remember}) to remember
5645 something, Org will prompt for a key to select the template (if you have
5646 more than one template) and then prepare the buffer like
5649 [[file:@var{link to where you called remember}]]
5653 During expansion of the template, special @kbd{%}-escapes@footnote{If you
5654 need one of these sequences literally, escape the @kbd{%} with a backslash.}
5655 allow dynamic insertion of content:
5657 %^@{@var{prompt}@} @r{prompt the user for a string and replace this sequence with it.}
5658 @r{You may specify a default value and a completion table with}
5659 @r{%^@{prompt|default|completion2|completion3...@}}
5660 @r{The arrow keys access a prompt-specific history.}
5661 %a @r{annotation, normally the link created with @code{org-store-link}}
5662 %A @r{like @code{%a}, but prompt for the description part}
5663 %i @r{initial content, the region when remember is called with C-u.}
5664 @r{The entire text will be indented like @code{%i} itself.}
5665 %t @r{timestamp, date only}
5666 %T @r{timestamp with date and time}
5667 %u, %U @r{like the above, but inactive timestamps}
5668 %^t @r{like @code{%t}, but prompt for date. Similarly @code{%^T}, @code{%^u}, @code{%^U}}
5669 @r{You may define a prompt like @code{%^@{Birthday@}t}}
5670 %n @r{user name (taken from @code{user-full-name})}
5671 %c @r{Current kill ring head.}
5672 %x @r{Content of the X clipboard.}
5673 %^C @r{Interactive selection of which kill or clip to use.}
5674 %^L @r{Like @code{%^C}, but insert as link.}
5675 %^g @r{prompt for tags, with completion on tags in target file.}
5676 %k @r{title of currently clocked task}
5677 %K @r{link to currently clocked task}
5678 %^G @r{prompt for tags, with completion all tags in all agenda files.}
5679 %^@{@var{prop}@}p @r{Prompt the user for a value for property @var{prop}}
5680 %:keyword @r{specific information for certain link types, see below}
5681 %[@var{file}] @r{insert the contents of the file given by @var{file}}
5682 %(@var{sexp}) @r{evaluate Elisp @var{sexp} and replace with the result}
5683 %! @r{immediately store note after completing the template}
5684 @r{(skipping the @kbd{C-c C-c} that normally triggers storing)}
5685 %& @r{jump to target location immediately after storing note}
5689 For specific link types, the following keywords will be
5690 defined@footnote{If you define your own link types (@pxref{Adding
5691 hyperlink types}), any property you store with
5692 @code{org-store-link-props} can be accessed in remember templates in a
5695 @vindex org-from-is-user-regexp
5697 Link type | Available keywords
5698 -------------------+----------------------------------------------
5699 bbdb | %:name %:company
5700 bbdb | %::server %:port %:nick
5701 vm, wl, mh, rmail | %:type %:subject %:message-id
5702 | %:from %:fromname %:fromaddress
5703 | %:to %:toname %:toaddress
5704 | %:fromto @r{(either "to NAME" or "from NAME")@footnote{This will always be the other, not the user. See the variable @code{org-from-is-user-regexp}.}}
5705 gnus | %:group, @r{for messages also all email fields}
5707 info | %:file %:node
5712 To place the cursor after template expansion use:
5715 %? @r{After completing the template, position cursor here.}
5719 If you change your mind about which template to use, call
5720 @code{org-remember} in the remember buffer. You may then select a new
5721 template that will be filled with the previous context information.
5723 @node Storing notes, , Remember templates, Remember
5724 @subsection Storing notes
5726 @vindex org-remember-clock-out-on-exit
5727 When you are finished preparing a note with Remember, you have to press
5728 @kbd{C-c C-c} to file the note away. If you have started the clock in the
5729 Remember buffer, you will first be asked if you want to clock out
5730 now@footnote{To avoid this query, configure the variable
5731 @code{org-remember-clock-out-on-exit}.}. If you answer @kbd{n}, the clock
5732 will continue to run after the note was filed away.
5734 The handler will then store the note in the file and under the headline
5735 specified in the template, or it will use the default file and headline.
5736 The window configuration will be restored, sending you back to the working
5737 context before the call to Remember. To re-use the location found
5738 during the last call to Remember, exit the Remember buffer with
5739 @kbd{C-0 C-c C-c}, i.e. specify a zero prefix argument to @kbd{C-c C-c}.
5740 Another special case is @kbd{C-2 C-c C-c} which files the note as a child of
5741 the currently clocked item.
5743 @vindex org-remember-store-without-prompt
5744 If you want to store the note directly to a different place, use
5745 @kbd{C-1 C-c C-c} instead to exit Remember@footnote{Configure the
5746 variable @code{org-remember-store-without-prompt} to make this behavior
5747 the default.}. The handler will then first prompt for a target file---if
5748 you press @key{RET}, the value specified for the template is used.
5749 Then the command offers the headings tree of the selected file, with the
5750 cursor position at the default headline (if you specified one in the
5751 template). You can either immediately press @key{RET} to get the note
5752 placed there. Or you can use the following keys to find a different
5755 @key{TAB} @r{Cycle visibility.}
5756 @key{down} / @key{up} @r{Next/previous visible headline.}
5757 n / p @r{Next/previous visible headline.}
5758 f / b @r{Next/previous headline same level.}
5760 @c 0-9 @r{Digit argument.}
5763 Pressing @key{RET} or @key{left} or @key{right}
5764 then leads to the following result.
5766 @vindex org-reverse-note-order
5767 @multitable @columnfractions 0.2 0.15 0.65
5768 @item @b{Cursor position} @tab @b{Key} @tab @b{Note gets inserted}
5769 @item on headline @tab @key{RET} @tab as sublevel of the heading at cursor, first or last
5770 @item @tab @tab depending on @code{org-reverse-note-order}.
5771 @item @tab @key{left}/@key{right} @tab as same level, before/after current heading
5772 @item buffer-start @tab @key{RET} @tab as level 2 heading at end of file or level 1 at beginning
5773 @item @tab @tab depending on @code{org-reverse-note-order}.
5774 @item not on headline @tab @key{RET}
5775 @tab at cursor position, level taken from context.
5778 Before inserting the text into a tree, the function ensures that the text has
5779 a headline, i.e. a first line that starts with a @samp{*}. If not, a
5780 headline is constructed from the current date. If you have indented the text
5781 of the note below the headline, the indentation will be adapted if inserting
5782 the note into the tree requires demotion from level 1.
5785 @node Attachments, RSS Feeds, Remember, Capture - Refile - Archive
5786 @section Attachments
5789 @vindex org-attach-directory
5790 It is often useful to associate reference material with an outline node/task.
5791 Small chunks of plain text can simply be stored in the subtree of a project.
5792 Hyperlinks (@pxref{Hyperlinks}) can be used to establish associations with
5793 files that live elsewhere on your computer or in the cloud, like emails or
5794 source code files belonging to a project. Another method is @i{attachments},
5795 which are files located in a directory belonging to an outline node. Org
5796 uses directories named by the unique ID of each entry. These directories are
5797 located in the @file{data} directory which lives in the same directory where
5798 your Org file lives@footnote{If you move entries or Org files from one
5799 directory to another, you may want to configure @code{org-attach-directory}
5800 to contain an absolute path.}. If you initialize this directory with
5801 @code{git init}, Org will automatically commit changes when it sees them.
5802 The attachment system has been contributed to Org by John Wiegley.
5804 In cases where it seems better to do so, you can also attach a directory of your
5805 choice to an entry. You can also make children inherit the attachment
5806 directory from a parent, so that an entire subtree uses the same attached
5809 @noindent The following commands deal with attachments.
5815 The dispatcher for commands related to the attachment system. After these
5816 keys, a list of commands is displayed and you need to press an additional key
5817 to select a command:
5822 @vindex org-attach-method
5823 Select a file and move it into the task's attachment directory. The file
5824 will be copied, moved, or linked, depending on @code{org-attach-method}.
5825 Note that hard links are not supported on all systems.
5831 Attach a file using the copy/move/link method.
5832 Note that hard links are not supported on all systems.
5836 Create a new attachment as an Emacs buffer.
5840 Synchronize the current task with its attachment directory, in case you added
5841 attachments yourself.
5845 @vindex org-file-apps
5846 Open current task's attachment. If there are more than one, prompt for a
5847 file name first. Opening will follow the rules set by @code{org-file-apps}.
5848 For more details, see the information on following hyperlinks
5849 (@pxref{Handling links}).
5853 Also open the attachment, but force opening the file in Emacs.
5857 Open the current task's attachment directory.
5861 Also open the directory, but force using @command{dired} in Emacs.
5865 Select and delete a single attachment.
5869 Delete all of a task's attachments. A safer way is to open the directory in
5870 @command{dired} and delete from there.
5874 @cindex property, ATTACH_DIR
5875 Set a specific directory as the entry's attachment directory. This works by
5876 putting the directory path into the @code{ATTACH_DIR} property.
5880 @cindex property, ATTACH_DIR_INHERIT
5881 Set the @code{ATTACH_DIR_INHERIT} property, so that children will use the
5882 same directory for attachments as the parent does.
5886 @node RSS Feeds, Protocols, Attachments, Capture - Refile - Archive
5890 Org has the capability to add and change entries based on information found in
5891 RSS feeds. You could use this to make a task out of each new podcast in a
5892 podcast feed. Or you could use a phone-based note-creating service on the
5893 web to import tasks into Org. To access feeds, you need to configure the
5894 variable @code{org-feed-alist}. The docstring of this variable has detailed
5895 information. Here is just an example:
5898 (setq org-feed-alist
5899 '(("ReQall" "http://www.reqall.com/user/feeds/rss/a1b2c3....."
5900 "~/org/feeds.org" "ReQall Entries")
5903 will configure that new items from the feed provided by @file{reqall.com}
5904 will result in new entries in the file @file{~/org/feeds.org} under the
5905 heading @samp{ReQall Entries}, whenever the following command is used:
5910 Collect items from the feeds configured in @code{org-feed-alist} and act upon
5914 Prompt for a feed name and go to the inbox configured for this feed.
5917 Under the same headline, Org will create a drawer @samp{FEEDSTATUS} in which
5918 it will store information about the status of items in the feed, to avoid
5919 adding the same item several times. You should add @samp{FEEDSTATUS} to the
5920 list of drawers in that file:
5923 #+DRAWERS: LOGBOOK PROPERTIES FEEDSTATUS
5926 For more information, see @file{org-feed.el} and the docstring of
5927 @code{org-feed-alist}.
5929 @node Protocols, Refiling notes, RSS Feeds, Capture - Refile - Archive
5930 @section Protocols for external access
5931 @cindex protocols, for external access
5934 You can set up Org for handling protocol calls from outside applications that
5935 are passed to Emacs through the @file{emacsserver}. For example, you can
5936 configure bookmarks in your web browser to send a link to the current page to
5937 Org and create a note from it using Remember (@pxref{Remember}). Or you
5938 could create a bookmark that will tell Emacs to open the local source file of
5939 a remote website you are looking at with the browser. See
5940 @uref{http://orgmode.org/worg/org-contrib/org-protocol.php} for detailed
5941 documentation and setup instructions.
5943 @node Refiling notes, Archiving, Protocols, Capture - Refile - Archive
5944 @section Refiling notes
5945 @cindex refiling notes
5947 When reviewing the captured data, you may want to refile some of the entries
5948 into a different list, for example into a project. Cutting, finding the
5949 right location, and then pasting the note is cumbersome. To simplify this
5950 process, you can use the following special command:
5955 @vindex org-reverse-note-order
5956 @vindex org-refile-targets
5957 @vindex org-refile-use-outline-path
5958 @vindex org-outline-path-complete-in-steps
5959 @vindex org-refile-allow-creating-parent-nodes
5960 Refile the entry or region at point. This command offers possible locations
5961 for refiling the entry and lets you select one with completion. The item (or
5962 all items in the region) is filed below the target heading as a subitem.
5963 Depending on @code{org-reverse-note-order}, it will be either the first or
5965 By default, all level 1 headlines in the current buffer are considered to be
5966 targets, but you can have more complex definitions across a number of files.
5967 See the variable @code{org-refile-targets} for details. If you would like to
5968 select a location via a file-path-like completion along the outline path, see
5969 the variables @code{org-refile-use-outline-path} and
5970 @code{org-outline-path-complete-in-steps}. If you would like to be able to
5971 create new nodes as new parents for for refiling on the fly, check the
5972 variable @code{org-refile-allow-creating-parent-nodes}.
5975 Use the refile interface to jump to a heading.
5976 @kindex C-u C-u C-c C-w
5977 @item C-u C-u C-c C-w
5978 Jump to the location where @code{org-refile} last moved a tree to.
5981 @node Archiving, , Refiling notes, Capture - Refile - Archive
5985 When a project represented by a (sub)tree is finished, you may want
5986 to move the tree out of the way and to stop it from contributing to the
5987 agenda. Archiving is important to keep your working files compact and global
5988 searches like the construction of agenda views fast.
5991 * Moving subtrees:: Moving a tree to an archive file
5992 * Internal archiving:: Switch off a tree but keep i in the file
5995 @node Moving subtrees, Internal archiving, Archiving, Archiving
5996 @subsection Moving a tree to the archive file
5997 @cindex external archiving
5999 The most common archiving action is to move a project tree to another file,
6007 @vindex org-archive-location
6008 Archive the subtree starting at the cursor position to the location
6009 given by @code{org-archive-location}.
6010 @kindex C-u C-c C-x C-s
6011 @item C-u C-c C-x C-s
6012 Check if any direct children of the current headline could be moved to
6013 the archive. To do this, each subtree is checked for open TODO entries.
6014 If none are found, the command offers to move it to the archive
6015 location. If the cursor is @emph{not} on a headline when this command
6016 is invoked, the level 1 trees will be checked.
6019 @cindex archive locations
6020 The default archive location is a file in the same directory as the
6021 current file, with the name derived by appending @file{_archive} to the
6022 current file name. For information and examples on how to change this,
6023 see the documentation string of the variable
6024 @code{org-archive-location}. There is also an in-buffer option for
6025 setting this variable, for example@footnote{For backward compatibility,
6026 the following also works: If there are several such lines in a file,
6027 each specifies the archive location for the text below it. The first
6028 such line also applies to any text before its definition. However,
6029 using this method is @emph{strongly} deprecated as it is incompatible
6030 with the outline structure of the document. The correct method for
6031 setting multiple archive locations in a buffer is using properties.}:
6035 #+ARCHIVE: %s_done::
6038 @cindex property, ARCHIVE
6040 If you would like to have a special ARCHIVE location for a single entry
6041 or a (sub)tree, give the entry an @code{:ARCHIVE:} property with the
6042 location as the value (@pxref{Properties and Columns}).
6044 @vindex org-archive-save-context-info
6045 When a subtree is moved, it receives a number of special properties that
6046 record context information like the file from where the entry came, its
6047 outline path the archiving time etc. Configure the variable
6048 @code{org-archive-save-context-info} to adjust the amount of information
6052 @node Internal archiving, , Moving subtrees, Archiving
6053 @subsection Internal archiving
6055 If you want to just switch off (for agenda views) certain subtrees without
6056 moving them to a different file, you can use the @code{ARCHIVE tag}.
6058 A headline that is marked with the ARCHIVE tag (@pxref{Tags}) stays at
6059 its location in the outline tree, but behaves in the following way:
6062 @vindex org-cycle-open-archived-trees
6063 It does not open when you attempt to do so with a visibility cycling
6064 command (@pxref{Visibility cycling}). You can force cycling archived
6065 subtrees with @kbd{C-@key{TAB}}, or by setting the option
6066 @code{org-cycle-open-archived-trees}. Also normal outline commands like
6067 @code{show-all} will open archived subtrees.
6069 @vindex org-sparse-tree-open-archived-trees
6070 During sparse tree construction (@pxref{Sparse trees}), matches in
6071 archived subtrees are not exposed, unless you configure the option
6072 @code{org-sparse-tree-open-archived-trees}.
6074 @vindex org-agenda-skip-archived-trees
6075 During agenda view construction (@pxref{Agenda Views}), the content of
6076 archived trees is ignored unless you configure the option
6077 @code{org-agenda-skip-archived-trees}, in which case these trees will always
6078 be included. In the agenda you can press the @kbd{v} key to get archives
6079 temporarily included.
6081 @vindex org-export-with-archived-trees
6082 Archived trees are not exported (@pxref{Exporting}), only the headline
6083 is. Configure the details using the variable
6084 @code{org-export-with-archived-trees}.
6086 @vindex org-columns-skip-arrchived-trees
6087 Archived trees are excluded from column view unless the variable
6088 @code{org-columns-skip-arrchived-trees} is configured to @code{nil}.
6091 The following commands help managing the ARCHIVE tag:
6096 Toggle the ARCHIVE tag for the current headline. When the tag is set,
6097 the headline changes to a shadowed face, and the subtree below it is
6099 @kindex C-u C-c C-x a
6101 Check if any direct children of the current headline should be archived.
6102 To do this, each subtree is checked for open TODO entries. If none are
6103 found, the command offers to set the ARCHIVE tag for the child. If the
6104 cursor is @emph{not} on a headline when this command is invoked, the
6105 level 1 trees will be checked.
6108 Cycle a tree even if it is tagged with ARCHIVE.
6111 Move the current entry to the @emph{Archive Sibling}. This is a sibling of
6112 the entry with the heading @samp{Archive} and the tag @samp{ARCHIVE}. The
6113 entry becomes a child of that sibling and in this way retains a lot of its
6114 original context, including inherited tags and approximate position in the
6119 @node Agenda Views, Markup, Capture - Refile - Archive, Top
6120 @chapter Agenda Views
6121 @cindex agenda views
6123 Due to the way Org works, TODO items, time-stamped items, and
6124 tagged headlines can be scattered throughout a file or even a number of
6125 files. To get an overview of open action items, or of events that are
6126 important for a particular date, this information must be collected,
6127 sorted and displayed in an organized way.
6129 Org can select items based on various criteria and display them
6130 in a separate buffer. Seven different view types are provided:
6134 an @emph{agenda} that is like a calendar and shows information
6137 a @emph{TODO list} that covers all unfinished
6140 a @emph{match view}, showings headlines based on the tags, properties, and
6141 TODO state associated with them,
6143 a @emph{timeline view} that shows all events in a single Org file,
6144 in time-sorted view,
6146 a @emph{keyword search view} that shows all entries from multiple files
6147 that contain specified keywords,
6149 a @emph{stuck projects view} showing projects that currently don't move
6152 @emph{custom views} that are special tag/keyword searches and
6153 combinations of different views.
6157 The extracted information is displayed in a special @emph{agenda
6158 buffer}. This buffer is read-only, but provides commands to visit the
6159 corresponding locations in the original Org files, and even to
6160 edit these files remotely.
6162 @vindex org-agenda-window-setup
6163 @vindex org-agenda-restore-windows-after-quit
6164 Two variables control how the agenda buffer is displayed and whether the
6165 window configuration is restored when the agenda exits:
6166 @code{org-agenda-window-setup} and
6167 @code{org-agenda-restore-windows-after-quit}.
6170 * Agenda files:: Files being searched for agenda information
6171 * Agenda dispatcher:: Keyboard access to agenda views
6172 * Built-in agenda views:: What is available out of the box?
6173 * Presentation and sorting:: How agenda items are prepared for display
6174 * Agenda commands:: Remote editing of Org trees
6175 * Custom agenda views:: Defining special searches and views
6176 * Exporting Agenda Views:: Writing a view to a file
6177 * Agenda column view:: Using column view for collected entries
6180 @node Agenda files, Agenda dispatcher, Agenda Views, Agenda Views
6181 @section Agenda files
6182 @cindex agenda files
6183 @cindex files for agenda
6185 @vindex org-agenda-files
6186 The information to be shown is normally collected from all @emph{agenda
6187 files}, the files listed in the variable
6188 @code{org-agenda-files}@footnote{If the value of that variable is not a
6189 list, but a single file name, then the list of agenda files will be
6190 maintained in that external file.}. If a directory is part of this list,
6191 all files with the extension @file{.org} in this directory will be part
6194 Thus, even if you only work with a single Org file, that file should
6195 be put into the list@footnote{When using the dispatcher, pressing
6196 @kbd{<} before selecting a command will actually limit the command to
6197 the current file, and ignore @code{org-agenda-files} until the next
6198 dispatcher command.}. You can customize @code{org-agenda-files}, but
6199 the easiest way to maintain it is through the following commands
6201 @cindex files, adding to agenda list
6205 Add current file to the list of agenda files. The file is added to
6206 the front of the list. If it was already in the list, it is moved to
6207 the front. With a prefix argument, file is added/moved to the end.
6210 Remove current file from the list of agenda files.
6215 Cycle through agenda file list, visiting one file after the other.
6216 @kindex M-x org-iswitchb
6217 @item M-x org-iswitchb
6218 Command to use an @code{iswitchb}-like interface to switch to and between Org
6223 The Org menu contains the current list of files and can be used
6224 to visit any of them.
6226 If you would like to focus the agenda temporarily on a file not in
6227 this list, or on just one file in the list, or even on only a subtree in a
6228 file, then this can be done in different ways. For a single agenda command,
6229 you may press @kbd{<} once or several times in the dispatcher
6230 (@pxref{Agenda dispatcher}). To restrict the agenda scope for an
6231 extended period, use the following commands:
6236 Permanently restrict the agenda to the current subtree. When with a
6237 prefix argument, or with the cursor before the first headline in a file,
6238 the agenda scope is set to the entire file. This restriction remains in
6239 effect until removed with @kbd{C-c C-x >}, or by typing either @kbd{<}
6240 or @kbd{>} in the agenda dispatcher. If there is a window displaying an
6241 agenda view, the new restriction takes effect immediately.
6244 Remove the permanent restriction created by @kbd{C-c C-x <}.
6248 When working with @file{speedbar.el}, you can use the following commands in
6252 @item < @r{in the speedbar frame}
6253 Permanently restrict the agenda to the item---either an Org file or a subtree
6254 in such a file---at the cursor in the Speedbar frame.
6255 If there is a window displaying an agenda view, the new restriction takes
6258 @item > @r{in the speedbar frame}
6259 Lift the restriction.
6262 @node Agenda dispatcher, Built-in agenda views, Agenda files, Agenda Views
6263 @section The agenda dispatcher
6264 @cindex agenda dispatcher
6265 @cindex dispatching agenda commands
6266 The views are created through a dispatcher, which should be bound to a
6267 global key---for example @kbd{C-c a} (@pxref{Installation}). In the
6268 following we will assume that @kbd{C-c a} is indeed how the dispatcher
6269 is accessed and list keyboard access to commands accordingly. After
6270 pressing @kbd{C-c a}, an additional letter is required to execute a
6271 command. The dispatcher offers the following default commands:
6274 Create the calendar-like agenda (@pxref{Weekly/daily agenda}).
6276 Create a list of all TODO items (@pxref{Global TODO list}).
6278 Create a list of headlines matching a TAGS expression (@pxref{Matching
6279 tags and properties}).
6281 Create the timeline view for the current buffer (@pxref{Timeline}).
6283 Create a list of entries selected by a boolean expression of keywords
6284 and/or regular expressions that must or must not occur in the entry.
6286 @vindex org-agenda-text-search-extra-files
6287 Search for a regular expression in all agenda files and additionally in
6288 the files listed in @code{org-agenda-text-search-extra-files}. This
6289 uses the Emacs command @code{multi-occur}. A prefix argument can be
6290 used to specify the number of context lines for each match, default is
6293 Create a list of stuck projects (@pxref{Stuck projects}).
6295 Restrict an agenda command to the current buffer@footnote{For backward
6296 compatibility, you can also press @kbd{1} to restrict to the current
6297 buffer.}. After pressing @kbd{<}, you still need to press the character
6298 selecting the command.
6300 If there is an active region, restrict the following agenda command to
6301 the region. Otherwise, restrict it to the current subtree@footnote{For
6302 backward compatibility, you can also press @kbd{0} to restrict to the
6303 current region/subtree.}. After pressing @kbd{< <}, you still need to press the
6304 character selecting the command.
6307 You can also define custom commands that will be accessible through the
6308 dispatcher, just like the default commands. This includes the
6309 possibility to create extended agenda buffers that contain several
6310 blocks together, for example the weekly agenda, the global TODO list and
6311 a number of special tags matches. @xref{Custom agenda views}.
6313 @node Built-in agenda views, Presentation and sorting, Agenda dispatcher, Agenda Views
6314 @section The built-in agenda views
6316 In this section we describe the built-in views.
6319 * Weekly/daily agenda:: The calendar page with current tasks
6320 * Global TODO list:: All unfinished action items
6321 * Matching tags and properties:: Structured information with fine-tuned search
6322 * Timeline:: Time-sorted view for single file
6323 * Keyword search:: Finding entries by keyword
6324 * Stuck projects:: Find projects you need to review
6327 @node Weekly/daily agenda, Global TODO list, Built-in agenda views, Built-in agenda views
6328 @subsection The weekly/daily agenda
6330 @cindex weekly agenda
6331 @cindex daily agenda
6333 The purpose of the weekly/daily @emph{agenda} is to act like a page of a
6334 paper agenda, showing all the tasks for the current week or day.
6337 @cindex org-agenda, command
6340 @vindex org-agenda-ndays
6341 Compile an agenda for the current week from a list of Org files. The agenda
6342 shows the entries for each day. With a numeric prefix@footnote{For backward
6343 compatibility, the universal prefix @kbd{C-u} causes all TODO entries to be
6344 listed before the agenda. This feature is deprecated, use the dedicated TODO
6345 list, or a block agenda instead (@pxref{Block agenda}).} (like @kbd{C-u 2 1
6346 C-c a a}) you may set the number of days to be displayed (see also the
6347 variable @code{org-agenda-ndays})
6350 Remote editing from the agenda buffer means, for example, that you can
6351 change the dates of deadlines and appointments from the agenda buffer.
6352 The commands available in the Agenda buffer are listed in @ref{Agenda
6355 @subsubheading Calendar/Diary integration
6356 @cindex calendar integration
6357 @cindex diary integration
6359 Emacs contains the calendar and diary by Edward M. Reingold. The
6360 calendar displays a three-month calendar with holidays from different
6361 countries and cultures. The diary allows you to keep track of
6362 anniversaries, lunar phases, sunrise/set, recurrent appointments
6363 (weekly, monthly) and more. In this way, it is quite complementary to
6364 Org. It can be very useful to combine output from Org with
6367 In order to include entries from the Emacs diary into Org mode's
6368 agenda, you only need to customize the variable
6371 (setq org-agenda-include-diary t)
6374 @noindent After that, everything will happen automatically. All diary
6375 entries including holidays, anniversaries, etc., will be included in the
6376 agenda buffer created by Org mode. @key{SPC}, @key{TAB}, and
6377 @key{RET} can be used from the agenda buffer to jump to the diary
6378 file in order to edit existing diary entries. The @kbd{i} command to
6379 insert new entries for the current date works in the agenda buffer, as
6380 well as the commands @kbd{S}, @kbd{M}, and @kbd{C} to display
6381 Sunrise/Sunset times, show lunar phases and to convert to other
6382 calendars, respectively. @kbd{c} can be used to switch back and forth
6383 between calendar and agenda.
6385 If you are using the diary only for sexp entries and holidays, it is
6386 faster to not use the above setting, but instead to copy or even move
6387 the entries into an Org file. Org mode evaluates diary-style sexp
6388 entries, and does it faster because there is no overhead for first
6389 creating the diary display. Note that the sexp entries must start at
6390 the left margin, no whitespace is allowed before them. For example,
6391 the following segment of an Org file will be processed and entries
6392 will be made in the agenda:
6395 * Birthdays and similar stuff
6397 %%(org-calendar-holiday) ; special function for holiday names
6399 %%(diary-anniversary 14 5 1956) Arthur Dent is %d years old
6400 %%(diary-anniversary 2 10 1869) Mahatma Gandhi would be %d years old
6403 @subsubheading Anniversaries from BBDB
6404 @cindex BBDB, anniversaries
6405 @cindex anniversaries, from BBDB
6407 If you are using the Big Brothers Database to store your contacts, you will
6408 very likely prefer to store anniversaries in BBDB rather than in a
6409 separate Org or diary file. Org supports this and will show BBDB
6410 anniversaries as part of the agenda. All you need to do is to add the
6411 following to one your your agenda files:
6418 %%(org-bbdb-anniversaries)
6421 You can then go ahead and define anniversaries for a BBDB record. Basically,
6422 you need to press @kbd{C-o anniversary @key{RET}} with the cursor in a BBDB
6423 record and then add the date in the format @code{YYYY-MM-DD}, followed by a
6424 space and the class of the anniversary (@samp{birthday} or @samp{wedding}, or
6425 a format string). If you omit the class, it will default to @samp{birthday}.
6426 Here are a few examples, the header for the file @file{org-bbdb.el} contains
6427 more detailed information.
6432 2008-04-14 %s released version 6.01 of org-mode, %d years ago
6435 After a change to BBDB, or for the first agenda display during an Emacs
6436 session, the agenda display will suffer a short delay as Org updates its
6437 hash with anniversaries. However, from then on things will be very fast---much
6438 faster in fact than a long list of @samp{%%(diary-anniversary)} entries
6439 in an Org or Diary file.
6441 @subsubheading Appointment reminders
6442 @cindex @file{appt.el}
6443 @cindex appointment reminders
6445 Org can interact with Emacs appointments notification facility. To add all
6446 the appointments of your agenda files, use the command
6447 @code{org-agenda-to-appt}. This command also lets you filter through the
6448 list of your appointments and add only those belonging to a specific category
6449 or matching a regular expression. See the docstring for details.
6451 @node Global TODO list, Matching tags and properties, Weekly/daily agenda, Built-in agenda views
6452 @subsection The global TODO list
6453 @cindex global TODO list
6454 @cindex TODO list, global
6456 The global TODO list contains all unfinished TODO items formatted and
6457 collected into a single place.
6462 Show the global TODO list. This collects the TODO items from all
6463 agenda files (@pxref{Agenda Views}) into a single buffer. The buffer is in
6464 @code{agenda-mode}, so there are commands to examine and manipulate
6465 the TODO entries directly from that buffer (@pxref{Agenda commands}).
6468 @cindex TODO keyword matching
6469 @vindex org-todo-keywords
6470 Like the above, but allows selection of a specific TODO keyword. You
6471 can also do this by specifying a prefix argument to @kbd{C-c a t}. With
6472 a @kbd{C-u} prefix you are prompted for a keyword, and you may also
6473 specify several keywords by separating them with @samp{|} as the boolean OR
6474 operator. With a numeric prefix, the nth keyword in
6475 @code{org-todo-keywords} is selected.
6477 The @kbd{r} key in the agenda buffer regenerates it, and you can give
6478 a prefix argument to this command to change the selected TODO keyword,
6479 for example @kbd{3 r}. If you often need a search for a specific
6480 keyword, define a custom command for it (@pxref{Agenda dispatcher}).@*
6481 Matching specific TODO keywords can also be done as part of a tags
6482 search (@pxref{Tag searches}).
6485 Remote editing of TODO items means that you can change the state of a
6486 TODO entry with a single key press. The commands available in the
6487 TODO list are described in @ref{Agenda commands}.
6489 @cindex sublevels, inclusion into TODO list
6490 Normally the global TODO list simply shows all headlines with TODO
6491 keywords. This list can become very long. There are two ways to keep
6495 @vindex org-agenda-todo-ignore-scheduled
6496 @vindex org-agenda-todo-ignore-deadlines
6497 @vindex org-agenda-todo-ignore-with-date
6498 Some people view a TODO item that has been @emph{scheduled} for execution or
6499 have a @emph{deadline} (@pxref{Timestamps}) as no longer @emph{open}.
6500 Configure the variables @code{org-agenda-todo-ignore-scheduled},
6501 @code{org-agenda-todo-ignore-deadlines}, and/or
6502 @code{org-agenda-todo-ignore-with-date} to exclude such items from the
6505 @vindex org-agenda-todo-list-sublevels
6506 TODO items may have sublevels to break up the task into subtasks. In
6507 such cases it may be enough to list only the highest level TODO headline
6508 and omit the sublevels from the global list. Configure the variable
6509 @code{org-agenda-todo-list-sublevels} to get this behavior.
6512 @node Matching tags and properties, Timeline, Global TODO list, Built-in agenda views
6513 @subsection Matching tags and properties
6514 @cindex matching, of tags
6515 @cindex matching, of properties
6519 If headlines in the agenda files are marked with @emph{tags} (@pxref{Tags}),
6520 or have properties (@pxref{Properties and Columns}), you can select headlines
6521 based on this metadata and collect them into an agenda buffer. The match
6522 syntax described here also applies when creating sparse trees with @kbd{C-c /
6528 Produce a list of all headlines that match a given set of tags. The
6529 command prompts for a selection criterion, which is a boolean logic
6530 expression with tags, like @samp{+work+urgent-withboss} or
6531 @samp{work|home} (@pxref{Tags}). If you often need a specific search,
6532 define a custom command for it (@pxref{Agenda dispatcher}).
6535 @vindex org-tags-match-list-sublevels
6536 @vindex org-agenda-tags-todo-honor-ignore-options
6537 Like @kbd{C-c a m}, but only select headlines that are also TODO items and
6538 force checking subitems (see variable @code{org-tags-match-list-sublevels}).
6539 To exclude scheduled/deadline items, see the variable
6540 @code{org-agenda-tags-todo-honor-ignore-options}. Matching specific TODO
6541 keywords together with a tags match is also possible, see @ref{Tag searches}.
6544 The commands available in the tags list are described in @ref{Agenda
6547 @subsubheading Match syntax
6549 @cindex Boolean logic, for tag/property searches
6550 A search string can use Boolean operators @samp{&} for AND and @samp{|} for
6551 OR. @samp{&} binds more strongly than @samp{|}. Parentheses are currently
6552 not implemented. Each element in the search is either a tag, a regular
6553 expression matching tags, or an expression like @code{PROPERTY OPERATOR
6554 VALUE} with a comparison operator, accessing a property value. Each element
6555 may be preceded by @samp{-}, to select against it, and @samp{+} is syntactic
6556 sugar for positive selection. The AND operator @samp{&} is optional when
6557 @samp{+} or @samp{-} is present. Here are some examples, using only tags.
6561 Select headlines tagged @samp{:work:}, but discard those also tagged
6564 Selects lines tagged @samp{:work:} or @samp{:laptop:}.
6565 @item work|laptop+night
6566 Like before, but require the @samp{:laptop:} lines to be tagged also
6570 @cindex regular expressions, with tags search
6571 Instead of a tag, you may also specify a regular expression enclosed in curly
6572 braces. For example,
6573 @samp{work+@{^boss.*@}} matches headlines that contain the tag
6574 @samp{:work:} and any tag @i{starting} with @samp{boss}.
6576 @cindex TODO keyword matching, with tags search
6577 @cindex level, require for tags/property match
6578 @cindex category, require for tags/property match
6579 @vindex org-odd-levels-only
6580 You may also test for properties (@pxref{Properties and Columns}) at the same
6581 time as matching tags. The properties may be real properties, or special
6582 properties that represent other metadata (@pxref{Special properties}). For
6583 example, the ``property'' @code{TODO} represents the TODO keyword of the
6584 entry. Or, the ``property'' @code{LEVEL} represents the level of an entry.
6585 So a search @samp{+LEVEL=3+boss-TODO="DONE"} lists all level three headlines
6586 that have the tag @samp{boss} and are @emph{not} marked with the TODO keyword
6587 DONE. In buffers with @code{org-odd-levels-only} set, @samp{LEVEL} does not
6588 count the number of stars, but @samp{LEVEL=2} will correspond to 3 stars etc.
6590 Here are more examples:
6592 @item work+TODO="WAITING"
6593 Select @samp{:work:}-tagged TODO lines with the specific TODO
6594 keyword @samp{WAITING}.
6595 @item work+TODO="WAITING"|home+TODO="WAITING"
6596 Waiting tasks both at work and at home.
6599 When matching properties, a number of different operators can be used to test
6600 the value of a property. Here is a complex example:
6603 +work-boss+PRIORITY="A"+Coffee="unlimited"+Effort<2 \
6604 +With=@{Sarah\|Denny@}+SCHEDULED>="<2008-10-11>"
6608 The type of comparison will depend on how the comparison value is written:
6611 If the comparison value is a plain number, a numerical comparison is done,
6612 and the allowed operators are @samp{<}, @samp{=}, @samp{>}, @samp{<=},
6613 @samp{>=}, and @samp{<>}.
6615 If the comparison value is enclosed in double-quotes,
6616 a string comparison is done, and the same operators are allowed.
6618 If the comparison value is enclosed in double-quotes @emph{and} angular
6619 brackets (like @samp{DEADLINE<="<2008-12-24 18:30>"}), both values are
6620 assumed to be date/time specifications in the standard Org way, and the
6621 comparison will be done accordingly. Special values that will be recognized
6622 are @code{"<now>"} for now (including time), and @code{"<today>"}, and
6623 @code{"<tomorrow>"} for these days at 0:00 hours, i.e. without a time
6624 specification. Also strings like @code{"<+5d>"} or @code{"<-2m>"} with units
6625 @code{d}, @code{w}, @code{m}, and @code{y} for day, week, month, and year,
6626 respectively, can be used.
6628 If the comparison value is enclosed
6629 in curly braces, a regexp match is performed, with @samp{=} meaning that the
6630 regexp matches the property value, and @samp{<>} meaning that it does not
6634 So the search string in the example finds entries tagged @samp{:work:} but
6635 not @samp{:boss:}, which also have a priority value @samp{A}, a
6636 @samp{:Coffee:} property with the value @samp{unlimited}, an @samp{Effort}
6637 property that is numerically smaller than 2, a @samp{:With:} property that is
6638 matched by the regular expression @samp{Sarah\|Denny}, and that are scheduled
6639 on or after October 11, 2008.
6641 Accessing TODO, LEVEL, and CATEGORY during a search is fast. Accessing any
6642 other properties will slow down the search. However, once you have paid the
6643 price by accessing one property, testing additional properties is cheap
6646 You can configure Org mode to use property inheritance during a search, but
6647 beware that this can slow down searches considerably. See @ref{Property
6648 inheritance}, for details.
6650 For backward compatibility, and also for typing speed, there is also a
6651 different way to test TODO states in a search. For this, terminate the
6652 tags/property part of the search string (which may include several terms
6653 connected with @samp{|}) with a @samp{/} and then specify a Boolean
6654 expression just for TODO keywords. The syntax is then similar to that for
6655 tags, but should be applied with care: for example, a positive
6656 selection on several TODO keywords cannot meaningfully be combined with
6657 boolean AND. However, @emph{negative selection} combined with AND can be
6658 meaningful. To make sure that only lines are checked that actually have any
6659 TODO keyword (resulting in a speed-up), use @kbd{C-c a M}, or equivalently
6660 start the TODO part after the slash with @samp{!}. Examples:
6664 Same as @samp{work+TODO="WAITING"}
6665 @item work/!-WAITING-NEXT
6666 Select @samp{:work:}-tagged TODO lines that are neither @samp{WAITING}
6668 @item work/!+WAITING|+NEXT
6669 Select @samp{:work:}-tagged TODO lines that are either @samp{WAITING} or
6673 @node Timeline, Keyword search, Matching tags and properties, Built-in agenda views
6674 @subsection Timeline for a single file
6675 @cindex timeline, single file
6676 @cindex time-sorted view
6678 The timeline summarizes all time-stamped items from a single Org mode
6679 file in a @emph{time-sorted view}. The main purpose of this command is
6680 to give an overview over events in a project.
6685 Show a time-sorted view of the Org file, with all time-stamped items.
6686 When called with a @kbd{C-u} prefix, all unfinished TODO entries
6687 (scheduled or not) are also listed under the current date.
6691 The commands available in the timeline buffer are listed in
6692 @ref{Agenda commands}.
6694 @node Keyword search, Stuck projects, Timeline, Built-in agenda views
6695 @subsection Keyword search
6696 @cindex keyword search
6697 @cindex searching, for keywords
6699 This agenda view is a general text search facility for Org mode entries.
6700 It is particularly useful to find notes.
6705 This is a special search that lets you select entries by keywords or
6706 regular expression, using a boolean logic. For example, the search
6710 +computer +wifi -ethernet -@{8\.11[bg]@}
6714 will search for note entries that contain the keywords @code{computer}
6715 and @code{wifi}, but not the keyword @code{ethernet}, and which are also
6716 not matched by the regular expression @code{8\.11[bg]}, meaning to
6717 exclude both 8.11b and 8.11g.
6719 @vindex org-agenda-text-search-extra-files
6720 Note that in addition to the agenda files, this command will also search
6721 the files listed in @code{org-agenda-text-search-extra-files}.
6724 @node Stuck projects, , Keyword search, Built-in agenda views
6725 @subsection Stuck projects
6727 If you are following a system like David Allen's GTD to organize your
6728 work, one of the ``duties'' you have is a regular review to make sure
6729 that all projects move along. A @emph{stuck} project is a project that
6730 has no defined next actions, so it will never show up in the TODO lists
6731 Org mode produces. During the review, you need to identify such
6732 projects and define next actions for them.
6737 List projects that are stuck.
6740 @vindex org-stuck-projects
6741 Customize the variable @code{org-stuck-projects} to define what a stuck
6742 project is and how to find it.
6745 You almost certainly will have to configure this view before it will
6746 work for you. The built-in default assumes that all your projects are
6747 level-2 headlines, and that a project is not stuck if it has at least
6748 one entry marked with a TODO keyword TODO or NEXT or NEXTACTION.
6750 Let's assume that you, in your own way of using Org mode, identify
6751 projects with a tag PROJECT, and that you use a TODO keyword MAYBE to
6752 indicate a project that should not be considered yet. Let's further
6753 assume that the TODO keyword DONE marks finished projects, and that NEXT
6754 and TODO indicate next actions. The tag @@SHOP indicates shopping and
6755 is a next action even without the NEXT tag. Finally, if the project
6756 contains the special word IGNORE anywhere, it should not be listed
6757 either. In this case you would start by identifying eligible projects
6758 with a tags/todo match@footnote{@xref{Tag searches}.}
6759 @samp{+PROJECT/-MAYBE-DONE}, and then check for TODO, NEXT, @@SHOP, and
6760 IGNORE in the subtree to identify projects that are not stuck. The
6761 correct customization for this is
6764 (setq org-stuck-projects
6765 '("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@@SHOP")
6769 Note that if a project is identified as non-stuck, the subtree of this entry
6770 will still be searched for stuck projects.
6772 @node Presentation and sorting, Agenda commands, Built-in agenda views, Agenda Views
6773 @section Presentation and sorting
6774 @cindex presentation, of agenda items
6776 @vindex org-agenda-prefix-format
6777 Before displaying items in an agenda view, Org mode visually prepares
6778 the items and sorts them. Each item occupies a single line. The line
6779 starts with a @emph{prefix} that contains the @emph{category}
6780 (@pxref{Categories}) of the item and other important information. You can
6781 customize the prefix using the option @code{org-agenda-prefix-format}.
6782 The prefix is followed by a cleaned-up version of the outline headline
6783 associated with the item.
6786 * Categories:: Not all tasks are equal
6787 * Time-of-day specifications:: How the agenda knows the time
6788 * Sorting of agenda items:: The order of things
6791 @node Categories, Time-of-day specifications, Presentation and sorting, Presentation and sorting
6792 @subsection Categories
6795 The category is a broad label assigned to each agenda item. By default,
6796 the category is simply derived from the file name, but you can also
6797 specify it with a special line in the buffer, like this@footnote{For
6798 backward compatibility, the following also works: if there are several
6799 such lines in a file, each specifies the category for the text below it.
6800 The first category also applies to any text before the first CATEGORY
6801 line. However, using this method is @emph{strongly} deprecated as it is
6802 incompatible with the outline structure of the document. The correct
6803 method for setting multiple categories in a buffer is using a
6811 @cindex property, CATEGORY
6812 If you would like to have a special CATEGORY for a single entry or a
6813 (sub)tree, give the entry a @code{:CATEGORY:} property with the
6814 special category you want to apply as the value.
6817 The display in the agenda buffer looks best if the category is not
6818 longer than 10 characters.
6820 @node Time-of-day specifications, Sorting of agenda items, Categories, Presentation and sorting
6821 @subsection Time-of-day specifications
6822 @cindex time-of-day specification
6824 Org mode checks each agenda item for a time-of-day specification. The
6825 time can be part of the timestamp that triggered inclusion into the
6826 agenda, for example as in @w{@samp{<2005-05-10 Tue 19:00>}}. Time
6827 ranges can be specified with two timestamps, like
6829 @w{@samp{<2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>}}.
6831 In the headline of the entry itself, a time(range) may also appear as
6832 plain text (like @samp{12:45} or a @samp{8:30-1pm}). If the agenda
6833 integrates the Emacs diary (@pxref{Weekly/daily agenda}), time
6834 specifications in diary entries are recognized as well.
6836 For agenda display, Org mode extracts the time and displays it in a
6837 standard 24 hour format as part of the prefix. The example times in
6838 the previous paragraphs would end up in the agenda like this:
6841 8:30-13:00 Arthur Dent lies in front of the bulldozer
6842 12:45...... Ford Prefect arrives and takes Arthur to the pub
6843 19:00...... The Vogon reads his poem
6844 20:30-22:15 Marvin escorts the Hitchhikers to the bridge
6848 If the agenda is in single-day mode, or for the display of today, the
6849 timed entries are embedded in a time grid, like
6852 8:00...... ------------------
6853 8:30-13:00 Arthur Dent lies in front of the bulldozer
6854 10:00...... ------------------
6855 12:00...... ------------------
6856 12:45...... Ford Prefect arrives and takes Arthur to the pub
6857 14:00...... ------------------
6858 16:00...... ------------------
6859 18:00...... ------------------
6860 19:00...... The Vogon reads his poem
6861 20:00...... ------------------
6862 20:30-22:15 Marvin escorts the Hitchhikers to the bridge
6865 @vindex org-agenda-use-time-grid
6866 @vindex org-agenda-time-grid
6867 The time grid can be turned on and off with the variable
6868 @code{org-agenda-use-time-grid}, and can be configured with
6869 @code{org-agenda-time-grid}.
6871 @node Sorting of agenda items, , Time-of-day specifications, Presentation and sorting
6872 @subsection Sorting of agenda items
6873 @cindex sorting, of agenda items
6874 @cindex priorities, of agenda items
6875 Before being inserted into a view, the items are sorted. How this is
6876 done depends on the type of view.
6879 @vindex org-agenda-files
6880 For the daily/weekly agenda, the items for each day are sorted. The
6881 default order is to first collect all items containing an explicit
6882 time-of-day specification. These entries will be shown at the beginning
6883 of the list, as a @emph{schedule} for the day. After that, items remain
6884 grouped in categories, in the sequence given by @code{org-agenda-files}.
6885 Within each category, items are sorted by priority (@pxref{Priorities}),
6886 which is composed of the base priority (2000 for priority @samp{A}, 1000
6887 for @samp{B}, and 0 for @samp{C}), plus additional increments for
6888 overdue scheduled or deadline items.
6890 For the TODO list, items remain in the order of categories, but within
6891 each category, sorting takes place according to priority
6892 (@pxref{Priorities}). The priority used for sorting derives from the
6893 priority cookie, with additions depending on how close an item is to its due
6896 For tags matches, items are not sorted at all, but just appear in the
6897 sequence in which they are found in the agenda files.
6900 @vindex org-agenda-sorting-strategy
6901 Sorting can be customized using the variable
6902 @code{org-agenda-sorting-strategy}, and may also include criteria based on
6903 the estimated effort of an entry (@pxref{Effort estimates}).
6905 @node Agenda commands, Custom agenda views, Presentation and sorting, Agenda Views
6906 @section Commands in the agenda buffer
6907 @cindex commands, in agenda buffer
6909 Entries in the agenda buffer are linked back to the Org file or diary
6910 file where they originate. You are not allowed to edit the agenda
6911 buffer itself, but commands are provided to show and jump to the
6912 original entry location, and to edit the Org files ``remotely'' from
6913 the agenda buffer. In this way, all information is stored only once,
6914 removing the risk that your agenda and note files may diverge.
6916 Some commands can be executed with mouse clicks on agenda lines. For
6917 the other commands, the cursor needs to be in the desired line.
6920 @tsubheading{Motion}
6921 @cindex motion commands in agenda
6924 Next line (same as @key{up} and @kbd{C-p}).
6927 Previous line (same as @key{down} and @kbd{C-n}).
6928 @tsubheading{View/Go to Org file}
6933 Display the original location of the item in another window.
6934 With prefix arg, make sure that the entire entry is made visible in the
6935 outline, not only the heading.
6939 Display original location and recenter that window.
6947 Go to the original location of the item in another window. Under Emacs
6948 22, @kbd{mouse-1} will also works for this.
6952 Go to the original location of the item and delete other windows.
6956 @vindex org-agenda-start-with-follow-mode
6957 Toggle Follow mode. In Follow mode, as you move the cursor through
6958 the agenda buffer, the other window always shows the corresponding
6959 location in the Org file. The initial setting for this mode in new
6960 agenda buffers can be set with the variable
6961 @code{org-agenda-start-with-follow-mode}.
6965 Display the entire subtree of the current item in an indirect buffer. With a
6966 numeric prefix argument N, go up to level N and then take that tree. If N is
6967 negative, go up that many levels. With a @kbd{C-u} prefix, do not remove the
6968 previously used indirect buffer.
6972 Follow a link in the entry. This will offer a selection of any links in the
6973 text belonging to the referenced Org node. If there is only one link, it
6974 will be followed without a selection prompt.
6976 @tsubheading{Change display}
6977 @cindex display changing, in agenda
6980 Delete other windows.
6988 @item v d @ @r{or short} @ d
6989 @itemx v w @ @r{or short} @ w
6992 Switch to day/week/month/year view. When switching to day or week view,
6993 this setting becomes the default for subsequent agenda commands. Since
6994 month and year views are slow to create, they do not become the default.
6995 A numeric prefix argument may be used to jump directly to a specific day
6996 of the year, ISO week, month, or year, respectively. For example,
6997 @kbd{32 d} jumps to February 1st, @kbd{9 w} to ISO week number 9. When
6998 setting day, week, or month view, a year may be encoded in the prefix
6999 argument as well. For example, @kbd{200712 w} will jump to week 12 in
7000 2007. If such a year specification has only one or two digits, it will
7001 be mapped to the interval 1938-2037.
7005 @vindex org-agenda-ndays
7006 Go forward in time to display the following @code{org-agenda-ndays} days.
7007 For example, if the display covers a week, switch to the following week.
7008 With prefix arg, go forward that many times @code{org-agenda-ndays} days.
7012 Go backward in time to display earlier dates.
7020 Prompt for a date and go there.
7024 Toggle the inclusion of diary entries. See @ref{Weekly/daily agenda}.
7028 @item v l @ @r{or short} @ l
7029 @vindex org-log-done
7030 @vindex org-agenda-log-mode-items
7031 Toggle Logbook mode. In Logbook mode, entries that were marked DONE while
7032 logging was on (variable @code{org-log-done}) are shown in the agenda, as are
7033 entries that have been clocked on that day. You can configure the entry
7034 types that should be included in log mode using the variable
7035 @code{org-agenda-log-mode-items}. When called with a @kbd{C-u} prefix, show
7036 all possible logbook entries, including state changes. When called with two
7037 prefix args @kbd{C-u C-u}, show only logging information, nothing else.
7041 @item v [ @ @r{or short} @ [
7042 Include inactive timestamps into the current view. Only for weekly/daily
7043 agenda and timeline views.
7049 Toggle Archives mode. In Archives mode, trees that are marked
7050 @code{ARCHIVED} are also scanned when producing the agenda. When you use the
7051 capital @kbd{A}, even all archive files are included. To exit archives mode,
7052 press @kbd{v a} again.
7056 @item v R @ @r{or short} @ R
7057 @vindex org-agenda-start-with-clockreport-mode
7058 Toggle Clockreport mode. In Clockreport mode, the daily/weekly agenda will
7059 always show a table with the clocked times for the timespan and file scope
7060 covered by the current agenda view. The initial setting for this mode in new
7061 agenda buffers can be set with the variable
7062 @code{org-agenda-start-with-clockreport-mode}.
7066 @item v E @ @r{or short} @ E
7067 @vindex org-agenda-start-with-entry-text-mode
7068 @vindex org-agenda-entry-text-maxlines
7069 Toggle entry text mode. In entry text mode, a number of lines from the Org
7070 outline node referenced by an agenda line will be displayed below the line.
7071 The maximum number of lines is given by the variable
7072 @code{org-agenda-entry-text-maxlines}. Calling this command with a numeric
7073 prefix argument will temporarily modify that number to the prefix value.
7077 @vindex org-agenda-use-time-grid
7078 @vindex org-agenda-time-grid
7079 Toggle the time grid on and off. See also the variables
7080 @code{org-agenda-use-time-grid} and @code{org-agenda-time-grid}.
7084 Recreate the agenda buffer, for example to reflect the changes after
7085 modification of the timestamps of items with @kbd{S-@key{left}} and
7086 @kbd{S-@key{right}}. When the buffer is the global TODO list, a prefix
7087 argument is interpreted to create a selective list for a specific TODO
7097 Save all Org buffers in the current Emacs session, and also the locations of
7102 @vindex org-columns-default-format
7103 Invoke column view (@pxref{Column view}) in the agenda buffer. The column
7104 view format is taken from the entry at point, or (if there is no entry at
7105 point), from the first entry in the agenda view. So whatever the format for
7106 that entry would be in the original buffer (taken from a property, from a
7107 @code{#+COLUMNS} line, or from the default variable
7108 @code{org-columns-default-format}), will be used in the agenda.
7112 Remove the restriction lock on the agenda, if it is currently restricted to a
7113 file or subtree (@pxref{Agenda files}).
7115 @tsubheading{Secondary filtering and query editing}
7116 @cindex filtering, by tag and effort, in agenda
7117 @cindex tag filtering, in agenda
7118 @cindex effort filtering, in agenda
7119 @cindex query editing, in agenda
7123 @vindex org-agenda-filter-preset
7124 Filter the current agenda view with respect to a tag and/or effort estimates.
7125 The difference between this and a custom agenda command is that filtering is
7126 very fast, so that you can switch quickly between different filters without
7127 having to recreate the agenda@footnote{Custom commands can preset a filter by
7128 binding the variable @code{org-agenda-filter-preset} as an option. This
7129 filter will then be applied to the view and persist as a basic filter through
7130 refreshes and more secondary filtering.}
7132 You will be prompted for a tag selection letter. Pressing @key{TAB} at that
7133 prompt will offer use completion to select a tag (including any tags that do
7134 not have a selection character). The command then hides all entries that do
7135 not contain or inherit this tag. When called with prefix arg, remove the
7136 entries that @emph{do} have the tag. A second @kbd{/} at the prompt will
7137 turn off the filter and unhide any hidden entries. If the first key you
7138 press is either @kbd{+} or @kbd{-}, the previous filter will be narrowed by
7139 requiring or forbidding the selected additional tag. Instead of pressing
7140 @kbd{+} or @kbd{-} after @kbd{/}, you can also immediately use the @kbd{\}
7143 @vindex org-sort-agenda-noeffort-is-high
7144 In order to filter for effort estimates, you should set-up allowed
7145 efforts globally, for example
7147 (setq org-global-properties
7148 '(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00")))
7150 You can then filter for an effort by first typing an operator, one of
7151 @kbd{<}, @kbd{>}, and @kbd{=}, and then the one-digit index of an effort
7152 estimate in your array of allowed values, where @kbd{0} means the 10th value.
7153 The filter will then restrict to entries with effort smaller-or-equal, equal,
7154 or larger-or-equal than the selected value. If the digits 0-9 are not used
7155 as fast access keys to tags, you can also simply press the index digit
7156 directly without an operator. In this case, @kbd{<} will be assumed. For
7157 application of the operator, entries without a defined effort will be treated
7158 according to the value of @code{org-sort-agenda-noeffort-is-high}. To filter
7159 for tasks without effort definition, press @kbd{?} as the operator.
7163 Narrow the current agenda filter by an additional condition. When called with
7164 prefix arg, remove the entries that @emph{do} have the tag, or that do match
7165 the effort criterion. You can achieve the same effect by pressing @kbd{+} or
7166 @kbd{-} as the first key after the @kbd{/} command.
7174 @item @r{in} search view
7175 add new search words (@kbd{[} and @kbd{]}) or new regular expressions
7176 (@kbd{@{} and @kbd{@}}) to the query string. The opening bracket/brace will
7177 add a positive search term prefixed by @samp{+}, indicating that this search
7178 term @i{must} occur/match in the entry. The closing bracket/brace will add a
7179 negative search term which @i{must not} occur/match in the entry for it to be
7183 @tsubheading{Remote editing}
7184 @cindex remote editing, from agenda
7189 @cindex undoing remote-editing events
7190 @cindex remote editing, undo
7193 Undo a change due to a remote editing command. The change is undone
7194 both in the agenda buffer and in the remote buffer.
7198 Change the TODO state of the item, both in the agenda and in the
7203 @vindex org-agenda-confirm-kill
7204 Delete the current agenda item along with the entire subtree belonging
7205 to it in the original Org file. If the text to be deleted remotely
7206 is longer than one line, the kill needs to be confirmed by the user. See
7207 variable @code{org-agenda-confirm-kill}.
7211 Refile the entry at point.
7215 Toggle the ARCHIVE tag for the current headline.
7219 Move the subtree corresponding to the current entry to its @emph{archive
7224 Archive the subtree corresponding to the current headline. This means the
7225 entry will be moved to the configured archive location, most likely a
7230 @vindex org-agenda-show-inherited-tags
7231 Show all tags associated with the current item. This is useful if you have
7232 turned off @code{org-agenda-show-inherited-tags}, but still want to see all
7233 tags of a headline occasionally.
7237 Set tags for the current headline. If there is an active region in the
7238 agenda, change a tag for all headings in the region.
7242 Set the priority for the current item. Org mode prompts for the
7243 priority character. If you reply with @key{SPC}, the priority cookie
7244 is removed from the entry.
7248 Display weighted priority of current item.
7254 Increase the priority of the current item. The priority is changed in
7255 the original buffer, but the agenda is not resorted. Use the @kbd{r}
7259 @kindex S-@key{down}
7262 Decrease the priority of the current item.
7266 @vindex org-log-into-drawer
7267 Add a note to the entry. This note will be recorded, and then files to the
7268 same location where state change notes are put. Depending on
7269 @code{org-log-into-drawer}, this maybe inside a drawer.
7273 Dispatcher for all command related to attachments.
7281 Set a deadline for this item.
7285 Agenda actions, to set dates for selected items to the cursor date.
7286 This command also works in the calendar! The command prompts for an
7289 m @r{Mark the entry at point for action. You can also make entries}
7290 @r{in Org files with @kbd{C-c C-x C-k}.}
7291 d @r{Set the deadline of the marked entry to the date at point.}
7292 s @r{Schedule the marked entry at the date at point.}
7293 r @r{Call @code{org-remember} with the cursor date as default date.}
7296 Press @kbd{r} afterward to refresh the agenda and see the effect of the
7299 @kindex S-@key{right}
7301 Change the timestamp associated with the current line by one day into the
7302 future. With a numeric prefix argument, change it by that many days. For
7303 example, @kbd{3 6 5 S-@key{right}} will change it by a year. With a
7304 @kbd{C-u} prefix, change the time by one hour. If you immediately repeat the
7305 command, it will continue to change hours even without the prefix arg. With
7306 a double @kbd{C-u C-u} prefix, do the same for changing minutes. The stamp
7307 is changed in the original Org file, but the change is not directly reflected
7308 in the agenda buffer. Use @kbd{r} or @kbd{g} to update the buffer.
7310 @kindex S-@key{left}
7312 Change the timestamp associated with the current line by one day
7317 Change the timestamp associated with the current line to today.
7318 The key @kbd{>} has been chosen, because it is the same as @kbd{S-.}
7323 Start the clock on the current item. If a clock is running already, it
7328 Stop the previously started clock.
7332 Cancel the currently running clock.
7336 Jump to the running clock in another window.
7338 @tsubheading{Bulk remote editing selected entries}
7339 @cindex remote editing, bulk, from agenda
7343 Mark the entry at point for bulk action.
7347 Unmark entry for bulk action.
7351 Unmark all marked entries for bulk action.
7355 Bulk action: act on all marked entries in the agenda. This will prompt for
7356 another key to select the action to be applied:
7358 r @r{Prompt for a single refile target and move all entries. The entries}
7359 @r{will no longer be in the agenda, refresh (@kbd{g}) to bring them back.}
7360 $ @r{Archive all selected entries.}
7361 A @r{Archive entries by moving them to their respective archive siblings.}
7362 t @r{Change TODO state. This prompts for a single TODO keyword and}
7363 @r{changes the state of all selected entries, bypassing blocking and}
7364 @r{suppressing logging notes (but not time stamps).}
7365 + @r{Add a tag to all selected entries.}
7366 - @r{Remove a tag from all selected entries.}
7367 s @r{Schedule all items to a new date. To shift existing schedule dates}
7368 @r{by a fixed number of days, use something starting with double plus}
7369 @r{at the prompt, for example @samp{++8d} or @samp{++2w}.}
7370 d @r{Set deadline to a specific date.}
7374 @tsubheading{Calendar commands}
7375 @cindex calendar commands, from agenda
7378 Open the Emacs calendar and move to the date at the agenda cursor.
7381 When in the calendar, compute and show the Org mode agenda for the
7384 @cindex diary entries, creating from agenda
7387 Insert a new entry into the diary. Prompts for the type of entry
7388 (day, weekly, monthly, yearly, anniversary, cyclic) and creates a new
7389 entry in the diary, just as @kbd{i d}, etc., would do in the calendar.
7390 The date is taken from the cursor position.
7394 Show the phases of the moon for the three months around current date.
7398 Show sunrise and sunset times. The geographical location must be set
7399 with calendar variables, see the documentation for the Emacs calendar.
7403 Convert the date at cursor into many other cultural and historic
7408 Show holidays for three months around the cursor date.
7410 @item M-x org-export-icalendar-combine-agenda-files
7411 Export a single iCalendar file containing entries from all agenda files.
7412 This is a globally available command, and also available in the agenda menu.
7414 @tsubheading{Exporting to a file}
7417 @cindex exporting agenda views
7418 @cindex agenda views, exporting
7419 @vindex org-agenda-exporter-settings
7420 Write the agenda view to a file. Depending on the extension of the selected
7421 file name, the view will be exported as HTML (extension @file{.html} or
7422 @file{.htm}), Postscript (extension @file{.ps}), PDF (extension @file{.pdf}),
7423 Org-mode (extension @file{.org}), and plain text (any other extension). When
7424 called with a @kbd{C-u} prefix argument, immediately open the newly created
7425 file. Use the variable @code{org-agenda-exporter-settings} to set options
7426 for @file{ps-print} and for @file{htmlize} to be used during export.
7428 @tsubheading{Quit and Exit}
7431 Quit agenda, remove the agenda buffer.
7434 @cindex agenda files, removing buffers
7436 Exit agenda, remove the agenda buffer and all buffers loaded by Emacs
7437 for the compilation of the agenda. Buffers created by the user to
7438 visit Org files will not be removed.
7442 @node Custom agenda views, Exporting Agenda Views, Agenda commands, Agenda Views
7443 @section Custom agenda views
7444 @cindex custom agenda views
7445 @cindex agenda views, custom
7447 Custom agenda commands serve two purposes: to store and quickly access
7448 frequently used TODO and tags searches, and to create special composite
7449 agenda buffers. Custom agenda commands will be accessible through the
7450 dispatcher (@pxref{Agenda dispatcher}), just like the default commands.
7453 * Storing searches:: Type once, use often
7454 * Block agenda:: All the stuff you need in a single buffer
7455 * Setting Options:: Changing the rules
7458 @node Storing searches, Block agenda, Custom agenda views, Custom agenda views
7459 @subsection Storing searches
7461 The first application of custom searches is the definition of keyboard
7462 shortcuts for frequently used searches, either creating an agenda
7463 buffer, or a sparse tree (the latter covering of course only the current
7466 @vindex org-agenda-custom-commands
7467 Custom commands are configured in the variable
7468 @code{org-agenda-custom-commands}. You can customize this variable, for
7469 example by pressing @kbd{C-c a C}. You can also directly set it with
7470 Emacs Lisp in @file{.emacs}. The following example contains all valid
7475 (setq org-agenda-custom-commands
7476 '(("w" todo "WAITING")
7477 ("W" todo-tree "WAITING")
7478 ("u" tags "+boss-urgent")
7479 ("v" tags-todo "+boss-urgent")
7480 ("U" tags-tree "+boss-urgent")
7481 ("f" occur-tree "\\<FIXME\\>")
7482 ("h" . "HOME+Name tags searches") ; description for "h" prefix
7483 ("hl" tags "+home+Lisa")
7484 ("hp" tags "+home+Peter")
7485 ("hk" tags "+home+Kim")))
7490 The initial string in each entry defines the keys you have to press
7491 after the dispatcher command @kbd{C-c a} in order to access the command.
7492 Usually this will be just a single character, but if you have many
7493 similar commands, you can also define two-letter combinations where the
7494 first character is the same in several combinations and serves as a
7495 prefix key@footnote{You can provide a description for a prefix key by
7496 inserting a cons cell with the prefix and the description.}. The second
7497 parameter is the search type, followed by the string or regular
7498 expression to be used for the matching. The example above will
7503 as a global search for TODO entries with @samp{WAITING} as the TODO
7506 as the same search, but only in the current buffer and displaying the
7507 results as a sparse tree
7509 as a global tags search for headlines marked @samp{:boss:} but not
7512 as the same search as @kbd{C-c a u}, but limiting the search to
7513 headlines that are also TODO items
7515 as the same search as @kbd{C-c a u}, but only in the current buffer and
7516 displaying the result as a sparse tree
7518 to create a sparse tree (again: current buffer only) with all entries
7519 containing the word @samp{FIXME}
7521 as a prefix command for a HOME tags search where you have to press an
7522 additional key (@kbd{l}, @kbd{p} or @kbd{k}) to select a name (Lisa,
7523 Peter, or Kim) as additional tag to match.
7526 @node Block agenda, Setting Options, Storing searches, Custom agenda views
7527 @subsection Block agenda
7528 @cindex block agenda
7529 @cindex agenda, with block views
7531 Another possibility is the construction of agenda views that comprise
7532 the results of @emph{several} commands, each of which creates a block in
7533 the agenda buffer. The available commands include @code{agenda} for the
7534 daily or weekly agenda (as created with @kbd{C-c a a}), @code{alltodo}
7535 for the global TODO list (as constructed with @kbd{C-c a t}), and the
7536 matching commands discussed above: @code{todo}, @code{tags}, and
7537 @code{tags-todo}. Here are two examples:
7541 (setq org-agenda-custom-commands
7542 '(("h" "Agenda and Home-related tasks"
7546 ("o" "Agenda and Office-related tasks"
7554 This will define @kbd{C-c a h} to create a multi-block view for stuff
7555 you need to attend to at home. The resulting agenda buffer will contain
7556 your agenda for the current week, all TODO items that carry the tag
7557 @samp{home}, and also all lines tagged with @samp{garden}. Finally the
7558 command @kbd{C-c a o} provides a similar view for office tasks.
7560 @node Setting Options, , Block agenda, Custom agenda views
7561 @subsection Setting options for custom commands
7562 @cindex options, for custom agenda views
7564 @vindex org-agenda-custom-commands
7565 Org mode contains a number of variables regulating agenda construction
7566 and display. The global variables define the behavior for all agenda
7567 commands, including the custom commands. However, if you want to change
7568 some settings just for a single custom view, you can do so. Setting
7569 options requires inserting a list of variable names and values at the
7570 right spot in @code{org-agenda-custom-commands}. For example:
7574 (setq org-agenda-custom-commands
7575 '(("w" todo "WAITING"
7576 ((org-agenda-sorting-strategy '(priority-down))
7577 (org-agenda-prefix-format " Mixed: ")))
7578 ("U" tags-tree "+boss-urgent"
7579 ((org-show-following-heading nil)
7580 (org-show-hierarchy-above nil)))
7582 ((org-agenda-files '("~org/notes.org"))
7583 (org-agenda-text-search-extra-files nil)))))
7588 Now the @kbd{C-c a w} command will sort the collected entries only by
7589 priority, and the prefix format is modified to just say @samp{ Mixed: }
7590 instead of giving the category of the entry. The sparse tags tree of
7591 @kbd{C-c a U} will now turn out ultra-compact, because neither the
7592 headline hierarchy above the match, nor the headline following the match
7593 will be shown. The command @kbd{C-c a N} will do a text search limited
7594 to only a single file.
7596 @vindex org-agenda-custom-commands
7597 For command sets creating a block agenda,
7598 @code{org-agenda-custom-commands} has two separate spots for setting
7599 options. You can add options that should be valid for just a single
7600 command in the set, and options that should be valid for all commands in
7601 the set. The former are just added to the command entry, the latter
7602 must come after the list of command entries. Going back to the block
7603 agenda example (@pxref{Block agenda}), let's change the sorting strategy
7604 for the @kbd{C-c a h} commands to @code{priority-down}, but let's sort
7605 the results for GARDEN tags query in the opposite order,
7606 @code{priority-up}. This would look like this:
7610 (setq org-agenda-custom-commands
7611 '(("h" "Agenda and Home-related tasks"
7615 ((org-agenda-sorting-strategy '(priority-up)))))
7616 ((org-agenda-sorting-strategy '(priority-down))))
7617 ("o" "Agenda and Office-related tasks"
7624 As you see, the values and parentheses setting is a little complex.
7625 When in doubt, use the customize interface to set this variable---it
7626 fully supports its structure. Just one caveat: when setting options in
7627 this interface, the @emph{values} are just Lisp expressions. So if the
7628 value is a string, you need to add the double-quotes around the value
7632 @node Exporting Agenda Views, Agenda column view, Custom agenda views, Agenda Views
7633 @section Exporting Agenda Views
7634 @cindex agenda views, exporting
7636 If you are away from your computer, it can be very useful to have a printed
7637 version of some agenda views to carry around. Org mode can export custom
7638 agenda views as plain text, HTML@footnote{You need to install Hrvoje Niksic's
7639 @file{htmlize.el}.}, Postscript, PDF@footnote{To create PDF output, the
7640 ghostscript @file{ps2pdf} utility must be installed on the system. Selecting
7641 a PDF file with also create the postscript file.}, and iCalendar files. If
7642 you want to do this only occasionally, use the command
7647 @cindex exporting agenda views
7648 @cindex agenda views, exporting
7649 @vindex org-agenda-exporter-settings
7650 Write the agenda view to a file. Depending on the extension of the selected
7651 file name, the view will be exported as HTML (extension @file{.html} or
7652 @file{.htm}), Postscript (extension @file{.ps}), iCalendar (extension
7653 @file{.ics}), Org-mode (extension @file{.org}), or plain text (any other
7654 extension). Use the variable @code{org-agenda-exporter-settings} to set
7655 options for @file{ps-print} and for @file{htmlize} to be used during export,
7658 @vindex org-agenda-add-entry-text-maxlines
7659 @vindex htmlize-output-type
7660 @vindex ps-number-of-columns
7661 @vindex ps-landscape-mode
7663 (setq org-agenda-exporter-settings
7664 '((ps-number-of-columns 2)
7665 (ps-landscape-mode t)
7666 (org-agenda-add-entry-text-maxlines 5)
7667 (htmlize-output-type 'css)))
7671 If you need to export certain agenda views frequently, you can associate
7672 any custom agenda command with a list of output file names
7673 @footnote{If you want to store standard views like the weekly agenda
7674 or the global TODO list as well, you need to define custom commands for
7675 them in order to be able to specify file names.}. Here is an example
7676 that first defines custom commands for the agenda and the global
7677 TODO list, together with a number of files to which to export them.
7678 Then we define two block agenda commands and specify file names for them
7679 as well. File names can be relative to the current working directory,
7684 (setq org-agenda-custom-commands
7685 '(("X" agenda "" nil ("agenda.html" "agenda.ps"))
7686 ("Y" alltodo "" nil ("todo.html" "todo.txt" "todo.ps"))
7687 ("h" "Agenda and Home-related tasks"
7692 ("~/views/home.html"))
7693 ("o" "Agenda and Office-related tasks"
7698 ("~/views/office.ps" "~/calendars/office.ics"))))
7702 The extension of the file name determines the type of export. If it is
7703 @file{.html}, Org mode will use the @file{htmlize.el} package to convert
7704 the buffer to HTML and save it to this file name. If the extension is
7705 @file{.ps}, @code{ps-print-buffer-with-faces} is used to produce
7706 Postscript output. If the extension is @file{.ics}, iCalendar export is
7707 run export over all files that were used to construct the agenda, and
7708 limit the export to entries listed in the agenda. Any other
7709 extension produces a plain ASCII file.
7711 The export files are @emph{not} created when you use one of those
7712 commands interactively because this might use too much overhead.
7713 Instead, there is a special command to produce @emph{all} specified
7719 Export all agenda views that have export file names associated with
7723 You can use the options section of the custom agenda commands to also
7724 set options for the export commands. For example:
7727 (setq org-agenda-custom-commands
7729 ((ps-number-of-columns 2)
7730 (ps-landscape-mode t)
7731 (org-agenda-prefix-format " [ ] ")
7732 (org-agenda-with-colors nil)
7733 (org-agenda-remove-tags t))
7738 This command sets two options for the Postscript exporter, to make it
7739 print in two columns in landscape format---the resulting page can be cut
7740 in two and then used in a paper agenda. The remaining settings modify
7741 the agenda prefix to omit category and scheduling information, and
7742 instead include a checkbox to check off items. We also remove the tags
7743 to make the lines compact, and we don't want to use colors for the
7744 black-and-white printer. Settings specified in
7745 @code{org-agenda-exporter-settings} will also apply, but the settings
7746 in @code{org-agenda-custom-commands} take precedence.
7749 From the command line you may also use
7751 emacs -f org-batch-store-agenda-views -kill
7754 or, if you need to modify some parameters@footnote{Quoting depends on the
7755 system you use, please check the FAQ for examples.}
7757 emacs -eval '(org-batch-store-agenda-views \
7758 org-agenda-ndays 30 \
7759 org-agenda-start-day "2007-11-01" \
7760 org-agenda-include-diary nil \
7761 org-agenda-files (quote ("~/org/project.org")))' \
7765 which will create the agenda views restricted to the file
7766 @file{~/org/project.org}, without diary entries and with a 30-day
7769 You can also extract agenda information in a way that allows further
7770 processing by other programs. See @ref{Extracting agenda information}, for
7774 @node Agenda column view, , Exporting Agenda Views, Agenda Views
7775 @section Using column view in the agenda
7776 @cindex column view, in agenda
7777 @cindex agenda, column view
7779 Column view (@pxref{Column view}) is normally used to view and edit
7780 properties embedded in the hierarchical structure of an Org file. It can be
7781 quite useful to use column view also from the agenda, where entries are
7782 collected by certain criteria.
7787 Turn on column view in the agenda.
7790 To understand how to use this properly, it is important to realize that the
7791 entries in the agenda are no longer in their proper outline environment.
7792 This causes the following issues:
7796 @vindex org-columns-default-format
7797 @vindex org-overriding-columns-format
7798 Org needs to make a decision which @code{COLUMNS} format to use. Since the
7799 entries in the agenda are collected from different files, and different files
7800 may have different @code{COLUMNS} formats, this is a non-trivial problem.
7801 Org first checks if the variable @code{org-overriding-columns-format} is
7802 currently set, and if so, takes the format from there. Otherwise it takes
7803 the format associated with the first item in the agenda, or, if that item
7804 does not have a specific format (defined in a property, or in its file), it
7805 uses @code{org-columns-default-format}.
7807 @cindex property, special, CLOCKSUM
7808 If any of the columns has a summary type defined (@pxref{Column attributes}),
7809 turning on column view in the agenda will visit all relevant agenda files and
7810 make sure that the computations of this property are up to date. This is
7811 also true for the special @code{CLOCKSUM} property. Org will then sum the
7812 values displayed in the agenda. In the daily/weekly agenda, the sums will
7813 cover a single day, in all other views they cover the entire block. It is
7814 vital to realize that the agenda may show the same entry @emph{twice} (for
7815 example as scheduled and as a deadline), and it may show two entries from the
7816 same hierarchy (for example a @emph{parent} and its @emph{child}). In these
7817 cases, the summation in the agenda will lead to incorrect results because
7818 some values will count double.
7820 When the column view in the agenda shows the @code{CLOCKSUM}, that is always
7821 the entire clocked time for this item. So even in the daily/weekly agenda,
7822 the clocksum listed in column view may originate from times outside the
7823 current view. This has the advantage that you can compare these values with
7824 a column listing the planned total effort for a task---one of the major
7825 applications for column view in the agenda. If you want information about
7826 clocked time in the displayed period use clock table mode (press @kbd{R} in
7831 @node Markup, Exporting, Agenda Views, Top
7832 @chapter Markup for rich export
7834 When exporting Org-mode documents, the exporter tries to reflect the
7835 structure of the document as accurately as possible in the backend. Since
7836 export targets like HTML, La@TeX{}, or DocBook allow much richer formatting,
7837 Org mode has rules on how to prepare text for rich export. This section
7838 summarizes the markup rules used in an Org-mode buffer.
7841 * Structural markup elements:: The basic structure as seen by the exporter
7842 * Images and tables:: Tables and Images will be included
7843 * Literal examples:: Source code examples with special formatting
7844 * Include files:: Include additional files into a document
7845 * Macro replacement:: Use macros to create complex output
7846 * Embedded LaTeX:: LaTeX can be freely used inside Org documents
7849 @node Structural markup elements, Images and tables, Markup, Markup
7850 @section Structural markup elements
7853 * Document title:: Where the title is taken from
7854 * Headings and sections:: The document structure as seen by the exporter
7855 * Table of contents:: The if and where of the table of contents
7856 * Initial text:: Text before the first heading?
7858 * Paragraphs:: Paragraphs
7859 * Footnote markup:: Footnotes
7860 * Emphasis and monospace:: Bold, italic, etc.
7861 * Horizontal rules:: Make a line
7862 * Comment lines:: What will *not* be exported
7865 @node Document title, Headings and sections, Structural markup elements, Structural markup elements
7866 @subheading Document title
7867 @cindex document title, markup rules
7870 The title of the exported document is taken from the special line
7874 #+TITLE: This is the title of the document
7878 If this line does not exist, the title is derived from the first non-empty,
7879 non-comment line in the buffer. If no such line exists, or if you have
7880 turned off exporting of the text before the first headline (see below), the
7881 title will be the file name without extension.
7883 @cindex property, EXPORT_TITLE
7884 If you are exporting only a subtree by marking is as the region, the heading
7885 of the subtree will become the title of the document. If the subtree has a
7886 property @code{EXPORT_TITLE}, that will take precedence.
7888 @node Headings and sections, Table of contents, Document title, Structural markup elements
7889 @subheading Headings and sections
7890 @cindex headings and sections, markup rules
7892 @vindex org-export-headline-levels
7893 The outline structure of the document as described in @ref{Document
7894 Structure}, forms the basis for defining sections of the exported document.
7895 However, since the outline structure is also used for (for example) lists of
7896 tasks, only the first three outline levels will be used as headings. Deeper
7897 levels will become itemized lists. You can change the location of this
7898 switch globally by setting the variable @code{org-export-headline-levels}, or on a
7899 per-file basis with a line
7906 @node Table of contents, Initial text, Headings and sections, Structural markup elements
7907 @subheading Table of contents
7908 @cindex table of contents, markup rules
7910 @vindex org-export-with-toc
7911 The table of contents is normally inserted directly before the first headline
7912 of the file. If you would like to get it to a different location, insert the
7913 string @code{[TABLE-OF-CONTENTS]} on a line by itself at the desired
7914 location. The depth of the table of contents is by default the same as the
7915 number of headline levels, but you can choose a smaller number, or turn off
7916 the table of contents entirely, by configuring the variable
7917 @code{org-export-with-toc}, or on a per-file basis with a line like
7920 #+OPTIONS: toc:2 (only to two levels in TOC)
7921 #+OPTIONS: toc:nil (no TOC at all)
7924 @node Initial text, Lists, Table of contents, Structural markup elements
7925 @subheading Text before the first headline
7926 @cindex text before first headline, markup rules
7929 Org mode normally exports the text before the first headline, and even uses
7930 the first line as the document title. The text will be fully marked up. If
7931 you need to include literal HTML, La@TeX{}, or DocBook code, use the special
7932 constructs described below in the sections for the individual exporters.
7934 @vindex org-export-skip-text-before-1st-heading
7935 Some people like to use the space before the first headline for setup and
7936 internal links and therefore would like to control the exported text before
7937 the first headline in a different way. You can do so by setting the variable
7938 @code{org-export-skip-text-before-1st-heading} to @code{t}. On a per-file
7939 basis, you can get the same effect with @samp{#+OPTIONS: skip:t}.
7942 If you still want to have some text before the first headline, use the
7943 @code{#+TEXT} construct:
7947 #+TEXT: This text will go before the *first* headline.
7948 #+TEXT: [TABLE-OF-CONTENTS]
7949 #+TEXT: This goes between the table of contents and the first headline
7952 @node Lists, Paragraphs, Initial text, Structural markup elements
7954 @cindex lists, markup rules
7956 Plain lists as described in @ref{Plain lists}, are translated to the backend's
7957 syntax for such lists. Most backends support unordered, ordered, and
7960 @node Paragraphs, Footnote markup, Lists, Structural markup elements
7961 @subheading Paragraphs, line breaks, and quoting
7962 @cindex paragraphs, markup rules
7964 Paragraphs are separated by at least one empty line. If you need to enforce
7965 a line break within a paragraph, use @samp{\\} at the end of a line.
7967 To keep the line breaks in a region, but otherwise use normal formatting, you
7968 can use this construct, which can also be used to format poetry.
7970 @cindex #+BEGIN_VERSE
7973 Great clouds overhead
7974 Tiny black birds rise and fall
7981 When quoting a passage from another document, it is customary to format this
7982 as a paragraph that is indented on both the left and the right margin. You
7983 can include quotations in Org-mode documents like this:
7985 @cindex #+BEGIN_QUOTE
7988 Everything should be made as simple as possible,
7989 but not any simpler -- Albert Einstein
7993 If you would like to center some text, do it like this:
7994 @cindex #+BEGIN_CENTER
7997 Everything should be made as simple as possible, \\
8003 @node Footnote markup, Emphasis and monospace, Paragraphs, Structural markup elements
8004 @subheading Footnote markup
8005 @cindex footnotes, markup rules
8006 @cindex @file{footnote.el}
8008 Footnotes defined in the way described in @ref{Footnotes}, will be exported by
8009 all backends. Org allows multiple references to the same note, and
8010 different backends support this to varying degrees.
8012 @node Emphasis and monospace, Horizontal rules, Footnote markup, Structural markup elements
8013 @subheading Emphasis and monospace
8015 @cindex underlined text, markup rules
8016 @cindex bold text, markup rules
8017 @cindex italic text, markup rules
8018 @cindex verbatim text, markup rules
8019 @cindex code text, markup rules
8020 @cindex strike-through text, markup rules
8021 You can make words @b{*bold*}, @i{/italic/}, _underlined_, @code{=code=}
8022 and @code{~verbatim~}, and, if you must, @samp{+strike-through+}. Text
8023 in the code and verbatim string is not processed for Org-mode specific
8024 syntax, it is exported verbatim.
8026 @node Horizontal rules, Comment lines, Emphasis and monospace, Structural markup elements
8027 @subheading Horizontal rules
8028 @cindex horizontal rules, markup rules
8029 A line consisting of only dashes, and at least 5 of them, will be
8030 exported as a horizontal line (@samp{<hr/>} in HTML).
8032 @node Comment lines, , Horizontal rules, Structural markup elements
8033 @subheading Comment lines
8034 @cindex comment lines
8035 @cindex exporting, not
8036 @cindex #+BEGIN_COMMENT
8038 Lines starting with @samp{#} in column zero are treated as comments and will
8039 never be exported. If you want an indented line to be treated as a comment,
8040 start it with @samp{#+ }. Also entire subtrees starting with the word
8041 @samp{COMMENT} will never be exported. Finally, regions surrounded by
8042 @samp{#+BEGIN_COMMENT} ... @samp{#+END_COMMENT} will not be exported.
8047 Toggle the COMMENT keyword at the beginning of an entry.
8051 @node Images and tables, Literal examples, Structural markup elements, Markup
8052 @section Images and Tables
8054 @cindex tables, markup rules
8057 Both the native Org mode tables (@pxref{Tables}) and tables formatted with
8058 the @file{table.el} package will be exported properly. For Org mode tables,
8059 the lines before the first horizontal separator line will become table header
8060 lines. You can use the following lines somewhere before the table to assign
8061 a caption and a label for cross references:
8064 #+CAPTION: This is the caption for the next table (or link)
8065 #+LABEL: tbl:basic-data
8070 @cindex inlined images, markup rules
8071 Some backends (HTML, La@TeX{}, and DocBook) allow you to directly include
8072 images into the exported document. Org does this, if a link to an image
8073 files does not have a description part, for example @code{[[./img/a.jpg]]}.
8074 If you wish to define a caption for the image and maybe a label for internal
8075 cross references, you sure that the link is on a line by itself precede it
8079 #+CAPTION: This is the caption for the next figure link (or table)
8080 #+LABEL: fig:SED-HR4049
8084 You may also define additional attributes for the figure. As this is
8085 backend-specific, see the sections about the individual backends for more
8089 @node Literal examples, Include files, Images and tables, Markup
8090 @section Literal examples
8091 @cindex literal examples, markup rules
8092 @cindex code line references, markup rules
8094 You can include literal examples that should not be subjected to
8095 markup. Such examples will be typeset in monospace, so this is well suited
8096 for source code and similar examples.
8097 @cindex #+BEGIN_EXAMPLE
8101 Some example from a text file.
8105 Note that such blocks may be @i{indented} in order to align nicely with
8106 indented text and in particular with plain list structure (@pxref{Plain
8107 lists}). For simplicity when using small examples, you can also start the
8108 example lines with a colon followed by a space. There may also be additional
8109 whitespace before the colon:
8113 : Some example from a text file.
8116 @cindex formatting source code, markup rules
8117 If the example is source code from a programming language, or any other text
8118 that can be marked up by font-lock in Emacs, you can ask for the example to
8119 look like the fontified Emacs buffer@footnote{Currently this works for the
8120 HTML backend, and requires the @file{htmlize.el} package version 1.34 or
8121 later. It also works for LaTeX with the listings package, if you turn on the
8122 option @code{org-export-latex-listings} and make sure that the listings
8123 package is included by the LaTeX header.}. This is done with the @samp{src}
8124 block, where you also need to specify the name of the major mode that should
8125 be used to fontify the example:
8129 #+BEGIN_SRC emacs-lisp
8130 (defun org-xor (a b)
8136 Both in @code{example} and in @code{src} snippets, you can add a @code{-n}
8137 switch to the end of the @code{BEGIN} line, to get the lines of the example
8138 numbered. If you use a @code{+n} switch, the numbering from the previous
8139 numbered snippet will be continued in the current one. In literal examples,
8140 Org will interpret strings like @samp{(ref:name)} as labels, and use them as
8141 targets for special hyperlinks like @code{[[(name)]]} (i.e. the reference name
8142 enclosed in single parenthesis). In HTML, hovering the mouse over such a
8143 link will remote-highlight the corresponding code line, which is kind of
8146 You can also add a @code{-r} switch which @i{removes} the labels from the
8147 source code@footnote{Adding @code{-k} to @code{-n -r} will @i{keep} the
8148 labels in the source code while using line numbers for the links, which might
8149 be useful to explain those in an org-mode example code.}. With the @code{-n}
8150 switch, links to these references will be labeled by the line numbers from
8151 the code listing, otherwise links will use the labels with no parentheses.
8155 #+BEGIN_SRC emacs-lisp -n -r
8156 (save-excursion (ref:sc)
8157 (goto-char (point-min)) (ref:jump)
8159 In line [[(sc)]] we remember the current position. [[(jump)][Line (jump)]]
8163 @vindex org-coderef-label-format
8164 If the syntax for the label format conflicts with the language syntax, use a
8165 @code{-l} switch to change the format, for example @samp{#+BEGIN_SRC pascal
8166 -n -r -l "((%s))"}. See also the variable @code{org-coderef-label-format}.
8168 HTML export also allows examples to be published as text areas, @xref{Text
8169 areas in HTML export}.
8174 Edit the source code example at point in its native mode. This works by
8175 switching to a temporary buffer with the source code. You need to exit by
8176 pressing @kbd{C-c '} again@footnote{Upon exit, lines starting with @samp{*}
8177 or @samp{#} will get a comma prepended, to keep them from being interpreted
8178 by Org as outline nodes or special comments. These commas will be striped
8179 for editing with @kbd{C-c '}, and also for export.}, the edited version will
8180 then replace the old version in the Org buffer. Fixed-width regions
8181 (where each line starts with a colon followed by a space) will be edited
8182 using @code{artist-mode}@footnote{You may select a different-mode with the
8183 variable @code{org-edit-fixed-width-region-mode}.} to allow creating ASCII
8184 drawings easily. Using this command in an empty line will create a new
8188 Calling @code{org-store-link} while editing a source code example in a
8189 temporary buffer created with @kbd{C-c '} will prompt for a label, make sure
8190 that it is unique in the current buffer, and insert it with the proper
8191 formatting like @samp{(ref:label)} at the end of the current line. Then the
8192 label is stored as a link @samp{(label)}, for retrieval with @kbd{C-c C-l}.
8196 @node Include files, Macro replacement, Literal examples, Markup
8197 @section Include files
8198 @cindex include files, markup rules
8200 During export, you can include the content of another file. For example, to
8201 include your @file{.emacs} file, you could use:
8205 #+INCLUDE: "~/.emacs" src emacs-lisp
8208 The optional second and third parameter are the markup (e.g. @samp{quote},
8209 @samp{example}, or @samp{src}), and, if the markup is @samp{src}, the
8210 language for formatting the contents. The markup is optional, if it is not
8211 given, the text will be assumed to be in Org mode format and will be
8212 processed normally. The include line will also allow additional keyword
8213 parameters @code{:prefix1} and @code{:prefix} to specify prefixes for the
8214 first line and for each following line, as well as any options accepted by
8215 the selected markup. For example, to include a file as an item, use
8218 #+INCLUDE: "~/snippets/xx" :prefix1 " + " :prefix " "
8224 Visit the include file at point.
8228 @node Macro replacement, Embedded LaTeX, Include files, Markup
8229 @section Macro replacement
8230 @cindex macro replacement, during export
8233 You can define text snippets with
8236 #+MACRO: name replacement text $1, $2 are arguments
8239 @noindent which can be referenced anywhere in the document (even in
8240 code examples) with @code{@{@{@{name(arg1,arg2)@}@}@}}. In addition to
8241 defined macros, @code{@{@{@{title@}@}@}}, @code{@{@{@{author@}@}@}}, etc.,
8242 will reference information set by the @code{#+TITLE:}, @code{#+AUTHOR:}, and
8243 similar lines. Also, @code{@{@{@{date(@var{FORMAT})@}@}@}} and
8244 @code{@{@{@{modification-time(@var{FORMAT})@}@}@}} refer to current date time
8245 and to the modification time of the file being exported, respectively.
8246 @var{FORMAT} should be a format string understood by
8247 @code{format-time-string}.
8249 Macro expansion takes place during export, and some people use it to
8250 construct complex HTML code.
8253 @node Embedded LaTeX, , Macro replacement, Markup
8254 @section Embedded La@TeX{}
8255 @cindex @TeX{} interpretation
8256 @cindex La@TeX{} interpretation
8258 Plain ASCII is normally sufficient for almost all note taking. One
8259 exception, however, are scientific notes which need to be able to contain
8260 mathematical symbols and the occasional formula. La@TeX{}@footnote{La@TeX{}
8261 is a macro system based on Donald E. Knuth's @TeX{} system. Many of the
8262 features described here as ``La@TeX{}'' are really from @TeX{}, but for
8263 simplicity I am blurring this distinction.} is widely used to typeset
8264 scientific documents. Org mode supports embedding La@TeX{} code into its
8265 files, because many academics are used to reading La@TeX{} source code, and
8266 because it can be readily processed into images for HTML production.
8268 It is not necessary to mark La@TeX{} macros and code in any special way.
8269 If you observe a few conventions, Org mode knows how to find it and what
8273 * Special symbols:: Greek letters and other symbols
8274 * Subscripts and superscripts:: Simple syntax for raising/lowering text
8275 * LaTeX fragments:: Complex formulas made easy
8276 * Previewing LaTeX fragments:: What will this snippet look like?
8277 * CDLaTeX mode:: Speed up entering of formulas
8280 @node Special symbols, Subscripts and superscripts, Embedded LaTeX, Embedded LaTeX
8281 @subsection Special symbols
8282 @cindex math symbols
8283 @cindex special symbols
8284 @cindex @TeX{} macros
8285 @cindex La@TeX{} fragments, markup rules
8286 @cindex HTML entities
8287 @cindex La@TeX{} entities
8289 You can use La@TeX{} macros to insert special symbols like @samp{\alpha} to
8290 indicate the Greek letter, or @samp{\to} to indicate an arrow. Completion
8291 for these macros is available, just type @samp{\} and maybe a few letters,
8292 and press @kbd{M-@key{TAB}} to see possible completions. Unlike La@TeX{}
8293 code, Org mode allows these macros to be present without surrounding math
8294 delimiters, for example:
8297 Angles are written as Greek letters \alpha, \beta and \gamma.
8300 @vindex org-html-entities
8301 During export, these symbols will be transformed into the native format of
8302 the exporter backend. Strings like @code{\alpha} will be exported as
8303 @code{α} in the HTML output, and as @code{$\alpha$} in the La@TeX{}
8304 output. Similarly, @code{\nbsp} will become @code{ } in HTML and
8305 @code{~} in La@TeX{}. If you need such a symbol inside a word, terminate it
8306 like this: @samp{\Aacute@{@}stor}.
8308 A large number of entities is provided, with names taken from both HTML and
8309 La@TeX{}, see the variable @code{org-html-entities} for the complete list.
8310 @samp{\-} is treated as a shy hyphen, and @samp{--}, @samp{---}, and
8311 @samp{...} are all converted into special commands creating hyphens of
8312 different lengths or a compact set of dots.
8314 @node Subscripts and superscripts, LaTeX fragments, Special symbols, Embedded LaTeX
8315 @subsection Subscripts and superscripts
8319 Just like in La@TeX{}, @samp{^} and @samp{_} are used to indicate super-
8320 and subscripts. Again, these can be used without embedding them in
8321 math-mode delimiters. To increase the readability of ASCII text, it is
8322 not necessary (but OK) to surround multi-character sub- and superscripts
8323 with curly braces. For example
8326 The mass if the sun is M_sun = 1.989 x 10^30 kg. The radius of
8327 the sun is R_@{sun@} = 6.96 x 10^8 m.
8330 @vindex org-export-with-sub-superscripts
8331 To avoid interpretation as raised or lowered text, you can quote @samp{^} and
8332 @samp{_} with a backslash: @samp{\^} and @samp{\_}. If you write a text
8333 where the underscore is often used in a different context, Org's convention
8334 to always interpret these as subscripts can get in your way. Configure the
8335 variable @code{org-export-with-sub-superscripts} to globally change this
8336 convention, or use, on a per-file basis:
8343 @node LaTeX fragments, Previewing LaTeX fragments, Subscripts and superscripts, Embedded LaTeX
8344 @subsection La@TeX{} fragments
8345 @cindex La@TeX{} fragments
8347 @vindex org-format-latex-header
8348 With symbols, sub- and superscripts, HTML is pretty much at its end when
8349 it comes to representing mathematical formulas@footnote{Yes, there is
8350 MathML, but that is not yet fully supported by many browsers, and there
8351 is no decent converter for turning La@TeX{} or ASCII representations of
8352 formulas into MathML. So for the time being, converting formulas into
8353 images seems the way to go.}. More complex expressions need a dedicated
8354 formula processor. To this end, Org mode can contain arbitrary La@TeX{}
8355 fragments. It provides commands to preview the typeset result of these
8356 fragments, and upon export to HTML, all fragments will be converted to
8357 images and inlined into the HTML document@footnote{The La@TeX{} export
8358 will not use images for displaying La@TeX{} fragments but include these
8359 fragments directly into the La@TeX{} code.}. For this to work you
8360 need to be on a system with a working La@TeX{} installation. You also
8361 need the @file{dvipng} program, available at
8362 @url{http://sourceforge.net/projects/dvipng/}. The La@TeX{} header that
8363 will be used when processing a fragment can be configured with the
8364 variable @code{org-format-latex-header}.
8366 La@TeX{} fragments don't need any special marking at all. The following
8367 snippets will be identified as La@TeX{} source code:
8370 Environments of any kind. The only requirement is that the
8371 @code{\begin} statement appears on a new line, preceded by only
8374 Text within the usual La@TeX{} math delimiters. To avoid conflicts with
8375 currency specifications, single @samp{$} characters are only recognized as
8376 math delimiters if the enclosed text contains at most two line breaks, is
8377 directly attached to the @samp{$} characters with no whitespace in between,
8378 and if the closing @samp{$} is followed by whitespace, punctuation or a dash.
8379 For the other delimiters, there is no such restriction, so when in doubt, use
8380 @samp{\(...\)} as inline math delimiters.
8383 @noindent For example:
8386 \begin@{equation@} % arbitrary environments,
8387 x=\sqrt@{b@} % even tables, figures
8388 \end@{equation@} % etc
8390 If $a^2=b$ and \( b=2 \), then the solution must be
8391 either $$ a=+\sqrt@{2@} $$ or \[ a=-\sqrt@{2@} \].
8395 @vindex org-format-latex-options
8396 If you need any of the delimiter ASCII sequences for other purposes, you
8397 can configure the option @code{org-format-latex-options} to deselect the
8398 ones you do not wish to have interpreted by the La@TeX{} converter.
8400 @node Previewing LaTeX fragments, CDLaTeX mode, LaTeX fragments, Embedded LaTeX
8401 @subsection Previewing LaTeX fragments
8402 @cindex LaTeX fragments, preview
8404 La@TeX{} fragments can be processed to produce preview images of the
8405 typeset expressions:
8410 Produce a preview image of the La@TeX{} fragment at point and overlay it
8411 over the source code. If there is no fragment at point, process all
8412 fragments in the current entry (between two headlines). When called
8413 with a prefix argument, process the entire subtree. When called with
8414 two prefix arguments, or when the cursor is before the first headline,
8415 process the entire buffer.
8418 Remove the overlay preview images.
8421 @vindex org-format-latex-options
8422 You can customize the variable @code{org-format-latex-options} to influence
8423 some aspects of the preview. In particular, the @code{:scale} (and for HTML
8424 export, @code{:html-scale}) property can be used to adjust the size of the
8427 During HTML export (@pxref{HTML export}), all La@TeX{} fragments are
8428 converted into images and inlined into the document if the following
8432 (setq org-export-with-LaTeX-fragments t)
8435 @node CDLaTeX mode, , Previewing LaTeX fragments, Embedded LaTeX
8436 @subsection Using CDLa@TeX{} to enter math
8439 CDLa@TeX{} mode is a minor mode that is normally used in combination with a
8440 major La@TeX{} mode like AUC@TeX{} in order to speed-up insertion of
8441 environments and math templates. Inside Org mode, you can make use of
8442 some of the features of CDLa@TeX{} mode. You need to install
8443 @file{cdlatex.el} and @file{texmathp.el} (the latter comes also with
8444 AUC@TeX{}) from @url{http://www.astro.uva.nl/~dominik/Tools/cdlatex}.
8445 Don't use CDLa@TeX{} mode itself under Org mode, but use the light
8446 version @code{org-cdlatex-mode} that comes as part of Org mode. Turn it
8447 on for the current buffer with @code{M-x org-cdlatex-mode}, or for all
8451 (add-hook 'org-mode-hook 'turn-on-org-cdlatex)
8454 When this mode is enabled, the following features are present (for more
8455 details see the documentation of CDLa@TeX{} mode):
8459 Environment templates can be inserted with @kbd{C-c @{}.
8462 The @key{TAB} key will do template expansion if the cursor is inside a
8463 La@TeX{} fragment@footnote{Org mode has a method to test if the cursor is
8464 inside such a fragment, see the documentation of the function
8465 @code{org-inside-LaTeX-fragment-p}.}. For example, @key{TAB} will
8466 expand @code{fr} to @code{\frac@{@}@{@}} and position the cursor
8467 correctly inside the first brace. Another @key{TAB} will get you into
8468 the second brace. Even outside fragments, @key{TAB} will expand
8469 environment abbreviations at the beginning of a line. For example, if
8470 you write @samp{equ} at the beginning of a line and press @key{TAB},
8471 this abbreviation will be expanded to an @code{equation} environment.
8472 To get a list of all abbreviations, type @kbd{M-x cdlatex-command-help}.
8476 @vindex cdlatex-simplify-sub-super-scripts
8477 Pressing @kbd{_} and @kbd{^} inside a La@TeX{} fragment will insert these
8478 characters together with a pair of braces. If you use @key{TAB} to move
8479 out of the braces, and if the braces surround only a single character or
8480 macro, they are removed again (depending on the variable
8481 @code{cdlatex-simplify-sub-super-scripts}).
8484 Pressing the backquote @kbd{`} followed by a character inserts math
8485 macros, also outside La@TeX{} fragments. If you wait more than 1.5 seconds
8486 after the backquote, a help window will pop up.
8489 Pressing the single-quote @kbd{'} followed by another character modifies
8490 the symbol before point with an accent or a font. If you wait more than
8491 1.5 seconds after the backquote, a help window will pop up. Character
8492 modification will work only inside La@TeX{} fragments, outside the quote
8496 @node Exporting, Publishing, Markup, Top
8500 Org-mode documents can be exported into a variety of other formats. For
8501 printing and sharing of notes, ASCII export produces a readable and simple
8502 version of an Org file. HTML export allows you to publish a notes file on
8503 the web, while the XOXO format provides a solid base for exchange with a
8504 broad range of other applications. La@TeX{} export lets you use Org mode and
8505 its structured editing functions to easily create La@TeX{} files. DocBook
8506 export makes it possible to convert Org files to many other formats using
8507 DocBook tools. To incorporate entries with associated times like deadlines
8508 or appointments into a desktop calendar program like iCal, Org mode can also
8509 produce extracts in the iCalendar format. Currently Org mode only supports
8510 export, not import of these different formats.
8512 Org supports export of selected regions when @code{transient-mark-mode} is
8513 enabled (default in Emacs 23).
8516 * Selective export:: Using tags to select and exclude trees
8517 * Export options:: Per-file export settings
8518 * The export dispatcher:: How to access exporter commands
8519 * ASCII export:: Exporting to plain ASCII
8520 * HTML export:: Exporting to HTML
8521 * LaTeX and PDF export:: Exporting to La@TeX{}, and processing to PDF
8522 * DocBook export:: Exporting to DocBook
8523 * XOXO export:: Exporting to XOXO
8524 * iCalendar export:: Exporting in iCalendar format
8527 @node Selective export, Export options, Exporting, Exporting
8528 @section Selective export
8529 @cindex export, selective by tags
8531 @vindex org-export-select-tags
8532 @vindex org-export-exclude-tags
8533 You may use tags to select the parts of a document that should be exported,
8534 or to exclude parts from export. This behavior is governed by two variables:
8535 @code{org-export-select-tags} and @code{org-export-exclude-tags}.
8537 Org first checks if any of the @emph{select} tags is present in the buffer.
8538 If yes, all trees that do not carry one of these tags will be excluded. If a
8539 selected tree is a subtree, the heading hierarchy above it will also be
8540 selected for export, but not the text below those headings.
8543 If none of the select tags is found, the whole buffer will be selected for
8547 Finally, all subtrees that are marked by any of the @emph{exclude} tags will
8548 be removed from the export buffer.
8550 @node Export options, The export dispatcher, Selective export, Exporting
8551 @section Export options
8552 @cindex options, for export
8554 @cindex completion, of option keywords
8555 The exporter recognizes special lines in the buffer which provide
8556 additional information. These lines may be put anywhere in the file.
8557 The whole set of lines can be inserted into the buffer with @kbd{C-c
8558 C-e t}. For individual lines, a good way to make sure the keyword is
8559 correct is to type @samp{#+} and then use @kbd{M-@key{TAB}} completion
8560 (@pxref{Completion}). For a summary of other in-buffer settings not
8561 specifically related to export, see @ref{In-buffer settings}.
8562 In particular, note that you can place commonly-used (export) options in
8563 a separate file which can be included using @code{#+SETUPFILE}.
8568 Insert template with export options, see example below.
8575 @cindex #+DESCRIPTION
8583 @cindex #+EXPORT_SELECT_TAGS
8584 @cindex #+EXPORT_EXCLUDE_TAGS
8585 @cindex #+LATEX_HEADER
8586 @vindex user-full-name
8587 @vindex user-mail-address
8588 @vindex org-export-default-language
8590 #+TITLE: the title to be shown (default is the buffer name)
8591 #+AUTHOR: the author (default taken from @code{user-full-name})
8592 #+DATE: a date, fixed, of a format string for @code{format-time-string}
8593 #+EMAIL: his/her email address (default from @code{user-mail-address})
8594 #+DESCRIPTION: the page description, e.g. for the XHTML meta tag
8595 #+KEYWORDS: the page keywords, e.g. for the XHTML meta tag
8596 #+LANGUAGE: language for HTML, e.g. @samp{en} (@code{org-export-default-language})
8597 #+TEXT: Some descriptive text to be inserted at the beginning.
8598 #+TEXT: Several lines may be given.
8599 #+OPTIONS: H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t f:t TeX:t ...
8600 #+BIND: lisp-var lisp-val, e.g.: org-export-latex-low-levels itemize
8601 @r{You need to confirm using these, or configure @code{org-export-allow-BIND}}
8602 #+LINK_UP: the ``up'' link of an exported page
8603 #+LINK_HOME: the ``home'' link of an exported page
8604 #+LATEX_HEADER: extra line(s) for the LaTeX header, like \usepackage@{xyz@}
8605 #+EXPORT_SELECT_TAGS: Tags that select a tree for export
8606 #+EXPORT_EXCLUDE_TAGS: Tags that exclude a tree from export
8610 The OPTIONS line is a compact@footnote{If you want to configure many options
8611 this way, you can use several OPTIONS lines.} form to specify export settings. Here
8613 @cindex headline levels
8614 @cindex section-numbers
8615 @cindex table of contents
8616 @cindex line-break preservation
8617 @cindex quoted HTML tags
8618 @cindex fixed-width sections
8620 @cindex @TeX{}-like syntax for sub- and superscripts
8622 @cindex special strings
8623 @cindex emphasized text
8624 @cindex @TeX{} macros
8625 @cindex La@TeX{} fragments
8626 @cindex author info, in export
8627 @cindex time info, in export
8629 H: @r{set the number of headline levels for export}
8630 num: @r{turn on/off section-numbers}
8631 toc: @r{turn on/off table of contents, or set level limit (integer)}
8632 \n: @r{turn on/off line-break-preservation}
8633 @@: @r{turn on/off quoted HTML tags}
8634 :: @r{turn on/off fixed-width sections}
8635 |: @r{turn on/off tables}
8636 ^: @r{turn on/off @TeX{}-like syntax for sub- and superscripts. If}
8637 @r{you write "^:@{@}", @code{a_@{b@}} will be interpreted, but}
8638 @r{the simple @code{a_b} will be left as it is.}
8639 -: @r{turn on/off conversion of special strings.}
8640 f: @r{turn on/off footnotes like this[1].}
8641 todo: @r{turn on/off inclusion of TODO keywords into exported text}
8642 pri: @r{turn on/off priority cookies}
8643 tags: @r{turn on/off inclusion of tags, may also be @code{not-in-toc}}
8644 <: @r{turn on/off inclusion of any time/date stamps like DEADLINES}
8645 *: @r{turn on/off emphasized text (bold, italic, underlined)}
8646 TeX: @r{turn on/off simple @TeX{} macros in plain text}
8647 LaTeX: @r{turn on/off La@TeX{} fragments}
8648 skip: @r{turn on/off skipping the text before the first heading}
8649 author: @r{turn on/off inclusion of author name/email into exported file}
8650 creator: @r{turn on/off inclusion of creator info into exported file}
8651 timestamp: @r{turn on/off inclusion creation time into exported file}
8652 d: @r{turn on/off inclusion of drawers}
8655 These options take effect in both the HTML and La@TeX{} export, except
8656 for @code{TeX} and @code{LaTeX}, which are respectively @code{t} and
8657 @code{nil} for the La@TeX{} export.
8659 When exporting only a single subtree by selecting it with @kbd{C-c @@} before
8660 calling an export command, the subtree can overrule some of the file's export
8661 settings with properties @code{EXPORT_FILE_NAME}, @code{EXPORT_TITLE},
8662 @code{EXPORT_TEXT}, @code{EXPORT_AUTHOR}, @code{EXPORT_DATE}, and
8663 @code{EXPORT_OPTIONS}.
8665 @node The export dispatcher, ASCII export, Export options, Exporting
8666 @section The export dispatcher
8667 @cindex dispatcher, for export commands
8669 All export commands can be reached using the export dispatcher, which is a
8670 prefix key that prompts for an additional key specifying the command.
8671 Normally the entire file is exported, but if there is an active region that
8672 contains one outline tree, the first heading is used as document title and
8673 the subtrees are exported.
8678 @vindex org-export-run-in-background
8679 Dispatcher for export and publishing commands. Displays a help-window
8680 listing the additional key(s) needed to launch an export or publishing
8681 command. The prefix arg is passed through to the exporter. A double prefix
8682 @kbd{C-u C-u} causes most commands to be executed in the background, in a
8683 separate Emacs process@footnote{To make this behavior the default, customize
8684 the variable @code{org-export-run-in-background}.}.
8687 Like @kbd{C-c C-e}, but only export the text that is currently visible
8688 (i.e. not hidden by outline visibility).
8689 @kindex C-u C-u C-c C-e
8690 @item C-u C-u C-c C-e
8691 @vindex org-export-run-in-background
8692 Call an the exporter, but reverse the setting of
8693 @code{org-export-run-in-background}, i.e. request background processing if
8694 not set, or force processing in the current Emacs process if set.
8697 @node ASCII export, HTML export, The export dispatcher, Exporting
8698 @section ASCII export
8699 @cindex ASCII export
8701 ASCII export produces a simple and very readable version of an Org-mode
8704 @cindex region, active
8705 @cindex active region
8706 @cindex transient-mark-mode
8710 @cindex property, EXPORT_FILE_NAME
8711 Export as ASCII file. For an Org file, @file{myfile.org}, the ASCII file
8712 will be @file{myfile.txt}. The file will be overwritten without
8713 warning. If there is an active region@footnote{This requires
8714 @code{transient-mark-mode} be turned on.}, only the region will be
8715 exported. If the selected region is a single tree@footnote{To select the
8716 current subtree, use @kbd{C-c @@}.}, the tree head will
8717 become the document title. If the tree head entry has or inherits an
8718 @code{EXPORT_FILE_NAME} property, that name will be used for the
8722 Export to a temporary buffer, do not create a file.
8725 Export only the visible part of the document.
8728 @cindex headline levels, for exporting
8729 In the exported version, the first 3 outline levels will become
8730 headlines, defining a general document structure. Additional levels
8731 will be exported as itemized lists. If you want that transition to occur
8732 at a different level, specify it with a prefix argument. For example,
8739 creates only top level headlines and does the rest as items. When
8740 headlines are converted to items, the indentation of the text following
8741 the headline is changed to fit nicely under the item. This is done with
8742 the assumption that the first body line indicates the base indentation of
8743 the body text. Any indentation larger than this is adjusted to preserve
8744 the layout relative to the first line. Should there be lines with less
8745 indentation than the first, these are left alone.
8747 @vindex org-export-ascii-links-to-notes
8748 Links will be exported in a footnote-like style, with the descriptive part in
8749 the text and the link in a note before the next heading. See the variable
8750 @code{org-export-ascii-links-to-notes} for details and other options.
8752 @node HTML export, LaTeX and PDF export, ASCII export, Exporting
8753 @section HTML export
8756 Org mode contains an HTML (XHTML 1.0 strict) exporter with extensive
8757 HTML formatting, in ways similar to John Gruber's @emph{markdown}
8758 language, but with additional support for tables.
8761 * HTML Export commands:: How to invoke HTML export
8762 * Quoting HTML tags:: Using direct HTML in Org mode
8763 * Links in HTML export:: How links will be interpreted and formatted
8764 * Tables in HTML export:: How to modify the formatting of tables
8765 * Images in HTML export:: How to insert figures into HTML output
8766 * Text areas in HTML export:: An alternative way to show an example
8767 * CSS support:: Changing the appearance of the output
8768 * Javascript support:: Info and Folding in a web browser
8771 @node HTML Export commands, Quoting HTML tags, HTML export, HTML export
8772 @subsection HTML export commands
8774 @cindex region, active
8775 @cindex active region
8776 @cindex transient-mark-mode
8780 @cindex property, EXPORT_FILE_NAME
8781 Export as HTML file @file{myfile.html}. For an Org file @file{myfile.org},
8782 the ASCII file will be @file{myfile.html}. The file will be overwritten
8783 without warning. If there is an active region@footnote{This requires
8784 @code{transient-mark-mode} be turned on.}, only the region will be
8785 exported. If the selected region is a single tree@footnote{To select the
8786 current subtree, use @kbd{C-c @@}.}, the tree head will become the document
8787 title. If the tree head entry has, or inherits, an @code{EXPORT_FILE_NAME}
8788 property, that name will be used for the export.
8791 Export as HTML file and immediately open it with a browser.
8794 Export to a temporary buffer, do not create a file.
8797 Export the active region to a temporary buffer. With a prefix argument, do
8798 not produce the file header and footer, but just the plain HTML section for
8799 the region. This is good for cut-and-paste operations.
8808 Export only the visible part of the document.
8809 @item M-x org-export-region-as-html
8810 Convert the region to HTML under the assumption that it was Org-mode
8811 syntax before. This is a global command that can be invoked in any
8813 @item M-x org-replace-region-by-HTML
8814 Replace the active region (assumed to be in Org-mode syntax) by HTML
8818 @cindex headline levels, for exporting
8819 In the exported version, the first 3 outline levels will become headlines,
8820 defining a general document structure. Additional levels will be exported as
8821 itemized lists. If you want that transition to occur at a different level,
8822 specify it with a numeric prefix argument. For example,
8829 creates two levels of headings and does the rest as items.
8831 @node Quoting HTML tags, Links in HTML export, HTML Export commands, HTML export
8832 @subsection Quoting HTML tags
8834 Plain @samp{<} and @samp{>} are always transformed to @samp{<} and
8835 @samp{>} in HTML export. If you want to include simple HTML tags
8836 which should be interpreted as such, mark them with @samp{@@} as in
8837 @samp{@@<b>bold text@@</b>}. Note that this really works only for
8838 simple tags. For more extensive HTML that should be copied verbatim to
8839 the exported file use either
8842 @cindex #+BEGIN_HTML
8844 #+HTML: Literal HTML code for export
8848 @cindex #+BEGIN_HTML
8852 All lines between these markers are exported literally
8857 @node Links in HTML export, Tables in HTML export, Quoting HTML tags, HTML export
8858 @subsection Links in HTML export
8860 @cindex links, in HTML export
8861 @cindex internal links, in HTML export
8862 @cindex external links, in HTML export
8863 Internal links (@pxref{Internal links}) will continue to work in HTML. This
8864 includes automatic links created by radio targets (@pxref{Radio
8865 targets}). Links to external files will still work if the target file is on
8866 the same @i{relative} path as the published Org file. Links to other
8867 @file{.org} files will be translated into HTML links under the assumption
8868 that an HTML version also exists of the linked file, at the same relative
8869 path. @samp{id:} links can then be used to jump to specific entries across
8870 files. For information related to linking files while publishing them to a
8871 publishing directory see @ref{Publishing links}.
8873 If you want to specify attributes for links, you can do so using a special
8874 @code{#+ATTR_HTML} line to define attributes that will be added to the
8875 @code{<a>} or @code{<img>} tags. Here is an example that sets @code{title}
8876 and @code{style} attributes for a link:
8880 #+ATTR_HTML: title="The Org-mode homepage" style="color:red;"
8881 [[http://orgmode.org]]
8884 @node Tables in HTML export, Images in HTML export, Links in HTML export, HTML export
8886 @cindex tables, in HTML
8887 @vindex org-export-html-table-tag
8889 Org-mode tables are exported to HTML using the table tag defined in
8890 @code{org-export-html-table-tag}. The default setting makes tables without
8891 cell borders and frame. If you would like to change this for individual
8892 tables, place somthing like the following before the table:
8897 #+CAPTION: This is a table with lines around and between cells
8898 #+ATTR_HTML: border="2" rules="all" frame="all"
8901 @node Images in HTML export, Text areas in HTML export, Tables in HTML export, HTML export
8902 @subsection Images in HTML export
8904 @cindex images, inline in HTML
8905 @cindex inlining images in HTML
8906 @vindex org-export-html-inline-images
8907 HTML export can inline images given as links in the Org file, and
8908 it can make an image the clickable part of a link. By
8909 default@footnote{But see the variable
8910 @code{org-export-html-inline-images}.}, images are inlined if a link does
8911 not have a description. So @samp{[[file:myimg.jpg]]} will be inlined,
8912 while @samp{[[file:myimg.jpg][the image]]} will just produce a link
8913 @samp{the image} that points to the image. If the description part
8914 itself is a @code{file:} link or a @code{http:} URL pointing to an
8915 image, this image will be inlined and activated so that clicking on the
8916 image will activate the link. For example, to include a thumbnail that
8917 will link to a high resolution version of the image, you could use:
8920 [[file:highres.jpg][file:thumb.jpg]]
8923 If you need to add attributes to an inlines image, use a @code{#+ATTR_HTML}.
8924 In the example below we specify the @code{alt} and @code{title} attributes to
8925 support text viewers and accessibility, and align it to the right.
8930 #+CAPTION: A black cat stalking a spider
8931 #+ATTR_HTML: alt="cat/spider image" title="Action!" align="right"
8936 and you could use @code{http} addresses just as well.
8938 @node Text areas in HTML export, CSS support, Images in HTML export, HTML export
8939 @subsection Text areas in HTML export
8941 @cindex text areas, in HTML
8942 An alternative way to publish literal code examples in HTML is to use text
8943 areas, where the example can even be edited before pasting it into an
8944 application. It is triggered by a @code{-t} switch at an @code{example} or
8945 @code{src} block. Using this switch disables any options for syntax and
8946 label highlighting, and line numbering, which may be present. You may also
8947 use @code{-h} and @code{-w} switches to specify the height and width of the
8948 text area, which default to the number of lines in the example, and 80,
8949 respectively. For example
8952 #+BEGIN_EXAMPLE -t -w 40
8953 (defun org-xor (a b)
8960 @node CSS support, Javascript support, Text areas in HTML export, HTML export
8961 @subsection CSS support
8962 @cindex CSS, for HTML export
8963 @cindex HTML export, CSS
8965 @vindex org-export-html-todo-kwd-class-prefix
8966 @vindex org-export-html-tag-class-prefix
8967 You can also give style information for the exported file. The HTML exporter
8968 assigns the following special CSS classes@footnote{If the classes on TODO
8969 keywords and tags lead to conflicts, use the variables
8970 @code{org-export-html-todo-kwd-class-prefix} and
8971 @code{org-export-html-tag-class-prefix} to make them unique.} to appropriate
8972 parts of the document---your style specifications may change these, in
8973 addition to any of the standard classes like for headlines, tables, etc.
8975 p.author @r{author information, including email}
8976 p.date @r{publishing date}
8977 p.creator @r{creator info, about org-mode version}
8978 .title @r{document title}
8979 .todo @r{TODO keywords, all not-done states}
8980 .done @r{the DONE keywords, all stated the count as done}
8981 .WAITING @r{each TODO keyword also uses a class named after itself}
8982 .timestamp @r{timestamp}
8983 .timestamp-kwd @r{keyword associated with a timestamp, like SCHEDULED}
8984 .timestamp-wrapper @r{span around keyword plus timestamp}
8985 .tag @r{tag in a headline}
8986 ._HOME @r{each tag uses itself as a class, "@@" replaced by "_"}
8987 .target @r{target for links}
8988 .linenr @r{the line number in a code example}
8989 .code-highlighted @r{for highlighting referenced code lines}
8990 div.outline-N @r{div for outline level N (headline plus text))}
8991 div.outline-text-N @r{extra div for text at outline level N}
8992 .section-number-N @r{section number in headlines, different for each level}
8993 div.figure @r{how to format an inlined image}
8994 pre.src @r{formatted source code}
8995 pre.example @r{normal example}
8996 p.verse @r{verse paragraph}
8997 div.footnotes @r{footnote section headline}
8998 p.footnote @r{footnote definition paragraph, containing a footnote}
8999 .footref @r{a footnote reference number (always a <sup>)}
9000 .footnum @r{footnote number in footnote definition (always <sup>)}
9003 @vindex org-export-html-style-default
9004 @vindex org-export-html-style-include-default
9005 @vindex org-export-html-style
9006 @vindex org-export-html-extra
9007 @vindex org-export-html-style-default
9008 Each exported file contains a compact default style that defines these
9009 classes in a basic way@footnote{This style is defined in the constant
9010 @code{org-export-html-style-default}, which you should not modify. To turn
9011 inclusion of these defaults off, customize
9012 @code{org-export-html-style-include-default}}. You may overwrite these
9013 settings, or add to them by using the variables @code{org-export-html-style}
9014 (for Org-wide settings) and @code{org-export-html-style-extra} (for more
9015 granular settings, like file-local settings). To set the latter variable
9016 individually for each file, you can use
9020 #+STYLE: <link rel="stylesheet" type="text/css" href="stylesheet.css" />
9024 For longer style definitions, you can use several such lines. You could also
9025 directly write a @code{<style>} @code{</style>} section in this way, without
9026 referring to an external file.
9028 @c FIXME: More about header and footer styles
9029 @c FIXME: Talk about links and targets.
9031 @node Javascript support, , CSS support, HTML export
9032 @subsection Javascript supported display of web pages
9034 @cindex Rose, Sebastian
9035 Sebastian Rose has written a JavaScript program especially designed to
9036 enhance the web viewing experience of HTML files created with Org. This
9037 program allows you to view large files in two different ways. The first one
9038 is an @emph{Info}-like mode where each section is displayed separately and
9039 navigation can be done with the @kbd{n} and @kbd{p} keys (and some other keys
9040 as well, press @kbd{?} for an overview of the available keys). The second
9041 view type is a @emph{folding} view much like Org provides inside Emacs. The
9042 script is available at @url{http://orgmode.org/org-info.js} and you can find
9043 the documentation for it at @url{http://orgmode.org/worg/code/org-info-js/}.
9044 We host the script at our site, but if you use it a lot, you might
9045 not want to be dependent on @url{orgmode.org} and prefer to install a local
9046 copy on your own web server.
9048 To use the script, you need to make sure that the @file{org-jsinfo.el} module
9049 gets loaded. It should be loaded by default, but you can try @kbd{M-x
9050 customize-variable @key{RET} org-modules @key{RET}} to convince yourself that
9051 this is indeed the case. All it then takes to make use of the program is
9052 adding a single line to the Org file:
9054 @cindex #+INFOJS_OPT
9056 #+INFOJS_OPT: view:info toc:nil
9060 If this line is found, the HTML header will automatically contain the code
9061 needed to invoke the script. Using the line above, you can set the following
9065 path: @r{The path to the script. The default is to grab the script from}
9066 @r{@url{http://orgmode.org/org-info.js}, but you might want to have}
9067 @r{a local copy and use a path like @samp{../scripts/org-info.js}.}
9068 view: @r{Initial view when website is first shown. Possible values are:}
9069 info @r{Info-like interface with one section per page.}
9070 overview @r{Folding interface, initially showing only top-level.}
9071 content @r{Folding interface, starting with all headlines visible.}
9072 showall @r{Folding interface, all headlines and text visible.}
9073 sdepth: @r{Maximum headline level that will still become an independent}
9074 @r{section for info and folding modes. The default is taken from}
9075 @r{@code{org-export-headline-levels} (= the @code{H} switch in @code{#+OPTIONS}).}
9076 @r{If this is smaller than in @code{org-export-headline-levels}, each}
9077 @r{info/folding section can still contain child headlines.}
9078 toc: @r{Should the table of content @emph{initially} be visible?}
9079 @r{Even when @code{nil}, you can always get to the "toc" with @kbd{i}.}
9080 tdepth: @r{The depth of the table of contents. The defaults are taken from}
9081 @r{the variables @code{org-export-headline-levels} and @code{org-export-with-toc}.}
9082 ftoc: @r{Does the css of the page specify a fixed position for the "toc"?}
9083 @r{If yes, the toc will never be displayed as a section.}
9084 ltoc: @r{Should there be short contents (children) in each section?}
9085 @r{Make this @code{above} if the section should be above initial text.}
9086 mouse: @r{Headings are highlighted when the mouse is over them. Should be}
9087 @r{@samp{underline} (default) or a background color like @samp{#cccccc}.}
9088 buttons: @r{Should view-toggle buttons be everywhere? When @code{nil} (the}
9089 @r{default), only one such button will be present.}
9092 @vindex org-infojs-options
9093 @vindex org-export-html-use-infojs
9094 You can choose default values for these options by customizing the variable
9095 @code{org-infojs-options}. If you always want to apply the script to your
9096 pages, configure the variable @code{org-export-html-use-infojs}.
9098 @node LaTeX and PDF export, DocBook export, HTML export, Exporting
9099 @section La@TeX{} and PDF export
9100 @cindex La@TeX{} export
9102 @cindex Guerry, Bastian
9104 Org mode contains a La@TeX{} exporter written by Bastien Guerry. With
9105 further processing, this backend is also used to produce PDF output. Since
9106 the La@TeX{} output uses @file{hyperref} to implement links and cross
9107 references, the PDF output file will be fully linked.
9110 * LaTeX/PDF export commands:: Which key invokes which commands
9111 * Quoting LaTeX code:: Incorporating literal La@TeX{} code
9112 * Sectioning structure:: Changing sectioning in La@TeX{} output
9113 * Tables in LaTeX export:: Options for exporting tables to La@TeX{}
9114 * Images in LaTeX export:: How to insert figures into La@TeX{} output
9117 @node LaTeX/PDF export commands, Quoting LaTeX code, LaTeX and PDF export, LaTeX and PDF export
9118 @subsection La@TeX{} export commands
9120 @cindex region, active
9121 @cindex active region
9122 @cindex transient-mark-mode
9126 @cindex property EXPORT_FILE_NAME
9127 Export as La@TeX{} file @file{myfile.tex}. For an Org file
9128 @file{myfile.org}, the ASCII file will be @file{myfile.tex}. The file will
9129 be overwritten without warning. If there is an active region@footnote{This
9130 requires @code{transient-mark-mode} be turned on.}, only the region will be
9131 exported. If the selected region is a single tree@footnote{To select the
9132 current subtree, use @kbd{C-c @@}.}, the tree head will become the document
9133 title. If the tree head entry has or inherits an @code{EXPORT_FILE_NAME}
9134 property, that name will be used for the export.
9137 Export to a temporary buffer, do not create a file.
9142 Export only the visible part of the document.
9143 @item M-x org-export-region-as-latex
9144 Convert the region to La@TeX{} under the assumption that it was Org mode
9145 syntax before. This is a global command that can be invoked in any
9147 @item M-x org-replace-region-by-latex
9148 Replace the active region (assumed to be in Org mode syntax) by La@TeX{}
9152 Export as La@TeX{} and then process to PDF.
9155 Export as La@TeX{} and then process to PDF, then open the resulting PDF file.
9158 @cindex headline levels, for exporting
9159 @vindex org-latex-low-levels
9160 In the exported version, the first 3 outline levels will become
9161 headlines, defining a general document structure. Additional levels
9162 will be exported as description lists. The exporter can ignore them or
9163 convert them to a custom string depending on
9164 @code{org-latex-low-levels}.
9166 If you want that transition to occur at a different level, specify it
9167 with a numeric prefix argument. For example,
9174 creates two levels of headings and does the rest as items.
9176 @node Quoting LaTeX code, Sectioning structure, LaTeX/PDF export commands, LaTeX and PDF export
9177 @subsection Quoting La@TeX{} code
9179 Embedded La@TeX{} as described in @ref{Embedded LaTeX}, will be correctly
9180 inserted into the La@TeX{} file. This includes simple macros like
9181 @samp{\ref@{LABEL@}} to create a cross reference to a figure. Furthermore,
9182 you can add special code that should only be present in La@TeX{} export with
9183 the following constructs:
9186 @cindex #+BEGIN_LaTeX
9188 #+LaTeX: Literal LaTeX code for export
9192 @cindex #+BEGIN_LaTeX
9196 All lines between these markers are exported literally
9200 @node Sectioning structure, Tables in LaTeX export, Quoting LaTeX code, LaTeX and PDF export
9201 @subsection Sectioning structure
9202 @cindex La@TeX{} class
9203 @cindex La@TeX{} sectioning structure
9205 By default, the La@TeX{} output uses the class @code{article}.
9207 @vindex org-export-latex-default-class
9208 @vindex org-export-latex-classes
9209 @cindex #+LATEX_HEADER
9210 @cindex #+LATEX_CLASS
9211 @cindex property, LATEX_CLASS
9212 You can change this globally by setting a different value for
9213 @code{org-export-latex-default-class} or locally by adding an option like
9214 @code{#+LaTeX_CLASS: myclass} in your file, or with a @code{:LaTeX_CLASS:}
9215 property that applies when exporting a region containing only this (sub)tree.
9216 The class should be listed in @code{org-export-latex-classes}, where you can
9217 also define the sectioning structure for each class, as well as defining
9218 additional classes. You can also use @code{#+LATEX_HEADER:
9219 \usepackage@{xyz@}} to add lines to the header.
9221 @node Tables in LaTeX export, Images in LaTeX export, Sectioning structure, LaTeX and PDF export
9222 @subsection Tables in La@TeX{} export
9223 @cindex tables, in La@TeX{} export
9225 For La@TeX{} export of a table, you can specify a label and a caption
9226 (@pxref{Images and tables}). You can also use the @code{ATTR_LaTeX} line to
9227 request a longtable environment for the table, so that it may span several
9228 pages. Finally, you can set the alignment string:
9232 @cindex #+ATTR_LaTeX
9234 #+CAPTION: A long table
9236 #+ATTR_LaTeX: longtable align=l|lp@{3cm@}r|l
9242 @node Images in LaTeX export, , Tables in LaTeX export, LaTeX and PDF export
9243 @subsection Images in La@TeX{} export
9244 @cindex images, inline in La@TeX{}
9245 @cindex inlining images in La@TeX{}
9247 Images that are linked to without a description part in the link, like
9248 @samp{[[file:img.jpg]]} or @samp{[[./img.jpg]]} will be inserted into the PDF
9249 output file resulting from La@TeX{} processing. Org will use an
9250 @code{\includegraphics} macro to insert the image. If you have specified a
9251 caption and/or a label as described in @ref{Images and tables}, the figure
9252 will be wrapped into a @code{figure} environment and thus become a floating
9253 element. You can use an @code{#+ATTR_LaTeX:} line to specify the various
9254 options that can be used in the optional argument of the
9255 @code{\includegraphics} macro. To modify the placement option of the
9256 @code{figure} environment, add something like @samp{placement=[h!]} to the
9259 If you'd like to let text flow around the image, add the word @samp{wrap} to
9260 the @code{#+ATTR_LaTeX:} line, which will make the figure occupy the left
9261 half of the page. To fine-tune, the @code{placement} field will be the
9262 set of additional arguments needed by the @code{wrapfigure} environment.
9263 Note that if you change the size of the image, you need to use compatible
9264 settings for @code{\includegraphics} and @code{wrapfigure}.
9268 @cindex #+ATTR_LaTeX
9270 #+CAPTION: The black-body emission of the disk around HR 4049
9271 #+LABEL: fig:SED-HR4049
9272 #+ATTR_LaTeX: width=5cm,angle=90
9273 [[./img/sed-hr4049.pdf]]
9275 #+ATTR_LaTeX: width=0.38\textwidth wrap placement=@{r@}@{0.4\textwidth@}
9279 If you need references to a label created in this way, write
9280 @samp{\ref@{fig:SED-HR4049@}} just like in La@TeX{}.
9282 @node DocBook export, XOXO export, LaTeX and PDF export, Exporting
9283 @section DocBook export
9284 @cindex DocBook export
9288 Org contains a DocBook exporter written by Baoqiu Cui. Once an Org file is
9289 exported to DocBook format, it can be further processed to produce other
9290 formats, including PDF, HTML, man pages, etc., using many available DocBook
9291 tools and stylesheets.
9293 Currently DocBook exporter only supports DocBook V5.0.
9296 * DocBook export commands:: How to invoke DocBook export
9297 * Quoting DocBook code:: Incorporating DocBook code in Org files
9298 * Recursive sections:: Recursive sections in DocBook
9299 * Tables in DocBook export:: Tables are exported as HTML tables
9300 * Images in DocBook export:: How to insert figures into DocBook output
9301 * Special characters:: How to handle special characters
9304 @node DocBook export commands, Quoting DocBook code, DocBook export, DocBook export
9305 @subsection DocBook export commands
9307 @cindex region, active
9308 @cindex active region
9309 @cindex transient-mark-mode
9313 @cindex property EXPORT_FILE_NAME
9314 Export as DocBook file. For an Org file, @file{myfile.org}, the DocBook XML
9315 file will be @file{myfile.xml}. The file will be overwritten without
9316 warning. If there is an active region@footnote{This requires
9317 @code{transient-mark-mode} to be turned on}, only the region will be
9318 exported. If the selected region is a single tree@footnote{To select the
9319 current subtree, use @kbd{C-c @@}.}, the tree head will become the document
9320 title. If the tree head entry has, or inherits, an @code{EXPORT_FILE_NAME}
9321 property, that name will be used for the export.
9324 Export as DocBook file, process to PDF, then open the resulting PDF file.
9326 @vindex org-export-docbook-xslt-proc-command
9327 @vindex org-export-docbook-xsl-fo-proc-command
9328 Note that, in order to produce PDF output based on exported DocBook file, you
9329 need to have XSLT processor and XSL-FO processor software installed on your
9330 system. Check variables @code{org-export-docbook-xslt-proc-command} and
9331 @code{org-export-docbook-xsl-fo-proc-command}.
9335 Export only the visible part of the document.
9338 @node Quoting DocBook code, Recursive sections, DocBook export commands, DocBook export
9339 @subsection Quoting DocBook code
9341 You can quote DocBook code in Org files and copy it verbatim into exported
9342 DocBook file with the following constructs:
9345 @cindex #+BEGIN_DOCBOOK
9347 #+DOCBOOK: Literal DocBook code for export
9351 @cindex #+BEGIN_DOCBOOK
9355 All lines between these markers are exported by DocBook exporter
9360 For example, you can use the following lines to include a DocBook warning
9361 admonition. As to what this warning says, you should pay attention to the
9362 document context when quoting DocBook code in Org files. You may make
9363 exported DocBook XML files invalid by not quoting DocBook code correctly.
9368 <para>You should know what you are doing when quoting DocBook XML code
9369 in your Org file. Invalid DocBook XML file may be generated by
9370 DocBook exporter if you are not careful!</para>
9375 @node Recursive sections, Tables in DocBook export, Quoting DocBook code, DocBook export
9376 @subsection Recursive sections
9377 @cindex DocBook recursive sections
9379 DocBook exporter exports Org files as articles using the @code{article}
9380 element in DocBook. Recursive sections, i.e. @code{section} elements, are
9381 used in exported articles. Top level headlines in Org files are exported as
9382 top level sections, and lower level headlines are exported as nested
9383 sections. The entire structure of Org files will be exported completely, no
9384 matter how many nested levels of headlines there are.
9386 Using recursive sections makes it easy to port and reuse exported DocBook
9387 code in other DocBook document types like @code{book} or @code{set}.
9389 @node Tables in DocBook export, Images in DocBook export, Recursive sections, DocBook export
9390 @subsection Tables in DocBook export
9391 @cindex tables, in DocBook export
9393 Tables in Org files are exported as HTML tables, which have been supported since
9396 If a table does not have a caption, an informal table is generated using the
9397 @code{informaltable} element; otherwise, a formal table will be generated
9398 using the @code{table} element.
9400 @node Images in DocBook export, Special characters, Tables in DocBook export, DocBook export
9401 @subsection Images in DocBook export
9402 @cindex images, inline in DocBook
9403 @cindex inlining images in DocBook
9405 Images that are linked to without a description part in the link, like
9406 @samp{[[file:img.jpg]]} or @samp{[[./img.jpg]]}, will be exported to DocBook
9407 using @code{mediaobject} elements. Each @code{mediaobject} element contains
9408 an @code{imageobject} that wraps an @code{imagedata} element. If you have
9409 specified a caption for an image as described in @ref{Images and tables}, a
9410 @code{caption} element will be added in @code{mediaobject}. If a label is
9411 also specified, it will be exported as an @code{xml:id} attribute of the
9412 @code{mediaobject} element.
9414 @vindex org-export-docbook-default-image-attributes
9415 Image attributes supported by the @code{imagedata} element, like @code{align}
9416 or @code{width}, can be specified in two ways: you can either customize
9417 variable @code{org-export-docbook-default-image-attributes} or use the
9418 @code{#+ATTR_DOCBOOK:} line. Attributes specified in variable
9419 @code{org-export-docbook-default-image-attributes} are applied to all inline
9420 images in the Org file to be exported (unless they are overwritten by image
9421 attributes specified in @code{#+ATTR_DOCBOOK:} lines).
9423 The @code{#+ATTR_DOCBOOK:} line can be used to specify additional image
9424 attributes or overwrite default image attributes for individual images. If
9425 the same attribute appears in both the @code{#+ATTR_DOCBOOK:} line and
9426 variable @code{org-export-docbook-default-image-attributes}, the former
9427 overwrites the latter. Here is an example about how image attributes can be
9432 @cindex #+ATTR_DOCBOOK
9434 #+CAPTION: The logo of Org mode
9435 #+LABEL: unicorn-svg
9436 #+ATTR_DOCBOOK: scalefit="1" width="100%" depth="100%"
9437 [[./img/org-mode-unicorn.svg]]
9440 @vindex org-export-docbook-inline-image-extensions
9441 By default, DocBook exporter recognizes the following image file types:
9442 @file{jpeg}, @file{jpg}, @file{png}, @file{gif}, and @file{svg}. You can
9443 customize variable @code{org-export-docbook-inline-image-extensions} to add
9444 more types to this list as long as DocBook supports them.
9446 @node Special characters, , Images in DocBook export, DocBook export
9447 @subsection Special characters in DocBook export
9448 @cindex Special characters in DocBook export
9450 @vindex org-export-docbook-doctype
9451 @vindex org-html-entities
9452 Special characters that are written in @TeX{}-like syntax, such as @code{\alpha},
9453 @code{\Gamma}, and @code{\Zeta}, are supported by DocBook exporter. These
9454 characters are rewritten to XML entities, like @code{α},
9455 @code{Γ}, and @code{Ζ}, based on the list saved in variable
9456 @code{org-html-entities}. As long as the generated DocBook file includes the
9457 corresponding entities, these special characters are recognized.
9459 You can customize variable @code{org-export-docbook-doctype} to include the
9460 entities you need. For example, you can set variable
9461 @code{org-export-docbook-doctype} to the following value to recognize all
9462 special characters included in XHTML entities:
9465 "<!DOCTYPE article [
9466 <!ENTITY % xhtml1-symbol PUBLIC
9467 \"-//W3C//ENTITIES Symbol for HTML//EN//XML\"
9468 \"http://www.w3.org/2003/entities/2007/xhtml1-symbol.ent\"
9475 @node XOXO export, iCalendar export, DocBook export, Exporting
9476 @section XOXO export
9479 Org mode contains an exporter that produces XOXO-style output.
9480 Currently, this exporter only handles the general outline structure and
9481 does not interpret any additional Org-mode features.
9486 Export as XOXO file @file{myfile.html}.
9489 Export only the visible part of the document.
9492 @node iCalendar export, , XOXO export, Exporting
9493 @section iCalendar export
9494 @cindex iCalendar export
9496 @vindex org-icalendar-include-todo
9497 @vindex org-icalendar-use-deadline
9498 @vindex org-icalendar-use-scheduled
9499 @vindex org-icalendar-categories
9500 Some people use Org mode for keeping track of projects, but still prefer a
9501 standard calendar application for anniversaries and appointments. In this
9502 case it can be useful to show deadlines and other time-stamped items in Org
9503 files in the calendar application. Org mode can export calendar information
9504 in the standard iCalendar format. If you also want to have TODO entries
9505 included in the export, configure the variable
9506 @code{org-icalendar-include-todo}. Plain timestamps are exported as VEVENT,
9507 and TODO items as VTODO. It will also create events from deadlines that are
9508 in non-TODO items. Deadlines and scheduling dates in TODO items will be used
9509 to set the start and due dates for the TODO entry@footnote{See the variables
9510 @code{org-icalendar-use-deadline} and @code{org-icalendar-use-scheduled}.}.
9511 As categories, it will use the tags locally defined in the heading, and the
9512 file/tree category@footnote{To add inherited tags or the TODO state,
9513 configure the variable @code{org-icalendar-categories}.}.
9515 @vindex org-icalendar-store-UID
9516 @cindex property, ID
9517 The iCalendar standard requires each entry to have a globally unique
9518 identifier (UID). Org creates these identifiers during export. If you set
9519 the variable @code{org-icalendar-store-UID}, the UID will be stored in the
9520 @code{:ID:} property of the entry and re-used next time you report this
9521 entry. Since a single entry can give rise to multiple iCalendar entries (as
9522 a timestamp, a deadline, a scheduled item, and as a TODO item), Org adds
9523 prefixes to the UID, depending on what triggered the inclusion of the entry.
9524 In this way the UID remains unique, but a synchronization program can still
9525 figure out from which entry all the different instances originate.
9530 Create iCalendar entries for the current file and store them in the same
9531 directory, using a file extension @file{.ics}.
9534 @vindex org-agenda-files
9535 Like @kbd{C-c C-e i}, but do this for all files in
9536 @code{org-agenda-files}. For each of these files, a separate iCalendar
9537 file will be written.
9540 @vindex org-combined-agenda-icalendar-file
9541 Create a single large iCalendar file from all files in
9542 @code{org-agenda-files} and write it to the file given by
9543 @code{org-combined-agenda-icalendar-file}.
9546 @vindex org-use-property-inheritance
9547 @vindex org-icalendar-include-body
9548 @cindex property, SUMMARY
9549 @cindex property, DESCRIPTION
9550 @cindex property, LOCATION
9551 The export will honor SUMMARY, DESCRIPTION and LOCATION@footnote{The LOCATION
9552 property can be inherited from higher in the hierarchy if you configure
9553 @code{org-use-property-inheritance} accordingly.} properties if the selected
9554 entries have them. If not, the summary will be derived from the headline,
9555 and the description from the body (limited to
9556 @code{org-icalendar-include-body} characters).
9558 How this calendar is best read and updated, depends on the application
9559 you are using. The FAQ covers this issue.
9561 @node Publishing, Miscellaneous, Exporting, Top
9564 @cindex O'Toole, David
9566 Org includes a publishing management system that allows you to configure
9567 automatic HTML conversion of @emph{projects} composed of interlinked org
9568 files. You can also configure Org to automatically upload your exported HTML
9569 pages and related attachments, such as images and source code files, to a web
9572 You can also use Org to convert files into PDF, or even combine HTML and PDF
9573 conversion so that files are available in both formats on the server.
9575 Publishing has been contributed to Org by David O'Toole.
9578 * Configuration:: Defining projects
9579 * Uploading files:: How to get files up on the server
9580 * Sample configuration:: Example projects
9581 * Triggering publication:: Publication commands
9584 @node Configuration, Uploading files, Publishing, Publishing
9585 @section Configuration
9587 Publishing needs significant configuration to specify files, destination
9588 and many other properties of a project.
9591 * Project alist:: The central configuration variable
9592 * Sources and destinations:: From here to there
9593 * Selecting files:: What files are part of the project?
9594 * Publishing action:: Setting the function doing the publishing
9595 * Publishing options:: Tweaking HTML export
9596 * Publishing links:: Which links keep working after publishing?
9597 * Project page index:: Publishing a list of project files
9600 @node Project alist, Sources and destinations, Configuration, Configuration
9601 @subsection The variable @code{org-publish-project-alist}
9602 @cindex org-publish-project-alist
9603 @cindex projects, for publishing
9605 @vindex org-publish-project-alist
9606 Publishing is configured almost entirely through setting the value of one
9607 variable, called @code{org-publish-project-alist}. Each element of the list
9608 configures one project, and may be in one of the two following forms:
9611 ("project-name" :property value :property value ...)
9613 ("project-name" :components ("project-name" "project-name" ...))
9617 In both cases, projects are configured by specifying property values. A
9618 project defines the set of files that will be published, as well as the
9619 publishing configuration to use when publishing those files. When a project
9620 takes the second form listed above, the individual members of the
9621 @code{:components} property are taken to be sub-projects, which group
9622 together files requiring different publishing options. When you publish such
9623 a ``meta-project'', all the components will also be published, in the
9626 @node Sources and destinations, Selecting files, Project alist, Configuration
9627 @subsection Sources and destinations for files
9628 @cindex directories, for publishing
9630 Most properties are optional, but some should always be set. In
9631 particular, Org needs to know where to look for source files,
9632 and where to put published files.
9634 @multitable @columnfractions 0.3 0.7
9635 @item @code{:base-directory}
9636 @tab Directory containing publishing source files
9637 @item @code{:publishing-directory}
9638 @tab Directory where output files will be published. You can directly
9639 publish to a webserver using a file name syntax appropriate for
9640 the Emacs @file{tramp} package. Or you can publish to a local directory and
9641 use external tools to upload your website (@pxref{Uploading files}).
9642 @item @code{:preparation-function}
9643 @tab Function called before starting the publishing process, for example, to
9644 run @code{make} for updating files to be published.
9645 @item @code{:completion-function}
9646 @tab Function called after finishing the publishing process, for example, to
9647 change permissions of the resulting files.
9651 @node Selecting files, Publishing action, Sources and destinations, Configuration
9652 @subsection Selecting files
9653 @cindex files, selecting for publishing
9655 By default, all files with extension @file{.org} in the base directory
9656 are considered part of the project. This can be modified by setting the
9658 @multitable @columnfractions 0.25 0.75
9659 @item @code{:base-extension}
9660 @tab Extension (without the dot!) of source files. This actually is a
9661 regular expression. Set this to the symbol @code{any} if you want to get all
9662 files in @code{:base-directory}, even without extension.
9664 @item @code{:exclude}
9665 @tab Regular expression to match file names that should not be
9666 published, even though they have been selected on the basis of their
9669 @item @code{:include}
9670 @tab List of files to be included regardless of @code{:base-extension}
9671 and @code{:exclude}.
9674 @node Publishing action, Publishing options, Selecting files, Configuration
9675 @subsection Publishing action
9676 @cindex action, for publishing
9678 Publishing means that a file is copied to the destination directory and
9679 possibly transformed in the process. The default transformation is to export
9680 Org files as HTML files, and this is done by the function
9681 @code{org-publish-org-to-html} which calls the HTML exporter (@pxref{HTML
9682 export}). But you also can publish your content as PDF files using
9683 @code{org-publish-org-to-pdf}. If you want to publish the Org file itself,
9684 but with @i{archived}, @i{commented}, and @i{tag-excluded} trees removed, use
9685 @code{org-publish-org-to-org} and set the parameters @code{:plain-source}
9686 and/or @code{:htmlized-source}. This will produce @file{file.org} and
9687 @file{file.org.html} in the publishing
9688 directory@footnote{@file{file-source.org} and @file{file-source.org.html} if
9689 source and publishing directories are equal. Note that with this kind of
9690 setup, you need to add @code{:exclude "-source\\.org"} to the project
9691 definition in @code{org-publish-project-alist} to avoid that the published
9692 source files will be considered as new org files the next time the project is
9693 published.}. Other files like images only
9694 need to be copied to the publishing destination, for this you may use
9695 @code{org-publish-attachment}. For non-Org files, you always need to
9696 specify the publishing function:
9698 @multitable @columnfractions 0.3 0.7
9699 @item @code{:publishing-function}
9700 @tab Function executing the publication of a file. This may also be a
9701 list of functions, which will all be called in turn.
9702 @item @code{:plain-source}
9703 @tab Non-nil means, publish plain source.
9704 @item @code{:htmlized-source}
9705 @tab Non-nil means, publish htmlized source.
9708 The function must accept two arguments: a property list containing at least a
9709 @code{:publishing-directory} property, and the name of the file to be
9710 published. It should take the specified file, make the necessary
9711 transformation (if any) and place the result into the destination folder.
9713 @node Publishing options, Publishing links, Publishing action, Configuration
9714 @subsection Options for the HTML/La@TeX{} exporters
9715 @cindex options, for publishing
9717 The property list can be used to set many export options for the HTML
9718 and La@TeX{} exporters. In most cases, these properties correspond to user
9719 variables in Org. The table below lists these properties along
9720 with the variable they belong to. See the documentation string for the
9721 respective variable for details.
9723 @vindex org-export-html-link-up
9724 @vindex org-export-html-link-home
9725 @vindex org-export-default-language
9726 @vindex org-display-custom-times
9727 @vindex org-export-headline-levels
9728 @vindex org-export-with-section-numbers
9729 @vindex org-export-section-number-format
9730 @vindex org-export-with-toc
9731 @vindex org-export-preserve-breaks
9732 @vindex org-export-with-archived-trees
9733 @vindex org-export-with-emphasize
9734 @vindex org-export-with-sub-superscripts
9735 @vindex org-export-with-special-strings
9736 @vindex org-export-with-footnotes
9737 @vindex org-export-with-drawers
9738 @vindex org-export-with-tags
9739 @vindex org-export-with-todo-keywords
9740 @vindex org-export-with-priority
9741 @vindex org-export-with-TeX-macros
9742 @vindex org-export-with-LaTeX-fragments
9743 @vindex org-export-skip-text-before-1st-heading
9744 @vindex org-export-with-fixed-width
9745 @vindex org-export-with-timestamps
9746 @vindex org-export-author-info
9747 @vindex org-export-creator-info
9748 @vindex org-export-with-tables
9749 @vindex org-export-highlight-first-table-line
9750 @vindex org-export-html-style-include-default
9751 @vindex org-export-html-style
9752 @vindex org-export-html-style-extra
9753 @vindex org-export-html-link-org-files-as-html
9754 @vindex org-export-html-inline-images
9755 @vindex org-export-html-extension
9756 @vindex org-export-html-table-tag
9757 @vindex org-export-html-expand
9758 @vindex org-export-html-with-timestamp
9759 @vindex org-export-publishing-directory
9760 @vindex org-export-html-preamble
9761 @vindex org-export-html-postamble
9762 @vindex org-export-html-auto-preamble
9763 @vindex org-export-html-auto-postamble
9764 @vindex user-full-name
9765 @vindex user-mail-address
9766 @vindex org-export-select-tags
9767 @vindex org-export-exclude-tags
9769 @multitable @columnfractions 0.32 0.68
9770 @item @code{:link-up} @tab @code{org-export-html-link-up}
9771 @item @code{:link-home} @tab @code{org-export-html-link-home}
9772 @item @code{:language} @tab @code{org-export-default-language}
9773 @item @code{:customtime} @tab @code{org-display-custom-times}
9774 @item @code{:headline-levels} @tab @code{org-export-headline-levels}
9775 @item @code{:section-numbers} @tab @code{org-export-with-section-numbers}
9776 @item @code{:section-number-format} @tab @code{org-export-section-number-format}
9777 @item @code{:table-of-contents} @tab @code{org-export-with-toc}
9778 @item @code{:preserve-breaks} @tab @code{org-export-preserve-breaks}
9779 @item @code{:archived-trees} @tab @code{org-export-with-archived-trees}
9780 @item @code{:emphasize} @tab @code{org-export-with-emphasize}
9781 @item @code{:sub-superscript} @tab @code{org-export-with-sub-superscripts}
9782 @item @code{:special-strings} @tab @code{org-export-with-special-strings}
9783 @item @code{:footnotes} @tab @code{org-export-with-footnotes}
9784 @item @code{:drawers} @tab @code{org-export-with-drawers}
9785 @item @code{:tags} @tab @code{org-export-with-tags}
9786 @item @code{:todo-keywords} @tab @code{org-export-with-todo-keywords}
9787 @item @code{:priority} @tab @code{org-export-with-priority}
9788 @item @code{:TeX-macros} @tab @code{org-export-with-TeX-macros}
9789 @item @code{:LaTeX-fragments} @tab @code{org-export-with-LaTeX-fragments}
9790 @item @code{:latex-listings} @tab @code{org-export-latex-listings}
9791 @item @code{:skip-before-1st-heading} @tab @code{org-export-skip-text-before-1st-heading}
9792 @item @code{:fixed-width} @tab @code{org-export-with-fixed-width}
9793 @item @code{:timestamps} @tab @code{org-export-with-timestamps}
9794 @item @code{:author-info} @tab @code{org-export-author-info}
9795 @item @code{:creator-info} @tab @code{org-export-creator-info}
9796 @item @code{:tables} @tab @code{org-export-with-tables}
9797 @item @code{:table-auto-headline} @tab @code{org-export-highlight-first-table-line}
9798 @item @code{:style-include-default} @tab @code{org-export-html-style-include-default}
9799 @item @code{:style} @tab @code{org-export-html-style}
9800 @item @code{:style-extra} @tab @code{org-export-html-style-extra}
9801 @item @code{:convert-org-links} @tab @code{org-export-html-link-org-files-as-html}
9802 @item @code{:inline-images} @tab @code{org-export-html-inline-images}
9803 @item @code{:html-extension} @tab @code{org-export-html-extension}
9804 @item @code{:xml-declaration} @tab @code{org-export-html-xml-declaration}
9805 @item @code{:html-table-tag} @tab @code{org-export-html-table-tag}
9806 @item @code{:expand-quoted-html} @tab @code{org-export-html-expand}
9807 @item @code{:timestamp} @tab @code{org-export-html-with-timestamp}
9808 @item @code{:publishing-directory} @tab @code{org-export-publishing-directory}
9809 @item @code{:preamble} @tab @code{org-export-html-preamble}
9810 @item @code{:postamble} @tab @code{org-export-html-postamble}
9811 @item @code{:auto-preamble} @tab @code{org-export-html-auto-preamble}
9812 @item @code{:auto-postamble} @tab @code{org-export-html-auto-postamble}
9813 @item @code{:author} @tab @code{user-full-name}
9814 @item @code{:email} @tab @code{user-mail-address} : @code{addr;addr;..}
9815 @item @code{:select-tags} @tab @code{org-export-select-tags}
9816 @item @code{:exclude-tags} @tab @code{org-export-exclude-tags}
9817 @item @code{:latex-image-options} @tab @code{org-export-latex-image-default-option}
9820 Most of the @code{org-export-with-*} variables have the same effect in
9821 both HTML and La@TeX{} exporters, except for @code{:TeX-macros} and
9822 @code{:LaTeX-fragments}, respectively @code{nil} and @code{t} in the
9825 @vindex org-publish-project-alist
9826 When a property is given a value in @code{org-publish-project-alist},
9827 its setting overrides the value of the corresponding user variable (if
9828 any) during publishing. Options set within a file (@pxref{Export
9829 options}), however, override everything.
9831 @node Publishing links, Project page index, Publishing options, Configuration
9832 @subsection Links between published files
9833 @cindex links, publishing
9835 To create a link from one Org file to another, you would use
9836 something like @samp{[[file:foo.org][The foo]]} or simply
9837 @samp{file:foo.org.} (@pxref{Hyperlinks}). When published, this link
9838 becomes a link to @file{foo.html}. In this way, you can interlink the
9839 pages of your "org web" project and the links will work as expected when
9840 you publish them to HTML. If you also publish the Org source file and want
9841 to link to that, use an @code{http:} link instead of a @code{file:} link,
9842 because @code{file:} links are converted to link to the corresponding
9845 You may also link to related files, such as images. Provided you are careful
9846 with relative file names, and provided you have also configured Org to upload
9847 the related files, these links will work too. See @ref{Complex example}, for
9848 an example of this usage.
9850 Sometimes an Org file to be published may contain links that are
9851 only valid in your production environment, but not in the publishing
9852 location. In this case, use the property
9854 @multitable @columnfractions 0.4 0.6
9855 @item @code{:link-validation-function}
9856 @tab Function to validate links
9860 to define a function for checking link validity. This function must
9861 accept two arguments, the file name and a directory relative to which
9862 the file name is interpreted in the production environment. If this
9863 function returns @code{nil}, then the HTML generator will only insert a
9864 description into the HTML file, but no link. One option for this
9865 function is @code{org-publish-validate-link} which checks if the given
9866 file is part of any project in @code{org-publish-project-alist}.
9868 @node Project page index, , Publishing links, Configuration
9869 @subsection Project page index
9870 @cindex index, of published pages
9872 The following properties may be used to control publishing of an
9873 index of files or a summary page for a given project.
9875 @multitable @columnfractions 0.25 0.75
9876 @item @code{:auto-index}
9877 @tab When non-nil, publish an index during @code{org-publish-current-project}
9878 or @code{org-publish-all}.
9880 @item @code{:index-filename}
9881 @tab Filename for output of index. Defaults to @file{sitemap.org} (which
9882 becomes @file{sitemap.html}).
9884 @item @code{:index-title}
9885 @tab Title of index page. Defaults to name of file.
9887 @item @code{:index-function}
9888 @tab Plug-in function to use for generation of index.
9889 Defaults to @code{org-publish-org-index}, which generates a plain list
9890 of links to all files in the project.
9893 @node Uploading files, Sample configuration, Configuration, Publishing
9894 @section Uploading files
9898 For those people already utilizing third party sync tools such as
9899 @command{rsync} or @command{unison}, it might be preferable not to use the built in
9900 @i{remote} publishing facilities of Org mode which rely heavily on
9901 Tramp. Tramp, while very useful and powerful, tends not to be
9902 so efficient for multiple file transfer and has been known to cause problems
9905 Specialized synchronization utilities offer several advantages. In addition
9906 to timestamp comparison, they also do content and permissions/attribute
9907 checks. For this reason you might prefer to publish your web to a local
9908 directory (possibly even @i{in place} with your Org files) and then use
9909 @file{unison} or @file{rsync} to do the synchronization with the remote host.
9911 Since Unison (for example) can be configured as to which files to transfer to
9912 a certain remote destination, it can greatly simplify the project publishing
9913 definition. Simply keep all files in the correct location, process your Org
9914 files with @code{org-publish} and let the synchronization tool do the rest.
9915 You do not need, in this scenario, to include attachments such as @file{jpg},
9916 @file{css} or @file{gif} files in the project definition since the 3rd party
9919 Publishing to a local directory is also much faster than to a remote one, so
9920 that you can afford more easily to republish entire projects. If you set
9921 @code{org-publish-use-timestamps-flag} to @code{nil}, you gain the main
9922 benefit of re-including any changed external files such as source example
9923 files you might include with @code{#+INCLUDE}. The timestamp mechanism in
9924 Org is not smart enough to detect if included files have been modified.
9926 @node Sample configuration, Triggering publication, Uploading files, Publishing
9927 @section Sample configuration
9929 Below we provide two example configurations. The first one is a simple
9930 project publishing only a set of Org files. The second example is
9931 more complex, with a multi-component project.
9934 * Simple example:: One-component publishing
9935 * Complex example:: A multi-component publishing example
9938 @node Simple example, Complex example, Sample configuration, Sample configuration
9939 @subsection Example: simple publishing configuration
9941 This example publishes a set of Org files to the @file{public_html}
9942 directory on the local machine.
9945 (setq org-publish-project-alist
9947 :base-directory "~/org/"
9948 :publishing-directory "~/public_html"
9949 :section-numbers nil
9950 :table-of-contents nil
9951 :style "<link rel=\"stylesheet\"
9952 href=\"../other/mystyle.css\"
9953 type=\"text/css\"/>")))
9956 @node Complex example, , Simple example, Sample configuration
9957 @subsection Example: complex publishing configuration
9959 This more complicated example publishes an entire website, including
9960 Org files converted to HTML, image files, Emacs Lisp source code, and
9961 style sheets. The publishing directory is remote and private files are
9964 To ensure that links are preserved, care should be taken to replicate
9965 your directory structure on the web server, and to use relative file
9966 paths. For example, if your Org files are kept in @file{~/org} and your
9967 publishable images in @file{~/images}, you'd link to an image with
9970 file:../images/myimage.png
9973 On the web server, the relative path to the image should be the
9974 same. You can accomplish this by setting up an "images" folder in the
9975 right place on the web server, and publishing images to it.
9978 (setq org-publish-project-alist
9980 :base-directory "~/org/"
9981 :base-extension "org"
9982 :publishing-directory "/ssh:user@@host:~/html/notebook/"
9983 :publishing-function org-publish-org-to-html
9984 :exclude "PrivatePage.org" ;; regexp
9986 :section-numbers nil
9987 :table-of-contents nil
9988 :style "<link rel=\"stylesheet\"
9989 href=\"../other/mystyle.css\" type=\"text/css\"/>"
9991 :auto-postamble nil)
9994 :base-directory "~/images/"
9995 :base-extension "jpg\\|gif\\|png"
9996 :publishing-directory "/ssh:user@@host:~/html/images/"
9997 :publishing-function org-publish-attachment)
10000 :base-directory "~/other/"
10001 :base-extension "css\\|el"
10002 :publishing-directory "/ssh:user@@host:~/html/other/"
10003 :publishing-function org-publish-attachment)
10004 ("website" :components ("orgfiles" "images" "other"))))
10007 @node Triggering publication, , Sample configuration, Publishing
10008 @section Triggering publication
10010 Once properly configured, Org can publish with the following commands:
10015 Prompt for a specific project and publish all files that belong to it.
10018 Publish the project containing the current file.
10021 Publish only the current file.
10024 Publish every project.
10027 @vindex org-publish-use-timestamps-flag
10028 Org uses timestamps to track when a file has changed. The above functions
10029 normally only publish changed files. You can override this and force
10030 publishing of all files by giving a prefix argument to any of the commands
10031 above, or by customizing the variable @code{org-publish-use-timestamps-flag}.
10032 This may be necessary in particular if files include other files via
10033 @code{#+SETUPFILE:} or @code{#+INCLUDE:}.
10035 @node Miscellaneous, Hacking, Publishing, Top
10036 @chapter Miscellaneous
10039 * Completion:: M-TAB knows what you need
10040 * Customization:: Adapting Org to your taste
10041 * In-buffer settings:: Overview of the #+KEYWORDS
10042 * The very busy C-c C-c key:: When in doubt, press C-c C-c
10043 * Clean view:: Getting rid of leading stars in the outline
10044 * TTY keys:: Using Org on a tty
10045 * Interaction:: Other Emacs packages
10049 @node Completion, Customization, Miscellaneous, Miscellaneous
10050 @section Completion
10051 @cindex completion, of @TeX{} symbols
10052 @cindex completion, of TODO keywords
10053 @cindex completion, of dictionary words
10054 @cindex completion, of option keywords
10055 @cindex completion, of tags
10056 @cindex completion, of property keys
10057 @cindex completion, of link abbreviations
10058 @cindex @TeX{} symbol completion
10059 @cindex TODO keywords completion
10060 @cindex dictionary word completion
10061 @cindex option keyword completion
10062 @cindex tag completion
10063 @cindex link abbreviations, completion of
10065 Emacs would not be Emacs without completion, and Org-mode uses it whenever it
10066 makes sense. If you prefer an @i{iswitchb}- or @i{ido}-like interface for
10067 some of the completion prompts, you can specify your preferece by setting at
10068 most one of the variables @code{org-completion-use-iswitchb}
10069 @code{org-completion-use-ido}.
10071 Org supports in-buffer completion. This type of completion does
10072 not make use of the minibuffer. You simply type a few letters into
10073 the buffer and use the key to complete text right there.
10076 @kindex M-@key{TAB}
10078 Complete word at point
10081 At the beginning of a headline, complete TODO keywords.
10083 After @samp{\}, complete @TeX{} symbols supported by the exporter.
10085 After @samp{*}, complete headlines in the current buffer so that they
10086 can be used in search links like @samp{[[*find this headline]]}.
10088 After @samp{:} in a headline, complete tags. The list of tags is taken
10089 from the variable @code{org-tag-alist} (possibly set through the
10090 @samp{#+TAGS} in-buffer option, @pxref{Setting tags}), or it is created
10091 dynamically from all tags used in the current buffer.
10093 After @samp{:} and not in a headline, complete property keys. The list
10094 of keys is constructed dynamically from all keys used in the current
10097 After @samp{[}, complete link abbreviations (@pxref{Link abbreviations}).
10099 After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or
10100 @samp{OPTIONS} which set file-specific options for Org mode. When the
10101 option keyword is already complete, pressing @kbd{M-@key{TAB}} again
10102 will insert example settings for this keyword.
10104 In the line after @samp{#+STARTUP: }, complete startup keywords,
10105 i.e. valid keys for this line.
10107 Elsewhere, complete dictionary words using Ispell.
10111 @node Customization, In-buffer settings, Completion, Miscellaneous
10112 @section Customization
10113 @cindex customization
10114 @cindex options, for customization
10115 @cindex variables, for customization
10117 There are more than 180 variables that can be used to customize
10118 Org. For the sake of compactness of the manual, I am not
10119 describing the variables here. A structured overview of customization
10120 variables is available with @kbd{M-x org-customize}. Or select
10121 @code{Browse Org Group} from the @code{Org->Customization} menu. Many
10122 settings can also be activated on a per-file basis, by putting special
10123 lines into the buffer (@pxref{In-buffer settings}).
10125 @node In-buffer settings, The very busy C-c C-c key, Customization, Miscellaneous
10126 @section Summary of in-buffer settings
10127 @cindex in-buffer settings
10128 @cindex special keywords
10130 Org mode uses special lines in the buffer to define settings on a
10131 per-file basis. These lines start with a @samp{#+} followed by a
10132 keyword, a colon, and then individual words defining a setting. Several
10133 setting words can be in the same line, but you can also have multiple
10134 lines for the keyword. While these settings are described throughout
10135 the manual, here is a summary. After changing any of those lines in the
10136 buffer, press @kbd{C-c C-c} with the cursor still in the line to
10137 activate the changes immediately. Otherwise they become effective only
10138 when the file is visited again in a new Emacs session.
10140 @vindex org-archive-location
10142 @item #+ARCHIVE: %s_done::
10143 This line sets the archive location for the agenda file. It applies for
10144 all subsequent lines until the next @samp{#+ARCHIVE} line, or the end
10145 of the file. The first such line also applies to any entries before it.
10146 The corresponding variable is @code{org-archive-location}.
10148 This line sets the category for the agenda file. The category applies
10149 for all subsequent lines until the next @samp{#+CATEGORY} line, or the
10150 end of the file. The first such line also applies to any entries before it.
10151 @item #+COLUMNS: %25ITEM .....
10152 @cindex property, COLUMNS
10153 Set the default format for columns view. This format applies when
10154 columns view is invoked in locations where no @code{COLUMNS} property
10156 @item #+CONSTANTS: name1=value1 ...
10157 @vindex org-table-formula-constants
10158 @vindex org-table-formula
10159 Set file-local values for constants to be used in table formulas. This
10160 line set the local variable @code{org-table-formula-constants-local}.
10161 The global version of this variable is
10162 @code{org-table-formula-constants}.
10163 @item #+FILETAGS: :tag1:tag2:tag3:
10164 Set tags that can be inherited by any entry in the file, including the
10166 @item #+DRAWERS: NAME1 .....
10167 @vindex org-drawers
10168 Set the file-local set of drawers. The corresponding global variable is
10169 @code{org-drawers}.
10170 @item #+LINK: linkword replace
10171 @vindex org-link-abbrev-alist
10172 These lines (several are allowed) specify link abbreviations.
10173 @xref{Link abbreviations}. The corresponding variable is
10174 @code{org-link-abbrev-alist}.
10175 @item #+PRIORITIES: highest lowest default
10176 @vindex org-highest-priority
10177 @vindex org-lowest-priority
10178 @vindex org-default-priority
10179 This line sets the limits and the default for the priorities. All three
10180 must be either letters A-Z or numbers 0-9. The highest priority must
10181 have a lower ASCII number that the lowest priority.
10182 @item #+PROPERTY: Property_Name Value
10183 This line sets a default inheritance value for entries in the current
10184 buffer, most useful for specifying the allowed values of a property.
10185 @cindex #+SETUPFILE
10186 @item #+SETUPFILE: file
10187 This line defines a file that holds more in-buffer setup. Normally this is
10188 entirely ignored. Only when the buffer is parsed for option-setting lines
10189 (i.e. when starting Org mode for a file, when pressing @kbd{C-c C-c} in a
10190 settings line, or when exporting), then the contents of this file are parsed
10191 as if they had been included in the buffer. In particular, the file can be
10192 any other Org mode file with internal setup. You can visit the file the
10193 cursor is in the line with @kbd{C-c '}.
10196 This line sets options to be used at startup of Org mode, when an
10197 Org file is being visited.
10199 The first set of options deals with the initial visibility of the outline
10200 tree. The corresponding variable for global default settings is
10201 @code{org-startup-folded}, with a default value @code{t}, which means
10203 @vindex org-startup-folded
10204 @cindex @code{overview}, STARTUP keyword
10205 @cindex @code{content}, STARTUP keyword
10206 @cindex @code{showall}, STARTUP keyword
10207 @cindex @code{showeverything}, STARTUP keyword
10209 overview @r{top-level headlines only}
10210 content @r{all headlines}
10211 showall @r{no folding of any entries}
10212 showeverything @r{show even drawer contents}
10215 @vindex org-startup-indented
10216 @cindex @code{indent}, STARTUP keyword
10217 @cindex @code{noindent}, STARTUP keyword
10218 Dynamic virtual indentation is controlled by the variable
10219 @code{org-startup-indented}@footnote{Emacs 23 and Org-mode 6.29 are required}
10221 indent @r{start with @code{org-indent-mode} turned on}
10222 noindent @r{start with @code{org-indent-mode} turned off}
10225 @vindex org-startup-align-all-tables
10226 Then there are options for aligning tables upon visiting a file. This
10227 is useful in files containing narrowed table columns. The corresponding
10228 variable is @code{org-startup-align-all-tables}, with a default value
10230 @cindex @code{align}, STARTUP keyword
10231 @cindex @code{noalign}, STARTUP keyword
10233 align @r{align all tables}
10234 noalign @r{don't align tables on startup}
10236 @vindex org-log-done
10237 @vindex org-log-note-clock-out
10238 @vindex org-log-repeat
10239 Logging the closing and reopening of TODO items and clock intervals can be
10240 configured using these options (see variables @code{org-log-done},
10241 @code{org-log-note-clock-out} and @code{org-log-repeat})
10242 @cindex @code{logdone}, STARTUP keyword
10243 @cindex @code{lognotedone}, STARTUP keyword
10244 @cindex @code{nologdone}, STARTUP keyword
10245 @cindex @code{lognoteclock-out}, STARTUP keyword
10246 @cindex @code{nolognoteclock-out}, STARTUP keyword
10247 @cindex @code{logrepeat}, STARTUP keyword
10248 @cindex @code{lognoterepeat}, STARTUP keyword
10249 @cindex @code{nologrepeat}, STARTUP keyword
10251 logdone @r{record a timestamp when an item is marked DONE}
10252 lognotedone @r{record timestamp and a note when DONE}
10253 nologdone @r{don't record when items are marked DONE}
10254 logrepeat @r{record a time when reinstating a repeating item}
10255 lognoterepeat @r{record a note when reinstating a repeating item}
10256 nologrepeat @r{do not record when reinstating repeating item}
10257 lognoteclock-out @r{record a note when clocking out}
10258 nolognoteclock-out @r{don't record a note when clocking out}
10260 @vindex org-hide-leading-stars
10261 @vindex org-odd-levels-only
10262 Here are the options for hiding leading stars in outline headings, and for
10263 indenting outlines. The corresponding variables are
10264 @code{org-hide-leading-stars} and @code{org-odd-levels-only}, both with a
10265 default setting @code{nil} (meaning @code{showstars} and @code{oddeven}).
10266 @cindex @code{hidestars}, STARTUP keyword
10267 @cindex @code{showstars}, STARTUP keyword
10268 @cindex @code{odd}, STARTUP keyword
10269 @cindex @code{even}, STARTUP keyword
10271 hidestars @r{make all but one of the stars starting a headline invisible.}
10272 showstars @r{show all stars starting a headline}
10273 indent @r{virtual indentation according to outline level}
10274 noindent @r{no virtual indentation according to outline level}
10275 odd @r{allow only odd outline levels (1,3,...)}
10276 oddeven @r{allow all outline levels}
10278 @vindex org-put-time-stamp-overlays
10279 @vindex org-time-stamp-overlay-formats
10280 To turn on custom format overlays over timestamps (variables
10281 @code{org-put-time-stamp-overlays} and
10282 @code{org-time-stamp-overlay-formats}), use
10283 @cindex @code{customtime}, STARTUP keyword
10285 customtime @r{overlay custom time format}
10287 @vindex constants-unit-system
10288 The following options influence the table spreadsheet (variable
10289 @code{constants-unit-system}).
10290 @cindex @code{constcgs}, STARTUP keyword
10291 @cindex @code{constSI}, STARTUP keyword
10293 constcgs @r{@file{constants.el} should use the c-g-s unit system}
10294 constSI @r{@file{constants.el} should use the SI unit system}
10296 @vindex org-footnote-define-inline
10297 @vindex org-footnote-auto-label
10298 @vindex org-footnote-auto-adjust
10299 To influence footnote settings, use the following keywords. The
10300 corresponding variables are @code{org-footnote-define-inline},
10301 @code{org-footnote-auto-label}, and @code{org-footnote-auto-adjust}.
10302 @cindex @code{fninline}, STARTUP keyword
10303 @cindex @code{nofninline}, STARTUP keyword
10304 @cindex @code{fnlocal}, STARTUP keyword
10305 @cindex @code{fnprompt}, STARTUP keyword
10306 @cindex @code{fnauto}, STARTUP keyword
10307 @cindex @code{fnconfirm}, STARTUP keyword
10308 @cindex @code{fnplain}, STARTUP keyword
10309 @cindex @code{fnadjust}, STARTUP keyword
10310 @cindex @code{nofnadjust}, STARTUP keyword
10312 fninline @r{define footnotes inline}
10313 fnnoinline @r{define footnotes in separate section}
10314 fnlocal @r{define footnotes near first reference, but not inline}
10315 fnprompt @r{prompt for footnote labels}
10316 fnauto @r{create [fn:1]-like labels automatically (default)}
10317 fnconfirm @r{offer automatic label for editing or confirmation}
10318 fnplain @r{create [1]-like labels automatically}
10319 fnadjust @r{automatically renumber and sort footnotes}
10320 nofnadjust @r{do not renumber and sort automatically}
10322 @cindex org-hide-block-startup
10323 To hide blocks on startup, use these keywords. The corresponding variable is
10324 @code{org-hide-block-startup}.
10325 @cindex @code{hideblocks}, STARTUP keyword
10326 @cindex @code{nohideblocks}, STARTUP keyword
10328 hideblocks @r{Hide all begin/end blocks on startup}
10329 nohideblocks @r{Do not hide blocks on startup}
10331 @item #+TAGS: TAG1(c1) TAG2(c2)
10332 @vindex org-tag-alist
10333 These lines (several such lines are allowed) specify the valid tags in
10334 this file, and (potentially) the corresponding @emph{fast tag selection}
10335 keys. The corresponding variable is @code{org-tag-alist}.
10337 This line contains the formulas for the table directly above the line.
10338 @item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+TEXT:, #+DATE:,
10339 @itemx #+OPTIONS:, #+BIND:
10340 @itemx #+DESCRIPTION:, #+KEYWORDS:
10341 @itemx #+LATEX_HEADER:, #+STYLE:, #+LINK_UP:, #+LINK_HOME:,
10342 @itemx #+EXPORT_SELECT_TAGS:, #+EXPORT_EXCLUDE_TAGS:
10343 These lines provide settings for exporting files. For more details see
10344 @ref{Export options}.
10345 @item #+TODO: #+SEQ_TODO: #+TYP_TODO:
10346 @vindex org-todo-keywords
10347 These lines set the TODO keywords and their interpretation in the
10348 current file. The corresponding variable is @code{org-todo-keywords}.
10351 @node The very busy C-c C-c key, Clean view, In-buffer settings, Miscellaneous
10352 @section The very busy C-c C-c key
10354 @cindex C-c C-c, overview
10356 The key @kbd{C-c C-c} has many purposes in Org, which are all
10357 mentioned scattered throughout this manual. One specific function of
10358 this key is to add @emph{tags} to a headline (@pxref{Tags}). In many
10359 other circumstances it means something like @emph{``Hey Org, look
10360 here and update according to what you see here''}. Here is a summary of
10361 what this means in different contexts.
10365 If there are highlights in the buffer from the creation of a sparse
10366 tree, or from clock display, remove these highlights.
10368 If the cursor is in one of the special @code{#+KEYWORD} lines, this
10369 triggers scanning the buffer for these lines and updating the
10372 If the cursor is inside a table, realign the table. This command
10373 works even if the automatic table editor has been turned off.
10375 If the cursor is on a @code{#+TBLFM} line, re-apply the formulas to
10378 If the cursor is inside a table created by the @file{table.el} package,
10379 activate that table.
10381 If the current buffer is a Remember buffer, close the note and file it.
10382 With a prefix argument, file it, without further interaction, to the
10385 If the cursor is on a @code{<<<target>>>}, update radio targets and
10386 corresponding links in this buffer.
10388 If the cursor is in a property line or at the start or end of a property
10389 drawer, offer property commands.
10391 If the cursor is at a footnote reference, go to the corresponding
10392 definition, and vice versa.
10394 If the cursor is on a statistics cookie, update it.
10396 If the cursor is in a plain list item with a checkbox, toggle the status
10399 If the cursor is on a numbered item in a plain list, renumber the
10402 If the cursor is on the @code{#+BEGIN} line of a dynamic block, the
10406 @node Clean view, TTY keys, The very busy C-c C-c key, Miscellaneous
10407 @section A cleaner outline view
10408 @cindex hiding leading stars
10409 @cindex dynamic indentation
10410 @cindex odd-levels-only outlines
10411 @cindex clean outline view
10413 Some people find it noisy and distracting that the Org headlines start with a
10414 potentially large number of stars, and that text below the headlines is not
10415 indented. While this is no problem when writing a @emph{book-like} document
10416 where the outline headings are really section headings, in a more
10417 @emph{list-oriented} outline, indented structure is a lot cleaner:
10421 * Top level headline | * Top level headline
10422 ** Second level | * Second level
10423 *** 3rd level | * 3rd level
10424 some text | some text
10425 *** 3rd level | * 3rd level
10426 more text | more text
10427 * Another top level headline | * Another top level headline
10432 If you are using at least Emacs 23.1.50.3 and version 6.29 of Org, this kind
10433 of view can be achieved dynamically at display time using
10434 @code{org-indent-mode}. In this minor mode, all lines are prefixed for
10435 display with the necessary amount of space. Also headlines are prefixed with
10436 additional stars, so that the amount of indentation shifts by
10437 two@footnote{See the variable @code{org-indent-indentation-per-level}.}
10438 spaces per level. All headline stars but the last one are made invisible
10439 using the @code{org-hide} face@footnote{Turning on @code{org-indent-mode}
10440 sets @code{org-hide-leading-stars} to @code{t} and
10441 @code{org-adapt-indentation} to @code{nil}.} - see below under @samp{2.} for
10442 more information on how this works. You can turn on @code{org-indent-mode}
10443 for all files by customizing the variable @code{org-startup-indented}, or you
10444 can turn it on for individual files using
10450 If you want a similar effect in earlier version of Emacs and/or Org, or if
10451 you want the indentation to be hard space characters so that the plain text
10452 file looks as similar as possible to the Emacs display, Org supports you in
10457 @emph{Indentation of text below headlines}@*
10458 You may indent text below each headline to make the left boundary line up
10459 with the headline, like
10463 more text, now indented
10466 @vindex org-adapt-indentation
10467 Org supports this with paragraph filling, line wrapping, and structure
10468 editing@footnote{See also the variable @code{org-adapt-indentation}.},
10469 preserving or adapting the indentation as appropriate.
10472 @vindex org-hide-leading-stars
10473 @emph{Hiding leading stars}@* You can modify the display in such a way that
10474 all leading stars become invisible. To do this in a global way, configure
10475 the variable @code{org-hide-leading-stars} or change this on a per-file basis
10479 #+STARTUP: hidestars
10480 #+STARTUP: showstars
10483 With hidden stars, the tree becomes:
10487 * Top level headline
10495 @vindex org-hide @r{(face)}
10496 The leading stars are not truly replaced by whitespace, they are only
10497 fontified with the face @code{org-hide} that uses the background color as
10498 font color. If you are not using either white or black background, you may
10499 have to customize this face to get the wanted effect. Another possibility is
10500 to set this font such that the extra stars are @i{almost} invisible, for
10501 example using the color @code{grey90} on a white background.
10504 @vindex org-odd-levels-only
10505 Things become cleaner still if you skip all the even levels and use only odd
10506 levels 1, 3, 5..., effectively adding two stars to go from one outline level
10507 to the next@footnote{When you need to specify a level for a property search
10508 or refile targets, @samp{LEVEL=2} will correspond to 3 stars, etc@.}. In this
10509 way we get the outline view shown at the beginning of this section. In order
10510 to make the structure editing and export commands handle this convention
10511 correctly, configure the variable @code{org-odd-levels-only}, or set this on
10512 a per-file basis with one of the following lines:
10519 You can convert an Org file from single-star-per-level to the
10520 double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels
10521 RET} in that file. The reverse operation is @kbd{M-x
10522 org-convert-to-oddeven-levels}.
10525 @node TTY keys, Interaction, Clean view, Miscellaneous
10526 @section Using Org on a tty
10527 @cindex tty key bindings
10529 Because Org contains a large number of commands, by default many of
10530 Org's core commands are bound to keys that are generally not
10531 accessible on a tty, such as the cursor keys (@key{left}, @key{right},
10532 @key{up}, @key{down}), @key{TAB} and @key{RET}, in particular when used
10533 together with modifiers like @key{Meta} and/or @key{Shift}. To access
10534 these commands on a tty when special keys are unavailable, the following
10535 alternative bindings can be used. The tty bindings below will likely be
10536 more cumbersome; you may find for some of the bindings below that a
10537 customized workaround suits you better. For example, changing a timestamp
10538 is really only fun with @kbd{S-@key{cursor}} keys, whereas on a
10539 tty you would rather use @kbd{C-c .} to re-insert the timestamp.
10541 @multitable @columnfractions 0.15 0.2 0.2
10542 @item @b{Default} @tab @b{Alternative 1} @tab @b{Alternative 2}
10543 @item @kbd{S-@key{TAB}} @tab @kbd{C-u @key{TAB}} @tab
10544 @item @kbd{M-@key{left}} @tab @kbd{C-c C-x l} @tab @kbd{@key{Esc} @key{left}}
10545 @item @kbd{M-S-@key{left}} @tab @kbd{C-c C-x L} @tab
10546 @item @kbd{M-@key{right}} @tab @kbd{C-c C-x r} @tab @kbd{@key{Esc} @key{right}}
10547 @item @kbd{M-S-@key{right}} @tab @kbd{C-c C-x R} @tab
10548 @item @kbd{M-@key{up}} @tab @kbd{C-c C-x u} @tab @kbd{@key{Esc} @key{up}}
10549 @item @kbd{M-S-@key{up}} @tab @kbd{C-c C-x U} @tab
10550 @item @kbd{M-@key{down}} @tab @kbd{C-c C-x d} @tab @kbd{@key{Esc} @key{down}}
10551 @item @kbd{M-S-@key{down}} @tab @kbd{C-c C-x D} @tab
10552 @item @kbd{S-@key{RET}} @tab @kbd{C-c C-x c} @tab
10553 @item @kbd{M-@key{RET}} @tab @kbd{C-c C-x m} @tab @kbd{@key{Esc} @key{RET}}
10554 @item @kbd{M-S-@key{RET}} @tab @kbd{C-c C-x M} @tab
10555 @item @kbd{S-@key{left}} @tab @kbd{C-c @key{left}} @tab
10556 @item @kbd{S-@key{right}} @tab @kbd{C-c @key{right}} @tab
10557 @item @kbd{S-@key{up}} @tab @kbd{C-c @key{up}} @tab
10558 @item @kbd{S-@key{down}} @tab @kbd{C-c @key{down}} @tab
10559 @item @kbd{C-S-@key{left}} @tab @kbd{C-c C-x @key{left}} @tab
10560 @item @kbd{C-S-@key{right}} @tab @kbd{C-c C-x @key{right}} @tab
10564 @node Interaction, , TTY keys, Miscellaneous
10565 @section Interaction with other packages
10566 @cindex packages, interaction with other
10567 Org lives in the world of GNU Emacs and interacts in various ways
10568 with other code out there.
10571 * Cooperation:: Packages Org cooperates with
10572 * Conflicts:: Packages that lead to conflicts
10575 @node Cooperation, Conflicts, Interaction, Interaction
10576 @subsection Packages that Org cooperates with
10579 @cindex @file{calc.el}
10580 @cindex Gillespie, Dave
10581 @item @file{calc.el} by Dave Gillespie
10582 Org uses the Calc package for implementing spreadsheet
10583 functionality in its tables (@pxref{The spreadsheet}). Org
10584 checks for the availability of Calc by looking for the function
10585 @code{calc-eval} which will have been autoloaded during setup if Calc has
10586 been installed properly. As of Emacs 22, Calc is part of the Emacs
10587 distribution. Another possibility for interaction between the two
10588 packages is using Calc for embedded calculations. @xref{Embedded Mode,
10589 , Embedded Mode, Calc, GNU Emacs Calc Manual}.
10590 @item @file{constants.el} by Carsten Dominik
10591 @cindex @file{constants.el}
10592 @cindex Dominik, Carsten
10593 @vindex org-table-formula-constants
10594 In a table formula (@pxref{The spreadsheet}), it is possible to use
10595 names for natural constants or units. Instead of defining your own
10596 constants in the variable @code{org-table-formula-constants}, install
10597 the @file{constants} package which defines a large number of constants
10598 and units, and lets you use unit prefixes like @samp{M} for
10599 @samp{Mega}, etc@. You will need version 2.0 of this package, available
10600 at @url{http://www.astro.uva.nl/~dominik/Tools}. Org checks for
10601 the function @code{constants-get}, which has to be autoloaded in your
10602 setup. See the installation instructions in the file
10603 @file{constants.el}.
10604 @item @file{cdlatex.el} by Carsten Dominik
10605 @cindex @file{cdlatex.el}
10606 @cindex Dominik, Carsten
10607 Org mode can make use of the CDLa@TeX{} package to efficiently enter
10608 La@TeX{} fragments into Org files. See @ref{CDLaTeX mode}.
10609 @item @file{imenu.el} by Ake Stenhoff and Lars Lindberg
10610 @cindex @file{imenu.el}
10611 Imenu allows menu access to an index of items in a file. Org mode
10612 supports Imenu---all you need to do to get the index is the following:
10614 (add-hook 'org-mode-hook
10615 (lambda () (imenu-add-to-menubar "Imenu")))
10617 @vindex org-imenu-depth
10618 By default the index is two levels deep---you can modify the depth using
10619 the option @code{org-imenu-depth}.
10620 @item @file{remember.el} by John Wiegley
10621 @cindex @file{remember.el}
10622 @cindex Wiegley, John
10623 Org cooperates with remember, see @ref{Remember}.
10624 @file{Remember.el} is not part of Emacs, find it on the web.
10625 @item @file{speedbar.el} by Eric M. Ludlam
10626 @cindex @file{speedbar.el}
10627 @cindex Ludlam, Eric M.
10628 Speedbar is a package that creates a special frame displaying files and
10629 index items in files. Org mode supports Speedbar and allows you to
10630 drill into Org files directly from the Speedbar. It also allows you to
10631 restrict the scope of agenda commands to a file or a subtree by using
10632 the command @kbd{<} in the Speedbar frame.
10633 @cindex @file{table.el}
10634 @item @file{table.el} by Takaaki Ota
10636 @cindex table editor, @file{table.el}
10637 @cindex @file{table.el}
10638 @cindex Ota, Takaaki
10640 Complex ASCII tables with automatic line wrapping, column- and
10641 row-spanning, and alignment can be created using the Emacs table
10642 package by Takaaki Ota (@uref{http://sourceforge.net/projects/table},
10643 and also part of Emacs 22).
10644 When @key{TAB} or @kbd{C-c C-c} is pressed in such a table, Org mode
10645 will call @command{table-recognize-table} and move the cursor into the
10646 table. Inside a table, the keymap of Org mode is inactive. In order
10647 to execute Org mode-related commands, leave the table.
10652 Recognize @file{table.el} table. Works when the cursor is in a
10657 Insert a @file{table.el} table. If there is already a table at point, this
10658 command converts it between the @file{table.el} format and the Org-mode
10659 format. See the documentation string of the command
10660 @code{org-convert-table} for the restrictions under which this is
10663 @file{table.el} is part of Emacs 22.
10664 @item @file{footnote.el} by Steven L. Baur
10665 @cindex @file{footnote.el}
10666 @cindex Baur, Steven L.
10667 Org mode recognizes numerical footnotes as provided by this package.
10668 However, Org mode also has its own footnote support (@pxref{Footnotes}),
10669 which makes using @file{footnote.el} unnecessary.
10672 @node Conflicts, , Cooperation, Interaction
10673 @subsection Packages that lead to conflicts with Org mode
10677 @cindex @code{shift-selection-mode}
10678 @vindex org-support-shift-select
10679 In Emacs 23, @code{shift-selection-mode} is on by default, meaning that
10680 cursor motions combined with the shift key should start or enlarge regions.
10681 This conflicts with the use of @kbd{S-@key{cursor}} commands in Org to change
10682 timestamps, TODO keywords, priorities, and item bullet types if the cursor is
10683 at such a location. By default, @kbd{S-@key{cursor}} commands outside
10684 special contexts don't do anything, but you can customize the variable
10685 @code{org-support-shift-select}. Org mode then tries to accommodate shift
10686 selection by (i) using it outside of the special contexts where special
10687 commands apply, and by (ii) extending an existing active region even if the
10688 cursor moves across a special context.
10690 @item @file{CUA.el} by Kim. F. Storm
10691 @cindex @file{CUA.el}
10692 @cindex Storm, Kim. F.
10693 @vindex org-replace-disputed-keys
10694 Key bindings in Org conflict with the @kbd{S-<cursor>} keys used by CUA mode
10695 (as well as @code{pc-select-mode} and @code{s-region-mode}) to select and extend the
10696 region. In fact, Emacs 23 has this built-in in the form of
10697 @code{shift-selection-mode}, see previous paragraph. If you are using Emacs
10698 23, you probably don't want to use another package for this purpose. However,
10699 if you prefer to leave these keys to a different package while working in
10700 Org mode, configure the variable @code{org-replace-disputed-keys}. When set,
10701 Org will move the following key bindings in Org files, and in the agenda
10702 buffer (but not during date selection).
10705 S-UP -> M-p S-DOWN -> M-n
10706 S-LEFT -> M-- S-RIGHT -> M-+
10707 C-S-LEFT -> M-S-- C-S-RIGHT -> M-S-+
10710 @vindex org-disputed-keys
10711 Yes, these are unfortunately more difficult to remember. If you want
10712 to have other replacement keys, look at the variable
10713 @code{org-disputed-keys}.
10715 @item @file{yasnippet.el}
10716 @cindex @file{yasnippet.el}
10717 The way Org-mode binds the TAB key (binding to @code{[tab]} instead of
10718 @code{"\t"}) overrules yasnippets' access to this key. The following code
10719 fixed this problem:
10722 (add-hook 'org-mode-hook
10724 (org-set-local 'yas/trigger-key [tab])
10725 (define-key yas/keymap [tab] 'yas/next-field-group)))
10728 @item @file{windmove.el} by Hovav Shacham
10729 @cindex @file{windmove.el}
10730 This package also uses the @kbd{S-<cursor>} keys, so everything written
10731 in the paragraph above about CUA mode also applies here.
10736 @node Hacking, MobileOrg, Miscellaneous, Top
10740 This appendix covers some aspects where users can extend the functionality of
10744 * Hooks:: Who to reach into Org's internals
10745 * Add-on packages:: Available extensions
10746 * Adding hyperlink types:: New custom link types
10747 * Context-sensitive commands:: How to add functionality to such commands
10748 * Tables in arbitrary syntax:: Orgtbl for La@TeX{} and other programs
10749 * Dynamic blocks:: Automatically filled blocks
10750 * Special agenda views:: Customized views
10751 * Extracting agenda information:: Postprocessing of agenda information
10752 * Using the property API:: Writing programs that use entry properties
10753 * Using the mapping API:: Mapping over all or selected entries
10756 @node Hooks, Add-on packages, Hacking, Hacking
10760 Org has a large number of hook variables that can be used to add
10761 functionality. This appendix about hacking is going to illustrate the
10762 use of some of them. A complete list of all hooks with documentation is
10763 maintained by the Worg project and can be found at
10764 @uref{http://orgmode.org/worg/org-configs/org-hooks.php}.
10766 @node Add-on packages, Adding hyperlink types, Hooks, Hacking
10767 @section Add-on packages
10768 @cindex add-on packages
10770 A large number of add-on packages have been written by various authors.
10771 These packages are not part of Emacs, but they are distributed as contributed
10772 packages with the separate release available at the Org mode home page at
10773 @uref{http://orgmode.org}. The list of contributed packages, along with
10774 documentation about each package, is maintained by the Worg project at
10775 @uref{http://orgmode.org/worg/org-contrib/}.
10779 @node Adding hyperlink types, Context-sensitive commands, Add-on packages, Hacking
10780 @section Adding hyperlink types
10781 @cindex hyperlinks, adding new types
10783 Org has a large number of hyperlink types built-in
10784 (@pxref{Hyperlinks}). If you would like to add new link types, Org
10785 provides an interface for doing so. Let's look at an example file,
10786 @file{org-man.el}, that will add support for creating links like
10787 @samp{[[man:printf][The printf manpage]]} to show Unix manual pages inside
10791 ;;; org-man.el - Support for links to manpages in Org
10795 (org-add-link-type "man" 'org-man-open)
10796 (add-hook 'org-store-link-functions 'org-man-store-link)
10798 (defcustom org-man-command 'man
10799 "The Emacs command to be used to display a man page."
10801 :type '(choice (const man) (const woman)))
10803 (defun org-man-open (path)
10804 "Visit the manpage on PATH.
10805 PATH should be a topic that can be thrown at the man command."
10806 (funcall org-man-command path))
10808 (defun org-man-store-link ()
10809 "Store a link to a manpage."
10810 (when (memq major-mode '(Man-mode woman-mode))
10811 ;; This is a man page, we do make this link
10812 (let* ((page (org-man-get-page-name))
10813 (link (concat "man:" page))
10814 (description (format "Manpage for %s" page)))
10815 (org-store-link-props
10818 :description description))))
10820 (defun org-man-get-page-name ()
10821 "Extract the page name from the buffer name."
10822 ;; This works for both `Man-mode' and `woman-mode'.
10823 (if (string-match " \\(\\S-+\\)\\*" (buffer-name))
10824 (match-string 1 (buffer-name))
10825 (error "Cannot create link to this man page")))
10829 ;;; org-man.el ends here
10833 You would activate this new link type in @file{.emacs} with
10840 Let's go through the file and see what it does.
10843 It does @code{(require 'org)} to make sure that @file{org.el} has been
10846 The next line calls @code{org-add-link-type} to define a new link type
10847 with prefix @samp{man}. The call also contains the name of a function
10848 that will be called to follow such a link.
10850 @vindex org-store-link-functions
10851 The next line adds a function to @code{org-store-link-functions}, in
10852 order to allow the command @kbd{C-c l} to record a useful link in a
10853 buffer displaying a man page.
10856 The rest of the file defines the necessary variables and functions.
10857 First there is a customization variable that determines which Emacs
10858 command should be used to display man pages. There are two options,
10859 @code{man} and @code{woman}. Then the function to follow a link is
10860 defined. It gets the link path as an argument---in this case the link
10861 path is just a topic for the manual command. The function calls the
10862 value of @code{org-man-command} to display the man page.
10864 Finally the function @code{org-man-store-link} is defined. When you try
10865 to store a link with @kbd{C-c l}, this function will be called to
10866 try to make a link. The function must first decide if it is supposed to
10867 create the link for this buffer type; we do this by checking the value
10868 of the variable @code{major-mode}. If not, the function must exit and
10869 return the value @code{nil}. If yes, the link is created by getting the
10870 manual topic from the buffer name and prefixing it with the string
10871 @samp{man:}. Then it must call the command @code{org-store-link-props}
10872 and set the @code{:type} and @code{:link} properties. Optionally you
10873 can also set the @code{:description} property to provide a default for
10874 the link description when the link is later inserted into an Org
10875 buffer with @kbd{C-c C-l}.
10877 When is makes sense for your new link type, you may also define a function
10878 @code{org-PREFIX-complete-link} that implements special (e.g. completion)
10879 support for inserting such a link with @kbd{C-c C-l}. Such a function should
10880 not accept any arguments, and return the full link with prefix.
10882 @node Context-sensitive commands, Tables in arbitrary syntax, Adding hyperlink types, Hacking
10883 @section Context-sensitive commands
10884 @cindex context-sensitive commands, hooks
10885 @cindex add-ons, context-sensitive commands
10886 @vindex org-ctrl-c-ctrl-c-hook
10888 Org has several commands that act differently depending on context. The most
10889 important example it the @kbd{C-c C-c} (@pxref{The very busy C-c C-c key}).
10890 Also the @kbd{M-cursor} and @kbd{M-S-cursor} keys have this property.
10892 Add-ons can tap into this functionality by providing a function that detects
10893 special context for that add-on and executes functionality appropriate for
10894 the context. Here is an example from Dan Davison's @file{org-R.el} which
10895 allows you to evaluate commands based on the @file{R} programming language. For
10896 this package, special contexts are lines that start with @code{#+R:} or
10900 (defun org-R-apply-maybe ()
10901 "Detect if this is context for org-R and execute R commands."
10902 (if (save-excursion
10903 (beginning-of-line 1)
10904 (looking-at "#\\+RR?:"))
10905 (progn (call-interactively 'org-R-apply)
10906 t) ;; to signal that we took action
10907 nil)) ;; to signal that we did not
10909 (add-hook 'org-ctrl-c-ctrl-c-hook 'org-R-apply-maybe)
10912 The function first checks if the cursor is in such a line. If that is the
10913 case, @code{org-R-apply} is called and the function returns @code{t} to
10914 signal that action was taken, and @kbd{C-c C-c} will stop looking for other
10915 contexts. If the function finds it should do nothing locally, it returns @code{nil} so that other, similar functions can have a try.
10918 @node Tables in arbitrary syntax, Dynamic blocks, Context-sensitive commands, Hacking
10919 @section Tables and lists in arbitrary syntax
10920 @cindex tables, in other modes
10921 @cindex lists, in other modes
10922 @cindex Orgtbl mode
10924 Since Orgtbl mode can be used as a minor mode in arbitrary buffers, a
10925 frequent feature request has been to make it work with native tables in
10926 specific languages, for example La@TeX{}. However, this is extremely
10927 hard to do in a general way, would lead to a customization nightmare,
10928 and would take away much of the simplicity of the Orgtbl-mode table
10932 This appendix describes a different approach. We keep the Orgtbl mode
10933 table in its native format (the @i{source table}), and use a custom
10934 function to @i{translate} the table to the correct syntax, and to
10935 @i{install} it in the right location (the @i{target table}). This puts
10936 the burden of writing conversion functions on the user, but it allows
10937 for a very flexible system.
10939 Bastien added the ability to do the same with lists. You can use Org's
10940 facilities to edit and structure lists by turning @code{orgstruct-mode}
10941 on, then locally exporting such lists in another format (HTML, La@TeX{}
10946 * Radio tables:: Sending and receiving radio tables
10947 * A LaTeX example:: Step by step, almost a tutorial
10948 * Translator functions:: Copy and modify
10949 * Radio lists:: Doing the same for lists
10952 @node Radio tables, A LaTeX example, Tables in arbitrary syntax, Tables in arbitrary syntax
10953 @subsection Radio tables
10954 @cindex radio tables
10956 To define the location of the target table, you first need to create two
10957 lines that are comments in the current mode, but contain magic words for
10958 Orgtbl mode to find. Orgtbl mode will insert the translated table
10959 between these lines, replacing whatever was there before. For example:
10962 /* BEGIN RECEIVE ORGTBL table_name */
10963 /* END RECEIVE ORGTBL table_name */
10967 Just above the source table, we put a special line that tells
10968 Orgtbl mode how to translate this table and where to install it. For
10972 #+ORGTBL: SEND table_name translation_function arguments....
10976 @code{table_name} is the reference name for the table that is also used
10977 in the receiver lines. @code{translation_function} is the Lisp function
10978 that does the translation. Furthermore, the line can contain a list of
10979 arguments (alternating key and value) at the end. The arguments will be
10980 passed as a property list to the translation function for
10981 interpretation. A few standard parameters are already recognized and
10982 acted upon before the translation function is called:
10986 Skip the first N lines of the table. Hlines do count as separate lines for
10989 @item :skipcols (n1 n2 ...)
10990 List of columns that should be skipped. If the table has a column with
10991 calculation marks, that column is automatically discarded as well.
10992 Please note that the translator function sees the table @emph{after} the
10993 removal of these columns, the function never knows that there have been
10994 additional columns.
10998 The one problem remaining is how to keep the source table in the buffer
10999 without disturbing the normal workings of the file, for example during
11000 compilation of a C file or processing of a La@TeX{} file. There are a
11001 number of different solutions:
11005 The table could be placed in a block comment if that is supported by the
11006 language. For example, in C mode you could wrap the table between
11007 @samp{/*} and @samp{*/} lines.
11009 Sometimes it is possible to put the table after some kind of @i{END}
11010 statement, for example @samp{\bye} in @TeX{} and @samp{\end@{document@}}
11013 You can just comment the table line-by-line whenever you want to process
11014 the file, and uncomment it whenever you need to edit the table. This
11015 only sounds tedious---the command @kbd{M-x orgtbl-toggle-comment}
11016 makes this comment-toggling very easy, in particular if you bind it to a
11020 @node A LaTeX example, Translator functions, Radio tables, Tables in arbitrary syntax
11021 @subsection A La@TeX{} example of radio tables
11022 @cindex La@TeX{}, and Orgtbl mode
11024 The best way to wrap the source table in La@TeX{} is to use the
11025 @code{comment} environment provided by @file{comment.sty}. It has to be
11026 activated by placing @code{\usepackage@{comment@}} into the document
11027 header. Orgtbl mode can insert a radio table skeleton@footnote{By
11028 default this works only for La@TeX{}, HTML, and Texinfo. Configure the
11029 variable @code{orgtbl-radio-tables} to install templates for other
11030 modes.} with the command @kbd{M-x orgtbl-insert-radio-table}. You will
11031 be prompted for a table name, let's say we use @samp{salesfigures}. You
11032 will then get the following template:
11034 @cindex #+ORGTBL, SEND
11036 % BEGIN RECEIVE ORGTBL salesfigures
11037 % END RECEIVE ORGTBL salesfigures
11039 #+ORGTBL: SEND salesfigures orgtbl-to-latex
11045 @vindex La@TeX{}-verbatim-environments
11046 The @code{#+ORGTBL: SEND} line tells Orgtbl mode to use the function
11047 @code{orgtbl-to-latex} to convert the table into La@TeX{} and to put it
11048 into the receiver location with name @code{salesfigures}. You may now
11049 fill in the table, feel free to use the spreadsheet features@footnote{If
11050 the @samp{#+TBLFM} line contains an odd number of dollar characters,
11051 this may cause problems with font-lock in La@TeX{} mode. As shown in the
11052 example you can fix this by adding an extra line inside the
11053 @code{comment} environment that is used to balance the dollar
11054 expressions. If you are using AUC@TeX{} with the font-latex library, a
11055 much better solution is to add the @code{comment} environment to the
11056 variable @code{LaTeX-verbatim-environments}.}:
11059 % BEGIN RECEIVE ORGTBL salesfigures
11060 % END RECEIVE ORGTBL salesfigures
11062 #+ORGTBL: SEND salesfigures orgtbl-to-latex
11063 | Month | Days | Nr sold | per day |
11064 |-------+------+---------+---------|
11065 | Jan | 23 | 55 | 2.4 |
11066 | Feb | 21 | 16 | 0.8 |
11067 | March | 22 | 278 | 12.6 |
11068 #+TBLFM: $4=$3/$2;%.1f
11069 % $ (optional extra dollar to keep font-lock happy, see footnote)
11074 When you are done, press @kbd{C-c C-c} in the table to get the converted
11075 table inserted between the two marker lines.
11077 Now let's assume you want to make the table header by hand, because you
11078 want to control how columns are aligned, etc@. In this case we make sure
11079 that the table translator skips the first 2 lines of the source
11080 table, and tell the command to work as a @i{splice}, i.e. to not produce
11081 header and footer commands of the target table:
11084 \begin@{tabular@}@{lrrr@}
11085 Month & \multicolumn@{1@}@{c@}@{Days@} & Nr.\ sold & per day\\
11086 % BEGIN RECEIVE ORGTBL salesfigures
11087 % END RECEIVE ORGTBL salesfigures
11091 #+ORGTBL: SEND salesfigures orgtbl-to-latex :splice t :skip 2
11092 | Month | Days | Nr sold | per day |
11093 |-------+------+---------+---------|
11094 | Jan | 23 | 55 | 2.4 |
11095 | Feb | 21 | 16 | 0.8 |
11096 | March | 22 | 278 | 12.6 |
11097 #+TBLFM: $4=$3/$2;%.1f
11101 The La@TeX{} translator function @code{orgtbl-to-latex} is already part of
11102 Orgtbl mode. It uses a @code{tabular} environment to typeset the table
11103 and marks horizontal lines with @code{\hline}. Furthermore, it
11104 interprets the following parameters (see also @pxref{Translator functions}):
11107 @item :splice nil/t
11108 When set to t, return only table body lines, don't wrap them into a
11109 tabular environment. Default is nil.
11112 A format to be used to wrap each field, it should contain @code{%s} for the
11113 original field value. For example, to wrap each field value in dollars,
11114 you could use @code{:fmt "$%s$"}. This may also be a property list with
11115 column numbers and formats. for example @code{:fmt (2 "$%s$" 4 "%s\\%%")}.
11116 A function of one argument can be used in place of the strings; the
11117 function must return a formatted string.
11120 Use this format to print numbers with exponentials. The format should
11121 have @code{%s} twice for inserting mantissa and exponent, for example
11122 @code{"%s\\times10^@{%s@}"}. The default is @code{"%s\\,(%s)"}. This
11123 may also be a property list with column numbers and formats, for example
11124 @code{:efmt (2 "$%s\\times10^@{%s@}$" 4 "$%s\\cdot10^@{%s@}$")}. After
11125 @code{efmt} has been applied to a value, @code{fmt} will also be
11126 applied. Similar to @code{fmt}, functions of two arguments can be
11127 supplied instead of strings.
11130 @node Translator functions, Radio lists, A LaTeX example, Tables in arbitrary syntax
11131 @subsection Translator functions
11132 @cindex HTML, and Orgtbl mode
11133 @cindex translator function
11135 Orgtbl mode has several translator functions built-in: @code{orgtbl-to-csv}
11136 (comma-separated values), @code{orgtbl-to-tsv} (TAB-separated values)
11137 @code{orgtbl-to-latex}, @code{orgtbl-to-html}, and @code{orgtbl-to-texinfo}.
11138 Except for @code{orgtbl-to-html}@footnote{The HTML translator uses the same
11139 code that produces tables during HTML export.}, these all use a generic
11140 translator, @code{orgtbl-to-generic}. For example, @code{orgtbl-to-latex}
11141 itself is a very short function that computes the column definitions for the
11142 @code{tabular} environment, defines a few field and line separators and then
11143 hands processing over to the generic translator. Here is the entire code:
11147 (defun orgtbl-to-latex (table params)
11148 "Convert the Orgtbl mode TABLE to LaTeX."
11149 (let* ((alignment (mapconcat (lambda (x) (if x "r" "l"))
11150 org-table-last-alignment ""))
11153 :tstart (concat "\\begin@{tabular@}@{" alignment "@}")
11154 :tend "\\end@{tabular@}"
11155 :lstart "" :lend " \\\\" :sep " & "
11156 :efmt "%s\\,(%s)" :hline "\\hline")))
11157 (orgtbl-to-generic table (org-combine-plists params2 params))))
11161 As you can see, the properties passed into the function (variable
11162 @var{PARAMS}) are combined with the ones newly defined in the function
11163 (variable @var{PARAMS2}). The ones passed into the function (i.e. the
11164 ones set by the @samp{ORGTBL SEND} line) take precedence. So if you
11165 would like to use the La@TeX{} translator, but wanted the line endings to
11166 be @samp{\\[2mm]} instead of the default @samp{\\}, you could just
11167 overrule the default with
11170 #+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]"
11173 For a new language, you can either write your own converter function in
11174 analogy with the La@TeX{} translator, or you can use the generic function
11175 directly. For example, if you have a language where a table is started
11176 with @samp{!BTBL!}, ended with @samp{!ETBL!}, and where table lines are
11177 started with @samp{!BL!}, ended with @samp{!EL!}, and where the field
11178 separator is a TAB, you could call the generic translator like this (on
11182 #+ORGTBL: SEND test orgtbl-to-generic :tstart "!BTBL!" :tend "!ETBL!"
11183 :lstart "!BL! " :lend " !EL!" :sep "\t"
11187 Please check the documentation string of the function
11188 @code{orgtbl-to-generic} for a full list of parameters understood by
11189 that function, and remember that you can pass each of them into
11190 @code{orgtbl-to-latex}, @code{orgtbl-to-texinfo}, and any other function
11191 using the generic function.
11193 Of course you can also write a completely new function doing complicated
11194 things the generic translator cannot do. A translator function takes
11195 two arguments. The first argument is the table, a list of lines, each
11196 line either the symbol @code{hline} or a list of fields. The second
11197 argument is the property list containing all parameters specified in the
11198 @samp{#+ORGTBL: SEND} line. The function must return a single string
11199 containing the formatted table. If you write a generally useful
11200 translator, please post it on @email{emacs-orgmode@@gnu.org} so that
11201 others can benefit from your work.
11203 @node Radio lists, , Translator functions, Tables in arbitrary syntax
11204 @subsection Radio lists
11205 @cindex radio lists
11206 @cindex org-list-insert-radio-list
11208 Sending and receiving radio lists works exactly the same way than sending and
11209 receiving radio tables (@pxref{Radio tables}). As for radio tables, you can
11210 insert radio lists templates in HTML, La@TeX{} and Texinfo modes by calling
11211 @code{org-list-insert-radio-list}.
11213 Here are the differences with radio tables:
11217 Use @code{ORGLST} instead of @code{ORGTBL}.
11219 The available translation functions for radio lists don't take
11222 @kbd{C-c C-c} will work when pressed on the first item of the list.
11225 Here is a La@TeX{} example. Let's say that you have this in your
11230 % BEGIN RECEIVE ORGLST to-buy
11231 % END RECEIVE ORGLST to-buy
11233 #+ORGLIST: SEND to-buy orgtbl-to-latex
11242 Pressing `C-c C-c' on @code{a new house} and will insert the converted
11243 La@TeX{} list between the two marker lines.
11245 @node Dynamic blocks, Special agenda views, Tables in arbitrary syntax, Hacking
11246 @section Dynamic blocks
11247 @cindex dynamic blocks
11249 Org documents can contain @emph{dynamic blocks}. These are
11250 specially marked regions that are updated by some user-written function.
11251 A good example for such a block is the clock table inserted by the
11252 command @kbd{C-c C-x C-r} (@pxref{Clocking work time}).
11254 Dynamic block are enclosed by a BEGIN-END structure that assigns a name
11255 to the block and can also specify parameters for the function producing
11256 the content of the block.
11258 #+BEGIN:dynamic block
11260 #+BEGIN: myblock :parameter1 value1 :parameter2 value2 ...
11265 Dynamic blocks are updated with the following commands
11268 @kindex C-c C-x C-u
11270 Update dynamic block at point.
11271 @kindex C-u C-c C-x C-u
11272 @item C-u C-c C-x C-u
11273 Update all dynamic blocks in the current file.
11276 Updating a dynamic block means to remove all the text between BEGIN and
11277 END, parse the BEGIN line for parameters and then call the specific
11278 writer function for this block to insert the new content. If you want
11279 to use the original content in the writer function, you can use the
11280 extra parameter @code{:content}.
11282 For a block with name @code{myblock}, the writer function is
11283 @code{org-dblock-write:myblock} with as only parameter a property list
11284 with the parameters given in the begin line. Here is a trivial example
11285 of a block that keeps track of when the block update function was last
11289 #+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
11295 The corresponding block writer function could look like this:
11298 (defun org-dblock-write:block-update-time (params)
11299 (let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
11300 (insert "Last block update at: "
11301 (format-time-string fmt (current-time)))))
11304 If you want to make sure that all dynamic blocks are always up-to-date,
11305 you could add the function @code{org-update-all-dblocks} to a hook, for
11306 example @code{before-save-hook}. @code{org-update-all-dblocks} is
11307 written in a way such that it does nothing in buffers that are not in
11310 @node Special agenda views, Extracting agenda information, Dynamic blocks, Hacking
11311 @section Special agenda views
11312 @cindex agenda views, user-defined
11314 Org provides a special hook that can be used to narrow down the
11315 selection made by any of the agenda views. You may specify a function
11316 that is used at each match to verify if the match should indeed be part
11317 of the agenda view, and if not, how much should be skipped.
11319 Let's say you want to produce a list of projects that contain a WAITING
11320 tag anywhere in the project tree. Let's further assume that you have
11321 marked all tree headings that define a project with the TODO keyword
11322 PROJECT. In this case you would run a TODO search for the keyword
11323 PROJECT, but skip the match unless there is a WAITING tag anywhere in
11324 the subtree belonging to the project line.
11326 To achieve this, you must write a function that searches the subtree for
11327 the tag. If the tag is found, the function must return @code{nil} to
11328 indicate that this match should not be skipped. If there is no such
11329 tag, return the location of the end of the subtree, to indicate that
11330 search should continue from there.
11333 (defun my-skip-unless-waiting ()
11334 "Skip trees that are not waiting"
11335 (let ((subtree-end (save-excursion (org-end-of-subtree t))))
11336 (if (re-search-forward ":waiting:" subtree-end t)
11337 nil ; tag found, do not skip
11338 subtree-end))) ; tag not found, continue after end of subtree
11341 Now you may use this function in an agenda custom command, for example
11345 (org-add-agenda-custom-command
11346 '("b" todo "PROJECT"
11347 ((org-agenda-skip-function 'my-skip-unless-waiting)
11348 (org-agenda-overriding-header "Projects waiting for something: "))))
11351 @vindex org-agenda-overriding-header
11352 Note that this also binds @code{org-agenda-overriding-header} to get a
11353 meaningful header in the agenda view.
11355 @vindex org-odd-levels-only
11356 @vindex org-agenda-skip-function
11357 A general way to create custom searches is to base them on a search for
11358 entries with a certain level limit. If you want to study all entries with
11359 your custom search function, simply do a search for
11360 @samp{LEVEL>0}@footnote{Note that, when using @code{org-odd-levels-only}, a
11361 level number corresponds to order in the hierarchy, not to the number of
11362 stars.}, and then use @code{org-agenda-skip-function} to select the entries
11363 you really want to have.
11365 You may also put a Lisp form into @code{org-agenda-skip-function}. In
11366 particular, you may use the functions @code{org-agenda-skip-entry-if}
11367 and @code{org-agenda-skip-subtree-if} in this form, for example:
11370 @item '(org-agenda-skip-entry-if 'scheduled)
11371 Skip current entry if it has been scheduled.
11372 @item '(org-agenda-skip-entry-if 'notscheduled)
11373 Skip current entry if it has not been scheduled.
11374 @item '(org-agenda-skip-entry-if 'deadline)
11375 Skip current entry if it has a deadline.
11376 @item '(org-agenda-skip-entry-if 'scheduled 'deadline)
11377 Skip current entry if it has a deadline, or if it is scheduled.
11378 @item '(org-agenda-skip-entry-if 'timestamp)
11379 Skip current entry if it has any timestamp, may also be deadline or scheduled.
11380 @item '(org-agenda-skip-entry 'regexp "regular expression")
11381 Skip current entry if the regular expression matches in the entry.
11382 @item '(org-agenda-skip-entry 'notregexp "regular expression")
11383 Skip current entry unless the regular expression matches.
11384 @item '(org-agenda-skip-subtree-if 'regexp "regular expression")
11385 Same as above, but check and skip the entire subtree.
11388 Therefore we could also have written the search for WAITING projects
11389 like this, even without defining a special function:
11392 (org-add-agenda-custom-command
11393 '("b" todo "PROJECT"
11394 ((org-agenda-skip-function '(org-agenda-skip-subtree-if
11395 'regexp ":waiting:"))
11396 (org-agenda-overriding-header "Projects waiting for something: "))))
11399 @node Extracting agenda information, Using the property API, Special agenda views, Hacking
11400 @section Extracting agenda information
11401 @cindex agenda, pipe
11402 @cindex Scripts, for agenda processing
11404 @vindex org-agenda-custom-commands
11405 Org provides commands to access agenda information for the command
11406 line in Emacs batch mode. This extracted information can be sent
11407 directly to a printer, or it can be read by a program that does further
11408 processing of the data. The first of these commands is the function
11409 @code{org-batch-agenda}, that produces an agenda view and sends it as
11410 ASCII text to STDOUT. The command takes a single string as parameter.
11411 If the string has length 1, it is used as a key to one of the commands
11412 you have configured in @code{org-agenda-custom-commands}, basically any
11413 key you can use after @kbd{C-c a}. For example, to directly print the
11414 current TODO list, you could use
11417 emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
11420 If the parameter is a string with 2 or more characters, it is used as a
11421 tags/TODO match string. For example, to print your local shopping list
11422 (all items with the tag @samp{shop}, but excluding the tag
11423 @samp{NewYork}), you could use
11426 emacs -batch -l ~/.emacs \
11427 -eval '(org-batch-agenda "+shop-NewYork")' | lpr
11431 You may also modify parameters on the fly like this:
11434 emacs -batch -l ~/.emacs \
11435 -eval '(org-batch-agenda "a" \
11436 org-agenda-ndays 30 \
11437 org-agenda-include-diary nil \
11438 org-agenda-files (quote ("~/org/project.org")))' \
11443 which will produce a 30-day agenda, fully restricted to the Org file
11444 @file{~/org/projects.org}, not even including the diary.
11446 If you want to process the agenda data in more sophisticated ways, you
11447 can use the command @code{org-batch-agenda-csv} to get a comma-separated
11448 list of values for each agenda item. Each line in the output will
11449 contain a number of fields separated by commas. The fields in a line
11453 category @r{The category of the item}
11454 head @r{The headline, without TODO keyword, TAGS and PRIORITY}
11455 type @r{The type of the agenda entry, can be}
11456 todo @r{selected in TODO match}
11457 tagsmatch @r{selected in tags match}
11458 diary @r{imported from diary}
11459 deadline @r{a deadline}
11460 scheduled @r{scheduled}
11461 timestamp @r{appointment, selected by timestamp}
11462 closed @r{entry was closed on date}
11463 upcoming-deadline @r{warning about nearing deadline}
11464 past-scheduled @r{forwarded scheduled item}
11465 block @r{entry has date block including date}
11466 todo @r{The TODO keyword, if any}
11467 tags @r{All tags including inherited ones, separated by colons}
11468 date @r{The relevant date, like 2007-2-14}
11469 time @r{The time, like 15:00-16:50}
11470 extra @r{String with extra planning info}
11471 priority-l @r{The priority letter if any was given}
11472 priority-n @r{The computed numerical priority}
11476 Time and date will only be given if a timestamp (or deadline/scheduled)
11477 led to the selection of the item.
11479 A CSV list like this is very easy to use in a post-processing script.
11480 For example, here is a Perl program that gets the TODO list from
11481 Emacs/Org and prints all the items, preceded by a checkbox:
11486 # define the Emacs command to run
11487 $cmd = "emacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv \"t\")'";
11489 # run it and capture the output
11490 $agenda = qx@{$cmd 2>/dev/null@};
11492 # loop over all lines
11493 foreach $line (split(/\n/,$agenda)) @{
11494 # get the individual values
11495 ($category,$head,$type,$todo,$tags,$date,$time,$extra,
11496 $priority_l,$priority_n) = split(/,/,$line);
11497 # process and print
11498 print "[ ] $head\n";
11502 @node Using the property API, Using the mapping API, Extracting agenda information, Hacking
11503 @section Using the property API
11504 @cindex API, for properties
11505 @cindex properties, API
11507 Here is a description of the functions that can be used to work with
11510 @defun org-entry-properties &optional pom which
11511 Get all properties of the entry at point-or-marker POM.@*
11512 This includes the TODO keyword, the tags, time strings for deadline,
11513 scheduled, and clocking, and any additional properties defined in the
11514 entry. The return value is an alist, keys may occur multiple times
11515 if the property key was used several times.@*
11516 POM may also be nil, in which case the current entry is used.
11517 If WHICH is nil or `all', get all properties. If WHICH is
11518 `special' or `standard', only get that subclass.
11520 @vindex org-use-property-inheritance
11521 @defun org-entry-get pom property &optional inherit
11522 Get value of PROPERTY for entry at point-or-marker POM. By default,
11523 this only looks at properties defined locally in the entry. If INHERIT
11524 is non-nil and the entry does not have the property, then also check
11525 higher levels of the hierarchy. If INHERIT is the symbol
11526 @code{selective}, use inheritance if and only if the setting of
11527 @code{org-use-property-inheritance} selects PROPERTY for inheritance.
11530 @defun org-entry-delete pom property
11531 Delete the property PROPERTY from entry at point-or-marker POM.
11534 @defun org-entry-put pom property value
11535 Set PROPERTY to VALUE for entry at point-or-marker POM.
11538 @defun org-buffer-property-keys &optional include-specials
11539 Get all property keys in the current buffer.
11542 @defun org-insert-property-drawer
11543 Insert a property drawer at point.
11546 @defun org-entry-put-multivalued-property pom property &rest values
11547 Set PROPERTY at point-or-marker POM to VALUES. VALUES should be a list of
11548 strings. They will be concatenated, with spaces as separators.
11551 @defun org-entry-get-multivalued-property pom property
11552 Treat the value of the property PROPERTY as a whitespace-separated list of
11553 values and return the values as a list of strings.
11556 @defun org-entry-add-to-multivalued-property pom property value
11557 Treat the value of the property PROPERTY as a whitespace-separated list of
11558 values and make sure that VALUE is in this list.
11561 @defun org-entry-remove-from-multivalued-property pom property value
11562 Treat the value of the property PROPERTY as a whitespace-separated list of
11563 values and make sure that VALUE is @emph{not} in this list.
11566 @defun org-entry-member-in-multivalued-property pom property value
11567 Treat the value of the property PROPERTY as a whitespace-separated list of
11568 values and check if VALUE is in this list.
11571 @node Using the mapping API, , Using the property API, Hacking
11572 @section Using the mapping API
11573 @cindex API, for mapping
11574 @cindex mapping entries, API
11576 Org has sophisticated mapping capabilities to find all entries satisfying
11577 certain criteria. Internally, this functionality is used to produce agenda
11578 views, but there is also an API that can be used to execute arbitrary
11579 functions for each or selected entries. The main entry point for this API
11582 @defun org-map-entries func &optional match scope &rest skip
11583 Call FUNC at each headline selected by MATCH in SCOPE.
11585 FUNC is a function or a Lisp form. The function will be called without
11586 arguments, with the cursor positioned at the beginning of the headline.
11587 The return values of all calls to the function will be collected and
11588 returned as a list.
11590 The call to FUNC will be wrapped into a save-excursion form, so FUNC
11591 does not need to preserve point. After evaluation, the cursor will be
11592 moved to the end of the line (presumably of the headline of the
11593 processed entry) and search continues from there. Under some
11594 circumstances, this may not produce the wanted results. For example,
11595 if you have removed (e.g. archived) the current (sub)tree it could
11596 mean that the next entry will be skipped entirely. In such cases, you
11597 can specify the position from where search should continue by making
11598 FUNC set the variable `org-map-continue-from' to the desired buffer
11601 MATCH is a tags/property/todo match as it is used in the agenda match view.
11602 Only headlines that are matched by this query will be considered during
11603 the iteration. When MATCH is nil or t, all headlines will be
11604 visited by the iteration.
11606 SCOPE determines the scope of this command. It can be any of:
11609 nil @r{the current buffer, respecting the restriction if any}
11610 tree @r{the subtree started with the entry at point}
11611 file @r{the current buffer, without restriction}
11613 @r{the current buffer, and any archives associated with it}
11614 agenda @r{all agenda files}
11615 agenda-with-archives
11616 @r{all agenda files with any archive files associated with them}
11618 @r{if this is a list, all files in the list will be scanned}
11621 The remaining args are treated as settings for the skipping facilities of
11622 the scanner. The following items can be given here:
11624 @vindex org-agenda-skip-function
11626 archive @r{skip trees with the archive tag}
11627 comment @r{skip trees with the COMMENT keyword}
11628 function or Lisp form
11629 @r{will be used as value for @code{org-agenda-skip-function},}
11630 @r{so whenever the function returns t, FUNC}
11631 @r{will not be called for that entry and search will}
11632 @r{continue from the point where the function leaves it}
11636 The function given to that mapping routine can really do anything you like.
11637 It can use the property API (@pxref{Using the property API}) to gather more
11638 information about the entry, or in order to change metadata in the entry.
11639 Here are a couple of functions that might be handy:
11641 @defun org-todo &optional arg
11642 Change the TODO state of the entry, see the docstring of the functions for
11643 the many possible values for the argument ARG.
11646 @defun org-priority &optional action
11647 Change the priority of the entry, see the docstring of this function for the
11648 possible values for ACTION.
11651 @defun org-toggle-tag tag &optional onoff
11652 Toggle the tag TAG in the current entry. Setting ONOFF to either @code{on}
11653 or @code{off} will not toggle tag, but ensure that it is either on or off.
11657 Promote the current entry.
11661 Demote the current entry.
11664 Here is a simple example that will turn all entries in the current file with
11665 a tag @code{TOMORROW} into TODO entries with the keyword @code{UPCOMING}.
11666 Entries in comment trees and in archive trees will be ignored.
11670 '(org-todo "UPCOMING")
11671 "+TOMORROW" 'file 'archive 'comment)
11674 The following example counts the number of entries with TODO keyword
11675 @code{WAITING}, in all agenda files.
11678 (length (org-map-entries t "/+WAITING" 'agenda))
11681 @node MobileOrg, History and Acknowledgments, Hacking, Top
11682 @appendix MobileOrg
11686 @i{MobileOrg} is an application for the @i{iPhone/iPod Touch} series of
11687 devices, developed by Richard Moreland. Instead of trying to implement the
11688 full feature set of Org and fighting with synchronization issues, this
11689 application chooses a different path. @i{MobileOrg} provides offline viewing
11690 and capture support for an Org-mode system rooted on a ``real'' computer.
11691 Synchronization issues are avoided by making @i{MobileOrg} only @i{write} to
11692 a special capture file, that is only @i{read} by the computer-based system.
11694 This appendix describes the support Org has for creating agenda views in a
11695 format that can be displayed by @i{MobileOrg}, and for integrating notes
11696 captured by @i{MobileOrg} into the main system. It does not cover the
11697 operation of @i{MobileOrg} itself (see @uref{http://mobileorg.ncogni.to/}).
11700 * Setting up the staging area:: Where to interact with the mobile device
11701 * Pushing to MobileOrg:: Uploading Org files and agendas
11702 * Pulling from MobileOrg:: Integrating captured and flagged items
11705 @node Setting up the staging area, Pushing to MobileOrg, MobileOrg, MobileOrg
11706 @section Setting up the staging area
11708 Org-mode has commands to prepare a directory with files for @i{MobileOrg},
11709 and to read captured notes from there. If Emacs can directly write to the
11710 WebDAV directory accessed by @i{MobileOrg}, all you need to do is to point to
11711 this directory using the variable @code{org-mobile-directory}.
11713 If Emacs cannot access the WebDAV directory directly, you can use a local
11714 directory for staging. Other means must then be used to keep this directory
11715 in sync with the WebDAV directory. In the following example, files are
11716 staged in @file{~/stage}, and Org-mode hooks take care of moving files to and
11717 from the WebDAV directory using @file{scp}.
11720 (setq org-mobile-directory "~/stage/")
11721 (add-hook 'org-mobile-post-push-hook
11723 (shell-command "scp ~/stage/* user@@webdavhost:mobile/")))
11724 (add-hook 'org-mobile-pre-pull-hook
11726 (shell-command "scp user@@webdavhost:mobile/mobileorg.org ~/stage/ ")))
11727 (add-hook 'org-mobile-post-pull-hook
11729 (shell-command "scp ~/stage/mobileorg.org user@@webdavhost:mobile/")))
11732 @node Pushing to MobileOrg, Pulling from MobileOrg, Setting up the staging area, MobileOrg
11733 @section Pushing to MobileOrg
11735 This operation copies all files currently listed in @code{org-mobile-files}
11736 to the directory @code{org-mobile-directory}. By default this list contains
11737 all agenda files (as listed in @code{org-agenda-files}), but additional files
11738 can be included by customizing @code{org-mobiles-files}. The push operation
11739 also creates (in the same directory) a special Org file @file{agendas.org}.
11740 This file is an Org-mode style outline, containing every custom agenda view
11741 defined by the user. While creating the agendas, Org-mode will
11742 force@footnote{See the variable @code{org-mobile-force-id-on-agenda-items}.}
11743 an ID property on all entries referenced by the agendas, so that these
11744 entries can be uniquely identified if @i{MobileOrg} flags them for further
11745 action. Finally, Org writes the file @file{index.org}, containing links to
11746 all other files. If @i{MobileOrg} is configured to request this file from
11747 the WebDAV server, all agendas and Org files will be downloaded to the
11748 iPhone. To speed up the download, MobileOrg will only read files whose
11749 checksums@footnote{stored automatically in the file @file{checksums.dat}}
11752 @node Pulling from MobileOrg, , Pushing to MobileOrg, MobileOrg
11753 @section Pulling from MobileOrg
11755 When @i{MobileOrg} synchronizes with the WebDAV server, it not only pulls the
11756 Org files for viewing. It also appends captured entries and pointers to
11757 flagged entries to the file @file{mobileorg.org} on the server. Org has
11758 a @emph{pull} operation that integrates this information into an inbox file
11759 and operates on the pointers to flagged entries. Here is how it works:
11763 Org moves all entries found in
11764 @file{mobileorg.org}@footnote{@file{mobileorg.org} will be empty after this
11765 operation.} and appends them to the file pointed to by the variable
11766 @code{org-mobile-inbox-for-pull}. Each captured entry will be a top-level
11767 entry in the inbox file.
11769 After moving the entries, Org will attempt to act on the flags. Some flags
11770 specify simple operations that will be executed directly and without user
11771 interaction. Examples are marking an entry as DONE and/or archiving
11772 it@footnote{as specified by the variable @code{org-archive-default-action}}.
11773 All other flagged entries will receive a tag @code{:FLAGGED:}, so that they
11774 can be easily found again. When there is a problem finding the entry that
11775 should be flagged, the pointer entry will remain in the inbox and will be
11776 marked with an error message.
11778 Org will then generate an agenda view with all flagged entries. The user
11779 should then go through these entries and do whatever actions are necessary.
11780 If a note has been stored while flagging an entry in @i{MobileOrg}, that note
11781 will be displayed in the echo area when the cursor is on the corresponding
11786 Pressing @kbd{?} in that special agenda will display the full flagging note in
11787 another window and also push it onto the kill ring. So you could use @kbd{?
11788 z C-y C-c C-c} to store that flagging note as a normal note in the entry.
11789 Pressing @kbd{?} twice in succession will offer to remove the
11790 @code{:FLAGGED:} tag along with the recorded flagging note (which is stored
11796 If you are not able to process all flagged entries directly, you can always
11797 return to this agenda view using @kbd{C-c a ?}. Note, however, that there is
11798 a subtle difference. The view created automatically by @kbd{M-x
11799 org-mobile-pull RET} is guaranteed to search all files that have been
11800 addressed by the last pull. This might include a file that is not currently
11801 in your list of agenda files. If you later use @kbd{C-c a ?} to regenerate
11802 the view, only the current agenda files will be searched.
11804 @node History and Acknowledgments, Main Index, MobileOrg, Top
11805 @appendix History and Acknowledgments
11806 @cindex acknowledgments
11810 Org was born in 2003, out of frustration over the user interface
11811 of the Emacs Outline mode. I was trying to organize my notes and
11812 projects, and using Emacs seemed to be the natural way to go. However,
11813 having to remember eleven different commands with two or three keys per
11814 command, only to hide and show parts of the outline tree, that seemed
11815 entirely unacceptable to me. Also, when using outlines to take notes, I
11816 constantly wanted to restructure the tree, organizing it parallel to my
11817 thoughts and plans. @emph{Visibility cycling} and @emph{structure
11818 editing} were originally implemented in the package
11819 @file{outline-magic.el}, but quickly moved to the more general
11820 @file{org.el}. As this environment became comfortable for project
11821 planning, the next step was adding @emph{TODO entries}, basic
11822 @emph{timestamps}, and @emph{table support}. These areas highlighted the two main
11823 goals that Org still has today: to be a new, outline-based,
11824 plain text mode with innovative and intuitive editing features, and to
11825 incorporate project planning functionality directly into a notes file.
11827 A special thanks goes to @i{Bastien Guerry} who has not only written a large
11828 number of extensions to Org (most of them integrated into the core by now),
11829 but who has also helped in the development and maintenance of Org so much that he
11830 should be considered the main co-contributor to this package.
11832 Since the first release, literally thousands of emails to me or to
11833 @email{emacs-orgmode@@gnu.org} have provided a constant stream of bug
11834 reports, feedback, new ideas, and sometimes patches and add-on code.
11835 Many thanks to everyone who has helped to improve this package. I am
11836 trying to keep here a list of the people who had significant influence
11837 in shaping one or more aspects of Org. The list may not be
11838 complete, if I have forgotten someone, please accept my apologies and
11844 @i{Russel Adams} came up with the idea for drawers.
11846 @i{Thomas Baumann} wrote @file{org-bbdb.el} and @file{org-mhe.el}.
11848 @i{Christophe Bataillon} created the great unicorn logo that we use on the
11851 @i{Alex Bochannek} provided a patch for rounding timestamps.
11853 @i{Brad Bozarth} showed how to pull RSS feed data into Org-mode files.
11855 @i{Tom Breton} wrote @file{org-choose.el}.
11857 @i{Charles Cave}'s suggestion sparked the implementation of templates
11860 @i{Pavel Chalmoviansky} influenced the agenda treatment of items with
11863 @i{Gregory Chernov} patched support for Lisp forms into table
11864 calculations and improved XEmacs compatibility, in particular by porting
11865 @file{nouline.el} to XEmacs.
11867 @i{Sacha Chua} suggested copying some linking code from Planner.
11869 @i{Baoqiu Cui} contributed the DocBook exporter.
11871 @i{Eddward DeVilla} proposed and tested checkbox statistics. He also
11872 came up with the idea of properties, and that there should be an API for
11875 @i{Nick Dokos} tracked down several nasty bugs.
11877 @i{Kees Dullemond} used to edit projects lists directly in HTML and so
11878 inspired some of the early development, including HTML export. He also
11879 asked for a way to narrow wide table columns.
11881 @i{Christian Egli} converted the documentation into Texinfo format,
11882 patched CSS formatting into the HTML exporter, and inspired the agenda.
11884 @i{David Emery} provided a patch for custom CSS support in exported
11887 @i{Nic Ferrier} contributed mailcap and XOXO support.
11889 @i{Miguel A. Figueroa-Villanueva} implemented hierarchical checkboxes.
11891 @i{John Foerch} figured out how to make incremental search show context
11892 around a match in a hidden outline tree.
11894 @i{Niels Giesen} had the idea to automatically archive DONE trees.
11896 @i{Bastien Guerry} wrote the La@TeX{} exporter and @file{org-bibtex.el}, and
11897 has been prolific with patches, ideas, and bug reports.
11899 @i{Kai Grossjohann} pointed out key-binding conflicts with other packages.
11901 @i{Bernt Hansen} has driven much of the support for auto-repeating tasks,
11902 task state change logging, and the clocktable. His clear explanations have
11903 been critical when we started to adopt the Git version control system.
11905 @i{Manuel Hermenegildo} has contributed various ideas, small fixes and
11908 @i{Phil Jackson} wrote @file{org-irc.el}.
11910 @i{Scott Jaderholm} proposed footnotes, control over whitespace between
11911 folded entries, and column view for properties.
11913 @i{Tokuya Kameshima} wrote @file{org-wl.el} and @file{org-mew.el}.
11915 @i{Shidai Liu} ("Leo") asked for embedded La@TeX{} and tested it. He also
11916 provided frequent feedback and some patches.
11918 @i{Matt Lundin} has proposed last-row references for table formulas and named
11919 invisible anchors. He has also worked a lot on the FAQ.
11921 @i{Jason F. McBrayer} suggested agenda export to CSV format.
11923 @i{Max Mikhanosha} came up with the idea of refiling.
11925 @i{Dmitri Minaev} sent a patch to set priority limits on a per-file
11928 @i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler
11931 @i{Richard Moreland} wrote @i{MobileOrg} for the iPhone.
11933 @i{Rick Moynihan} proposed allowing multiple TODO sequences in a file
11934 and being able to quickly restrict the agenda to a subtree.
11936 @i{Todd Neal} provided patches for links to Info files and Elisp forms.
11938 @i{Greg Newman} refreshed the unicorn logo into its current form.
11940 @i{Tim O'Callaghan} suggested in-file links, search options for general
11941 file links, and TAGS.
11943 @i{Takeshi Okano} translated the manual and David O'Toole's tutorial
11946 @i{Oliver Oppitz} suggested multi-state TODO items.
11948 @i{Scott Otterson} sparked the introduction of descriptive text for
11949 links, among other things.
11951 @i{Pete Phillips} helped during the development of the TAGS feature, and
11952 provided frequent feedback.
11954 @i{Martin Pohlack} provided the code snippet to bundle character insertion
11955 into bundles of 20 for undo.
11957 @i{T.V. Raman} reported bugs and suggested improvements.
11959 @i{Matthias Rempe} (Oelde) provided ideas, Windows support, and quality
11962 @i{Paul Rivier} provided the basic implementation of named footnotes.
11964 @i{Kevin Rogers} contributed code to access VM files on remote hosts.
11966 @i{Sebastian Rose} wrote @file{org-info.js}, a Java script for displaying
11967 webpages derived from Org using an Info-like or a folding interface with
11968 single-key navigation.
11970 @i{Frank Ruell} solved the mystery of the @code{keymapp nil} bug, a
11971 conflict with @file{allout.el}.
11973 @i{Jason Riedy} generalized the send-receive mechanism for Orgtbl tables with
11976 @i{Philip Rooke} created the Org reference card, provided lots
11977 of feedback, developed and applied standards to the Org documentation.
11979 @i{Christian Schlauer} proposed angular brackets around links, among
11982 @i{Eric Schulte} wrote @file{org-plot.el} and contributed various patches,
11983 small features and modules.
11985 Linking to VM/BBDB/Gnus was first inspired by @i{Tom Shannon}'s
11986 @file{organizer-mode.el}.
11988 @i{Ilya Shlyakhter} proposed the Archive Sibling, line numbering in literal
11989 examples, and remote highlighting for referenced code lines.
11991 @i{Stathis Sideris} wrote the @file{ditaa.jar} ASCII to PNG converter that is
11992 now packaged into Org's @file{contrib} directory.
11994 @i{Daniel Sinder} came up with the idea of internal archiving by locking
11997 @i{Dale Smith} proposed link abbreviations.
11999 @i{James TD Smith} has contributed a large number of patches for useful
12000 tweaks and features.
12002 @i{Adam Spiers} asked for global linking commands, inspired the link
12003 extension system, added support for mairix, and proposed the mapping API.
12005 @i{Andy Stewart} contributed code to @file{org-w3m.el}, to copy HTML content
12006 with links transformation to Org syntax.
12008 @i{David O'Toole} wrote @file{org-publish.el} and drafted the manual
12009 chapter about publishing.
12011 @i{J@"urgen Vollmer} contributed code generating the table of contents
12014 @i{Chris Wallace} provided a patch implementing the @samp{QUOTE}
12017 @i{David Wainberg} suggested archiving, and improvements to the linking
12020 @i{John Wiegley} wrote @file{emacs-wiki.el}, @file{planner.el}, and
12021 @file{muse.el}, which have some overlap with Org. Initially the development
12022 of Org was fully independent because I was not aware of the existence of
12023 these packages. But with time I have occasionally looked at John's code and
12024 learned a lot from it. John has also contributed a number of great ideas and
12025 patches directly to Org, including the attachment system
12026 (@file{org-attach.el}), integration with Apple Mail
12027 (@file{org-mac-message.el}), and hierarchical dependencies of TODO items.
12029 @i{Carsten Wimmer} suggested some changes and helped fix a bug in
12032 @i{Roland Winkler} requested additional key bindings to make Org
12035 @i{Piotr Zielinski} wrote @file{org-mouse.el}, proposed agenda blocks
12036 and contributed various ideas and code snippets.
12040 @node Main Index, Key Index, History and Acknowledgments, Top
12041 @unnumbered Concept Index
12045 @node Key Index, Variable Index, Main Index, Top
12046 @unnumbered Key Index
12050 @node Variable Index, , Key Index, Top
12051 @unnumbered Variable Index
12053 This is not a complete index of variables and faces, only the ones that are
12054 mentioned in the manual. For a more complete list, use @kbd{M-x
12055 org-customize @key{RET}} and then klick yourself through the tree.
12062 arch-tag: 7893d1Fe-cc57-4d13-b5e5-f494a1CBC7ac
12065 @c Local variables:
12066 @c ispell-local-dictionary: "en_US-w_accents"
12067 @c ispell-local-pdict: "./.aspell.org.pws"
12072 @c LocalWords: webdavhost pre