orgguide.texi 93 KB

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