orgguide.texi 93 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591
  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. * Remember:: Capture new tasks/ideas with little interruption
  139. * Refiling notes:: Moving a tree from one place to another
  140. * Archiving:: What to do with finished projects
  141. Remember
  142. * Setting up Remember for Org:: Some code for .emacs to get things going
  143. * Remember templates:: Define the outline of different note types
  144. * Storing notes:: Directly get the note to where it belongs
  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 uses the @file{remember.el} package to create tasks, and stores files
  1261. related to a task (@i{attachments}) in a special directory. Once in the
  1262. system, tasks and projects need to be moved around. Moving completed project
  1263. trees to an archive file keeps the system compact and fast.
  1264. @menu
  1265. * Remember:: Capture new tasks/ideas with little interruption
  1266. * Refiling notes:: Moving a tree from one place to another
  1267. * Archiving:: What to do with finished projects
  1268. @end menu
  1269. @node Remember, Refiling notes, Capture - Refile - Archive, Capture - Refile - Archive
  1270. @section Remember
  1271. The Remember package by John Wiegley lets you store quick notes with little
  1272. interruption of your work flow. It is an excellent way to add new notes and
  1273. tasks to Org files. The @code{remember.el} package is part of Emacs 23, not
  1274. Emacs 22. See @uref{http://www.emacswiki.org/cgi-bin/wiki/RememberMode} for
  1275. more information.
  1276. Org significantly expands the possibilities of Remember: you may define
  1277. templates for different note types, and associate target files and headlines
  1278. with specific templates. It also allows you to select the location where a
  1279. note should be stored interactively, on the fly.
  1280. @menu
  1281. * Setting up Remember for Org:: Some code for .emacs to get things going
  1282. * Remember templates:: Define the outline of different note types
  1283. * Storing notes:: Directly get the note to where it belongs
  1284. @end menu
  1285. @node Setting up Remember for Org, Remember templates, Remember, Remember
  1286. @unnumberedsubsec Setting up Remember for Org
  1287. The following customization will tell Remember to use Org files as
  1288. target, and to create annotations compatible with Org links.
  1289. @smallexample
  1290. (org-remember-insinuate)
  1291. (setq org-directory "~/path/to/my/orgfiles/")
  1292. (setq org-default-notes-file (concat org-directory "/notes.org"))
  1293. (define-key global-map "\C-cr" 'org-remember)
  1294. @end smallexample
  1295. @noindent
  1296. The last line binds the command @code{org-remember} to a global
  1297. key@footnote{Please select your own key, @kbd{C-c r} is only a
  1298. suggestion.}. @code{org-remember} basically just calls Remember,
  1299. but it makes a few things easier: if there is an active region, it will
  1300. automatically copy the region into the Remember buffer. It also allows
  1301. to jump to the buffer and location where Remember notes are being
  1302. stored: just call @code{org-remember} with a prefix argument. If you
  1303. use two prefix arguments, Org jumps to the location where the last
  1304. remember note was stored.
  1305. @node Remember templates, Storing notes, Setting up Remember for Org, Remember
  1306. @unnumberedsubsec Remember templates
  1307. In combination with Org, you can use templates to generate
  1308. different types of Remember notes. For example, if you would like
  1309. to use one template to create general TODO entries, another one for
  1310. journal entries, and a third one for collecting random ideas, you could
  1311. use:
  1312. @smallexample
  1313. (setq org-remember-templates
  1314. '(("Todo" ?t "* TODO %?\n %i\n %a" "~/org/TODO.org" "Tasks")
  1315. ("Journal" ?j "* %U %?\n\n %i\n %a" "~/org/JOURNAL.org")
  1316. ("Idea" ?i "* %^@{Title@}\n %i\n %a" "~/org/JOURNAL.org" "New Ideas")))
  1317. @end smallexample
  1318. @noindent In these entries, the first string is just a name, and the
  1319. character specifies how to select the template. It is useful if the
  1320. character is also the first letter of the name. The next string specifies
  1321. the template. Two more (optional) strings give the file in which, and the
  1322. headline under which, the new note should be stored.
  1323. When you call @kbd{M-x org-remember} (or @kbd{M-x remember}) to remember
  1324. something, Org will prompt for a key to select the template (if you have
  1325. more than one template) and then prepare the buffer like
  1326. @smallexample
  1327. * TODO
  1328. [[file:@var{link to where you called remember}]]
  1329. @end smallexample
  1330. @noindent
  1331. During expansion of the template, special @kbd{%}-escapes@footnote{If you
  1332. need one of these sequences literally, escape the @kbd{%} with a backslash.}
  1333. allow dynamic insertion of content. Here is a small selection of the
  1334. possibilities, consult the manual for more.
  1335. @smallexample
  1336. %a @r{annotation, normally the link created with @code{org-store-link}}
  1337. %i @r{initial content, the region when remember is called with C-u.}
  1338. %t @r{timestamp, date only}
  1339. %T @r{timestamp with date and time}
  1340. %u, %U @r{like the above, but inactive timestamps}
  1341. @end smallexample
  1342. @node Storing notes, , Remember templates, Remember
  1343. @unnumberedsubsec Storing notes
  1344. When you are finished preparing a note with Remember, you have to press
  1345. @kbd{C-c C-c} to file the note away.
  1346. The handler will store the note in the file and under the headline
  1347. specified in the template, or it will use the default file and headline. The
  1348. window configuration will be restored, sending you back to the working
  1349. context before the call to Remember.
  1350. @node Refiling notes, Archiving, Remember, Capture - Refile - Archive
  1351. @section Refiling notes
  1352. When reviewing the captured data, you may want to refile some of the entries
  1353. into a different list, for example into a project. Cutting, finding the
  1354. right location, and then pasting the note is cumbersome. To simplify this
  1355. process, you can use the following special command:
  1356. @table @kbd
  1357. @item C-c C-w
  1358. Refile the entry or region at point. This command offers possible locations
  1359. for refiling the entry and lets you select one with completion. The item (or
  1360. all items in the region) is filed below the target heading as a subitem.@*
  1361. By default, all level 1 headlines in the current buffer are considered to be
  1362. targets, but you can have more complex definitions across a number of files.
  1363. See the variable @code{org-refile-targets} for details.
  1364. @item C-u C-c C-w
  1365. Use the refile interface to jump to a heading.
  1366. @item C-u C-u C-c C-w
  1367. Jump to the location where @code{org-refile} last moved a tree to.
  1368. @end table
  1369. @node Archiving, , Refiling notes, Capture - Refile - Archive
  1370. @section Archiving
  1371. When a project represented by a (sub)tree is finished, you may want
  1372. to move the tree out of the way and to stop it from contributing to the
  1373. agenda. Archiving is important to keep your working files compact and global
  1374. searches like the construction of agenda views fast.
  1375. The most common archiving action is to move a project tree to another file,
  1376. the archive file.
  1377. @table @kbd
  1378. @item C-c C-x C-a
  1379. Archive the current entry using the command specified in the variable
  1380. @code{org-archive-default-command}.
  1381. @item C-c C-x C-s@ @r{or short} @ C-c $
  1382. Archive the subtree starting at the cursor position to the location
  1383. given by @code{org-archive-location}.
  1384. @end table
  1385. The default archive location is a file in the same directory as the
  1386. current file, with the name derived by appending @file{_archive} to the
  1387. current file name. For information and examples on how to change this,
  1388. see the documentation string of the variable
  1389. @code{org-archive-location}. There is also an in-buffer option for
  1390. setting this variable, for example
  1391. @smallexample
  1392. #+ARCHIVE: %s_done::
  1393. @end smallexample
  1394. @seealso{
  1395. @uref{http://orgmode.org/manual/Capture-_002d-Refile-_002d-Archive.html#Capture-_002d-Refile-_002d-Archive,
  1396. Chapter 9 of the manual}@*
  1397. @uref{http://members.optusnet.com.au/~charles57/GTD/remember.html, Charles
  1398. Cave's remember tutorial}@*
  1399. @uref{http://orgmode.org/worg/org-tutorials/org-protocol-custom-handler.php,
  1400. Sebastian Rose's tutorial for capturing from a web browser}}@uref{}@*
  1401. @node Agenda Views, Markup, Capture - Refile - Archive, Top
  1402. @chapter Agenda Views
  1403. Due to the way Org works, TODO items, time-stamped items, and tagged
  1404. headlines can be scattered throughout a file or even a number of files. To
  1405. get an overview of open action items, or of events that are important for a
  1406. particular date, this information must be collected, sorted and displayed in
  1407. an organized way. There are several different views, see below.
  1408. The extracted information is displayed in a special @emph{agenda buffer}.
  1409. This buffer is read-only, but provides commands to visit the corresponding
  1410. locations in the original Org files, and even to edit these files remotely.
  1411. Remote editing from the agenda buffer means, for example, that you can
  1412. change the dates of deadlines and appointments from the agenda buffer.
  1413. The commands available in the Agenda buffer are listed in @ref{Agenda
  1414. commands}.
  1415. @menu
  1416. * Agenda files:: Files being searched for agenda information
  1417. * Agenda dispatcher:: Keyboard access to agenda views
  1418. * Built-in agenda views:: What is available out of the box?
  1419. * Agenda commands:: Remote editing of Org trees
  1420. * Custom agenda views:: Defining special searches and views
  1421. @end menu
  1422. @node Agenda files, Agenda dispatcher, Agenda Views, Agenda Views
  1423. @section Agenda files
  1424. The information to be shown is normally collected from all @emph{agenda
  1425. files}, the files listed in the variable
  1426. @code{org-agenda-files}.
  1427. @table @kbd
  1428. @item C-c [
  1429. Add current file to the list of agenda files. The file is added to
  1430. the front of the list. If it was already in the list, it is moved to
  1431. the front. With a prefix argument, file is added/moved to the end.
  1432. @item C-c ]
  1433. Remove current file from the list of agenda files.
  1434. @item C-,
  1435. Cycle through agenda file list, visiting one file after the other.
  1436. @end table
  1437. @node Agenda dispatcher, Built-in agenda views, Agenda files, Agenda Views
  1438. @section The agenda dispatcher
  1439. The views are created through a dispatcher, which should be bound to a
  1440. global key---for example @kbd{C-c a} (@pxref{Installation}). After
  1441. pressing @kbd{C-c a}, an additional letter is required to execute a
  1442. command:
  1443. @table @kbd
  1444. @item a
  1445. The calendar-like agenda (@pxref{Weekly/daily agenda}).
  1446. @item t @r{/} T
  1447. A list of all TODO items (@pxref{Global TODO list}).
  1448. @item m @r{/} M
  1449. A list of headlines matching a TAGS expression (@pxref{Matching
  1450. tags and properties}).
  1451. @item L
  1452. The timeline view for the current buffer (@pxref{Timeline}).
  1453. @item s
  1454. A list of entries selected by a boolean expression of keywords
  1455. and/or regular expressions that must or must not occur in the entry.
  1456. @end table
  1457. @node Built-in agenda views, Agenda commands, Agenda dispatcher, Agenda Views
  1458. @section The built-in agenda views
  1459. @menu
  1460. * Weekly/daily agenda:: The calendar page with current tasks
  1461. * Global TODO list:: All unfinished action items
  1462. * Matching tags and properties:: Structured information with fine-tuned search
  1463. * Timeline:: Time-sorted view for single file
  1464. * Search view:: Find entries by searching for text
  1465. @end menu
  1466. @node Weekly/daily agenda, Global TODO list, Built-in agenda views, Built-in agenda views
  1467. @subsection The weekly/daily agenda
  1468. The purpose of the weekly/daily @emph{agenda} is to act like a page of a
  1469. paper agenda, showing all the tasks for the current week or day.
  1470. @table @kbd
  1471. @item C-c a a
  1472. Compile an agenda for the current week from a list of Org files. The agenda
  1473. shows the entries for each day.
  1474. @end table
  1475. Emacs contains the calendar and diary by Edward M. Reingold. Org-mode
  1476. understands the syntax of the diary and allows you to use diary sexp entries
  1477. directly in Org files:
  1478. @smallexample
  1479. * Birthdays and similar stuff
  1480. #+CATEGORY: Holiday
  1481. %%(org-calendar-holiday) ; special function for holiday names
  1482. #+CATEGORY: Ann
  1483. %%(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
  1484. %%(diary-anniversary 10 2 1869) Mahatma Gandhi would be %d years old
  1485. @end smallexample
  1486. Org can interact with Emacs appointments notification facility. To add all
  1487. the appointments of your agenda files, use the command
  1488. @code{org-agenda-to-appt}. See the docstring for details.
  1489. @node Global TODO list, Matching tags and properties, Weekly/daily agenda, Built-in agenda views
  1490. @subsection The global TODO list
  1491. The global TODO list contains all unfinished TODO items formatted and
  1492. collected into a single place. Remote editing of TODO items lets you
  1493. can change the state of a TODO entry with a single key press. The commands
  1494. available in the TODO list are described in @ref{Agenda commands}.
  1495. @table @kbd
  1496. @item C-c a t
  1497. Show the global TODO list. This collects the TODO items from all
  1498. agenda files (@pxref{Agenda Views}) into a single buffer.
  1499. @item C-c a T
  1500. Like the above, but allows selection of a specific TODO keyword.
  1501. @end table
  1502. @node Matching tags and properties, Timeline, Global TODO list, Built-in agenda views
  1503. @subsection Matching tags and properties
  1504. If headlines in the agenda files are marked with @emph{tags} (@pxref{Tags}),
  1505. or have properties (@pxref{Properties}), you can select headlines
  1506. based on this metadata and collect them into an agenda buffer. The match
  1507. syntax described here also applies when creating sparse trees with @kbd{C-c /
  1508. m}. The commands available in the tags list are described in @ref{Agenda
  1509. commands}.
  1510. @table @kbd
  1511. @item C-c a m
  1512. Produce a list of all headlines that match a given set of tags. The
  1513. command prompts for a selection criterion, which is a boolean logic
  1514. expression with tags, like @samp{+work+urgent-withboss} or
  1515. @samp{work|home} (@pxref{Tags}). If you often need a specific search,
  1516. define a custom command for it (@pxref{Agenda dispatcher}).
  1517. @item C-c a M
  1518. Like @kbd{C-c a m}, but only select headlines that are also TODO items.
  1519. @end table
  1520. @subsubheading Match syntax
  1521. A search string can use Boolean operators @samp{&} for AND and @samp{|} for
  1522. OR. @samp{&} binds more strongly than @samp{|}. Parentheses are currently
  1523. not implemented. Each element in the search is either a tag, a regular
  1524. expression matching tags, or an expression like @code{PROPERTY OPERATOR
  1525. VALUE} with a comparison operator, accessing a property value. Each element
  1526. may be preceded by @samp{-}, to select against it, and @samp{+} is syntactic
  1527. sugar for positive selection. The AND operator @samp{&} is optional when
  1528. @samp{+} or @samp{-} is present. Here are some examples, using only tags.
  1529. @table @samp
  1530. @item +work-boss
  1531. Select headlines tagged @samp{:work:}, but discard those also tagged
  1532. @samp{:boss:}.
  1533. @item work|laptop
  1534. Selects lines tagged @samp{:work:} or @samp{:laptop:}.
  1535. @item work|laptop+night
  1536. Like before, but require the @samp{:laptop:} lines to be tagged also
  1537. @samp{:night:}.
  1538. @end table
  1539. You may also test for properties at the same
  1540. time as matching tags, see the manual for more information.
  1541. @node Timeline, Search view, Matching tags and properties, Built-in agenda views
  1542. @subsection Timeline for a single file
  1543. The timeline summarizes all time-stamped items from a single Org mode
  1544. file in a @emph{time-sorted view}. The main purpose of this command is
  1545. to give an overview over events in a project.
  1546. @table @kbd
  1547. @item C-c a L
  1548. Show a time-sorted view of the Org file, with all time-stamped items.
  1549. When called with a @kbd{C-u} prefix, all unfinished TODO entries
  1550. (scheduled or not) are also listed under the current date.
  1551. @end table
  1552. @node Search view, , Timeline, Built-in agenda views
  1553. @subsection Search view
  1554. This agenda view is a general text search facility for Org mode entries.
  1555. It is particularly useful to find notes.
  1556. @table @kbd
  1557. @item C-c a s
  1558. This is a special search that lets you select entries by matching a substring
  1559. or specific words using a boolean logic.
  1560. @end table
  1561. For example, the search string @samp{computer equipment} will find entries
  1562. that contain @samp{computer equipment} as a substring.
  1563. Search view can also search for specific keywords in the entry, using Boolean
  1564. logic. The search string @samp{+computer +wifi -ethernet -@{8\.11[bg]@}}
  1565. will search for note entries that contain the keywords @code{computer}
  1566. and @code{wifi}, but not the keyword @code{ethernet}, and which are also
  1567. not matched by the regular expression @code{8\.11[bg]}, meaning to
  1568. exclude both 8.11b and 8.11g.
  1569. Note that in addition to the agenda files, this command will also search
  1570. the files listed in @code{org-agenda-text-search-extra-files}.
  1571. @node Agenda commands, Custom agenda views, Built-in agenda views, Agenda Views
  1572. @section Commands in the agenda buffer
  1573. Entries in the agenda buffer are linked back to the Org file or diary
  1574. file where they originate. Commands are provided to show and jump to the
  1575. original entry location, and to edit the Org files ``remotely'' from
  1576. the agenda buffer. This is just a selection of the many commands, explore
  1577. the @code{Agenda} menu and the manual for a complete list.
  1578. @table @kbd
  1579. @tsubheading{Motion}
  1580. @item n
  1581. Next line (same as @key{up} and @kbd{C-p}).
  1582. @item p
  1583. Previous line (same as @key{down} and @kbd{C-n}).
  1584. @tsubheading{View/Go to Org file}
  1585. @item mouse-3
  1586. @itemx @key{SPC}
  1587. Display the original location of the item in another window.
  1588. With prefix arg, make sure that the entire entry is made visible in the
  1589. outline, not only the heading.
  1590. @c
  1591. @itemx @key{TAB}
  1592. Go to the original location of the item in another window. Under Emacs
  1593. 22, @kbd{mouse-1} will also works for this.
  1594. @c
  1595. @itemx @key{RET}
  1596. Go to the original location of the item and delete other windows.
  1597. @c
  1598. @tsubheading{Change display}
  1599. @item o
  1600. Delete other windows.
  1601. @c
  1602. @item d @r{/} w
  1603. Switch to day/week view.
  1604. @c
  1605. @item f @r{and} b
  1606. Go forward/backward in time to display the following @code{org-agenda-ndays}
  1607. days. For example, if the display covers a week, switch to the
  1608. following/previous week.
  1609. @c
  1610. @item .
  1611. Go to today.
  1612. @c
  1613. @item j
  1614. Prompt for a date and go there.
  1615. @c
  1616. @item v l @ @r{or short} @ l
  1617. Toggle Logbook mode. In Logbook mode, entries that were marked DONE while
  1618. logging was on (variable @code{org-log-done}) are shown in the agenda, as are
  1619. entries that have been clocked on that day. When called with a @kbd{C-u}
  1620. prefix, show all possible logbook entries, including state changes.
  1621. @c
  1622. @item r @r{or} g
  1623. Recreate the agenda buffer, to reflect the changes.
  1624. @item s
  1625. Save all Org buffers in the current Emacs session, and also the locations of
  1626. IDs.
  1627. @tsubheading{Secondary filtering and query editing}
  1628. @item /
  1629. Filter the current agenda view with respect to a tag. You are prompted for a
  1630. letter to select a tag. Press @samp{-} first to select against the tag.
  1631. @item \
  1632. Narrow the current agenda filter by an additional condition.
  1633. @tsubheading{Remote editing (see the manual for many more commands)}
  1634. @item 0-9
  1635. Digit argument.
  1636. @c
  1637. @item t
  1638. Change the TODO state of the item, in the agenda and in the
  1639. org file.
  1640. @c
  1641. @item C-k
  1642. Delete the current agenda item along with the entire subtree belonging
  1643. to it in the original Org file.
  1644. @c
  1645. @item C-c C-w
  1646. Refile the entry at point.
  1647. @c
  1648. @item C-c C-x C-a @ @r{or short} @ a
  1649. Archive the subtree corresponding to the entry at point using the default
  1650. archiving command set in @code{org-archive-default-command}.
  1651. @c
  1652. @item C-c C-x C-s @ @r{or short} @ $
  1653. Archive the subtree corresponding to the current headline.
  1654. @c
  1655. @item C-c C-s
  1656. Schedule this item, with prefix arg remove the scheduling timestamp
  1657. @c
  1658. @item C-c C-d
  1659. Set a deadline for this item, with prefix arg remove the deadline.
  1660. @c
  1661. @item S-@key{right} @r{and} S-@key{left}
  1662. Change the timestamp associated with the current line by one day.
  1663. @c
  1664. @item I
  1665. Start the clock on the current item.
  1666. @c
  1667. @item O / X
  1668. Stop/cancel the previously started clock.
  1669. @item J
  1670. Jump to the running clock in another window.
  1671. @end table
  1672. @node Custom agenda views, , Agenda commands, Agenda Views
  1673. @section Custom agenda views
  1674. The main application of custom searches is the definition of keyboard
  1675. shortcuts for frequently used searches, either creating an agenda
  1676. buffer, or a sparse tree (the latter covering of course only the current
  1677. buffer).
  1678. Custom commands are configured in the variable
  1679. @code{org-agenda-custom-commands}. You can customize this variable, for
  1680. example by pressing @kbd{C-c a C}. You can also directly set it with
  1681. Emacs Lisp in @file{.emacs}. The following example contains all valid
  1682. search types:
  1683. @smalllisp
  1684. @group
  1685. (setq org-agenda-custom-commands
  1686. '(("w" todo "WAITING")
  1687. ("u" tags "+boss-urgent")
  1688. ("v" tags-todo "+boss-urgent")))
  1689. @end group
  1690. @end smalllisp
  1691. @noindent
  1692. The initial string in each entry defines the keys you have to press after the
  1693. dispatcher command @kbd{C-c a} in order to access the command. Usually this
  1694. will be just a single character. The second parameter is the search type,
  1695. followed by the string or regular expression to be used for the matching.
  1696. The example above will therefore define:
  1697. @table @kbd
  1698. @item C-c a w
  1699. as a global search for TODO entries with @samp{WAITING} as the TODO
  1700. keyword
  1701. @item C-c a u
  1702. as a global tags search for headlines marked @samp{:boss:} but not
  1703. @samp{:urgent:}
  1704. @item C-c a v
  1705. as the same search as @kbd{C-c a u}, but limiting the search to
  1706. headlines that are also TODO items
  1707. @end table
  1708. @seealso{
  1709. @uref{http://orgmode.org/manual/Agenda-Views.html#Agenda-Views, Chapter 10 of
  1710. the manual}@*
  1711. @uref{http://orgmode.org/worg/org-tutorials/org-custom-agenda-commands.php,
  1712. Mat Lundin's tutorial about custom agenda commands}@*
  1713. @uref{http://www.newartisans.com/2007/08/using-org-mode-as-a-day-planner.html,
  1714. John Wiegley's setup}}
  1715. @node Markup, Exporting, Agenda Views, Top
  1716. @chapter Markup for rich export
  1717. When exporting Org-mode documents, the exporter tries to reflect the
  1718. structure of the document as accurately as possible in the backend. Since
  1719. export targets like HTML, La@TeX{}, or DocBook allow much richer formatting,
  1720. Org mode has rules on how to prepare text for rich export. This section
  1721. summarizes the markup rules used in an Org-mode buffer.
  1722. @menu
  1723. * Structural markup elements:: The basic structure as seen by the exporter
  1724. * Images and tables:: Tables and Images will be included
  1725. * Literal examples:: Source code examples with special formatting
  1726. * Include files:: Include additional files into a document
  1727. * Embedded LaTeX:: LaTeX can be freely used inside Org documents
  1728. @end menu
  1729. @node Structural markup elements, Images and tables, Markup, Markup
  1730. @section Structural markup elements
  1731. @menu
  1732. * Document title:: Where the title is taken from
  1733. * Headings and sections:: The document structure as seen by the exporter
  1734. * Table of contents:: The if and where of the table of contents
  1735. * Paragraphs:: Paragraphs
  1736. * Emphasis and monospace:: Bold, italic, etc.
  1737. * Comment lines:: What will *not* be exported
  1738. @end menu
  1739. @node Document title, Headings and sections, Structural markup elements, Structural markup elements
  1740. @subheading Document title
  1741. @noindent
  1742. The title of the exported document is taken from the special line
  1743. @smallexample
  1744. #+TITLE: This is the title of the document
  1745. @end smallexample
  1746. @node Headings and sections, Table of contents, Document title, Structural markup elements
  1747. @subheading Headings and sections
  1748. The outline structure of the document as described in @ref{Document
  1749. Structure}, forms the basis for defining sections of the exported document.
  1750. However, since the outline structure is also used for (for example) lists of
  1751. tasks, only the first three outline levels will be used as headings. Deeper
  1752. levels will become itemized lists. You can change the location of this
  1753. switch globally by setting the variable @code{org-export-headline-levels}, or on a
  1754. per-file basis with a line
  1755. @smallexample
  1756. #+OPTIONS: H:4
  1757. @end smallexample
  1758. @node Table of contents, Paragraphs, Headings and sections, Structural markup elements
  1759. @subheading Table of contents
  1760. The table of contents is normally inserted directly before the first headline
  1761. of the file.
  1762. @smallexample
  1763. #+OPTIONS: toc:2 (only to two levels in TOC)
  1764. #+OPTIONS: toc:nil (no TOC at all)
  1765. @end smallexample
  1766. @node Paragraphs, Emphasis and monospace, Table of contents, Structural markup elements
  1767. @subheading Paragraphs, line breaks, and quoting
  1768. Paragraphs are separated by at least one empty line. If you need to enforce
  1769. a line break within a paragraph, use @samp{\\} at the end of a line.
  1770. To keep the line breaks in a region, but otherwise use normal formatting, you
  1771. can use this construct, which can also be used to format poetry.
  1772. @smallexample
  1773. #+BEGIN_VERSE
  1774. Great clouds overhead
  1775. Tiny black birds rise and fall
  1776. Snow covers Emacs
  1777. -- AlexSchroeder
  1778. #+END_VERSE
  1779. @end smallexample
  1780. When quoting a passage from another document, it is customary to format this
  1781. as a paragraph that is indented on both the left and the right margin. You
  1782. can include quotations in Org-mode documents like this:
  1783. @smallexample
  1784. #+BEGIN_QUOTE
  1785. Everything should be made as simple as possible,
  1786. but not any simpler -- Albert Einstein
  1787. #+END_QUOTE
  1788. @end smallexample
  1789. If you would like to center some text, do it like this:
  1790. @smallexample
  1791. #+BEGIN_CENTER
  1792. Everything should be made as simple as possible, \\
  1793. but not any simpler
  1794. #+END_CENTER
  1795. @end smallexample
  1796. @node Emphasis and monospace, Comment lines, Paragraphs, Structural markup elements
  1797. @subheading Emphasis and monospace
  1798. You can make words @b{*bold*}, @i{/italic/}, _underlined_, @code{=code=}
  1799. and @code{~verbatim~}, and, if you must, @samp{+strike-through+}. Text
  1800. in the code and verbatim string is not processed for Org-mode specific
  1801. syntax, it is exported verbatim. To insert a horizontal rules, use a line
  1802. consisting of only dashes, and at least 5 of them.
  1803. @node Comment lines, , Emphasis and monospace, Structural markup elements
  1804. @subheading Comment lines
  1805. Lines starting with @samp{#} in column zero are treated as comments and will
  1806. never be exported. If you want an indented line to be treated as a comment,
  1807. start it with @samp{#+ }. Also entire subtrees starting with the word
  1808. @samp{COMMENT} will never be exported. Finally, regions surrounded by
  1809. @samp{#+BEGIN_COMMENT} ... @samp{#+END_COMMENT} will not be exported.
  1810. @table @kbd
  1811. @item C-c ;
  1812. Toggle the COMMENT keyword at the beginning of an entry.
  1813. @end table
  1814. @node Images and tables, Literal examples, Structural markup elements, Markup
  1815. @section Images and Tables
  1816. For Org mode tables, the lines before the first horizontal separator line
  1817. will become table header lines. You can use the following lines somewhere
  1818. before the table to assign a caption and a label for cross references, and in
  1819. the text you can refer to the object with @code{\ref@{tab:basic-data@}}:
  1820. @smallexample
  1821. #+CAPTION: This is the caption for the next table (or link)
  1822. #+LABEL: tbl:basic-data
  1823. | ... | ...|
  1824. |-----|----|
  1825. @end smallexample
  1826. Some backends (HTML, La@TeX{}, and DocBook) allow you to directly include
  1827. images into the exported document. Org does this, if a link to an image
  1828. files does not have a description part, for example @code{[[./img/a.jpg]]}.
  1829. If you wish to define a caption for the image and maybe a label for internal
  1830. cross references, you sure that the link is on a line by itself precede it
  1831. with:
  1832. @smallexample
  1833. #+CAPTION: This is the caption for the next figure link (or table)
  1834. #+LABEL: fig:SED-HR4049
  1835. [[./img/a.jpg]]
  1836. @end smallexample
  1837. You may also define additional attributes for the figure. As this is
  1838. backend-specific, see the sections about the individual backends for more
  1839. information.
  1840. @node Literal examples, Include files, Images and tables, Markup
  1841. @section Literal examples
  1842. You can include literal examples that should not be subjected to
  1843. markup. Such examples will be typeset in monospace, so this is well suited
  1844. for source code and similar examples.
  1845. @smallexample
  1846. #+BEGIN_EXAMPLE
  1847. Some example from a text file.
  1848. #+END_EXAMPLE
  1849. @end smallexample
  1850. For simplicity when using small examples, you can also start the example
  1851. lines with a colon followed by a space. There may also be additional
  1852. whitespace before the colon:
  1853. @smallexample
  1854. Here is an example
  1855. : Some example from a text file.
  1856. @end smallexample
  1857. For source code from a programming language, or any other text
  1858. that can be marked up by font-lock in Emacs, you can ask for it to
  1859. look like the fontified Emacs buffer
  1860. @smallexample
  1861. #+BEGIN_SRC emacs-lisp
  1862. (defun org-xor (a b)
  1863. "Exclusive or."
  1864. (if a (not b) b))
  1865. #+END_SRC
  1866. @end smallexample
  1867. To edit the example in a special buffer supporting this language, use
  1868. @kbd{C-c '} to both enter and leave the editing buffer.
  1869. @node Include files, Embedded LaTeX, Literal examples, Markup
  1870. @section Include files
  1871. During export, you can include the content of another file. For example, to
  1872. include your @file{.emacs} file, you could use:
  1873. @smallexample
  1874. #+INCLUDE: "~/.emacs" src emacs-lisp
  1875. @end smallexample
  1876. @noindent
  1877. The optional second and third parameter are the markup (e.g. @samp{quote},
  1878. @samp{example}, or @samp{src}), and, if the markup is @samp{src}, the
  1879. language for formatting the contents. The markup is optional, if it is not
  1880. given, the text will be assumed to be in Org mode format and will be
  1881. processed normally. @kbd{C-c '} will visit the included file.
  1882. @node Embedded LaTeX, , Include files, Markup
  1883. @section Embedded La@TeX{}
  1884. For scientific notes which need to be able to contain mathematical symbols
  1885. and the occasional formula, Org-mode supports embedding La@TeX{} code into
  1886. its files. You can directly use TeX-like macros for special symbols, enter
  1887. formulas and entire LaTeX environments.
  1888. @smallexample
  1889. Angles are written as Greek letters \alpha, \beta and \gamma. The mass if
  1890. the sun is M_sun = 1.989 x 10^30 kg. The radius of the sun is R_@{sun@} =
  1891. 6.96 x 10^8 m. If $a^2=b$ and $b=2$, then the solution must be either
  1892. $a=+\sqrt@{2@}$ or $a=-\sqrt@{2@}$.
  1893. \begin@{equation@}
  1894. x=\sqrt@{b@}
  1895. \end@{equation@}
  1896. @end smallexample
  1897. @noindent With
  1898. @uref{http://orgmode.org/manual/LaTeX-fragments.html#LaTeX-fragments,special
  1899. setup}, LaTeX snippets will be included as images when exporting to HTML.
  1900. @seealso{
  1901. @uref{http://orgmode.org/manual/Markup.html#Markup, Chapter 11 of the manual}}
  1902. @node Exporting, Publishing, Markup, Top
  1903. @chapter Exporting
  1904. Org-mode documents can be exported into a variety of other formats: ASCII
  1905. export for inclusion into emails, HTML to publish on the web, La@TeX{}/PDF
  1906. for beautiful printed documents and DocBook to enter the world of many other
  1907. formats using DocBook tools. There is also export to iCalendar format so
  1908. that planning information can be incorporated into desktop calendars.
  1909. @menu
  1910. * Export options:: Per-file export settings
  1911. * The export dispatcher:: How to access exporter commands
  1912. * ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding
  1913. * HTML export:: Exporting to HTML
  1914. * LaTeX and PDF export:: Exporting to La@TeX{}, and processing to PDF
  1915. * DocBook export:: Exporting to DocBook
  1916. * iCalendar export::
  1917. @end menu
  1918. @node Export options, The export dispatcher, Exporting, Exporting
  1919. @section Export options
  1920. The exporter recognizes special lines in the buffer which provide
  1921. additional information. These lines may be put anywhere in the file.
  1922. The whole set of lines can be inserted into the buffer with @kbd{C-c
  1923. C-e t}.
  1924. @table @kbd
  1925. @item C-c C-e t
  1926. Insert template with export options, see example below.
  1927. @end table
  1928. @smallexample
  1929. #+TITLE: the title to be shown (default is the buffer name)
  1930. #+AUTHOR: the author (default taken from @code{user-full-name})
  1931. #+DATE: a date, fixed, of a format string for @code{format-time-string}
  1932. #+EMAIL: his/her email address (default from @code{user-mail-address})
  1933. #+DESCRIPTION: the page description, e.g. for the XHTML meta tag
  1934. #+KEYWORDS: the page keywords, e.g. for the XHTML meta tag
  1935. #+LANGUAGE: language for HTML, e.g. @samp{en} (@code{org-export-default-language})
  1936. #+TEXT: Some descriptive text to be inserted at the beginning.
  1937. #+TEXT: Several lines may be given.
  1938. #+OPTIONS: H:2 num:t toc:t \n:nil @@:t ::t |:t ^:t f:t TeX:t ...
  1939. #+LINK_UP: the ``up'' link of an exported page
  1940. #+LINK_HOME: the ``home'' link of an exported page
  1941. #+LATEX_HEADER: extra line(s) for the LaTeX header, like \usepackage@{xyz@}
  1942. @end smallexample
  1943. @node The export dispatcher, ASCII/Latin-1/UTF-8 export, Export options, Exporting
  1944. @section The export dispatcher
  1945. All export commands can be reached using the export dispatcher, which is a
  1946. prefix key that prompts for an additional key specifying the command.
  1947. Normally the entire file is exported, but if there is an active region that
  1948. contains one outline tree, the first heading is used as document title and
  1949. the subtrees are exported.
  1950. @table @kbd
  1951. @item C-c C-e
  1952. Dispatcher for export and publishing commands.
  1953. @end table
  1954. @node ASCII/Latin-1/UTF-8 export, HTML export, The export dispatcher, Exporting
  1955. @section ASCII/Latin-1/UTF-8 export
  1956. ASCII export produces a simple and very readable version of an Org-mode
  1957. file, containing only plain ASCII. Latin-1 and UTF-8 export augment the file
  1958. with special characters and symbols available in these encodings.
  1959. @table @kbd
  1960. @item C-c C-e a
  1961. Export as ASCII file.
  1962. @item C-c C-e n @ @ @r{and} @ @ C-c C-e N
  1963. Like the above commands, but use Latin-1 encoding.
  1964. @item C-c C-e u @ @ @r{and} @ @ C-c C-e U
  1965. Like the above commands, but use UTF-8 encoding.
  1966. @end table
  1967. @node HTML export, LaTeX and PDF export, ASCII/Latin-1/UTF-8 export, Exporting
  1968. @section HTML export
  1969. @table @kbd
  1970. @item C-c C-e h
  1971. Export as HTML file @file{myfile.html}.
  1972. @item C-c C-e b
  1973. Export as HTML file and immediately open it with a browser.
  1974. @end table
  1975. To insert HTML that should be copied verbatim to
  1976. the exported file use either
  1977. @smallexample
  1978. #+HTML: Literal HTML code for export
  1979. @end smallexample
  1980. @noindent or
  1981. @smallexample
  1982. #+BEGIN_HTML
  1983. All lines between these markers are exported literally
  1984. #+END_HTML
  1985. @end smallexample
  1986. @node LaTeX and PDF export, DocBook export, HTML export, Exporting
  1987. @section La@TeX{} and PDF export
  1988. @table @kbd
  1989. @item C-c C-e l
  1990. Export as La@TeX{} file @file{myfile.tex}.
  1991. @item C-c C-e p
  1992. Export as La@TeX{} and then process to PDF.
  1993. @item C-c C-e d
  1994. Export as La@TeX{} and then process to PDF, then open the resulting PDF file.
  1995. @end table
  1996. By default, the La@TeX{} output uses the class @code{article}. You can
  1997. change this by adding an option like @code{#+LaTeX_CLASS: myclass} in your
  1998. file. The class must be listed in @code{org-export-latex-classes}.
  1999. Embedded La@TeX{} as described in @ref{Embedded LaTeX}, will be correctly
  2000. inserted into the La@TeX{} file. Similarly to the HTML exporter, you can use
  2001. @code{#+LaTeX:} and @code{#+BEGIN_LaTeX ... #+END_LaTeX} construct to add
  2002. verbatim LaTeX code.
  2003. @node DocBook export, iCalendar export, LaTeX and PDF export, Exporting
  2004. @section DocBook export
  2005. @table @kbd
  2006. @item C-c C-e D
  2007. Export as DocBook file.
  2008. @end table
  2009. Similarly to the HTML exporter, you can use @code{#+DocBook:} and
  2010. @code{#+BEGIN_DocBook ... #+END_DocBook} construct to add verbatim LaTeX
  2011. code.
  2012. @node iCalendar export, , DocBook export, Exporting
  2013. @section iCalendar export
  2014. @table @kbd
  2015. @kindex C-c C-e i
  2016. @item C-c C-e i
  2017. Create iCalendar entries for the current file in a @file{.ics} file.
  2018. @kindex C-c C-e c
  2019. @item C-c C-e c
  2020. Create a single large iCalendar file from all files in
  2021. @code{org-agenda-files} and write it to the file given by
  2022. @code{org-combined-agenda-icalendar-file}.
  2023. @end table
  2024. @seealso{
  2025. @uref{http://orgmode.org/manual/Exporting.html#Exporting, Chapter 12 of the manual}@*
  2026. @uref{http://orgmode.org/worg/org-tutorials/images-and-xhtml-export.php,
  2027. Sebastian Rose's image handling tutorial}@*
  2028. @uref{http://orgmode.org/worg/org-tutorials/org-latex-export.php, Thomas
  2029. Dye's LaTeX export tutorial}
  2030. @uref{http://orgmode.org/worg/org-tutorials/org-beamer/tutorial.php, Eric
  2031. Fraga's BEAMER presentation tutorial}}
  2032. @node Publishing, Miscellaneous, Exporting, Top
  2033. @chapter Publishing
  2034. Org includes a publishing management system that allows you to configure
  2035. automatic HTML conversion of @emph{projects} composed of interlinked org
  2036. files. You can also configure Org to automatically upload your exported HTML
  2037. pages and related attachments, such as images and source code files, to a web
  2038. server. For detailed instructions about setup, see the manual.
  2039. Here is an example:
  2040. @smalllisp
  2041. (setq org-publish-project-alist
  2042. '(("org"
  2043. :base-directory "~/org/"
  2044. :publishing-directory "~/public_html"
  2045. :section-numbers nil
  2046. :table-of-contents nil
  2047. :style "<link rel=\"stylesheet\"
  2048. href=\"../other/mystyle.css\"
  2049. type=\"text/css\"/>")))
  2050. @end smalllisp
  2051. @table @kbd
  2052. @item C-c C-e C
  2053. Prompt for a specific project and publish all files that belong to it.
  2054. @item C-c C-e P
  2055. Publish the project containing the current file.
  2056. @item C-c C-e F
  2057. Publish only the current file.
  2058. @item C-c C-e E
  2059. Publish every project.
  2060. @end table
  2061. Org uses timestamps to track when a file has changed. The above functions
  2062. normally only publish changed files. You can override this and force
  2063. publishing of all files by giving a prefix argument to any of the commands
  2064. above.
  2065. @seealso{
  2066. @uref{http://orgmode.org/manual/Publishing.html#Publishing, Chapter 12 of the
  2067. manual}@*
  2068. @uref{http://orgmode.org/worg/org-tutorials/org-publish-html-tutorial.php,
  2069. Sebastian Rose's publishing tutorial}@*
  2070. @uref{http://orgmode.org/worg/org-tutorials/org-jekyll.php, Ian Barton's
  2071. Jekyll/blogging setup}}
  2072. @node Miscellaneous, , Publishing, Top
  2073. @chapter Miscellaneous
  2074. @menu
  2075. * Completion:: M-TAB knows what you need
  2076. * Clean view:: Getting rid of leading stars in the outline
  2077. * MobileOrg:: Org-mode on the iPhone
  2078. @end menu
  2079. @node Completion, Clean view, Miscellaneous, Miscellaneous
  2080. @section Completion
  2081. Org supports in-buffer completion with @kbd{M-@key{TAB}}. This type of
  2082. completion does not make use of the minibuffer. You simply type a few
  2083. letters into the buffer and use the key to complete text right there. For
  2084. example, this command will complete @TeX{} symbols after @samp{\}, TODO
  2085. keywords at the beginning of a headline, and tags after @samp{:} in a
  2086. headline.
  2087. @node Clean view, MobileOrg, Completion, Miscellaneous
  2088. @section A cleaner outline view
  2089. Some people find it noisy and distracting that the Org headlines start with a
  2090. potentially large number of stars, and that text below the headlines is not
  2091. indented. While this is no problem when writing a @emph{book-like} document
  2092. where the outline headings are really section headings, in a more
  2093. @emph{list-oriented} outline, indented structure is a lot cleaner:
  2094. @smallexample
  2095. @group
  2096. * Top level headline | * Top level headline
  2097. ** Second level | * Second level
  2098. *** 3rd level | * 3rd level
  2099. some text | some text
  2100. *** 3rd level | * 3rd level
  2101. more text | more text
  2102. * Another top level headline | * Another top level headline
  2103. @end group
  2104. @end smallexample
  2105. @noindent
  2106. If you are using at least Emacs 23.1.50.3 and version 6.29 of Org, this kind
  2107. of view can be achieved dynamically at display time using
  2108. @code{org-indent-mode}, which will prepend intangible space to each line.
  2109. You can turn on @code{org-indent-mode} for all files by customizing the
  2110. variable @code{org-startup-indented}, or you can turn it on for individual
  2111. files using
  2112. @smallexample
  2113. #+STARTUP: indent
  2114. @end smallexample
  2115. If you want a similar effect in earlier version of Emacs and/or Org, or if
  2116. you want the indentation to be hard space characters so that the plain text
  2117. file looks as similar as possible to the Emacs display, Org supports you by
  2118. helping to indent (with @key{TAB}) text below each headline, by hiding
  2119. leading stars, and by only using levels 1, 3, etc to get two characters
  2120. indentation for each level. To get this support in a file, use
  2121. @smallexample
  2122. #+STARTUP: hidestars odd
  2123. @end smallexample
  2124. @node MobileOrg, , Clean view, Miscellaneous
  2125. @section MobileOrg
  2126. @i{MobileOrg} is an application for the @i{iPhone/iPod Touch} series of
  2127. devices, developed by Richard Moreland. For details, see the Org-mode
  2128. manual.
  2129. @seealso{
  2130. @uref{http://orgmode.org/manual/Miscellaneous.html#Miscellaneous, Chapter 14
  2131. of the manual}@*
  2132. @uref{http://orgmode.org/manual/MobileOrg.html#MobileOrg, Appendix B of the
  2133. manual}@*
  2134. @uref{http://orgmode.org/orgcard.pdf,Key reference card}}
  2135. @bye
  2136. @ignore
  2137. arch-tag: 8f0a8557-0acc-4436-b2b2-0197699e1452
  2138. @end ignore
  2139. @c Local variables:
  2140. @c ispell-local-dictionary: "en_US-w_accents"
  2141. @c ispell-local-pdict: "./.aspell.org.pws"
  2142. @c fill-column: 77
  2143. @c End:
  2144. @c LocalWords: webdavhost pre