orgguide.texi 92 KB

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