| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688 | \input texinfo@c %**start of header@setfilename ../../info/orgguide@settitle The compact Org-mode Guide@include org-version.inc@c Use proper quote and backtick for code sections in PDF output@c Cf. Texinfo manual 14.2@set txicodequoteundirected@set txicodequotebacktick@c Version and Contact Info@set MAINTAINERSITE @uref{http://orgmode.org,maintainers webpage}@set AUTHOR Carsten Dominik@set MAINTAINER Carsten Dominik@set MAINTAINEREMAIL @email{carsten at orgmode dot org}@set MAINTAINERCONTACT @uref{mailto:carsten at orgmode dot org,contact the maintainer}@c %**end of header@finalout@c Macro definitions@iftex@c @hyphenation{time-stamp time-stamps time-stamp-ing time-stamp-ed}@end iftex@c Subheadings inside a table.@macro tsubheading{text}@ifinfo@subsubheading \text\@end ifinfo@ifnotinfo@item @b{\text\}@end ifnotinfo@end macro@macro seealso{text}@noindent @b{Further reading}@*@noindent \text\@end macro@copyingCopyright @copyright{} 2010--2014 Free Software Foundation@quotationPermission is granted to copy, distribute and/or modify this documentunder the terms of the GNU Free Documentation License, Version 1.3 orany later version published by the Free Software Foundation; with noInvariant Sections, with the Front-Cover texts being ``A GNU Manual,''and with the Back-Cover Texts as in (a) below.  A copy of the licenseis included in the section entitled ``GNU Free Documentation License''in the full Org manual, which is distributed together with the compactguide.(a) The FSF's Back-Cover Text is: ``You have the freedom to copy andmodify this GNU manual.''@end quotation@end copying@dircategory Emacs@direntry* Org Mode Guide: (orgguide).  Abbreviated Org-mode Manual@end direntry@titlepage@title The compact Org-mode Guide@subtitle Release @value{VERSION}@author by Carsten Dominik@c The following two commands start the copyright page.@page@vskip 0pt plus 1filll@insertcopying@end titlepage@c Output the table of contents at the beginning.@shortcontents@ifnottex@node Top, Introduction, (dir), (dir)@top Org Mode Guide@insertcopying@end ifnottex@menu* Introduction::		Getting started* Document Structure::		A tree works like your brain* Tables::			Pure magic for quick formatting* Hyperlinks::			Notes in context* TODO Items::			Every tree branch can be a TODO item* Tags::			Tagging headlines and matching sets of tags* Properties::			Properties* Dates and Times::		Making items useful for planning* Capture - Refile - Archive::	The ins and outs for projects* Agenda Views::		Collecting information into views* Markup::			Prepare text for rich export* Exporting::			Sharing and publishing of notes* Publishing::			Create a web site of linked Org files* Working With Source Code::	Source code snippets embedded in Org* Miscellaneous::		All the rest which did not fit elsewhere* GNU Free Documentation License::  This manual license.@detailmenu --- The Detailed Node Listing ---Introduction* Preface::			Welcome* Installation::		How to install a downloaded version of Org* Activation::			How to activate Org for certain buffers* Feedback::			Bug reports, ideas, patches etc.Document Structure* Outlines::			Org is based on Outline mode* Headlines::			How to typeset Org tree headlines* Visibility cycling::		Show and hide, much simplified* Motion::			Jumping to other headlines* Structure editing::		Changing sequence and level of headlines* Sparse trees::		Matches embedded in context* Plain lists::			Additional structure within an entry* Footnotes::			How footnotes are defined in Org's syntaxHyperlinks* Link format::			How links in Org are formatted* Internal links::		Links to other places in the current file* External links::		URL-like links to the world* Handling links::		Creating, inserting and following* Targeted links::		Point at a location in a fileTODO Items* Using TODO states::		Setting and switching states* Multi-state workflows::	More than just on/off* Progress logging::		Dates and notes for progress* Priorities::			Some things are more important than others* Breaking down tasks::		Splitting a task into manageable pieces* Checkboxes::			Tick-off listsProgress logging* Closing items::		When was this entry marked DONE?* Tracking TODO state changes::	 When did the status change?Tags* Tag inheritance::		Tags use the tree structure of the outline* Setting tags::		How to assign tags to a headline* Tag groups::			Use one tag to search for several tags* Tag searches::		Searching for combinations of tagsDates and Times* Timestamps::			Assigning a time to a tree entry* Creating timestamps::		Commands which insert timestamps* Deadlines and scheduling::	Planning your work* Clocking work time::		Tracking how long you spend on a taskCapture - Refile - Archive* Capture::			Capturing new stuff* Refile and copy::		Moving a tree from one place to another* Archiving::			What to do with finished projectsCapture* Setting up a capture location::  Where notes will be stored* Using capture::		Commands to invoke and terminate capture* Capture templates::		Define the outline of different note typesAgenda Views* Agenda files::		Files being searched for agenda information* Agenda dispatcher::		Keyboard access to agenda views* Built-in agenda views::	What is available out of the box?* Agenda commands::		Remote editing of Org trees* Custom agenda views::		Defining special searches and viewsThe built-in agenda views* Weekly/daily agenda::		The calendar page with current tasks* Global TODO list::		All unfinished action items* Matching tags and properties::  Structured information with fine-tuned search* Timeline::			Time-sorted view for single file* Search view::			Find entries by searching for textMarkup for rich export* Structural markup elements::	The basic structure as seen by the exporter* Images and tables::		Images, tables and caption mechanism* Literal examples::		Source code examples with special formatting* Include files::		Include additional files into a document* Embedded @LaTeX{}::		@LaTeX{} can be freely used inside Org documentsStructural markup elements* Document title::		Where the title is taken from* Headings and sections::	The document structure as seen by the exporter* Table of contents::		The if and where of the table of contents* Paragraphs::			Paragraphs* Emphasis and monospace::	Bold, italic, etc.* Comment lines::		What will *not* be exportedExporting* Export options::		Per-file export settings* The export dispatcher::	How to access exporter commands* ASCII/Latin-1/UTF-8 export::	Exporting to flat files with encoding* HTML export::			Exporting to HTML* @LaTeX{} and PDF export::	Exporting to @LaTeX{}, and processing to PDF* iCalendar export::            Exporting to iCalendarMiscellaneous* Completion::			M-TAB knows what you need* Clean view::			Getting rid of leading stars in the outline* MobileOrg::			Org-mode on the iPhone@end detailmenu@end menu@node Introduction, Document Structure, Top, Top@chapter Introduction@menu* Preface::			Welcome* Installation::		How to install a downloaded version of Org* Activation::			How to activate Org for certain buffers* Feedback::			Bug reports, ideas, patches etc.@end menu@node Preface, Installation, Introduction, Introduction@section PrefaceOrg is a mode for keeping notes, maintaining TODO lists, and doing projectplanning with a fast and effective plain-text system.  It is also anauthoring and publishing system, and it supports working with source code forliteral programming and reproducible research.@i{This document is a much compressed derivative of the@uref{http://orgmode.org/index.html#sec-4_1, comprehensive Org-mode manual}.It contains all basic features and commands, along with important hints forcustomization.  It is intended for beginners who would shy back from a 200page manual because of sheer size.}@node Installation, Activation, Preface, Introduction@section Installation@b{Important:} @i{If you are using a version of Org that is part of the Emacsdistribution or an XEmacs package, please skip this section and go directlyto @ref{Activation}.}If you have downloaded Org from the Web, either as a distribution @file{.zip}or @file{.tar} file, or as a Git archive, it is best to run it directly fromthe distribution directory.  You need to add the @file{lisp} subdirectoriesto the Emacs load path.  To do this, add the following line to @file{.emacs}:@smallexample(setq load-path (cons "~/path/to/orgdir/lisp" load-path))(setq load-path (cons "~/path/to/orgdir/contrib/lisp" load-path))@end smallexample@noindent If you have been using git or a tar ball to get Org, you need torun the following command to generate autoload information.command:@smallexamplemake autoloads@end smallexample@node Activation, Feedback, Installation, Introduction@section ActivationAdd the following lines to your @file{.emacs} file.  The last four linesdefine @emph{global} keys for some commands --- please choose suitable keysyourself.@smalllisp;; The following lines are always needed.  Choose your own keys.(global-set-key "\C-cl" 'org-store-link)(global-set-key "\C-ca" 'org-agenda)(global-set-key "\C-cc" 'org-capture)(global-set-key "\C-cb" 'org-iswitchb)@end smalllispFiles with extension @samp{.org} will be put into Org mode automatically.@node Feedback,  , Activation, Introduction@section FeedbackIf you find problems with Org, or if you have questions, remarks, or ideasabout it, please mail to the Org mailing list @email{emacs-orgmode@@gnu.org}.For information on how to submit bug reports, see the main manual.@node Document Structure, Tables, Introduction, Top@chapter Document StructureOrg is based on Outline mode and provides flexible commands toedit the structure of the document.@menu* Outlines::			Org is based on Outline mode* Headlines::			How to typeset Org tree headlines* Visibility cycling::		Show and hide, much simplified* Motion::			Jumping to other headlines* Structure editing::		Changing sequence and level of headlines* Sparse trees::		Matches embedded in context* Plain lists::			Additional structure within an entry* Footnotes::			How footnotes are defined in Org's syntax@end menu@node Outlines, Headlines, Document Structure, Document Structure@section OutlinesOrg is implemented on top of Outline mode.  Outlines allow adocument to be organized in a hierarchical structure, which (at leastfor me) is the best representation of notes and thoughts.  An overviewof this structure is achieved by folding (hiding) large parts of thedocument to show only the general document structure and the partscurrently being worked on.  Org greatly simplifies the use ofoutlines by compressing the entire show/hide functionality into a singlecommand, @command{org-cycle}, which is bound to the @key{TAB} key.@node Headlines, Visibility cycling, Outlines, Document Structure@section HeadlinesHeadlines define the structure of an outline tree.  The headlines inOrg start with one or more stars, on the left margin@footnote{Seethe variable @code{org-special-ctrl-a/e} to configure special behaviorof @kbd{C-a} and @kbd{C-e} in headlines.}.  For example:@smallexample* Top level headline** Second level*** 3rd level    some text*** 3rd level    more text* Another top level headline@end smallexample@noindent Some people find the many stars too noisy and would prefer anoutline that has whitespace followed by a single star as headlinestarters.  @ref{Clean view}, describes a setup to realize this.@node Visibility cycling, Motion, Headlines, Document Structure@section Visibility cyclingOutlines make it possible to hide parts of the text in the buffer.Org uses just two commands, bound to @key{TAB} and@kbd{S-@key{TAB}} to change the visibility in the buffer.@table @kbd@item @key{TAB}@emph{Subtree cycling}: Rotate current subtree among the states@smallexample,-> FOLDED -> CHILDREN -> SUBTREE --.'-----------------------------------'@end smallexampleWhen called with a prefix argument (@kbd{C-u @key{TAB}}) or with the shiftkey, global cycling is invoked.@item S-@key{TAB} @r{and} C-u @key{TAB}@emph{Global cycling}: Rotate the entire buffer among the states@smallexample,-> OVERVIEW -> CONTENTS -> SHOW ALL --.'--------------------------------------'@end smallexample@item C-u C-u C-u @key{TAB}Show all, including drawers.@end tableWhen Emacs first visits an Org file, the global state is set toOVERVIEW, i.e.@: only the top level headlines are visible.  This can beconfigured through the variable @code{org-startup-folded}, or on aper-file basis by adding a startup keyword @code{overview}, @code{content},@code{showall}, like this:@smallexample#+STARTUP: content@end smallexample@node Motion, Structure editing, Visibility cycling, Document Structure@section MotionThe following commands jump to other headlines in the buffer.@table @kbd@item C-c C-nNext heading.@item C-c C-pPrevious heading.@item C-c C-fNext heading same level.@item C-c C-bPrevious heading same level.@item C-c C-uBackward to higher level heading.@end table@node Structure editing, Sparse trees, Motion, Document Structure@section Structure editing@table @kbd@item M-@key{RET}Insert new heading with same level as current.  If the cursor is in a plainlist item, a new item is created (@pxref{Plain lists}).  When this command isused in the middle of a line, the line is split and the rest of the linebecomes the new headline@footnote{If you do not want the line to be split,customize the variable @code{org-M-RET-may-split-line}.}.@item M-S-@key{RET}Insert new TODO entry with same level as current heading.@item @key{TAB} @r{in new, empty entry}In a new entry with no text yet, @key{TAB} will cycle through reasonablelevels.@item M-@key{left}@r{/}@key{right}Promote/demote current heading by one level.@item M-S-@key{left}@r{/}@key{right}Promote/demote the current subtree by one level.@item M-S-@key{up}@r{/}@key{down}Move subtree up/down (swap with previous/next subtree of samelevel).@item C-c C-wRefile entry or region to a different location.  @xref{Refile and copy}.@item C-x n s/wNarrow buffer to current subtree / widen it again@end tableWhen there is an active region (Transient Mark mode), promotion anddemotion work on all headlines in the region.@node Sparse trees, Plain lists, Structure editing, Document Structure@section Sparse treesAn important feature of Org mode is the ability to construct @emph{sparsetrees} for selected information in an outline tree, so that the entiredocument is folded as much as possible, but the selected information is madevisible along with the headline structure above it@footnote{See also thevariables @code{org-show-hierarchy-above}, @code{org-show-following-heading},@code{org-show-siblings}, and @code{org-show-entry-below} for detailedcontrol on how much context is shown around each match.}.  Just try it outand you will see immediately how it works.Org mode contains several commands creating such trees, all thesecommands can be accessed through a dispatcher:@table @kbd@item C-c /This prompts for an extra key to select a sparse-tree creating command.@item C-c / rOccur.  Prompts for a regexp and shows a sparse tree with all matches.  Eachmatch is also highlighted; the highlights disappear by pressing @kbd{C-c C-c}.@end tableThe other sparse tree commands select headings based on TODO keywords,tags, or properties and will be discussed later in this manual.@node Plain lists, Footnotes, Sparse trees, Document Structure@section Plain listsWithin an entry of the outline tree, hand-formatted lists can provideadditional structure.  They also provide a way to create lists ofcheckboxes (@pxref{Checkboxes}).  Org supports editing such lists,and the HTML exporter (@pxref{Exporting}) parses and formats them.Org knows ordered lists, unordered lists, and description lists.@itemize @bullet@item@emph{Unordered} list items start with @samp{-}, @samp{+}, or@samp{*} as bullets.@item@emph{Ordered} list items start with @samp{1.} or @samp{1)}.@item@emph{Description} list use @samp{ :: } to separate the @emph{term} from thedescription.@end itemizeItems belonging to the same list must have the same indentation on the firstline.  An item ends before the next line that is indented like itsbullet/number, or less.  A list ends when all items are closed, or before twoblank lines.  An example:@smallexample@group** Lord of the Rings   My favorite scenes are (in this order)   1. The attack of the Rohirrim   2. Eowyn's fight with the witch king      + this was already my favorite scene in the book      + I really like Miranda Otto.   Important actors in this film are:   - @b{Elijah Wood} :: He plays Frodo   - @b{Sean Austin} :: He plays Sam, Frodo's friend.@end group@end smallexampleThe following commands act on items when the cursor is in the first line ofan item (the line with the bullet or number).@table @kbd@item @key{TAB}Items can be folded just like headline levels.@item M-@key{RET}Insert new item at current level.  With a prefix argument, force a newheading (@pxref{Structure editing}).@item M-S-@key{RET}Insert a new item with a checkbox (@pxref{Checkboxes}).@item M-S-@key{up}@r{/}@key{down}Move the item including subitems up/down (swap with previous/next itemof same indentation).  If the list is ordered, renumbering isautomatic.@item M-@key{left}@r{/}M-@key{right}Decrease/increase the indentation of an item, leaving children alone.@item M-S-@key{left}@r{/}@key{right}Decrease/increase the indentation of the item, including subitems.@item C-c C-cIf there is a checkbox (@pxref{Checkboxes}) in the item line, toggle thestate of the checkbox.  Also verify bullets and indentation consistency inthe whole list.@item C-c -Cycle the entire list level through the different itemize/enumerate bullets(@samp{-}, @samp{+}, @samp{*}, @samp{1.}, @samp{1)}).@end table@node Footnotes,  , Plain lists, Document Structure@section FootnotesA footnote is defined in a paragraph that is started by a footnote marker insquare brackets in column 0, no indentation allowed.  The footnote referenceis simply the marker in square brackets, inside text.  For example:@smallexampleThe Org homepage[fn:1] now looks a lot better than it used to....[fn:1] The link is: http://orgmode.org@end smallexample@noindent The following commands handle footnotes:@table @kbd@item C-c C-x fThe footnote action command.  When the cursor is on a footnote reference,jump to the definition.  When it is at a definition, jump to the (first)reference.  Otherwise, create a new footnote.  When this command is calledwith a prefix argument, a menu of additional options including renumbering isoffered.@item C-c C-cJump between definition and reference.@end table@seealso{@uref{http://orgmode.org/manual/Document-Structure.html#Document-Structure,Chapter 2 of the manual}@*@uref{http://sachachua.com/wp/2008/01/outlining-your-notes-with-org/,Sacha Chua's tutorial}}@node Tables, Hyperlinks, Document Structure, Top@chapter TablesOrg comes with a fast and intuitive table editor.  Spreadsheet-likecalculations are supported in connection with the Emacs @file{calc}package@ifinfo(@pxref{Top,Calc,,Calc,Gnu Emacs Calculator Manual}).@end ifinfo@ifnotinfo(see the Emacs Calculator manual for more information about the Emacscalculator).@end ifnotinfoOrg makes it easy to format tables in plain ASCII.  Any line with@samp{|} as the first non-whitespace character is considered part of atable.  @samp{|} is also the column separator.  A table might look likethis:@smallexample| Name  | Phone | Age ||-------+-------+-----|| Peter |  1234 |  17 || Anna  |  4321 |  25 |@end smallexampleA table is re-aligned automatically each time you press @key{TAB} or@key{RET} or @kbd{C-c C-c} inside the table.  @key{TAB} also moves tothe next field (@key{RET} to the next row) and creates new table rowsat the end of the table or before horizontal lines.  The indentationof the table is set by the first line.  Any line starting with@samp{|-} is considered as a horizontal separator line and will beexpanded on the next re-align to span the whole table width.  So, tocreate the above table, you would only type@smallexample|Name|Phone|Age||-@end smallexample@noindent and then press @key{TAB} to align the table and start filling infields.  Even faster would be to type @code{|Name|Phone|Age} followed by@kbd{C-c @key{RET}}.When typing text into a field, Org treats @key{DEL},@key{Backspace}, and all character keys in a special way, so thatinserting and deleting avoids shifting other fields.  Also, whentyping @emph{immediately after the cursor was moved into a new fieldwith @kbd{@key{TAB}}, @kbd{S-@key{TAB}} or @kbd{@key{RET}}}, thefield is automatically made blank.@table @kbd@tsubheading{Creation and conversion}@item C-c |Convert the active region to table.  If every line contains at least one TABcharacter, the function assumes that the material is tab separated.  If everyline contains a comma, comma-separated values (CSV) are assumed.  If not,lines are split at whitespace into fields.@*If there is no active region, this command creates an empty Orgtable.  But it's easier just to start typing, like@kbd{|Name|Phone|Age C-c @key{RET}}.@tsubheading{Re-aligning and field motion}@item C-c C-cRe-align the table without moving the cursor.@c@item @key{TAB}Re-align the table, move to the next field.  Creates a new row ifnecessary.@c@item S-@key{TAB}Re-align, move to previous field.@c@item @key{RET}Re-align the table and move down to next row.  Creates a new row ifnecessary.@tsubheading{Column and row editing}@item M-@key{left}@itemx M-@key{right}Move the current column left/right.@c@item M-S-@key{left}Kill the current column.@c@item M-S-@key{right}Insert a new column to the left of the cursor position.@c@item M-@key{up}@itemx M-@key{down}Move the current row up/down.@c@item M-S-@key{up}Kill the current row or horizontal line.@c@item M-S-@key{down}Insert a new row above the current row.  With a prefix argument, the line iscreated below the current one.@c@item C-c -Insert a horizontal line below current row.  With a prefix argument, the lineis created above the current line.@c@item C-c @key{RET}Insert a horizontal line below current row, and move the cursor into the rowbelow that line.@c@item C-c ^Sort the table lines in the region.  The position of point indicates thecolumn to be used for sorting, and the range of lines is the rangebetween the nearest horizontal separator lines, or the entire table.@end table@seealso{@uref{http://orgmode.org/manual/Tables.html#Tables, Chapter 3 of themanual}@*@uref{http://orgmode.org/worg/org-tutorials/tables.php, Bastien'stable tutorial}@*@uref{http://orgmode.org/worg/org-tutorials/org-spreadsheet-intro.php,Bastien's spreadsheet tutorial}@*@uref{http://orgmode.org/worg/org-tutorials/org-plot.php, Eric's plotting tutorial}}@node Hyperlinks, TODO Items, Tables, Top@chapter HyperlinksLike HTML, Org provides links inside a file, external links toother files, Usenet articles, emails, and much more.@menu* Link format::			How links in Org are formatted* Internal links::		Links to other places in the current file* External links::		URL-like links to the world* Handling links::		Creating, inserting and following* Targeted links::		Point at a location in a file@end menu@node Link format, Internal links, Hyperlinks, Hyperlinks@section Link formatOrg will recognize plain URL-like links and activate them asclickable links.  The general link format, however, looks like this:@smallexample[[link][description]]       @r{or alternatively}           [[link]]@end smallexample@noindentOnce a link in the buffer is complete (all brackets present), Org will changethe display so that @samp{description} is displayed instead of@samp{[[link][description]]} and @samp{link} is displayed instead of@samp{[[link]]}.  To edit the invisible @samp{link} part, use @kbd{C-cC-l} with the cursor on the link.@node Internal links, External links, Link format, Hyperlinks@section Internal linksIf the link does not look like a URL, it is considered to be internal in thecurrent file.  The most important case is a link like@samp{[[#my-custom-id]]} which will link to the entry with the@code{CUSTOM_ID} property @samp{my-custom-id}.Links such as @samp{[[My Target]]} or @samp{[[My Target][Find my target]]}lead to a text search in the current file for the corresponding target whichlooks like @samp{<<My Target>>}.Internal links will be used to reference their destination, through links ornumbers, when possible.@node External links, Handling links, Internal links, Hyperlinks@section External linksOrg supports links to files, websites, Usenet and email messages,BBDB database entries and links to both IRC conversations and theirlogs.  External links are URL-like locators.  They start with a shortidentifying string followed by a colon.  There can be no space afterthe colon.  Here are some examples:@smallexamplehttp://www.astro.uva.nl/~dominik          @r{on the web}file:/home/dominik/images/jupiter.jpg     @r{file, absolute path}/home/dominik/images/jupiter.jpg          @r{same as above}file:papers/last.pdf                      @r{file, relative path}file:projects.org                         @r{another Org file}docview:papers/last.pdf::NNN              @r{open file in doc-view mode at page NNN}id:B7423F4D-2E8A-471B-8810-C40F074717E9   @r{Link to heading by ID}news:comp.emacs                           @r{Usenet link}mailto:adent@@galaxy.net                   @r{Mail link}vm:folder                                 @r{VM folder link}vm:folder#id                              @r{VM message link}wl:folder#id                              @r{WANDERLUST message link}mhe:folder#id                             @r{MH-E message link}rmail:folder#id                           @r{RMAIL message link}gnus:group#id                             @r{Gnus article link}bbdb:R.*Stallman                          @r{BBDB link (with regexp)}irc:/irc.com/#emacs/bob                   @r{IRC link}info:org:External%20links                 @r{Info node link (with encoded space)}@end smallexampleA link should be enclosed in double brackets and may contain adescriptive text to be displayed instead of the URL (@pxref{Linkformat}), for example:@smallexample[[http://www.gnu.org/software/emacs/][GNU Emacs]]@end smallexample@noindentIf the description is a file name or URL that points to an image, HTML export(@pxref{HTML export}) will inline the image as a clickable button.  If thereis no description at all and the link points to an image, that image will beinlined into the exported HTML file.@node Handling links, Targeted links, External links, Hyperlinks@section Handling linksOrg provides methods to create a link in the correct syntax, toinsert it into an Org file, and to follow the link.@table @kbd@item C-c lStore a link to the current location.  This is a @emph{global} command (youmust create the key binding yourself) which can be used in any buffer tocreate a link.  The link will be stored for later insertion into an Orgbuffer (see below).@c@item C-c C-lInsert a link.  This prompts for a link to be inserted into the buffer.  Youcan just type a link, or use history keys @key{up} and @key{down} to accessstored links.  You will be prompted for the description part of the link.When called with a @kbd{C-u} prefix argument, file name completion is used tolink to a file.@c@item C-c C-l @r{(with cursor on existing link)}When the cursor is on an existing link, @kbd{C-c C-l} allows you to edit thelink and description parts of the link.@c@item C-c C-o @r{or} mouse-1 @r{or} mouse-2Open link at point.@item C-c &Jump back to a recorded position.  A position is recorded by thecommands following internal links, and by @kbd{C-c %}.  Using thiscommand several times in direct succession moves through a ring ofpreviously recorded positions.@c@end table@node Targeted links,  , Handling links, Hyperlinks@section Targeted linksFile links can contain additional information to make Emacs jump to aparticular location in the file when following a link.  This can be aline number or a search option after a double colon.Here is the syntax of the different ways to attach a search to a filelink, together with an explanation:@smallexample[[file:~/code/main.c::255]]                 @r{Find line 255}[[file:~/xx.org::My Target]]                @r{Find @samp{<<My Target>>}}[[file:~/xx.org::#my-custom-id]]            @r{Find entry with custom id}@end smallexample@seealso{@uref{http://orgmode.org/manual/Hyperlinks.html#Hyperlinks, Chapter 4 of themanual}}@node TODO Items, Tags, Hyperlinks, Top@chapter TODO ItemsOrg mode does not require TODO lists to live in separate documents.  Instead,TODO items are part of a notes file, because TODO items usuallycome up while taking notes!  With Org mode, simply mark any entry in a treeas being a TODO item.  In this way, information is not duplicated, and TODOitems remain in the context from which they emerged.Org mode providing methods to give you an overview of all the things that youhave to do, collected from many files.@menu* Using TODO states::		Setting and switching states* Multi-state workflows::	More than just on/off* Progress logging::		Dates and notes for progress* Priorities::			Some things are more important than others* Breaking down tasks::		Splitting a task into manageable pieces* Checkboxes::			Tick-off lists@end menu@node Using TODO states, Multi-state workflows, TODO Items, TODO Items@section Using TODO statesAny headline becomes a TODO item when it starts with the word@samp{TODO}, for example:@smallexample*** TODO Write letter to Sam Fortune@end smallexample@noindentThe most important commands to work with TODO entries are:@table @kbd@item C-c C-tRotate the TODO state of the current item among@smallexample(unmarked) -> TODO -> DONE -> (unmarked)@end smallexampleThe same rotation can also be done ``remotely'' from the timeline andagenda buffers with the @kbd{t} command key (@pxref{Agenda commands}).@item S-@key{right}@r{/}@key{left}Select the following/preceding TODO state, similar to cycling.@item C-c / tView TODO items in a @emph{sparse tree} (@pxref{Sparse trees}).  Folds thebuffer, but shows all TODO items and the headings hierarchy abovethem.@item C-c a tShow the global TODO list.  Collects the TODO items from all agenda files(@pxref{Agenda Views}) into a single buffer.  @xref{Global TODO list}, formore information.@item S-M-@key{RET}Insert a new TODO entry below the current one.@end table@noindentChanging a TODO state can also trigger tag changes.  See the docstring of theoption @code{org-todo-state-tags-triggers} for details.@node Multi-state workflows, Progress logging, Using TODO states, TODO Items@section Multi-state workflowsYou can use TODO keywords to indicate @emph{sequential} working progressstates:@smalllisp(setq org-todo-keywords  '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))@end smalllispThe vertical bar separates the TODO keywords (states that @emph{need action})from the DONE states (which need @emph{no further action}).  If you don'tprovide the separator bar, the last state is used as the DONE state.  Withthis setup, the command @kbd{C-c C-t} will cycle an entry from TODO toFEEDBACK, then to VERIFY, and finally to DONE and DELEGATED.  Sometimes youmay want to use different sets of TODO keywords in parallel.  For example,you may want to have the basic @code{TODO}/@code{DONE}, but also a workflowfor bug fixing.  Your setup would then look like this:@smalllisp(setq org-todo-keywords      '((sequence "TODO(t)" "|" "DONE(d)")        (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")))@end smalllispThe keywords should all be different, this helps Org mode to keep track ofwhich subsequence should be used for a given entry.  The example also showshow to define keys for fast access of a particular state, by adding a letterin parenthesis after each keyword---you will be prompted for the key after@kbd{C-c C-t}.To define TODO keywords that are valid only in a single file, use thefollowing text anywhere in the file.@smallexample#+TODO: TODO(t) | DONE(d)#+TODO: REPORT(r) BUG(b) KNOWNCAUSE(k) | FIXED(f)#+TODO: | CANCELED(c)@end smallexampleAfter changing one of these lines, use @kbd{C-c C-c} with the cursor still inthe line to make the changes known to Org mode.@node Progress logging, Priorities, Multi-state workflows, TODO Items@section Progress loggingOrg mode can automatically record a timestamp and possibly a note whenyou mark a TODO item as DONE, or even each time you change the state ofa TODO item.  This system is highly configurable; settings can be on aper-keyword basis and can be localized to a file or even a subtree.  Forinformation on how to clock working time for a task, see @ref{Clockingwork time}.@menu* Closing items::		When was this entry marked DONE?* Tracking TODO state changes::	 When did the status change?@end menu@node Closing items, Tracking TODO state changes, Progress logging, Progress logging@unnumberedsubsec Closing itemsThe most basic logging is to keep track of @emph{when} a certain TODOitem was finished.  This is achieved with@footnote{The correspondingin-buffer setting is: @code{#+STARTUP: logdone}}.@smalllisp(setq org-log-done 'time)@end smalllisp@noindentThen each time you turn an entry from a TODO (not-done) state into any of theDONE states, a line @samp{CLOSED: [timestamp]} will be inserted just afterthe headline.  If you want to record a note along with the timestamp,use@footnote{The corresponding in-buffer setting is: @code{#+STARTUP:lognotedone}}@smalllisp(setq org-log-done 'note)@end smalllisp@noindentYou will then be prompted for a note, and that note will be stored belowthe entry with a @samp{Closing Note} heading.@node Tracking TODO state changes,  , Closing items, Progress logging@unnumberedsubsec Tracking TODO state changesYou might want to keep track of TODO state changes.  You can either recordjust a timestamp, or a time-stamped note for a change.  These records will beinserted after the headline as an itemized list.  When taking a lot of notes,you might want to get the notes out of the way into a drawer.  Customize thevariable @code{org-log-into-drawer} to get this behavior.For state logging, Org mode expects configuration on a per-keyword basis.This is achieved by adding special markers @samp{!} (for a timestamp) and@samp{@@} (for a note) in parentheses after each keyword.  For example:@smallexample#+TODO: TODO(t) WAIT(w@@/!) | DONE(d!) CANCELED(c@@)@end smallexample@noindentwill define TODO keywords and fast access keys, and also request that a timeis recorded when the entry is set to DONE, and that a note is recorded whenswitching to WAIT or CANCELED.  The same syntax works also when setting@code{org-todo-keywords}.@node Priorities, Breaking down tasks, Progress logging, TODO Items@section PrioritiesIf you use Org mode extensively, you may end up with enough TODO items thatit starts to make sense to prioritize them.  Prioritizing can be done byplacing a @emph{priority cookie} into the headline of a TODO item, like this@smallexample*** TODO [#A] Write letter to Sam Fortune@end smallexample@noindentOrg mode supports three priorities: @samp{A}, @samp{B}, and @samp{C}.@samp{A} is the highest, @samp{B} the default if none is given.  Prioritiesmake a difference only in the agenda.@table @kbd@item @kbd{C-c ,}Set the priority of the current headline.  Press @samp{A}, @samp{B} or@samp{C} to select a priority, or @key{SPC} to remove the cookie.@c@item S-@key{up}/@key{dwn}Increase/decrease priority of current headline@end table@node Breaking down tasks, Checkboxes, Priorities, TODO Items@section Breaking tasks down into subtasksIt is often advisable to break down large tasks into smaller, manageablesubtasks.  You can do this by creating an outline tree below a TODO item,with detailed subtasks on the tree.  To keep the overview over the fractionof subtasks that are already completed, insert either @samp{[/]} or@samp{[%]} anywhere in the headline.  These cookies will be updated each timethe TODO status of a child changes, or when pressing @kbd{C-c C-c} on thecookie.  For example:@smallexample* Organize Party [33%]** TODO Call people [1/2]*** TODO Peter*** DONE Sarah** TODO Buy food** DONE Talk to neighbor@end smallexample@node Checkboxes,  , Breaking down tasks, TODO Items@section CheckboxesEvery item in a plain list (@pxref{Plain lists}) can be made into a checkboxby starting it with the string @samp{[ ]}.  Checkboxes are not included inthe global TODO list, so they are often great to split a task into a numberof simple steps.Here is an example of a checkbox list.@smallexample* TODO Organize party [1/3]  - [-] call people [1/2]    - [ ] Peter    - [X] Sarah  - [X] order food@end smallexampleCheckboxes work hierarchically, so if a checkbox item has children thatare checkboxes, toggling one of the children checkboxes will make theparent checkbox reflect if none, some, or all of the children arechecked.@noindent The following commands work with checkboxes:@table @kbd@item C-c C-cToggle checkbox status or (with prefix arg) checkbox presence at point.@item M-S-@key{RET}Insert a new item with a checkbox.This works only if the cursor is already in a plain list item(@pxref{Plain lists}).@end table@seealso{@uref{http://orgmode.org/manual/TODO-Items.html#TODO-Items, Chapter 5 of the manual}@*@uref{http://orgmode.org/worg/org-tutorials/orgtutorial_dto.php, DavidO'Toole's introductory tutorial}@*@uref{http://members.optusnet.com.au/~charles57/GTD/gtd_workflow.html,Charles Cave's GTD setup}}@node Tags, Properties, TODO Items, Top@chapter TagsAn excellent way to implement labels and contexts for cross-correlatinginformation is to assign @i{tags} to headlines.  Org mode has extensivesupport for tags.Every headline can contain a list of tags; they occur at the end of theheadline.  Tags are normal words containing letters, numbers, @samp{_}, and@samp{@@}.  Tags must be preceded and followed by a single colon, e.g.,@samp{:work:}.  Several tags can be specified, as in @samp{:work:urgent:}.Tags will by default be in bold face with the same color as the headline.@menu* Tag inheritance::		Tags use the tree structure of the outline* Setting tags::		How to assign tags to a headline* Tag groups::			Use one tag to search for several tags* Tag searches::		Searching for combinations of tags@end menu@node Tag inheritance, Setting tags, Tags, Tags@section Tag inheritance@i{Tags} make use of the hierarchical structure of outline trees.  If aheading has a certain tag, all subheadings will inherit the tag aswell.  For example, in the list@smallexample* Meeting with the French group      :work:** Summary by Frank                  :boss:notes:*** TODO Prepare slides for him      :action:@end smallexample@noindentthe final heading will have the tags @samp{:work:}, @samp{:boss:},@samp{:notes:}, and @samp{:action:} even though the final heading is notexplicitly marked with those tags.  You can also set tags that all entries ina file should inherit just as if these tags were defined in a hypotheticallevel zero that surrounds the entire file.  Use a line like this@footnote{Aswith all these in-buffer settings, pressing @kbd{C-c C-c} activates anychanges in the line.}:@smallexample#+FILETAGS: :Peter:Boss:Secret:@end smallexample@node Setting tags, Tag groups, Tag inheritance, Tags@section Setting tagsTags can simply be typed into the buffer at the end of a headline.After a colon, @kbd{M-@key{TAB}} offers completion on tags.  There isalso a special command for inserting tags:@table @kbd@item C-c C-qEnter new tags for the current headline.  Org mode will either offercompletion or a special single-key interface for setting tags, seebelow.  After pressing @key{RET}, the tags will be inserted and alignedto @code{org-tags-column}.  When called with a @kbd{C-u} prefix, alltags in the current buffer will be aligned to that column, just to makethings look nice.@item C-c C-cWhen the cursor is in a headline, this does the same as @kbd{C-c C-q}.@end tableOrg will support tag insertion based on a @emph{list of tags}.  Bydefault this list is constructed dynamically, containing all tagscurrently used in the buffer.  You may also globally specify a hard listof tags with the variable @code{org-tag-alist}.  Finally you can setthe default tags for a given file with lines like@smallexample#+TAGS: @@work @@home @@tennisclub#+TAGS: laptop car pc sailboat@end smallexampleBy default Org mode uses the standard minibuffer completion facilities forentering tags.  However, it also implements another, quicker, tag selectionmethod called @emph{fast tag selection}.  This allows you to select anddeselect tags with just a single key press.  For this to work well you shouldassign unique letters to most of your commonly used tags.  You can do thisglobally by configuring the variable @code{org-tag-alist} in your@file{.emacs} file.  For example, you may find the need to tag many items indifferent files with @samp{:@@home:}.  In this case you can set somethinglike:@smalllisp(setq org-tag-alist '(("@@work" . ?w) ("@@home" . ?h) ("laptop" . ?l)))@end smalllisp@noindent If the tag is only relevant to the file you are working on, then youcan instead set the TAGS option line as:@smallexample#+TAGS: @@work(w)  @@home(h)  @@tennisclub(t)  laptop(l)  pc(p)@end smallexample@node Tag groups, Tag searches, Setting tags, Tags@section Tag groups@cindex group tags@cindex tags, groupsIn a set of mutually exclusive tags, the first tag can be defined as a@emph{group tag}.  When you search for a group tag, it will return matchesfor all members in the group.  In an agenda view, filtering by a group tagwill display headlines tagged with at least one of the members of thegroup.  This makes tag searches and filters even more flexible.You can set group tags by inserting a colon between the group tag and othertags, like this:@example#+TAGS: @{ @@read : @@read_book  @@read_ebook @}@end exampleIn this example, @samp{@@read} is a @emph{group tag} for a set of threetags: @samp{@@read}, @samp{@@read_book} and @samp{@@read_ebook}.You can also use the @code{:grouptags} keyword directly when setting@var{org-tag-alist}, see the documentation of that variable.@kindex C-c C-x q@vindex org-group-tagsIf you want to ignore group tags temporarily, toggle group tags supportwith @command{org-toggle-tags-groups}, bound to @kbd{C-c C-x q}.  If youwant to disable tag groups completely, set @var{org-group-tags} to nil.@node Tag searches,  , Tag groups, Tags@section Tag searchesOnce a system of tags has been set up, it can be used to collect relatedinformation into special lists.@table @kbd@item C-c \@itemx C-c / mCreate a sparse tree with all headlines matching a tags search.  With a@kbd{C-u} prefix argument, ignore headlines that are not a TODO line.@item C-c a mCreate a global list of tag matches from all agenda files.@xref{Matching tags and properties}.@item C-c a MCreate a global list of tag matches from all agenda files, but checkonly TODO items and force checking subitems (see variable@code{org-tags-match-list-sublevels}).@end tableThese commands all prompt for a match string which allows basic Boolean logiclike @samp{+boss+urgent-project1}, to find entries with tags @samp{boss} and@samp{urgent}, but not @samp{project1}, or @samp{Kathy|Sally} to find entrieswhich are tagged, like @samp{Kathy} or @samp{Sally}.  The full syntax of thesearch string is rich and allows also matching against TODO keywords, entrylevels and properties.  For a complete description with many examples, see@ref{Matching tags and properties}.@seealso{@uref{http://orgmode.org/manual/Tags.html#Tags, Chapter 6 of the manual}@*@uref{http://sachachua.com/wp/2008/01/tagging-in-org-plus-bonus-code-for-timeclocks-and-tags/,Sacha Chua's article about tagging in Org-mode}}@node Properties, Dates and Times, Tags, Top@chapter PropertiesProperties are key-value pairs associated with an entry.  They live in aspecial drawer with the name @code{PROPERTIES}.  Eachproperty is specified on a single line, with the key (surrounded by colons)first, and the value after it:@smallexample* CD collection** Classic*** Goldberg Variations    :PROPERTIES:    :Title:     Goldberg Variations    :Composer:  J.S. Bach    :Publisher: Deutsche Grammophon    :NDisks:    1    :END:@end smallexampleYou may define the allowed values for a particular property @samp{:Xyz:}by setting a property @samp{:Xyz_ALL:}.  This special property is@emph{inherited}, so if you set it in a level 1 entry, it will apply tothe entire tree.  When allowed values are defined, setting thecorresponding property becomes easier and is less prone to typingerrors.  For the example with the CD collection, we can predefinepublishers and the number of disks in a box like this:@smallexample* CD collection  :PROPERTIES:  :NDisks_ALL:  1 2 3 4  :Publisher_ALL: "Deutsche Grammophon" Philips EMI  :END:@end smallexampleor globally using @code{org-global-properties}, or file-wide like this:@smallexample#+PROPERTY: NDisks_ALL 1 2 3 4@end smallexample@table @kbd@item C-c C-x pSet a property.  This prompts for a property name and a value.@item C-c C-c dRemove a property from the current entry.@end tableTo create sparse trees and special lists with selection based on properties,the same commands are used as for tag searches (@pxref{Tag searches}).  Thesyntax for the search string is described in @ref{Matching tags andproperties}.@table @kbd@end table@seealso{@uref{http://orgmode.org/manual/Properties-and-Columns.html#Properties-and-Columns,Chapter 7 of the manual}@*@uref{http://orgmode.org/worg/org-tutorials/org-column-view-tutorial.php,BastienGuerry's column view tutorial}}@node Dates and Times, Capture - Refile - Archive, Properties, Top@chapter Dates and TimesTo assist project planning, TODO items can be labeled with a date and/ora time.  The specially formatted string carrying the date and timeinformation is called a @emph{timestamp} in Org mode.@menu* Timestamps::			Assigning a time to a tree entry* Creating timestamps::		Commands which insert timestamps* Deadlines and scheduling::	Planning your work* Clocking work time::		Tracking how long you spend on a task@end menu@node Timestamps, Creating timestamps, Dates and Times, Dates and Times@section TimestampsA timestamp is a specification of a date (possibly with a time or a range oftimes) in a special format, either @samp{<2003-09-16 Tue>} or@samp{<2003-09-16 Tue 09:39>} or @samp{<2003-09-16 Tue 12:00-12:30>}.  Atimestamp can appear anywhere in the headline or body of an Org tree entry.Its presence causes entries to be shown on specific dates in the agenda(@pxref{Weekly/daily agenda}).  We distinguish:@noindent @b{Plain timestamp; Event; Appointment}@*A simple timestamp just assigns a date/time to an item.  This is justlike writing down an appointment or event in a paper agenda.@smallexample* Meet Peter at the movies  <2006-11-01 Wed 19:15>* Discussion on climate change  <2006-11-02 Thu 20:00-22:00>@end smallexample@noindent @b{Timestamp with repeater interval}@*A timestamp may contain a @emph{repeater interval}, indicating that itapplies not only on the given date, but again and again after a certaininterval of N days (d), weeks (w), months (m), or years (y).  Thefollowing will show up in the agenda every Wednesday:@smallexample* Pick up Sam at school  <2007-05-16 Wed 12:30 +1w>@end smallexample@noindent @b{Diary-style sexp entries}@*For more complex date specifications, Org mode supports using thespecial sexp diary entries implemented in the Emacs calendar/diarypackage.  For example@smallexample* The nerd meeting on every 2nd Thursday of the month  <%%(diary-float t 4 2)>@end smallexample@noindent @b{Time/Date range}@*Two timestamps connected by @samp{--} denote a range.@smallexample** Meeting in Amsterdam   <2004-08-23 Mon>--<2004-08-26 Thu>@end smallexample@noindent @b{Inactive timestamp}@*Just like a plain timestamp, but with square brackets instead ofangular ones.  These timestamps are inactive in the sense that they do@emph{not} trigger an entry to show up in the agenda.@smallexample* Gillian comes late for the fifth time  [2006-11-01 Wed]@end smallexample@node Creating timestamps, Deadlines and scheduling, Timestamps, Dates and Times@section Creating timestampsFor Org mode to recognize timestamps, they need to be in the specificformat.  All commands listed below produce timestamps in the correctformat.@table @kbd@item C-c .Prompt for a date and insert a corresponding timestamp.  When the cursor isat an existing timestamp in the buffer, the command is used to modify thistimestamp instead of inserting a new one.  When this command is used twice insuccession, a time range is inserted.  With a prefix, also add the currenttime. @c@item C-c !Like @kbd{C-c .}, but insert an inactive timestamp that will not causean agenda entry.@c@item S-@key{left}@r{/}@key{right}Change date at cursor by one day.@c@item S-@key{up}@r{/}@key{down}Change the item under the cursor in a timestamp.  The cursor can be on ayear, month, day, hour or minute.  When the timestamp contains a time rangelike @samp{15:30-16:30}, modifying the first time will also shift the second,shifting the time block with constant length.  To change the length, modifythe second time.@end tableWhen Org mode prompts for a date/time, it will accept any string containingsome date and/or time information, and intelligently interpret the string,deriving defaults for unspecified information from the current date and time.You can also select a date in the pop-up calendar.  See the manual for moreinformation on how exactly the date/time prompt works.@node Deadlines and scheduling, Clocking work time, Creating timestamps, Dates and Times@section Deadlines and schedulingA timestamp may be preceded by special keywords to facilitate planning:@noindent @b{DEADLINE}@*Meaning: the task (most likely a TODO item, though not necessarily) is supposedto be finished on that date.@table @kbd@item C-c C-dInsert @samp{DEADLINE} keyword along with a stamp, in the line following theheadline.@end tableOn the deadline date, the task will be listed in the agenda.  Inaddition, the agenda for @emph{today} will carry a warning about theapproaching or missed deadline, starting@code{org-deadline-warning-days} before the due date, and continuinguntil the entry is marked DONE.  An example:@smallexample*** TODO write article about the Earth for the Guide    The editor in charge is [[bbdb:Ford Prefect]]    DEADLINE: <2004-02-29 Sun>@end smallexample@noindent @b{SCHEDULED}@*Meaning: you are @i{planning to start working} on that task on the givendate@footnote{This is quite different from what is normally understood by@i{scheduling a meeting}, which is done in Org-mode by just inserting a timestamp without keyword.}.@table @kbd@item C-c C-sInsert @samp{SCHEDULED} keyword along with a stamp, in the line following theheadline.@end tableThe headline will be listed under the given date@footnote{It will stillbe listed on that date after it has been marked DONE.  If you don't likethis, set the variable @code{org-agenda-skip-scheduled-if-done}.}.  Inaddition, a reminder that the scheduled date has passed will be presentin the compilation for @emph{today}, until the entry is marked DONE.I.e.@: the task will automatically be forwarded until completed.@smallexample*** TODO Call Trillian for a date on New Years Eve.    SCHEDULED: <2004-12-25 Sat>@end smallexampleSome tasks need to be repeated again and again.  Org mode helps toorganize such tasks using a so-called repeater in a DEADLINE, SCHEDULED,or plain timestamp.  In the following example@smallexample** TODO Pay the rent   DEADLINE: <2005-10-01 Sat +1m>@end smallexample@noindentthe @code{+1m} is a repeater; the intended interpretation is that the taskhas a deadline on <2005-10-01> and repeats itself every (one) month startingfrom that time.@node Clocking work time,  , Deadlines and scheduling, Dates and Times@section Clocking work timeOrg mode allows you to clock the time you spend on specific tasks in aproject.@table @kbd@item C-c C-x C-iStart the clock on the current item (clock-in).  This inserts the CLOCKkeyword together with a timestamp.  When called with a @kbd{C-u} prefixargument, select the task from a list of recently clocked tasks.@c@item C-c C-x C-oStop the clock (clock-out).  This inserts another timestamp at the samelocation where the clock was last started.  It also directly computesthe resulting time in inserts it after the time range as @samp{=>HH:MM}.@item C-c C-x C-eUpdate the effort estimate for the current clock task.@item C-c C-x C-xCancel the current clock.  This is useful if a clock was started bymistake, or if you ended up working on something else.@item C-c C-x C-jJump to the entry that contains the currently running clock.  With a@kbd{C-u} prefix arg, select the target task from a list of recently clockedtasks.@item C-c C-x C-rInsert a dynamic block containing a clockreport as an Org-mode table into the current file.  When the cursor isat an existing clock table, just update it.@smallexample#+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file#+END: clocktable@end smallexample@noindentFor details about how to customize this view, see @uref{http://orgmode.org/manual/Clocking-work-time.html#Clocking-work-time,the manual}.@item C-c C-cUpdate dynamic block at point.  The cursor needs to be in the@code{#+BEGIN} line of the dynamic block.@end tableThe @kbd{l} key may be used in the timeline (@pxref{Timeline}) and inthe agenda (@pxref{Weekly/daily agenda}) to show which tasks have beenworked on or closed during a day.@seealso{@uref{http://orgmode.org/manual/Dates-and-Times.html#Dates-and-Times,Chapter 8 of the manual}@*@uref{http://members.optusnet.com.au/~charles57/GTD/org_dates/, CharlesCave's Date and Time tutorial}@*@uref{http://doc.norang.ca/org-mode.html#Clocking, Bernt Hansen's clocking workflow}}@node Capture - Refile - Archive, Agenda Views, Dates and Times, Top@chapter Capture - Refile - ArchiveAn important part of any organization system is the ability to quicklycapture new ideas and tasks, and to associate reference material with them.Org defines a capture process to create tasks.  Once in the system, tasks andprojects need to be moved around.  Moving completed project trees to anarchive file keeps the system compact and fast.@menu* Capture::			Capturing new stuff* Refile and copy::		Moving a tree from one place to another* Archiving::			What to do with finished projects@end menu@node Capture, Refile and copy, Capture - Refile - Archive, Capture - Refile - Archive@section CaptureOrg's lets you store quick notes with little interruption of your work flow.You can define templates for new entries and associate them with differenttargets for storing notes.@menu* Setting up a capture location::  Where notes will be stored* Using capture::		Commands to invoke and terminate capture* Capture templates::		Define the outline of different note types@end menu@node Setting up a capture location, Using capture, Capture, Capture@unnumberedsubsec Setting up a capture locationThe following customization sets a default target@footnote{Using capturetemplates, you get finer control over capture locations, see@ref{Capture templates}.} file for notes, and defines a globalkey for capturing new stuff.@example(setq org-default-notes-file (concat org-directory "/notes.org"))(define-key global-map "\C-cc" 'org-capture)@end example@node Using capture, Capture templates, Setting up a capture location, Capture@unnumberedsubsec Using capture@table @kbd@item C-c cStart a capture process, placing you into a narrowed indirect buffer to edit.@item C-c C-cOnce you are done entering information into the capture buffer, @kbd{C-c C-c} will return you to the window configuration before the captureprocess, so that you can resume your work without further distraction.@item C-c C-wFinalize by moving the entry to a refile location (see section 9.2).@item C-c C-kAbort the capture process and return to the previous state.@end table@node Capture templates,  , Using capture, Capture@unnumberedsubsec Capture templatesYou can use templates to generate different types of capture notes, and tostore them in different places.  For example, if you would liketo store new tasks under a heading @samp{Tasks} in file @file{TODO.org}, andjournal entries in a date tree in @file{journal.org} you coulduse:@smallexample(setq org-capture-templates '(("t" "Todo" entry (file+headline "~/org/gtd.org" "Tasks")        "* TODO %?\n  %i\n  %a")   ("j" "Journal" entry (file+datetree "~/org/journal.org")        "* %?\nEntered on %U\n  %i\n  %a")))@end smallexample@noindent In these entries, the first string is the key to reach thetemplate, the second is a short description.  Then follows the type of theentry and a definition of the target location for storing the note.  Finally,the template itself, a string with %-escapes to fill in information based ontime and context.When you call @kbd{M-x org-capture}, Org will prompt for a key to select thetemplate (if you have more than one template) and then prepare the buffer like@smallexample* TODO  [[file:@var{link to where you were when initiating capture}]]@end smallexample@noindentDuring expansion of the template, special @kbd{%}-escapes@footnote{If youneed one of these sequences literally, escape the @kbd{%} with a backslash.}allow dynamic insertion of content.  Here is a small selection of thepossibilities, consult the manual for more.@smallexample%a          @r{annotation, normally the link created with @code{org-store-link}}%i          @r{initial content, the region when capture is called with C-u.}%t, %T      @r{timestamp, date only, or date and time}%u, %U      @r{like above, but inactive timestamps}@end smallexample@node Refile and copy, Archiving, Capture, Capture - Refile - Archive@section Refile and copyWhen reviewing the captured data, you may want to refile or copy some of theentries into a different list, for example into a project.  Cutting, findingthe right location, and then pasting the note is cumbersome.  To simplifythis process, use the following commands:@table @kbd@item C-c M-xCopy the entry or region at point.  This command behaves like@code{org-refile}, except that the original note will not be deleted.@item C-c C-wRefile the entry or region at point.  This command offers possible locationsfor refiling the entry and lets you select one with completion.  The item (orall items in the region) is filed below the target heading as a subitem.@*By default, all level 1 headlines in the current buffer are considered to betargets, but you can have more complex definitions across a number of files.See the variable @code{org-refile-targets} for details.@item C-u C-c C-wUse the refile interface to jump to a heading.@item C-u C-u C-c C-wJump to the location where @code{org-refile} last moved a tree to.@end table@node Archiving,  , Refile and copy, Capture - Refile - Archive@section ArchivingWhen a project represented by a (sub)tree is finished, you may wantto move the tree out of the way and to stop it from contributing to theagenda.  Archiving is important to keep your working files compact and globalsearches like the construction of agenda views fast.The most common archiving action is to move a project tree to another file,the archive file.@table @kbd@item C-c C-x C-aArchive the current entry using @code{org-archive-default-command}.@item C-c C-x C-s@ @r{or short} @ C-c $Archive the subtree starting at the cursor position to the locationgiven by @code{org-archive-location}.@end tableThe default archive location is a file in the same directory as thecurrent file, with the name derived by appending @file{_archive} to thecurrent file name.  For information and examples on how to change this,see the documentation string of the variable@code{org-archive-location}.  There is also an in-buffer option forsetting this variable, for example@smallexample#+ARCHIVE: %s_done::@end smallexample@seealso{@uref{http://orgmode.org/manual/Capture-_002d-Refile-_002d-Archive.html#Capture-_002d-Refile-_002d-Archive,Chapter 9 of the manual}@*@uref{http://orgmode.org/worg/org-tutorials/org-protocol-custom-handler.php,Sebastian Rose's tutorial for capturing from a web browser}}@uref{}@*@node Agenda Views, Markup, Capture - Refile - Archive, Top@chapter Agenda ViewsDue to the way Org works, TODO items, time-stamped items, and taggedheadlines can be scattered throughout a file or even a number of files.  Toget an overview of open action items, or of events that are important for aparticular date, this information must be collected, sorted and displayed inan organized way.  There are several different views, see below.The extracted information is displayed in a special @emph{agenda buffer}.This buffer is read-only, but provides commands to visit the correspondinglocations in the original Org files, and even to edit these files remotely.Remote editing from the agenda buffer means, for example, that you canchange the dates of deadlines and appointments from the agenda buffer.The commands available in the Agenda buffer are listed in @ref{Agendacommands}.@menu* Agenda files::		Files being searched for agenda information* Agenda dispatcher::		Keyboard access to agenda views* Built-in agenda views::	What is available out of the box?* Agenda commands::		Remote editing of Org trees* Custom agenda views::		Defining special searches and views@end menu@node Agenda files, Agenda dispatcher, Agenda Views, Agenda Views@section Agenda filesThe information to be shown is normally collected from all @emph{agendafiles}, the files listed in the variable@code{org-agenda-files}.@table @kbd@item C-c [Add current file to the list of agenda files.  The file is added tothe front of the list.  If it was already in the list, it is moved tothe front.  With a prefix argument, file is added/moved to the end.@item C-c ]Remove current file from the list of agenda files.@item C-,Cycle through agenda file list, visiting one file after the other.@end table@node Agenda dispatcher, Built-in agenda views, Agenda files, Agenda Views@section The agenda dispatcherThe views are created through a dispatcher, which should be bound to aglobal key---for example @kbd{C-c a} (@pxref{Installation}).  Afterpressing @kbd{C-c a}, an additional letter is required to execute acommand:@table @kbd@item aThe calendar-like agenda (@pxref{Weekly/daily agenda}).@item t @r{/} TA list of all TODO items (@pxref{Global TODO list}).@item m @r{/} MA list of headlines matching a TAGS expression (@pxref{Matchingtags and properties}).@item LThe timeline view for the current buffer (@pxref{Timeline}).@item sA list of entries selected by a boolean expression of keywordsand/or regular expressions that must or must not occur in the entry.@end table@node Built-in agenda views, Agenda commands, Agenda dispatcher, Agenda Views@section The built-in agenda views@menu* Weekly/daily agenda::		The calendar page with current tasks* Global TODO list::		All unfinished action items* Matching tags and properties::  Structured information with fine-tuned search* Timeline::			Time-sorted view for single file* Search view::			Find entries by searching for text@end menu@node Weekly/daily agenda, Global TODO list, Built-in agenda views, Built-in agenda views@subsection The weekly/daily agendaThe purpose of the weekly/daily @emph{agenda} is to act like a page of apaper agenda, showing all the tasks for the current week or day.@table @kbd@item C-c a aCompile an agenda for the current week from a list of Org files.  The agendashows the entries for each day.@end tableEmacs contains the calendar and diary by Edward M. Reingold.  Org-modeunderstands the syntax of the diary and allows you to use diary sexp entriesdirectly in Org files:@smallexample* Birthdays and similar stuff#+CATEGORY: Holiday%%(org-calendar-holiday)   ; special function for holiday names#+CATEGORY: Ann%%(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%%(diary-anniversary 10  2 1869) Mahatma Gandhi would be %d years old@end smallexampleOrg can interact with Emacs appointments notification facility.  To add allthe appointments of your agenda files, use the command@code{org-agenda-to-appt}.  See the docstring for details.@node Global TODO list, Matching tags and properties, Weekly/daily agenda, Built-in agenda views@subsection The global TODO listThe global TODO list contains all unfinished TODO items formatted andcollected into a single place.  Remote editing of TODO items lets youcan change the state of a TODO entry with a single key press.  The commandsavailable in the TODO list are described in @ref{Agenda commands}.@table @kbd@item C-c a tShow the global TODO list.  This collects the TODO items from allagenda files (@pxref{Agenda Views}) into a single buffer.@item C-c a TLike the above, but allows selection of a specific TODO keyword. @end table@node Matching tags and properties, Timeline, Global TODO list, Built-in agenda views@subsection Matching tags and propertiesIf headlines in the agenda files are marked with @emph{tags} (@pxref{Tags}),or have properties (@pxref{Properties}), you can select headlinesbased on this metadata and collect them into an agenda buffer.  The matchsyntax described here also applies when creating sparse trees with @kbd{C-c /m}.  The commands available in the tags list are described in @ref{Agendacommands}.@table @kbd@item C-c a mProduce a list of all headlines that match a given set of tags.  Thecommand prompts for a selection criterion, which is a boolean logicexpression with tags, like @samp{+work+urgent-withboss} or@samp{work|home} (@pxref{Tags}).  If you often need a specific search,define a custom command for it (@pxref{Agenda dispatcher}).@item C-c a MLike @kbd{C-c a m}, but only select headlines that are also TODO items.@end table@subsubheading Match syntaxA search string can use Boolean operators @samp{&} for AND and @samp{|} forOR.  @samp{&} binds more strongly than @samp{|}.  Parentheses are currentlynot implemented.  Each element in the search is either a tag, a regularexpression matching tags, or an expression like @code{PROPERTY OPERATORVALUE} with a comparison operator, accessing a property value.  Each elementmay be preceded by @samp{-}, to select against it, and @samp{+} is syntacticsugar for positive selection.  The AND operator @samp{&} is optional when@samp{+} or @samp{-} is present.  Here are some examples, using only tags.@table @samp@item +work-bossSelect headlines tagged @samp{:work:}, but discard those also tagged@samp{:boss:}.@item work|laptopSelects lines tagged @samp{:work:} or @samp{:laptop:}.@item work|laptop+nightLike before, but require the @samp{:laptop:} lines to be tagged also@samp{:night:}.@end tableYou may also test for properties at the sametime as matching tags, see the manual for more information.@node Timeline, Search view, Matching tags and properties, Built-in agenda views@subsection Timeline for a single fileThe timeline summarizes all time-stamped items from a single Org modefile in a @emph{time-sorted view}.  The main purpose of this command isto give an overview over events in a project.@table @kbd@item C-c a LShow a time-sorted view of the Org file, with all time-stamped items.When called with a @kbd{C-u} prefix, all unfinished TODO entries(scheduled or not) are also listed under the current date.@end table@node Search view,  , Timeline, Built-in agenda views@subsection Search viewThis agenda view is a general text search facility for Org mode entries.It is particularly useful to find notes.@table @kbd@item C-c a sThis is a special search that lets you select entries by matching a substringor specific words using a boolean logic.@end tableFor example, the search string @samp{computer equipment} will find entriesthat contain @samp{computer equipment} as a substring. Search view can also search for specific keywords in the entry, using Booleanlogic.  The search string @samp{+computer +wifi -ethernet -@{8\.11[bg]@}}will search for note entries that contain the keywords @code{computer}and @code{wifi}, but not the keyword @code{ethernet}, and which are alsonot matched by the regular expression @code{8\.11[bg]}, meaning toexclude both 8.11b and 8.11g. Note that in addition to the agenda files, this command will also searchthe files listed in @code{org-agenda-text-search-extra-files}.@node Agenda commands, Custom agenda views, Built-in agenda views, Agenda Views@section Commands in the agenda bufferEntries in the agenda buffer are linked back to the Org file or diaryfile where they originate.  Commands are provided to show and jump to theoriginal entry location, and to edit the Org files ``remotely'' fromthe agenda buffer.  This is just a selection of the many commands, explorethe @code{Agenda} menu and the manual for a complete list.@table @kbd@tsubheading{Motion}@item nNext line (same as @key{up} and @kbd{C-p}).@item pPrevious line (same as @key{down} and @kbd{C-n}).@tsubheading{View/Go to Org file}@item mouse-3@itemx @key{SPC}Display the original location of the item in another window.With prefix arg, make sure that the entire entry is made visible in theoutline, not only the heading.@c@itemx @key{TAB}Go to the original location of the item in another window.  Under Emacs22, @kbd{mouse-1} will also work for this.@c@itemx @key{RET}Go to the original location of the item and delete other windows.@c@tsubheading{Change display}@item oDelete other windows.@c@item d @r{/} wSwitch to day/week view. @c@item f @r{and} bGo forward/backward in time to display the following@code{org-agenda-current-span} days.  For example, if the display covers aweek, switch to the following/previous week.@c@item .Go to today.@c@item jPrompt for a date and go there.@c@item v l @ @r{or short} @ lToggle Logbook mode.  In Logbook mode, entries that were marked DONE whilelogging was on (variable @code{org-log-done}) are shown in the agenda, as areentries that have been clocked on that day.  When called with a @kbd{C-u}prefix, show all possible logbook entries, including state changes.@c@item r @r{or} gRecreate the agenda buffer, to reflect the changes.@item sSave all Org buffers in the current Emacs session, and also the locations ofIDs.@tsubheading{Secondary filtering and query editing}@item /Filter the current agenda view with respect to a tag.  You are prompted for aletter to select a tag.  Press @samp{-} first to select against the tag.@item \Narrow the current agenda filter by an additional condition.@tsubheading{Remote editing (see the manual for many more commands)}@item 0--9Digit argument.@c@item tChange the TODO state of the item, in the agenda and in theorg file.@c@item C-kDelete the current agenda item along with the entire subtree belongingto it in the original Org file.@c@item C-c C-wRefile the entry at point.@c@item C-c C-x C-a @ @r{or short} @ aArchive the subtree corresponding to the entry at point using the defaultarchiving command set in @code{org-archive-default-command}.@c@item C-c C-x C-s @ @r{or short} @ $Archive the subtree corresponding to the current headline.@c@item C-c C-sSchedule this item, with prefix arg remove the scheduling timestamp@c@item C-c C-dSet a deadline for this item, with prefix arg remove the deadline.@c@item S-@key{right} @r{and} S-@key{left}Change the timestamp associated with the current line by one day.@c@item IStart the clock on the current item.@c@item O / XStop/cancel the previously started clock.@item JJump to the running clock in another window.@end table@node Custom agenda views,  , Agenda commands, Agenda Views@section Custom agenda viewsThe main application of custom searches is the definition of keyboardshortcuts for frequently used searches, either creating an agendabuffer, or a sparse tree (the latter covering of course only the currentbuffer).Custom commands are configured in the variable@code{org-agenda-custom-commands}.  You can customize this variable, forexample by pressing @kbd{C-c a C}.  You can also directly set it withEmacs Lisp in @file{.emacs}.  The following example contains all validsearch types:@smalllisp@group(setq org-agenda-custom-commands      '(("w" todo "WAITING")        ("u" tags "+boss-urgent")        ("v" tags-todo "+boss-urgent")))@end group@end smalllisp@noindentThe initial string in each entry defines the keys you have to press after thedispatcher command @kbd{C-c a} in order to access the command.  Usually thiswill be just a single character.  The second parameter is the search type,followed by the string or regular expression to be used for the matching.The example above will therefore define:@table @kbd@item C-c a was a global search for TODO entries with @samp{WAITING} as the TODOkeyword@item C-c a uas a global tags search for headlines marked @samp{:boss:} but not@samp{:urgent:}@item C-c a vas the same search as @kbd{C-c a u}, but limiting the search toheadlines that are also TODO items@end table@seealso{@uref{http://orgmode.org/manual/Agenda-Views.html#Agenda-Views, Chapter 10 ofthe manual}@*@uref{http://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.php,Mat Lundin's tutorial about custom agenda commands}@*@uref{http://www.newartisans.com/2007/08/using-org-mode-as-a-day-planner.html,John Wiegley's setup}}@node Markup, Exporting, Agenda Views, Top@chapter Markup for rich exportWhen exporting Org-mode documents, the exporter tries to reflect thestructure of the document as accurately as possible in the backend.  Sinceexport targets like HTML, @LaTeX{}, or DocBook allow much richer formatting,Org mode has rules on how to prepare text for rich export.  This sectionsummarizes the markup rules used in an Org-mode buffer.@menu* Structural markup elements::	The basic structure as seen by the exporter* Images and tables::		Images, tables and caption mechanism* Literal examples::		Source code examples with special formatting* Include files::		Include additional files into a document* Embedded @LaTeX{}::		@LaTeX{} can be freely used inside Org documents@end menu@node Structural markup elements, Images and tables, Markup, Markup@section Structural markup elements@menu* Document title::		Where the title is taken from* Headings and sections::	The document structure as seen by the exporter* Table of contents::		The if and where of the table of contents* Paragraphs::			Paragraphs* Emphasis and monospace::	Bold, italic, etc.* Comment lines::		What will *not* be exported@end menu@node Document title, Headings and sections, Structural markup elements, Structural markup elements@subheading Document title@noindentThe title of the exported document is taken from the special line@smallexample#+TITLE: This is the title of the document@end smallexample@node Headings and sections, Table of contents, Document title, Structural markup elements@subheading Headings and sectionsThe outline structure of the document as described in @ref{DocumentStructure}, forms the basis for defining sections of the exported document.However, since the outline structure is also used for (for example) lists oftasks, only the first three outline levels will be used as headings.  Deeperlevels will become itemized lists.  You can change the location of thisswitch globally by setting the variable @code{org-export-headline-levels}, or on aper-file basis with a line@smallexample#+OPTIONS: H:4@end smallexample@node Table of contents, Paragraphs, Headings and sections, Structural markup elements@subheading Table of contentsThe table of contents is normally inserted directly before the first headlineof the file.@smallexample#+OPTIONS: toc:2          (only to two levels in TOC)#+OPTIONS: toc:nil        (no TOC at all)@end smallexample@node Paragraphs, Emphasis and monospace, Table of contents, Structural markup elements@subheading Paragraphs, line breaks, and quotingParagraphs are separated by at least one empty line.  If you need to enforcea line break within a paragraph, use @samp{\\} at the end of a line.To keep the line breaks in a region, but otherwise use normal formatting, youcan use this construct, which can also be used to format poetry.@smallexample#+BEGIN_VERSE Great clouds overhead Tiny black birds rise and fall Snow covers Emacs     -- AlexSchroeder#+END_VERSE@end smallexampleWhen quoting a passage from another document, it is customary to format thisas a paragraph that is indented on both the left and the right margin.  Youcan include quotations in Org-mode documents like this:@smallexample#+BEGIN_QUOTEEverything should be made as simple as possible,but not any simpler -- Albert Einstein#+END_QUOTE@end smallexampleIf you would like to center some text, do it like this:@smallexample#+BEGIN_CENTEREverything should be made as simple as possible, \\but not any simpler#+END_CENTER@end smallexample@node Emphasis and monospace, Comment lines, Paragraphs, Structural markup elements@subheading Emphasis and monospaceYou can make words @b{*bold*}, @i{/italic/}, _underlined_, @code{=code=}and @code{~verbatim~}, and, if you must, @samp{+strike-through+}.  Textin the code and verbatim string is not processed for Org-mode specificsyntax, it is exported verbatim.  To insert a horizontal rules, use a line consisting of only dashes, and at least 5 of them.@node Comment lines,  , Emphasis and monospace, Structural markup elements@subheading Comment linesLines starting with zero or more whitespace characters followed by @samp{#}and a whitespace are treated as comments and will never be exported.  Alsoentire subtrees starting with the word @samp{COMMENT} will never be exported.Finally, regions surrounded by @samp{#+BEGIN_COMMENT}... @samp{#+END_COMMENT} will not be exported.@table @kbd@item C-c ;Toggle the COMMENT keyword at the beginning of an entry.@end table@node Images and tables, Literal examples, Structural markup elements, Markup@section Images and TablesFor Org mode tables, the lines before the first horizontal separator linewill become table header lines.  You can use the following lines somewherebefore the table to assign a caption and a label for cross references, and inthe text you can refer to the object with @code{[[tab:basic-data]]}:@smallexample#+CAPTION: This is the caption for the next table (or link)#+NAME:   tbl:basic-data   | ... | ...|   |-----|----|@end smallexampleSome backends allow you to directly include images into the exporteddocument.  Org does this, if a link to an image files does not havea description part, for example @code{[[./img/a.jpg]]}.  If you wish todefine a caption for the image and maybe a label for internal crossreferences, you sure that the link is on a line by itself precede it with:@smallexample#+CAPTION: This is the caption for the next figure link (or table)#+NAME:   fig:SED-HR4049[[./img/a.jpg]]@end smallexampleThe same caption mechanism applies to other structures than images and tables(e.g., @LaTeX{} equations, source code blocks), provided the chosen exportback-end supports them.@node Literal examples, Include files, Images and tables, Markup@section Literal examplesYou can include literal examples that should not be subjected tomarkup.  Such examples will be typeset in monospace, so this is well suitedfor source code and similar examples.@smallexample#+BEGIN_EXAMPLESome example from a text file.#+END_EXAMPLE@end smallexampleFor simplicity when using small examples, you can also start the examplelines with a colon followed by a space.  There may also be additionalwhitespace before the colon:@smallexampleHere is an example   : Some example from a text file.@end smallexampleFor source code from a programming language, or any other textthat can be marked up by font-lock in Emacs, you can ask for it tolook like the fontified Emacs buffer@smallexample#+BEGIN_SRC emacs-lisp(defun org-xor (a b)   "Exclusive or."   (if a (not b) b))#+END_SRC@end smallexampleTo edit the example in a special buffer supporting this language, use@kbd{C-c '} to both enter and leave the editing buffer.@node Include files, Embedded @LaTeX{}, Literal examples, Markup@section Include filesDuring export, you can include the content of another file.  For example, toinclude your @file{.emacs} file, you could use:@smallexample#+INCLUDE: "~/.emacs" src emacs-lisp@end smallexample@noindentThe optional second and third parameter are the markup (e.g.@: @samp{quote},@samp{example}, or @samp{src}), and, if the markup is @samp{src}, thelanguage for formatting the contents.  The markup is optional, if it is notgiven, the text will be assumed to be in Org mode format and will beprocessed normally. @kbd{C-c '} will visit the included file.@node Embedded @LaTeX{},  , Include files, Markup@section Embedded @LaTeX{}For scientific notes which need to be able to contain mathematical symbolsand the occasional formula, Org-mode supports embedding @LaTeX{} code intoits files.  You can directly use TeX-like syntax for special symbols, enterformulas and entire @LaTeX{} environments.@smallexampleAngles are written as Greek letters \alpha, \beta and \gamma.  The mass ifthe sun is M_sun = 1.989 x 10^30 kg.  The radius of the sun is R_@{sun@} =6.96 x 10^8 m.  If $a^2=b$ and $b=2$, then the solution must be either$a=+\sqrt@{2@}$ or $a=-\sqrt@{2@}$.\begin@{equation@}x=\sqrt@{b@}\end@{equation@}@end smallexample@noindent  With@uref{http://orgmode.org/manual/LaTeX-fragments.html#LaTeX-fragments,specialsetup}, @LaTeX{} snippets will be included as images when exporting to HTML.@seealso{@uref{http://orgmode.org/manual/Markup.html#Markup, Chapter 11 of the manual}}@node Exporting, Publishing, Markup, Top@chapter ExportingOrg-mode documents can be exported into a variety of other formats: ASCIIexport for inclusion into emails, HTML to publish on the web, @LaTeX{}/PDFfor beautiful printed documents and DocBook to enter the world of many otherformats using DocBook tools.  There is also export to iCalendar format sothat planning information can be incorporated into desktop calendars.@menu* Export options::		Per-file export settings* The export dispatcher::	How to access exporter commands* ASCII/Latin-1/UTF-8 export::	Exporting to flat files with encoding* HTML export::			Exporting to HTML* @LaTeX{} and PDF export::	Exporting to @LaTeX{}, and processing to PDF* iCalendar export::            Exporting to iCalendar@end menu@node Export options, The export dispatcher, Exporting, Exporting@section Export optionsThe exporter recognizes special lines in the buffer which provideadditional information.  These lines may be put anywhere in the file.The whole set of lines can be inserted into the buffer with @kbd{C-cC-e t}.@table @kbd@item C-c C-e tInsert template with export options, see example below.@end table@smallexample#+TITLE:       the title to be shown (default is the buffer name)#+AUTHOR:      the author (default taken from @code{user-full-name})#+DATE:        a date, fixed, or an Org timestamp#+EMAIL:       his/her email address (default from @code{user-mail-address})#+DESCRIPTION: the page description, e.g.@: for the XHTML meta tag#+KEYWORDS:    the page keywords, e.g.@: for the XHTML meta tag#+LANGUAGE:    language for HTML, e.g.@: @samp{en} (@code{org-export-default-language})#+OPTIONS:     H:2 num:t toc:t \n:nil ::t |:t ^:t f:t tex:t ...@end smallexample@node The export dispatcher, ASCII/Latin-1/UTF-8 export, Export options, Exporting@section The export dispatcherAll export commands can be reached using the export dispatcher, which isa prefix key that prompts for an additional key specifying the command.Normally the entire file is exported, but if a region is active, it will beexported instead.@table @kbd@item C-c C-eDispatcher for export and publishing commands.@end table@node ASCII/Latin-1/UTF-8 export, HTML export, The export dispatcher, Exporting@section ASCII/Latin-1/UTF-8 exportASCII export produces a simple and very readable version of an Org-modefile, containing only plain ASCII.  Latin-1 and UTF-8 export augment the filewith special characters and symbols available in these encodings.@table @kbd@item C-c C-e t a @ @ @r{and} @ @ C-c C-e t AExport as ASCII file or temporary buffer.@item C-c C-e t n @ @ @r{and} @ @ C-c C-e t NLike the above commands, but use Latin-1 encoding.@item C-c C-e t u @ @ @r{and} @ @ C-c C-e t ULike the above commands, but use UTF-8 encoding.@end table@node HTML export, @LaTeX{} and PDF export, ASCII/Latin-1/UTF-8 export, Exporting@section HTML export@table @kbd@item C-c C-e h hExport as HTML file @file{myfile.html}.@item C-c C-e h oExport as HTML file and immediately open it with a browser.@end tableTo insert HTML that should be copied verbatim tothe exported file use either@smallexample#+HTML: Literal HTML code for export@end smallexample@noindent or@smallexample#+BEGIN_HTMLAll lines between these markers are exported literally#+END_HTML@end smallexample@node @LaTeX{} and PDF export, iCalendar export, HTML export, Exporting@section @LaTeX{} and PDF export@table @kbd@item C-c C-e l lExport as @LaTeX{} file @file{myfile.tex}.@item C-c C-e l pExport as @LaTeX{} and then process to PDF.@item C-c C-e l oExport as @LaTeX{} and then process to PDF, then open the resulting PDF file.@end tableBy default, the @LaTeX{} output uses the class @code{article}.  You canchange this by adding an option like @code{#+LATEX_CLASS: myclass} in yourfile.  The class must be listed in @code{org-latex-classes}.Embedded @LaTeX{} as described in @ref{Embedded @LaTeX{}}, will be correctlyinserted into the @LaTeX{} file.  Similarly to the HTML exporter, you can use@code{#+LATEX:} and @code{#+BEGIN_LATEX ... #+END_LATEX} construct to addverbatim @LaTeX{} code.@node iCalendar export,  , @LaTeX{} and PDF export, Exporting@section iCalendar export@table @kbd@item C-c C-e c fCreate iCalendar entries for the current file in a @file{.ics} file.@item C-c C-e c cCreate a single large iCalendar file from all files in@code{org-agenda-files} and write it to the file given by@code{org-icalendar-combined-agenda-file}.@end table@seealso{@uref{http://orgmode.org/manual/Exporting.html#Exporting, Chapter 12 of the manual}@*@uref{http://orgmode.org/worg/org-tutorials/images-and-xhtml-export.php,Sebastian Rose's image handling tutorial}@*@uref{http://orgmode.org/worg/org-tutorials/org-latex-export.php, ThomasDye's LaTeX export tutorial}@uref{http://orgmode.org/worg/org-tutorials/org-beamer/tutorial.php, EricFraga's BEAMER presentation tutorial}}@node Publishing, Working With Source Code, Exporting, Top@chapter PublishingOrg includes a publishing management system that allows you to configureautomatic HTML conversion of @emph{projects} composed of interlinked orgfiles.  You can also configure Org to automatically upload your exported HTMLpages and related attachments, such as images and source code files, to a webserver.  For detailed instructions about setup, see the manual.Here is an example:@smalllisp(setq org-publish-project-alist      '(("org"         :base-directory "~/org/"         :publishing-directory "~/public_html"         :section-numbers nil         :table-of-contents nil         :style "<link rel=\"stylesheet\"                href=\"../other/mystyle.css\"                type=\"text/css\"/>")))@end smalllisp@table @kbd@item C-c C-e P xPrompt for a specific project and publish all files that belong to it.@item C-c C-e P pPublish the project containing the current file.@item C-c C-e P fPublish only the current file.@item C-c C-e P aPublish every project.@end tableOrg uses timestamps to track when a file has changed.  The above functionsnormally only publish changed files.  You can override this and forcepublishing of all files by giving a prefix argument to any of the commandsabove.@seealso{@uref{http://orgmode.org/manual/Publishing.html#Publishing, Chapter 13 of themanual}@*@uref{http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.php,Sebastian Rose's publishing tutorial}@*@uref{http://orgmode.org/worg/org-tutorials/org-jekyll.php, Ian Barton'sJekyll/blogging setup}}@node Working With Source Code, Miscellaneous, Publishing, Top@chapter Working with source codeOrg-mode provides a number of features for working with source code,including editing of code blocks in their native major-mode, evaluation ofcode blocks, tangling of code blocks, and exporting code blocks and theirresults in several formats.@subheading Structure of Code BlocksThe structure of code blocks is as follows:@example#+NAME: <name>#+BEGIN_SRC <language> <switches> <header arguments>  <body>#+END_SRC@end exampleWhere @code{<name>} is a string used to name the code block,@code{<language>} specifies the language of the code block(e.g.@: @code{emacs-lisp}, @code{shell}, @code{R}, @code{python}, etc...),@code{<switches>} can be used to control export of the code block,@code{<header arguments>} can be used to control many aspects of code blockbehavior as demonstrated below, and @code{<body>} contains the actual sourcecode.@subheading Editing source codeUse @kbd{C-c '} to edit the current code block.  This brings up a languagemajor-mode edit buffer containing the body of the code block.  Saving thisbuffer will write the new contents back to the Org buffer.  Use @kbd{C-c '}again to exit the edit buffer.@subheading Evaluating code blocksUse @kbd{C-c C-c} to evaluate the current code block and insert its resultsin the Org-mode buffer.  By default, evaluation is only turned on for@code{emacs-lisp} code blocks, however support exists for evaluating blocksin many languages.  For a complete list of supported languages see themanual.  The following shows a code block and its results.@example#+BEGIN_SRC emacs-lisp  (+ 1 2 3 4)#+END_SRC#+RESULTS:: 10@end example@subheading Extracting source codeUse @kbd{C-c C-v t} to create pure source code files by extracting code fromsource blocks in the current buffer.  This is referred to as ``tangling''---aterm adopted from the literate programming community.  During ``tangling'' ofcode blocks their bodies are expanded using @code{org-babel-expand-src-block}which can expand both variable and ``noweb'' style references.  In order totangle a code block it must have a @code{:tangle} header argument, see themanual for details.@subheading Library of BabelUse @kbd{C-c C-v l} to load the code blocks from an Org-mode files into the``Library of Babel'', these blocks can then be evaluated from any Org-modebuffer.  A collection of generally useful code blocks is distributed withOrg-mode in @code{contrib/library-of-babel.org}.@subheading Header ArgumentsMany aspects of the evaluation and export of code blocks are controlledthrough header arguments.  These can be specified globally, at the filelevel, at the outline subtree level, and at the individual code block level.The following describes some of the header arguments.@table @code@item :varThe @code{:var} header argument is used to pass arguments to code blocks.The values passed to arguments can be literal values, values from org-modetables and literal example blocks, or the results of other named code blocks.@item :resultsThe @code{:results} header argument controls the @emph{collection},@emph{type}, and @emph{handling} of code block results.  Values of@code{output} or @code{value} (the default) specify how results are collectedfrom a code block's evaluation.  Values of @code{vector}, @code{scalar}@code{file} @code{raw} @code{html} @code{latex} and @code{code} specify thetype of the results of the code block which dictates how they will beincorporated into the Org-mode buffer.  Values of @code{silent},@code{replace}, @code{prepend}, and @code{append} specify handling of codeblock results, specifically if and how the results should be inserted intothe Org-mode buffer.@item :sessionA header argument of @code{:session} will cause the code block to beevaluated in a persistent interactive inferior process in Emacs.  This allowsfor persisting state between code block evaluations, and for manualinspection of the results of evaluation.@item :exportsAny combination of the @emph{code} or the @emph{results} of a block can beretained on export, this is specified by setting the @code{:results} headerargument to @code{code} @code{results} @code{none} or @code{both}.@item :tangleA header argument of @code{:tangle yes} will cause a code block's contents tobe tangled to a file named after the filename of the Org-mode buffer.  Analternate file name can be specified with @code{:tangle filename}.@item :cacheA header argument of @code{:cache yes} will cause associate a hash of theexpanded code block with the results, ensuring that code blocks are onlyre-run when their inputs have changed.@item :nowebA header argument of @code{:noweb yes} will expand ``noweb'' style referenceson evaluation and tangling.@item :fileCode blocks which output results to files (e.g.@: graphs, diagrams and figures)can accept a @code{:file filename} header argument in which case the resultsare saved to the named file, and a link to the file is inserted into theOrg-mode buffer.@end table@seealso{@uref{http://orgmode.org/manual/Literal-examples.html#Literal-examples,Chapter 11.3 of the manual}@*@uref{http://orgmode.org/worg/org-contrib/babel/index.php,The Babel site on Worg}}@node Miscellaneous, GNU Free Documentation License, Working With Source Code, Top@chapter Miscellaneous@menu* Completion::			M-TAB knows what you need* Clean view::			Getting rid of leading stars in the outline* MobileOrg::			Org-mode on the iPhone@end menu@node Completion, Clean view, Miscellaneous, Miscellaneous@section CompletionOrg supports in-buffer completion with @kbd{M-@key{TAB}}.  This type ofcompletion does not make use of the minibuffer.  You simply type a fewletters into the buffer and use the key to complete text right there.  Forexample, this command will complete @TeX{} symbols after @samp{\}, TODOkeywords at the beginning of a headline, and tags after @samp{:} in aheadline.@node Clean view, MobileOrg, Completion, Miscellaneous@section A cleaner outline viewSome people find it noisy and distracting that the Org headlines start with apotentially large number of stars, and that text below the headlines is notindented.  While this is no problem when writing a @emph{book-like} documentwhere the outline headings are really section headings, in a more@emph{list-oriented} outline, indented structure is a lot cleaner:@smallexample@group* Top level headline             |    * Top level headline** Second level                  |      * Second level*** 3rd level                    |        * 3rd levelsome text                        |          some text*** 3rd level                    |        * 3rd levelmore text                        |          more text* Another top level headline     |    * Another top level headline@end group@end smallexample@noindentIf you are using at least Emacs 23.1.50.3 and version 6.29 of Org, this kindof view can be achieved dynamically at display time using@code{org-indent-mode}, which will prepend intangible space to each line.You can turn on @code{org-indent-mode} for all files by customizing thevariable @code{org-startup-indented}, or you can turn it on for individualfiles using@smallexample#+STARTUP: indent@end smallexampleIf you want a similar effect in earlier version of Emacs and/or Org, or ifyou want the indentation to be hard space characters so that the plain textfile looks as similar as possible to the Emacs display, Org supports you byhelping to indent (with @key{TAB}) text below each headline, by hidingleading stars, and by only using levels 1, 3, etc to get two charactersindentation for each level.  To get this support in a file, use@smallexample#+STARTUP: hidestars odd@end smallexample@node MobileOrg,  , Clean view, Miscellaneous@section MobileOrg@i{MobileOrg} is the name of the mobile companion app for Org mode, currentlyavailable for iOS and for Android.  @i{MobileOrg} offers offline viewing andcapture support for an Org mode system rooted on a ``real'' computer.  Itdoes also allow you to record changes to existing entries.The @uref{http://mobileorg.ncogni.to/, iOS implementation} for the@i{iPhone/iPod Touch/iPad} series of devices, was developed by RichardMoreland. Android users should check out@uref{http://wiki.github.com/matburt/mobileorg-android/, MobileOrg Android}by Matt Jones.  The two implementations are not identical but offer similarfeatures.@seealso{@uref{http://orgmode.org/manual/Miscellaneous.html#Miscellaneous, Chapter 15of the manual}@*@uref{http://orgmode.org/manual/MobileOrg.html#MobileOrg, Appendix B of themanual}@*@uref{http://orgmode.org/orgcard.pdf,Key reference card}}@c @node GNU Free Documentation License,  , Miscellaneous, Top@c @appendix GNU Free Documentation License@c @include doclicense.texi@bye@c Local variables:@c fill-column: 77@c End:@c  LocalWords:  webdavhost pre
 |