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