3 @setfilename ../../info/orgguide
4 @settitle The compact Org-mode Guide
6 @include org-version.inc
8 @c Use proper quote and backtick for code sections in PDF output
9 @c Cf. Texinfo manual 14.2
10 @set txicodequoteundirected
11 @set txicodequotebacktick
13 @c Version and Contact Info
14 @set MAINTAINERSITE @uref{http://orgmode.org,maintainers webpage}
15 @set AUTHOR Carsten Dominik
16 @set MAINTAINER Carsten Dominik
17 @set MAINTAINEREMAIL @email{carsten at orgmode dot org}
18 @set MAINTAINERCONTACT @uref{mailto:carsten at orgmode dot org,contact the maintainer}
24 @c @hyphenation{time-stamp time-stamps time-stamp-ing time-stamp-ed}
27 @c Subheadings inside a table.
28 @macro tsubheading{text}
38 @noindent @b{Further reading}@*@noindent \text\
42 Copyright @copyright{} 2010-2012 Free Software Foundation
45 Permission is granted to copy, distribute and/or modify this document
46 under the terms of the GNU Free Documentation License, Version 1.3 or
47 any later version published by the Free Software Foundation; with no
48 Invariant Sections, with the Front-Cover texts being ``A GNU Manual,''
49 and with the Back-Cover Texts as in (a) below. A copy of the license
50 is included in the section entitled ``GNU Free Documentation License.''
52 (a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
53 modify this GNU manual. Buying copies from the FSF supports it in
54 developing GNU and promoting software freedom.''
56 This document is part of a collection distributed under the GNU Free
57 Documentation License. If you want to distribute this document
58 separately from the collection, you can do so by adding a copy of the
59 license to the document, as described in section 6 of the license.
65 * Org Mode Guide: (orgguide). Abbreviated Org-mode Manual
69 @title The compact Org-mode Guide
71 @subtitle Release @value{VERSION}
72 @author by Carsten Dominik
74 @c The following two commands start the copyright page.
76 @vskip 0pt plus 1filll
80 @c Output the table of contents at the beginning.
84 @node Top, Introduction, (dir), (dir)
91 * Introduction:: Getting started
92 * Document Structure:: A tree works like your brain
93 * Tables:: Pure magic for quick formatting
94 * Hyperlinks:: Notes in context
95 * TODO Items:: Every tree branch can be a TODO item
96 * Tags:: Tagging headlines and matching sets of tags
97 * Properties:: Properties
98 * Dates and Times:: Making items useful for planning
99 * Capture - Refile - Archive:: The ins and outs for projects
100 * Agenda Views:: Collecting information into views
101 * Markup:: Prepare text for rich export
102 * Exporting:: Sharing and publishing of notes
103 * Publishing:: Create a web site of linked Org files
104 * Working With Source Code:: Source code snippets embedded in Org
105 * Miscellaneous:: All the rest which did not fit elsewhere
108 --- The Detailed Node Listing ---
113 * Installation:: How to install a downloaded version of Org
114 * Activation:: How to activate Org for certain buffers
115 * Feedback:: Bug reports, ideas, patches etc.
119 * Outlines:: Org is based on Outline mode
120 * Headlines:: How to typeset Org tree headlines
121 * Visibility cycling:: Show and hide, much simplified
122 * Motion:: Jumping to other headlines
123 * Structure editing:: Changing sequence and level of headlines
124 * Sparse trees:: Matches embedded in context
125 * Plain lists:: Additional structure within an entry
126 * Footnotes:: How footnotes are defined in Org's syntax
130 * Link format:: How links in Org are formatted
131 * Internal links:: Links to other places in the current file
132 * External links:: URL-like links to the world
133 * Handling links:: Creating, inserting and following
134 * Targeted links:: Point at a location in a file
138 * Using TODO states:: Setting and switching states
139 * Multi-state workflows:: More than just on/off
140 * Progress logging:: Dates and notes for progress
141 * Priorities:: Some things are more important than others
142 * Breaking down tasks:: Splitting a task into manageable pieces
143 * Checkboxes:: Tick-off lists
147 * Closing items:: When was this entry marked DONE?
148 * Tracking TODO state changes:: When did the status change?
152 * Tag inheritance:: Tags use the tree structure of the outline
153 * Setting tags:: How to assign tags to a headline
154 * Tag searches:: Searching for combinations of tags
158 * Timestamps:: Assigning a time to a tree entry
159 * Creating timestamps:: Commands which insert timestamps
160 * Deadlines and scheduling:: Planning your work
161 * Clocking work time:: Tracking how long you spend on a task
163 Capture - Refile - Archive
166 * Refile and copy:: Moving a tree from one place to another
167 * Archiving:: What to do with finished projects
171 * Setting up a capture location:: Where notes will be stored
172 * Using capture:: Commands to invoke and terminate capture
173 * Capture templates:: Define the outline of different note types
177 * Agenda files:: Files being searched for agenda information
178 * Agenda dispatcher:: Keyboard access to agenda views
179 * Built-in agenda views:: What is available out of the box?
180 * Agenda commands:: Remote editing of Org trees
181 * Custom agenda views:: Defining special searches and views
183 The built-in agenda views
185 * Weekly/daily agenda:: The calendar page with current tasks
186 * Global TODO list:: All unfinished action items
187 * Matching tags and properties:: Structured information with fine-tuned search
188 * Timeline:: Time-sorted view for single file
189 * Search view:: Find entries by searching for text
191 Markup for rich export
193 * Structural markup elements:: The basic structure as seen by the exporter
194 * Images and tables:: Tables and Images will be included
195 * Literal examples:: Source code examples with special formatting
196 * Include files:: Include additional files into a document
197 * Embedded @LaTeX{}:: @LaTeX{} can be freely used inside Org documents
199 Structural markup elements
201 * Document title:: Where the title is taken from
202 * Headings and sections:: The document structure as seen by the exporter
203 * Table of contents:: The if and where of the table of contents
204 * Paragraphs:: Paragraphs
205 * Emphasis and monospace:: Bold, italic, etc.
206 * Comment lines:: What will *not* be exported
210 * Export options:: Per-file export settings
211 * The export dispatcher:: How to access exporter commands
212 * ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding
213 * HTML export:: Exporting to HTML
214 * @LaTeX{} and PDF export:: Exporting to @LaTeX{}, and processing to PDF
215 * DocBook export:: Exporting to DocBook
220 * Completion:: M-TAB knows what you need
221 * Clean view:: Getting rid of leading stars in the outline
222 * MobileOrg:: Org-mode on the iPhone
227 @node Introduction, Document Structure, Top, Top
228 @chapter Introduction
232 * Installation:: How to install a downloaded version of Org
233 * Activation:: How to activate Org for certain buffers
234 * Feedback:: Bug reports, ideas, patches etc.
237 @node Preface, Installation, Introduction, Introduction
240 Org is a mode for keeping notes, maintaining TODO lists, and doing project
241 planning with a fast and effective plain-text system. It is also an
242 authoring and publishing system.
244 @i{This document is a much compressed derivative of the
245 @uref{http://orgmode.org/index.html#sec-4_1, comprehensive Org-mode manual}.
246 It contains all basic features and commands, along with important hints for
247 customization. It is intended for beginners who would shy back from a 200
248 page manual because of sheer size.}
250 @node Installation, Activation, Preface, Introduction
251 @section Installation
253 @b{Important:} @i{If you are using a version of Org that is part of the Emacs
254 distribution or an XEmacs package, please skip this section and go directly
255 to @ref{Activation}.}
257 If you have downloaded Org from the Web, either as a distribution @file{.zip}
258 or @file{.tar} file, or as a Git archive, it is best to run it directly from
259 the distribution directory. You need to add the @file{lisp} subdirectories
260 to the Emacs load path. To do this, add the following line to @file{.emacs}:
263 (setq load-path (cons "~/path/to/orgdir/lisp" load-path))
264 (setq load-path (cons "~/path/to/orgdir/contrib/lisp" load-path))
267 @noindent For speed you should byte-compile the Lisp files with the shell
274 @node Activation, Feedback, Installation, Introduction
277 Add the following lines to your @file{.emacs} file. The last three lines
278 define @emph{global} keys for some commands --- please choose suitable keys
282 ;; The following lines are always needed. Choose your own keys.
283 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode)) ; not needed since Emacs 22.2
284 (add-hook 'org-mode-hook 'turn-on-font-lock) ; not needed when global-font-lock-mode is on
285 (global-set-key "\C-cl" 'org-store-link)
286 (global-set-key "\C-ca" 'org-agenda)
287 (global-set-key "\C-cb" 'org-iswitchb)
290 With this setup, all files with extension @samp{.org} will be put
293 @node Feedback, , Activation, Introduction
296 If you find problems with Org, or if you have questions, remarks, or ideas
297 about it, please mail to the Org mailing list @email{emacs-orgmode@@gnu.org}.
298 For information on how to submit bug reports, see the main manual.
300 @node Document Structure, Tables, Introduction, Top
301 @chapter Document Structure
303 Org is based on Outline mode and provides flexible commands to
304 edit the structure of the document.
307 * Outlines:: Org is based on Outline mode
308 * Headlines:: How to typeset Org tree headlines
309 * Visibility cycling:: Show and hide, much simplified
310 * Motion:: Jumping to other headlines
311 * Structure editing:: Changing sequence and level of headlines
312 * Sparse trees:: Matches embedded in context
313 * Plain lists:: Additional structure within an entry
314 * Footnotes:: How footnotes are defined in Org's syntax
317 @node Outlines, Headlines, Document Structure, Document Structure
320 Org is implemented on top of Outline mode. Outlines allow a
321 document to be organized in a hierarchical structure, which (at least
322 for me) is the best representation of notes and thoughts. An overview
323 of this structure is achieved by folding (hiding) large parts of the
324 document to show only the general document structure and the parts
325 currently being worked on. Org greatly simplifies the use of
326 outlines by compressing the entire show/hide functionality into a single
327 command, @command{org-cycle}, which is bound to the @key{TAB} key.
329 @node Headlines, Visibility cycling, Outlines, Document Structure
332 Headlines define the structure of an outline tree. The headlines in
333 Org start with one or more stars, on the left margin@footnote{See
334 the variable @code{org-special-ctrl-a/e} to configure special behavior
335 of @kbd{C-a} and @kbd{C-e} in headlines.}. For example:
345 * Another top level headline
348 @noindent Some people find the many stars too noisy and would prefer an
349 outline that has whitespace followed by a single star as headline
350 starters. @ref{Clean view}, describes a setup to realize this.
352 @node Visibility cycling, Motion, Headlines, Document Structure
353 @section Visibility cycling
355 Outlines make it possible to hide parts of the text in the buffer.
356 Org uses just two commands, bound to @key{TAB} and
357 @kbd{S-@key{TAB}} to change the visibility in the buffer.
361 @emph{Subtree cycling}: Rotate current subtree among the states
364 ,-> FOLDED -> CHILDREN -> SUBTREE --.
365 '-----------------------------------'
368 When called with a prefix argument (@kbd{C-u @key{TAB}}) or with the shift
369 key, global cycling is invoked.
371 @item S-@key{TAB} @r{and} C-u @key{TAB}
372 @emph{Global cycling}: Rotate the entire buffer among the states
375 ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
376 '--------------------------------------'
379 @item C-u C-u C-u @key{TAB}
380 Show all, including drawers.
383 When Emacs first visits an Org file, the global state is set to
384 OVERVIEW, i.e.@: only the top level headlines are visible. This can be
385 configured through the variable @code{org-startup-folded}, or on a
386 per-file basis by adding a startup keyword @code{overview}, @code{content},
387 @code{showall}, like this:
394 @node Motion, Structure editing, Visibility cycling, Document Structure
396 The following commands jump to other headlines in the buffer.
404 Next heading same level.
406 Previous heading same level.
408 Backward to higher level heading.
411 @node Structure editing, Sparse trees, Motion, Document Structure
412 @section Structure editing
416 Insert new heading with same level as current. If the cursor is in a plain
417 list item, a new item is created (@pxref{Plain lists}). When this command is
418 used in the middle of a line, the line is split and the rest of the line
419 becomes the new headline@footnote{If you do not want the line to be split,
420 customize the variable @code{org-M-RET-may-split-line}.}.
422 Insert new TODO entry with same level as current heading.
423 @item @key{TAB} @r{in new, empty entry}
424 In a new entry with no text yet, @key{TAB} will cycle through reasonable
426 @item M-@key{left}@r{/}@key{right}
427 Promote/demote current heading by one level.
428 @item M-S-@key{left}@r{/}@key{right}
429 Promote/demote the current subtree by one level.
430 @item M-S-@key{up}@r{/}@key{down}
431 Move subtree up/down (swap with previous/next subtree of same
434 Refile entry or region to a different location. @xref{Refile and copy}.
436 Narrow buffer to current subtree / widen it again
439 When there is an active region (Transient Mark mode), promotion and
440 demotion work on all headlines in the region.
442 @node Sparse trees, Plain lists, Structure editing, Document Structure
443 @section Sparse trees
445 An important feature of Org mode is the ability to construct @emph{sparse
446 trees} for selected information in an outline tree, so that the entire
447 document is folded as much as possible, but the selected information is made
448 visible along with the headline structure above it@footnote{See also the
449 variables @code{org-show-hierarchy-above}, @code{org-show-following-heading},
450 @code{org-show-siblings}, and @code{org-show-entry-below} for detailed
451 control on how much context is shown around each match.}. Just try it out
452 and you will see immediately how it works.
454 Org mode contains several commands creating such trees, all these
455 commands can be accessed through a dispatcher:
459 This prompts for an extra key to select a sparse-tree creating command.
461 Occur. Prompts for a regexp and shows a sparse tree with all matches. Each
462 match is also highlighted; the highlights disappear by pressing @kbd{C-c C-c}.
465 The other sparse tree commands select headings based on TODO keywords,
466 tags, or properties and will be discussed later in this manual.
468 @node Plain lists, Footnotes, Sparse trees, Document Structure
471 Within an entry of the outline tree, hand-formatted lists can provide
472 additional structure. They also provide a way to create lists of
473 checkboxes (@pxref{Checkboxes}). Org supports editing such lists,
474 and the HTML exporter (@pxref{Exporting}) parses and formats them.
476 Org knows ordered lists, unordered lists, and description lists.
479 @emph{Unordered} list items start with @samp{-}, @samp{+}, or
482 @emph{Ordered} list items start with @samp{1.} or @samp{1)}.
484 @emph{Description} list use @samp{ :: } to separate the @emph{term} from the
488 Items belonging to the same list must have the same indentation on the first
489 line. An item ends before the next line that is indented like its
490 bullet/number, or less. A list ends when all items are closed, or before two
491 blank lines. An example:
496 My favorite scenes are (in this order)
497 1. The attack of the Rohirrim
498 2. Eowyn's fight with the witch king
499 + this was already my favorite scene in the book
500 + I really like Miranda Otto.
501 Important actors in this film are:
502 - @b{Elijah Wood} :: He plays Frodo
503 - @b{Sean Austin} :: He plays Sam, Frodo's friend.
507 The following commands act on items when the cursor is in the first line of
508 an item (the line with the bullet or number).
512 Items can be folded just like headline levels.
514 Insert new item at current level. With a prefix argument, force a new
515 heading (@pxref{Structure editing}).
517 Insert a new item with a checkbox (@pxref{Checkboxes}).
518 @item M-S-@key{up}@r{/}@key{down}
519 Move the item including subitems up/down (swap with previous/next item
520 of same indentation). If the list is ordered, renumbering is
522 @item M-@key{left}@r{/}M-@key{right}
523 Decrease/increase the indentation of an item, leaving children alone.
524 @item M-S-@key{left}@r{/}@key{right}
525 Decrease/increase the indentation of the item, including subitems.
527 If there is a checkbox (@pxref{Checkboxes}) in the item line, toggle the
528 state of the checkbox. Also verify bullets and indentation consistency in
531 Cycle the entire list level through the different itemize/enumerate bullets
532 (@samp{-}, @samp{+}, @samp{*}, @samp{1.}, @samp{1)}).
535 @node Footnotes, , Plain lists, Document Structure
538 A footnote is defined in a paragraph that is started by a footnote marker in
539 square brackets in column 0, no indentation allowed. The footnote reference
540 is simply the marker in square brackets, inside text. For example:
543 The Org homepage[fn:1] now looks a lot better than it used to.
545 [fn:1] The link is: http://orgmode.org
548 @noindent The following commands handle footnotes:
552 The footnote action command. When the cursor is on a footnote reference,
553 jump to the definition. When it is at a definition, jump to the (first)
554 reference. Otherwise, create a new footnote. When this command is called
555 with a prefix argument, a menu of additional options including renumbering is
559 Jump between definition and reference.
563 @uref{http://orgmode.org/manual/Document-Structure.html#Document-Structure,
564 Chapter 2 of the manual}@*
565 @uref{http://sachachua.com/wp/2008/01/outlining-your-notes-with-org/,
566 Sacha Chua's tutorial}}
569 @node Tables, Hyperlinks, Document Structure, Top
572 Org comes with a fast and intuitive table editor. Spreadsheet-like
573 calculations are supported in connection with the Emacs @file{calc}
576 (@pxref{Top,Calc,,Calc,Gnu Emacs Calculator Manual}).
579 (see the Emacs Calculator manual for more information about the Emacs
583 Org makes it easy to format tables in plain ASCII. Any line with
584 @samp{|} as the first non-whitespace character is considered part of a
585 table. @samp{|} is also the column separator. A table might look like
589 | Name | Phone | Age |
590 |-------+-------+-----|
591 | Peter | 1234 | 17 |
595 A table is re-aligned automatically each time you press @key{TAB} or
596 @key{RET} or @kbd{C-c C-c} inside the table. @key{TAB} also moves to
597 the next field (@key{RET} to the next row) and creates new table rows
598 at the end of the table or before horizontal lines. The indentation
599 of the table is set by the first line. Any line starting with
600 @samp{|-} is considered as a horizontal separator line and will be
601 expanded on the next re-align to span the whole table width. So, to
602 create the above table, you would only type
609 @noindent and then press @key{TAB} to align the table and start filling in
610 fields. Even faster would be to type @code{|Name|Phone|Age} followed by
613 When typing text into a field, Org treats @key{DEL},
614 @key{Backspace}, and all character keys in a special way, so that
615 inserting and deleting avoids shifting other fields. Also, when
616 typing @emph{immediately after the cursor was moved into a new field
617 with @kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}}, the
618 field is automatically made blank.
621 @tsubheading{Creation and conversion}
623 Convert the active region to table. If every line contains at least one TAB
624 character, the function assumes that the material is tab separated. If every
625 line contains a comma, comma-separated values (CSV) are assumed. If not,
626 lines are split at whitespace into fields.
628 If there is no active region, this command creates an empty Org
629 table. But it's easier just to start typing, like
630 @kbd{|Name|Phone|Age C-c @key{RET}}.
632 @tsubheading{Re-aligning and field motion}
634 Re-align the table without moving the cursor.
637 Re-align the table, move to the next field. Creates a new row if
641 Re-align, move to previous field.
644 Re-align the table and move down to next row. Creates a new row if
647 @tsubheading{Column and row editing}
650 Move the current column left/right.
653 Kill the current column.
655 @item M-S-@key{right}
656 Insert a new column to the left of the cursor position.
660 Move the current row up/down.
663 Kill the current row or horizontal line.
666 Insert a new row above the current row. With a prefix argument, the line is
667 created below the current one.
670 Insert a horizontal line below current row. With a prefix argument, the line
671 is created above the current line.
674 Insert a horizontal line below current row, and move the cursor into the row
678 Sort the table lines in the region. The position of point indicates the
679 column to be used for sorting, and the range of lines is the range
680 between the nearest horizontal separator lines, or the entire table.
685 @uref{http://orgmode.org/manual/Tables.html#Tables, Chapter 3 of the
687 @uref{http://orgmode.org/worg/org-tutorials/tables.php, Bastien's
689 @uref{http://orgmode.org/worg/org-tutorials/org-spreadsheet-intro.php,
690 Bastien's spreadsheet tutorial}@*
691 @uref{http://orgmode.org/worg/org-tutorials/org-plot.php, Eric's plotting tutorial}}
693 @node Hyperlinks, TODO Items, Tables, Top
696 Like HTML, Org provides links inside a file, external links to
697 other files, Usenet articles, emails, and much more.
700 * Link format:: How links in Org are formatted
701 * Internal links:: Links to other places in the current file
702 * External links:: URL-like links to the world
703 * Handling links:: Creating, inserting and following
704 * Targeted links:: Point at a location in a file
707 @node Link format, Internal links, Hyperlinks, Hyperlinks
710 Org will recognize plain URL-like links and activate them as
711 clickable links. The general link format, however, looks like this:
714 [[link][description]] @r{or alternatively} [[link]]
718 Once a link in the buffer is complete (all brackets present), Org will change
719 the display so that @samp{description} is displayed instead of
720 @samp{[[link][description]]} and @samp{link} is displayed instead of
721 @samp{[[link]]}. To edit the invisible @samp{link} part, use @kbd{C-c
722 C-l} with the cursor on the link.
724 @node Internal links, External links, Link format, Hyperlinks
725 @section Internal links
727 If the link does not look like a URL, it is considered to be internal in the
728 current file. The most important case is a link like
729 @samp{[[#my-custom-id]]} which will link to the entry with the
730 @code{CUSTOM_ID} property @samp{my-custom-id}.
732 Links such as @samp{[[My Target]]} or @samp{[[My Target][Find my target]]}
733 lead to a text search in the current file for the corresponding target which
734 looks like @samp{<<My Target>>}.
736 @node External links, Handling links, Internal links, Hyperlinks
737 @section External links
739 Org supports links to files, websites, Usenet and email messages,
740 BBDB database entries and links to both IRC conversations and their
741 logs. External links are URL-like locators. They start with a short
742 identifying string followed by a colon. There can be no space after
743 the colon. Here are some examples:
746 http://www.astro.uva.nl/~dominik @r{on the web}
747 file:/home/dominik/images/jupiter.jpg @r{file, absolute path}
748 /home/dominik/images/jupiter.jpg @r{same as above}
749 file:papers/last.pdf @r{file, relative path}
750 file:projects.org @r{another Org file}
751 docview:papers/last.pdf::NNN @r{open file in doc-view mode at page NNN}
752 id:B7423F4D-2E8A-471B-8810-C40F074717E9 @r{Link to heading by ID}
753 news:comp.emacs @r{Usenet link}
754 mailto:adent@@galaxy.net @r{Mail link}
755 vm:folder @r{VM folder link}
756 vm:folder#id @r{VM message link}
757 wl:folder#id @r{WANDERLUST message link}
758 mhe:folder#id @r{MH-E message link}
759 rmail:folder#id @r{RMAIL message link}
760 gnus:group#id @r{Gnus article link}
761 bbdb:R.*Stallman @r{BBDB link (with regexp)}
762 irc:/irc.com/#emacs/bob @r{IRC link}
763 info:org:External%20links @r{Info node link (with encoded space)}
766 A link should be enclosed in double brackets and may contain a
767 descriptive text to be displayed instead of the URL (@pxref{Link
768 format}), for example:
771 [[http://www.gnu.org/software/emacs/][GNU Emacs]]
775 If the description is a file name or URL that points to an image, HTML export
776 (@pxref{HTML export}) will inline the image as a clickable button. If there
777 is no description at all and the link points to an image, that image will be
778 inlined into the exported HTML file.
780 @node Handling links, Targeted links, External links, Hyperlinks
781 @section Handling links
783 Org provides methods to create a link in the correct syntax, to
784 insert it into an Org file, and to follow the link.
788 Store a link to the current location. This is a @emph{global} command (you
789 must create the key binding yourself) which can be used in any buffer to
790 create a link. The link will be stored for later insertion into an Org
794 Insert a link. This prompts for a link to be inserted into the buffer. You
795 can just type a link, or use history keys @key{up} and @key{down} to access
796 stored links. You will be prompted for the description part of the link.
797 When called with a @kbd{C-u} prefix argument, file name completion is used to
800 @item C-c C-l @r{(with cursor on existing link)}
801 When the cursor is on an existing link, @kbd{C-c C-l} allows you to edit the
802 link and description parts of the link.
804 @item C-c C-o @r{or} mouse-1 @r{or} mouse-2
807 Jump back to a recorded position. A position is recorded by the
808 commands following internal links, and by @kbd{C-c %}. Using this
809 command several times in direct succession moves through a ring of
810 previously recorded positions.
814 @node Targeted links, , Handling links, Hyperlinks
815 @section Targeted links
817 File links can contain additional information to make Emacs jump to a
818 particular location in the file when following a link. This can be a
819 line number or a search option after a double colon.
821 Here is the syntax of the different ways to attach a search to a file
822 link, together with an explanation:
825 [[file:~/code/main.c::255]] @r{Find line 255}
826 [[file:~/xx.org::My Target]] @r{Find @samp{<<My Target>>}}
827 [[file:~/xx.org::#my-custom-id]] @r{Find entry with custom id}
831 @uref{http://orgmode.org/manual/Hyperlinks.html#Hyperlinks, Chapter 4 of the
834 @node TODO Items, Tags, Hyperlinks, Top
837 Org mode does not maintain TODO lists as separate documents@footnote{Of
838 course, you can make a document that contains only long lists of TODO items,
839 but this is not required.}. Instead, TODO items are an integral part of the
840 notes file, because TODO items usually come up while taking notes! With Org
841 mode, simply mark any entry in a tree as being a TODO item. In this way,
842 information is not duplicated, and the entire context from which the TODO
843 item emerged is always present.
845 Of course, this technique for managing TODO items scatters them
846 throughout your notes file. Org mode compensates for this by providing
847 methods to give you an overview of all the things that you have to do.
850 * Using TODO states:: Setting and switching states
851 * Multi-state workflows:: More than just on/off
852 * Progress logging:: Dates and notes for progress
853 * Priorities:: Some things are more important than others
854 * Breaking down tasks:: Splitting a task into manageable pieces
855 * Checkboxes:: Tick-off lists
858 @node Using TODO states, Multi-state workflows, TODO Items, TODO Items
859 @section Using TODO states
861 Any headline becomes a TODO item when it starts with the word
862 @samp{TODO}, for example:
865 *** TODO Write letter to Sam Fortune
869 The most important commands to work with TODO entries are:
873 Rotate the TODO state of the current item among
876 ,-> (unmarked) -> TODO -> DONE --.
877 '--------------------------------'
880 The same rotation can also be done ``remotely'' from the timeline and
881 agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
883 @item S-@key{right}@r{/}@key{left}
884 Select the following/preceding TODO state, similar to cycling.
886 View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}). Folds the
887 buffer, but shows all TODO items and the headings hierarchy above
890 Show the global TODO list. Collects the TODO items from all agenda files
891 (@pxref{Agenda Views}) into a single buffer. @xref{Global TODO list}, for
894 Insert a new TODO entry below the current one.
898 Changing a TODO state can also trigger tag changes. See the docstring of the
899 option @code{org-todo-state-tags-triggers} for details.
901 @node Multi-state workflows, Progress logging, Using TODO states, TODO Items
902 @section Multi-state workflows
904 You can use TODO keywords to indicate different @emph{sequential} states
905 in the process of working on an item, for example:
908 (setq org-todo-keywords
909 '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
912 The vertical bar separates the TODO keywords (states that @emph{need
913 action}) from the DONE states (which need @emph{no further action}). If
914 you don't provide the separator bar, the last state is used as the DONE
916 With this setup, the command @kbd{C-c C-t} will cycle an entry from TODO
917 to FEEDBACK, then to VERIFY, and finally to DONE and DELEGATED.
919 Sometimes you may want to use different sets of TODO keywords in
920 parallel. For example, you may want to have the basic
921 @code{TODO}/@code{DONE}, but also a workflow for bug fixing, and a
922 separate state indicating that an item has been canceled (so it is not
923 DONE, but also does not require action). Your setup would then look
927 (setq org-todo-keywords
928 '((sequence "TODO(t)" "|" "DONE(d)")
929 (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")
930 (sequence "|" "CANCELED(c)")))
933 The keywords should all be different, this helps Org mode to keep track of
934 which subsequence should be used for a given entry. The example also shows
935 how to define keys for fast access of a particular state, by adding a letter
936 in parenthesis after each keyword - you will be prompted for the key after
939 To define TODO keywords that are valid only in a single file, use the
940 following text anywhere in the file.
943 #+TODO: TODO(t) | DONE(d)
944 #+TODO: REPORT(r) BUG(b) KNOWNCAUSE(k) | FIXED(f)
945 #+TODO: | CANCELED(c)
948 After changing one of these lines, use @kbd{C-c C-c} with the cursor still in
949 the line to make the changes known to Org mode.
951 @node Progress logging, Priorities, Multi-state workflows, TODO Items
952 @section Progress logging
954 Org mode can automatically record a timestamp and possibly a note when
955 you mark a TODO item as DONE, or even each time you change the state of
956 a TODO item. This system is highly configurable, settings can be on a
957 per-keyword basis and can be localized to a file or even a subtree. For
958 information on how to clock working time for a task, see @ref{Clocking
962 * Closing items:: When was this entry marked DONE?
963 * Tracking TODO state changes:: When did the status change?
966 @node Closing items, Tracking TODO state changes, Progress logging, Progress logging
967 @unnumberedsubsec Closing items
969 The most basic logging is to keep track of @emph{when} a certain TODO
970 item was finished. This is achieved with@footnote{The corresponding
971 in-buffer setting is: @code{#+STARTUP: logdone}}.
974 (setq org-log-done 'time)
978 Then each time you turn an entry from a TODO (not-done) state into any of the
979 DONE states, a line @samp{CLOSED: [timestamp]} will be inserted just after
980 the headline. If you want to record a note along with the timestamp,
981 use@footnote{The corresponding in-buffer setting is: @code{#+STARTUP:
985 (setq org-log-done 'note)
989 You will then be prompted for a note, and that note will be stored below
990 the entry with a @samp{Closing Note} heading.
992 @node Tracking TODO state changes, , Closing items, Progress logging
993 @unnumberedsubsec Tracking TODO state changes
995 You might want to keep track of TODO state changes. You can either record
996 just a timestamp, or a time-stamped note for a change. These records will be
997 inserted after the headline as an itemized list. When taking a lot of notes,
998 you might want to get the notes out of the way into a drawer. Customize the
999 variable @code{org-log-into-drawer} to get this behavior.
1001 For state logging, Org mode expects configuration on a per-keyword basis.
1002 This is achieved by adding special markers @samp{!} (for a timestamp) and
1003 @samp{@@} (for a note) in parentheses after each keyword. For example:
1005 #+TODO: TODO(t) WAIT(w@@/!) | DONE(d!) CANCELED(c@@)
1008 will define TODO keywords and fast access keys, and also request that a time
1009 is recorded when the entry is set to DONE, and that a note is recorded when
1010 switching to WAIT or CANCELED. The same syntax works also when setting
1011 @code{org-todo-keywords}.
1013 @node Priorities, Breaking down tasks, Progress logging, TODO Items
1016 If you use Org mode extensively, you may end up with enough TODO items that
1017 it starts to make sense to prioritize them. Prioritizing can be done by
1018 placing a @emph{priority cookie} into the headline of a TODO item, like this
1021 *** TODO [#A] Write letter to Sam Fortune
1025 Org mode supports three priorities: @samp{A}, @samp{B}, and @samp{C}.
1026 @samp{A} is the highest, @samp{B} the default if none is given. Priorities
1027 make a difference only in the agenda.
1031 Set the priority of the current headline. Press @samp{A}, @samp{B} or
1032 @samp{C} to select a priority, or @key{SPC} to remove the cookie.
1036 Increase/decrease priority of current headline
1039 @node Breaking down tasks, Checkboxes, Priorities, TODO Items
1040 @section Breaking tasks down into subtasks
1042 It is often advisable to break down large tasks into smaller, manageable
1043 subtasks. You can do this by creating an outline tree below a TODO item,
1044 with detailed subtasks on the tree. To keep the overview over the fraction
1045 of subtasks that are already completed, insert either @samp{[/]} or
1046 @samp{[%]} anywhere in the headline. These cookies will be updated each time
1047 the TODO status of a child changes, or when pressing @kbd{C-c C-c} on the
1048 cookie. For example:
1051 * Organize Party [33%]
1052 ** TODO Call people [1/2]
1056 ** DONE Talk to neighbor
1059 @node Checkboxes, , Breaking down tasks, TODO Items
1062 Every item in a plain list (@pxref{Plain lists}) can be made into a checkbox
1063 by starting it with the string @samp{[ ]}. Checkboxes are not included into
1064 the global TODO list, so they are often great to split a task into a number
1066 Here is an example of a checkbox list.
1069 * TODO Organize party [1/3]
1070 - [-] call people [1/2]
1074 - [ ] think about what music to play
1077 Checkboxes work hierarchically, so if a checkbox item has children that
1078 are checkboxes, toggling one of the children checkboxes will make the
1079 parent checkbox reflect if none, some, or all of the children are
1082 @noindent The following commands work with checkboxes:
1086 Toggle checkbox status or (with prefix arg) checkbox presence at point.
1088 Insert a new item with a checkbox.
1089 This works only if the cursor is already in a plain list item
1090 (@pxref{Plain lists}).
1094 @uref{http://orgmode.org/manual/TODO-Items.html#TODO-Items, Chapter 5 of the manual}@*
1095 @uref{http://orgmode.org/worg/org-tutorials/orgtutorial_dto.php, David
1096 O'Toole's introductory tutorial}@*
1097 @uref{http://members.optusnet.com.au/~charles57/GTD/gtd_workflow.html,
1098 Charles Cave's GTD setup}}
1100 @node Tags, Properties, TODO Items, Top
1103 An excellent way to implement labels and contexts for cross-correlating
1104 information is to assign @i{tags} to headlines. Org mode has extensive
1107 Every headline can contain a list of tags; they occur at the end of the
1108 headline. Tags are normal words containing letters, numbers, @samp{_}, and
1109 @samp{@@}. Tags must be preceded and followed by a single colon, e.g.,
1110 @samp{:work:}. Several tags can be specified, as in @samp{:work:urgent:}.
1111 Tags will by default be in bold face with the same color as the headline.
1114 * Tag inheritance:: Tags use the tree structure of the outline
1115 * Setting tags:: How to assign tags to a headline
1116 * Tag searches:: Searching for combinations of tags
1119 @node Tag inheritance, Setting tags, Tags, Tags
1120 @section Tag inheritance
1122 @i{Tags} make use of the hierarchical structure of outline trees. If a
1123 heading has a certain tag, all subheadings will inherit the tag as
1124 well. For example, in the list
1127 * Meeting with the French group :work:
1128 ** Summary by Frank :boss:notes:
1129 *** TODO Prepare slides for him :action:
1133 the final heading will have the tags @samp{:work:}, @samp{:boss:},
1134 @samp{:notes:}, and @samp{:action:} even though the final heading is not
1135 explicitly marked with those tags. You can also set tags that all entries in
1136 a file should inherit just as if these tags were defined in a hypothetical
1137 level zero that surrounds the entire file. Use a line like this@footnote{As
1138 with all these in-buffer settings, pressing @kbd{C-c C-c} activates any
1139 changes in the line.}:
1142 #+FILETAGS: :Peter:Boss:Secret:
1145 @node Setting tags, Tag searches, Tag inheritance, Tags
1146 @section Setting tags
1148 Tags can simply be typed into the buffer at the end of a headline.
1149 After a colon, @kbd{M-@key{TAB}} offers completion on tags. There is
1150 also a special command for inserting tags:
1154 Enter new tags for the current headline. Org mode will either offer
1155 completion or a special single-key interface for setting tags, see
1156 below. After pressing @key{RET}, the tags will be inserted and aligned
1157 to @code{org-tags-column}. When called with a @kbd{C-u} prefix, all
1158 tags in the current buffer will be aligned to that column, just to make
1161 When the cursor is in a headline, this does the same as @kbd{C-c C-q}.
1164 Org will support tag insertion based on a @emph{list of tags}. By
1165 default this list is constructed dynamically, containing all tags
1166 currently used in the buffer. You may also globally specify a hard list
1167 of tags with the variable @code{org-tag-alist}. Finally you can set
1168 the default tags for a given file with lines like
1171 #+TAGS: @@work @@home @@tennisclub
1172 #+TAGS: laptop car pc sailboat
1175 By default Org mode uses the standard minibuffer completion facilities for
1176 entering tags. However, it also implements another, quicker, tag selection
1177 method called @emph{fast tag selection}. This allows you to select and
1178 deselect tags with just a single key press. For this to work well you should
1179 assign unique letters to most of your commonly used tags. You can do this
1180 globally by configuring the variable @code{org-tag-alist} in your
1181 @file{.emacs} file. For example, you may find the need to tag many items in
1182 different files with @samp{:@@home:}. In this case you can set something
1186 (setq org-tag-alist '(("@@work" . ?w) ("@@home" . ?h) ("laptop" . ?l)))
1189 @noindent If the tag is only relevant to the file you are working on, then you
1190 can instead set the TAGS option line as:
1193 #+TAGS: @@work(w) @@home(h) @@tennisclub(t) laptop(l) pc(p)
1196 @node Tag searches, , Setting tags, Tags
1197 @section Tag searches
1199 Once a system of tags has been set up, it can be used to collect related
1200 information into special lists.
1205 Create a sparse tree with all headlines matching a tags search. With a
1206 @kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
1208 Create a global list of tag matches from all agenda files.
1209 @xref{Matching tags and properties}.
1211 Create a global list of tag matches from all agenda files, but check
1212 only TODO items and force checking subitems (see variable
1213 @code{org-tags-match-list-sublevels}).
1216 These commands all prompt for a match string which allows basic Boolean logic
1217 like @samp{+boss+urgent-project1}, to find entries with tags @samp{boss} and
1218 @samp{urgent}, but not @samp{project1}, or @samp{Kathy|Sally} to find entries
1219 which are tagged, like @samp{Kathy} or @samp{Sally}. The full syntax of the
1220 search string is rich and allows also matching against TODO keywords, entry
1221 levels and properties. For a complete description with many examples, see
1222 @ref{Matching tags and properties}.
1225 @uref{http://orgmode.org/manual/Tags.html#Tags, Chapter 6 of the manual}@*
1226 @uref{http://sachachua.com/wp/2008/01/tagging-in-org-plus-bonus-code-for-timeclocks-and-tags/,
1227 Sacha Chua's article about tagging in Org-mode}}
1229 @node Properties, Dates and Times, Tags, Top
1232 Properties are key-value pairs associates with and entry. They live in a
1233 special drawer with the name @code{PROPERTIES}. Each
1234 property is specified on a single line, with the key (surrounded by colons)
1235 first, and the value after it:
1240 *** Goldberg Variations
1242 :Title: Goldberg Variations
1243 :Composer: J.S. Bach
1244 :Publisher: Deutsche Grammophon
1249 You may define the allowed values for a particular property @samp{:Xyz:}
1250 by setting a property @samp{:Xyz_ALL:}. This special property is
1251 @emph{inherited}, so if you set it in a level 1 entry, it will apply to
1252 the entire tree. When allowed values are defined, setting the
1253 corresponding property becomes easier and is less prone to typing
1254 errors. For the example with the CD collection, we can predefine
1255 publishers and the number of disks in a box like this:
1260 :NDisks_ALL: 1 2 3 4
1261 :Publisher_ALL: "Deutsche Grammophon" Philips EMI
1264 or globally using @code{org-global-properties}, or file-wide like this:
1266 #+PROPERTY: NDisks_ALL 1 2 3 4
1271 Set a property. This prompts for a property name and a value.
1273 Remove a property from the current entry.
1276 To create sparse trees and special lists with selection based on properties,
1277 the same commands are used as for tag searches (@pxref{Tag searches}). The
1278 syntax for the search string is described in @ref{Matching tags and
1285 @uref{http://orgmode.org/manual/Properties-and-Columns.html#Properties-and-Columns,
1286 Chapter 7 of the manual}@*
1287 @uref{http://orgmode.org/worg/org-tutorials/org-column-view-tutorial.php,Bastien
1288 Guerry's column view tutorial}}
1290 @node Dates and Times, Capture - Refile - Archive, Properties, Top
1291 @chapter Dates and Times
1293 To assist project planning, TODO items can be labeled with a date and/or
1294 a time. The specially formatted string carrying the date and time
1295 information is called a @emph{timestamp} in Org mode.
1298 * Timestamps:: Assigning a time to a tree entry
1299 * Creating timestamps:: Commands which insert timestamps
1300 * Deadlines and scheduling:: Planning your work
1301 * Clocking work time:: Tracking how long you spend on a task
1305 @node Timestamps, Creating timestamps, Dates and Times, Dates and Times
1308 A timestamp is a specification of a date (possibly with a time or a range of
1309 times) in a special format, either @samp{<2003-09-16 Tue>} or
1310 @samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16 Tue 12:00-12:30>}. A
1311 timestamp can appear anywhere in the headline or body of an Org tree entry.
1312 Its presence causes entries to be shown on specific dates in the agenda
1313 (@pxref{Weekly/daily agenda}). We distinguish:
1315 @noindent @b{Plain timestamp; Event; Appointment}@*
1316 A simple timestamp just assigns a date/time to an item. This is just
1317 like writing down an appointment or event in a paper agenda.
1320 * Meet Peter at the movies
1321 <2006-11-01 Wed 19:15>
1322 * Discussion on climate change
1323 <2006-11-02 Thu 20:00-22:00>
1326 @noindent @b{Timestamp with repeater interval}@*
1327 A timestamp may contain a @emph{repeater interval}, indicating that it
1328 applies not only on the given date, but again and again after a certain
1329 interval of N days (d), weeks (w), months (m), or years (y). The
1330 following will show up in the agenda every Wednesday:
1332 * Pick up Sam at school
1333 <2007-05-16 Wed 12:30 +1w>
1336 @noindent @b{Diary-style sexp entries}@*
1337 For more complex date specifications, Org mode supports using the
1338 special sexp diary entries implemented in the Emacs calendar/diary
1339 package. For example
1341 * The nerd meeting on every 2nd Thursday of the month
1342 <%%(diary-float t 4 2)>
1345 @noindent @b{Time/Date range}@*
1346 Two timestamps connected by @samp{--} denote a range.
1348 ** Meeting in Amsterdam
1349 <2004-08-23 Mon>--<2004-08-26 Thu>
1352 @noindent @b{Inactive timestamp}@*
1353 Just like a plain timestamp, but with square brackets instead of
1354 angular ones. These timestamps are inactive in the sense that they do
1355 @emph{not} trigger an entry to show up in the agenda.
1358 * Gillian comes late for the fifth time
1363 @node Creating timestamps, Deadlines and scheduling, Timestamps, Dates and Times
1364 @section Creating timestamps
1366 For Org mode to recognize timestamps, they need to be in the specific
1367 format. All commands listed below produce timestamps in the correct
1372 Prompt for a date and insert a corresponding timestamp. When the cursor is
1373 at an existing timestamp in the buffer, the command is used to modify this
1374 timestamp instead of inserting a new one. When this command is used twice in
1375 succession, a time range is inserted. With a prefix, also add the current
1379 Like @kbd{C-c .}, but insert an inactive timestamp that will not cause
1382 @item S-@key{left}@r{/}@key{right}
1383 Change date at cursor by one day.
1385 @item S-@key{up}@r{/}@key{down}
1386 Change the item under the cursor in a timestamp. The cursor can be on a
1387 year, month, day, hour or minute. When the timestamp contains a time range
1388 like @samp{15:30-16:30}, modifying the first time will also shift the second,
1389 shifting the time block with constant length. To change the length, modify
1393 When Org mode prompts for a date/time, it will accept any string containing
1394 some date and/or time information, and intelligently interpret the string,
1395 deriving defaults for unspecified information from the current date and time.
1396 You can also select a date in the pop-up calendar. See the manual for more
1397 information on how exactly the date/time prompt works.
1399 @node Deadlines and scheduling, Clocking work time, Creating timestamps, Dates and Times
1400 @section Deadlines and scheduling
1402 A timestamp may be preceded by special keywords to facilitate planning:
1404 @noindent @b{DEADLINE}@*
1405 Meaning: the task (most likely a TODO item, though not necessarily) is supposed
1406 to be finished on that date.
1409 Insert @samp{DEADLINE} keyword along with a stamp, in the line following the
1413 On the deadline date, the task will be listed in the agenda. In
1414 addition, the agenda for @emph{today} will carry a warning about the
1415 approaching or missed deadline, starting
1416 @code{org-deadline-warning-days} before the due date, and continuing
1417 until the entry is marked DONE. An example:
1420 *** TODO write article about the Earth for the Guide
1421 The editor in charge is [[bbdb:Ford Prefect]]
1422 DEADLINE: <2004-02-29 Sun>
1426 @noindent @b{SCHEDULED}@*
1427 Meaning: you are @i{planning to start working} on that task on the given
1428 date@footnote{This is quite different from what is normally understood by
1429 @i{scheduling a meeting}, which is done in Org-mode by just inserting a time
1430 stamp without keyword.}.
1434 Insert @samp{SCHEDULED} keyword along with a stamp, in the line following the
1438 The headline will be listed under the given date@footnote{It will still
1439 be listed on that date after it has been marked DONE. If you don't like
1440 this, set the variable @code{org-agenda-skip-scheduled-if-done}.}. In
1441 addition, a reminder that the scheduled date has passed will be present
1442 in the compilation for @emph{today}, until the entry is marked DONE.
1443 I.e.@: the task will automatically be forwarded until completed.
1446 *** TODO Call Trillian for a date on New Years Eve.
1447 SCHEDULED: <2004-12-25 Sat>
1450 Some tasks need to be repeated again and again. Org mode helps to
1451 organize such tasks using a so-called repeater in a DEADLINE, SCHEDULED,
1452 or plain timestamp. In the following example
1454 ** TODO Pay the rent
1455 DEADLINE: <2005-10-01 Sat +1m>
1458 the @code{+1m} is a repeater; the intended interpretation is that the task
1459 has a deadline on <2005-10-01> and repeats itself every (one) month starting
1462 @node Clocking work time, , Deadlines and scheduling, Dates and Times
1463 @section Clocking work time
1465 Org mode allows you to clock the time you spend on specific tasks in a
1470 Start the clock on the current item (clock-in). This inserts the CLOCK
1471 keyword together with a timestamp. When called with a @kbd{C-u} prefix
1472 argument, select the task from a list of recently clocked tasks.
1475 Stop the clock (clock-out). This inserts another timestamp at the same
1476 location where the clock was last started. It also directly computes
1477 the resulting time in inserts it after the time range as @samp{=>
1480 Update the effort estimate for the current clock task.
1482 Cancel the current clock. This is useful if a clock was started by
1483 mistake, or if you ended up working on something else.
1485 Jump to the entry that contains the currently running clock. With a
1486 @kbd{C-u} prefix arg, select the target task from a list of recently clocked
1489 Insert a dynamic block containing a clock
1490 report as an Org-mode table into the current file. When the cursor is
1491 at an existing clock table, just update it.
1493 #+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file
1497 For details about how to customize this view, see @uref{http://orgmode.org/manual/Clocking-work-time.html#Clocking-work-time,the manual}.
1499 Update dynamic block at point. The cursor needs to be in the
1500 @code{#+BEGIN} line of the dynamic block.
1503 The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
1504 the agenda (@pxref{Weekly/daily agenda}) to show which tasks have been
1505 worked on or closed during a day.
1508 @uref{http://orgmode.org/manual/Dates-and-Times.html#Dates-and-Times,
1509 Chapter 8 of the manual}@*
1510 @uref{http://members.optusnet.com.au/~charles57/GTD/org_dates/, Charles
1511 Cave's Date and Time tutorial}@*
1512 @uref{http://doc.norang.ca/org-mode.html#Clocking, Bernt Hansen's clocking workflow}}
1514 @node Capture - Refile - Archive, Agenda Views, Dates and Times, Top
1515 @chapter Capture - Refile - Archive
1517 An important part of any organization system is the ability to quickly
1518 capture new ideas and tasks, and to associate reference material with them.
1519 Org defines a capture process to create tasks. It stores files related to a
1520 task (@i{attachments}) in a special directory. Once in the system, tasks and
1521 projects need to be moved around. Moving completed project trees to an
1522 archive file keeps the system compact and fast.
1526 * Refile and copy:: Moving a tree from one place to another
1527 * Archiving:: What to do with finished projects
1530 @node Capture, Refile and copy, Capture - Refile - Archive, Capture - Refile - Archive
1533 Org's method for capturing new items is heavily inspired by John Wiegley
1534 excellent remember package. It lets you store quick notes with little
1535 interruption of your work flow. Org lets you define templates for new
1536 entries and associate them with different targets for storing notes.
1539 * Setting up a capture location:: Where notes will be stored
1540 * Using capture:: Commands to invoke and terminate capture
1541 * Capture templates:: Define the outline of different note types
1544 @node Setting up a capture location, Using capture, Capture, Capture
1545 @unnumberedsubsec Setting up a capture location
1547 The following customization sets a default target@footnote{Using capture
1548 templates, you can define more fine-grained capture locations, see
1549 @ref{Capture templates}.} file for notes, and defines a global
1550 key@footnote{Please select your own key, @kbd{C-c c} is only a suggestion.}
1551 for capturing new stuff.
1554 (setq org-default-notes-file (concat org-directory "/notes.org"))
1555 (define-key global-map "\C-cc" 'org-capture)
1558 @node Using capture, Capture templates, Setting up a capture location, Capture
1559 @unnumberedsubsec Using capture
1563 Start a capture process. You will be placed into a narrowed indirect buffer
1566 Once you are done entering information into the capture buffer,
1567 @kbd{C-c C-c} will return you to the window configuration before the capture
1568 process, so that you can resume your work without further distraction.
1570 Finalize by moving the entry to a refile location (@pxref{Refile and copy}).
1572 Abort the capture process and return to the previous state.
1575 @node Capture templates, , Using capture, Capture
1576 @unnumberedsubsec Capture templates
1578 You can use templates to generate different types of capture notes, and to
1579 store them in different places. For example, if you would like
1580 to store new tasks under a heading @samp{Tasks} in file @file{TODO.org}, and
1581 journal entries in a date tree in @file{journal.org} you could
1585 (setq org-capture-templates
1586 '(("t" "Todo" entry (file+headline "~/org/gtd.org" "Tasks")
1587 "* TODO %?\n %i\n %a")
1588 ("j" "Journal" entry (file+datetree "~/org/journal.org")
1589 "* %?\nEntered on %U\n %i\n %a")))
1592 @noindent In these entries, the first string is the key to reach the
1593 template, the second is a short description. Then follows the type of the
1594 entry and a definition of the target location for storing the note. Finally,
1595 the template itself, a string with %-escapes to fill in information based on
1598 When you call @kbd{M-x org-capture}, Org will prompt for a key to select the
1599 template (if you have more than one template) and then prepare the buffer like
1602 [[file:@var{link to where you were when initiating capture}]]
1606 During expansion of the template, special @kbd{%}-escapes@footnote{If you
1607 need one of these sequences literally, escape the @kbd{%} with a backslash.}
1608 allow dynamic insertion of content. Here is a small selection of the
1609 possibilities, consult the manual for more.
1611 %a @r{annotation, normally the link created with @code{org-store-link}}
1612 %i @r{initial content, the region when remember is called with C-u.}
1613 %t @r{timestamp, date only}
1614 %T @r{timestamp with date and time}
1615 %u, %U @r{like the above, but inactive timestamps}
1618 @node Refile and copy, Archiving, Capture, Capture - Refile - Archive
1619 @section Refile and copy
1621 When reviewing the captured data, you may want to refile or copy some of the
1622 entries into a different list, for example into a project. Cutting, finding
1623 the right location, and then pasting the note is cumbersome. To simplify
1624 this process, you can use the following special command:
1628 Copy the entry or region at point. This command behaves like
1629 @code{org-refile}, except that the original note will not be deleted.
1631 Refile the entry or region at point. This command offers possible locations
1632 for refiling the entry and lets you select one with completion. The item (or
1633 all items in the region) is filed below the target heading as a subitem.@*
1634 By default, all level 1 headlines in the current buffer are considered to be
1635 targets, but you can have more complex definitions across a number of files.
1636 See the variable @code{org-refile-targets} for details.
1638 Use the refile interface to jump to a heading.
1639 @item C-u C-u C-c C-w
1640 Jump to the location where @code{org-refile} last moved a tree to.
1643 @node Archiving, , Refile and copy, Capture - Refile - Archive
1646 When a project represented by a (sub)tree is finished, you may want
1647 to move the tree out of the way and to stop it from contributing to the
1648 agenda. Archiving is important to keep your working files compact and global
1649 searches like the construction of agenda views fast.
1650 The most common archiving action is to move a project tree to another file,
1655 Archive the current entry using the command specified in the variable
1656 @code{org-archive-default-command}.
1657 @item C-c C-x C-s@ @r{or short} @ C-c $
1658 Archive the subtree starting at the cursor position to the location
1659 given by @code{org-archive-location}.
1662 The default archive location is a file in the same directory as the
1663 current file, with the name derived by appending @file{_archive} to the
1664 current file name. For information and examples on how to change this,
1665 see the documentation string of the variable
1666 @code{org-archive-location}. There is also an in-buffer option for
1667 setting this variable, for example
1670 #+ARCHIVE: %s_done::
1674 @uref{http://orgmode.org/manual/Capture-_002d-Refile-_002d-Archive.html#Capture-_002d-Refile-_002d-Archive,
1675 Chapter 9 of the manual}@*
1676 @uref{http://members.optusnet.com.au/~charles57/GTD/remember.html, Charles
1677 Cave's remember tutorial}@*
1678 @uref{http://orgmode.org/worg/org-tutorials/org-protocol-custom-handler.php,
1679 Sebastian Rose's tutorial for capturing from a web browser}}@uref{}@*
1681 @node Agenda Views, Markup, Capture - Refile - Archive, Top
1682 @chapter Agenda Views
1684 Due to the way Org works, TODO items, time-stamped items, and tagged
1685 headlines can be scattered throughout a file or even a number of files. To
1686 get an overview of open action items, or of events that are important for a
1687 particular date, this information must be collected, sorted and displayed in
1688 an organized way. There are several different views, see below.
1690 The extracted information is displayed in a special @emph{agenda buffer}.
1691 This buffer is read-only, but provides commands to visit the corresponding
1692 locations in the original Org files, and even to edit these files remotely.
1693 Remote editing from the agenda buffer means, for example, that you can
1694 change the dates of deadlines and appointments from the agenda buffer.
1695 The commands available in the Agenda buffer are listed in @ref{Agenda
1699 * Agenda files:: Files being searched for agenda information
1700 * Agenda dispatcher:: Keyboard access to agenda views
1701 * Built-in agenda views:: What is available out of the box?
1702 * Agenda commands:: Remote editing of Org trees
1703 * Custom agenda views:: Defining special searches and views
1706 @node Agenda files, Agenda dispatcher, Agenda Views, Agenda Views
1707 @section Agenda files
1709 The information to be shown is normally collected from all @emph{agenda
1710 files}, the files listed in the variable
1711 @code{org-agenda-files}.
1715 Add current file to the list of agenda files. The file is added to
1716 the front of the list. If it was already in the list, it is moved to
1717 the front. With a prefix argument, file is added/moved to the end.
1719 Remove current file from the list of agenda files.
1721 Cycle through agenda file list, visiting one file after the other.
1724 @node Agenda dispatcher, Built-in agenda views, Agenda files, Agenda Views
1725 @section The agenda dispatcher
1726 The views are created through a dispatcher, which should be bound to a
1727 global key---for example @kbd{C-c a} (@pxref{Installation}). After
1728 pressing @kbd{C-c a}, an additional letter is required to execute a
1732 The calendar-like agenda (@pxref{Weekly/daily agenda}).
1734 A list of all TODO items (@pxref{Global TODO list}).
1736 A list of headlines matching a TAGS expression (@pxref{Matching
1737 tags and properties}).
1739 The timeline view for the current buffer (@pxref{Timeline}).
1741 A list of entries selected by a boolean expression of keywords
1742 and/or regular expressions that must or must not occur in the entry.
1745 @node Built-in agenda views, Agenda commands, Agenda dispatcher, Agenda Views
1746 @section The built-in agenda views
1749 * Weekly/daily agenda:: The calendar page with current tasks
1750 * Global TODO list:: All unfinished action items
1751 * Matching tags and properties:: Structured information with fine-tuned search
1752 * Timeline:: Time-sorted view for single file
1753 * Search view:: Find entries by searching for text
1756 @node Weekly/daily agenda, Global TODO list, Built-in agenda views, Built-in agenda views
1757 @subsection The weekly/daily agenda
1759 The purpose of the weekly/daily @emph{agenda} is to act like a page of a
1760 paper agenda, showing all the tasks for the current week or day.
1764 Compile an agenda for the current week from a list of Org files. The agenda
1765 shows the entries for each day.
1768 Emacs contains the calendar and diary by Edward M. Reingold. Org-mode
1769 understands the syntax of the diary and allows you to use diary sexp entries
1770 directly in Org files:
1773 * Birthdays and similar stuff
1775 %%(org-calendar-holiday) ; special function for holiday names
1777 %%(diary-anniversary 5 14 1956)@footnote{Note that the order of the arguments (month, day, year) depends on the setting of @code{calendar-date-style}.} Arthur Dent is %d years old
1778 %%(diary-anniversary 10 2 1869) Mahatma Gandhi would be %d years old
1781 Org can interact with Emacs appointments notification facility. To add all
1782 the appointments of your agenda files, use the command
1783 @code{org-agenda-to-appt}. See the docstring for details.
1785 @node Global TODO list, Matching tags and properties, Weekly/daily agenda, Built-in agenda views
1786 @subsection The global TODO list
1788 The global TODO list contains all unfinished TODO items formatted and
1789 collected into a single place. Remote editing of TODO items lets you
1790 can change the state of a TODO entry with a single key press. The commands
1791 available in the TODO list are described in @ref{Agenda commands}.
1795 Show the global TODO list. This collects the TODO items from all
1796 agenda files (@pxref{Agenda Views}) into a single buffer.
1798 Like the above, but allows selection of a specific TODO keyword.
1801 @node Matching tags and properties, Timeline, Global TODO list, Built-in agenda views
1802 @subsection Matching tags and properties
1804 If headlines in the agenda files are marked with @emph{tags} (@pxref{Tags}),
1805 or have properties (@pxref{Properties}), you can select headlines
1806 based on this metadata and collect them into an agenda buffer. The match
1807 syntax described here also applies when creating sparse trees with @kbd{C-c /
1808 m}. The commands available in the tags list are described in @ref{Agenda
1813 Produce a list of all headlines that match a given set of tags. The
1814 command prompts for a selection criterion, which is a boolean logic
1815 expression with tags, like @samp{+work+urgent-withboss} or
1816 @samp{work|home} (@pxref{Tags}). If you often need a specific search,
1817 define a custom command for it (@pxref{Agenda dispatcher}).
1819 Like @kbd{C-c a m}, but only select headlines that are also TODO items.
1822 @subsubheading Match syntax
1824 A search string can use Boolean operators @samp{&} for AND and @samp{|} for
1825 OR. @samp{&} binds more strongly than @samp{|}. Parentheses are currently
1826 not implemented. Each element in the search is either a tag, a regular
1827 expression matching tags, or an expression like @code{PROPERTY OPERATOR
1828 VALUE} with a comparison operator, accessing a property value. Each element
1829 may be preceded by @samp{-}, to select against it, and @samp{+} is syntactic
1830 sugar for positive selection. The AND operator @samp{&} is optional when
1831 @samp{+} or @samp{-} is present. Here are some examples, using only tags.
1835 Select headlines tagged @samp{:work:}, but discard those also tagged
1838 Selects lines tagged @samp{:work:} or @samp{:laptop:}.
1839 @item work|laptop+night
1840 Like before, but require the @samp{:laptop:} lines to be tagged also
1844 You may also test for properties at the same
1845 time as matching tags, see the manual for more information.
1847 @node Timeline, Search view, Matching tags and properties, Built-in agenda views
1848 @subsection Timeline for a single file
1850 The timeline summarizes all time-stamped items from a single Org mode
1851 file in a @emph{time-sorted view}. The main purpose of this command is
1852 to give an overview over events in a project.
1856 Show a time-sorted view of the Org file, with all time-stamped items.
1857 When called with a @kbd{C-u} prefix, all unfinished TODO entries
1858 (scheduled or not) are also listed under the current date.
1861 @node Search view, , Timeline, Built-in agenda views
1862 @subsection Search view
1864 This agenda view is a general text search facility for Org mode entries.
1865 It is particularly useful to find notes.
1869 This is a special search that lets you select entries by matching a substring
1870 or specific words using a boolean logic.
1872 For example, the search string @samp{computer equipment} will find entries
1873 that contain @samp{computer equipment} as a substring.
1874 Search view can also search for specific keywords in the entry, using Boolean
1875 logic. The search string @samp{+computer +wifi -ethernet -@{8\.11[bg]@}}
1876 will search for note entries that contain the keywords @code{computer}
1877 and @code{wifi}, but not the keyword @code{ethernet}, and which are also
1878 not matched by the regular expression @code{8\.11[bg]}, meaning to
1879 exclude both 8.11b and 8.11g.
1881 Note that in addition to the agenda files, this command will also search
1882 the files listed in @code{org-agenda-text-search-extra-files}.
1884 @node Agenda commands, Custom agenda views, Built-in agenda views, Agenda Views
1885 @section Commands in the agenda buffer
1887 Entries in the agenda buffer are linked back to the Org file or diary
1888 file where they originate. Commands are provided to show and jump to the
1889 original entry location, and to edit the Org files ``remotely'' from
1890 the agenda buffer. This is just a selection of the many commands, explore
1891 the @code{Agenda} menu and the manual for a complete list.
1894 @tsubheading{Motion}
1896 Next line (same as @key{up} and @kbd{C-p}).
1898 Previous line (same as @key{down} and @kbd{C-n}).
1899 @tsubheading{View/Go to Org file}
1902 Display the original location of the item in another window.
1903 With prefix arg, make sure that the entire entry is made visible in the
1904 outline, not only the heading.
1907 Go to the original location of the item in another window. Under Emacs
1908 22, @kbd{mouse-1} will also work for this.
1911 Go to the original location of the item and delete other windows.
1914 @tsubheading{Change display}
1916 Delete other windows.
1919 Switch to day/week view.
1922 Go forward/backward in time to display the following
1923 @code{org-agenda-current-span} days. For example, if the display covers a
1924 week, switch to the following/previous week.
1930 Prompt for a date and go there.
1932 @item v l @ @r{or short} @ l
1933 Toggle Logbook mode. In Logbook mode, entries that were marked DONE while
1934 logging was on (variable @code{org-log-done}) are shown in the agenda, as are
1935 entries that have been clocked on that day. When called with a @kbd{C-u}
1936 prefix, show all possible logbook entries, including state changes.
1939 Recreate the agenda buffer, to reflect the changes.
1941 Save all Org buffers in the current Emacs session, and also the locations of
1944 @tsubheading{Secondary filtering and query editing}
1947 Filter the current agenda view with respect to a tag. You are prompted for a
1948 letter to select a tag. Press @samp{-} first to select against the tag.
1951 Narrow the current agenda filter by an additional condition.
1953 @tsubheading{Remote editing (see the manual for many more commands)}
1959 Change the TODO state of the item, in the agenda and in the
1963 Delete the current agenda item along with the entire subtree belonging
1964 to it in the original Org file.
1967 Refile the entry at point.
1969 @item C-c C-x C-a @ @r{or short} @ a
1970 Archive the subtree corresponding to the entry at point using the default
1971 archiving command set in @code{org-archive-default-command}.
1973 @item C-c C-x C-s @ @r{or short} @ $
1974 Archive the subtree corresponding to the current headline.
1977 Schedule this item, with prefix arg remove the scheduling timestamp
1980 Set a deadline for this item, with prefix arg remove the deadline.
1982 @item S-@key{right} @r{and} S-@key{left}
1983 Change the timestamp associated with the current line by one day.
1986 Start the clock on the current item.
1989 Stop/cancel the previously started clock.
1992 Jump to the running clock in another window.
1995 @node Custom agenda views, , Agenda commands, Agenda Views
1996 @section Custom agenda views
1998 The main application of custom searches is the definition of keyboard
1999 shortcuts for frequently used searches, either creating an agenda
2000 buffer, or a sparse tree (the latter covering of course only the current
2002 Custom commands are configured in the variable
2003 @code{org-agenda-custom-commands}. You can customize this variable, for
2004 example by pressing @kbd{C-c a C}. You can also directly set it with
2005 Emacs Lisp in @file{.emacs}. The following example contains all valid
2010 (setq org-agenda-custom-commands
2011 '(("w" todo "WAITING")
2012 ("u" tags "+boss-urgent")
2013 ("v" tags-todo "+boss-urgent")))
2018 The initial string in each entry defines the keys you have to press after the
2019 dispatcher command @kbd{C-c a} in order to access the command. Usually this
2020 will be just a single character. The second parameter is the search type,
2021 followed by the string or regular expression to be used for the matching.
2022 The example above will therefore define:
2026 as a global search for TODO entries with @samp{WAITING} as the TODO
2029 as a global tags search for headlines marked @samp{:boss:} but not
2032 as the same search as @kbd{C-c a u}, but limiting the search to
2033 headlines that are also TODO items
2037 @uref{http://orgmode.org/manual/Agenda-Views.html#Agenda-Views, Chapter 10 of
2039 @uref{http://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.php,
2040 Mat Lundin's tutorial about custom agenda commands}@*
2041 @uref{http://www.newartisans.com/2007/08/using-org-mode-as-a-day-planner.html,
2042 John Wiegley's setup}}
2044 @node Markup, Exporting, Agenda Views, Top
2045 @chapter Markup for rich export
2047 When exporting Org-mode documents, the exporter tries to reflect the
2048 structure of the document as accurately as possible in the backend. Since
2049 export targets like HTML, @LaTeX{}, or DocBook allow much richer formatting,
2050 Org mode has rules on how to prepare text for rich export. This section
2051 summarizes the markup rules used in an Org-mode buffer.
2054 * Structural markup elements:: The basic structure as seen by the exporter
2055 * Images and tables:: Tables and Images will be included
2056 * Literal examples:: Source code examples with special formatting
2057 * Include files:: Include additional files into a document
2058 * Embedded @LaTeX{}:: @LaTeX{} can be freely used inside Org documents
2061 @node Structural markup elements, Images and tables, Markup, Markup
2062 @section Structural markup elements
2065 * Document title:: Where the title is taken from
2066 * Headings and sections:: The document structure as seen by the exporter
2067 * Table of contents:: The if and where of the table of contents
2068 * Paragraphs:: Paragraphs
2069 * Emphasis and monospace:: Bold, italic, etc.
2070 * Comment lines:: What will *not* be exported
2073 @node Document title, Headings and sections, Structural markup elements, Structural markup elements
2074 @subheading Document title
2077 The title of the exported document is taken from the special line
2080 #+TITLE: This is the title of the document
2083 @node Headings and sections, Table of contents, Document title, Structural markup elements
2084 @subheading Headings and sections
2086 The outline structure of the document as described in @ref{Document
2087 Structure}, forms the basis for defining sections of the exported document.
2088 However, since the outline structure is also used for (for example) lists of
2089 tasks, only the first three outline levels will be used as headings. Deeper
2090 levels will become itemized lists. You can change the location of this
2091 switch globally by setting the variable @code{org-export-headline-levels}, or on a
2092 per-file basis with a line
2098 @node Table of contents, Paragraphs, Headings and sections, Structural markup elements
2099 @subheading Table of contents
2101 The table of contents is normally inserted directly before the first headline
2105 #+OPTIONS: toc:2 (only to two levels in TOC)
2106 #+OPTIONS: toc:nil (no TOC at all)
2109 @node Paragraphs, Emphasis and monospace, Table of contents, Structural markup elements
2110 @subheading Paragraphs, line breaks, and quoting
2112 Paragraphs are separated by at least one empty line. If you need to enforce
2113 a line break within a paragraph, use @samp{\\} at the end of a line.
2115 To keep the line breaks in a region, but otherwise use normal formatting, you
2116 can use this construct, which can also be used to format poetry.
2120 Great clouds overhead
2121 Tiny black birds rise and fall
2128 When quoting a passage from another document, it is customary to format this
2129 as a paragraph that is indented on both the left and the right margin. You
2130 can include quotations in Org-mode documents like this:
2134 Everything should be made as simple as possible,
2135 but not any simpler -- Albert Einstein
2139 If you would like to center some text, do it like this:
2142 Everything should be made as simple as possible, \\
2147 @node Emphasis and monospace, Comment lines, Paragraphs, Structural markup elements
2148 @subheading Emphasis and monospace
2150 You can make words @b{*bold*}, @i{/italic/}, _underlined_, @code{=code=}
2151 and @code{~verbatim~}, and, if you must, @samp{+strike-through+}. Text
2152 in the code and verbatim string is not processed for Org-mode specific
2153 syntax, it is exported verbatim. To insert a horizontal rules, use a line
2154 consisting of only dashes, and at least 5 of them.
2156 @node Comment lines, , Emphasis and monospace, Structural markup elements
2157 @subheading Comment lines
2159 Lines starting with zero or more whitespace characters followed by @samp{#}
2160 are treated as comments and will never be exported. Also entire subtrees
2161 starting with the word @samp{COMMENT} will never be exported. Finally,
2162 regions surrounded by @samp{#+BEGIN_COMMENT} ... @samp{#+END_COMMENT} will
2167 Toggle the COMMENT keyword at the beginning of an entry.
2170 @node Images and tables, Literal examples, Structural markup elements, Markup
2171 @section Images and Tables
2173 For Org mode tables, the lines before the first horizontal separator line
2174 will become table header lines. You can use the following lines somewhere
2175 before the table to assign a caption and a label for cross references, and in
2176 the text you can refer to the object with @code{\ref@{tab:basic-data@}}:
2179 #+CAPTION: This is the caption for the next table (or link)
2180 #+LABEL: tbl:basic-data
2185 Some backends (HTML, @LaTeX{}, and DocBook) allow you to directly include
2186 images into the exported document. Org does this, if a link to an image
2187 files does not have a description part, for example @code{[[./img/a.jpg]]}.
2188 If you wish to define a caption for the image and maybe a label for internal
2189 cross references, you sure that the link is on a line by itself precede it
2193 #+CAPTION: This is the caption for the next figure link (or table)
2194 #+LABEL: fig:SED-HR4049
2198 You may also define additional attributes for the figure. As this is
2199 backend-specific, see the sections about the individual backends for more
2203 @node Literal examples, Include files, Images and tables, Markup
2204 @section Literal examples
2206 You can include literal examples that should not be subjected to
2207 markup. Such examples will be typeset in monospace, so this is well suited
2208 for source code and similar examples.
2212 Some example from a text file.
2216 For simplicity when using small examples, you can also start the example
2217 lines with a colon followed by a space. There may also be additional
2218 whitespace before the colon:
2222 : Some example from a text file.
2225 For source code from a programming language, or any other text
2226 that can be marked up by font-lock in Emacs, you can ask for it to
2227 look like the fontified Emacs buffer
2230 #+BEGIN_SRC emacs-lisp
2231 (defun org-xor (a b)
2237 To edit the example in a special buffer supporting this language, use
2238 @kbd{C-c '} to both enter and leave the editing buffer.
2240 @node Include files, Embedded @LaTeX{}, Literal examples, Markup
2241 @section Include files
2243 During export, you can include the content of another file. For example, to
2244 include your @file{.emacs} file, you could use:
2247 #+INCLUDE: "~/.emacs" src emacs-lisp
2250 The optional second and third parameter are the markup (e.g.@: @samp{quote},
2251 @samp{example}, or @samp{src}), and, if the markup is @samp{src}, the
2252 language for formatting the contents. The markup is optional, if it is not
2253 given, the text will be assumed to be in Org mode format and will be
2254 processed normally. @kbd{C-c '} will visit the included file.
2256 @node Embedded @LaTeX{}, , Include files, Markup
2257 @section Embedded @LaTeX{}
2259 For scientific notes which need to be able to contain mathematical symbols
2260 and the occasional formula, Org-mode supports embedding @LaTeX{} code into
2261 its files. You can directly use TeX-like macros for special symbols, enter
2262 formulas and entire @LaTeX{} environments.
2265 Angles are written as Greek letters \alpha, \beta and \gamma. The mass if
2266 the sun is M_sun = 1.989 x 10^30 kg. The radius of the sun is R_@{sun@} =
2267 6.96 x 10^8 m. If $a^2=b$ and $b=2$, then the solution must be either
2268 $a=+\sqrt@{2@}$ or $a=-\sqrt@{2@}$.
2275 @uref{http://orgmode.org/manual/LaTeX-fragments.html#LaTeX-fragments,special
2276 setup}, @LaTeX{} snippets will be included as images when exporting to HTML.
2279 @uref{http://orgmode.org/manual/Markup.html#Markup, Chapter 11 of the manual}}
2281 @node Exporting, Publishing, Markup, Top
2284 Org-mode documents can be exported into a variety of other formats: ASCII
2285 export for inclusion into emails, HTML to publish on the web, @LaTeX{}/PDF
2286 for beautiful printed documents and DocBook to enter the world of many other
2287 formats using DocBook tools. There is also export to iCalendar format so
2288 that planning information can be incorporated into desktop calendars.
2291 * Export options:: Per-file export settings
2292 * The export dispatcher:: How to access exporter commands
2293 * ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding
2294 * HTML export:: Exporting to HTML
2295 * @LaTeX{} and PDF export:: Exporting to @LaTeX{}, and processing to PDF
2296 * DocBook export:: Exporting to DocBook
2297 * iCalendar export::
2300 @node Export options, The export dispatcher, Exporting, Exporting
2301 @section Export options
2303 The exporter recognizes special lines in the buffer which provide
2304 additional information. These lines may be put anywhere in the file.
2305 The whole set of lines can be inserted into the buffer with @kbd{C-c
2310 Insert template with export options, see example below.
2314 #+TITLE: the title to be shown (default is the buffer name)
2315 #+AUTHOR: the author (default taken from @code{user-full-name})
2316 #+DATE: a date, fixed, of a format string for @code{format-time-string}
2317 #+EMAIL: his/her email address (default from @code{user-mail-address})
2318 #+DESCRIPTION: the page description, e.g.@: for the XHTML meta tag
2319 #+KEYWORDS: the page keywords, e.g.@: for the XHTML meta tag
2320 #+LANGUAGE: language for HTML, e.g.@: @samp{en} (@code{org-export-default-language})
2321 #+TEXT: Some descriptive text to be inserted at the beginning.
2322 #+TEXT: Several lines may be given.
2323 #+OPTIONS: H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t f:t TeX:t ...
2324 #+LINK_UP: the ``up'' link of an exported page
2325 #+LINK_HOME: the ``home'' link of an exported page
2326 #+LATEX_HEADER: extra line(s) for the @LaTeX{} header, like \usepackage@{xyz@}
2329 @node The export dispatcher, ASCII/Latin-1/UTF-8 export, Export options, Exporting
2330 @section The export dispatcher
2332 All export commands can be reached using the export dispatcher, which is a
2333 prefix key that prompts for an additional key specifying the command.
2334 Normally the entire file is exported, but if there is an active region that
2335 contains one outline tree, the first heading is used as document title and
2336 the subtrees are exported.
2340 Dispatcher for export and publishing commands.
2343 @node ASCII/Latin-1/UTF-8 export, HTML export, The export dispatcher, Exporting
2344 @section ASCII/Latin-1/UTF-8 export
2346 ASCII export produces a simple and very readable version of an Org-mode
2347 file, containing only plain ASCII. Latin-1 and UTF-8 export augment the file
2348 with special characters and symbols available in these encodings.
2352 Export as ASCII file.
2353 @item C-c C-e n @ @ @r{and} @ @ C-c C-e N
2354 Like the above commands, but use Latin-1 encoding.
2355 @item C-c C-e u @ @ @r{and} @ @ C-c C-e U
2356 Like the above commands, but use UTF-8 encoding.
2359 @node HTML export, @LaTeX{} and PDF export, ASCII/Latin-1/UTF-8 export, Exporting
2360 @section HTML export
2364 Export as HTML file @file{myfile.html}.
2366 Export as HTML file and immediately open it with a browser.
2369 To insert HTML that should be copied verbatim to
2370 the exported file use either
2373 #+HTML: Literal HTML code for export
2378 All lines between these markers are exported literally
2382 @node @LaTeX{} and PDF export, DocBook export, HTML export, Exporting
2383 @section @LaTeX{} and PDF export
2387 Export as @LaTeX{} file @file{myfile.tex}.
2389 Export as @LaTeX{} and then process to PDF.
2391 Export as @LaTeX{} and then process to PDF, then open the resulting PDF file.
2394 By default, the @LaTeX{} output uses the class @code{article}. You can
2395 change this by adding an option like @code{#+LaTeX_CLASS: myclass} in your
2396 file. The class must be listed in @code{org-export-latex-classes}.
2398 Embedded @LaTeX{} as described in @ref{Embedded @LaTeX{}}, will be correctly
2399 inserted into the @LaTeX{} file. Similarly to the HTML exporter, you can use
2400 @code{#+LaTeX:} and @code{#+BEGIN_LaTeX ... #+END_LaTeX} construct to add
2401 verbatim @LaTeX{} code.
2403 @node DocBook export, iCalendar export, @LaTeX{} and PDF export, Exporting
2404 @section DocBook export
2408 Export as DocBook file.
2411 Similarly to the HTML exporter, you can use @code{#+DOCBOOK:} and
2412 @code{#+BEGIN_DOCBOOK ... #+END_DOCBOOK} construct to add verbatim @LaTeX{}
2415 @node iCalendar export, , DocBook export, Exporting
2416 @section iCalendar export
2420 Create iCalendar entries for the current file in a @file{.ics} file.
2422 Create a single large iCalendar file from all files in
2423 @code{org-agenda-files} and write it to the file given by
2424 @code{org-combined-agenda-icalendar-file}.
2428 @uref{http://orgmode.org/manual/Exporting.html#Exporting, Chapter 12 of the manual}@*
2429 @uref{http://orgmode.org/worg/org-tutorials/images-and-xhtml-export.php,
2430 Sebastian Rose's image handling tutorial}@*
2431 @uref{http://orgmode.org/worg/org-tutorials/org-latex-export.php, Thomas
2432 Dye's LaTeX export tutorial}
2433 @uref{http://orgmode.org/worg/org-tutorials/org-beamer/tutorial.php, Eric
2434 Fraga's BEAMER presentation tutorial}}
2436 @node Publishing, Working With Source Code, Exporting, Top
2439 Org includes a publishing management system that allows you to configure
2440 automatic HTML conversion of @emph{projects} composed of interlinked org
2441 files. You can also configure Org to automatically upload your exported HTML
2442 pages and related attachments, such as images and source code files, to a web
2443 server. For detailed instructions about setup, see the manual.
2448 (setq org-publish-project-alist
2450 :base-directory "~/org/"
2451 :publishing-directory "~/public_html"
2452 :section-numbers nil
2453 :table-of-contents nil
2454 :style "<link rel=\"stylesheet\"
2455 href=\"../other/mystyle.css\"
2456 type=\"text/css\"/>")))
2461 Prompt for a specific project and publish all files that belong to it.
2463 Publish the project containing the current file.
2465 Publish only the current file.
2467 Publish every project.
2470 Org uses timestamps to track when a file has changed. The above functions
2471 normally only publish changed files. You can override this and force
2472 publishing of all files by giving a prefix argument to any of the commands
2476 @uref{http://orgmode.org/manual/Publishing.html#Publishing, Chapter 13 of the
2478 @uref{http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.php,
2479 Sebastian Rose's publishing tutorial}@*
2480 @uref{http://orgmode.org/worg/org-tutorials/org-jekyll.php, Ian Barton's
2481 Jekyll/blogging setup}}
2483 @node Working With Source Code, Miscellaneous, Publishing, Top
2484 @chapter Working with source code
2485 Org-mode provides a number of features for working with source code,
2486 including editing of code blocks in their native major-mode, evaluation of
2487 code blocks, tangling of code blocks, and exporting code blocks and their
2488 results in several formats.
2490 @subheading Structure of Code Blocks
2491 The structure of code blocks is as follows:
2495 #+BEGIN_SRC <language> <switches> <header arguments>
2500 Where @code{<name>} is a string used to name the code block,
2501 @code{<language>} specifies the language of the code block
2502 (e.g.@: @code{emacs-lisp}, @code{shell}, @code{R}, @code{python}, etc...),
2503 @code{<switches>} can be used to control export of the code block,
2504 @code{<header arguments>} can be used to control many aspects of code block
2505 behavior as demonstrated below, and @code{<body>} contains the actual source
2508 @subheading Editing source code
2509 Use @kbd{C-c '} to edit the current code block. This brings up a language
2510 major-mode edit buffer containing the body of the code block. Saving this
2511 buffer will write the new contents back to the Org buffer. Use @kbd{C-c '}
2512 again to exit the edit buffer.
2514 @subheading Evaluating code blocks
2515 Use @kbd{C-c C-c} to evaluate the current code block and insert its results
2516 in the Org-mode buffer. By default, evaluation is only turned on for
2517 @code{emacs-lisp} code blocks, however support exists for evaluating blocks
2518 in many languages. For a complete list of supported languages see the
2519 manual. The following shows a code block and its results.
2522 #+BEGIN_SRC emacs-lisp
2530 @subheading Extracting source code
2531 Use @kbd{C-c C-v t} to create pure source code files by extracting code from
2532 source blocks in the current buffer. This is referred to as ``tangling''---a
2533 term adopted from the literate programming community. During ``tangling'' of
2534 code blocks their bodies are expanded using @code{org-babel-expand-src-block}
2535 which can expand both variable and ``noweb'' style references. In order to
2536 tangle a code block it must have a @code{:tangle} header argument, see the
2539 @subheading Library of Babel
2540 Use @kbd{C-c C-v l} to load the code blocks from an Org-mode files into the
2541 ``Library of Babel'', these blocks can then be evaluated from any Org-mode
2542 buffer. A collection of generally useful code blocks is distributed with
2543 Org-mode in @code{contrib/library-of-babel.org}.
2545 @subheading Header Arguments
2546 Many aspects of the evaluation and export of code blocks are controlled
2547 through header arguments. These can be specified globally, at the file
2548 level, at the outline subtree level, and at the individual code block level.
2549 The following describes some of the header arguments.
2552 The @code{:var} header argument is used to pass arguments to code blocks.
2553 The values passed to arguments can be literal values, values from org-mode
2554 tables and literal example blocks, or the results of other named code blocks.
2556 The @code{:results} header argument controls the @emph{collection},
2557 @emph{type}, and @emph{handling} of code block results. Values of
2558 @code{output} or @code{value} (the default) specify how results are collected
2559 from a code block's evaluation. Values of @code{vector}, @code{scalar}
2560 @code{file} @code{raw} @code{html} @code{latex} and @code{code} specify the
2561 type of the results of the code block which dictates how they will be
2562 incorporated into the Org-mode buffer. Values of @code{silent},
2563 @code{replace}, @code{prepend}, and @code{append} specify handling of code
2564 block results, specifically if and how the results should be inserted into
2565 the Org-mode buffer.
2567 A header argument of @code{:session} will cause the code block to be
2568 evaluated in a persistent interactive inferior process in Emacs. This allows
2569 for persisting state between code block evaluations, and for manual
2570 inspection of the results of evaluation.
2572 Any combination of the @emph{code} or the @emph{results} of a block can be
2573 retained on export, this is specified by setting the @code{:results} header
2574 argument to @code{code} @code{results} @code{none} or @code{both}.
2576 A header argument of @code{:tangle yes} will cause a code block's contents to
2577 be tangled to a file named after the filename of the Org-mode buffer. An
2578 alternate file name can be specified with @code{:tangle filename}.
2580 A header argument of @code{:cache yes} will cause associate a hash of the
2581 expanded code block with the results, ensuring that code blocks are only
2582 re-run when their inputs have changed.
2584 A header argument of @code{:noweb yes} will expand ``noweb'' style references
2585 on evaluation and tangling.
2587 Code blocks which output results to files (e.g.@: graphs, diagrams and figures)
2588 can accept a @code{:file filename} header argument in which case the results
2589 are saved to the named file, and a link to the file is inserted into the
2594 @uref{http://orgmode.org/manual/Literal-examples.html#Literal-examples,
2595 Chapter 11.3 of the manual}@*
2596 @uref{http://orgmode.org/worg/org-contrib/babel/index.php,
2597 The Babel site on Worg}}
2599 @node Miscellaneous, , Working With Source Code, Top
2600 @chapter Miscellaneous
2603 * Completion:: M-TAB knows what you need
2604 * Clean view:: Getting rid of leading stars in the outline
2605 * MobileOrg:: Org-mode on the iPhone
2608 @node Completion, Clean view, Miscellaneous, Miscellaneous
2611 Org supports in-buffer completion with @kbd{M-@key{TAB}}. This type of
2612 completion does not make use of the minibuffer. You simply type a few
2613 letters into the buffer and use the key to complete text right there. For
2614 example, this command will complete @TeX{} symbols after @samp{\}, TODO
2615 keywords at the beginning of a headline, and tags after @samp{:} in a
2618 @node Clean view, MobileOrg, Completion, Miscellaneous
2619 @section A cleaner outline view
2621 Some people find it noisy and distracting that the Org headlines start with a
2622 potentially large number of stars, and that text below the headlines is not
2623 indented. While this is no problem when writing a @emph{book-like} document
2624 where the outline headings are really section headings, in a more
2625 @emph{list-oriented} outline, indented structure is a lot cleaner:
2629 * Top level headline | * Top level headline
2630 ** Second level | * Second level
2631 *** 3rd level | * 3rd level
2632 some text | some text
2633 *** 3rd level | * 3rd level
2634 more text | more text
2635 * Another top level headline | * Another top level headline
2640 If you are using at least Emacs 23.1.50.3 and version 6.29 of Org, this kind
2641 of view can be achieved dynamically at display time using
2642 @code{org-indent-mode}, which will prepend intangible space to each line.
2643 You can turn on @code{org-indent-mode} for all files by customizing the
2644 variable @code{org-startup-indented}, or you can turn it on for individual
2651 If you want a similar effect in earlier version of Emacs and/or Org, or if
2652 you want the indentation to be hard space characters so that the plain text
2653 file looks as similar as possible to the Emacs display, Org supports you by
2654 helping to indent (with @key{TAB}) text below each headline, by hiding
2655 leading stars, and by only using levels 1, 3, etc to get two characters
2656 indentation for each level. To get this support in a file, use
2659 #+STARTUP: hidestars odd
2662 @node MobileOrg, , Clean view, Miscellaneous
2665 @i{MobileOrg} is the name of the mobile companion app for Org mode, currently
2666 available for iOS and for Android. @i{MobileOrg} offers offline viewing and
2667 capture support for an Org mode system rooted on a ``real'' computer. It
2668 does also allow you to record changes to existing entries.
2670 The @uref{http://mobileorg.ncogni.to/, iOS implementation} for the
2671 @i{iPhone/iPod Touch/iPad} series of devices, was developed by Richard
2672 Moreland. Android users should check out
2673 @uref{http://wiki.github.com/matburt/mobileorg-android/, MobileOrg Android}
2674 by Matt Jones. The two implementations are not identical but offer similar
2678 @uref{http://orgmode.org/manual/Miscellaneous.html#Miscellaneous, Chapter 15
2680 @uref{http://orgmode.org/manual/MobileOrg.html#MobileOrg, Appendix B of the
2682 @uref{http://orgmode.org/orgcard.pdf,Key reference card}}
2691 @c LocalWords: webdavhost pre