org-koma-letter: Add asynchronous export support
[org-mode.git] / doc / orgguide.texi
blob3d8d48106b3369ecd92c40de722cd28eb3fa0a33
1 \input texinfo
2 @c %**start of header
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}
19 @c %**end of header
20 @finalout
22 @c Macro definitions
23 @iftex
24 @c @hyphenation{time-stamp time-stamps time-stamp-ing time-stamp-ed}
25 @end iftex
27 @c Subheadings inside a table.
28 @macro tsubheading{text}
29 @ifinfo
30 @subsubheading \text\
31 @end ifinfo
32 @ifnotinfo
33 @item @b{\text\}
34 @end ifnotinfo
35 @end macro
37 @macro seealso{text}
38 @noindent @b{Further reading}@*@noindent \text\
39 @end macro
40 @copying
42 Copyright @copyright{} 2010-2012 Free Software Foundation
44 @quotation
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 and no Cover Texts.
49 @end quotation
50 @end copying
52 @dircategory Emacs
53 @direntry
54 * Org Mode Guide: (orgguide).  Abbreviated Org-mode Manual
55 @end direntry
57 @titlepage
58 @title The compact Org-mode Guide
60 @subtitle Release @value{VERSION}
61 @author by Carsten Dominik
63 @c The following two commands start the copyright page.
64 @page
65 @vskip 0pt plus 1filll
66 @insertcopying
67 @end titlepage
69 @c Output the table of contents at the beginning.
70 @shortcontents
72 @ifnottex
73 @node Top, Introduction, (dir), (dir)
74 @top Org Mode Guide
76 @insertcopying
77 @end ifnottex
79 @menu
80 * Introduction::                Getting started
81 * Document Structure::          A tree works like your brain
82 * Tables::                      Pure magic for quick formatting
83 * Hyperlinks::                  Notes in context
84 * TODO Items::                  Every tree branch can be a TODO item
85 * Tags::                        Tagging headlines and matching sets of tags
86 * Properties::                  Properties
87 * Dates and Times::             Making items useful for planning
88 * Capture - Refile - Archive::  The ins and outs for projects
89 * Agenda Views::                Collecting information into views
90 * Markup::                      Prepare text for rich export
91 * Exporting::                   Sharing and publishing of notes
92 * Publishing::                  Create a web site of linked Org files
93 * Working With Source Code::    Source code snippets embedded in Org
94 * Miscellaneous::               All the rest which did not fit elsewhere
96 @detailmenu
97  --- The Detailed Node Listing ---
99 Introduction
101 * Preface::                     Welcome
102 * Installation::                How to install a downloaded version of Org
103 * Activation::                  How to activate Org for certain buffers
104 * Feedback::                    Bug reports, ideas, patches etc.
106 Document Structure
108 * Outlines::                    Org is based on Outline mode
109 * Headlines::                   How to typeset Org tree headlines
110 * Visibility cycling::          Show and hide, much simplified
111 * Motion::                      Jumping to other headlines
112 * Structure editing::           Changing sequence and level of headlines
113 * Sparse trees::                Matches embedded in context
114 * Plain lists::                 Additional structure within an entry
115 * Footnotes::                   How footnotes are defined in Org's syntax
117 Hyperlinks
119 * Link format::                 How links in Org are formatted
120 * Internal links::              Links to other places in the current file
121 * External links::              URL-like links to the world
122 * Handling links::              Creating, inserting and following
123 * Targeted links::              Point at a location in a file
125 TODO Items
127 * Using TODO states::           Setting and switching states
128 * Multi-state workflows::       More than just on/off
129 * Progress logging::            Dates and notes for progress
130 * Priorities::                  Some things are more important than others
131 * Breaking down tasks::         Splitting a task into manageable pieces
132 * Checkboxes::                  Tick-off lists
134 Progress logging
136 * Closing items::               When was this entry marked DONE?
137 * Tracking TODO state changes::  When did the status change?
139 Tags
141 * Tag inheritance::             Tags use the tree structure of the outline
142 * Setting tags::                How to assign tags to a headline
143 * Tag searches::                Searching for combinations of tags
145 Dates and Times
147 * Timestamps::                  Assigning a time to a tree entry
148 * Creating timestamps::         Commands which insert timestamps
149 * Deadlines and scheduling::    Planning your work
150 * Clocking work time::          Tracking how long you spend on a task
152 Capture - Refile - Archive
154 * Capture::                     
155 * Refile and copy::             Moving a tree from one place to another
156 * Archiving::                   What to do with finished projects
158 Capture
160 * Setting up a capture location::  Where notes will be stored
161 * Using capture::               Commands to invoke and terminate capture
162 * Capture templates::           Define the outline of different note types
164 Agenda Views
166 * Agenda files::                Files being searched for agenda information
167 * Agenda dispatcher::           Keyboard access to agenda views
168 * Built-in agenda views::       What is available out of the box?
169 * Agenda commands::             Remote editing of Org trees
170 * Custom agenda views::         Defining special searches and views
172 The built-in agenda views
174 * Weekly/daily agenda::         The calendar page with current tasks
175 * Global TODO list::            All unfinished action items
176 * Matching tags and properties::  Structured information with fine-tuned search
177 * Timeline::                    Time-sorted view for single file
178 * Search view::                 Find entries by searching for text
180 Markup for rich export
182 * Structural markup elements::  The basic structure as seen by the exporter
183 * Images and tables::           Tables and Images will be included
184 * Literal examples::            Source code examples with special formatting
185 * Include files::               Include additional files into a document
186 * Embedded @LaTeX{}::           @LaTeX{} can be freely used inside Org documents
188 Structural markup elements
190 * Document title::              Where the title is taken from
191 * Headings and sections::       The document structure as seen by the exporter
192 * Table of contents::           The if and where of the table of contents
193 * Paragraphs::                  Paragraphs
194 * Emphasis and monospace::      Bold, italic, etc.
195 * Comment lines::               What will *not* be exported
197 Exporting
199 * Export options::              Per-file export settings
200 * The export dispatcher::       How to access exporter commands
201 * ASCII/Latin-1/UTF-8 export::  Exporting to flat files with encoding
202 * HTML export::                 Exporting to HTML
203 * @LaTeX{} and PDF export::     Exporting to @LaTeX{}, and processing to PDF
204 * DocBook export::              Exporting to DocBook
205 * iCalendar export::            
207 Miscellaneous
209 * Completion::                  M-TAB knows what you need
210 * Clean view::                  Getting rid of leading stars in the outline
211 * MobileOrg::                   Org-mode on the iPhone
213 @end detailmenu
214 @end menu
216 @node Introduction, Document Structure, Top, Top
217 @chapter Introduction
219 @menu
220 * Preface::                     Welcome
221 * Installation::                How to install a downloaded version of Org
222 * Activation::                  How to activate Org for certain buffers
223 * Feedback::                    Bug reports, ideas, patches etc.
224 @end menu
226 @node Preface, Installation, Introduction, Introduction
227 @section Preface
229 Org is a mode for keeping notes, maintaining TODO lists, and doing project
230 planning with a fast and effective plain-text system.  It is also an
231 authoring and publishing system.
233 @i{This document is a much compressed derivative of the
234 @uref{http://orgmode.org/index.html#sec-4_1, comprehensive Org-mode manual}.
235 It contains all basic features and commands, along with important hints for
236 customization.  It is intended for beginners who would shy back from a 200
237 page manual because of sheer size.}
239 @node Installation, Activation, Preface, Introduction
240 @section Installation
242 @b{Important:} @i{If you are using a version of Org that is part of the Emacs
243 distribution or an XEmacs package, please skip this section and go directly
244 to @ref{Activation}.}
246 If you have downloaded Org from the Web, either as a distribution @file{.zip}
247 or @file{.tar} file, or as a Git archive, it is best to run it directly from
248 the distribution directory.  You need to add the @file{lisp} subdirectories
249 to the Emacs load path.  To do this, add the following line to @file{.emacs}:
251 @smallexample
252 (setq load-path (cons "~/path/to/orgdir/lisp" load-path))
253 (setq load-path (cons "~/path/to/orgdir/contrib/lisp" load-path))
254 @end smallexample
256 @noindent For speed you should byte-compile the Lisp files with the shell
257 command:
259 @smallexample
260 make
261 @end smallexample
263 @node Activation, Feedback, Installation, Introduction
264 @section Activation
266 Add the following lines to your @file{.emacs} file.  The last three lines
267 define @emph{global} keys for some commands --- please choose suitable keys
268 yourself.
270 @smalllisp
271 ;; The following lines are always needed.  Choose your own keys.
272 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode)) ; not needed since Emacs 22.2
273 (add-hook 'org-mode-hook 'turn-on-font-lock) ; not needed when global-font-lock-mode is on
274 (global-set-key "\C-cl" 'org-store-link)
275 (global-set-key "\C-ca" 'org-agenda)
276 (global-set-key "\C-cb" 'org-iswitchb)
277 @end smalllisp
279 With this setup, all files with extension @samp{.org} will be put
280 into Org mode. 
282 @node Feedback,  , Activation, Introduction
283 @section Feedback
285 If you find problems with Org, or if you have questions, remarks, or ideas
286 about it, please mail to the Org mailing list @email{emacs-orgmode@@gnu.org}.
287 For information on how to submit bug reports, see the main manual.
289 @node Document Structure, Tables, Introduction, Top
290 @chapter Document Structure
292 Org is based on Outline mode and provides flexible commands to
293 edit the structure of the document.
295 @menu
296 * Outlines::                    Org is based on Outline mode
297 * Headlines::                   How to typeset Org tree headlines
298 * Visibility cycling::          Show and hide, much simplified
299 * Motion::                      Jumping to other headlines
300 * Structure editing::           Changing sequence and level of headlines
301 * Sparse trees::                Matches embedded in context
302 * Plain lists::                 Additional structure within an entry
303 * Footnotes::                   How footnotes are defined in Org's syntax
304 @end menu
306 @node Outlines, Headlines, Document Structure, Document Structure
307 @section Outlines
309 Org is implemented on top of Outline mode.  Outlines allow a
310 document to be organized in a hierarchical structure, which (at least
311 for me) is the best representation of notes and thoughts.  An overview
312 of this structure is achieved by folding (hiding) large parts of the
313 document to show only the general document structure and the parts
314 currently being worked on.  Org greatly simplifies the use of
315 outlines by compressing the entire show/hide functionality into a single
316 command, @command{org-cycle}, which is bound to the @key{TAB} key.
318 @node Headlines, Visibility cycling, Outlines, Document Structure
319 @section Headlines
321 Headlines define the structure of an outline tree.  The headlines in
322 Org start with one or more stars, on the left margin@footnote{See
323 the variable @code{org-special-ctrl-a/e} to configure special behavior
324 of @kbd{C-a} and @kbd{C-e} in headlines.}.  For example:
326 @smallexample
327 * Top level headline
328 ** Second level
329 *** 3rd level
330     some text
331 *** 3rd level
332     more text
334 * Another top level headline
335 @end smallexample
337 @noindent Some people find the many stars too noisy and would prefer an
338 outline that has whitespace followed by a single star as headline
339 starters.  @ref{Clean view}, describes a setup to realize this.
341 @node Visibility cycling, Motion, Headlines, Document Structure
342 @section Visibility cycling
344 Outlines make it possible to hide parts of the text in the buffer.
345 Org uses just two commands, bound to @key{TAB} and
346 @kbd{S-@key{TAB}} to change the visibility in the buffer.
348 @table @kbd
349 @item @key{TAB}
350 @emph{Subtree cycling}: Rotate current subtree among the states
352 @smallexample
353 ,-> FOLDED -> CHILDREN -> SUBTREE --.
354 '-----------------------------------'
355 @end smallexample
357 When called with a prefix argument (@kbd{C-u @key{TAB}}) or with the shift
358 key, global cycling is invoked.
360 @item S-@key{TAB} @r{and} C-u @key{TAB}
361 @emph{Global cycling}: Rotate the entire buffer among the states
363 @smallexample
364 ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
365 '--------------------------------------'
366 @end smallexample
368 @item C-u C-u C-u @key{TAB}
369 Show all, including drawers.
370 @end table
372 When Emacs first visits an Org file, the global state is set to
373 OVERVIEW, i.e.@: only the top level headlines are visible.  This can be
374 configured through the variable @code{org-startup-folded}, or on a
375 per-file basis by adding a startup keyword @code{overview}, @code{content},
376 @code{showall}, like this:
378 @smallexample
379 #+STARTUP: content
380 @end smallexample
383 @node Motion, Structure editing, Visibility cycling, Document Structure
384 @section Motion
385 The following commands jump to other headlines in the buffer.
387 @table @kbd
388 @item C-c C-n
389 Next heading.
390 @item C-c C-p
391 Previous heading.
392 @item C-c C-f
393 Next heading same level.
394 @item C-c C-b
395 Previous heading same level.
396 @item C-c C-u
397 Backward to higher level heading.
398 @end table
400 @node Structure editing, Sparse trees, Motion, Document Structure
401 @section Structure editing
403 @table @kbd
404 @item M-@key{RET}
405 Insert new heading with same level as current.  If the cursor is in a plain
406 list item, a new item is created (@pxref{Plain lists}).  When this command is
407 used in the middle of a line, the line is split and the rest of the line
408 becomes the new headline@footnote{If you do not want the line to be split,
409 customize the variable @code{org-M-RET-may-split-line}.}.
410 @item M-S-@key{RET}
411 Insert new TODO entry with same level as current heading.
412 @item @key{TAB} @r{in new, empty entry}
413 In a new entry with no text yet, @key{TAB} will cycle through reasonable
414 levels.
415 @item M-@key{left}@r{/}@key{right}
416 Promote/demote current heading by one level.
417 @item M-S-@key{left}@r{/}@key{right}
418 Promote/demote the current subtree by one level.
419 @item M-S-@key{up}@r{/}@key{down}
420 Move subtree up/down (swap with previous/next subtree of same
421 level).
422 @item C-c C-w
423 Refile entry or region to a different location.  @xref{Refile and copy}.
424 @item C-x n s/w
425 Narrow buffer to current subtree / widen it again
426 @end table
428 When there is an active region (Transient Mark mode), promotion and
429 demotion work on all headlines in the region.
431 @node Sparse trees, Plain lists, Structure editing, Document Structure
432 @section Sparse trees
434 An important feature of Org mode is the ability to construct @emph{sparse
435 trees} for selected information in an outline tree, so that the entire
436 document is folded as much as possible, but the selected information is made
437 visible along with the headline structure above it@footnote{See also the
438 variables @code{org-show-hierarchy-above}, @code{org-show-following-heading},
439 @code{org-show-siblings}, and @code{org-show-entry-below} for detailed
440 control on how much context is shown around each match.}.  Just try it out
441 and you will see immediately how it works.
443 Org mode contains several commands creating such trees, all these
444 commands can be accessed through a dispatcher:
446 @table @kbd
447 @item C-c /
448 This prompts for an extra key to select a sparse-tree creating command.
449 @item C-c / r
450 Occur.  Prompts for a regexp and shows a sparse tree with all matches.  Each
451 match is also highlighted; the highlights disappear by pressing @kbd{C-c C-c}.
452 @end table
454 The other sparse tree commands select headings based on TODO keywords,
455 tags, or properties and will be discussed later in this manual.
457 @node Plain lists, Footnotes, Sparse trees, Document Structure
458 @section Plain lists
460 Within an entry of the outline tree, hand-formatted lists can provide
461 additional structure.  They also provide a way to create lists of
462 checkboxes (@pxref{Checkboxes}).  Org supports editing such lists,
463 and the HTML exporter (@pxref{Exporting}) parses and formats them.
465 Org knows ordered lists, unordered lists, and description lists.
466 @itemize @bullet
467 @item
468 @emph{Unordered} list items start with @samp{-}, @samp{+}, or
469 @samp{*} as bullets.
470 @item
471 @emph{Ordered} list items start with @samp{1.} or @samp{1)}.
472 @item
473 @emph{Description} list use @samp{ :: } to separate the @emph{term} from the
474 description.
475 @end itemize
477 Items belonging to the same list must have the same indentation on the first
478 line.  An item ends before the next line that is indented like its
479 bullet/number, or less.  A list ends when all items are closed, or before two
480 blank lines.  An example:
482 @smallexample
483 @group
484 ** Lord of the Rings
485    My favorite scenes are (in this order)
486    1. The attack of the Rohirrim
487    2. Eowyn's fight with the witch king
488       + this was already my favorite scene in the book
489       + I really like Miranda Otto.
490    Important actors in this film are:
491    - @b{Elijah Wood} :: He plays Frodo
492    - @b{Sean Austin} :: He plays Sam, Frodo's friend.
493 @end group
494 @end smallexample
496 The following commands act on items when the cursor is in the first line of
497 an item (the line with the bullet or number).
499 @table @kbd
500 @item @key{TAB}
501 Items can be folded just like headline levels.
502 @item M-@key{RET}
503 Insert new item at current level.  With a prefix argument, force a new
504 heading (@pxref{Structure editing}).
505 @item M-S-@key{RET}
506 Insert a new item with a checkbox (@pxref{Checkboxes}).
507 @item M-S-@key{up}@r{/}@key{down}
508 Move the item including subitems up/down (swap with previous/next item
509 of same indentation).  If the list is ordered, renumbering is
510 automatic.
511 @item M-@key{left}@r{/}M-@key{right}
512 Decrease/increase the indentation of an item, leaving children alone.
513 @item M-S-@key{left}@r{/}@key{right}
514 Decrease/increase the indentation of the item, including subitems.
515 @item C-c C-c
516 If there is a checkbox (@pxref{Checkboxes}) in the item line, toggle the
517 state of the checkbox.  Also verify bullets and indentation consistency in
518 the whole list.
519 @item C-c -
520 Cycle the entire list level through the different itemize/enumerate bullets
521 (@samp{-}, @samp{+}, @samp{*}, @samp{1.}, @samp{1)}).
522 @end table
524 @node Footnotes,  , Plain lists, Document Structure
525 @section Footnotes
527 A footnote is defined in a paragraph that is started by a footnote marker in
528 square brackets in column 0, no indentation allowed.  The footnote reference
529 is simply the marker in square brackets, inside text.  For example:
531 @smallexample
532 The Org homepage[fn:1] now looks a lot better than it used to.
534 [fn:1] The link is: http://orgmode.org
535 @end smallexample
537 @noindent The following commands handle footnotes:
539 @table @kbd
540 @item C-c C-x f
541 The footnote action command.  When the cursor is on a footnote reference,
542 jump to the definition.  When it is at a definition, jump to the (first)
543 reference.  Otherwise, create a new footnote.  When this command is called
544 with a prefix argument, a menu of additional options including renumbering is
545 offered.
547 @item C-c C-c
548 Jump between definition and reference.
549 @end table
551 @seealso{
552 @uref{http://orgmode.org/manual/Document-Structure.html#Document-Structure,
553 Chapter 2 of the manual}@*
554 @uref{http://sachachua.com/wp/2008/01/outlining-your-notes-with-org/,
555 Sacha Chua's tutorial}}
558 @node Tables, Hyperlinks, Document Structure, Top
559 @chapter Tables
561 Org comes with a fast and intuitive table editor.  Spreadsheet-like
562 calculations are supported in connection with the Emacs @file{calc}
563 package
564 @ifinfo
565 (@pxref{Top,Calc,,Calc,Gnu Emacs Calculator Manual}).
566 @end ifinfo
567 @ifnotinfo
568 (see the Emacs Calculator manual for more information about the Emacs
569 calculator).
570 @end ifnotinfo
572 Org makes it easy to format tables in plain ASCII.  Any line with
573 @samp{|} as the first non-whitespace character is considered part of a
574 table.  @samp{|} is also the column separator.  A table might look like
575 this:
577 @smallexample
578 | Name  | Phone | Age |
579 |-------+-------+-----|
580 | Peter |  1234 |  17 |
581 | Anna  |  4321 |  25 |
582 @end smallexample
584 A table is re-aligned automatically each time you press @key{TAB} or
585 @key{RET} or @kbd{C-c C-c} inside the table.  @key{TAB} also moves to
586 the next field (@key{RET} to the next row) and creates new table rows
587 at the end of the table or before horizontal lines.  The indentation
588 of the table is set by the first line.  Any line starting with
589 @samp{|-} is considered as a horizontal separator line and will be
590 expanded on the next re-align to span the whole table width.  So, to
591 create the above table, you would only type
593 @smallexample
594 |Name|Phone|Age|
596 @end smallexample
598 @noindent and then press @key{TAB} to align the table and start filling in
599 fields.  Even faster would be to type @code{|Name|Phone|Age} followed by
600 @kbd{C-c @key{RET}}.
602 When typing text into a field, Org treats @key{DEL},
603 @key{Backspace}, and all character keys in a special way, so that
604 inserting and deleting avoids shifting other fields.  Also, when
605 typing @emph{immediately after the cursor was moved into a new field
606 with @kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}}, the
607 field is automatically made blank.
609 @table @kbd
610 @tsubheading{Creation and conversion}
611 @item C-c |
612 Convert the active region to table.  If every line contains at least one TAB
613 character, the function assumes that the material is tab separated.  If every
614 line contains a comma, comma-separated values (CSV) are assumed.  If not,
615 lines are split at whitespace into fields.
617 If there is no active region, this command creates an empty Org
618 table.  But it's easier just to start typing, like
619 @kbd{|Name|Phone|Age C-c @key{RET}}.
621 @tsubheading{Re-aligning and field motion}
622 @item C-c C-c
623 Re-align the table without moving the cursor.
625 @item @key{TAB}
626 Re-align the table, move to the next field.  Creates a new row if
627 necessary.
629 @item S-@key{TAB}
630 Re-align, move to previous field.
632 @item @key{RET}
633 Re-align the table and move down to next row.  Creates a new row if
634 necessary.
636 @tsubheading{Column and row editing}
637 @item M-@key{left}
638 @itemx M-@key{right}
639 Move the current column left/right.
641 @item M-S-@key{left}
642 Kill the current column.
644 @item M-S-@key{right}
645 Insert a new column to the left of the cursor position.
647 @item M-@key{up}
648 @itemx M-@key{down}
649 Move the current row up/down.
651 @item M-S-@key{up}
652 Kill the current row or horizontal line.
654 @item M-S-@key{down}
655 Insert a new row above the current row.  With a prefix argument, the line is
656 created below the current one.
658 @item C-c -
659 Insert a horizontal line below current row.  With a prefix argument, the line
660 is created above the current line.
662 @item C-c @key{RET}
663 Insert a horizontal line below current row, and move the cursor into the row
664 below that line.
666 @item C-c ^
667 Sort the table lines in the region.  The position of point indicates the
668 column to be used for sorting, and the range of lines is the range
669 between the nearest horizontal separator lines, or the entire table.
671 @end table
673 @seealso{
674 @uref{http://orgmode.org/manual/Tables.html#Tables, Chapter 3 of the
675 manual}@*
676 @uref{http://orgmode.org/worg/org-tutorials/tables.php, Bastien's
677 table tutorial}@*
678 @uref{http://orgmode.org/worg/org-tutorials/org-spreadsheet-intro.php,
679 Bastien's spreadsheet tutorial}@*
680 @uref{http://orgmode.org/worg/org-tutorials/org-plot.php, Eric's plotting tutorial}}
682 @node Hyperlinks, TODO Items, Tables, Top
683 @chapter Hyperlinks
685 Like HTML, Org provides links inside a file, external links to
686 other files, Usenet articles, emails, and much more.
688 @menu
689 * Link format::                 How links in Org are formatted
690 * Internal links::              Links to other places in the current file
691 * External links::              URL-like links to the world
692 * Handling links::              Creating, inserting and following
693 * Targeted links::              Point at a location in a file
694 @end menu
696 @node Link format, Internal links, Hyperlinks, Hyperlinks
697 @section Link format
699 Org will recognize plain URL-like links and activate them as
700 clickable links.  The general link format, however, looks like this:
702 @smallexample
703 [[link][description]]       @r{or alternatively}           [[link]]
704 @end smallexample
706 @noindent
707 Once a link in the buffer is complete (all brackets present), Org will change
708 the display so that @samp{description} is displayed instead of
709 @samp{[[link][description]]} and @samp{link} is displayed instead of
710 @samp{[[link]]}.  To edit the invisible @samp{link} part, use @kbd{C-c
711 C-l} with the cursor on the link.
713 @node Internal links, External links, Link format, Hyperlinks
714 @section Internal links
716 If the link does not look like a URL, it is considered to be internal in the
717 current file.  The most important case is a link like
718 @samp{[[#my-custom-id]]} which will link to the entry with the
719 @code{CUSTOM_ID} property @samp{my-custom-id}.
721 Links such as @samp{[[My Target]]} or @samp{[[My Target][Find my target]]}
722 lead to a text search in the current file for the corresponding target which
723 looks like @samp{<<My Target>>}.
725 @node External links, Handling links, Internal links, Hyperlinks
726 @section External links
728 Org supports links to files, websites, Usenet and email messages,
729 BBDB database entries and links to both IRC conversations and their
730 logs.  External links are URL-like locators.  They start with a short
731 identifying string followed by a colon.  There can be no space after
732 the colon.  Here are some examples:
734 @smallexample
735 http://www.astro.uva.nl/~dominik          @r{on the web}
736 file:/home/dominik/images/jupiter.jpg     @r{file, absolute path}
737 /home/dominik/images/jupiter.jpg          @r{same as above}
738 file:papers/last.pdf                      @r{file, relative path}
739 file:projects.org                         @r{another Org file}
740 docview:papers/last.pdf::NNN              @r{open file in doc-view mode at page NNN}
741 id:B7423F4D-2E8A-471B-8810-C40F074717E9   @r{Link to heading by ID}
742 news:comp.emacs                           @r{Usenet link}
743 mailto:adent@@galaxy.net                   @r{Mail link}
744 vm:folder                                 @r{VM folder link}
745 vm:folder#id                              @r{VM message link}
746 wl:folder#id                              @r{WANDERLUST message link}
747 mhe:folder#id                             @r{MH-E message link}
748 rmail:folder#id                           @r{RMAIL message link}
749 gnus:group#id                             @r{Gnus article link}
750 bbdb:R.*Stallman                          @r{BBDB link (with regexp)}
751 irc:/irc.com/#emacs/bob                   @r{IRC link}
752 info:org:External%20links                 @r{Info node link (with encoded space)}
753 @end smallexample
755 A link should be enclosed in double brackets and may contain a
756 descriptive text to be displayed instead of the URL (@pxref{Link
757 format}), for example:
759 @smallexample
760 [[http://www.gnu.org/software/emacs/][GNU Emacs]]
761 @end smallexample
763 @noindent
764 If the description is a file name or URL that points to an image, HTML export
765 (@pxref{HTML export}) will inline the image as a clickable button.  If there
766 is no description at all and the link points to an image, that image will be
767 inlined into the exported HTML file.
769 @node Handling links, Targeted links, External links, Hyperlinks
770 @section Handling links
772 Org provides methods to create a link in the correct syntax, to
773 insert it into an Org file, and to follow the link.
775 @table @kbd
776 @item C-c l
777 Store a link to the current location.  This is a @emph{global} command (you
778 must create the key binding yourself) which can be used in any buffer to
779 create a link.  The link will be stored for later insertion into an Org
780 buffer (see below).
782 @item C-c C-l
783 Insert a link.  This prompts for a link to be inserted into the buffer.  You
784 can just type a link, or use history keys @key{up} and @key{down} to access
785 stored links.  You will be prompted for the description part of the link.
786 When called with a @kbd{C-u} prefix argument, file name completion is used to
787 link to a file.
789 @item C-c C-l @r{(with cursor on existing link)}
790 When the cursor is on an existing link, @kbd{C-c C-l} allows you to edit the
791 link and description parts of the link.
793 @item C-c C-o @r{or} mouse-1 @r{or} mouse-2
794 Open link at point.
795 @item C-c &
796 Jump back to a recorded position.  A position is recorded by the
797 commands following internal links, and by @kbd{C-c %}.  Using this
798 command several times in direct succession moves through a ring of
799 previously recorded positions.
801 @end table
803 @node Targeted links,  , Handling links, Hyperlinks
804 @section Targeted links
806 File links can contain additional information to make Emacs jump to a
807 particular location in the file when following a link.  This can be a
808 line number or a search option after a double colon.
810 Here is the syntax of the different ways to attach a search to a file
811 link, together with an explanation:
813 @smallexample
814 [[file:~/code/main.c::255]]                 @r{Find line 255}
815 [[file:~/xx.org::My Target]]                @r{Find @samp{<<My Target>>}}
816 [[file:~/xx.org::#my-custom-id]]            @r{Find entry with custom id}
817 @end smallexample
819 @seealso{
820 @uref{http://orgmode.org/manual/Hyperlinks.html#Hyperlinks, Chapter 4 of the
821 manual}}
823 @node TODO Items, Tags, Hyperlinks, Top
824 @chapter TODO Items
826 Org mode does not maintain TODO lists as separate documents@footnote{Of
827 course, you can make a document that contains only long lists of TODO items,
828 but this is not required.}.  Instead, TODO items are an integral part of the
829 notes file, because TODO items usually come up while taking notes!  With Org
830 mode, simply mark any entry in a tree as being a TODO item.  In this way,
831 information is not duplicated, and the entire context from which the TODO
832 item emerged is always present.
834 Of course, this technique for managing TODO items scatters them
835 throughout your notes file.  Org mode compensates for this by providing
836 methods to give you an overview of all the things that you have to do.
838 @menu
839 * Using TODO states::           Setting and switching states
840 * Multi-state workflows::       More than just on/off
841 * Progress logging::            Dates and notes for progress
842 * Priorities::                  Some things are more important than others
843 * Breaking down tasks::         Splitting a task into manageable pieces
844 * Checkboxes::                  Tick-off lists
845 @end menu
847 @node Using TODO states, Multi-state workflows, TODO Items, TODO Items
848 @section Using TODO states
850 Any headline becomes a TODO item when it starts with the word
851 @samp{TODO}, for example:
853 @smallexample
854 *** TODO Write letter to Sam Fortune
855 @end smallexample
857 @noindent
858 The most important commands to work with TODO entries are:
860 @table @kbd
861 @item C-c C-t
862 Rotate the TODO state of the current item among
864 @smallexample
865 ,-> (unmarked) -> TODO -> DONE --.
866 '--------------------------------'
867 @end smallexample
869 The same rotation can also be done ``remotely'' from the timeline and
870 agenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).
872 @item S-@key{right}@r{/}@key{left}
873 Select the following/preceding TODO state, similar to cycling.
874 @item C-c / t
875 View TODO items in a @emph{sparse tree} (@pxref{Sparse trees}).  Folds the
876 buffer, but shows all TODO items and the headings hierarchy above
877 them.
878 @item C-c a t
879 Show the global TODO list.  Collects the TODO items from all agenda files
880 (@pxref{Agenda Views}) into a single buffer.  @xref{Global TODO list}, for
881 more information.
882 @item S-M-@key{RET}
883 Insert a new TODO entry below the current one.
884 @end table
886 @noindent
887 Changing a TODO state can also trigger tag changes.  See the docstring of the
888 option @code{org-todo-state-tags-triggers} for details.
890 @node Multi-state workflows, Progress logging, Using TODO states, TODO Items
891 @section Multi-state workflows
893 You can use TODO keywords to indicate different @emph{sequential} states
894 in the process of working on an item, for example:
896 @smalllisp
897 (setq org-todo-keywords
898   '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
899 @end smalllisp
901 The vertical bar separates the TODO keywords (states that @emph{need
902 action}) from the DONE states (which need @emph{no further action}).  If
903 you don't provide the separator bar, the last state is used as the DONE
904 state.
905 With this setup, the command @kbd{C-c C-t} will cycle an entry from TODO
906 to FEEDBACK, then to VERIFY, and finally to DONE and DELEGATED.  
908 Sometimes you may want to use different sets of TODO keywords in
909 parallel.  For example, you may want to have the basic
910 @code{TODO}/@code{DONE}, but also a workflow for bug fixing, and a
911 separate state indicating that an item has been canceled (so it is not
912 DONE, but also does not require action).  Your setup would then look
913 like this:
915 @smalllisp
916 (setq org-todo-keywords
917       '((sequence "TODO(t)" "|" "DONE(d)")
918         (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")
919         (sequence "|" "CANCELED(c)")))
920 @end smalllisp
922 The keywords should all be different, this helps Org mode to keep track of
923 which subsequence should be used for a given entry.  The example also shows
924 how to define keys for fast access of a particular state, by adding a letter
925 in parenthesis after each keyword - you will be prompted for the key after
926 @kbd{C-c C-t}.
928 To define TODO keywords that are valid only in a single file, use the
929 following text anywhere in the file.
931 @smallexample
932 #+TODO: TODO(t) | DONE(d)
933 #+TODO: REPORT(r) BUG(b) KNOWNCAUSE(k) | FIXED(f)
934 #+TODO: | CANCELED(c)
935 @end smallexample
937 After changing one of these lines, use @kbd{C-c C-c} with the cursor still in
938 the line to make the changes known to Org mode.
940 @node Progress logging, Priorities, Multi-state workflows, TODO Items
941 @section Progress logging
943 Org mode can automatically record a timestamp and possibly a note when
944 you mark a TODO item as DONE, or even each time you change the state of
945 a TODO item.  This system is highly configurable, settings can be on a
946 per-keyword basis and can be localized to a file or even a subtree.  For
947 information on how to clock working time for a task, see @ref{Clocking
948 work time}.
950 @menu
951 * Closing items::               When was this entry marked DONE?
952 * Tracking TODO state changes::  When did the status change?
953 @end menu
955 @node Closing items, Tracking TODO state changes, Progress logging, Progress logging
956 @unnumberedsubsec Closing items
958 The most basic logging is to keep track of @emph{when} a certain TODO
959 item was finished.  This is achieved with@footnote{The corresponding
960 in-buffer setting is: @code{#+STARTUP: logdone}}.
962 @smalllisp
963 (setq org-log-done 'time)
964 @end smalllisp
966 @noindent
967 Then each time you turn an entry from a TODO (not-done) state into any of the
968 DONE states, a line @samp{CLOSED: [timestamp]} will be inserted just after
969 the headline.  If you want to record a note along with the timestamp,
970 use@footnote{The corresponding in-buffer setting is: @code{#+STARTUP:
971 lognotedone}}
973 @smalllisp
974 (setq org-log-done 'note)
975 @end smalllisp
977 @noindent
978 You will then be prompted for a note, and that note will be stored below
979 the entry with a @samp{Closing Note} heading.
981 @node Tracking TODO state changes,  , Closing items, Progress logging
982 @unnumberedsubsec Tracking TODO state changes
984 You might want to keep track of TODO state changes.  You can either record
985 just a timestamp, or a time-stamped note for a change.  These records will be
986 inserted after the headline as an itemized list.  When taking a lot of notes,
987 you might want to get the notes out of the way into a drawer.  Customize the
988 variable @code{org-log-into-drawer} to get this behavior.
990 For state logging, Org mode expects configuration on a per-keyword basis.
991 This is achieved by adding special markers @samp{!} (for a timestamp) and
992 @samp{@@} (for a note) in parentheses after each keyword.  For example:
993 @smallexample
994 #+TODO: TODO(t) WAIT(w@@/!) | DONE(d!) CANCELED(c@@)
995 @end smallexample
996 @noindent
997 will define TODO keywords and fast access keys, and also request that a time
998 is recorded when the entry is set to DONE, and that a note is recorded when
999 switching to WAIT or CANCELED.  The same syntax works also when setting
1000 @code{org-todo-keywords}.
1002 @node Priorities, Breaking down tasks, Progress logging, TODO Items
1003 @section Priorities
1005 If you use Org mode extensively, you may end up with enough TODO items that
1006 it starts to make sense to prioritize them.  Prioritizing can be done by
1007 placing a @emph{priority cookie} into the headline of a TODO item, like this
1009 @smallexample
1010 *** TODO [#A] Write letter to Sam Fortune
1011 @end smallexample
1013 @noindent
1014 Org mode supports three priorities: @samp{A}, @samp{B}, and @samp{C}.
1015 @samp{A} is the highest, @samp{B} the default if none is given.  Priorities
1016 make a difference only in the agenda.
1018 @table @kbd
1019 @item @kbd{C-c ,}
1020 Set the priority of the current headline.  Press @samp{A}, @samp{B} or
1021 @samp{C} to select a priority, or @key{SPC} to remove the cookie.
1023 @item S-@key{up}
1024 @itemx S-@key{down}
1025 Increase/decrease priority of current headline
1026 @end table
1028 @node Breaking down tasks, Checkboxes, Priorities, TODO Items
1029 @section Breaking tasks down into subtasks
1031 It is often advisable to break down large tasks into smaller, manageable
1032 subtasks.  You can do this by creating an outline tree below a TODO item,
1033 with detailed subtasks on the tree.  To keep the overview over the fraction
1034 of subtasks that are already completed, insert either @samp{[/]} or
1035 @samp{[%]} anywhere in the headline.  These cookies will be updated each time
1036 the TODO status of a child changes, or when pressing @kbd{C-c C-c} on the
1037 cookie.  For example:
1039 @smallexample
1040 * Organize Party [33%]
1041 ** TODO Call people [1/2]
1042 *** TODO Peter
1043 *** DONE Sarah
1044 ** TODO Buy food
1045 ** DONE Talk to neighbor
1046 @end smallexample
1048 @node Checkboxes,  , Breaking down tasks, TODO Items
1049 @section Checkboxes
1051 Every item in a plain list (@pxref{Plain lists}) can be made into a checkbox
1052 by starting it with the string @samp{[ ]}.  Checkboxes are not included into
1053 the global TODO list, so they are often great to split a task into a number
1054 of simple steps.
1055 Here is an example of a checkbox list.
1057 @smallexample
1058 * TODO Organize party [1/3]
1059   - [-] call people [1/2]
1060     - [ ] Peter
1061     - [X] Sarah
1062   - [X] order food
1063   - [ ] think about what music to play
1064 @end smallexample
1066 Checkboxes work hierarchically, so if a checkbox item has children that
1067 are checkboxes, toggling one of the children checkboxes will make the
1068 parent checkbox reflect if none, some, or all of the children are
1069 checked.
1071 @noindent The following commands work with checkboxes:
1073 @table @kbd
1074 @item C-c C-c
1075 Toggle checkbox status or (with prefix arg) checkbox presence at point.
1076 @item M-S-@key{RET}
1077 Insert a new item with a checkbox.
1078 This works only if the cursor is already in a plain list item
1079 (@pxref{Plain lists}).
1080 @end table
1082 @seealso{
1083 @uref{http://orgmode.org/manual/TODO-Items.html#TODO-Items, Chapter 5 of the manual}@*
1084 @uref{http://orgmode.org/worg/org-tutorials/orgtutorial_dto.php, David
1085 O'Toole's introductory tutorial}@*
1086 @uref{http://members.optusnet.com.au/~charles57/GTD/gtd_workflow.html,
1087 Charles Cave's GTD setup}}
1089 @node Tags, Properties, TODO Items, Top
1090 @chapter Tags
1092 An excellent way to implement labels and contexts for cross-correlating
1093 information is to assign @i{tags} to headlines.  Org mode has extensive
1094 support for tags.
1096 Every headline can contain a list of tags; they occur at the end of the
1097 headline.  Tags are normal words containing letters, numbers, @samp{_}, and
1098 @samp{@@}.  Tags must be preceded and followed by a single colon, e.g.,
1099 @samp{:work:}.  Several tags can be specified, as in @samp{:work:urgent:}.
1100 Tags will by default be in bold face with the same color as the headline.
1102 @menu
1103 * Tag inheritance::             Tags use the tree structure of the outline
1104 * Setting tags::                How to assign tags to a headline
1105 * Tag searches::                Searching for combinations of tags
1106 @end menu
1108 @node Tag inheritance, Setting tags, Tags, Tags
1109 @section Tag inheritance
1111 @i{Tags} make use of the hierarchical structure of outline trees.  If a
1112 heading has a certain tag, all subheadings will inherit the tag as
1113 well.  For example, in the list
1115 @smallexample
1116 * Meeting with the French group      :work:
1117 ** Summary by Frank                  :boss:notes:
1118 *** TODO Prepare slides for him      :action:
1119 @end smallexample
1121 @noindent
1122 the final heading will have the tags @samp{:work:}, @samp{:boss:},
1123 @samp{:notes:}, and @samp{:action:} even though the final heading is not
1124 explicitly marked with those tags.  You can also set tags that all entries in
1125 a file should inherit just as if these tags were defined in a hypothetical
1126 level zero that surrounds the entire file.  Use a line like this@footnote{As
1127 with all these in-buffer settings, pressing @kbd{C-c C-c} activates any
1128 changes in the line.}:
1130 @smallexample
1131 #+FILETAGS: :Peter:Boss:Secret:
1132 @end smallexample
1134 @node Setting tags, Tag searches, Tag inheritance, Tags
1135 @section Setting tags
1137 Tags can simply be typed into the buffer at the end of a headline.
1138 After a colon, @kbd{M-@key{TAB}} offers completion on tags.  There is
1139 also a special command for inserting tags:
1141 @table @kbd
1142 @item C-c C-q
1143 Enter new tags for the current headline.  Org mode will either offer
1144 completion or a special single-key interface for setting tags, see
1145 below.  After pressing @key{RET}, the tags will be inserted and aligned
1146 to @code{org-tags-column}.  When called with a @kbd{C-u} prefix, all
1147 tags in the current buffer will be aligned to that column, just to make
1148 things look nice.
1149 @item C-c C-c
1150 When the cursor is in a headline, this does the same as @kbd{C-c C-q}.
1151 @end table
1153 Org will support tag insertion based on a @emph{list of tags}.  By
1154 default this list is constructed dynamically, containing all tags
1155 currently used in the buffer.  You may also globally specify a hard list
1156 of tags with the variable @code{org-tag-alist}.  Finally you can set
1157 the default tags for a given file with lines like
1159 @smallexample
1160 #+TAGS: @@work @@home @@tennisclub
1161 #+TAGS: laptop car pc sailboat
1162 @end smallexample
1164 By default Org mode uses the standard minibuffer completion facilities for
1165 entering tags.  However, it also implements another, quicker, tag selection
1166 method called @emph{fast tag selection}.  This allows you to select and
1167 deselect tags with just a single key press.  For this to work well you should
1168 assign unique letters to most of your commonly used tags.  You can do this
1169 globally by configuring the variable @code{org-tag-alist} in your
1170 @file{.emacs} file.  For example, you may find the need to tag many items in
1171 different files with @samp{:@@home:}.  In this case you can set something
1172 like:
1174 @smalllisp
1175 (setq org-tag-alist '(("@@work" . ?w) ("@@home" . ?h) ("laptop" . ?l)))
1176 @end smalllisp
1178 @noindent If the tag is only relevant to the file you are working on, then you
1179 can instead set the TAGS option line as:
1181 @smallexample
1182 #+TAGS: @@work(w)  @@home(h)  @@tennisclub(t)  laptop(l)  pc(p)
1183 @end smallexample
1185 @node Tag searches,  , Setting tags, Tags
1186 @section Tag searches
1188 Once a system of tags has been set up, it can be used to collect related
1189 information into special lists.
1191 @table @kbd
1192 @item C-c \
1193 @itemx C-c / m
1194 Create a sparse tree with all headlines matching a tags search.  With a
1195 @kbd{C-u} prefix argument, ignore headlines that are not a TODO line.
1196 @item C-c a m
1197 Create a global list of tag matches from all agenda files.
1198 @xref{Matching tags and properties}.
1199 @item C-c a M
1200 Create a global list of tag matches from all agenda files, but check
1201 only TODO items and force checking subitems (see variable
1202 @code{org-tags-match-list-sublevels}).
1203 @end table
1205 These commands all prompt for a match string which allows basic Boolean logic
1206 like @samp{+boss+urgent-project1}, to find entries with tags @samp{boss} and
1207 @samp{urgent}, but not @samp{project1}, or @samp{Kathy|Sally} to find entries
1208 which are tagged, like @samp{Kathy} or @samp{Sally}.  The full syntax of the
1209 search string is rich and allows also matching against TODO keywords, entry
1210 levels and properties.  For a complete description with many examples, see
1211 @ref{Matching tags and properties}.
1213 @seealso{
1214 @uref{http://orgmode.org/manual/Tags.html#Tags, Chapter 6 of the manual}@*
1215 @uref{http://sachachua.com/wp/2008/01/tagging-in-org-plus-bonus-code-for-timeclocks-and-tags/,
1216 Sacha Chua's article about tagging in Org-mode}}
1218 @node Properties, Dates and Times, Tags, Top
1219 @chapter Properties
1221 Properties are key-value pairs associates with and entry.  They live in a
1222 special drawer with the name @code{PROPERTIES}.  Each
1223 property is specified on a single line, with the key (surrounded by colons)
1224 first, and the value after it:
1226 @smallexample
1227 * CD collection
1228 ** Classic
1229 *** Goldberg Variations
1230     :PROPERTIES:
1231     :Title:     Goldberg Variations
1232     :Composer:  J.S. Bach
1233     :Publisher: Deutsche Grammophon
1234     :NDisks:    1
1235     :END:
1236 @end smallexample
1238 You may define the allowed values for a particular property @samp{:Xyz:}
1239 by setting a property @samp{:Xyz_ALL:}.  This special property is
1240 @emph{inherited}, so if you set it in a level 1 entry, it will apply to
1241 the entire tree.  When allowed values are defined, setting the
1242 corresponding property becomes easier and is less prone to typing
1243 errors.  For the example with the CD collection, we can predefine
1244 publishers and the number of disks in a box like this:
1246 @smallexample
1247 * CD collection
1248   :PROPERTIES:
1249   :NDisks_ALL:  1 2 3 4
1250   :Publisher_ALL: "Deutsche Grammophon" Philips EMI
1251   :END:
1252 @end smallexample
1253 or globally using @code{org-global-properties}, or file-wide like this:
1254 @smallexample
1255 #+PROPERTY: NDisks_ALL 1 2 3 4
1256 @end smallexample
1258 @table @kbd
1259 @item C-c C-x p
1260 Set a property.  This prompts for a property name and a value.
1261 @item C-c C-c d
1262 Remove a property from the current entry.
1263 @end table
1265 To create sparse trees and special lists with selection based on properties,
1266 the same commands are used as for tag searches (@pxref{Tag searches}).  The
1267 syntax for the search string is described in @ref{Matching tags and
1268 properties}.
1270 @table @kbd
1271 @end table
1273 @seealso{
1274 @uref{http://orgmode.org/manual/Properties-and-Columns.html#Properties-and-Columns,
1275 Chapter 7 of the manual}@*
1276 @uref{http://orgmode.org/worg/org-tutorials/org-column-view-tutorial.php,Bastien
1277 Guerry's column view tutorial}}
1279 @node Dates and Times, Capture - Refile - Archive, Properties, Top
1280 @chapter Dates and Times
1282 To assist project planning, TODO items can be labeled with a date and/or
1283 a time.  The specially formatted string carrying the date and time
1284 information is called a @emph{timestamp} in Org mode.
1286 @menu
1287 * Timestamps::                  Assigning a time to a tree entry
1288 * Creating timestamps::         Commands which insert timestamps
1289 * Deadlines and scheduling::    Planning your work
1290 * Clocking work time::          Tracking how long you spend on a task
1291 @end menu
1294 @node Timestamps, Creating timestamps, Dates and Times, Dates and Times
1295 @section Timestamps
1297 A timestamp is a specification of a date (possibly with a time or a range of
1298 times) in a special format, either @samp{<2003-09-16 Tue>} or
1299 @samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16 Tue 12:00-12:30>}.  A
1300 timestamp can appear anywhere in the headline or body of an Org tree entry.
1301 Its presence causes entries to be shown on specific dates in the agenda
1302 (@pxref{Weekly/daily agenda}).  We distinguish:
1304 @noindent @b{Plain timestamp; Event; Appointment}@*
1305 A simple timestamp just assigns a date/time to an item.  This is just
1306 like writing down an appointment or event in a paper agenda.
1308 @smallexample
1309 * Meet Peter at the movies
1310   <2006-11-01 Wed 19:15>
1311 * Discussion on climate change
1312   <2006-11-02 Thu 20:00-22:00>
1313 @end smallexample
1315 @noindent @b{Timestamp with repeater interval}@*
1316 A timestamp may contain a @emph{repeater interval}, indicating that it
1317 applies not only on the given date, but again and again after a certain
1318 interval of N days (d), weeks (w), months (m), or years (y).  The
1319 following will show up in the agenda every Wednesday:
1320 @smallexample
1321 * Pick up Sam at school
1322   <2007-05-16 Wed 12:30 +1w>
1323 @end smallexample
1325 @noindent @b{Diary-style sexp entries}@*
1326 For more complex date specifications, Org mode supports using the
1327 special sexp diary entries implemented in the Emacs calendar/diary
1328 package.  For example
1329 @smallexample
1330 * The nerd meeting on every 2nd Thursday of the month
1331   <%%(diary-float t 4 2)>
1332 @end smallexample
1334 @noindent @b{Time/Date range}@*
1335 Two timestamps connected by @samp{--} denote a range.
1336 @smallexample
1337 ** Meeting in Amsterdam
1338    <2004-08-23 Mon>--<2004-08-26 Thu>
1339 @end smallexample
1341 @noindent @b{Inactive timestamp}@*
1342 Just like a plain timestamp, but with square brackets instead of
1343 angular ones.  These timestamps are inactive in the sense that they do
1344 @emph{not} trigger an entry to show up in the agenda.
1346 @smallexample
1347 * Gillian comes late for the fifth time
1348   [2006-11-01 Wed]
1349 @end smallexample
1352 @node Creating timestamps, Deadlines and scheduling, Timestamps, Dates and Times
1353 @section Creating timestamps
1355 For Org mode to recognize timestamps, they need to be in the specific
1356 format.  All commands listed below produce timestamps in the correct
1357 format.
1359 @table @kbd
1360 @item C-c .
1361 Prompt for a date and insert a corresponding timestamp.  When the cursor is
1362 at an existing timestamp in the buffer, the command is used to modify this
1363 timestamp instead of inserting a new one.  When this command is used twice in
1364 succession, a time range is inserted.  With a prefix, also add the current
1365 time. 
1367 @item C-c !
1368 Like @kbd{C-c .}, but insert an inactive timestamp that will not cause
1369 an agenda entry.
1371 @item S-@key{left}@r{/}@key{right}
1372 Change date at cursor by one day.
1374 @item S-@key{up}@r{/}@key{down}
1375 Change the item under the cursor in a timestamp.  The cursor can be on a
1376 year, month, day, hour or minute.  When the timestamp contains a time range
1377 like @samp{15:30-16:30}, modifying the first time will also shift the second,
1378 shifting the time block with constant length.  To change the length, modify
1379 the second time.
1380 @end table
1382 When Org mode prompts for a date/time, it will accept any string containing
1383 some date and/or time information, and intelligently interpret the string,
1384 deriving defaults for unspecified information from the current date and time.
1385 You can also select a date in the pop-up calendar.  See the manual for more
1386 information on how exactly the date/time prompt works.
1388 @node Deadlines and scheduling, Clocking work time, Creating timestamps, Dates and Times
1389 @section Deadlines and scheduling
1391 A timestamp may be preceded by special keywords to facilitate planning:
1393 @noindent @b{DEADLINE}@*
1394 Meaning: the task (most likely a TODO item, though not necessarily) is supposed
1395 to be finished on that date.
1396 @table @kbd
1397 @item C-c C-d
1398 Insert @samp{DEADLINE} keyword along with a stamp, in the line following the
1399 headline.
1400 @end table
1402 On the deadline date, the task will be listed in the agenda.  In
1403 addition, the agenda for @emph{today} will carry a warning about the
1404 approaching or missed deadline, starting
1405 @code{org-deadline-warning-days} before the due date, and continuing
1406 until the entry is marked DONE.  An example:
1408 @smallexample
1409 *** TODO write article about the Earth for the Guide
1410     The editor in charge is [[bbdb:Ford Prefect]]
1411     DEADLINE: <2004-02-29 Sun>
1412 @end smallexample
1415 @noindent @b{SCHEDULED}@*
1416 Meaning: you are @i{planning to start working} on that task on the given
1417 date@footnote{This is quite different from what is normally understood by
1418 @i{scheduling a meeting}, which is done in Org-mode by just inserting a time
1419 stamp without keyword.}.
1421 @table @kbd
1422 @item C-c C-s
1423 Insert @samp{SCHEDULED} keyword along with a stamp, in the line following the
1424 headline.
1425 @end table
1427 The headline will be listed under the given date@footnote{It will still
1428 be listed on that date after it has been marked DONE.  If you don't like
1429 this, set the variable @code{org-agenda-skip-scheduled-if-done}.}.  In
1430 addition, a reminder that the scheduled date has passed will be present
1431 in the compilation for @emph{today}, until the entry is marked DONE.
1432 I.e.@: the task will automatically be forwarded until completed.
1434 @smallexample
1435 *** TODO Call Trillian for a date on New Years Eve.
1436     SCHEDULED: <2004-12-25 Sat>
1437 @end smallexample
1439 Some tasks need to be repeated again and again.  Org mode helps to
1440 organize such tasks using a so-called repeater in a DEADLINE, SCHEDULED,
1441 or plain timestamp.  In the following example
1442 @smallexample
1443 ** TODO Pay the rent
1444    DEADLINE: <2005-10-01 Sat +1m>
1445 @end smallexample
1446 @noindent
1447 the @code{+1m} is a repeater; the intended interpretation is that the task
1448 has a deadline on <2005-10-01> and repeats itself every (one) month starting
1449 from that time.
1451 @node Clocking work time,  , Deadlines and scheduling, Dates and Times
1452 @section Clocking work time
1454 Org mode allows you to clock the time you spend on specific tasks in a
1455 project.
1457 @table @kbd
1458 @item C-c C-x C-i
1459 Start the clock on the current item (clock-in).  This inserts the CLOCK
1460 keyword together with a timestamp.  When called with a @kbd{C-u} prefix
1461 argument, select the task from a list of recently clocked tasks.
1463 @item C-c C-x C-o
1464 Stop the clock (clock-out).  This inserts another timestamp at the same
1465 location where the clock was last started.  It also directly computes
1466 the resulting time in inserts it after the time range as @samp{=>
1467 HH:MM}.
1468 @item C-c C-x C-e
1469 Update the effort estimate for the current clock task.
1470 @item C-c C-x C-x
1471 Cancel the current clock.  This is useful if a clock was started by
1472 mistake, or if you ended up working on something else.
1473 @item C-c C-x C-j
1474 Jump to the entry that contains the currently running clock.  With a
1475 @kbd{C-u} prefix arg, select the target task from a list of recently clocked
1476 tasks.
1477 @item C-c C-x C-r
1478 Insert a dynamic block containing a clock
1479 report as an Org-mode table into the current file.  When the cursor is
1480 at an existing clock table, just update it.
1481 @smallexample
1482 #+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file
1483 #+END: clocktable
1484 @end smallexample
1485 @noindent
1486 For details about how to customize this view, see @uref{http://orgmode.org/manual/Clocking-work-time.html#Clocking-work-time,the manual}.
1487 @item C-c C-c
1488 Update dynamic block at point.  The cursor needs to be in the
1489 @code{#+BEGIN} line of the dynamic block.
1490 @end table
1492 The @kbd{l} key may be used in the timeline (@pxref{Timeline}) and in
1493 the agenda (@pxref{Weekly/daily agenda}) to show which tasks have been
1494 worked on or closed during a day.
1496 @seealso{
1497 @uref{http://orgmode.org/manual/Dates-and-Times.html#Dates-and-Times,
1498 Chapter 8 of the manual}@*
1499 @uref{http://members.optusnet.com.au/~charles57/GTD/org_dates/, Charles
1500 Cave's Date and Time tutorial}@*
1501 @uref{http://doc.norang.ca/org-mode.html#Clocking, Bernt Hansen's clocking workflow}}
1503 @node Capture - Refile - Archive, Agenda Views, Dates and Times, Top
1504 @chapter Capture - Refile - Archive
1506 An important part of any organization system is the ability to quickly
1507 capture new ideas and tasks, and to associate reference material with them.
1508 Org defines a capture process to create tasks.  It stores files related to a
1509 task (@i{attachments}) in a special directory.  Once in the system, tasks and
1510 projects need to be moved around.  Moving completed project trees to an
1511 archive file keeps the system compact and fast.
1513 @menu
1514 * Capture::                     
1515 * Refile and copy::             Moving a tree from one place to another
1516 * Archiving::                   What to do with finished projects
1517 @end menu
1519 @node Capture, Refile and copy, Capture - Refile - Archive, Capture - Refile - Archive
1520 @section Capture
1522 Org's method for capturing new items is heavily inspired by John Wiegley
1523 excellent remember package.  It lets you store quick notes with little
1524 interruption of your work flow.  Org lets you define templates for new
1525 entries and associate them with different targets for storing notes.
1527 @menu
1528 * Setting up a capture location::  Where notes will be stored
1529 * Using capture::               Commands to invoke and terminate capture
1530 * Capture templates::           Define the outline of different note types
1531 @end menu
1533 @node Setting up a capture location, Using capture, Capture, Capture
1534 @unnumberedsubsec Setting up a capture location
1536 The following customization sets a default target@footnote{Using capture
1537 templates, you can define more fine-grained capture locations, see
1538 @ref{Capture templates}.} file for notes, and defines a global
1539 key@footnote{Please select your own key, @kbd{C-c c} is only a suggestion.}
1540 for capturing new stuff.
1542 @example
1543 (setq org-default-notes-file (concat org-directory "/notes.org"))
1544 (define-key global-map "\C-cc" 'org-capture)
1545 @end example
1547 @node Using capture, Capture templates, Setting up a capture location, Capture
1548 @unnumberedsubsec Using capture
1550 @table @kbd
1551 @item C-c c
1552 Start a capture process.  You will be placed into a narrowed indirect buffer
1553 to edit the item.
1554 @item C-c C-c
1555 Once you are done entering information into the capture buffer, 
1556 @kbd{C-c C-c} will return you to the window configuration before the capture
1557 process, so that you can resume your work without further distraction.
1558 @item C-c C-w
1559 Finalize by moving the entry to a refile location (@pxref{Refile and copy}).
1560 @item C-c C-k
1561 Abort the capture process and return to the previous state.
1562 @end table
1564 @node Capture templates,  , Using capture, Capture
1565 @unnumberedsubsec Capture templates
1567 You can use templates to generate different types of capture notes, and to
1568 store them in different places.  For example, if you would like
1569 to store new tasks under a heading @samp{Tasks} in file @file{TODO.org}, and
1570 journal entries in a date tree in @file{journal.org} you could
1571 use:
1573 @smallexample
1574 (setq org-capture-templates
1575  '(("t" "Todo" entry (file+headline "~/org/gtd.org" "Tasks")
1576         "* TODO %?\n  %i\n  %a")
1577    ("j" "Journal" entry (file+datetree "~/org/journal.org")
1578         "* %?\nEntered on %U\n  %i\n  %a")))
1579 @end smallexample
1581 @noindent In these entries, the first string is the key to reach the
1582 template, the second is a short description.  Then follows the type of the
1583 entry and a definition of the target location for storing the note.  Finally,
1584 the template itself, a string with %-escapes to fill in information based on
1585 time and context.
1587 When you call @kbd{M-x org-capture}, Org will prompt for a key to select the
1588 template (if you have more than one template) and then prepare the buffer like
1589 @smallexample
1590 * TODO
1591   [[file:@var{link to where you were when initiating capture}]]
1592 @end smallexample
1594 @noindent
1595 During expansion of the template, special @kbd{%}-escapes@footnote{If you
1596 need one of these sequences literally, escape the @kbd{%} with a backslash.}
1597 allow dynamic insertion of content.  Here is a small selection of the
1598 possibilities, consult the manual for more.
1599 @smallexample
1600 %a          @r{annotation, normally the link created with @code{org-store-link}}
1601 %i          @r{initial content, the region when remember is called with C-u.}
1602 %t          @r{timestamp, date only}
1603 %T          @r{timestamp with date and time}
1604 %u, %U      @r{like the above, but inactive timestamps}
1605 @end smallexample
1607 @node Refile and copy, Archiving, Capture, Capture - Refile - Archive
1608 @section Refile and copy
1610 When reviewing the captured data, you may want to refile or copy some of the
1611 entries into a different list, for example into a project.  Cutting, finding
1612 the right location, and then pasting the note is cumbersome.  To simplify
1613 this process, you can use the following special command:
1615 @table @kbd
1616 @item C-c M-x
1617 Copy the entry or region at point.  This command behaves like
1618 @code{org-refile}, except that the original note will not be deleted.
1619 @item C-c C-w
1620 Refile the entry or region at point.  This command offers possible locations
1621 for refiling the entry and lets you select one with completion.  The item (or
1622 all items in the region) is filed below the target heading as a subitem.@*
1623 By default, all level 1 headlines in the current buffer are considered to be
1624 targets, but you can have more complex definitions across a number of files.
1625 See the variable @code{org-refile-targets} for details.
1626 @item C-u C-c C-w
1627 Use the refile interface to jump to a heading.
1628 @item C-u C-u C-c C-w
1629 Jump to the location where @code{org-refile} last moved a tree to.
1630 @end table
1632 @node Archiving,  , Refile and copy, Capture - Refile - Archive
1633 @section Archiving
1635 When a project represented by a (sub)tree is finished, you may want
1636 to move the tree out of the way and to stop it from contributing to the
1637 agenda.  Archiving is important to keep your working files compact and global
1638 searches like the construction of agenda views fast.
1639 The most common archiving action is to move a project tree to another file,
1640 the archive file.
1642 @table @kbd
1643 @item C-c C-x C-a
1644 Archive the current entry using the command specified in the variable
1645 @code{org-archive-default-command}.
1646 @item C-c C-x C-s@ @r{or short} @ C-c $
1647 Archive the subtree starting at the cursor position to the location
1648 given by @code{org-archive-location}.
1649 @end table
1651 The default archive location is a file in the same directory as the
1652 current file, with the name derived by appending @file{_archive} to the
1653 current file name.  For information and examples on how to change this,
1654 see the documentation string of the variable
1655 @code{org-archive-location}.  There is also an in-buffer option for
1656 setting this variable, for example
1658 @smallexample
1659 #+ARCHIVE: %s_done::
1660 @end smallexample
1662 @seealso{
1663 @uref{http://orgmode.org/manual/Capture-_002d-Refile-_002d-Archive.html#Capture-_002d-Refile-_002d-Archive,
1664 Chapter 9 of the manual}@*
1665 @uref{http://members.optusnet.com.au/~charles57/GTD/remember.html, Charles
1666 Cave's remember tutorial}@*
1667 @uref{http://orgmode.org/worg/org-tutorials/org-protocol-custom-handler.php,
1668 Sebastian Rose's tutorial for capturing from a web browser}}@uref{}@*
1670 @node Agenda Views, Markup, Capture - Refile - Archive, Top
1671 @chapter Agenda Views
1673 Due to the way Org works, TODO items, time-stamped items, and tagged
1674 headlines can be scattered throughout a file or even a number of files.  To
1675 get an overview of open action items, or of events that are important for a
1676 particular date, this information must be collected, sorted and displayed in
1677 an organized way.  There are several different views, see below.
1679 The extracted information is displayed in a special @emph{agenda buffer}.
1680 This buffer is read-only, but provides commands to visit the corresponding
1681 locations in the original Org files, and even to edit these files remotely.
1682 Remote editing from the agenda buffer means, for example, that you can
1683 change the dates of deadlines and appointments from the agenda buffer.
1684 The commands available in the Agenda buffer are listed in @ref{Agenda
1685 commands}.
1687 @menu
1688 * Agenda files::                Files being searched for agenda information
1689 * Agenda dispatcher::           Keyboard access to agenda views
1690 * Built-in agenda views::       What is available out of the box?
1691 * Agenda commands::             Remote editing of Org trees
1692 * Custom agenda views::         Defining special searches and views
1693 @end menu
1695 @node Agenda files, Agenda dispatcher, Agenda Views, Agenda Views
1696 @section Agenda files
1698 The information to be shown is normally collected from all @emph{agenda
1699 files}, the files listed in the variable
1700 @code{org-agenda-files}.
1702 @table @kbd
1703 @item C-c [
1704 Add current file to the list of agenda files.  The file is added to
1705 the front of the list.  If it was already in the list, it is moved to
1706 the front.  With a prefix argument, file is added/moved to the end.
1707 @item C-c ]
1708 Remove current file from the list of agenda files.
1709 @item C-,
1710 Cycle through agenda file list, visiting one file after the other.
1711 @end table
1713 @node Agenda dispatcher, Built-in agenda views, Agenda files, Agenda Views
1714 @section The agenda dispatcher
1715 The views are created through a dispatcher, which should be bound to a
1716 global key---for example @kbd{C-c a} (@pxref{Installation}).  After
1717 pressing @kbd{C-c a}, an additional letter is required to execute a
1718 command:
1719 @table @kbd
1720 @item a
1721 The calendar-like agenda (@pxref{Weekly/daily agenda}).
1722 @item t @r{/} T
1723 A list of all TODO items (@pxref{Global TODO list}).
1724 @item m @r{/} M
1725 A list of headlines matching a TAGS expression (@pxref{Matching
1726 tags and properties}).
1727 @item L
1728 The timeline view for the current buffer (@pxref{Timeline}).
1729 @item s
1730 A list of entries selected by a boolean expression of keywords
1731 and/or regular expressions that must or must not occur in the entry.
1732 @end table
1734 @node Built-in agenda views, Agenda commands, Agenda dispatcher, Agenda Views
1735 @section The built-in agenda views
1737 @menu
1738 * Weekly/daily agenda::         The calendar page with current tasks
1739 * Global TODO list::            All unfinished action items
1740 * Matching tags and properties::  Structured information with fine-tuned search
1741 * Timeline::                    Time-sorted view for single file
1742 * Search view::                 Find entries by searching for text
1743 @end menu
1745 @node Weekly/daily agenda, Global TODO list, Built-in agenda views, Built-in agenda views
1746 @subsection The weekly/daily agenda
1748 The purpose of the weekly/daily @emph{agenda} is to act like a page of a
1749 paper agenda, showing all the tasks for the current week or day.
1751 @table @kbd
1752 @item C-c a a
1753 Compile an agenda for the current week from a list of Org files.  The agenda
1754 shows the entries for each day.
1755 @end table
1757 Emacs contains the calendar and diary by Edward M. Reingold.  Org-mode
1758 understands the syntax of the diary and allows you to use diary sexp entries
1759 directly in Org files:
1761 @smallexample
1762 * Birthdays and similar stuff
1763 #+CATEGORY: Holiday
1764 %%(org-calendar-holiday)   ; special function for holiday names
1765 #+CATEGORY: Ann
1766 %%(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
1767 %%(diary-anniversary 10  2 1869) Mahatma Gandhi would be %d years old
1768 @end smallexample
1770 Org can interact with Emacs appointments notification facility.  To add all
1771 the appointments of your agenda files, use the command
1772 @code{org-agenda-to-appt}.  See the docstring for details.
1774 @node Global TODO list, Matching tags and properties, Weekly/daily agenda, Built-in agenda views
1775 @subsection The global TODO list
1777 The global TODO list contains all unfinished TODO items formatted and
1778 collected into a single place.  Remote editing of TODO items lets you
1779 can change the state of a TODO entry with a single key press.  The commands
1780 available in the TODO list are described in @ref{Agenda commands}.
1782 @table @kbd
1783 @item C-c a t
1784 Show the global TODO list.  This collects the TODO items from all
1785 agenda files (@pxref{Agenda Views}) into a single buffer.
1786 @item C-c a T
1787 Like the above, but allows selection of a specific TODO keyword. 
1788 @end table
1790 @node Matching tags and properties, Timeline, Global TODO list, Built-in agenda views
1791 @subsection Matching tags and properties
1793 If headlines in the agenda files are marked with @emph{tags} (@pxref{Tags}),
1794 or have properties (@pxref{Properties}), you can select headlines
1795 based on this metadata and collect them into an agenda buffer.  The match
1796 syntax described here also applies when creating sparse trees with @kbd{C-c /
1797 m}.  The commands available in the tags list are described in @ref{Agenda
1798 commands}.
1800 @table @kbd
1801 @item C-c a m
1802 Produce a list of all headlines that match a given set of tags.  The
1803 command prompts for a selection criterion, which is a boolean logic
1804 expression with tags, like @samp{+work+urgent-withboss} or
1805 @samp{work|home} (@pxref{Tags}).  If you often need a specific search,
1806 define a custom command for it (@pxref{Agenda dispatcher}).
1807 @item C-c a M
1808 Like @kbd{C-c a m}, but only select headlines that are also TODO items.
1809 @end table
1811 @subsubheading Match syntax
1813 A search string can use Boolean operators @samp{&} for AND and @samp{|} for
1814 OR.  @samp{&} binds more strongly than @samp{|}.  Parentheses are currently
1815 not implemented.  Each element in the search is either a tag, a regular
1816 expression matching tags, or an expression like @code{PROPERTY OPERATOR
1817 VALUE} with a comparison operator, accessing a property value.  Each element
1818 may be preceded by @samp{-}, to select against it, and @samp{+} is syntactic
1819 sugar for positive selection.  The AND operator @samp{&} is optional when
1820 @samp{+} or @samp{-} is present.  Here are some examples, using only tags.
1822 @table @samp
1823 @item +work-boss
1824 Select headlines tagged @samp{:work:}, but discard those also tagged
1825 @samp{:boss:}.
1826 @item work|laptop
1827 Selects lines tagged @samp{:work:} or @samp{:laptop:}.
1828 @item work|laptop+night
1829 Like before, but require the @samp{:laptop:} lines to be tagged also
1830 @samp{:night:}.
1831 @end table
1833 You may also test for properties at the same
1834 time as matching tags, see the manual for more information.
1836 @node Timeline, Search view, Matching tags and properties, Built-in agenda views
1837 @subsection Timeline for a single file
1839 The timeline summarizes all time-stamped items from a single Org mode
1840 file in a @emph{time-sorted view}.  The main purpose of this command is
1841 to give an overview over events in a project.
1843 @table @kbd
1844 @item C-c a L
1845 Show a time-sorted view of the Org file, with all time-stamped items.
1846 When called with a @kbd{C-u} prefix, all unfinished TODO entries
1847 (scheduled or not) are also listed under the current date.
1848 @end table
1850 @node Search view,  , Timeline, Built-in agenda views
1851 @subsection Search view
1853 This agenda view is a general text search facility for Org mode entries.
1854 It is particularly useful to find notes.
1856 @table @kbd
1857 @item C-c a s
1858 This is a special search that lets you select entries by matching a substring
1859 or specific words using a boolean logic.
1860 @end table
1861 For example, the search string @samp{computer equipment} will find entries
1862 that contain @samp{computer equipment} as a substring. 
1863 Search view can also search for specific keywords in the entry, using Boolean
1864 logic.  The search string @samp{+computer +wifi -ethernet -@{8\.11[bg]@}}
1865 will search for note entries that contain the keywords @code{computer}
1866 and @code{wifi}, but not the keyword @code{ethernet}, and which are also
1867 not matched by the regular expression @code{8\.11[bg]}, meaning to
1868 exclude both 8.11b and 8.11g. 
1870 Note that in addition to the agenda files, this command will also search
1871 the files listed in @code{org-agenda-text-search-extra-files}.
1873 @node Agenda commands, Custom agenda views, Built-in agenda views, Agenda Views
1874 @section Commands in the agenda buffer
1876 Entries in the agenda buffer are linked back to the Org file or diary
1877 file where they originate.  Commands are provided to show and jump to the
1878 original entry location, and to edit the Org files ``remotely'' from
1879 the agenda buffer.  This is just a selection of the many commands, explore
1880 the @code{Agenda} menu and the manual for a complete list.
1882 @table @kbd
1883 @tsubheading{Motion}
1884 @item n
1885 Next line (same as @key{up} and @kbd{C-p}).
1886 @item p
1887 Previous line (same as @key{down} and @kbd{C-n}).
1888 @tsubheading{View/Go to Org file}
1889 @item mouse-3
1890 @itemx @key{SPC}
1891 Display the original location of the item in another window.
1892 With prefix arg, make sure that the entire entry is made visible in the
1893 outline, not only the heading.
1895 @itemx @key{TAB}
1896 Go to the original location of the item in another window.  Under Emacs
1897 22, @kbd{mouse-1} will also work for this.
1899 @itemx @key{RET}
1900 Go to the original location of the item and delete other windows.
1903 @tsubheading{Change display}
1904 @item o
1905 Delete other windows.
1907 @item d @r{/} w
1908 Switch to day/week view. 
1910 @item f @r{and} b
1911 Go forward/backward in time to display the following
1912 @code{org-agenda-current-span} days.  For example, if the display covers a
1913 week, switch to the following/previous week.
1915 @item .
1916 Go to today.
1918 @item j
1919 Prompt for a date and go there.
1921 @item v l @ @r{or short} @ l
1922 Toggle Logbook mode.  In Logbook mode, entries that were marked DONE while
1923 logging was on (variable @code{org-log-done}) are shown in the agenda, as are
1924 entries that have been clocked on that day.  When called with a @kbd{C-u}
1925 prefix, show all possible logbook entries, including state changes.
1927 @item r @r{or} g
1928 Recreate the agenda buffer, to reflect the changes.
1929 @item s
1930 Save all Org buffers in the current Emacs session, and also the locations of
1931 IDs.
1933 @tsubheading{Secondary filtering and query editing}
1935 @item /
1936 Filter the current agenda view with respect to a tag.  You are prompted for a
1937 letter to select a tag.  Press @samp{-} first to select against the tag.
1939 @item \
1940 Narrow the current agenda filter by an additional condition.
1942 @tsubheading{Remote editing (see the manual for many more commands)}
1944 @item 0-9
1945 Digit argument.
1947 @item t
1948 Change the TODO state of the item, in the agenda and in the
1949 org file.
1951 @item C-k
1952 Delete the current agenda item along with the entire subtree belonging
1953 to it in the original Org file.
1955 @item C-c C-w
1956 Refile the entry at point.
1958 @item C-c C-x C-a @ @r{or short} @ a
1959 Archive the subtree corresponding to the entry at point using the default
1960 archiving command set in @code{org-archive-default-command}.
1962 @item C-c C-x C-s @ @r{or short} @ $
1963 Archive the subtree corresponding to the current headline.
1965 @item C-c C-s
1966 Schedule this item, with prefix arg remove the scheduling timestamp
1968 @item C-c C-d
1969 Set a deadline for this item, with prefix arg remove the deadline.
1971 @item S-@key{right} @r{and} S-@key{left}
1972 Change the timestamp associated with the current line by one day.
1974 @item I
1975 Start the clock on the current item.
1977 @item O / X
1978 Stop/cancel the previously started clock.
1980 @item J
1981 Jump to the running clock in another window.
1982 @end table
1984 @node Custom agenda views,  , Agenda commands, Agenda Views
1985 @section Custom agenda views
1987 The main application of custom searches is the definition of keyboard
1988 shortcuts for frequently used searches, either creating an agenda
1989 buffer, or a sparse tree (the latter covering of course only the current
1990 buffer).
1991 Custom commands are configured in the variable
1992 @code{org-agenda-custom-commands}.  You can customize this variable, for
1993 example by pressing @kbd{C-c a C}.  You can also directly set it with
1994 Emacs Lisp in @file{.emacs}.  The following example contains all valid
1995 search types:
1997 @smalllisp
1998 @group
1999 (setq org-agenda-custom-commands
2000       '(("w" todo "WAITING")
2001         ("u" tags "+boss-urgent")
2002         ("v" tags-todo "+boss-urgent")))
2003 @end group
2004 @end smalllisp
2006 @noindent
2007 The initial string in each entry defines the keys you have to press after the
2008 dispatcher command @kbd{C-c a} in order to access the command.  Usually this
2009 will be just a single character.  The second parameter is the search type,
2010 followed by the string or regular expression to be used for the matching.
2011 The example above will therefore define:
2013 @table @kbd
2014 @item C-c a w
2015 as a global search for TODO entries with @samp{WAITING} as the TODO
2016 keyword
2017 @item C-c a u
2018 as a global tags search for headlines marked @samp{:boss:} but not
2019 @samp{:urgent:}
2020 @item C-c a v
2021 as the same search as @kbd{C-c a u}, but limiting the search to
2022 headlines that are also TODO items
2023 @end table
2025 @seealso{
2026 @uref{http://orgmode.org/manual/Agenda-Views.html#Agenda-Views, Chapter 10 of
2027 the manual}@*
2028 @uref{http://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.php,
2029 Mat Lundin's tutorial about custom agenda commands}@*
2030 @uref{http://www.newartisans.com/2007/08/using-org-mode-as-a-day-planner.html,
2031 John Wiegley's setup}}
2033 @node Markup, Exporting, Agenda Views, Top
2034 @chapter Markup for rich export
2036 When exporting Org-mode documents, the exporter tries to reflect the
2037 structure of the document as accurately as possible in the backend.  Since
2038 export targets like HTML, @LaTeX{}, or DocBook allow much richer formatting,
2039 Org mode has rules on how to prepare text for rich export.  This section
2040 summarizes the markup rules used in an Org-mode buffer.
2042 @menu
2043 * Structural markup elements::  The basic structure as seen by the exporter
2044 * Images and tables::           Tables and Images will be included
2045 * Literal examples::            Source code examples with special formatting
2046 * Include files::               Include additional files into a document
2047 * Embedded @LaTeX{}::           @LaTeX{} can be freely used inside Org documents
2048 @end menu
2050 @node Structural markup elements, Images and tables, Markup, Markup
2051 @section Structural markup elements
2053 @menu
2054 * Document title::              Where the title is taken from
2055 * Headings and sections::       The document structure as seen by the exporter
2056 * Table of contents::           The if and where of the table of contents
2057 * Paragraphs::                  Paragraphs
2058 * Emphasis and monospace::      Bold, italic, etc.
2059 * Comment lines::               What will *not* be exported
2060 @end menu
2062 @node Document title, Headings and sections, Structural markup elements, Structural markup elements
2063 @subheading Document title
2065 @noindent
2066 The title of the exported document is taken from the special line
2068 @smallexample
2069 #+TITLE: This is the title of the document
2070 @end smallexample
2072 @node Headings and sections, Table of contents, Document title, Structural markup elements
2073 @subheading Headings and sections
2075 The outline structure of the document as described in @ref{Document
2076 Structure}, forms the basis for defining sections of the exported document.
2077 However, since the outline structure is also used for (for example) lists of
2078 tasks, only the first three outline levels will be used as headings.  Deeper
2079 levels will become itemized lists.  You can change the location of this
2080 switch globally by setting the variable @code{org-export-headline-levels}, or on a
2081 per-file basis with a line
2083 @smallexample
2084 #+OPTIONS: H:4
2085 @end smallexample
2087 @node Table of contents, Paragraphs, Headings and sections, Structural markup elements
2088 @subheading Table of contents
2090 The table of contents is normally inserted directly before the first headline
2091 of the file.
2093 @smallexample
2094 #+OPTIONS: toc:2          (only to two levels in TOC)
2095 #+OPTIONS: toc:nil        (no TOC at all)
2096 @end smallexample
2098 @node Paragraphs, Emphasis and monospace, Table of contents, Structural markup elements
2099 @subheading Paragraphs, line breaks, and quoting
2101 Paragraphs are separated by at least one empty line.  If you need to enforce
2102 a line break within a paragraph, use @samp{\\} at the end of a line.
2104 To keep the line breaks in a region, but otherwise use normal formatting, you
2105 can use this construct, which can also be used to format poetry.
2107 @smallexample
2108 #+BEGIN_VERSE
2109  Great clouds overhead
2110  Tiny black birds rise and fall
2111  Snow covers Emacs
2113      -- AlexSchroeder
2114 #+END_VERSE
2115 @end smallexample
2117 When quoting a passage from another document, it is customary to format this
2118 as a paragraph that is indented on both the left and the right margin.  You
2119 can include quotations in Org-mode documents like this:
2121 @smallexample
2122 #+BEGIN_QUOTE
2123 Everything should be made as simple as possible,
2124 but not any simpler -- Albert Einstein
2125 #+END_QUOTE
2126 @end smallexample
2128 If you would like to center some text, do it like this:
2129 @smallexample
2130 #+BEGIN_CENTER
2131 Everything should be made as simple as possible, \\
2132 but not any simpler
2133 #+END_CENTER
2134 @end smallexample
2136 @node Emphasis and monospace, Comment lines, Paragraphs, Structural markup elements
2137 @subheading Emphasis and monospace
2139 You can make words @b{*bold*}, @i{/italic/}, _underlined_, @code{=code=}
2140 and @code{~verbatim~}, and, if you must, @samp{+strike-through+}.  Text
2141 in the code and verbatim string is not processed for Org-mode specific
2142 syntax, it is exported verbatim.  To insert a horizontal rules, use a line 
2143 consisting of only dashes, and at least 5 of them.
2145 @node Comment lines,  , Emphasis and monospace, Structural markup elements
2146 @subheading Comment lines
2148 Lines starting with zero or more whitespace characters followed by @samp{#}
2149 are treated as comments and will never be exported.  Also entire subtrees
2150 starting with the word @samp{COMMENT} will never be exported.  Finally,
2151 regions surrounded by @samp{#+BEGIN_COMMENT} ... @samp{#+END_COMMENT} will
2152 not be exported.
2154 @table @kbd
2155 @item C-c ;
2156 Toggle the COMMENT keyword at the beginning of an entry.
2157 @end table
2159 @node Images and tables, Literal examples, Structural markup elements, Markup
2160 @section Images and Tables
2162 For Org mode tables, the lines before the first horizontal separator line
2163 will become table header lines.  You can use the following lines somewhere
2164 before the table to assign a caption and a label for cross references, and in
2165 the text you can refer to the object with @code{\ref@{tab:basic-data@}}:
2167 @smallexample
2168 #+CAPTION: This is the caption for the next table (or link)
2169 #+LABEL:   tbl:basic-data
2170    | ... | ...|
2171    |-----|----|
2172 @end smallexample
2174 Some backends (HTML, @LaTeX{}, and DocBook) allow you to directly include
2175 images into the exported document.  Org does this, if a link to an image
2176 files does not have a description part, for example @code{[[./img/a.jpg]]}.
2177 If you wish to define a caption for the image and maybe a label for internal
2178 cross references, you sure that the link is on a line by itself precede it
2179 with:
2181 @smallexample
2182 #+CAPTION: This is the caption for the next figure link (or table)
2183 #+LABEL:   fig:SED-HR4049
2184 [[./img/a.jpg]]
2185 @end smallexample
2187 You may also define additional attributes for the figure.  As this is
2188 backend-specific, see the sections about the individual backends for more
2189 information.
2192 @node Literal examples, Include files, Images and tables, Markup
2193 @section Literal examples
2195 You can include literal examples that should not be subjected to
2196 markup.  Such examples will be typeset in monospace, so this is well suited
2197 for source code and similar examples.
2199 @smallexample
2200 #+BEGIN_EXAMPLE
2201 Some example from a text file.
2202 #+END_EXAMPLE
2203 @end smallexample
2205 For simplicity when using small examples, you can also start the example
2206 lines with a colon followed by a space.  There may also be additional
2207 whitespace before the colon:
2209 @smallexample
2210 Here is an example
2211    : Some example from a text file.
2212 @end smallexample
2214 For source code from a programming language, or any other text
2215 that can be marked up by font-lock in Emacs, you can ask for it to
2216 look like the fontified Emacs buffer
2218 @smallexample
2219 #+BEGIN_SRC emacs-lisp
2220 (defun org-xor (a b)
2221    "Exclusive or."
2222    (if a (not b) b))
2223 #+END_SRC
2224 @end smallexample
2226 To edit the example in a special buffer supporting this language, use
2227 @kbd{C-c '} to both enter and leave the editing buffer.
2229 @node Include files, Embedded @LaTeX{}, Literal examples, Markup
2230 @section Include files
2232 During export, you can include the content of another file.  For example, to
2233 include your @file{.emacs} file, you could use:
2235 @smallexample
2236 #+INCLUDE: "~/.emacs" src emacs-lisp
2237 @end smallexample
2238 @noindent
2239 The optional second and third parameter are the markup (e.g.@: @samp{quote},
2240 @samp{example}, or @samp{src}), and, if the markup is @samp{src}, the
2241 language for formatting the contents.  The markup is optional, if it is not
2242 given, the text will be assumed to be in Org mode format and will be
2243 processed normally. @kbd{C-c '} will visit the included file.
2245 @node Embedded @LaTeX{},  , Include files, Markup
2246 @section Embedded @LaTeX{}
2248 For scientific notes which need to be able to contain mathematical symbols
2249 and the occasional formula, Org-mode supports embedding @LaTeX{} code into
2250 its files.  You can directly use TeX-like macros for special symbols, enter
2251 formulas and entire @LaTeX{} environments.
2253 @smallexample
2254 Angles are written as Greek letters \alpha, \beta and \gamma.  The mass if
2255 the sun is M_sun = 1.989 x 10^30 kg.  The radius of the sun is R_@{sun@} =
2256 6.96 x 10^8 m.  If $a^2=b$ and $b=2$, then the solution must be either
2257 $a=+\sqrt@{2@}$ or $a=-\sqrt@{2@}$.
2259 \begin@{equation@}
2260 x=\sqrt@{b@}
2261 \end@{equation@}
2262 @end smallexample
2263 @noindent  With
2264 @uref{http://orgmode.org/manual/LaTeX-fragments.html#LaTeX-fragments,special
2265 setup}, @LaTeX{} snippets will be included as images when exporting to HTML.
2267 @seealso{
2268 @uref{http://orgmode.org/manual/Markup.html#Markup, Chapter 11 of the manual}}
2270 @node Exporting, Publishing, Markup, Top
2271 @chapter Exporting
2273 Org-mode documents can be exported into a variety of other formats: ASCII
2274 export for inclusion into emails, HTML to publish on the web, @LaTeX{}/PDF
2275 for beautiful printed documents and DocBook to enter the world of many other
2276 formats using DocBook tools.  There is also export to iCalendar format so
2277 that planning information can be incorporated into desktop calendars.
2279 @menu
2280 * Export options::              Per-file export settings
2281 * The export dispatcher::       How to access exporter commands
2282 * ASCII/Latin-1/UTF-8 export::  Exporting to flat files with encoding
2283 * HTML export::                 Exporting to HTML
2284 * @LaTeX{} and PDF export::     Exporting to @LaTeX{}, and processing to PDF
2285 * DocBook export::              Exporting to DocBook
2286 * iCalendar export::            
2287 @end menu
2289 @node Export options, The export dispatcher, Exporting, Exporting
2290 @section Export options
2292 The exporter recognizes special lines in the buffer which provide
2293 additional information.  These lines may be put anywhere in the file.
2294 The whole set of lines can be inserted into the buffer with @kbd{C-c
2295 C-e t}.
2297 @table @kbd
2298 @item C-c C-e t
2299 Insert template with export options, see example below.
2300 @end table
2302 @smallexample
2303 #+TITLE:       the title to be shown (default is the buffer name)
2304 #+AUTHOR:      the author (default taken from @code{user-full-name})
2305 #+DATE:        a date, fixed, of a format string for @code{format-time-string}
2306 #+EMAIL:       his/her email address (default from @code{user-mail-address})
2307 #+DESCRIPTION: the page description, e.g.@: for the XHTML meta tag
2308 #+KEYWORDS:    the page keywords, e.g.@: for the XHTML meta tag
2309 #+LANGUAGE:    language for HTML, e.g.@: @samp{en} (@code{org-export-default-language})
2310 #+TEXT:        Some descriptive text to be inserted at the beginning.
2311 #+TEXT:        Several lines may be given.
2312 #+OPTIONS:     H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t f:t TeX:t ...
2313 #+LINK_UP:     the ``up'' link of an exported page
2314 #+LINK_HOME:   the ``home'' link of an exported page
2315 #+LATEX_HEADER: extra line(s) for the @LaTeX{} header, like \usepackage@{xyz@}
2316 @end smallexample
2318 @node The export dispatcher, ASCII/Latin-1/UTF-8 export, Export options, Exporting
2319 @section The export dispatcher
2321 All export commands can be reached using the export dispatcher, which is a
2322 prefix key that prompts for an additional key specifying the command.
2323 Normally the entire file is exported, but if there is an active region that
2324 contains one outline tree, the first heading is used as document title and
2325 the subtrees are exported.
2327 @table @kbd
2328 @item C-c C-e
2329 Dispatcher for export and publishing commands.
2330 @end table
2332 @node ASCII/Latin-1/UTF-8 export, HTML export, The export dispatcher, Exporting
2333 @section ASCII/Latin-1/UTF-8 export
2335 ASCII export produces a simple and very readable version of an Org-mode
2336 file, containing only plain ASCII.  Latin-1 and UTF-8 export augment the file
2337 with special characters and symbols available in these encodings.
2339 @table @kbd
2340 @item C-c C-e a
2341 Export as ASCII file.
2342 @item C-c C-e n @ @ @r{and} @ @ C-c C-e N
2343 Like the above commands, but use Latin-1 encoding.
2344 @item C-c C-e u @ @ @r{and} @ @ C-c C-e U
2345 Like the above commands, but use UTF-8 encoding.
2346 @end table
2348 @node HTML export, @LaTeX{} and PDF export, ASCII/Latin-1/UTF-8 export, Exporting
2349 @section HTML export
2351 @table @kbd
2352 @item C-c C-e h
2353 Export as HTML file @file{myfile.html}.
2354 @item C-c C-e b
2355 Export as HTML file and immediately open it with a browser.
2356 @end table
2358 To insert HTML that should be copied verbatim to
2359 the exported file use either
2361 @smallexample
2362 #+HTML: Literal HTML code for export
2363 @end smallexample
2364 @noindent or
2365 @smallexample
2366 #+BEGIN_HTML
2367 All lines between these markers are exported literally
2368 #+END_HTML
2369 @end smallexample
2371 @node @LaTeX{} and PDF export, DocBook export, HTML export, Exporting
2372 @section @LaTeX{} and PDF export
2374 @table @kbd
2375 @item C-c C-e l
2376 Export as @LaTeX{} file @file{myfile.tex}.
2377 @item C-c C-e p
2378 Export as @LaTeX{} and then process to PDF.
2379 @item C-c C-e d
2380 Export as @LaTeX{} and then process to PDF, then open the resulting PDF file.
2381 @end table
2383 By default, the @LaTeX{} output uses the class @code{article}.  You can
2384 change this by adding an option like @code{#+LaTeX_CLASS: myclass} in your
2385 file.  The class must be listed in @code{org-export-latex-classes}.
2387 Embedded @LaTeX{} as described in @ref{Embedded @LaTeX{}}, will be correctly
2388 inserted into the @LaTeX{} file.  Similarly to the HTML exporter, you can use
2389 @code{#+LaTeX:} and @code{#+BEGIN_LaTeX ... #+END_LaTeX} construct to add
2390 verbatim @LaTeX{} code.
2392 @node DocBook export, iCalendar export, @LaTeX{} and PDF export, Exporting
2393 @section DocBook export
2395 @table @kbd
2396 @item C-c C-e D
2397 Export as DocBook file.
2398 @end table
2400 Similarly to the HTML exporter, you can use @code{#+DOCBOOK:} and
2401 @code{#+BEGIN_DOCBOOK ... #+END_DOCBOOK} construct to add verbatim @LaTeX{}
2402 code.
2404 @node iCalendar export,  , DocBook export, Exporting
2405 @section iCalendar export
2407 @table @kbd
2408 @item C-c C-e i
2409 Create iCalendar entries for the current file in a @file{.ics} file.
2410 @item C-c C-e c
2411 Create a single large iCalendar file from all files in
2412 @code{org-agenda-files} and write it to the file given by
2413 @code{org-combined-agenda-icalendar-file}.
2414 @end table
2416 @seealso{
2417 @uref{http://orgmode.org/manual/Exporting.html#Exporting, Chapter 12 of the manual}@*
2418 @uref{http://orgmode.org/worg/org-tutorials/images-and-xhtml-export.php,
2419 Sebastian Rose's image handling tutorial}@*
2420 @uref{http://orgmode.org/worg/org-tutorials/org-latex-export.php, Thomas
2421 Dye's LaTeX export tutorial}
2422 @uref{http://orgmode.org/worg/org-tutorials/org-beamer/tutorial.php, Eric
2423 Fraga's BEAMER presentation tutorial}}
2425 @node Publishing, Working With Source Code, Exporting, Top
2426 @chapter Publishing
2428 Org includes a publishing management system that allows you to configure
2429 automatic HTML conversion of @emph{projects} composed of interlinked org
2430 files.  You can also configure Org to automatically upload your exported HTML
2431 pages and related attachments, such as images and source code files, to a web
2432 server.  For detailed instructions about setup, see the manual.
2434 Here is an example:
2436 @smalllisp
2437 (setq org-publish-project-alist
2438       '(("org"
2439          :base-directory "~/org/"
2440          :publishing-directory "~/public_html"
2441          :section-numbers nil
2442          :table-of-contents nil
2443          :style "<link rel=\"stylesheet\"
2444                 href=\"../other/mystyle.css\"
2445                 type=\"text/css\"/>")))
2446 @end smalllisp
2448 @table @kbd
2449 @item C-c C-e C
2450 Prompt for a specific project and publish all files that belong to it.
2451 @item C-c C-e P
2452 Publish the project containing the current file.
2453 @item C-c C-e F
2454 Publish only the current file.
2455 @item C-c C-e E
2456 Publish every project.
2457 @end table
2459 Org uses timestamps to track when a file has changed.  The above functions
2460 normally only publish changed files.  You can override this and force
2461 publishing of all files by giving a prefix argument to any of the commands
2462 above.
2464 @seealso{
2465 @uref{http://orgmode.org/manual/Publishing.html#Publishing, Chapter 13 of the
2466 manual}@*
2467 @uref{http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.php,
2468 Sebastian Rose's publishing tutorial}@*
2469 @uref{http://orgmode.org/worg/org-tutorials/org-jekyll.php, Ian Barton's
2470 Jekyll/blogging setup}}
2472 @node Working With Source Code, Miscellaneous, Publishing, Top
2473 @chapter Working with source code
2474 Org-mode provides a number of features for working with source code,
2475 including editing of code blocks in their native major-mode, evaluation of
2476 code blocks, tangling of code blocks, and exporting code blocks and their
2477 results in several formats.
2479 @subheading Structure of Code Blocks
2480 The structure of code blocks is as follows:
2482 @example
2483 #+NAME: <name>
2484 #+BEGIN_SRC <language> <switches> <header arguments>
2485   <body>
2486 #+END_SRC
2487 @end example
2489 Where @code{<name>} is a string used to name the code block,
2490 @code{<language>} specifies the language of the code block
2491 (e.g.@: @code{emacs-lisp}, @code{shell}, @code{R}, @code{python}, etc...),
2492 @code{<switches>} can be used to control export of the code block,
2493 @code{<header arguments>} can be used to control many aspects of code block
2494 behavior as demonstrated below, and @code{<body>} contains the actual source
2495 code.
2497 @subheading Editing source code
2498 Use @kbd{C-c '} to edit the current code block.  This brings up a language
2499 major-mode edit buffer containing the body of the code block.  Saving this
2500 buffer will write the new contents back to the Org buffer.  Use @kbd{C-c '}
2501 again to exit the edit buffer.
2503 @subheading Evaluating code blocks
2504 Use @kbd{C-c C-c} to evaluate the current code block and insert its results
2505 in the Org-mode buffer.  By default, evaluation is only turned on for
2506 @code{emacs-lisp} code blocks, however support exists for evaluating blocks
2507 in many languages.  For a complete list of supported languages see the
2508 manual.  The following shows a code block and its results.
2510 @example
2511 #+BEGIN_SRC emacs-lisp
2512   (+ 1 2 3 4)
2513 #+END_SRC
2515 #+RESULTS:
2516 : 10
2517 @end example
2519 @subheading Extracting source code
2520 Use @kbd{C-c C-v t} to create pure source code files by extracting code from
2521 source blocks in the current buffer.  This is referred to as ``tangling''---a
2522 term adopted from the literate programming community.  During ``tangling'' of
2523 code blocks their bodies are expanded using @code{org-babel-expand-src-block}
2524 which can expand both variable and ``noweb'' style references.  In order to
2525 tangle a code block it must have a @code{:tangle} header argument, see the
2526 manual for details.
2528 @subheading Library of Babel
2529 Use @kbd{C-c C-v l} to load the code blocks from an Org-mode files into the
2530 ``Library of Babel'', these blocks can then be evaluated from any Org-mode
2531 buffer.  A collection of generally useful code blocks is distributed with
2532 Org-mode in @code{contrib/library-of-babel.org}.
2534 @subheading Header Arguments
2535 Many aspects of the evaluation and export of code blocks are controlled
2536 through header arguments.  These can be specified globally, at the file
2537 level, at the outline subtree level, and at the individual code block level.
2538 The following describes some of the header arguments.
2539 @table @code
2540 @item :var
2541 The @code{:var} header argument is used to pass arguments to code blocks.
2542 The values passed to arguments can be literal values, values from org-mode
2543 tables and literal example blocks, or the results of other named code blocks.
2544 @item :results
2545 The @code{:results} header argument controls the @emph{collection},
2546 @emph{type}, and @emph{handling} of code block results.  Values of
2547 @code{output} or @code{value} (the default) specify how results are collected
2548 from a code block's evaluation.  Values of @code{vector}, @code{scalar}
2549 @code{file} @code{raw} @code{html} @code{latex} and @code{code} specify the
2550 type of the results of the code block which dictates how they will be
2551 incorporated into the Org-mode buffer.  Values of @code{silent},
2552 @code{replace}, @code{prepend}, and @code{append} specify handling of code
2553 block results, specifically if and how the results should be inserted into
2554 the Org-mode buffer.
2555 @item :session
2556 A header argument of @code{:session} will cause the code block to be
2557 evaluated in a persistent interactive inferior process in Emacs.  This allows
2558 for persisting state between code block evaluations, and for manual
2559 inspection of the results of evaluation.
2560 @item :exports
2561 Any combination of the @emph{code} or the @emph{results} of a block can be
2562 retained on export, this is specified by setting the @code{:results} header
2563 argument to @code{code} @code{results} @code{none} or @code{both}.
2564 @item :tangle
2565 A header argument of @code{:tangle yes} will cause a code block's contents to
2566 be tangled to a file named after the filename of the Org-mode buffer.  An
2567 alternate file name can be specified with @code{:tangle filename}.
2568 @item :cache
2569 A header argument of @code{:cache yes} will cause associate a hash of the
2570 expanded code block with the results, ensuring that code blocks are only
2571 re-run when their inputs have changed.
2572 @item :noweb
2573 A header argument of @code{:noweb yes} will expand ``noweb'' style references
2574 on evaluation and tangling.
2575 @item :file
2576 Code blocks which output results to files (e.g.@: graphs, diagrams and figures)
2577 can accept a @code{:file filename} header argument in which case the results
2578 are saved to the named file, and a link to the file is inserted into the
2579 Org-mode buffer.
2580 @end table
2582 @seealso{
2583 @uref{http://orgmode.org/manual/Literal-examples.html#Literal-examples,
2584 Chapter 11.3 of the manual}@*
2585 @uref{http://orgmode.org/worg/org-contrib/babel/index.php,
2586 The Babel site on Worg}}
2588 @node Miscellaneous,  , Working With Source Code, Top
2589 @chapter Miscellaneous
2591 @menu
2592 * Completion::                  M-TAB knows what you need
2593 * Clean view::                  Getting rid of leading stars in the outline
2594 * MobileOrg::                   Org-mode on the iPhone
2595 @end menu
2597 @node Completion, Clean view, Miscellaneous, Miscellaneous
2598 @section Completion
2600 Org supports in-buffer completion with @kbd{M-@key{TAB}}.  This type of
2601 completion does not make use of the minibuffer.  You simply type a few
2602 letters into the buffer and use the key to complete text right there.  For
2603 example, this command will complete @TeX{} symbols after @samp{\}, TODO
2604 keywords at the beginning of a headline, and tags after @samp{:} in a
2605 headline.
2607 @node Clean view, MobileOrg, Completion, Miscellaneous
2608 @section A cleaner outline view
2610 Some people find it noisy and distracting that the Org headlines start with a
2611 potentially large number of stars, and that text below the headlines is not
2612 indented.  While this is no problem when writing a @emph{book-like} document
2613 where the outline headings are really section headings, in a more
2614 @emph{list-oriented} outline, indented structure is a lot cleaner:
2616 @smallexample
2617 @group
2618 * Top level headline             |    * Top level headline
2619 ** Second level                  |      * Second level
2620 *** 3rd level                    |        * 3rd level
2621 some text                        |          some text
2622 *** 3rd level                    |        * 3rd level
2623 more text                        |          more text
2624 * Another top level headline     |    * Another top level headline
2625 @end group
2626 @end smallexample
2628 @noindent
2629 If you are using at least Emacs 23.1.50.3 and version 6.29 of Org, this kind
2630 of view can be achieved dynamically at display time using
2631 @code{org-indent-mode}, which will prepend intangible space to each line.
2632 You can turn on @code{org-indent-mode} for all files by customizing the
2633 variable @code{org-startup-indented}, or you can turn it on for individual
2634 files using
2636 @smallexample
2637 #+STARTUP: indent
2638 @end smallexample
2640 If you want a similar effect in earlier version of Emacs and/or Org, or if
2641 you want the indentation to be hard space characters so that the plain text
2642 file looks as similar as possible to the Emacs display, Org supports you by
2643 helping to indent (with @key{TAB}) text below each headline, by hiding
2644 leading stars, and by only using levels 1, 3, etc to get two characters
2645 indentation for each level.  To get this support in a file, use
2647 @smallexample
2648 #+STARTUP: hidestars odd
2649 @end smallexample
2651 @node MobileOrg,  , Clean view, Miscellaneous
2652 @section MobileOrg
2654 @i{MobileOrg} is the name of the mobile companion app for Org mode, currently
2655 available for iOS and for Android.  @i{MobileOrg} offers offline viewing and
2656 capture support for an Org mode system rooted on a ``real'' computer.  It
2657 does also allow you to record changes to existing entries.
2659 The @uref{http://mobileorg.ncogni.to/, iOS implementation} for the
2660 @i{iPhone/iPod Touch/iPad} series of devices, was developed by Richard
2661 Moreland. Android users should check out
2662 @uref{http://wiki.github.com/matburt/mobileorg-android/, MobileOrg Android}
2663 by Matt Jones.  The two implementations are not identical but offer similar
2664 features.
2666 @seealso{
2667 @uref{http://orgmode.org/manual/Miscellaneous.html#Miscellaneous, Chapter 15
2668 of the manual}@*
2669 @uref{http://orgmode.org/manual/MobileOrg.html#MobileOrg, Appendix B of the
2670 manual}@*
2671 @uref{http://orgmode.org/orgcard.pdf,Key reference card}}
2673 @bye
2675 @c Local variables:
2676 @c fill-column: 77
2677 @c End:
2680 @c  LocalWords:  webdavhost pre