orgguide.texi 97 KB

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