orgguide.texi 92 KB

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