1 #+title: The Org Manual
3 #+texinfo: @insertcopying
7 :DESCRIPTION: Getting started.
13 :DESCRIPTION: Brief summary of what Org does.
17 Org is a mode for keeping notes, maintaining TODO lists, and project
18 planning with a fast and effective plain-text system. It also is an
19 authoring system with unique support for literate programming and
20 reproducible research.
22 Org is implemented on top of Outline mode, which makes it possible to
23 keep the content of large files well structured. Visibility cycling
24 and structure editing help to work with the tree. Tables are easily
25 created with a built-in table editor. Plain text URL-like links
26 connect to websites, emails, Usenet messages, BBDB entries, and any
27 files related to the projects.
29 Org develops organizational tasks around notes files that contain
30 lists or information about projects as plain text. Project planning
31 and task management makes use of metadata which is part of an outline
32 node. Based on this data, specific entries can be extracted in
33 queries and create dynamic /agenda views/ that also integrate the
34 Emacs calendar and diary. Org can be used to implement many different
35 project planning schemes, such as David Allen's GTD system.
37 Org files can serve as a single source authoring system with export to
38 many different formats such as HTML, LaTeX, Open Document, and
39 Markdown. New export backends can be derived from existing ones, or
42 Org files can include source code blocks, which makes Org uniquely
43 suited for authoring technical documents with code examples. Org
44 source code blocks are fully functional; they can be evaluated in
45 place and their results can be captured in the file. This makes it
46 possible to create a single file reproducible research compendium.
48 Org keeps simple things simple. When first fired up, it should feel
49 like a straightforward, easy to use outliner. Complexity is not
50 imposed, but a large amount of functionality is available when needed.
51 Org is a toolbox. Many users actually run only a -- very personal --
52 fraction of Org's capabilities, and know that there is more whenever
55 All of this is achieved with strictly plain text files, the most
56 portable and future-proof file format. Org runs in Emacs. Emacs is
57 one of the most widely ported programs, so that Org mode is available
58 on every major platform.
61 There is a website for Org which provides links to the newest version
62 of Org, as well as additional information, frequently asked questions
63 (FAQ), links to tutorials, etc. This page is located at
64 [[http://orgmode.org]].
66 #+cindex: print edition
67 An earlier version (7.3) of this manual is available as a [[http://www.network-theory.co.uk/org/manual/][paperback
68 book from Network Theory Ltd.]].
72 :DESCRIPTION: Installing Org.
74 #+cindex: installation
76 Org is part of recent distributions of GNU Emacs, so you normally do
77 not need to install it. If, for one reason or another, you want to
78 install Org on top of this pre-packaged version, there are three ways
81 - By using Emacs package system.
82 - By downloading Org as an archive.
83 - By using Org's git repository.
85 We *strongly recommend* to stick to a single installation method.
87 *** Using Emacs packaging system
92 Recent Emacs distributions include a packaging system which lets you
93 install Elisp libraries. You can install Org with {{{kbd(M-x
94 package-install RET org)}}}.
97 *Important*: you need to do this in a session where no =.org= file has
98 been visited, i.e., where no Org built-in function have been loaded.
99 Otherwise autoload Org functions will mess up the installation.
101 Then, to make sure your Org configuration is taken into account,
102 initialize the package system with ~(package-initialize)~ in your
103 Emacs init file before setting any Org option. If you want to use
104 Org's package repository, check out the [[http://orgmode.org/elpa.html][Org ELPA page]].
106 *** Downloading Org as an archive
111 You can download Org latest release from [[http://orgmode.org/][Org's website]]. In this case,
112 make sure you set the load-path correctly in your Emacs init file:
114 #+begin_src emacs-lisp
115 (add-to-list 'load-path "~/path/to/orgdir/lisp")
118 The downloaded archive contains contributed libraries that are not
119 included in Emacs. If you want to use them, add the =contrib/=
120 directory to your load-path:
122 #+begin_src emacs-lisp
123 (add-to-list 'load-path "~/path/to/orgdir/contrib/lisp" t)
126 Optionally, you can compile the files and/or install them in your
127 system. Run =make help= to list compilation and installation options.
129 *** Using Org's git repository
134 You can clone Org's repository and install Org like this:
138 $ git clone git://orgmode.org/org-mode.git
142 Note that in this case, ~make autoloads~ is mandatory: it defines
143 Org's version in =org-version.el= and Org's autoloads in
146 Remember to add the correct load-path as described in the method
149 You can also compile with =make=, generate the documentation with
150 =make doc=, create a local configuration with =make config= and
151 install Org with =make install=. Please run =make help= to get the
152 list of compilation/installation options.
154 For more detailed explanations on Org's build system, please check the
155 Org Build System page on [[http://orgmode.org/worg/dev/org-build-system.html][Worg]].
159 :DESCRIPTION: How to activate Org for certain buffers.
164 #+cindex: global key bindings
165 #+cindex: key bindings, global
167 Org mode buffers need Font Lock to be turned on: this is the default
170 There are compatibility issues between Org mode and some other Elisp
171 packages (see [[*Packages that conflict with Org mode]]). Please take the
172 time to check the list.
175 #+findex: org-capture
176 #+findex: org-store-link
177 #+findex: org-iswitchb
178 The four Org commands ~org-store-link~, ~org-capture~, ~org-agenda~,
179 and ~org-iswitchb~ be accessible through global keys -- i.e., anywhere
180 in Emacs, not just in Org buffers. Here are suggested bindings for
181 these keys, please modify the keys to your own liking.
183 #+begin_src emacs-lisp
184 (global-set-key "\C-cl" 'org-store-link)
185 (global-set-key "\C-ca" 'org-agenda)
186 (global-set-key "\C-cc" 'org-capture)
187 (global-set-key "\C-cb" 'org-iswitchb)
190 #+cindex: Org mode, turning on
191 Files with the =.org= extension use Org mode by default. To turn on
192 Org mode in a file that does not have the extension =.org=, make the
193 first line of a file look like this:
195 : MY PROJECTS -*- mode: org; -*-
197 #+vindex: org-insert-mode-line-in-empty-file
199 which selects Org mode for this buffer no matter what the file's name
200 is. See also the variable ~org-insert-mode-line-in-empty-file~.
202 Many commands in Org work on the region if the region is /active/. To
203 make use of this, you need to have ~transient-mark-mode~ turned on,
204 which is the default. If you do not like ~transient-mark-mode~, you
205 can create an active region by using the mouse to select a region, or
206 pressing {{{kbd(C-SPC)}}} twice before moving the cursor.
210 :DESCRIPTION: Bug reports, ideas, patches, etc.
213 #+cindex: bug reports
214 #+cindex: reporting a bug
218 If you find problems with Org, or if you have questions, remarks, or
219 ideas about it, please mail to the Org mailing list
220 [[mailto:emacs-orgmode@gnu.org]]. You can subscribe to the list [[https://lists.gnu.org/mailman/listinfo/emacs-orgmode][on this
221 web page]]. If you are not a member of the mailing list, your mail will
222 be passed to the list after a moderator has approved it[fn:2].
224 #+findex: org-version
225 #+findex: org-submit-bug-report
226 For bug reports, please first try to reproduce the bug with the latest
227 version of Org available -- if you are running an outdated version, it
228 is quite possible that the bug has been fixed already. If the bug
229 persists, prepare a report and provide as much information as
230 possible, including the version information of Emacs ({{{kbd(M-x
231 emacs-version)}}}) and Org ({{{kbd(M-x org-version)}}}), as well as
232 the Org related setup in the Emacs init file. The easiest way to do
233 this is to use the command
235 : M-x org-submit-bug-report <RET>
238 which puts all this information into an Emacs mail buffer so that you
239 only need to add your description. If you are not sending the Email
240 from within Emacs, please copy and paste the content into your Email
243 Sometimes you might face a problem due to an error in your Emacs or
244 Org mode setup. Before reporting a bug, it is very helpful to start
245 Emacs with minimal customizations and reproduce the problem. Doing so
246 often helps you determine if the problem is with your customization or
247 with Org mode itself. You can start a typical minimal session with
248 a command like the example below.
250 : $ emacs -Q -l /path/to/minimal-org.el
252 However if you are using Org mode as distributed with Emacs, a minimal
253 setup is not necessary. In that case it is sufficient to start Emacs
254 as =emacs -Q=. The =minimal-org.el= setup file can have contents as
257 #+begin_src emacs-lisp
258 ;;; Minimal setup to load latest `org-mode'.
260 ;; Activate debugging.
261 (setq debug-on-error t
265 ;; Add latest Org mode to load path.
266 (add-to-list 'load-path (expand-file-name "/path/to/org-mode/lisp"))
267 (add-to-list 'load-path (expand-file-name "/path/to/org-mode/contrib/lisp" t))
270 If an error occurs, a "backtrace" can be very useful -- see below on
271 how to create one. Often a small example file helps, along with clear
274 1. What exactly did you do?
275 2. What did you expect to happen?
276 3. What happened instead?
279 Thank you for helping to improve this program.
281 *** How to create a useful backtrace
286 #+cindex: backtrace of an error
287 If working with Org produces an error with a message you do not
288 understand, you may have hit a bug. The best way to report this is by
289 providing, in addition to what was mentioned above, a backtrace. This
290 is information from the built-in debugger about where and how the
291 error occurred. Here is how to produce a useful backtrace:
293 1. Reload uncompiled versions of all Org mode Lisp files. The
294 backtrace contains much more information if it is produced with
295 uncompiled code. To do this, use
297 : C-u M-x org-reload <RET>
300 or, from the menu: Org \rarr Refresh/Reload \rarr Reload Org uncompiled.
302 2. Then, activate the debugger:
304 : M-x toggle-debug-or-errror <RET>
307 or, from the menu: Options \rarr Enter Debugger on Error.
309 3. Do whatever you have to do to hit the error. Do not forget to
310 document the steps you take.
312 4. When you hit the error, a =*Backtrace*= buffer appears on the
313 screen. Save this buffer to a file -- for example using {{{kbd(C-x
314 C-w)}}} -- and attach it to your bug report.
316 ** Typesetting conventions used in this manual
318 :DESCRIPTION: Typesetting conventions used in this manual.
319 :ALT_TITLE: Conventions
322 *** TODO keywords, tags, properties, etc.
327 Org uses various syntactical elements: TODO keywords, tags, property
328 names, keywords, blocks, etc. In this manual we use the following
331 #+attr_texinfo: :sep ,
332 - =TODO=, =WAITING= :: TODO keywords are written with all capitals,
333 even if they are user-defined.
335 - =boss=, =ARCHIVE= :: User-defined tags are written in lowercase;
336 built-in tags with special meaning are written with all capitals.
338 - =Release=, =PRIORITY= :: User-defined properties are capitalized;
339 built-in properties with special meaning are written with all
342 - =TITLE=, =BEGIN= ... =END= :: Keywords and blocks are written in
343 uppercase to enhance their readability, but you can use lowercase
346 *** Key bindings and commands
353 The manual suggests a few global key bindings, in particular
354 {{{kbd(C-c a)}}} for ~org-agenda~ and {{{kbd(C-c c)}}} for
355 ~org-capture~. These are only suggestions, but the rest of the manual
356 assumes that these key bindings are in place in order to list commands
359 Also, the manual lists both the keys and the corresponding commands
360 for accessing a functionality. Org mode often uses the same key for
361 different functions, depending on context. The command that is bound
362 to such keys has a generic name, like ~org-metaright~. In the manual
363 we will, wherever possible, give the function that is internally
364 called by the generic command. For example, in the chapter on
365 document structure, {{{kbd(M-right)}}} will be listed to call
366 ~org-do-demote~, while in the chapter on tables, it will be listed to
367 call ~org-table-move-column-right~.
371 :DESCRIPTION: A tree works like your brain.
373 #+cindex: document structure
374 #+cindex: structure of document
376 Org is based on Outline mode and provides flexible commands to
377 edit the structure of the document.
381 :DESCRIPTION: Org is based on Outline mode.
384 #+cindex: Outline mode
386 Org is implemented on top of Outline mode. Outlines allow a document
387 to be organized in a hierarchical structure, which, least for me, is
388 the best representation of notes and thoughts. An overview of this
389 structure is achieved by folding, i.e., hiding large parts of the
390 document to show only the general document structure and the parts
391 currently being worked on. Org greatly simplifies the use of outlines
392 by compressing the entire show and hide functionalities into a single
393 command, ~org-cycle~, which is bound to the {{{kbd(TAB)}}} key.
397 :DESCRIPTION: How to typeset Org tree headlines.
400 #+cindex: outline tree
401 #+vindex: org-special-ctrl-a/e
402 #+vindex: org-special-ctrl-k
403 #+vindex: org-ctrl-k-protect-subtree
405 Headlines define the structure of an outline tree. The headlines in
406 Org start with one or more stars, on the left margin[fn:3]. For
410 ,* Top level headline
416 ,* Another top level headline
419 #+vindex: org-footnote-section
421 Note that the name defined in ~org-footnote-section~ is reserved. Do
422 not use it as a title for your own headings.
424 Some people find the many stars too noisy and would prefer an outline
425 that has whitespace followed by a single star as headline starters.
426 See [[*A cleaner outline view]].
428 #+vindex: org-cycle-separator-lines
429 An empty line after the end of a subtree is considered part of it and
430 is hidden when the subtree is folded. However, if you leave at least
431 two empty lines, one empty line remains visible after folding the
432 subtree, in order to structure the collapsed view. See the variable
433 ~org-cycle-separator-lines~ to modify this behavior.
435 ** Visibility cycling
437 :DESCRIPTION: Show and hide, much simplified.
439 #+cindex: cycling, visibility
440 #+cindex: visibility cycling
441 #+cindex: trees, visibility
442 #+cindex: show hidden text
445 *** Global and local cycling
447 :DESCRIPTION: Cycling through various visibility states.
449 #+cindex: subtree visibility states
450 #+cindex: subtree cycling
451 #+cindex: folded, subtree visibility state
452 #+cindex: children, subtree visibility state
453 #+cindex: subtree, subtree visibility state
455 Outlines make it possible to hide parts of the text in the buffer.
456 Org uses just two commands, bound to {{{kbd(TAB)}}} and
457 {{{kbd(S-TAB)}}} to change the visibility in the buffer.
459 #+attr_texinfo: :sep ,
460 - {{{kbd(TAB)}}} (~org-cycle~) ::
464 /Subtree cycling/: Rotate current subtree among the states
467 ,-> FOLDED -> CHILDREN -> SUBTREE --.
468 '-----------------------------------'
471 #+vindex: org-cycle-emulate-tab
472 The cursor must be on a headline for this to work[fn:4].
474 - {{{kbd(S-TAB)}}} (~org-global-cycle~), {{{kbd(C-u TAB)}}} ::
476 #+cindex: global visibility states
477 #+cindex: global cycling
478 #+cindex: overview, global visibility state
479 #+cindex: contents, global visibility state
480 #+cindex: show all, global visibility state
483 #+findex: org-global-cycle
484 /Global cycling/: Rotate the entire buffer among the states
487 ,-> OVERVIEW -> CONTENTS -> SHOW ALL --.
488 '--------------------------------------'
491 When {{{kbd(S-TAB)}}} is called with a numeric prefix argument N,
492 the CONTENTS view up to headlines of level N are shown. Note
493 that inside tables (see [[*Tables]]), {{{kbd(S-TAB)}}} jumps to the
494 previous field instead.
496 #+vindex: org-cycle-global-at-bob
497 You can run global cycling using {{{kbd(TAB)}}} only if point is
498 at the very beginning of the buffer, but not on a headline, and
499 ~org-cycle-global-at-bob~ is set to a non-~nil~ value.
501 - {{{kbd(C-u C-u TAB)}}} (~org-set-startup-visibility~) ::
503 #+cindex: startup visibility
504 #+kindex: C-u C-u TAB
505 #+findex: org-set-startup-visibility
506 Switch back to the startup visibility of the buffer (see [[*Initial
509 - {{{kbd(C-u C-u C-u TAB)}}} (~outline-show-all~) ::
511 #+cindex: show all, command
512 #+kindex: C-u C-u C-u TAB
513 #+findex: outline-show-all
514 Show all, including drawers.
516 - {{{kbd(C-c C-r)}}} (~org-reveal~) ::
518 #+cindex: revealing context
521 Reveal context around point, showing the current entry, the
522 following heading and the hierarchy above. Useful for working
523 near a location that has been exposed by a sparse tree command
524 (see [[*Sparse trees]]) or an agenda command (see [[*Commands in the
525 agenda buffer]]). With a prefix argument show, on each level, all
526 sibling headings. With a double prefix argument, also show the
527 entire subtree of the parent.
529 - {{{kbd(C-c C-k)}}} (~outline-show-branches~) ::
531 #+cindex: show branches, command
533 #+findex: outline-show-branches
534 Expose all the headings of the subtree, CONTENTS view for just
537 - {{{kbd(C-c TAB)}}} (~outline-show-children~) ::
539 #+cindex: show children, command
541 #+findex: outline-show-children
542 Expose all direct children of the subtree. With a numeric prefix
543 argument N, expose all children down to level N.
545 - {{{kbd(C-c C-x b)}}} (~org-tree-to-indirect-buffer~) ::
548 #+findex: org-tree-to-indirect-buffer
549 Show the current subtree in an indirect buffer[fn:5]. With
550 a numeric prefix argument, N, go up to level N and then take that
551 tree. If N is negative then go up that many levels. With
552 a {{{kbd(C-u)}}} prefix, do not remove the previously used
555 - {{{kbd(C-c C-x v)}}} (~org-copy-visible~) ::
558 #+findex: org-copy-visible
559 Copy the /visible/ text in the region into the kill ring.
561 *** Initial visibility
563 :DESCRIPTION: Setting the initial visibility state.
566 #+vindex: org-startup-folded
567 When Emacs first visits an Org file, the global state is set to
568 OVERVIEW, i.e., only the top level headlines are visible[fn:6]. This
569 can be configured through the variable ~org-startup-folded~, or on
570 a per-file basis by adding one of the following lines anywhere in the
573 #+cindex: STARTUP, keyword
578 ,#+STARTUP: showeverything
581 #+cindex: VISIBILITY, property
583 Furthermore, any entries with a =VISIBILITY= property (see [[*Properties
584 and columns]]) get their visibility adapted accordingly. Allowed values
585 for this property are =folded=, =children=, =content=, and ~all~.
587 - {{{kbd(C-u C-u TAB)}}} (~org-set-startup-visibility~) ::
589 #+kindex: C-u C-u TAB
590 #+findex: org-set-startup-visibility
591 Switch back to the startup visibility of the buffer, i.e.,
592 whatever is requested by startup options and =VISIBILITY=
593 properties in individual entries.
595 *** Catching invisible edits
597 :DESCRIPTION: Preventing mistakes when editing invisible parts.
599 #+cindex: edits, catching invisible
601 #+vindex: org-catch-invisible-edits
602 Sometimes you may inadvertently edit an invisible part of the buffer
603 and be confused on what has been edited and how to undo the mistake.
604 Setting ~org-catch-invisible-edits~ to non-~nil~ helps preventing
605 this. See the docstring of this option on how Org should catch
606 invisible edits and process them.
610 :DESCRIPTION: Jumping to other headlines.
612 #+cindex: motion, between headlines
613 #+cindex: jumping, to headlines
614 #+cindex: headline navigation
616 The following commands jump to other headlines in the buffer.
618 - {{{kbd(C-c C-n)}}} (~outline-next-visible-heading~) ::
621 #+findex: outline-next-visible-heading
624 - {{{kbd(C-c C-p)}}} (~outline-previous-visible-heading~) ::
627 #+findex: outline-previous-visible-heading
630 - {{{kbd(C-c C-f)}}} (~org-forward-same-level~) ::
633 #+findex: org-forward-same-level
634 Next heading same level.
636 - {{{kbd(C-c C-b)}}} (~org-backward-same-level~) ::
639 #+findex: org-backward-same-level
640 Previous heading same level.
642 - {{{kbd(C-c C-u)}}} (~outline-up-heading~) ::
645 #+findex: outline-up-heading
646 Backward to higher level heading.
648 - {{{kbd(C-c C-j)}}} (~org-goto~) ::
652 #+vindex: org-goto-auto-isearch
653 Jump to a different place without changing the current outline
654 visibility. Shows the document structure in a temporary buffer,
655 where you can use the following keys to find your destination:
657 #+attr_texinfo: :columns 0.3 0.7
658 | {{{kbd(TAB)}}} | Cycle visibility. |
659 | {{{kbd(down)}}} / {{{kbd(up)}}} | Next/previous visible headline. |
660 | {{{kbd(RET)}}} | Select this location. |
661 | {{{kbd(/)}}} | Do a Sparse-tree search |
664 The following keys work if you turn off ~org-goto-auto-isearch~
666 #+attr_texinfo: :columns 0.3 0.7
667 | {{{kbd(n)}}} / {{{kbd(p)}}} | Next/previous visible headline. |
668 | {{{kbd(f)}}} / {{{kbd(b)}}} | Next/previous headline same level. |
669 | {{{kbd(u)}}} | One level up. |
670 | {{{kbd(0)}}} ... {{{kbd(9)}}} | Digit argument. |
671 | {{{kbd(q)}}} | Quit. |
673 #+vindex: org-goto-interface
675 See also the variable ~org-goto-interface~.
679 :DESCRIPTION: Changing sequence and level of headlines.
681 #+cindex: structure editing
682 #+cindex: headline, promotion and demotion
683 #+cindex: promotion, of subtrees
684 #+cindex: demotion, of subtrees
685 #+cindex: subtree, cut and paste
686 #+cindex: pasting, of subtrees
687 #+cindex: cutting, of subtrees
688 #+cindex: copying, of subtrees
689 #+cindex: sorting, of subtrees
690 #+cindex: subtrees, cut and paste
692 - {{{kbd(M-RET)}}} (~org-meta-return~) ::
695 #+findex: org-meta-return
696 #+vindex: org-M-RET-may-split-line
697 Insert a new heading, item or row.
699 If the command is used at the /beginning/ of a line, and if there
700 is a heading or a plain list item (see [[*Plain lists]]) at point,
701 the new heading/item is created /before/ the current line. When
702 used at the beginning of a regular line of text, turn that line
705 When this command is used in the middle of a line, the line is
706 split and the rest of the line becomes the new item or headline.
707 If you do not want the line to be split, customize
708 ~org-M-RET-may-split-line~.
710 Calling the command with a {{{kbd(C-u)}}} prefix unconditionally
711 inserts a new heading at the end of the current subtree, thus
712 preserving its contents. With a double {{{kbd(C-u C-u)}}}
713 prefix, the new heading is created at the end of the parent
716 - {{{kbd(C-RET)}}} (~org-insert-heading-respect-content~) ::
719 #+findex: org-insert-heading-respect-content
720 Insert a new heading at the end of the current subtree.
722 - {{{kbd(M-S-RET)}}} (~org-insert-todo-heading~) ::
725 #+findex: org-insert-todo-heading
726 #+vindex: org-treat-insert-todo-heading-as-state-change
727 Insert new TODO entry with same level as current heading. See
729 ~org-treat-insert-todo-heading-as-state-change~.
731 - {{{kbd(C-S-RET)}}} (~org-insert-todo-heading-respect-content~) ::
734 #+findex: org-insert-todo-heading-respect-content
735 Insert new TODO entry with same level as current heading. Like
736 {{{kbd(C-RET)}}}, the new headline is inserted after the current
739 - {{{kbd(TAB)}}} (~org-cycle~) ::
743 In a new entry with no text yet, the first {{{kbd(TAB)}}} demotes
744 the entry to become a child of the previous one. The next
745 {{{kbd(TAB)}}} makes it a parent, and so on, all the way to top
746 level. Yet another {{{kbd(TAB)}}}, and you are back to the
749 - {{{kbd(M-left)}}} (~org-do-promote~) ::
752 #+findex: org-do-promote
753 Promote current heading by one level.
755 - {{{kbd(M-right)}}} (~org-do-demote~) ::
758 #+findex: org-do-demote
759 Demote current heading by one level.
761 - {{{kbd(M-S-left)}}} (~org-promote-subtree~) ::
764 #+findex: org-promote-subtree
765 Promote the current subtree by one level.
767 - {{{kbd(M-S-right)}}} (~org-demote-subtree~) ::
770 #+findex: org-demote-subtree
771 Demote the current subtree by one level.
773 - {{{kbd(M-up)}}} (~org-move-subtree-up~) ::
776 #+findex: org-move-subtree-up
777 Move subtree up -- swap with previous subtree of same level.
779 - {{{kbd(M-down)}}} (~org-move-subtree-down~) ::
782 #+findex: org-move-subtree-down
783 Move subtree down -- swap with next subtree of same level.
785 - {{{kbd(C-c @)}}} (~org-mark-subtree~) ::
788 #+findex: org-mark-subtree
789 Mark the subtree at point. Hitting repeatedly marks subsequent
790 subtrees of the same level as the marked subtree.
792 - {{{kbd(C-c C-x C-w)}}} (~org-cut-subtree~) ::
794 #+kindex: C-c C-x C-w
795 #+findex: org-cut-subtree
796 Kill subtree, i.e., remove it from buffer but save in kill ring.
797 With a numeric prefix argument N, kill N sequential subtrees.
799 - {{{kbd(C-c C-x M-w)}}} (~org-copy-subtree~) ::
801 #+kindex: C-c C-x M-w
802 #+findex: org-copy-subtree
803 Copy subtree to kill ring. With a numeric prefix argument N,
804 copy the N sequential subtrees.
806 - {{{kbd(C-c C-x C-y)}}} (~org-paste-subtree~) ::
808 #+kindex: C-c C-x C-y
809 #+findex: org-paste-subtree
810 Yank subtree from kill ring. This does modify the level of the
811 subtree to make sure the tree fits in nicely at the yank
812 position. The yank level can also be specified with a numeric
813 prefix argument, or by yanking after a headline marker like
816 - {{{kbd(C-y)}}} (~org-yank~) ::
820 #+vindex: org-yank-adjusted-subtrees
821 #+vindex: org-yank-folded-subtrees
822 Depending on the variables ~org-yank-adjusted-subtrees~ and
823 ~org-yank-folded-subtrees~, Org's internal ~yank~ command pastes
824 subtrees folded and in a clever way, using the same command as
825 {{{kbd(C-c C-x C-y)}}}. With the default settings, no level
826 adjustment takes place, but the yanked tree is folded unless
827 doing so would swallow text previously visible. Any prefix
828 argument to this command forces a normal ~yank~ to be executed,
829 with the prefix passed along. A good way to force a normal yank
830 is {{{kbd(C-u C-y)}}}. If you use ~yank-pop~ after a yank, it
831 yanks previous kill items plainly, without adjustment and
834 - {{{kbd(C-c C-x c)}}} (~org-clone-subtree-with-time-shift~) ::
837 #+findex: org-clone-subtree-with-time-shift
838 Clone a subtree by making a number of sibling copies of it. You
839 are prompted for the number of copies to make, and you can also
840 specify if any timestamps in the entry should be shifted. This
841 can be useful, for example, to create a number of tasks related
842 to a series of lectures to prepare. For more details, see the
843 docstring of the command ~org-clone-subtree-with-time-shift~.
845 - {{{kbd(C-c C-w)}}} (~org-refile~) ::
849 Refile entry or region to a different location. See [[Refile and
852 - {{{kbd(C-c ^)}}} (~org-sort~) ::
856 Sort same-level entries. When there is an active region, all
857 entries in the region are sorted. Otherwise the children of the
858 current headline are sorted. The command prompts for the sorting
859 method, which can be alphabetically, numerically, by time --
860 first timestamp with active preferred, creation time, scheduled
861 time, deadline time --, by priority, by TODO keyword -- in the
862 sequence the keywords have been defined in the setup -- or by the
863 value of a property. Reverse sorting is possible as well. You
864 can also supply your own function to extract the sorting key.
865 With a {{{kbd(C-u)}}} prefix, sorting is case-sensitive.
867 - {{{kbd(C-x n s)}}} (~org-narrow-to-subtree~) ::
870 #+findex: org-narrow-to-subtree
871 Narrow buffer to current subtree.
873 - {{{kbd(C-x n b)}}} (~org-narrow-to-block~) ::
876 #+findex: org-narrow-to-block
877 Narrow buffer to current block.
879 - {{{kbd(C-x n w)}}} (~widen~) ::
883 Widen buffer to remove narrowing.
885 - {{{kbd(C-c *)}}} (~org-toggle-heading~) ::
888 #+findex: org-toggle-heading
889 Turn a normal line or plain list item into a headline -- so that
890 it becomes a subheading at its location. Also turn a headline
891 into a normal line by removing the stars. If there is an active
892 region, turn all lines in the region into headlines. If the
893 first line in the region was an item, turn only the item lines
894 into headlines. Finally, if the first line is a headline, remove
895 the stars from all headlines in the region.
897 #+cindex: region, active
898 #+cindex: active region
899 #+cindex: transient mark mode
900 When there is an active region -- i.e., when Transient Mark mode is
901 active --, promotion and demotion work on all headlines in the region.
902 To select a region of headlines, it is best to place both point and
903 mark at the beginning of a line, mark at the beginning of the first
904 headline, and point at the line just after the last headline to
905 change. Note that when the cursor is inside a table (see [[*Tables]]),
906 the Meta-Cursor keys have different functionality.
910 :DESCRIPTION: Matches embedded in context.
911 :ALT_TITLE: Sparse trees
913 #+cindex: sparse trees
914 #+cindex: trees, sparse
915 #+cindex: folding, sparse trees
916 #+cindex: occur, command
918 #+vindex: org-show-context-detail
919 An important feature of Org mode is the ability to construct /sparse
920 trees/ for selected information in an outline tree, so that the entire
921 document is folded as much as possible, but the selected information
922 is made visible along with the headline structure above it[fn:7].
923 Just try it out and you will see immediately how it works.
925 Org mode contains several commands creating such trees, all these
926 commands can be accessed through a dispatcher:
928 - {{{kbd(C-c /)}}} (~org-sparse-tree~) ::
931 #+findex: org-sparse-tree
932 This prompts for an extra key to select a sparse-tree creating
935 - {{{kbd(C-c / r)}}} or {{{kbd(C-c / /)}}} (~org-occur~) ::
940 #+vindex: org-remove-highlights-with-change
941 Prompts for a regexp and shows a sparse tree with all matches.
942 If the match is in a headline, the headline is made visible. If
943 the match is in the body of an entry, headline and body are made
944 visible. In order to provide minimal context, also the full
945 hierarchy of headlines above the match is shown, as well as the
946 headline following the match. Each match is also highlighted;
947 the highlights disappear when the buffer is changed by an editing
948 command, or by pressing {{{kbd(C-c C-c)}}}[fn:8]. When called
949 with a {{{kbd(C-u)}}} prefix argument, previous highlights are
950 kept, so several calls to this command can be stacked.
952 - {{{kbd(M-g n)}}} or {{{kbd(M-g M-n)}}} (~next-error~) ::
957 Jump to the next sparse tree match in this buffer.
959 - {{{kbd(M-g p)}}} or {{{kbd(M-g M-p)}}} (~previous-error~) ::
963 #+findex: previous-error
964 Jump to the previous sparse tree match in this buffer.
966 #+vindex: org-agenda-custom-commands
968 For frequently used sparse trees of specific search strings, you can
969 use the variable ~org-agenda-custom-commands~ to define fast keyboard
970 access to specific sparse trees. These commands will then be
971 accessible through the agenda dispatcher (see [[*The agenda dispatcher]]).
974 #+begin_src emacs-lisp
975 (setq org-agenda-custom-commands
976 '(("f" occur-tree "FIXME")))
980 defines the key {{{kbd(C-c a f)}}} as a shortcut for creating a sparse
981 tree matching the string =FIXME=.
983 The other sparse tree commands select headings based on TODO keywords,
984 tags, or properties and are discussed later in this manual.
987 #+cindex: printing sparse trees
988 #+cindex: visible text, printing
989 To print a sparse tree, you can use the Emacs command
990 ~ps-print-buffer-with-faces~ which does not print invisible parts of
991 the document. Or you can use the command {{{kbd(C-c C-e v)}}} to
992 export only the visible part of the document and print the resulting
997 :DESCRIPTION: Additional structure within an entry.
998 :ALT_TITLE: Plain lists
1000 #+cindex: plain lists
1001 #+cindex: lists, plain
1002 #+cindex: lists, ordered
1003 #+cindex: ordered lists
1005 Within an entry of the outline tree, hand-formatted lists can provide
1006 additional structure. They also provide a way to create lists of
1007 checkboxes (see [[*Checkboxes]]). Org supports editing such lists, and
1008 every exporter (see [[*Exporting]]) can parse and format them.
1010 Org knows ordered lists, unordered lists, and description lists.
1012 #+attr_texinfo: :indic @bullet
1013 - /Unordered/ list items start with =-=, =+=, or =*=[fn:9] as bullets.
1016 #+vindex: org-plain-list-ordered-item-terminator
1017 #+vindex: org-alphabetical-lists
1018 /Ordered/ list items start with a numeral followed by either
1019 a period or a right parenthesis[fn:10], such as =1.= or =1)=[fn:11]
1020 If you want a list to start with a different value -- e.g., 20 --
1021 start the text of the item with =[@20]=[fn:12]. Those constructs
1022 can be used in any item of the list in order to enforce a particular
1025 - /Description/ list items are unordered list items, and contain the
1026 separator =::= to distinguish the description /term/ from the
1029 Items belonging to the same list must have the same indentation on the
1030 first line. In particular, if an ordered list reaches number =10.=,
1031 then the 2-digit numbers must be written left-aligned with the other
1032 numbers in the list. An item ends before the next line that is less
1033 or equally indented than its bullet/number.
1035 A list ends whenever every item has ended, which means before any line
1036 less or equally indented than items at top level. It also ends before
1037 two blank lines. In that case, all items are closed. Here is an
1041 ,* Lord of the Rings
1042 My favorite scenes are (in this order)
1043 1. The attack of the Rohirrim
1044 2. Eowyn's fight with the witch king
1045 + this was already my favorite scene in the book
1046 + I really like Miranda Otto.
1047 3. Peter Jackson being shot by Legolas
1049 He makes a really funny face when it happens.
1050 But in the end, no individual scenes matter but the film as a whole.
1051 Important actors in this film are:
1052 - Elijah Wood :: He plays Frodo
1053 - Sean Astin :: He plays Sam, Frodo's friend. I still remember him
1054 very well from his role as Mikey Walsh in /The Goonies/.
1057 Org supports these lists by tuning filling and wrapping commands to
1058 deal with them correctly, and by exporting them properly (see
1059 [[Exporting]]). Since indentation is what governs the structure of these
1060 lists, many structural constructs like =#+BEGIN_= blocks can be
1061 indented to signal that they belong to a particular item.
1063 #+vindex: org-list-demote-modify-bullet
1064 #+vindex: org-list-indent-offset
1065 If you find that using a different bullet for a sub-list -- than that
1066 used for the current list-level -- improves readability, customize the
1067 variable ~org-list-demote-modify-bullet~. To get a greater difference
1068 of indentation between items and theirs sub-items, customize
1069 ~org-list-indent-offset~.
1071 #+vindex: org-list-automatic-rules
1072 The following commands act on items when the cursor is in the first
1073 line of an item -- the line with the bullet or number. Some of them
1074 imply the application of automatic rules to keep list structure
1075 intact. If some of these actions get in your way, configure
1076 ~org-list-automatic-rules~ to disable them individually.
1078 #+attr_texinfo: :sep ,
1079 - {{{kbd(TAB)}}} (~org-cycle~) ::
1081 #+cindex: cycling, in plain lists
1084 #+vindex: org-cycle-include-plain-lists
1085 Items can be folded just like headline levels. Normally this
1086 works only if the cursor is on a plain list item. For more
1087 details, see the variable ~org-cycle-include-plain-lists~. If
1088 this variable is set to ~integrate~, plain list items are
1089 treated like low-level headlines. The level of an item is then
1090 given by the indentation of the bullet/number. Items are
1091 always subordinate to real headlines, however; the hierarchies
1092 remain completely separated. In a new item with no text yet,
1093 the first {{{kbd(TAB)}}} demotes the item to become a child of
1094 the previous one. Subsequent {{{kbd(TAB)}}}s move the item to
1095 meaningful levels in the list and eventually get it back to its
1098 - {{{kbd(M-RET)}}} (~org-insert-heading~) ::
1101 #+findex: org-insert-heading
1102 #+vindex: org-M-RET-may-split-line
1103 Insert new item at current level. With a prefix argument,
1104 force a new heading (see [[Structure editing]]). If this command
1105 is used in the middle of an item, that item is /split/ in two,
1106 and the second part becomes the new item[fn:13]. If this
1107 command is executed /before item's body/, the new item is
1108 created /before/ the current one.
1110 - {{{kbd(M-S-RET)}}} ::
1113 Insert a new item with a checkbox (see [[Checkboxes]]).
1115 - {{{kbd(S-up)}}}, {{{kbd(S-down)}}} ::
1119 #+cindex: shift-selection-mode
1120 #+vindex: org-support-shift-select
1121 #+vindex: org-list-use-circular-motion
1122 Jump to the previous/next item in the current list, but only if
1123 ~org-support-shift-select~ is off[fn:14]. If not, you can
1124 still use paragraph jumping commands like {{{kbd(C-up)}}}
1125 and {{{kbd(C-down)}}} to quite similar effect.
1127 - {{{kbd(M-up)}}}, {{{kbd(M-down)}}} ::
1131 Move the item including subitems up/down[fn:15] -- swap with
1132 previous/next item of same indentation. If the list is
1133 ordered, renumbering is automatic.
1135 - {{{kbd(M-left)}}}, {{{kbd(M-right)}}} ::
1139 Decrease/increase the indentation of an item, leaving children
1142 - {{{kbd(M-S-left)}}}, {{{kbd(M-S-right)}}} ::
1146 Decrease/increase the indentation of the item, including
1147 subitems. Initially, the item tree is selected based on
1148 current indentation. When these commands are executed several
1149 times in direct succession, the initially selected region is
1150 used, even if the new indentation would imply a different
1151 hierarchy. To use the new hierarchy, break the command chain
1152 with a cursor motion or so.
1154 As a special case, using this command on the very first item of
1155 a list moves the whole list. This behavior can be disabled by
1156 configuring ~org-list-automatic-rules~. The global indentation
1157 of a list has no influence on the text /after/ the list.
1159 - {{{kbd(C-c C-c)}}} ::
1162 If there is a checkbox (see [[Checkboxes]]) in the item line,
1163 toggle the state of the checkbox. In any case, verify bullets
1164 and indentation consistency in the whole list.
1166 - {{{kbd(C-c -)}}} ::
1169 #+vindex: org-plain-list-ordered-item-terminator
1170 Cycle the entire list level through the different
1171 itemize/enumerate bullets (=-=, =+=, =*=, =1.=, =1)=) or
1172 a subset of them, depending on
1173 ~org-plain-list-ordered-item-terminator~, the type of list, and
1174 its indentation. With a numeric prefix argument N, select the
1175 Nth bullet from this list. If there is an active region when
1176 calling this, selected text is changed into an item. With
1177 a prefix argument, all lines are converted to list items. If
1178 the first line already was a list item, any item marker is
1179 removed from the list. Finally, even without an active region,
1180 a normal line is converted into a list item.
1182 - {{{kbd(C-c *)}}} ::
1185 Turn a plain list item into a headline -- so that it becomes
1186 a subheading at its location. See [[*Structure editing]], for
1187 a detailed explanation.
1189 - {{{kbd(C-c C-*)}}} ::
1192 Turn the whole plain list into a subtree of the current
1193 heading. Checkboxes (see [[*Checkboxes]]) become TODO --
1194 respectively DONE -- keywords when unchecked -- respectively
1197 - {{{kbd(S-left)}}}, {{{kbd(S-right)}}} ::
1199 #+vindex: org-support-shift-select
1202 This command also cycles bullet styles when the cursor in on
1203 the bullet or anywhere in an item line, details depending on
1204 ~org-support-shift-select~.
1206 - {{{kbd(C-c ^)}}} ::
1209 #+cindex: sorting, of plain list
1210 Sort the plain list. Prompt for the sorting method:
1211 numerically, alphabetically, by time, or by custom function.
1215 :DESCRIPTION: Tucking stuff away.
1218 #+cindex: visibility cycling, drawers
1220 Sometimes you want to keep information associated with an entry, but
1221 you normally do not want to see it. For this, Org mode has /drawers/.
1222 They can contain anything but a headline and another drawer. Drawers
1226 ,** This is a headline
1227 Still outside the drawer
1229 This is inside the drawer.
1235 #+findex: org-insert-drawer
1236 You can interactively insert a drawer at point by calling
1237 ~org-insert-drawer~, which is bound to {{{kbd(C-c C-x d)}}}. With an
1238 active region, this command puts the region inside the drawer. With
1239 a prefix argument, this command calls ~org-insert-property-drawer~,
1240 which creates a =PROPERTIES= drawer right below the current headline.
1241 Org mode uses this special drawer for storing properties (see
1242 [[*Properties and columns]]). You cannot use it for anything else.
1244 Completion over drawer keywords is also possible using
1245 {{{kbd(M-TAB)}}}[fn:16].
1247 Visibility cycling (see [[*Visibility cycling]]) on the headline hides and
1248 shows the entry, but keep the drawer collapsed to a single line. In
1249 order to look inside the drawer, you need to move the cursor to the
1250 drawer line and press {{{kbd(TAB)}}} there.
1252 You can also arrange for state change notes (see [[Tracking TODO state
1253 changes]]) and clock times (see [[*Clocking work time]]) to be stored in
1254 a =LOGBOOK= drawer. If you want to store a quick note there, in
1255 a similar way to state changes, use
1257 - {{{kbd(C-c C-z)}}} ::
1260 Add a time-stamped note to the =LOGBOOK= drawer.
1264 :DESCRIPTION: Folding blocks.
1266 #+vindex: org-hide-block-startup
1267 #+cindex: blocks, folding
1269 Org mode uses =#+BEGIN= ... =#+END= blocks for various purposes from
1270 including source code examples (see [[*Literal examples]]) to capturing
1271 time logging information (see [[*Clocking work time]]). These blocks can
1272 be folded and unfolded by pressing {{{kbd(TAB)}}} in the =#+BEGIN=
1273 line. You can also get all blocks folded at startup by configuring
1274 the variable ~org-hide-block-startup~ or on a per-file basis by using
1276 #+cindex: STARTUP, keyword
1278 ,#+STARTUP: hideblocks
1279 ,#+STARTUP: nohideblocks
1282 ** Creating footnotes
1284 :DESCRIPTION: How footnotes are defined in Org's syntax.
1288 Org mode supports the creation of footnotes.
1290 A footnote is started by a footnote marker in square brackets in
1291 column 0, no indentation allowed. It ends at the next footnote
1292 definition, headline, or after two consecutive empty lines. The
1293 footnote reference is simply the marker in square brackets, inside
1294 text. Markers always start with =fn:=. For example:
1297 The Org homepage[fn:1] now looks a lot better than it used to.
1299 [fn:1] The link is: http://orgmode.org
1302 Org mode extends the number-based syntax to /named/ footnotes and
1303 optional inline definition. Here are the valid references:
1307 A named footnote reference, where {{{var(NAME)}}} is a unique
1308 label word, or, for simplicity of automatic creation, a number.
1310 - =[fn:: This is the inline definition of this footnote]= ::
1312 A LaTeX-like anonymous footnote where the definition is given
1313 directly at the reference point.
1315 - =[fn:NAME: a definition]= ::
1317 An inline definition of a footnote, which also specifies a name
1318 for the note. Since Org allows multiple references to the same
1319 note, you can then use =[fn:NAME]= to create additional
1322 #+vindex: org-footnote-auto-label
1323 Footnote labels can be created automatically, or you can create names
1324 yourself. This is handled by the variable ~org-footnote-auto-label~
1325 and its corresponding =STARTUP= keywords. See the docstring of that
1326 variable for details.
1328 #+texinfo: @noindent
1329 The following command handles footnotes:
1331 - {{{kbd(C-c C-x f)}}} :: The footnote action command.
1334 When the cursor is on a footnote reference, jump to the
1335 definition. When it is at a definition, jump to the -- first --
1338 #+vindex: org-footnote-define-inline
1339 #+vindex: org-footnote-section
1340 Otherwise, create a new footnote. Depending on the variable
1341 ~org-footnote-define-inline~[fn:17], the definition is placed
1342 right into the text as part of the reference, or separately into
1343 the location determined by the variable ~org-footnote-section~.
1345 When this command is called with a prefix argument, a menu of
1346 additional options is offered:
1348 #+attr_texinfo: :columns 0.1 0.9
1349 | {{{kbd(s)}}} | Sort the footnote definitions by reference sequence. |
1350 | {{{kbd(r)}}} | Renumber the simple =fn:N= footnotes. |
1351 | {{{kbd(S)}}} | Short for first {{{kbd(r)}}}, then {{{kbd(s)}}} action. |
1352 | {{{kbd(n)}}} | Rename all footnotes into a =fn:1= ... =fn:n= sequence. |
1353 | {{{kbd(d)}}} | Delete the footnote at point, including definition and references. |
1355 #+vindex: org-footnote-auto-adjust
1356 Depending on the variable ~org-footnote-auto-adjust~[fn:18],
1357 renumbering and sorting footnotes can be automatic after each
1358 insertion or deletion.
1360 - {{{kbd(C-c C-c)}}} ::
1363 If the cursor is on a footnote reference, jump to the definition.
1364 If it is at the definition, jump back to the reference. When
1365 called at a footnote location with a prefix argument, offer the
1366 same menu as {{{kbd(C-c C-x f)}}}.
1368 - {{{kbd(C-c C-o)}}} or {{{kbd(mouse-1/2)}}} ::
1373 Footnote labels are also links to the corresponding definition or
1374 reference, and you can use the usual commands to follow these
1377 ** The Orgstruct minor mode
1379 :DESCRIPTION: Structure editing outside Org.
1380 :ALT_TITLE: Orgstruct mode
1382 #+cindex: Orgstruct mode
1383 #+cindex: minor mode for structure editing
1385 If you like the intuitive way the Org mode structure editing and list
1386 formatting works, you might want to use these commands in other modes
1387 like Text mode or Mail mode as well. The minor mode ~orgstruct-mode~
1388 makes this possible. Toggle the mode with {{{kbd(M-x
1389 orgstruct-mode)}}}, or turn it on by default, for example in Message
1392 #+begin_src emacs-lisp
1393 (add-hook 'message-mode-hook 'turn-on-orgstruct)
1394 (add-hook 'message-mode-hook 'turn-on-orgstruct++)
1397 When this mode is active and the cursor is on a line that looks to Org
1398 like a headline or the first line of a list item, most structure
1399 editing commands will work, even if the same keys normally have
1400 different functionality in the major mode you are using. If the
1401 cursor is not in one of those special lines, Orgstruct mode lurks
1402 silently in the shadows.
1404 When you use ~orgstruct++-mode~, Org will also export indentation and
1405 Auto Fill settings into that mode, and detect item context after the
1406 first line of an item.
1408 #+vindex: orgstruct-heading-prefix-regexp
1409 You can also use Org structure editing to fold and unfold headlines in
1410 /any/ file, provided you defined ~orgstruct-heading-prefix-regexp~:
1411 the regular expression must match the local prefix to use before Org's
1412 headlines. For example, if you set this variable to ~";; "~ in Emacs
1413 Lisp files, you will be able to fold and unfold headlines in Emacs
1414 Lisp commented lines. Some commands like ~org-demote~ are disabled
1415 when the prefix is set, but folding/unfolding will work correctly.
1419 :DESCRIPTION: Formal description of Org's syntax.
1422 A reference document providing a formal description of Org's syntax is
1423 available as [[http://orgmode.org/worg/dev/org-syntax.html][a draft on Worg]], written and maintained by Nicolas
1424 Goaziou. It defines Org's core internal concepts such as =headlines=,
1425 =sections=, =affiliated keywords=, =(greater) elements= and =objects=.
1426 Each part of an Org file falls into one of the categories above.
1428 To explore the abstract structure of an Org buffer, run this in
1431 : M-: (org-element-parse-buffer) <RET>
1433 #+texinfo: @noindent
1434 It outputs a list containing the buffer's content represented as an
1435 abstract structure. The export engine relies on the information
1436 stored in this list. Most interactive commands -- e.g., for structure
1437 editing -- also rely on the syntactic meaning of the surrounding
1440 #+cindex: syntax checker
1443 You can check syntax in your documents using ~org-lint~ command.
1447 :DESCRIPTION: Pure magic for quick formatting.
1450 #+cindex: editing tables
1452 Org comes with a fast and intuitive table editor. Spreadsheet-like
1453 calculations are supported using the Emacs Calc package (see
1456 ** Built-in table editor
1458 :DESCRIPTION: Simple tables.
1460 #+cindex: table editor, built-in
1462 Org makes it easy to format tables in plain ASCII. Any line with =|=
1463 as the first non-whitespace character is considered part of a table.
1464 =|= is also the column separator[fn:19]. A table might look like
1468 | Name | Phone | Age |
1469 |-------+-------+-----|
1470 | Peter | 1234 | 17 |
1471 | Anna | 4321 | 25 |
1474 A table is re-aligned automatically each time you press
1475 {{{kbd(TAB)}}}, {{{kbd(RET)}}} or {{{kbd(C-c C-c)}}} inside the table.
1476 {{{kbd(TAB)}}} also moves to the next field -- {{{kbd(RET)}}} to the
1477 next row -- and creates new table rows at the end of the table or
1478 before horizontal lines. The indentation of the table is set by the
1479 first line. Any line starting with =|-= is considered as a horizontal
1480 separator line and will be expanded on the next re-align to span the
1481 whole table width. So, to create the above table, you would only type
1488 #+texinfo: @noindent
1489 and then press {{{kbd(TAB)}}} to align the table and start filling in
1490 fields. Even faster would be to type =|Name|Phone|Age= followed by
1493 When typing text into a field, Org treats {{{kbd(DEL)}}},
1494 {{{kbd(Backspace)}}}, and all character keys in a special way, so that
1495 inserting and deleting avoids shifting other fields. Also, when
1496 typing /immediately/ after the cursor was moved into a new field with
1497 {{{kbd(TAB)}}}, {{{kbd(S-TAB)}}} or {{{kbd(RET)}}}, the field is
1498 automatically made blank. If this behavior is too unpredictable for
1499 you, configure the option ~org-table-auto-blank-field~.
1501 *** Creation and conversion
1506 - {{{kbd(C-c |)}}} (~org-table-create-or-convert-from-region~) ::
1509 #+findex: org-table-create-or-convert-from-region
1510 Convert the active region to table. If every line contains at
1511 least one {{{kbd(TAB)}}} character, the function assumes that the
1512 material is tab separated. If every line contains a comma,
1513 comma-separated values (CSV) are assumed. If not, lines are
1514 split at whitespace into fields. You can use a prefix argument
1515 to force a specific separator: {{{kbd(C-u)}}} forces CSV,
1516 {{{kbd(C-u C-u)}}} forces {{{kbd(TAB)}}}, {{{kbd(C-u C-u C-u)}}}
1517 prompts for a regular expression to match the separator, and
1518 a numeric argument N indicates that at least N consecutive
1519 spaces, or alternatively a {{{kbd(TAB)}}} will be the separator.
1521 If there is no active region, this command creates an empty Org
1522 table. But it is easier just to start typing, like {{{kbd(|
1523 N a m e | P h o n e | A g e RET | - TAB)}}}.
1525 *** Re-aligning and field motion
1530 - {{{kbd(C-c C-c)}}} (~org-table-align~) ::
1533 #+findex: org-table-align
1534 Re-align the table without moving the cursor.
1536 - {{{kbd(TAB)}}} (~org-table-next-field~) ::
1539 #+findex: org-table-next-field
1540 Re-align the table, move to the next field. Creates a new row if
1543 - {{{kbd(C-c SPC)}}} (~org-table-blank-field~) ::
1546 #+findex: org-table-blank-field
1547 Blank the field at point.
1549 - {{{kbd(S-TAB)}}} (~org-table-previous-field~) ::
1552 #+findex: org-table-previous-field
1553 Re-align, move to previous field.
1555 - {{{kbd(RET)}}} (~org-table-next-row~) ::
1558 #+findex: org-table-next-row
1559 Re-align the table and move down to next row. Creates a new row
1560 if necessary. At the beginning or end of a line, {{{kbd(RET)}}}
1561 still inserts a new line, so it can be used to split a table.
1563 - {{{kbd(M-a)}}} (~org-table-beginning-of-field~) ::
1566 #+findex: org-table-beginning-of-field
1567 Move to beginning of the current table field, or on to the
1570 - {{{kbd(M-e)}}} (~org-table-end-of-field~) ::
1573 #+findex: org-table-end-of-field
1574 Move to end of the current table field, or on to the next field.
1576 *** Column and row editing
1581 - {{{kbd(M-left)}}} (~org-table-move-column-left~) ::
1584 #+findex: org-table-move-column-left
1585 Move the current column left.
1587 - {{{kbd(M-right)}}} (~org-table-move-column-right~) ::
1590 #+findex: org-table-move-column-right
1591 Move the current column right.
1593 - {{{kbd(M-S-left)}}} (~org-table-delete-column~) ::
1596 #+findex: org-table-delete-column
1597 Kill the current column.
1599 - {{{kbd(M-S-right)}}} (~org-table-insert-column~) ::
1602 #+findex: org-table-insert-column
1603 Insert a new column to the left of the cursor position.
1605 - {{{kbd(M-up)}}} (~org-table-move-row-up~) ::
1608 #+findex: org-table-move-row-up
1609 Move the current row up.
1611 - {{{kbd(M-down)}}} (~org-table-move-row-down~) ::
1614 #+findex: org-table-move-row-down
1615 Move the current row down.
1617 - {{{kbd(M-S-up)}}} (~org-table-kill-row~) ::
1620 #+findex: org-table-kill-row
1621 Kill the current row or horizontal line.
1623 - {{{kbd(M-S-down)}}} (~org-table-insert-row~) ::
1626 #+findex: org-table-insert-row
1627 Insert a new row above the current row. With a prefix argument,
1628 the line is created below the current one.
1630 - {{{kbd(C-c -)}}} (~org-table-insert-hline~) ::
1633 #+findex: org-table-insert-hline
1634 Insert a horizontal line below current row. With a prefix
1635 argument, the line is created above the current line.
1637 - {{{kbd(C-c RET)}}} (~org-table-hline-and-move~) ::
1640 #+findex: org-table-hline-and-move
1641 Insert a horizontal line below current row, and move the cursor
1642 into the row below that line.
1644 - {{{kbd(C-c ^)}}} (~org-table-sort-lines~) ::
1647 #+findex: org-table-sort-lines
1648 Sort the table lines in the region. The position of point
1649 indicates the column to be used for sorting, and the range of
1650 lines is the range between the nearest horizontal separator
1651 lines, or the entire table. If point is before the first column,
1652 you are prompted for the sorting column. If there is an active
1653 region, the mark specifies the first line and the sorting column,
1654 while point should be in the last line to be included into the
1655 sorting. The command prompts for the sorting type,
1656 alphabetically, numerically, or by time. You can sort in normal
1657 or reverse order. You can also supply your own key extraction
1658 and comparison functions. When called with a prefix argument,
1659 alphabetic sorting is case-sensitive.
1666 - {{{kbd(C-c C-x M-w)}}} (~org-table-copy-region~) ::
1668 #+kindex: C-c C-x M-w
1669 #+findex: org-table-copy-region
1670 Copy a rectangular region from a table to a special clipboard.
1671 Point and mark determine edge fields of the rectangle. If there
1672 is no active region, copy just the current field. The process
1673 ignores horizontal separator lines.
1675 - {{{kbd(C-c C-x C-w)}}} (~org-table-cut-region~) ::
1677 #+kindex: C-c C-x C-w
1678 #+findex: org-table-cut-region
1679 Copy a rectangular region from a table to a special clipboard,
1680 and blank all fields in the rectangle. So this is the "cut"
1683 - {{{kbd(C-c C-x C-y)}}} (~org-table-paste-rectangle~) ::
1685 #+kindex: C-c C-x C-y
1686 #+findex: org-table-paste-rectangle
1687 Paste a rectangular region into a table. The upper left corner
1688 ends up in the current field. All involved fields are
1689 overwritten. If the rectangle does not fit into the present
1690 table, the table is enlarged as needed. The process ignores
1691 horizontal separator lines.
1693 - {{{kbd(M-RET)}}} (~org-table-wrap-region~) ::
1696 #+findex: org-table-wrap-region
1697 Split the current field at the cursor position and move the rest
1698 to the line below. If there is an active region, and both point
1699 and mark are in the same column, the text in the column is
1700 wrapped to minimum width for the given number of lines.
1701 A numeric prefix argument may be used to change the number of
1702 desired lines. If there is no region, but you specify a prefix
1703 argument, the current field is made blank, and the content is
1704 appended to the field above.
1711 #+cindex: formula, in tables
1712 #+cindex: calculations, in tables
1714 - {{{kbd(C-c +)}}} (~org-table-sum~) ::
1717 #+findex: org-table-sum
1718 Sum the numbers in the current column, or in the rectangle
1719 defined by the active region. The result is shown in the echo
1720 area and can be inserted with {{{kbd(C-y)}}}.
1722 - {{{kbd(S-RET)}}} (~org-table-copy-down~) ::
1725 #+findex: org-table-copy-down
1726 #+vindex: org-table-copy-increment
1727 When current field is empty, copy from first non-empty field
1728 above. When not empty, copy current field down to next row and
1729 move cursor along with it. Depending on the variable
1730 ~org-table-copy-increment~, integer field values can be
1731 incremented during copy. Integers that are too large are not
1732 incremented, however. Also, a ~0~ prefix argument temporarily
1733 disables the increment. This key is also used by shift-selection
1734 and related modes (see [[*Packages that conflict with Org mode]]).
1741 - {{{kbd(C-c `)}}} (~org-table-edit-field~) ::
1744 #+findex: org-table-edit-field
1745 Edit the current field in a separate window. This is useful for
1746 fields that are not fully visible (see [[*Column width and
1747 alignment]]). When called with a {{{kbd(C-u)}}} prefix, just make
1748 the full field visible, so that it can be edited in place. When
1749 called with two {{{kbd(C-u)}}} prefixes, make the editor window
1750 follow the cursor through the table and always show the current
1751 field. The follow mode exits automatically when the cursor
1752 leaves the table, or when you repeat this command with {{{kbd(C-u
1755 - {{{kbd(M-x org-table-import)}}} ::
1757 #+findex: org-table-import
1758 Import a file as a table. The table should be TAB or whitespace
1759 separated. Use, for example, to import a spreadsheet table or
1760 data from a database, because these programs generally can write
1761 TAB-separated text files. This command works by inserting the
1762 file into the buffer and then converting the region to a table.
1763 Any prefix argument is passed on to the converter, which uses it
1764 to determine the separator.
1766 - {{{kbd(C-c |)}}} (~org-table-create-or-convert-from-region~) ::
1769 #+findex: org-table-create-or-convert-from-region
1770 Tables can also be imported by pasting tabular text into the Org
1771 buffer, selecting the pasted text with {{{kbd(C-x C-x)}}} and
1772 then using the {{{kbd(C-c |)}}} command (see [[*Creation and
1775 - {{{kbd(M-x org-table-export)}}} ::
1777 #+findex: org-table-export
1778 #+vindex: org-table-export-default-format
1779 Export the table, by default as a TAB-separated file. Use for
1780 data exchange with, for example, spreadsheet or database
1781 programs. The format used to export the file can be configured
1782 in the variable ~org-table-export-default-format~. You may also
1783 use properties =TABLE_EXPORT_FILE= and =TABLE_EXPORT_FORMAT= to
1784 specify the file name and the format for table export in
1785 a subtree. Org supports quite general formats for exported
1786 tables. The exporter format is the same as the format used by
1787 Orgtbl radio tables, see [[*Translator functions]], for a detailed
1790 ** Column width and alignment
1792 :DESCRIPTION: Overrule the automatic settings.
1794 #+cindex: narrow columns in tables
1795 #+cindex: alignment in tables
1797 The width of columns is automatically determined by the table editor.
1798 The alignment of a column is determined automatically from the
1799 fraction of number-like versus non-number fields in the column.
1801 #+vindex: org-table-automatic-realign
1802 Editing a field may modify alignment of the table. Moving
1803 a contiguous row or column -- i.e., using {{{kbd(TAB)}}} or
1804 {{{kbd(RET)}}} -- automatically re-aligns it. If you want to disable
1805 this behavior, set ~org-table-automatic-realign~ to ~nil~. In any
1806 case, you can always align manually a table:
1808 - {{{kbd(C-c C-c)}}} (~org-table-align~) ::
1811 #+findex: org-table-align
1812 Align the current table.
1814 #+texinfo: @noindent
1815 #+vindex: org-startup-align-all-tables
1816 Setting the option ~org-startup-align-all-tables~ re-aligns all tables
1817 in a file upon visiting it. You can also set this option on
1818 a per-file basis with:
1825 Sometimes a single field or a few fields need to carry more text,
1826 leading to inconveniently wide columns. Maybe you want to hide away
1827 several columns or display them with a fixed width, regardless of
1828 content, as shown in the following example.
1831 |---+---------------------+--------| |---+-------…|…|
1832 | | <6> | | | | <6> …|…|
1833 | 1 | one | some | ----\ | 1 | one …|…|
1834 | 2 | two | boring | ----/ | 2 | two …|…|
1835 | 3 | This is a long text | column | | 3 | This i…|…|
1836 |---+---------------------+--------| |---+-------…|…|
1839 To set the width of a column, one field anywhere in the column may
1840 contain just the string =<N>= where {{{var(N)}}} specifies the width
1841 as a number of characters. You control displayed width of columns
1842 with the following tools:
1844 - {{{kbd(C-c TAB)}}} (~org-table-toggle-column-width~) ::
1847 #+findex: org-table-toggle-column-width
1848 Shrink or expand current column.
1850 If a width cookie specifies a width W for the column, shrinking
1851 it displays the first W visible characters only. Otherwise, the
1852 column is shrunk to a single character.
1854 When called before the first column or after the last one, ask
1855 for a list of column ranges to operate on.
1857 - {{{kbd(C-u C-c TAB)}}} (~org-table-shrink~) ::
1859 #+kindex: C-u C-c TAB
1860 #+findex: org-table-shrink
1861 Shrink all columns with a column width. Expand the others.
1863 - {{{kbd(C-u C-u C-c TAB)}}} (~org-table-expand~) ::
1865 #+kindex: C-u C-u C-c TAB
1866 #+findex: org-table-expand
1869 To see the full text of a shrunk field, hold the mouse over it --
1870 a tool-tip window then shows the full content. Alternatively
1871 {{{kbd(C-h .)}}} (~display-local-help~) reveals the full content.
1872 For convenience, any change to a shrunk column expands it.
1874 #+vindex: org-startup-shrink-all-tables
1875 Setting the option ~org-startup-shrink-all-tables~ shrinks all columns
1876 containing a width cookie in a file the moment it is visited. You can
1877 also set this option on a per-file basis with:
1881 If you would like to overrule the automatic alignment of number-rich
1882 columns to the right and of string-rich columns to the left, you can
1883 use =<r>=, =<c>= or =<l>= in a similar fashion. You may also combine
1884 alignment and field width like this: =<r10>=.
1886 Lines which only contain these formatting cookies are removed
1887 automatically upon exporting the document.
1891 :DESCRIPTION: Grouping to trigger vertical lines.
1893 #+cindex: grouping columns in tables
1895 When Org exports tables, it does so by default without vertical lines
1896 because that is visually more satisfying in general. Occasionally
1897 however, vertical lines can be useful to structure a table into groups
1898 of columns, much like horizontal lines can do for groups of rows. In
1899 order to specify column groups, you can use a special row where the
1900 first field contains only =/=. The further fields can either contain
1901 =<= to indicate that this column should start a group, =>= to indicate
1902 the end of a column, or =<>= (no space between =<= and =>=) to make
1903 a column a group of its own. Upon export, boundaries between column
1904 groups are marked with vertical lines. Here is an example:
1907 | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
1908 |---+-----+-----+-----+---------+------------|
1909 | / | < | | > | < | > |
1910 | 1 | 1 | 1 | 1 | 1 | 1 |
1911 | 2 | 4 | 8 | 16 | 1.4142 | 1.1892 |
1912 | 3 | 9 | 27 | 81 | 1.7321 | 1.3161 |
1913 |---+-----+-----+-----+---------+------------|
1914 ,#+TBLFM: $2=$1^2::$3=$1^3::$4=$1^4::$5=sqrt($1)::$6=sqrt(sqrt(($1)))
1917 It is also sufficient to just insert the column group starters after
1918 every vertical line you would like to have:
1921 | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) |
1922 |---+-----+-----+-----+---------+------------|
1926 ** The Orgtbl minor mode
1928 :DESCRIPTION: The table editor as minor mode.
1929 :ALT_TITLE: Orgtbl mode
1931 #+cindex: Orgtbl mode
1932 #+cindex: minor mode for tables
1934 #+findex: orgtbl-mode
1935 If you like the intuitive way the Org table editor works, you might
1936 also want to use it in other modes like Text mode or Mail mode. The
1937 minor mode Orgtbl mode makes this possible. You can always toggle the
1938 mode with {{{kbd(M-x orgtbl-mode)}}}. To turn it on by default, for
1939 example in Message mode, use
1941 #+begin_src emacs-lisp
1942 (add-hook 'message-mode-hook 'turn-on-orgtbl)
1945 Furthermore, with some special setup, it is possible to maintain
1946 tables in arbitrary syntax with Orgtbl mode. For example, it is
1947 possible to construct LaTeX tables with the underlying ease and power
1948 of Orgtbl mode, including spreadsheet capabilities. For details, see
1949 [[*Tables in arbitrary syntax]].
1953 :DESCRIPTION: The table editor has spreadsheet capabilities.
1955 #+cindex: calculations, in tables
1956 #+cindex: spreadsheet capabilities
1957 #+cindex: Calc package
1959 The table editor makes use of the Emacs Calc package to implement
1960 spreadsheet-like capabilities. It can also evaluate Emacs Lisp forms
1961 to derive fields from other fields. While fully featured, Org's
1962 implementation is not identical to other spreadsheets. For example,
1963 Org knows the concept of a /column formula/ that will be applied to
1964 all non-header fields in a column without having to copy the formula
1965 to each relevant field. There is also a formula debugger, and
1966 a formula editor with features for highlighting fields in the table
1967 corresponding to the references at the point in the formula, moving
1968 these references by arrow keys.
1972 :DESCRIPTION: How to refer to another field or range.
1974 #+cindex: references
1976 To compute fields in the table from other fields, formulas must
1977 reference other fields or ranges. In Org, fields can be referenced by
1978 name, by absolute coordinates, and by relative coordinates. To find
1979 out what the coordinates of a field are, press {{{kbd(C-c ?)}}} in
1980 that field, or press {{{kbd(C-c })}}} to toggle the display of a grid.
1982 **** Field references
1987 #+cindex: field references
1988 #+cindex: references, to fields
1989 Formulas can reference the value of another field in two ways. Like
1990 in any other spreadsheet, you may reference fields with
1991 a letter/number combination like =B3=, meaning the second field in the
1992 third row. However, Org prefers to use another, more general
1993 representation that looks like this:[fn:20]
1997 Column specifications can be absolute like =$1=, =$2=, ..., =$N=, or
1998 relative to the current column, i.e., the column of the field which is
1999 being computed, like =$+1= or =$-2=. =$<= and =$>= are immutable
2000 references to the first and last column, respectively, and you can use
2001 =$>>>= to indicate the third column from the right.
2003 The row specification only counts data lines and ignores horizontal
2004 separator lines, or "hlines". Like with columns, you can use absolute
2005 row numbers =@1=, =@2=, ..., =@N=, and row numbers relative to the
2006 current row like =@+3= or =@-1=. =@<= and =@>= are immutable
2007 references the first and last row in the table, respectively. You may
2008 also specify the row relative to one of the hlines: =@I= refers to the
2009 first hline, =@II= to the second, etc. =@-I= refers to the first such
2010 line above the current line, =@+I= to the first such line below the
2011 current line. You can also write =@III+2= which is the second data
2012 line after the third hline in the table.
2014 =@0= and =$0= refer to the current row and column, respectively, i.e.,
2015 to the row/column for the field being computed. Also, if you omit
2016 either the column or the row part of the reference, the current
2017 row/column is implied.
2019 Org's references with /unsigned/ numbers are fixed references in the
2020 sense that if you use the same reference in the formula for two
2021 different fields, the same field is referenced each time. Org's
2022 references with /signed/ numbers are floating references because the
2023 same reference operator can reference different fields depending on
2024 the field being calculated by the formula.
2026 Here are a few examples:
2028 #+attr_texinfo: :columns 0.2 0.8
2029 | =@2$3= | 2nd row, 3rd column (same as =C2=) |
2030 | =$5= | column 5 in the current row (same as =E&=) |
2031 | =@2= | current column, row 2 |
2032 | =@-1$-3= | field one row up, three columns to the left |
2033 | =@-I$2= | field just under hline above current row, column 2 |
2034 | =@>$5= | field in the last row, in column 5 |
2036 **** Range references
2041 #+cindex: range references
2042 #+cindex: references, to ranges
2043 You may reference a rectangular range of fields by specifying two
2044 field references connected by two dots =..=. If both fields are in
2045 the current row, you may simply use =$2..$7=, but if at least one
2046 field is in a different row, you need to use the general =@ROW$COLUMN=
2047 format at least for the first field, i.e., the reference must start
2048 with =@= in order to be interpreted correctly. Examples:
2050 #+attr_texinfo: :columns 0.2 0.8
2051 | =$1..$3= | first three fields in the current row |
2052 | =$P..$Q= | range, using column names (see [[*Advanced features]]) |
2053 | =$<<<..$>>= | start in third column, continue to the last but one |
2054 | =@2$1..@4$3= | six fields between these two fields (same as =A2..C4=) |
2055 | =@-1$-2..@-1= | 3 fields in the row above, starting from 2 columns on the left |
2056 | =@I..II= | between first and second hline, short for =@I..@II= |
2058 #+texinfo: @noindent
2059 Range references return a vector of values that can be fed into Calc
2060 vector functions. Empty fields in ranges are normally suppressed, so
2061 that the vector contains only the non-empty fields. For other options
2062 with the mode switches =E=, =N= and examples, see [[*Formula syntax for
2065 **** Field coordinates in formulas
2070 #+cindex: field coordinates
2071 #+cindex: coordinates, of field
2072 #+cindex: row, of field coordinates
2073 #+cindex: column, of field coordinates
2074 #+vindex: org-table-current-column
2075 #+vindex: org-table-current-dline
2076 One of the very first actions during evaluation of Calc formulas and
2077 Lisp formulas is to substitute =@#= and =$#= in the formula with the
2078 row or column number of the field where the current result will go to.
2079 The traditional Lisp formula equivalents are ~org-table-current-dline~
2080 and ~org-table-current-column~. Examples:
2082 - =if(@# % 2, $#, string(""))= ::
2084 Insert column number on odd rows, set field to empty on even
2087 - =$2 = '(identity remote(FOO, @@#$1))= ::
2089 Copy text or values of each row of column 1 of the table named
2090 {{{var(FOO)}}} into column 2 of the current table.
2092 - =@3 = 2 * remote(FOO, @@1$$#)= ::
2094 Insert the doubled value of each column of row 1 of the table
2095 named {{{var(FOO)}}} into row 3 of the current table.
2097 #+texinfo: @noindent
2098 For the second and third examples, table {{{var(FOO)}}} must have at
2099 least as many rows or columns as the current table. Note that this is
2100 inefficient[fn:21] for large number of rows.
2102 **** Named references
2106 #+cindex: named references
2107 #+cindex: references, named
2108 #+cindex: name, of column or field
2109 #+cindex: constants, in calculations
2110 #+cindex: CONSTANTS, keyword
2111 #+vindex: org-table-formula-constants
2113 =$name= is interpreted as the name of a column, parameter or constant.
2114 Constants are defined globally through the variable
2115 ~org-table-formula-constants~, and locally -- for the file -- through
2116 a line like this example:
2118 : #+CONSTANTS: c=299792458. pi=3.14 eps=2.4e-6
2120 #+texinfo: @noindent
2121 #+vindex: constants-unit-system
2122 #+pindex: constants.el
2123 Also, properties (see [[*Properties and columns]]) can be used as
2124 constants in table formulas: for a property =Xyz= use the name
2125 =$PROP_Xyz=, and the property will be searched in the current outline
2126 entry and in the hierarchy above it. If you have the =constants.el=
2127 package, it will also be used to resolve constants, including natural
2128 constants like =$h= for Planck's constant, and units like =$km= for
2129 kilometers[fn:22]. Column names and parameters can be specified in
2130 special table lines. These are described below, see [[*Advanced
2131 features]]. All names must start with a letter, and further consist of
2132 letters and numbers.
2134 **** Remote references
2139 #+cindex: remote references
2140 #+cindex: references, remote
2141 #+cindex: references, to a different table
2142 #+cindex: name, of column or field
2143 #+cindex: constants, in calculations
2144 #+cindex: NAME, keyword
2145 You may also reference constants, fields and ranges from a different
2146 table, either in the current file or even in a different file. The
2151 #+texinfo: @noindent
2152 where {{{var(NAME)}}} can be the name of a table in the current file
2153 as set by a =#+NAME:= line before the table. It can also be the ID of
2154 an entry, even in a different file, and the reference then refers to
2155 the first table in that entry. {{{var(REF)}}} is an absolute field or
2156 range reference as described above for example =@3$3= or =$somename=,
2157 valid in the referenced table.
2159 #+cindex: table indirection
2160 When {{{var(NAME)}}} has the format =@ROW$COLUMN=, it is substituted
2161 with the name or ID found in this field of the current table. For
2162 example =remote($1, @@>$2)= \Rightarrow =remote(year_2013, @@>$1)=. The format
2163 =B3= is not supported because it can not be distinguished from a plain
2166 *** Formula syntax for Calc
2168 :DESCRIPTION: Using Calc to compute stuff.
2170 #+cindex: formula syntax, Calc
2171 #+cindex: syntax, of formulas
2173 A formula can be any algebraic expression understood by the Emacs
2174 =Calc= package. Note that =calc= has the non-standard convention that
2175 =/= has lower precedence than =*=, so that =a/b*c= is interpreted as
2176 =(a/(b*c))=. Before evaluation by ~calc-eval~ (see [[info:calc#Calling Calc from Your Programs][Calling Calc from
2177 Your Lisp Programs]]), variable substitution takes place according to
2178 the rules described above.
2180 #+cindex: vectors, in table calculations
2181 The range vectors can be directly fed into the Calc vector functions
2182 like ~vmean~ and ~vsum~.
2184 #+cindex: format specifier, in spreadsheet
2185 #+cindex: mode, for Calc
2186 #+vindex: org-calc-default-modes
2187 A formula can contain an optional mode string after a semicolon. This
2188 string consists of flags to influence Calc and other modes during
2189 execution. By default, Org uses the standard Calc modes (precision
2190 12, angular units degrees, fraction and symbolic modes off). The
2191 display format, however, has been changed to ~(float 8)~ to keep
2192 tables compact. The default settings can be configured using the
2193 variable ~org-calc-default-modes~.
2195 - =p20= :: Set the internal Calc calculation precision to 20 digits.
2196 - =n3=, =s3=, =e2=, =f4= :: Normal, scientific, engineering or fixed
2197 format of the result of Calc passed back to Org. Calc formatting
2198 is unlimited in precision as long as the Calc calculation
2199 precision is greater.
2200 - =D=, =R= :: Degree and radian angle modes of Calc.
2201 - =F=, =S= :: Fraction and symbolic modes of Calc.
2202 - =T=, =t=, =U= :: Duration computations in Calc or Lisp, [[*Durations
2204 - =E= :: If and how to consider empty fields. Without =E= empty
2205 fields in range references are suppressed so that the Calc vector
2206 or Lisp list contains only the non-empty fields. With =E= the
2207 empty fields are kept. For empty fields in ranges or empty field
2208 references the value =nan= (not a number) is used in Calc
2209 formulas and the empty string is used for Lisp formulas. Add =N=
2210 to use 0 instead for both formula types. For the value of
2211 a field the mode =N= has higher precedence than =E=.
2212 - =N= :: Interpret all fields as numbers, use 0 for non-numbers. See
2213 the next section to see how this is essential for computations
2214 with Lisp formulas. In Calc formulas it is used only
2215 occasionally because there number strings are already interpreted
2216 as numbers without =N=.
2217 - =L= :: Literal, for Lisp formulas only. See the next section.
2219 #+texinfo: @noindent
2220 Unless you use large integer numbers or high-precision calculation and
2221 display for floating point numbers you may alternatively provide
2222 a ~printf~ format specifier to reformat the Calc result after it has
2223 been passed back to Org instead of letting Calc already do the
2224 formatting[fn:23]. A few examples:
2226 | =$1+$2= | Sum of first and second field |
2227 | =$1+$2;%.2f= | Same, format result to two decimals |
2228 | =exp($2)+exp($1)= | Math functions can be used |
2229 | =$0;%.1f= | Reformat current cell to 1 decimal |
2230 | =($3-32)*5/9= | Degrees F \to C conversion |
2231 | =$c/$1/$cm= | Hz \to cm conversion, using =constants.el= |
2232 | =tan($1);Dp3s1= | Compute in degrees, precision 3, display SCI 1 |
2233 | =sin($1);Dp3%.1e= | Same, but use ~printf~ specifier for display |
2234 | =vmean($2..$7)= | Compute column range mean, using vector function |
2235 | =vmean($2..$7);EN= | Same, but treat empty fields as 0 |
2236 | =taylor($3,x=7,2)= | Taylor series of $3, at x=7, second degree |
2238 Calc also contains a complete set of logical operations (see [[info:calc#Logical%20Operations][Logical
2239 Operations]]). For example
2241 - =if($1 < 20, teen, string(""))= ::
2243 ="teen"= if age =$1= is less than 20, else the Org table result
2244 field is set to empty with the empty string.
2246 - =if("$1" == "nan" || "$2" == "nan", string(""), $1 + $2); E f-1= ::
2248 Sum of the first two columns. When at least one of the input
2249 fields is empty the Org table result field is set to empty. =E=
2250 is required to not convert empty fields to 0. =f-1= is an
2251 optional Calc format string similar to =%.1f= but leaves empty
2254 - =if(typeof(vmean($1..$7)) == 12, string(""), vmean($1..$7); E= ::
2256 Mean value of a range unless there is any empty field. Every
2257 field in the range that is empty is replaced by =nan= which lets
2258 =vmean= result in =nan=. Then =typeof == 12= detects the =nan=
2259 from ~vmean~ and the Org table result field is set to empty. Use
2260 this when the sample set is expected to never have missing
2263 - =if("$1..$7" == "[]", string(""), vmean($1..$7))= ::
2265 Mean value of a range with empty fields skipped. Every field in
2266 the range that is empty is skipped. When all fields in the range
2267 are empty the mean value is not defined and the Org table result
2268 field is set to empty. Use this when the sample set can have
2271 - =vmean($1..$7); EN= ::
2273 To complete the example before: Mean value of a range with empty
2274 fields counting as samples with value 0. Use this only when
2275 incomplete sample sets should be padded with 0 to the full size.
2277 You can add your own Calc functions defined in Emacs Lisp with
2278 ~defmath~ and use them in formula syntax for Calc.
2280 *** Emacs Lisp forms as formulas
2282 :DESCRIPTION: Writing formulas in Emacs Lisp.
2283 :ALT_TITLE: Formula syntax for Lisp
2285 #+cindex: Lisp forms, as table formulas
2287 It is also possible to write a formula in Emacs Lisp. This can be
2288 useful for string manipulation and control structures, if Calc's
2289 functionality is not enough.
2291 If a formula starts with a single-quote followed by an opening
2292 parenthesis, then it is evaluated as a Lisp form. The evaluation
2293 should return either a string or a number. Just as with Calc
2294 formulas, you can specify modes and a ~printf~ format after
2297 With Emacs Lisp forms, you need to be conscious about the way field
2298 references are interpolated into the form. By default, a reference is
2299 interpolated as a Lisp string (in double-quotes) containing the field.
2300 If you provide the =N= mode switch, all referenced elements are
2301 numbers -- non-number fields will be zero -- and interpolated as Lisp
2302 numbers, without quotes. If you provide the =L= flag, all fields are
2303 interpolated literally, without quotes. I.e., if you want a reference
2304 to be interpreted as a string by the Lisp form, enclose the reference
2305 operator itself in double-quotes, like ="$3"=. Ranges are inserted as
2306 space-separated fields, so you can embed them in list or vector
2309 Here are a few examples -- note how the =N= mode is used when we do
2310 computations in Lisp:
2312 - ='(concat (substring $1 1 2) (substring $1 0 1) (substring $1 2))= ::
2314 Swap the first two characters of the content of column 1.
2318 Add columns 1 and 2, equivalent to Calc's =$1+$2=.
2320 - ='(apply '+ '($1..$4));N= ::
2322 Compute the sum of columns 1 to 4, like Calc's =vsum($1..$4)=.
2324 *** Durations and time values
2326 :DESCRIPTION: How to compute durations and time values.
2328 #+cindex: Duration, computing
2329 #+cindex: Time, computing
2330 #+vindex: org-table-duration-custom-format
2332 If you want to compute time values use the =T=, =t=, or =U= flag,
2333 either in Calc formulas or Elisp formulas:
2336 | Task 1 | Task 2 | Total |
2337 |---------+----------+----------|
2338 | 2:12 | 1:47 | 03:59:00 |
2339 | 2:12 | 1:47 | 03:59 |
2340 | 3:02:20 | -2:07:00 | 0.92 |
2341 ,#+TBLFM: @2$3=$1+$2;T::@3$3=$1+$2;U::@4$3=$1+$2;t
2344 Input duration values must be of the form =HH:MM[:SS]=, where seconds
2345 are optional. With the =T= flag, computed durations are displayed as
2346 =HH:MM:SS= (see the first formula above). With the =U= flag, seconds
2347 are omitted so that the result is only =HH:MM= (see second formula
2348 above). Zero-padding of the hours field depends upon the value of the
2349 variable ~org-table-duration-hour-zero-padding~.
2351 With the =t= flag, computed durations are displayed according to the
2352 value of the option ~org-table-duration-custom-format~, which defaults
2353 to ~hours~ and displays the result as a fraction of hours (see the
2354 third formula in the example above).
2356 Negative duration values can be manipulated as well, and integers are
2357 considered as seconds in addition and subtraction.
2359 *** Field and range formulas
2361 :DESCRIPTION: Formula for specific (ranges of) fields.
2363 #+cindex: field formula
2364 #+cindex: range formula
2365 #+cindex: formula, for individual table field
2366 #+cindex: formula, for range of fields
2368 To assign a formula to a particular field, type it directly into the
2369 field, preceded by =:==, for example =vsum(@II..III)=. When you press
2370 {{{kbd(TAB)}}} or {{{kbd(RET)}}} or {{{kbd(C-c C-c)}}} with the cursor
2371 still in the field, the formula is stored as the formula for this
2372 field, evaluated, and the current field is replaced with the result.
2374 #+cindex: TBLFM, keyword
2375 Formulas are stored in a special =TBLFM= keyword located directly
2376 below the table. If you type the equation in the fourth field of the
2377 third data line in the table, the formula looks like =@3$4=$1+$2=.
2378 When inserting/deleting/swapping column and rows with the appropriate
2379 commands, /absolute references/ (but not relative ones) in stored
2380 formulas are modified in order to still reference the same field. To
2381 avoid this from happening, in particular in range references, anchor
2382 ranges at the table borders (using =@<=, =@>=, =$<=, =$>=), or at
2383 hlines using the =@I= notation. Automatic adaptation of field
2384 references does of course not happen if you edit the table structure
2385 with normal editing commands -- then you must fix the equations
2388 Instead of typing an equation into the field, you may also use the
2391 - {{{kbd(C-u C-c =)}}} (~org-table-eval-formula~) ::
2394 #+findex: org-table-eval-formula
2395 Install a new formula for the current field. The command prompts
2396 for a formula with default taken from the =TBLFM= keyword,
2397 applies it to the current field, and stores it.
2399 The left-hand side of a formula can also be a special expression in
2400 order to assign the formula to a number of different fields. There is
2401 no keyboard shortcut to enter such range formulas. To add them, use
2402 the formula editor (see [[*Editing and debugging formulas]]) or edit the
2403 =TBLFM= keyword directly.
2405 - =$2== :: Column formula, valid for the entire column. This is so
2406 common that Org treats these formulas in a special way, see
2407 [[*Column formulas]].
2408 - ~@3=~ :: Row formula, applies to all fields in the specified row.
2409 =@>== means the last row.
2410 - =@1$2..@4$3== :: Range formula, applies to all fields in the given
2411 rectangular range. This can also be used to assign a formula to
2412 some but not all fields in a row.
2413 - =$NAME== :: Named field, see [[*Advanced features]].
2417 :DESCRIPTION: Formulas valid for an entire column.
2419 #+cindex: column formula
2420 #+cindex: formula, for table column
2422 When you assign a formula to a simple column reference like =$3==, the
2423 same formula is used in all fields of that column, with the following
2424 very convenient exceptions: (i) If the table contains horizontal
2425 separator hlines with rows above and below, everything before the
2426 first such hline is considered part of the table /header/ and is not
2427 modified by column formulas. Therefore a header is mandatory when you
2428 use column formulas and want to add hlines to group rows, like for
2429 example to separate a total row at the bottom from the summand rows
2430 above. (ii) Fields that already get a value from a field/range
2431 formula are left alone by column formulas. These conditions make
2432 column formulas very easy to use.
2434 To assign a formula to a column, type it directly into any field in
2435 the column, preceded by an equal sign, like ==$1+$2=. When you press
2436 {{{kbd(TAB)}}} or {{{kbd(RET)}}} or {{{kbd(C-c C-c)}}} with the cursor
2437 still in the field, the formula is stored as the formula for the
2438 current column, evaluated and the current field replaced with the
2439 result. If the field contains only ===, the previously stored formula
2440 for this column is used. For each column, Org only remembers the most
2441 recently used formula. In the =TBLFM= keyword, column formulas look
2442 like =$4=$1+$2=. The left-hand side of a column formula can not be
2443 the name of column, it must be the numeric column reference or =$>=.
2445 Instead of typing an equation into the field, you may also use the
2448 - {{{kbd(C-c =)}}} (~org-table-eval-formula~) ::
2451 #+findex: org-table-eval-formula
2452 Install a new formula for the current column and replace current
2453 field with the result of the formula. The command prompts for
2454 a formula, with default taken from the =TBLFM= keyword, applies
2455 it to the current field and stores it. With a numeric prefix
2456 argument, e.g., {{{kbd(C-5 C-c =)}}}, the command applies it to
2457 that many consecutive fields in the current column.
2459 *** Lookup functions
2461 :DESCRIPTION: Lookup functions for searching tables.
2463 #+cindex: lookup functions in tables
2464 #+cindex: table lookup functions
2466 Org has three predefined Emacs Lisp functions for lookups in tables.
2468 - ~(org-lookup-first VAL S-LIST R-LIST &optional PREDICATE)~ ::
2470 #+findex: org-lookup-first
2471 Searches for the first element {{{var(S)}}} in list
2472 {{{var(S-LIST)}}} for which
2473 #+begin_src emacs-lisp
2476 is non-~nil~; returns the value from the corresponding position
2477 in list {{{var(R-LIST)}}}. The default {{{var(PREDICATE)}}} is
2478 ~equal~. Note that the parameters {{{var(VAL)}}} and
2479 {{{var(S)}}} are passed to {{{var(PREDICATE)}}} in the same order
2480 as the corresponding parameters are in the call to
2481 ~org-lookup-first~, where {{{var(VAL)}}} precedes
2482 {{{var(S-LIST)}}}. If {{{var(R-LIST)}}} is ~nil~, the matching
2483 element {{{var(S)}}} of {{{var(S-LIST)}}} is returned.
2485 - ~(org-lookup-last VAL S-LIST R-LIST &optional PREDICATE)~ ::
2487 #+findex: org-lookup-last
2488 Similar to ~org-lookup-first~ above, but searches for the /last/
2489 element for which {{{var(PREDICATE)}}} is non-~nil~.
2491 - ~(org-lookup-all VAL S-LIST R-LIST &optional PREDICATE)~ ::
2493 #+findex: org-lookup-all
2494 Similar to ~org-lookup-first~, but searches for /all/ elements
2495 for which {{{var(PREDICATE)}}} is non-~nil~, and returns /all/
2496 corresponding values. This function can not be used by itself in
2497 a formula, because it returns a list of values. However,
2498 powerful lookups can be built when this function is combined with
2499 other Emacs Lisp functions.
2501 If the ranges used in these functions contain empty fields, the =E=
2502 mode for the formula should usually be specified: otherwise empty
2503 fields are not included in {{{var(S-LIST)}}} and/or {{{var(R-LIST)}}}
2504 which can, for example, result in an incorrect mapping from an element
2505 of {{{var(S-LIST)}}} to the corresponding element of
2508 These three functions can be used to implement associative arrays,
2509 count matching cells, rank results, group data, etc. For practical
2510 examples see [[http://orgmode.org/worg/org-tutorials/org-lookups.html][this tutorial on Worg]].
2512 *** Editing and debugging formulas
2514 :DESCRIPTION: Fixing formulas.
2516 #+cindex: formula editing
2517 #+cindex: editing, of table formulas
2519 #+vindex: org-table-use-standard-references
2520 You can edit individual formulas in the minibuffer or directly in the
2521 field. Org can also prepare a special buffer with all active formulas
2522 of a table. When offering a formula for editing, Org converts
2523 references to the standard format (like =B3= or =D&=) if possible. If
2524 you prefer to only work with the internal format (like =@3$2= or
2525 =$4=), configure the variable ~org-table-use-standard-references~.
2527 - {{{kbd(C-c =)}}} or {{{kbd(C-u C-c =)}}} (~org-table-eval-formula~) ::
2531 #+findex: org-table-eval-formula
2532 Edit the formula associated with the current column/field in the
2533 minibuffer. See [[*Column formulas]], and [[*Field and range formulas]].
2535 - {{{kbd(C-u C-u C-c =)}}} (~org-table-eval-formula~) ::
2537 #+kindex: C-u C-u C-c =
2538 #+findex: org-table-eval-formula
2539 Re-insert the active formula (either a field formula, or a column
2540 formula) into the current field, so that you can edit it directly
2541 in the field. The advantage over editing in the minibuffer is
2542 that you can use the command {{{kbd(C-c ?)}}}.
2544 - {{{kbd(C-c ?)}}} (~org-table-field-info~) ::
2547 #+findex: org-table-field-info
2548 While editing a formula in a table field, highlight the field(s)
2549 referenced by the reference at the cursor position in the
2552 - {{{kbd(C-c })}}} (~org-table-toggle-coordinate-overlays~) ::
2555 #+findex: org-table-toggle-coordinate-overlays
2556 Toggle the display of row and column numbers for a table, using
2557 overlays. These are updated each time the table is aligned; you
2558 can force it with {{{kbd(C-c C-c)}}}.
2560 - {{{kbd(C-c {)}}} (~org-table-toggle-formula-debugger~) ::
2563 #+findex: org-table-toggle-formula-debugger
2564 Toggle the formula debugger on and off. See below.
2566 - {{{kbd(C-c ')}}} (~org-table-edit-formulas~) ::
2569 #+findex: org-table-edit-formulas
2570 Edit all formulas for the current table in a special buffer,
2571 where the formulas are displayed one per line. If the current
2572 field has an active formula, the cursor in the formula editor
2573 marks it. While inside the special buffer, Org automatically
2574 highlights any field or range reference at the cursor position.
2575 You may edit, remove and add formulas, and use the following
2578 - {{{kbd(C-c C-c)}}} or {{{kbd(C-x C-s)}}} (~org-table-fedit-finish~) ::
2582 #+findex: org-table-fedit-finish
2583 Exit the formula editor and store the modified formulas. With
2584 {{{kbd(C-u)}}} prefix, also apply the new formulas to the
2587 - {{{kbd(C-c C-q)}}} (~org-table-fedit-abort~) ::
2590 #+findex: org-table-fedit-abort
2591 Exit the formula editor without installing changes.
2593 - {{{kbd(C-c C-r)}}} (~org-table-fedit-toggle-ref-type~) ::
2596 #+findex: org-table-fedit-toggle-ref-type
2597 Toggle all references in the formula editor between standard
2598 (like =B3=) and internal (like =@3$2=).
2600 - {{{kbd(TAB)}}} (~org-table-fedit-lisp-indent~) ::
2603 #+findex: org-table-fedit-lisp-indent
2604 Pretty-print or indent Lisp formula at point. When in a line
2605 containing a Lisp formula, format the formula according to
2606 Emacs Lisp rules. Another {{{kbd(TAB)}}} collapses the formula
2607 back again. In the open formula, {{{kbd(TAB)}}} re-indents
2608 just like in Emacs Lisp mode.
2610 - {{{kbd(M-TAB)}}} (~lisp-complete-symbol~) ::
2613 #+findex: lisp-complete-symbol
2614 Complete Lisp symbols, just like in Emacs Lisp mode.
2616 - {{{kbd(S-up)}}}, {{{kbd(S-down)}}}, {{{kbd(S-left)}}}, {{{kbd(S-right)}}} ::
2622 #+findex: org-table-fedit-ref-up
2623 #+findex: org-table-fedit-ref-down
2624 #+findex: org-table-fedit-ref-left
2625 #+findex: org-table-fedit-ref-right
2626 Shift the reference at point. For example, if the reference
2627 is =B3= and you press {{{kbd(S-right)}}}, it becomes =C3=.
2628 This also works for relative references and for hline
2631 - {{{kbd(M-S-up)}}} (~org-table-fedit-line-up~) ::
2634 #+findex: org-table-fedit-line-up
2635 Move the test line for column formulas up in the Org buffer.
2637 - {{{kbd(M-S-down)}}} (~org-table-fedit-line-down~) ::
2640 #+findex: org-table-fedit-line-down
2641 Move the test line for column formulas down in the Org buffer.
2643 - {{{kbd(M-up)}}} (~org-table-fedit-scroll-up~) ::
2646 #+findex: org-table-fedit-scroll-up
2647 Scroll up the window displaying the table.
2649 - {{{kbd(M-down)}}} (~org-table-fedit-scroll-down~) ::
2652 #+findex: org-table-fedit-scroll-down
2653 Scroll down the window displaying the table.
2655 - {{{kbd(C-c })}}} ::
2658 #+findex: org-table-toggle-coordinate-overlays
2659 Turn the coordinate grid in the table on and off.
2661 Making a table field blank does not remove the formula associated with
2662 the field, because that is stored in a different line -- the =TBLFM=
2663 keyword line. During the next recalculation, the field will be filled
2664 again. To remove a formula from a field, you have to give an empty
2665 reply when prompted for the formula, or to edit the =TBLFM= keyword.
2668 You may edit the =TBLFM= keyword directly and re-apply the changed
2669 equations with {{{kbd(C-c C-c)}}} in that line or with the normal
2670 recalculation commands in the table.
2672 **** Using multiple =TBLFM= lines
2676 #+cindex: multiple formula lines
2677 #+cindex: TBLFM keywords, multiple
2678 #+cindex: TBLFM, switching
2681 You may apply the formula temporarily. This is useful when you switch
2682 the formula. Place multiple =TBLFM= keywords right after the table,
2683 and then press {{{kbd(C-c C-c)}}} on the formula to apply. Here is an
2695 #+texinfo: @noindent
2696 Pressing {{{kbd(C-c C-c)}}} in the line of =#+TBLFM: $2=$1*2= yields:
2707 #+texinfo: @noindent
2708 Note: If you recalculate this table, with {{{kbd(C-u C-c *)}}}, for
2709 example, you get the following result of applying only the first
2721 **** Debugging formulas
2725 #+cindex: formula debugging
2726 #+cindex: debugging, of table formulas
2728 When the evaluation of a formula leads to an error, the field content
2729 becomes the string =#ERROR=. If you would like to see what is going
2730 on during variable substitution and calculation in order to find
2731 a bug, turn on formula debugging in the Tbl menu and repeat the
2732 calculation, for example by pressing {{{kbd(C-u C-u C-c = RET)}}} in
2733 a field. Detailed information are displayed.
2735 *** Updating the table
2737 :DESCRIPTION: Recomputing all dependent fields.
2739 #+cindex: recomputing table fields
2740 #+cindex: updating, table
2742 Recalculation of a table is normally not automatic, but needs to be
2743 triggered by a command. To make recalculation at least
2744 semi-automatic, see [[*Advanced features]].
2746 In order to recalculate a line of a table or the entire table, use the
2749 - {{{kbd(C-c *)}}} (~org-table-recalculate~) ::
2752 #+findex: org-table-recalculate
2753 Recalculate the current row by first applying the stored column
2754 formulas from left to right, and all field/range formulas in the
2757 - {{{kbd(C-u C-c *)}}} or {{{kbd(C-u C-c C-c)}}} ::
2760 #+kindex: C-u C-c C-c
2761 Recompute the entire table, line by line. Any lines before the
2762 first hline are left alone, assuming that these are part of the
2765 - {{{kbd(C-u C-u C-c *)}}} or {{{kbd(C-u C-u C-c C-c)}}} (~org-table-iterate~) ::
2767 #+kindex: C-u C-u C-c *
2768 #+kindex: C-u C-u C-c C-c
2769 #+findex: org-table-iterate
2770 Iterate the table by recomputing it until no further changes
2771 occur. This may be necessary if some computed fields use the
2772 value of other fields that are computed /later/ in the
2773 calculation sequence.
2775 - {{{kbd(M-x org-table-recalculate-buffer-tables)}}} ::
2777 #+findex: org-table-recalculate-buffer-tables
2778 Recompute all tables in the current buffer.
2780 - {{{kbd(M-x org-table-iterate-buffer-tables)}}} ::
2782 #+findex: org-table-iterate-buffer-tables
2783 Iterate all tables in the current buffer, in order to converge
2784 table-to-table dependencies.
2786 *** Advanced features
2788 :DESCRIPTION: Field and column names, automatic recalculation...
2791 If you want the recalculation of fields to happen automatically, or if
2792 you want to be able to assign /names/[fn:24] to fields and columns,
2793 you need to reserve the first column of the table for special marking
2796 - {{{kbd(C-#)}}} (~org-table-rotate-recalc-marks~) ::
2799 #+findex: org-table-rotate-recalc-marks
2800 Rotate the calculation mark in first column through the states
2801 =#=, =*=, =!=, =$=. When there is an active region, change all
2802 marks in the region.
2804 Here is an example of a table that collects exam results of students
2805 and makes use of these features:
2808 |---+---------+--------+--------+--------+-------+------|
2809 | | Student | Prob 1 | Prob 2 | Prob 3 | Total | Note |
2810 |---+---------+--------+--------+--------+-------+------|
2811 | ! | | P1 | P2 | P3 | Tot | |
2812 | # | Maximum | 10 | 15 | 25 | 50 | 10.0 |
2813 | ^ | | m1 | m2 | m3 | mt | |
2814 |---+---------+--------+--------+--------+-------+------|
2815 | # | Peter | 10 | 8 | 23 | 41 | 8.2 |
2816 | # | Sam | 2 | 4 | 3 | 9 | 1.8 |
2817 |---+---------+--------+--------+--------+-------+------|
2818 | | Average | | | | 25.0 | |
2819 | ^ | | | | | at | |
2820 | $ | max=50 | | | | | |
2821 |---+---------+--------+--------+--------+-------+------|
2822 ,#+TBLFM: $6=vsum($P1..$P3)::$7=10*$Tot/$max;%.1f::$at=vmean(@-II..@-I);%.1f
2825 #+texinfo: @noindent
2826 *Important*: please note that for these special tables, recalculating
2827 the table with {{{kbd(C-u C-c *)}}} only affects rows that are marked
2828 =#= or =*=, and fields that have a formula assigned to the field
2829 itself. The column formulas are not applied in rows with empty first
2832 #+cindex: marking characters, tables
2833 The marking characters have the following meaning:
2835 - =!= :: The fields in this line define names for the columns, so that
2836 you may refer to a column as =$Tot= instead of =$6=.
2838 - =^= :: This row defines names for the fields /above/ the row. With
2839 such a definition, any formula in the table may use =$m1= to
2840 refer to the value =10=. Also, if you assign a formula to
2841 a names field, it is stored as =$name = ...=.
2843 - =_= :: Similar to =^=, but defines names for the fields in the row
2846 - =$= :: Fields in this row can define /parameters/ for formulas. For
2847 example, if a field in a =$= row contains =max=50=, then formulas
2848 in this table can refer to the value 50 using =$max=. Parameters
2849 work exactly like constants, only that they can be defined on
2852 - =#= :: Fields in this row are automatically recalculated when
2853 pressing {{{kbd(TAB)}}} or {{{kbd(RET)}}} or {{{kbd(S-TAB)}}} in
2854 this row. Also, this row is selected for a global recalculation
2855 with {{{kbd(C-u C-c *)}}}. Unmarked lines are left alone by this
2858 - =*= :: Selects this line for global recalculation with {{{kbd(C-u
2859 C-c *)}}}, but not for automatic recalculation. Use this when
2860 automatic recalculation slows down editing too much.
2862 - =/= :: Do not export this line. Useful for lines that contain the
2863 narrowing =<N>= markers or column group markers.
2865 Finally, just to whet your appetite for what can be done with the
2866 fantastic Calc package, here is a table that computes the Taylor
2867 series of degree n at location x for a couple of functions.
2870 |---+-------------+---+-----+--------------------------------------|
2871 | | Func | n | x | Result |
2872 |---+-------------+---+-----+--------------------------------------|
2873 | # | exp(x) | 1 | x | 1 + x |
2874 | # | exp(x) | 2 | x | 1 + x + x^2 / 2 |
2875 | # | exp(x) | 3 | x | 1 + x + x^2 / 2 + x^3 / 6 |
2876 | # | x^2+sqrt(x) | 2 | x=0 | x*(0.5 / 0) + x^2 (2 - 0.25 / 0) / 2 |
2877 | # | x^2+sqrt(x) | 2 | x=1 | 2 + 2.5 x - 2.5 + 0.875 (x - 1)^2 |
2878 | * | tan(x) | 3 | x | 0.0175 x + 1.77e-6 x^3 |
2879 |---+-------------+---+-----+--------------------------------------|
2880 ,#+TBLFM: $5=taylor($2,$4,$3);n3
2885 :DESCRIPTION: Plotting from Org tables.
2887 #+cindex: graph, in tables
2888 #+cindex: plot tables using Gnuplot
2890 Org Plot can produce graphs of information stored in Org tables,
2891 either graphically or in ASCII art.
2893 *** Graphical plots using Gnuplot
2898 #+cindex: PLOT, keyword
2899 Org Plot can produce 2D and 3D graphs of information stored in Org
2900 tables using [[http://www.gnuplot.info/][Gnuplot]] and [[http://cars9.uchicago.edu/~ravel/software/gnuplot-mode.html][Gnuplot mode]]. To see this in action, ensure
2901 that you have both Gnuplot and Gnuplot mode installed on your system,
2902 then call {{{kbd(C-c \quot g)}}} or {{{kbd(M-x org-plot/gnuplot)}}} on the
2906 ,#+PLOT: title:"Citas" ind:1 deps:(3) type:2d with:histograms set:"yrange [0:]"
2907 | Sede | Max cites | H-index |
2908 |-----------+-----------+---------|
2909 | Chile | 257.72 | 21.39 |
2910 | Leeds | 165.77 | 19.68 |
2911 | Sao Paolo | 71.00 | 11.50 |
2912 | Stockholm | 134.19 | 14.33 |
2913 | Morels | 257.56 | 17.67 |
2916 Notice that Org Plot is smart enough to apply the table's headers as
2917 labels. Further control over the labels, type, content, and
2918 appearance of plots can be exercised through the =PLOT= keyword
2919 preceding a table. See below for a complete list of Org Plot options.
2920 For more information and examples see the [[http://orgmode.org/worg/org-tutorials/org-plot.html][Org Plot tutorial]].
2927 - =set= :: Specify any Gnuplot option to be set when graphing.
2929 - =title= :: Specify the title of the plot.
2931 - =ind= :: Specify which column of the table to use as the =x= axis.
2933 - =deps= :: Specify the columns to graph as a Lisp style list,
2934 surrounded by parentheses and separated by spaces for example
2935 =dep:(3 4)= to graph the third and fourth columns (defaults to
2936 graphing all other columns aside from the =ind= column).
2938 - =type= :: Specify whether the plot is =2d=, =3d=, or =grid=.
2940 - =with= :: Specify a =with= option to be inserted for every col being
2941 plotted (e.g., =lines=, =points=, =boxes=, =impulses=, etc.).
2942 Defaults to =lines=.
2944 - =file= :: If you want to plot to a file, specify
2945 ="path/to/desired/output-file"=.
2947 - =labels= :: List of labels to be used for the =deps=. Defaults to
2948 the column headers if they exist.
2950 - =line= :: Specify an entire line to be inserted in the Gnuplot
2953 - =map= :: When plotting =3d= or =grid= types, set this to =t= to
2954 graph a flat mapping rather than a =3d= slope.
2956 - =timefmt= :: Specify format of Org mode timestamps as they will be
2957 parsed by Gnuplot. Defaults to =%Y-%m-%d-%H:%M:%S=.
2959 - =script= :: If you want total control, you can specify a script
2960 file -- place the file name between double-quotes --, which will
2961 be used to plot. Before plotting, every instance of =$datafile=
2962 in the specified script will be replaced with the path to the
2963 generated data file. Note: even if you set this option, you may
2964 still want to specify the plot type, as that can impact the
2965 content of the data file.
2972 While the cursor is on a column, typing {{{kbd(C-c " a)}}} or
2973 {{{kbd(M-x orgtbl-ascii-plot)}}} create a new column containing an
2974 ASCII-art bars plot. The plot is implemented through a regular column
2975 formula. When the source column changes, the bar plot may be updated
2976 by refreshing the table, for example typing {{{kbd(C-u C-c *)}}}.
2979 | Sede | Max cites | |
2980 |---------------+-----------+--------------|
2981 | Chile | 257.72 | WWWWWWWWWWWW |
2982 | Leeds | 165.77 | WWWWWWWh |
2983 | Sao Paolo | 71.00 | WWW; |
2984 | Stockholm | 134.19 | WWWWWW: |
2985 | Morelia | 257.56 | WWWWWWWWWWWH |
2986 | Rochefourchat | 0.00 | |
2987 ,#+TBLFM: $3='(orgtbl-ascii-draw $2 0.0 257.72 12)
2990 The formula is an Elisp call.
2992 #+attr_texinfo: :options orgtbl-ascii-draw value min max &optional width
2994 Draw an ASCII bar in a table.
2996 {{{var(VALUE)}}} is the value to plot.
2998 {{{var(MIN)}}} is the value displayed as an empty bar. {{{var(MAX)}}}
2999 is the value filling all the {{{var(WIDTH)}}}. Sources values outside
3000 this range are displayed as =too small= or =too large=.
3002 {{{var(WIDTH)}}} is the number of characters of the bar plot. It
3008 :DESCRIPTION: Notes in context.
3010 #+cindex: hyperlinks
3012 Like HTML, Org provides links inside a file, external links to
3013 other files, Usenet articles, emails, and much more.
3017 :DESCRIPTION: How links in Org are formatted.
3019 #+cindex: link format
3020 #+cindex: format, of links
3022 Org recognizes plain URL-like links and activate them as clickable
3023 links. The general link format, however, looks like this:
3025 : [[LINK][DESCRIPTION]]
3027 #+texinfo: @noindent
3032 #+texinfo: @noindent
3033 Once a link in the buffer is complete (all brackets present), Org
3034 changes the display so that =DESCRIPTION= is displayed instead of
3035 =[[LINK][DESCRIPTION]]= and =LINK= is displayed instead of =[[LINK]]=. Links are be
3036 highlighted in the face ~org-link~, which by default is an underlined
3037 face. You can directly edit the visible part of a link. Note that
3038 this can be either the LINK part, if there is no description, or the
3039 {{{var(DESCRIPTION)}}} part. To edit also the invisible
3040 {{{var(LINK)}}} part, use {{{kbd(C-c C-l)}}} with the cursor on the
3043 If you place the cursor at the beginning or just behind the end of the
3044 displayed text and press {{{kbd(BS)}}}, you remove the -- invisible --
3045 bracket at that location. This makes the link incomplete and the
3046 internals are again displayed as plain text. Inserting the missing
3047 bracket hides the link internals again. To show the internal
3048 structure of all links, use the menu: Org \rarr Hyperlinks \rarr Literal
3053 :DESCRIPTION: Links to other places in the current file.
3055 #+cindex: internal links
3056 #+cindex: links, internal
3057 #+cindex: targets, for links
3059 #+cindex: CUSTOM_ID, property
3060 If the link does not look like a URL, it is considered to be internal
3061 in the current file. The most important case is a link like
3062 =[[#my-custom-id]]= which links to the entry with the =CUSTOM_ID= property
3063 =my-custom-id=. You are responsible yourself to make sure these
3064 custom IDs are unique in a file.
3066 Links such as =[[My Target]]= or =[[My Target][Find my target]]= lead to a text search in
3069 The link can be followed with {{{kbd(C-c C-o)}}} when the cursor is on
3070 the link, or with a mouse click (see [[*Handling links]]). Links to
3071 custom IDs point to the corresponding headline. The preferred match
3072 for a text link is a /dedicated target/: the same string in double
3073 angular brackets, like =<<My Target>>=.
3075 #+cindex: NAME, keyword
3076 If no dedicated target exists, the link tries to match the exact name
3077 of an element within the buffer. Naming is done with the =NAME=
3078 keyword, which has to be put in the line before the element it refers
3079 to, as in the following example
3088 If none of the above succeeds, Org searches for a headline that is
3089 exactly the link text but may also include a TODO keyword and
3092 During export, internal links are used to mark objects and assign them
3093 a number. Marked objects are then referenced by links pointing to
3094 them. In particular, links without a description appear as the number
3095 assigned to the marked object[fn:26]. In the following excerpt from
3100 2. <<target>>another item
3101 Here we refer to item [[target]].
3104 #+texinfo: @noindent
3105 The last sentence will appear as =Here we refer to item 2= when
3108 In non-Org files, the search looks for the words in the link text. In
3109 the above example the search would be for =target=.
3111 Following a link pushes a mark onto Org's own mark ring. You can
3112 return to the previous position with {{{kbd(C-c &)}}}. Using this
3113 command several times in direct succession goes back to positions
3118 :DESCRIPTION: Make targets trigger links in plain text.
3120 #+cindex: radio targets
3121 #+cindex: targets, radio
3122 #+cindex: links, radio targets
3124 Org can automatically turn any occurrences of certain target names in
3125 normal text into a link. So without explicitly creating a link, the
3126 text connects to the target radioing its position. Radio targets are
3127 enclosed by triple angular brackets. For example, a target =<<<My
3128 Target>>>= causes each occurrence of =my target= in normal text to
3129 become activated as a link. The Org file is scanned automatically for
3130 radio targets only when the file is first loaded into Emacs. To
3131 update the target list during editing, press {{{kbd(C-c C-c)}}} with
3132 the cursor on or at a target.
3136 :DESCRIPTION: URL-like links to the world.
3138 #+cindex: links, external
3139 #+cindex: external links
3140 #+cindex: Gnus links
3141 #+cindex: BBDB links
3144 #+cindex: file links
3145 #+cindex: Rmail links
3146 #+cindex: MH-E links
3147 #+cindex: Usenet links
3148 #+cindex: shell links
3149 #+cindex: Info links
3150 #+cindex: Elisp links
3152 Org supports links to files, websites, Usenet and email messages, BBDB
3153 database entries and links to both IRC conversations and their logs.
3154 External links are URL-like locators. They start with a short
3155 identifying string followed by a colon. There can be no space after
3156 the colon. The following list shows examples for each link type.
3158 | =http://www.astro.uva.nl/=dominik= | on the web |
3159 | =doi:10.1000/182= | DOI for an electronic resource |
3160 | =file:/home/dominik/images/jupiter.jpg= | file, absolute path |
3161 | =/home/dominik/images/jupiter.jpg= | same as above |
3162 | =file:papers/last.pdf= | file, relative path |
3163 | =./papers/last.pdf= | same as above |
3164 | =file:/ssh:me@some.where:papers/last.pdf= | file, path on remote machine |
3165 | =/ssh:me@some.where:papers/last.pdf= | same as above |
3166 | =file:sometextfile::NNN= | file, jump to line number |
3167 | =file:projects.org= | another Org file |
3168 | =file:projects.org::some words= | text search in Org file[fn:27] |
3169 | =file:projects.org::*task title= | heading search in Org file |
3170 | =file+sys:/path/to/file= | open via OS, like double-click |
3171 | =file+emacs:/path/to/file= | force opening by Emacs |
3172 | =docview:papers/last.pdf::NNN= | open in doc-view mode at page |
3173 | =id:B7423F4D-2E8A-471B-8810-C40F074717E9= | Link to heading by ID |
3174 | =news:comp.emacs= | Usenet link |
3175 | =mailto:adent@galaxy.net= | Mail link |
3176 | =mhe:folder= | MH-E folder link |
3177 | =mhe:folder#id= | MH-E message link |
3178 | =rmail:folder= | Rmail folder link |
3179 | =rmail:folder#id= | Rmail message link |
3180 | =gnus:group= | Gnus group link |
3181 | =gnus:group#id= | Gnus article link |
3182 | =bbdb:R.*Stallman= | BBDB link (with regexp) |
3183 | =irc:/irc.com/#emacs/bob= | IRC link |
3184 | =info:org#External links= | Info node link |
3185 | =shell:ls *.org= | A shell command |
3186 | =elisp:org-agenda= | Interactive Elisp command |
3187 | =elisp:(find-file-other-frame "Elisp.org")= | Elisp form to evaluate |
3190 #+cindex: Wanderlust links
3191 On top of these built-in link types, some are available through the
3192 =contrib/= directory (see [[*Installation]]). For example, these links to
3193 VM or Wanderlust messages are available when you load the
3194 corresponding libraries from the =contrib/= directory:
3196 | =vm:folder= | VM folder link |
3197 | =vm:folder#id= | VM message link |
3198 | =vm://myself@some.where.org/folder#id= | VM on remote machine |
3199 | =vm-imap:account:folder= | VM IMAP folder link |
3200 | =vm-imap:account:folder#id= | VM IMAP message link |
3201 | =wl:folder= | Wanderlust folder link |
3202 | =wl:folder#id= | Wanderlust message link |
3204 For customizing Org to add new link types, see [[*Adding hyperlink
3207 A link should be enclosed in double brackets and may contain
3208 a descriptive text to be displayed instead of the URL (see [[*Link
3209 format]]), for example:
3211 : [[http://www.gnu.org/software/emacs/][GNU Emacs]]
3213 #+texinfo: @noindent
3214 If the description is a file name or URL that points to an image, HTML
3215 export (see [[*HTML export]]) inlines the image as a clickable button. If
3216 there is no description at all and the link points to an image, that
3217 image is inlined into the exported HTML file.
3219 #+cindex: square brackets, around links
3220 #+cindex: angular brackets, around links
3221 #+cindex: plain text external links
3222 Org also finds external links in the normal text and activates them as
3223 links. If spaces must be part of the link (for example in
3224 =bbdb:Richard Stallman=), or if you need to remove ambiguities about
3225 the end of the link, enclose them in square or angular brackets.
3229 :DESCRIPTION: Creating, inserting and following.
3231 #+cindex: links, handling
3233 Org provides methods to create a link in the correct syntax, to insert
3234 it into an Org file, and to follow the link.
3236 #+attr_texinfo: :sep ,
3237 - {{{kbd(C-c l)}}} (~org-store-link~) ::
3240 #+findex: org-store-link
3241 #+cindex: storing links
3242 Store a link to the current location. This is a /global/
3243 command -- you must create the key binding yourself -- which can
3244 be used in any buffer to create a link. The link is stored for
3245 later insertion into an Org buffer -- see below. What kind of
3246 link is created depends on the current buffer:
3248 - /Org mode buffers/ ::
3250 For Org files, if there is a =<<target>>= at the cursor, the
3251 link points to the target. Otherwise it points to the
3252 current headline, which is also the description[fn:28].
3254 #+vindex: org-link-to-org-use-id
3255 #+cindex: CUSTOM_ID, property
3256 #+cindex: ID, property
3257 If the headline has a =CUSTOM_ID= property, store a link to
3258 this custom ID. In addition or alternatively, depending on
3259 the value of ~org-link-to-org-use-id~, create and/or use
3260 a globally unique ID property for the link[fn:29]. So using
3261 this command in Org buffers potentially creates two links:
3262 a human-readable link from the custom ID, and one that is
3263 globally unique and works even if the entry is moved from
3264 file to file. Later, when inserting the link, you need to
3265 decide which one to use.
3267 - /Email/News clients: VM, Rmail, Wanderlust, MH-E, Gnus/ ::
3269 Pretty much all Emacs mail clients are supported. The link
3270 points to the current article, or, in some Gnus buffers, to
3271 the group. The description is constructed from the author
3274 - /Web browsers: W3 and W3M/ ::
3276 Here the link is the current URL, with the page title as
3279 - /Contacts: BBDB/ ::
3281 Links created in a BBDB buffer point to the current entry.
3285 #+vindex: org-irc-links-to-logs
3286 For IRC links, if the variable ~org-irc-link-to-logs~ is
3287 non-~nil~, create a =file= style link to the relevant point
3288 in the logs for the current conversation. Otherwise store
3289 an =irc= style link to the user/channel/server under the
3294 For any other files, the link points to the file, with
3295 a search string (see [[*Search options in file links][*Search options]]) pointing to the
3296 contents of the current line. If there is an active region,
3297 the selected words form the basis of the search string. If
3298 the automatically created link is not working correctly or
3299 accurately enough, you can write custom functions to select
3300 the search string and to do the search for particular file
3301 types (see [[*Custom searches]]). The key binding {{{kbd(C-c
3302 l)}}} is only a suggestion (see [[*Installation]]).
3306 When the cursor is in an agenda view, the created link
3307 points to the entry referenced by the current line.
3309 - {{{kbd(C-c C-l)}}} (~org-insert-link~) ::
3312 #+findex: org-insert-link
3313 #+cindex: link completion
3314 #+cindex: completion, of links
3315 #+cindex: inserting links
3316 #+vindex: org-keep-stored-link-after-insertion
3317 Insert a link[fn:30]. This prompts for a link to be inserted
3318 into the buffer. You can just type a link, using text for an
3319 internal link, or one of the link type prefixes mentioned in the
3320 examples above. The link is inserted into the buffer, along with
3321 a descriptive text[fn:31]. If some text was selected at this
3322 time, it becomes the default description.
3324 - /Inserting stored links/ ::
3326 All links stored during the current session are part of the
3327 history for this prompt, so you can access them with
3328 {{{kbd(up)}}} and {{{kbd(down)}}} (or {{{kbd(M-p)}}},
3331 - /Completion support/ ::
3333 Completion with {{{kbd(TAB)}}} helps you to insert valid
3334 link prefixes like =http= or =ftp=, including the prefixes
3335 defined through link abbreviations (see [[*Link
3336 abbreviations]]). If you press {{{kbd(RET)}}} after inserting
3337 only the prefix, Org offers specific completion support for
3338 some link types[fn:32]. For example, if you type {{{kbd(f
3339 i l e RET)}}} -- alternative access: {{{kbd(C-u C-c C-l)}}},
3340 see below -- Org offers file name completion, and after
3341 {{{kbd(b b d b RET)}}} you can complete contact names.
3343 - {{{kbd(C-u C-c C-l)}}} ::
3345 #+cindex: file name completion
3346 #+cindex: completion, of file names
3347 #+kindex: C-u C-c C-l
3348 When {{{kbd(C-c C-l)}}} is called with a {{{kbd(C-u)}}} prefix
3349 argument, insert a link to a file. You may use file name
3350 completion to select the name of the file. The path to the file
3351 is inserted relative to the directory of the current Org file, if
3352 the linked file is in the current directory or in a sub-directory
3353 of it, or if the path is written relative to the current
3354 directory using =../=. Otherwise an absolute path is used, if
3355 possible with =~/= for your home directory. You can force an
3356 absolute path with two {{{kbd(C-u)}}} prefixes.
3358 - {{{kbd(C-c C-l)}}} (with cursor on existing link) ::
3360 #+cindex: following links
3361 When the cursor is on an existing link, {{{kbd(C-c C-l)}}} allows
3362 you to edit the link and description parts of the link.
3364 - {{{kbd(C-c C-o)}}} (~org-open-at-point~) ::
3367 #+findex: org-open-at-point
3368 #+vindex: org-file-apps
3369 #+vindex: org-link-frame-setup
3370 Open link at point. This launches a web browser for URL
3371 (using ~browse-url-at-point~), run
3372 VM/MH-E/Wanderlust/Rmail/Gnus/BBDB for the corresponding
3373 links, and execute the command in a shell link. When the
3374 cursor is on an internal link, this command runs the
3375 corresponding search. When the cursor is on a TAG list in
3376 a headline, it creates the corresponding TAGS view. If the
3377 cursor is on a timestamp, it compiles the agenda for that
3378 date. Furthermore, it visits text and remote files in
3379 =file= links with Emacs and select a suitable application
3380 for local non-text files. Classification of files is based
3381 on file extension only. See option ~org-file-apps~. If you
3382 want to override the default application and visit the file
3383 with Emacs, use a {{{kbd(C-u)}}} prefix. If you want to
3384 avoid opening in Emacs, use a {{{kbd(C-u C-u)}}} prefix. \\
3385 If the cursor is on a headline, but not on a link, offer all
3386 links in the headline and entry text. If you want to setup
3387 the frame configuration for following links, customize
3388 ~org-link-frame-setup~.
3392 #+vindex: org-return-follows-link
3394 When ~org-return-follows-link~ is set, {{{kbd(RET)}}} also
3395 follows the link at point.
3397 - {{{kbd(mouse-2)}}} or {{{kbd(mouse-1)}}} ::
3401 On links, {{{kbd(mouse-1)}}} and {{{kbd(mouse-2)}}} opens
3402 the link just as {{{kbd(C-c C-o)}}} does.
3404 - {{{kbd(mouse-3)}}} ::
3406 #+vindex: org-display-internal-link-with-indirect-buffer
3408 Like {{{kbd(mouse-2)}}}, but force file links to be opened
3409 with Emacs, and internal links to be displayed in another
3412 - {{{kbd(C-c C-x C-v)}}} (~org-toggle-inline-images~) ::
3414 #+cindex: inlining images
3415 #+cindex: images, inlining
3416 #+vindex: org-startup-with-inline-images
3417 #+kindex: C-c C-x C-v
3418 #+findex: org-toggle-inline-images
3419 Toggle the inline display of linked images. Normally this
3420 only inlines images that have no description part in the
3421 link, i.e., images that are inlined during export. When
3422 called with a prefix argument, also display images that do
3423 have a link description. You can ask for inline images to
3424 be displayed at startup by configuring the variable
3425 ~org-startup-with-inline-images~[fn:34].
3427 - {{{kbd(C-c %)}}} (~org-mark-ring-push~) ::
3430 #+findex: org-mark-ring-push
3432 Push the current position onto the mark ring, to be able to
3433 return easily. Commands following an internal link do this
3436 - {{{kbd(C-c &)}}} (~org-mark-ring-goto~) ::
3439 #+findex: org-mark-ring-goto
3440 #+cindex: links, returning to
3441 Jump back to a recorded position. A position is recorded by
3442 the commands following internal links, and by {{{kbd(C-c
3443 %)}}}. Using this command several times in direct
3444 succession moves through a ring of previously recorded
3447 - {{{kbd(C-c C-x C-n)}}} (~org-next-link~), {{{kbd(C-c C-x C-p)}}} (~org-previous-link~) ::
3449 #+kindex: C-c C-x C-p
3450 #+findex: org-previous-link
3451 #+kindex: C-c C-x C-n
3452 #+findex: org-next-link
3453 #+cindex: links, finding next/previous
3454 Move forward/backward to the next link in the buffer. At the
3455 limit of the buffer, the search fails once, and then wraps
3456 around. The key bindings for this are really too long; you might
3457 want to bind this also to {{{kbd(C-n)}}} and {{{kbd(C-p)}}}.
3459 #+begin_src emacs-lisp
3460 (add-hook 'org-load-hook
3462 (define-key org-mode-map "\C-n" 'org-next-link)
3463 (define-key org-mode-map "\C-p" 'org-previous-link)))
3466 ** Using links outside Org
3468 :DESCRIPTION: Linking from my C source code?
3471 You can insert and follow links that have Org syntax not only in Org,
3472 but in any Emacs buffer. For this, you should create two global
3473 commands, like this (please select suitable global keys yourself):
3475 #+begin_src emacs-lisp
3476 (global-set-key "\C-c L" 'org-insert-link-global)
3477 (global-set-key "\C-c o" 'org-open-at-point-global)
3480 ** Link abbreviations
3482 :DESCRIPTION: Shortcuts for writing complex links.
3484 #+cindex: link abbreviations
3485 #+cindex: abbreviation, links
3487 Long URL can be cumbersome to type, and often many similar links are
3488 needed in a document. For this you can use link abbreviations. An
3489 abbreviated link looks like this
3491 : [[linkword:tag][description]]
3493 #+texinfo: @noindent
3494 #+vindex: org-link-abbrev-alist
3495 where the tag is optional. The /linkword/ must be a word, starting
3496 with a letter, followed by letters, numbers, =-=, and =_=.
3497 Abbreviations are resolved according to the information in the
3498 variable ~org-link-abbrev-alist~ that relates the linkwords to
3499 replacement text. Here is an example:
3501 #+begin_src emacs-lisp
3502 (setq org-link-abbrev-alist
3503 '(("bugzilla" . "http://10.1.2.9/bugzilla/show_bug.cgi?id=")
3504 ("url-to-ja" . "http://translate.google.fr/translate?sl=en&tl=ja&u=%h")
3505 ("google" . "http://www.google.com/search?q=")
3506 ("gmap" . "http://maps.google.com/maps?q=%s")
3507 ("omap" . "http://nominatim.openstreetmap.org/search?q=%s&polygon=1")
3508 ("ads" . "http://adsabs.harvard.edu/cgi-bin/nph-abs_connect?author=%s&db_key=AST")))
3511 If the replacement text contains the string =%s=, it is replaced with
3512 the tag. Using =%h= instead of =%s= percent-encodes the tag (see the
3513 example above, where we need to encode the URL parameter). Using
3514 =%(my-function)= passes the tag to a custom function, and replace it
3515 by the resulting string.
3517 If the replacement text do not contain any specifier, it is simply
3518 appended to the string in order to create the link.
3520 Instead of a string, you may also specify a function that will be
3521 called with the tag as the only argument to create the link.
3523 With the above setting, you could link to a specific bug with
3524 =[[bugzilla:129]]=, search the web for =OrgMode= with =[[google:OrgMode]]=,
3525 show the map location of the Free Software Foundation =[[gmap:51
3526 Franklin Street, Boston]]= or of Carsten office =[[omap:Science Park 904,
3527 Amsterdam, The Netherlands]]= and find out what the Org author is doing
3528 besides Emacs hacking with =[[ads:Dominik,C]]=.
3530 If you need special abbreviations just for a single Org buffer, you
3531 can define them in the file with
3533 #+cindex: LINK, keyword
3535 ,#+LINK: bugzilla http://10.1.2.9/bugzilla/show_bug.cgi?id=
3536 ,#+LINK: google http://www.google.com/search?q=%s
3539 #+texinfo: @noindent
3540 In-buffer completion (see [[*Completion]]) can be used after =[= to
3541 complete link abbreviations. You may also define a function that
3542 implements special (e.g., completion) support for inserting such
3543 a link with {{{kbd(C-c C-l)}}}. Such a function should not accept any
3544 arguments, and return the full link with prefix. You can set the link
3545 completion function like this:
3547 #+BEGIN_SRC emacs-lisp
3548 (org-link-set-parameter "type" :complete #'some-completion-function)
3551 ** Search options in file links
3553 :DESCRIPTION: Linking to a specific location.
3554 :ALT_TITLE: Search options
3556 #+cindex: search option in file links
3557 #+cindex: file links, searching
3559 File links can contain additional information to make Emacs jump to
3560 a particular location in the file when following a link. This can be
3561 a line number or a search option after a double colon[fn:35]. For
3562 example, when the command {{{kbd(C-c l)}}} creates a link (see
3563 [[*Handling links]]) to a file, it encodes the words in the current line
3564 as a search string that can be used to find this line back later when
3565 following the link with {{{kbd(C-c C-o)}}}.
3567 Here is the syntax of the different ways to attach a search to a file
3568 link, together with an explanation:
3571 [[file:~/code/main.c::255]]
3572 [[file:~/xx.org::My Target]]
3573 [[file:~/xx.org::*My Target]]
3574 [[file:~/xx.org::#my-custom-id]]
3575 [[file:~/xx.org::/regexp/]]
3578 - =255= :: Jump to line 255.
3579 - =My Target= :: Search for a link target =<<My Target>>=, or do
3580 a text search for =my target=, similar to the search in internal
3581 links, see [[*Internal links]]. In HTML export (see [[*HTML export]]),
3582 such a file link becomes a HTML reference to the corresponding
3583 named anchor in the linked file.
3584 - =*My Target= :: In an Org file, restrict search to headlines.
3585 - =#my-custom-id= :: Link to a heading with a =CUSTOM_ID= property
3586 - =/REGEXP/= :: Do a regular expression search for {{{var(REGEXP)}}}.
3587 This uses the Emacs command ~occur~ to list all matches in
3588 a separate window. If the target file is in Org mode,
3589 ~org-occur~ is used to create a sparse tree with the matches.
3591 As a degenerate case, a file link with an empty file name can be used
3592 to search the current file. For example, =[[file:::find me]]= does
3593 a search for =find me= in the current file, just as =[[find me]]= would.
3597 :DESCRIPTION: When the default search is not enough.
3599 #+cindex: custom search strings
3600 #+cindex: search strings, custom
3602 The default mechanism for creating search strings and for doing the
3603 actual search related to a file link may not work correctly in all
3604 cases. For example, BibTeX database files have many entries like
3605 ~year="1993"~ which would not result in good search strings, because
3606 the only unique identification for a BibTeX entry is the citation key.
3608 #+vindex: org-create-file-search-functions
3609 #+vindex: org-execute-file-search-functions
3610 If you come across such a problem, you can write custom functions to
3611 set the right search string for a particular file type, and to do the
3612 search for the string in the file. Using ~add-hook~, these functions
3613 need to be added to the hook variables
3614 ~org-create-file-search-functions~ and
3615 ~org-execute-file-search-functions~. See the docstring for these
3616 variables for more information. Org actually uses this mechanism for
3617 BibTeX database files, and you can use the corresponding code as an
3618 implementation example. See the file =org-bibtex.el=.
3622 :DESCRIPTION: Every tree branch can be a TODO item.
3623 :ALT_TITLE: TODO Items
3625 #+cindex: TODO items
3627 Org mode does not maintain TODO lists as separate documents[fn:36].
3628 Instead, TODO items are an integral part of the notes file, because
3629 TODO items usually come up while taking notes! With Org mode, simply
3630 mark any entry in a tree as being a TODO item. In this way,
3631 information is not duplicated, and the entire context from which the
3632 TODO item emerged is always present.
3634 Of course, this technique for managing TODO items scatters them
3635 throughout your notes file. Org mode compensates for this by
3636 providing methods to give you an overview of all the things that you
3639 ** Basic TODO functionality
3641 :DESCRIPTION: Marking and displaying TODO entries.
3642 :ALT_TITLE: TODO basics
3645 Any headline becomes a TODO item when it starts with the word =TODO=,
3648 : *** TODO Write letter to Sam Fortune
3650 #+texinfo: @noindent
3651 The most important commands to work with TODO entries are:
3653 - {{{kbd(C-c C-t)}}} (~org-todo~) ::
3656 #+cindex: cycling, of TODO states
3657 Rotate the TODO state of the current item among
3660 ,-> (unmarked) -> TODO -> DONE --.
3661 '--------------------------------'
3664 If TODO keywords have fast access keys (see [[*Fast access to
3665 TODO states]]), prompt for a TODO keyword through the fast
3666 selection interface; this is the default behavior when
3667 ~org-use-fast-todo-selection~ is non-~nil~.
3669 The same rotation can also be done "remotely" from the timeline
3670 and agenda buffers with the {{{kbd(t)}}} command key (see
3671 [[*Commands in the agenda buffer]]).
3673 - {{{kbd(C-u C-c C-t)}}} ::
3675 #+kindex: C-u C-c C-t
3676 When TODO keywords have no selection keys, select a specific
3677 keyword using completion; otherwise force cycling through TODO
3678 states with no prompt. When ~org-use-fast-todo-selection~ is set
3679 to ~prefix~, use the fast selection interface.
3681 - {{{kbd(S-right)}}} {{{kbd(S-left)}}} ::
3685 #+vindex: org-treat-S-cursor-todo-selection-as-state-change
3686 Select the following/preceding TODO state, similar to cycling.
3687 Useful mostly if more than two TODO states are possible (see
3688 [[*Extended use of TODO keywords]]). See also [[*Packages that
3689 conflict with Org mode]], for a discussion of the interaction with
3690 ~shift-selection-mode~. See also the variable
3691 ~org-treat-S-cursor-todo-selection-as-state-change~.
3693 - {{{kbd(C-c / t)}}} (~org-show-todo-tree~) ::
3696 #+cindex: sparse tree, for TODO
3697 #+vindex: org-todo-keywords
3698 #+findex: org-show-todo-tree
3699 View TODO items in a /sparse tree/ (see [[*Sparse trees]]). Folds
3700 the entire buffer, but shows all TODO items -- with not-DONE
3701 state -- and the headings hierarchy above them. With a prefix
3702 argument, or by using {{{kbd(C-c / T)}}}, search for a specific
3703 TODO. You are prompted for the keyword, and you can also give
3704 a list of keywords like =KWD1|KWD2|...= to list entries that
3705 match any one of these keywords. With a numeric prefix argument
3706 N, show the tree for the Nth keyword in the variable
3707 ~org-todo-keywords~. With two prefix arguments, find all TODO
3708 states, both un-done and done.
3710 - {{{kbd(C-c a t)}}} (~org-todo-list~) ::
3713 Show the global TODO list. Collects the TODO items (with
3714 not-DONE states) from all agenda files (see [[*Agenda views]]) into
3715 a single buffer. The new buffer is in Org Agenda mode, which
3716 provides commands to examine and manipulate the TODO entries from
3717 the new buffer (see [[*Commands in the agenda buffer]]). See [[*The
3718 global TODO list]], for more information.
3720 - {{{kbd(S-M-RET)}}} (~org-insert-todo-heading~) ::
3723 #+findex: org-insert-todo-heading
3724 Insert a new TODO entry below the current one.
3726 #+vindex: org-todo-state-tags-triggers
3727 #+texinfo: @noindent
3728 Changing a TODO state can also trigger tag changes. See the docstring
3729 of the option ~org-todo-state-tags-triggers~ for details.
3731 ** Extended use of TODO keywords
3733 :DESCRIPTION: Workflow and assignments.
3734 :ALT_TITLE: TODO extensions
3736 #+cindex: extended TODO keywords
3738 #+vindex: org-todo-keywords
3739 By default, marked TODO entries have one of only two states: TODO and
3740 DONE. Org mode allows you to classify TODO items in more complex ways
3741 with /TODO keywords/ (stored in ~org-todo-keywords~). With special
3742 setup, the TODO keyword system can work differently in different
3745 Note that /tags/ are another way to classify headlines in general and
3746 TODO items in particular (see [[*Tags]]).
3748 *** TODO keywords as workflow states
3750 :DESCRIPTION: From TODO to DONE in steps.
3751 :ALT_TITLE: Workflow states
3753 #+cindex: TODO workflow
3754 #+cindex: workflow states as TODO keywords
3756 You can use TODO keywords to indicate different /sequential/ states in
3757 the process of working on an item, for example[fn:37]:
3759 #+begin_src emacs-lisp
3760 (setq org-todo-keywords
3761 '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED")))
3764 The vertical bar separates the TODO keywords (states that /need
3765 action/) from the DONE states (which need /no further action/). If
3766 you do not provide the separator bar, the last state is used as the
3769 #+cindex: completion, of TODO keywords
3770 With this setup, the command {{{kbd(C-c C-t)}}} cycles an entry from
3771 =TODO= to =FEEDBACK=, then to =VERIFY=, and finally to =DONE= and
3772 =DELEGATED=. You may also use a numeric prefix argument to quickly
3773 select a specific state. For example {{{kbd(C-3 C-c C-t)}}} changes
3774 the state immediately to =VERIFY=. Or you can use {{{kbd(S-left)}}}
3775 to go backward through the sequence. If you define many keywords, you
3776 can use in-buffer completion (see [[*Completion]]) or even a special
3777 one-key selection scheme (see [[*Fast access to TODO states]]) to insert
3778 these words into the buffer. Changing a TODO state can be logged with
3779 a timestamp, see [[*Tracking TODO state changes]], for more information.
3781 *** TODO keywords as types
3783 :DESCRIPTION: I do this, Fred does the rest.
3784 :ALT_TITLE: TODO types
3786 #+cindex: TODO types
3787 #+cindex: names as TODO keywords
3788 #+cindex: types as TODO keywords
3790 The second possibility is to use TODO keywords to indicate different
3791 /types/ of action items. For example, you might want to indicate that
3792 items are for "work" or "home". Or, when you work with several people
3793 on a single project, you might want to assign action items directly to
3794 persons, by using their names as TODO keywords. This would be set up
3797 #+begin_src emacs-lisp
3798 (setq org-todo-keywords '((type "Fred" "Sara" "Lucy" "|" "DONE")))
3801 In this case, different keywords do not indicate a sequence, but
3802 rather different types. So the normal work flow would be to assign
3803 a task to a person, and later to mark it DONE. Org mode supports this
3804 style by adapting the workings of the command {{{kbd(C-c
3805 C-t)}}}[fn:38]. When used several times in succession, it still
3806 cycles through all names, in order to first select the right type for
3807 a task. But when you return to the item after some time and execute
3808 {{{kbd(C-c C-t)}}} again, it will switch from any name directly to
3809 =DONE=. Use prefix arguments or completion to quickly select
3810 a specific name. You can also review the items of a specific TODO
3811 type in a sparse tree by using a numeric prefix to {{{kbd(C-c / t)}}}.
3812 For example, to see all things Lucy has to do, you would use
3813 {{{kbd(C-3 C-c / t)}}}. To collect Lucy's items from all agenda files
3814 into a single buffer, you would use the numeric prefix argument as
3815 well when creating the global TODO list: {{{kbd(C-3 C-c a t)}}}.
3817 *** Multiple keyword sets in one file
3819 :DESCRIPTION: Mixing it all, still finding your way.
3820 :ALT_TITLE: Multiple sets in one file
3822 #+cindex: TODO keyword sets
3824 Sometimes you may want to use different sets of TODO keywords in
3825 parallel. For example, you may want to have the basic TODO/DONE, but
3826 also a workflow for bug fixing, and a separate state indicating that
3827 an item has been canceled -- so it is not DONE, but also does not
3828 require action. Your setup would then look like this:
3830 #+begin_src emacs-lisp
3831 (setq org-todo-keywords
3832 '((sequence "TODO" "|" "DONE")
3833 (sequence "REPORT" "BUG" "KNOWNCAUSE" "|" "FIXED")
3834 (sequence "|" "CANCELED")))
3837 The keywords should all be different, this helps Org mode to keep
3838 track of which subsequence should be used for a given entry. In this
3839 setup, {{{kbd(C-c C-t)}}} only operates within a subsequence, so it
3840 switches from =DONE= to (nothing) to =TODO=, and from =FIXED= to
3841 (nothing) to =REPORT=. Therefore you need a mechanism to initially
3842 select the correct sequence. Besides the obvious ways like typing
3843 a keyword or using completion, you may also apply the following
3846 #+attr_texinfo: :sep ,
3847 - {{{kbd(C-u C-u C-c C-t)}}}, {{{kbd(C-S-right)}}}, {{{kbd(C-S-left)}}} ::
3851 #+kindex: C-u C-u C-c C-t
3852 These keys jump from one TODO subset to the next. In the above
3853 example, {{{kbd(C-u C-u C-c C-t)}}} or {{{kbd(C-S-right)}}} would
3854 jump from =TODO= or =DONE= to =REPORT=, and any of the words in
3855 the second row to =CANCELED=. Note that the {{{kbd(C-S-)}}} key
3856 binding conflict with ~shift-selection-mode~ (see [[*Packages that
3857 conflict with Org mode]]).
3859 - {{{kbd(S-right)}}}, {{{kbd(S-left)}}} ::
3863 {{{kbd(S-left)}}} and {{{kbd(S-right)}}} walk through /all/
3864 keywords from all sets, so for example {{{kbd(S-right)}}} would
3865 switch from =DONE= to =REPORT= in the example above. For
3866 a discussion of the interaction with ~shift-selection-mode~, see
3867 [[*Packages that conflict with Org mode]].
3869 *** Fast access to TODO states
3871 :DESCRIPTION: Single letter selection of state.
3874 If you would like to quickly change an entry to an arbitrary TODO
3875 state instead of cycling through the states, you can set up keys for
3876 single-letter access to the states. This is done by adding the
3877 selection character after each keyword, in parentheses[fn:39]. For
3880 #+begin_src emacs-lisp
3881 (setq org-todo-keywords
3882 '((sequence "TODO(t)" "|" "DONE(d)")
3883 (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)")
3884 (sequence "|" "CANCELED(c)")))
3887 #+vindex: org-fast-tag-selection-include-todo
3888 If you then press {{{kbd(C-c C-t)}}} followed by the selection key,
3889 the entry is switched to this state. {{{kbd(SPC)}}} can be used to
3890 remove any TODO keyword from an entry[fn:40].
3892 *** Setting up keywords for individual files
3894 :DESCRIPTION: Different files, different requirements.
3895 :ALT_TITLE: Per-file keywords
3897 #+cindex: keyword options
3898 #+cindex: per-file keywords
3899 #+cindex: TODO, keyword
3900 #+cindex: TYP_TODO, keyword
3901 #+cindex: SEQ_TODO, keyword
3903 It can be very useful to use different aspects of the TODO mechanism
3904 in different files. For file-local settings, you need to add special
3905 lines to the file which set the keywords and interpretation for that
3906 file only. For example, to set one of the two examples discussed
3907 above, you need one of the following lines, starting in column zero
3908 anywhere in the file:
3910 : #+TODO: TODO FEEDBACK VERIFY | DONE CANCELED
3912 #+texinfo: @noindent
3913 you may also write =#+SEQ_TODO= to be explicit about the
3914 interpretation, but it means the same as =#+TODO=, or
3916 : #+TYP_TODO: Fred Sara Lucy Mike | DONE
3918 A setup for using several sets in parallel would be:
3921 ,#+TODO: TODO | DONE
3922 ,#+TODO: REPORT BUG KNOWNCAUSE | FIXED
3926 #+cindex: completion, of option keywords
3928 #+texinfo: @noindent
3929 To make sure you are using the correct keyword, type =#+= into the
3930 buffer and then use {{{kbd(M-TAB)}}} completion.
3932 #+cindex: DONE, final TODO keyword
3933 Remember that the keywords after the vertical bar -- or the last
3934 keyword if no bar is there -- must always mean that the item is DONE,
3935 although you may use a different word. After changing one of these
3936 lines, use {{{kbd(C-c C-c)}}} with the cursor still in the line to
3937 make the changes known to Org mode[fn:41].
3939 *** Faces for TODO keywords
3941 :DESCRIPTION: Highlighting states.
3943 #+cindex: faces, for TODO keywords
3945 #+vindex: org-todo, face
3946 #+vindex: org-done, face
3947 #+vindex: org-todo-keyword-faces
3948 Org mode highlights TODO keywords with special faces: ~org-todo~ for
3949 keywords indicating that an item still has to be acted upon, and
3950 ~org-done~ for keywords indicating that an item is finished. If you
3951 are using more than two different states, you might want to use
3952 special faces for some of them. This can be done using the variable
3953 ~org-todo-keyword-faces~. For example:
3955 #+begin_src emacs-lisp
3956 (setq org-todo-keyword-faces
3957 '(("TODO" . org-warning) ("STARTED" . "yellow")
3958 ("CANCELED" . (:foreground "blue" :weight bold))))
3961 #+vindex: org-faces-easy-properties
3962 While using a list with face properties as shown for =CANCELED=
3963 /should/ work, this does not always seem to be the case. If
3964 necessary, define a special face and use that. A string is
3965 interpreted as a color. The variable ~org-faces-easy-properties~
3966 determines if that color is interpreted as a foreground or
3969 *** TODO dependencies
3971 :DESCRIPTION: When one task needs to wait for others.
3973 #+cindex: TODO dependencies
3974 #+cindex: dependencies, of TODO states
3976 #+vindex: org-enforce-todo-dependencies
3977 #+cindex: ORDERED, property
3978 The structure of Org files -- hierarchy and lists -- makes it easy to
3979 define TODO dependencies. Usually, a parent TODO task should not be
3980 marked DONE until all subtasks, defined as children tasks, are marked
3981 as DONE. And sometimes there is a logical sequence to a number of
3982 (sub)tasks, so that one task cannot be acted upon before all siblings
3983 above it are done. If you customize the variable
3984 ~org-enforce-todo-dependencies~, Org blocks entries from changing
3985 state to DONE while they have children that are not DONE.
3986 Furthermore, if an entry has a property =ORDERED=, each of its
3987 children is blocked until all earlier siblings are marked DONE. Here
3991 ,* TODO Blocked until (two) is done
4000 ,** TODO b, needs to wait for (a)
4001 ,** TODO c, needs to wait for (a) and (b)
4004 #+cindex: TODO dependencies, NOBLOCKING
4005 #+cindex: NOBLOCKING, property
4006 You can ensure an entry is never blocked by using the =NOBLOCKING=
4010 ,* This entry is never blocked
4016 - {{{kbd(C-c C-x o)}}} (~org-toggle-ordered-property~) ::
4019 #+findex: org-toggle-ordered-property
4020 #+vindex: org-track-ordered-property-with-tag
4021 #+cindex: ORDERED, property
4022 Toggle the =ORDERED= property of the current entry. A property
4023 is used for this behavior because this should be local to the
4024 current entry, not inherited like a tag. However, if you would
4025 like to /track/ the value of this property with a tag for better
4026 visibility, customize the variable
4027 ~org-track-ordered-property-with-tag~.
4029 - {{{kbd(C-u C-u C-u C-c C-t)}}} ::
4031 #+kindex: C-u C-u C-u C-c C-t
4032 Change TODO state, circumventing any state blocking.
4034 #+vindex: org-agenda-dim-blocked-tasks
4035 If you set the variable ~org-agenda-dim-blocked-tasks~, TODO entries
4036 that cannot be closed because of such dependencies are shown in
4037 a dimmed font or even made invisible in agenda views (see [[*Agenda
4040 #+cindex: checkboxes and TODO dependencies
4041 #+vindex: org-enforce-todo-dependencies
4042 You can also block changes of TODO states by looking at checkboxes
4043 (see [[*Checkboxes]]). If you set the variable
4044 ~org-enforce-todo-checkbox-dependencies~, an entry that has unchecked
4045 checkboxes is blocked from switching to DONE.
4047 If you need more complex dependency structures, for example
4048 dependencies between entries in different trees or files, check out
4049 the contributed module =org-depend.el=.
4053 :DESCRIPTION: Dates and notes for progress.
4055 #+cindex: progress logging
4056 #+cindex: logging, of progress
4058 Org mode can automatically record a timestamp and possibly a note when
4059 you mark a TODO item as DONE, or even each time you change the state
4060 of a TODO item. This system is highly configurable, settings can be
4061 on a per-keyword basis and can be localized to a file or even
4062 a subtree. For information on how to clock working time for a task,
4063 see [[*Clocking work time]].
4067 :DESCRIPTION: When was this entry marked DONE?
4070 The most basic logging is to keep track of /when/ a certain TODO item
4071 was finished. This is achieved with[fn:42]
4073 #+begin_src emacs-lisp
4074 (setq org-log-done 'time)
4077 #+vindex: org-closed-keep-when-no-todo
4078 #+texinfo: @noindent
4079 Then each time you turn an entry from a TODO (not-done) state into any
4080 of the DONE states, a line =CLOSED: [timestamp]= is inserted just
4081 after the headline. If you turn the entry back into a TODO item
4082 through further state cycling, that line is removed again. If you
4083 turn the entry back to a non-TODO state (by pressing {{{kbd(C-c C-t
4084 SPC)}}} for example), that line is also removed, unless you set
4085 ~org-closed-keep-when-no-todo~ to non-~nil~. If you want to record
4086 a note along with the timestamp, use[fn:43]
4088 #+begin_src emacs-lisp
4089 (setq org-log-done 'note)
4092 #+texinfo: @noindent
4093 You are then be prompted for a note, and that note is stored below the
4094 entry with a =Closing Note= heading.
4096 *** Tracking TODO state changes
4098 :DESCRIPTION: When did the status change?
4100 #+cindex: drawer, for state change recording
4102 #+vindex: org-log-states-order-reversed
4103 #+vindex: org-log-into-drawer
4104 #+cindex: LOG_INTO_DRAWER, property
4105 When TODO keywords are used as workflow states (see [[*TODO keywords as workflow states][*Workflow states]]),
4106 you might want to keep track of when a state change occurred and maybe
4107 take a note about this change. You can either record just
4108 a timestamp, or a time-stamped note for a change. These records are
4109 inserted after the headline as an itemized list, newest first[fn:44].
4110 When taking a lot of notes, you might want to get the notes out of the
4111 way into a drawer (see [[*Drawers]]). Customize the variable
4112 ~org-log-into-drawer~ to get this behavior -- the recommended drawer
4113 for this is called =LOGBOOK=[fn:45]. You can also overrule the
4114 setting of this variable for a subtree by setting a =LOG_INTO_DRAWER=
4117 Since it is normally too much to record a note for every state, Org
4118 mode expects configuration on a per-keyword basis for this. This is
4119 achieved by adding special markers =!= (for a timestamp) or =@= (for
4120 a note with timestamp) in parentheses after each keyword. For
4121 example, with the setting
4123 #+begin_src emacs-lisp
4124 (setq org-todo-keywords
4125 '((sequence "TODO(t)" "WAIT(w@/!)" "|" "DONE(d!)" "CANCELED(c@)")))
4128 To record a timestamp without a note for TODO keywords configured with
4129 =@=, just type {{{kbd(C-c C-c)}}} to enter a blank note when prompted.
4131 #+vindex: org-log-done
4133 you not only define global TODO keywords and fast access keys, but
4134 also request that a time is recorded when the entry is set to =DONE=,
4135 and that a note is recorded when switching to =WAIT= or
4136 =CANCELED=[fn:46]. The setting for =WAIT= is even more special: the
4137 =!= after the slash means that in addition to the note taken when
4138 entering the state, a timestamp should be recorded when /leaving/ the
4139 =WAIT= state, if and only if the /target/ state does not configure
4140 logging for entering it. So it has no effect when switching from
4141 =WAIT= to =DONE=, because =DONE= is configured to record a timestamp
4142 only. But when switching from =WAIT= back to =TODO=, the =/!= in the
4143 =WAIT= setting now triggers a timestamp even though =TODO= has no
4146 You can use the exact same syntax for setting logging preferences local
4149 : #+TODO: TODO(t) WAIT(w@/!) | DONE(d!) CANCELED(c@)
4151 #+cindex: LOGGING, property
4152 In order to define logging settings that are local to a subtree or
4153 a single item, define a =LOGGING= property in this entry. Any
4154 non-empty =LOGGING= property resets all logging settings to ~nil~.
4155 You may then turn on logging for this specific tree using =STARTUP=
4156 keywords like =lognotedone= or =logrepeat=, as well as adding state
4157 specific settings like =TODO(!)=. For example:
4160 ,* TODO Log each state with only a time
4162 :LOGGING: TODO(!) WAIT(!) DONE(!) CANCELED(!)
4164 ,* TODO Only log when switching to WAIT, and when repeating
4166 :LOGGING: WAIT(@) logrepeat
4168 ,* TODO No logging at all
4174 *** Tracking your habits
4176 :DESCRIPTION: How consistent have you been?
4179 #+cindex: STYLE, property
4181 Org has the ability to track the consistency of a special category of
4182 TODO, called "habits." A habit has the following properties:
4184 1. You have enabled the ~habits~ module by customizing the variable
4187 2. The habit is a TODO item, with a TODO keyword representing an open
4190 3. The property =STYLE= is set to the value =habit=.
4192 4. The TODO has a scheduled date, usually with a =.+= style repeat
4193 interval. A =++= style may be appropriate for habits with time
4194 constraints, e.g., must be done on weekends, or a =+= style for an
4195 unusual habit that can have a backlog, e.g., weekly reports.
4197 5. The TODO may also have minimum and maximum ranges specified by
4198 using the syntax =.+2d/3d=, which says that you want to do the task
4199 at least every three days, but at most every two days.
4201 6. You must also have state logging for the DONE state enabled (see
4202 [[*Tracking TODO state changes]]), in order for historical data to be
4203 represented in the consistency graph. If it is not enabled it is
4204 not an error, but the consistency graphs are largely meaningless.
4206 To give you an idea of what the above rules look like in action, here's an
4207 actual habit with some history:
4211 SCHEDULED: <2009-10-17 Sat .+2d/4d>
4214 :LAST_REPEAT: [2009-10-19 Mon 00:36]
4216 - State "DONE" from "TODO" [2009-10-15 Thu]
4217 - State "DONE" from "TODO" [2009-10-12 Mon]
4218 - State "DONE" from "TODO" [2009-10-10 Sat]
4219 - State "DONE" from "TODO" [2009-10-04 Sun]
4220 - State "DONE" from "TODO" [2009-10-02 Fri]
4221 - State "DONE" from "TODO" [2009-09-29 Tue]
4222 - State "DONE" from "TODO" [2009-09-25 Fri]
4223 - State "DONE" from "TODO" [2009-09-19 Sat]
4224 - State "DONE" from "TODO" [2009-09-16 Wed]
4225 - State "DONE" from "TODO" [2009-09-12 Sat]
4228 What this habit says is: I want to shave at most every 2 days -- given
4229 by the =SCHEDULED= date and repeat interval -- and at least every
4230 4 days. If today is the 15th, then the habit first appears in the
4231 agenda on Oct 17, after the minimum of 2 days has elapsed, and will
4232 appear overdue on Oct 19, after four days have elapsed.
4234 What's really useful about habits is that they are displayed along
4235 with a consistency graph, to show how consistent you've been at
4236 getting that task done in the past. This graph shows every day that
4237 the task was done over the past three weeks, with colors for each day.
4238 The colors used are:
4240 - Blue :: If the task was not to be done yet on that day.
4241 - Green :: If the task could have been done on that day.
4242 - Yellow :: If the task was going to be overdue the next day.
4243 - Red :: If the task was overdue on that day.
4245 In addition to coloring each day, the day is also marked with an
4246 asterisk if the task was actually done that day, and an exclamation
4247 mark to show where the current day falls in the graph.
4249 There are several configuration variables that can be used to change
4250 the way habits are displayed in the agenda.
4252 - ~org-habit-graph-column~ ::
4254 #+vindex: org-habit-graph-column
4255 The buffer column at which the consistency graph should be drawn.
4256 This overwrites any text in that column, so it is a good idea to
4257 keep your habits' titles brief and to the point.
4259 - ~org-habit-preceding-days~ ::
4261 #+vindex: org-habit-preceding-days
4262 The amount of history, in days before today, to appear in
4265 - ~org-habit-following-days~ ::
4267 #+vindex: org-habit-following-days
4268 The number of days after today that appear in consistency graphs.
4270 - ~org-habit-show-habits-only-for-today~ ::
4272 #+vindex: org-habit-show-habits-only-for-today
4273 If non-~nil~, only show habits in today's agenda view. This is
4274 set to true by default.
4276 Lastly, pressing {{{kbd(K)}}} in the agenda buffer causes habits to
4277 temporarily be disabled and do not appear at all. Press {{{kbd(K)}}}
4278 again to bring them back. They are also subject to tag filtering, if
4279 you have habits which should only be done in certain contexts, for
4284 :DESCRIPTION: Some things are more important than others.
4286 #+cindex: priorities
4287 #+cindex: priority cookie
4289 If you use Org mode extensively, you may end up with enough TODO items
4290 that it starts to make sense to prioritize them. Prioritizing can be
4291 done by placing a /priority cookie/ into the headline of a TODO item,
4294 : *** TODO [#A] Write letter to Sam Fortune
4296 #+vindex: org-priority-faces
4297 #+texinfo: @noindent
4298 By default, Org mode supports three priorities: =A=, =B=, and =C=.
4299 =A= is the highest priority. An entry without a cookie is treated
4300 just like priority =B=. Priorities make a difference only for sorting
4301 in the agenda (see [[*Weekly/daily agenda]]); outside the agenda, they
4302 have no inherent meaning to Org mode. The cookies can be highlighted
4303 with special faces by customizing the variable ~org-priority-faces~.
4305 Priorities can be attached to any outline node; they do not need to be
4308 #+attr_texinfo: :sep ;
4309 - {{{kbd(C-c \,)}}} (~org-priority~) ::
4312 #+findex: org-priority
4313 Set the priority of the current headline. The command prompts
4314 for a priority character =A=, =B= or =C=. When you press
4315 {{{kbd(SPC)}}} instead, the priority cookie is removed from the
4316 headline. The priorities can also be changed "remotely" from the
4317 timeline and agenda buffer with the {{{kbd(\,)}}} command (see
4318 [[*Commands in the agenda buffer]]).
4320 - {{{kbd(S-up)}}} (~org-priority-up~); {{{kbd(S-down)}}} (~org-priority-down~) ::
4324 #+findex: org-priority-up
4325 #+findex: org-priority-down
4326 #+vindex: org-priority-start-cycle-with-default
4327 Increase/decrease priority of current headline[fn:47]. Note that
4328 these keys are also used to modify timestamps (see [[*Creating
4329 timestamps]]). See also [[*Packages that conflict with Org mode]], for
4330 a discussion of the interaction with ~shift-selection-mode~.
4332 #+vindex: org-highest-priority
4333 #+vindex: org-lowest-priority
4334 #+vindex: org-default-priority
4335 You can change the range of allowed priorities by setting the
4336 variables ~org-highest-priority~, ~org-lowest-priority~, and
4337 ~org-default-priority~. For an individual buffer, you may set these
4338 values (highest, lowest, default) like this (please make sure that the
4339 highest priority is earlier in the alphabet than the lowest priority):
4341 #+cindex: PRIORITIES, keyword
4342 : #+PRIORITIES: A C B
4344 ** Breaking tasks down tasks into subtasks
4346 :DESCRIPTION: Splitting a task into manageable pieces.
4347 :ALT_TITLE: Breaking down tasks
4349 #+cindex: tasks, breaking down
4350 #+cindex: statistics, for TODO items
4352 #+vindex: org-agenda-todo-list-sublevels
4353 It is often advisable to break down large tasks into smaller,
4354 manageable subtasks. You can do this by creating an outline tree
4355 below a TODO item, with detailed subtasks on the tree[fn:48]. To keep
4356 the overview over the fraction of subtasks that are already completed,
4357 insert either =[/]= or =[%]= anywhere in the headline. These cookies
4358 are updated each time the TODO status of a child changes, or when
4359 pressing {{{kbd(C-c C-c)}}} on the cookie. For example:
4362 ,* Organize Party [33%]
4363 ,** TODO Call people [1/2]
4367 ,** DONE Talk to neighbor
4370 #+cindex: COOKIE_DATA, property
4371 If a heading has both checkboxes and TODO children below it, the
4372 meaning of the statistics cookie become ambiguous. Set the property
4373 =COOKIE_DATA= to either =checkbox= or =todo= to resolve this issue.
4375 #+vindex: org-hierarchical-todo-statistics
4376 If you would like to have the statistics cookie count any TODO entries
4377 in the subtree (not just direct children), configure the variable
4378 ~org-hierarchical-todo-statistics~. To do this for a single subtree,
4379 include the word =recursive= into the value of the =COOKIE_DATA=
4383 ,* Parent capturing statistics [2/20]
4385 :COOKIE_DATA: todo recursive
4389 If you would like a TODO entry to automatically change to DONE when
4390 all children are done, you can use the following setup:
4392 #+begin_src emacs-lisp
4393 (defun org-summary-todo (n-done n-not-done)
4394 "Switch entry to DONE when all subentries are done, to TODO otherwise."
4395 (let (org-log-done org-log-states) ; turn off logging
4396 (org-todo (if (= n-not-done 0) "DONE" "TODO"))))
4398 (add-hook 'org-after-todo-statistics-hook 'org-summary-todo)
4401 Another possibility is the use of checkboxes to identify (a hierarchy
4402 of) a large number of subtasks (see [[*Checkboxes]]).
4406 :DESCRIPTION: Tick-off lists.
4408 #+cindex: checkboxes
4410 #+vindex: org-list-automatic-rules
4411 Every item in a plain list[fn:49] (see [[*Plain lists]]) can be made into
4412 a checkbox by starting it with the string =[ ]=. This feature is
4413 similar to TODO items (see [[*TODO items]]), but is more lightweight.
4414 Checkboxes are not included into the global TODO list, so they are
4415 often great to split a task into a number of simple steps. Or you can
4416 use them in a shopping list. To toggle a checkbox, use {{{kbd(C-c
4417 C-c)}}}, or use the mouse (thanks to Piotr Zielinski's
4420 Here is an example of a checkbox list.
4423 ,* TODO Organize party [2/4]
4424 - [-] call people [1/3]
4429 - [ ] think about what music to play
4430 - [X] talk to the neighbors
4433 Checkboxes work hierarchically, so if a checkbox item has children
4434 that are checkboxes, toggling one of the children checkboxes makes the
4435 parent checkbox reflect if none, some, or all of the children are
4438 #+cindex: statistics, for checkboxes
4439 #+cindex: checkbox statistics
4440 #+cindex: COOKIE_DATA, property
4441 #+vindex: org-hierarchical-checkbox-statistics
4442 The =[2/4]= and =[1/3]= in the first and second line are cookies
4443 indicating how many checkboxes present in this entry have been checked
4444 off, and the total number of checkboxes present. This can give you an
4445 idea on how many checkboxes remain, even without opening a folded
4446 entry. The cookies can be placed into a headline or into (the first
4447 line of) a plain list item. Each cookie covers checkboxes of direct
4448 children structurally below the headline/item on which the cookie
4449 appears[fn:50]. You have to insert the cookie yourself by typing
4450 either =[/]= or =[%]=. With =[/]= you get an =n out of m= result, as
4451 in the examples above. With =[%]= you get information about the
4452 percentage of checkboxes checked (in the above example, this would be
4453 =[50%]= and =[33%]=, respectively). In a headline, a cookie can count
4454 either checkboxes below the heading or TODO states of children, and it
4455 displays whatever was changed last. Set the property =COOKIE_DATA= to
4456 either =checkbox= or =todo= to resolve this issue.
4458 #+cindex: blocking, of checkboxes
4459 #+cindex: checkbox blocking
4460 #+cindex: ORDERED, property
4461 If the current outline node has an =ORDERED= property, checkboxes must
4462 be checked off in sequence, and an error is thrown if you try to check
4463 off a box while there are unchecked boxes above it.
4465 #+texinfo: @noindent
4466 The following commands work with checkboxes:
4468 - {{{kbd(C-c C-c)}}} (~org-toggle-checkbox~) ::
4471 #+findex: org-toggle-checkbox
4472 Toggle checkbox status or -- with prefix argument -- checkbox
4473 presence at point. With a single prefix argument, add an empty
4474 checkbox or remove the current one[fn:51]. With a double prefix
4475 argument, set it to =[-]=, which is considered to be an
4478 - {{{kbd(C-c C-x C-b)}}} (~org-toggle-checkbox~) ::
4480 #+kindex: C-c C-x C-b
4481 Toggle checkbox status or -- with prefix argument -- checkbox
4482 presence at point. With double prefix argument, set it to =[-]=,
4483 which is considered to be an intermediate state.
4485 - If there is an active region, toggle the first checkbox in the
4486 region and set all remaining boxes to the same status as the
4487 first. With a prefix argument, add or remove the checkbox for
4488 all items in the region.
4490 - If the cursor is in a headline, toggle checkboxes in the region
4491 between this headline and the next -- so /not/ the entire
4494 - If there is no active region, just toggle the checkbox at
4497 - {{{kbd(M-S-RET)}}} (~org-insert-todo-heading~) ::
4500 #+findex: org-insert-todo-heading
4501 Insert a new item with a checkbox. This works only if the cursor
4502 is already in a plain list item (see [[*Plain lists]]).
4504 - {{{kbd(C-c C-x o)}}} (~org-toggle-ordered-property~) ::
4507 #+findex: org-toggle-ordered-property
4508 #+vindex: org-track-ordered-property-with-tag
4509 Toggle the =ORDERED= property of the entry, to toggle if
4510 checkboxes must be checked off in sequence. A property is used
4511 for this behavior because this should be local to the current
4512 entry, not inherited like a tag. However, if you would like to
4513 /track/ the value of this property with a tag for better
4514 visibility, customize ~org-track-ordered-property-with-tag~.
4516 - {{{kbd(C-c #)}}} (~org-update-statistics-cookies~) ::
4519 #+findex: org-update-statistics-cookies
4520 Update the statistics cookie in the current outline entry. When
4521 called with a {{{kbd(C-u)}}} prefix, update the entire file.
4522 Checkbox statistic cookies are updated automatically if you
4523 toggle checkboxes with {{{kbd(C-c C-c)}}} and make new ones with
4524 {{{kbd(M-S-RET)}}}. TODO statistics cookies update when changing
4525 TODO states. If you delete boxes/entries or add/change them by
4526 hand, use this command to get things back into sync.
4530 :DESCRIPTION: Tagging headlines and matching sets of tags.
4533 #+cindex: headline tagging
4534 #+cindex: matching, tags
4535 #+cindex: sparse tree, tag based
4537 An excellent way to implement labels and contexts for
4538 cross-correlating information is to assign /tags/ to headlines. Org
4539 mode has extensive support for tags.
4541 #+vindex: org-tag-faces
4542 Every headline can contain a list of tags; they occur at the end of
4543 the headline. Tags are normal words containing letters, numbers, =_=,
4544 and =@=. Tags must be preceded and followed by a single colon, e.g.,
4545 =:work:=. Several tags can be specified, as in =:work:urgent:=. Tags
4546 by default are in bold face with the same color as the headline. You
4547 may specify special faces for specific tags using the variable
4548 ~org-tag-faces~, in much the same way as you can for TODO keywords
4549 (see [[*Faces for TODO keywords]]).
4553 :DESCRIPTION: Tags use the tree structure of an outline.
4555 #+cindex: tag inheritance
4556 #+cindex: inheritance, of tags
4557 #+cindex: sublevels, inclusion into tags match
4559 /Tags/ make use of the hierarchical structure of outline trees. If
4560 a heading has a certain tag, all subheadings inherit the tag as well.
4561 For example, in the list
4564 ,* Meeting with the French group :work:
4565 ,** Summary by Frank :boss:notes:
4566 ,*** TODO Prepare slides for him :action:
4569 #+texinfo: @noindent
4570 the final heading has the tags =work=, =boss=, =notes=, and =action=
4571 even though the final heading is not explicitly marked with those
4572 tags. You can also set tags that all entries in a file should inherit
4573 just as if these tags were defined in a hypothetical level zero that
4574 surrounds the entire file. Use a line like this[fn:52]
4576 #+cindex: FILETAGS, keyword
4577 : #+FILETAGS: :Peter:Boss:Secret:
4579 #+vindex: org-use-tag-inheritance
4580 #+vindex: org-tags-exclude-from-inheritance
4581 #+texinfo: @noindent
4582 To limit tag inheritance to specific tags, or to turn it off entirely,
4583 use the variables ~org-use-tag-inheritance~ and
4584 ~org-tags-exclude-from-inheritance~.
4586 #+vindex: org-tags-match-list-sublevels
4587 When a headline matches during a tags search while tag inheritance is
4588 turned on, all the sublevels in the same tree -- for a simple match
4589 form -- match as well[fn:53]. The list of matches may then become
4590 very long. If you only want to see the first tags match in a subtree,
4591 configure the variable ~org-tags-match-list-sublevels~ (not
4594 #+vindex: org-agenda-use-tag-inheritance
4595 Tag inheritance is relevant when the agenda search tries to match
4596 a tag, either in the ~tags~ or ~tags-todo~ agenda types. In other
4597 agenda types, ~org-use-tag-inheritance~ has no effect. Still, you may
4598 want to have your tags correctly set in the agenda, so that tag
4599 filtering works fine, with inherited tags. Set
4600 ~org-agenda-use-tag-inheritance~ to control this: the default value
4601 includes all agenda types, but setting this to ~nil~ can really speed
4602 up agenda generation.
4606 :DESCRIPTION: How to assign tags to a headline.
4608 #+cindex: setting tags
4609 #+cindex: tags, setting
4612 Tags can simply be typed into the buffer at the end of a headline.
4613 After a colon, {{{kbd(M-TAB)}}} offers completion on tags. There is
4614 also a special command for inserting tags:
4616 - {{{kbd(C-c C-q)}}} (~org-set-tags-command~) ::
4619 #+findex: org-set-tags-command
4620 #+cindex: completion, of tags
4621 #+vindex: org-tags-column
4622 Enter new tags for the current headline. Org mode either offers
4623 completion or a special single-key interface for setting tags,
4624 see below. After pressing {{{kbd(RET)}}}, the tags are inserted
4625 and aligned to ~org-tags-column~. When called with
4626 a {{{kbd(C-u)}}} prefix, all tags in the current buffer are
4627 aligned to that column, just to make things look nice. Tags are
4628 automatically realigned after promotion, demotion, and TODO state
4629 changes (see [[*Basic TODO functionality]]).
4631 - {{{kbd(C-c C-c)}}} (~org-set-tags-command~) ::
4634 When the cursor is in a headline, this does the same as
4637 #+vindex: org-tag-alist
4638 Org supports tag insertion based on a /list of tags/. By default this
4639 list is constructed dynamically, containing all tags currently used in
4640 the buffer. You may also globally specify a hard list of tags with
4641 the variable ~org-tag-alist~. Finally you can set the default tags
4642 for a given file with lines like
4644 #+cindex: TAGS, keyword
4646 ,#+TAGS: @work @home @tennisclub
4647 ,#+TAGS: laptop car pc sailboat
4650 If you have globally defined your preferred set of tags using the
4651 variable ~org-tag-alist~, but would like to use a dynamic tag list in
4652 a specific file, add an empty =TAGS= keyword to that file:
4656 #+vindex: org-tag-persistent-alist
4657 If you have a preferred set of tags that you would like to use in
4658 every file, in addition to those defined on a per-file basis by =TAGS=
4659 keyword, then you may specify a list of tags with the variable
4660 ~org-tag-persistent-alist~. You may turn this off on a per-file basis
4661 by adding a =STARTUP= keyword to that file:
4665 By default Org mode uses the standard minibuffer completion facilities
4666 for entering tags. However, it also implements another, quicker, tag
4667 selection method called /fast tag selection/. This allows you to
4668 select and deselect tags with just a single key press. For this to
4669 work well you should assign unique letters to most of your commonly
4670 used tags. You can do this globally by configuring the variable
4671 ~org-tag-alist~ in your Emacs init file. For example, you may find
4672 the need to tag many items in different files with =@home=. In this
4673 case you can set something like:
4675 #+begin_src emacs-lisp
4676 (setq org-tag-alist '(("@work" . ?w) ("@home" . ?h) ("laptop" . ?l)))
4679 #+texinfo: @noindent
4680 If the tag is only relevant to the file you are working on, then you
4681 can instead set the =TAGS= keyword as:
4683 : #+TAGS: @work(w) @home(h) @tennisclub(t) laptop(l) pc(p)
4685 #+texinfo: @noindent
4686 The tags interface shows the available tags in a splash window. If
4687 you want to start a new line after a specific tag, insert =\n= into
4690 : #+TAGS: @work(w) @home(h) @tennisclub(t) \n laptop(l) pc(p)
4692 #+texinfo: @noindent
4693 or write them in two lines:
4696 ,#+TAGS: @work(w) @home(h) @tennisclub(t)
4697 ,#+TAGS: laptop(l) pc(p)
4700 #+texinfo: @noindent
4701 You can also group together tags that are mutually exclusive by using
4704 : #+TAGS: { @work(w) @home(h) @tennisclub(t) } laptop(l) pc(p)
4706 #+texinfo: @noindent
4707 you indicate that at most one of =@work=, =@home=, and =@tennisclub=
4708 should be selected. Multiple such groups are allowed.
4710 #+texinfo: @noindent
4711 Do not forget to press {{{kbd(C-c C-c)}}} with the cursor in one of
4712 these lines to activate any changes.
4714 #+texinfo: @noindent
4715 To set these mutually exclusive groups in the variable
4716 ~org-tags-alist~, you must use the dummy tags ~:startgroup~ and
4717 ~:endgroup~ instead of the braces. Similarly, you can use ~:newline~
4718 to indicate a line break. The previous example would be set globally
4719 by the following configuration:
4721 #+begin_src emacs-lisp
4722 (setq org-tag-alist '((:startgroup . nil)
4723 ("@work" . ?w) ("@home" . ?h)
4724 ("@tennisclub" . ?t)
4726 ("laptop" . ?l) ("pc" . ?p)))
4729 If at least one tag has a selection key then pressing {{{kbd(C-c
4730 C-c)}}} automatically presents you with a special interface, listing
4731 inherited tags, the tags of the current headline, and a list of all
4732 valid tags with corresponding keys[fn:54].
4734 Pressing keys assigned to tags adds or removes them from the list of
4735 tags in the current line. Selecting a tag in a group of mutually
4736 exclusive tags turns off any other tag from that group.
4738 In this interface, you can also use the following special keys:
4743 Enter a tag in the minibuffer, even if the tag is not in the
4744 predefined list. You can complete on all tags present in the
4745 buffer. You can also add several tags: just separate them with
4751 Clear all tags for this line.
4756 Accept the modified set.
4761 Abort without installing changes.
4766 If {{{kbd(q)}}} is not assigned to a tag, it aborts like
4772 Turn off groups of mutually exclusive tags. Use this to (as an
4773 exception) assign several tags from such a group.
4778 Toggle auto-exit after the next change (see below). If you are
4779 using expert mode, the first {{{kbd(C-c)}}} displays the
4782 #+texinfo: @noindent
4783 This method lets you assign tags to a headline with very few keys.
4784 With the above setup, you could clear the current tags and set
4785 =@home=, =laptop= and =pc= tags with just the following keys:
4786 {{{kbd(C-c C-c SPC h l p RET)}}}. Switching from =@home= to =@work=
4787 would be done with {{{kbd(C-c C-c w RET)}}} or alternatively with
4788 {{{kbd(C-c C-c C-c w)}}}. Adding the non-predefined tag =Sarah= could
4789 be done with {{{kbd(C-c C-c TAB S a r a h RET)}}}.
4791 #+vindex: org-fast-tag-selection-single-key
4792 If you find that most of the time you need only a single key press to
4793 modify your list of tags, set the variable
4794 ~org-fast-tag-selection-single-key~. Then you no longer have to press
4795 {{{kbd(RET)}}} to exit fast tag selection -- it exits after the first
4796 change. If you then occasionally need more keys, press {{{kbd(C-c)}}}
4797 to turn off auto-exit for the current tag selection process (in
4798 effect: start selection with {{{kbd(C-c C-c C-c)}}} instead of
4799 {{{kbd(C-c C-c)}}}). If you set the variable to the value ~expert~,
4800 the special window is not even shown for single-key tag selection, it
4801 comes up only when you press an extra {{{kbd(C-c)}}}.
4805 :DESCRIPTION: Create a hierarchy of tags.
4807 #+cindex: group tags
4808 #+cindex: tags, groups
4809 #+cindex: tags hierarchy
4811 Tags can be defined in hierarchies. A tag can be defined as a /group
4812 tag/ for a set of other tags. The group tag can be seen as the
4813 "broader term" for its set of tags. Defining multiple group tags and
4814 nesting them creates a tag hierarchy.
4816 One use-case is to create a taxonomy of terms (tags) that can be used
4817 to classify nodes in a document or set of documents.
4819 When you search for a group tag, it return matches for all members in
4820 the group and its subgroups. In an agenda view, filtering by a group
4821 tag displays or hide headlines tagged with at least one of the members
4822 of the group or any of its subgroups. This makes tag searches and
4823 filters even more flexible.
4825 You can set group tags by using brackets and inserting a colon between
4826 the group tag and its related tags -- beware that all whitespaces are
4827 mandatory so that Org can parse this line correctly:
4829 : #+TAGS: [ GTD : Control Persp ]
4831 In this example, =GTD= is the group tag and it is related to two other
4832 tags: =Control=, =Persp=. Defining =Control= and =Persp= as group
4833 tags creates an hierarchy of tags:
4836 ,#+TAGS: [ Control : Context Task ]
4837 ,#+TAGS: [ Persp : Vision Goal AOF Project ]
4840 That can conceptually be seen as a hierarchy of tags:
4852 You can use the ~:startgrouptag~, ~:grouptags~ and ~:endgrouptag~
4853 keyword directly when setting ~org-tag-alist~ directly:
4855 #+begin_src emacs-lisp
4856 (setq org-tag-alist '((:startgrouptag)
4870 The tags in a group can be mutually exclusive if using the same group
4871 syntax as is used for grouping mutually exclusive tags together; using
4874 : #+TAGS: { Context : @Home @Work @Call }
4876 When setting ~org-tag-alist~ you can use ~:startgroup~ and ~:endgroup~
4877 instead of ~:startgrouptag~ and ~:endgrouptag~ to make the tags
4880 Furthermore, the members of a group tag can also be regular
4881 expressions, creating the possibility of a more dynamic and rule-based
4882 tag structure. The regular expressions in the group must be specified
4883 within curly brackets. Here is an expanded example:
4886 ,#+TAGS: [ Vision : {V@.+} ]
4887 ,#+TAGS: [ Goal : {G@.+} ]
4888 ,#+TAGS: [ AOF : {AOF@.+} ]
4889 ,#+TAGS: [ Project : {P@.+} ]
4892 Searching for the tag =Project= now lists all tags also including
4893 regular expression matches for =P@.+=, and similarly for tag searches
4894 on =Vision=, =Goal= and =AOF=. For example, this would work well for
4895 a project tagged with a common project-identifier,
4896 e.g. =P@2014_OrgTags=.
4899 #+findex: org-toggle-tags-groups
4900 #+vindex: org-group-tags
4901 If you want to ignore group tags temporarily, toggle group tags
4902 support with ~org-toggle-tags-groups~, bound to {{{kbd(C-c C-x q)}}}.
4903 If you want to disable tag groups completely, set ~org-group-tags~ to
4908 :DESCRIPTION: Searching for combinations of tags.
4910 #+cindex: tag searches
4911 #+cindex: searching for tags
4913 Once a system of tags has been set up, it can be used to collect
4914 related information into special lists.
4916 - {{{kbd(C-c / m)}}} or {{{kbd(C-c \)}}} (~org-match-sparse-tree~) ::
4920 #+findex: org-match-sparse-tree
4921 Create a sparse tree with all headlines matching a tags search.
4922 With a {{{kbd(C-u)}}} prefix argument, ignore headlines that are
4925 - {{{kbd(C-c a m)}}} (~org-tags-view~) ::
4928 #+findex: org-tags-view
4929 Create a global list of tag matches from all agenda files. See
4930 [[*Matching tags and properties]].
4932 - {{{kbd(C-c a M)}}} (~org-tags-view~) ::
4935 #+vindex: org-tags-match-list-sublevels
4936 Create a global list of tag matches from all agenda files, but
4937 check only TODO items and force checking subitems (see the option
4938 ~org-tags-match-list-sublevels~).
4940 These commands all prompt for a match string which allows basic
4941 Boolean logic like =+boss+urgent-project1=, to find entries with tags
4942 =boss= and =urgent=, but not =project1=, or =Kathy|Sally= to find
4943 entries which are tagged, like =Kathy= or =Sally=. The full syntax of
4944 the search string is rich and allows also matching against TODO
4945 keywords, entry levels and properties. For a complete description
4946 with many examples, see [[*Matching tags and properties]].
4948 * Properties and columns
4950 :DESCRIPTION: Storing information about an entry.
4952 #+cindex: properties
4954 A property is a key-value pair associated with an entry. Properties
4955 can be set so they are associated with a single entry, with every
4956 entry in a tree, or with every entry in an Org file.
4958 There are two main applications for properties in Org mode. First,
4959 properties are like tags, but with a value. Imagine maintaining
4960 a file where you document bugs and plan releases for a piece of
4961 software. Instead of using tags like =release_1=, =release_2=, you
4962 can use a property, say =Release=, that in different subtrees has
4963 different values, such as =1.0= or =2.0=. Second, you can use
4964 properties to implement (very basic) database capabilities in an Org
4965 buffer. Imagine keeping track of your music CDs, where properties
4966 could be things such as the album, artist, date of release, number of
4969 Properties can be conveniently edited and viewed in column view (see
4974 :DESCRIPTION: How properties are spelled out.
4976 #+cindex: property syntax
4977 #+cindex: drawer, for properties
4979 Properties are key--value pairs. When they are associated with
4980 a single entry or with a tree they need to be inserted into a special
4981 drawer (see [[*Drawers]]) with the name =PROPERTIES=, which has to be
4982 located right below a headline, and its planning line (see [[*Deadlines
4983 and scheduling]]) when applicable. Each property is specified on
4984 a single line, with the key -- surrounded by colons -- first, and the
4985 value after it. Keys are case-insensitive. Here is an example:
4990 ,*** Goldberg Variations
4992 :Title: Goldberg Variations
4993 :Composer: J.S. Bach
4995 :Publisher: Deutsche Grammophon
5000 Depending on the value of ~org-use-property-inheritance~, a property
5001 set this way is associated either with a single entry, or with the
5002 sub-tree defined by the entry, see [[*Property inheritance]].
5004 You may define the allowed values for a particular property =Xyz= by
5005 setting a property =Xyz_ALL=. This special property is /inherited/,
5006 so if you set it in a level 1 entry, it applies to the entire tree.
5007 When allowed values are defined, setting the corresponding property
5008 becomes easier and is less prone to typing errors. For the example
5009 with the CD collection, we can pre-define publishers and the number of
5010 disks in a box like this:
5015 :NDisks_ALL: 1 2 3 4
5016 :Publisher_ALL: "Deutsche Grammophon" Philips EMI
5020 If you want to set properties that can be inherited by any entry in
5021 a file, use a line like:
5023 #+cindex: @samp{_ALL} suffix, in properties
5024 #+cindex: PROPERTY, keyword
5025 : #+PROPERTY: NDisks_ALL 1 2 3 4
5027 #+cindex: @samp{+} suffix, in properties
5028 If you want to add to the value of an existing property, append a =+=
5029 to the property name. The following results in the property =var=
5030 having the value =foo=1 bar=2=.
5033 ,#+PROPERTY: var foo=1
5034 ,#+PROPERTY: var+ bar=2
5037 It is also possible to add to the values of inherited properties. The
5038 following results in the =Genres= property having the value =Classic
5039 Baroque= under the =Goldberg Variations= subtree.
5047 ,*** Goldberg Variations
5049 :Title: Goldberg Variations
5050 :Composer: J.S. Bach
5052 :Publisher: Deutsche Grammophon
5058 Note that a property can only have one entry per drawer.
5060 #+vindex: org-global-properties
5061 Property values set with the global variable ~org-global-properties~
5062 can be inherited by all entries in all Org files.
5064 #+texinfo: @noindent
5065 The following commands help to work with properties:
5067 #+attr_texinfo: :sep ,
5068 - {{{kbd(M-TAB)}}} (~pcomplete~) ::
5072 After an initial colon in a line, complete property keys. All
5073 keys used in the current file are offered as possible
5076 - {{{kbd(C-c C-x p)}}} (~org-set-property~) ::
5079 #+findex: org-set-property
5080 Set a property. This prompts for a property name and a value.
5081 If necessary, the property drawer is created as well.
5083 - {{{kbd(C-u M-x org-insert-drawer)}}} ::
5085 #+findex: org-insert-drawer
5086 Insert a property drawer into the current entry. The drawer is
5087 inserted early in the entry, but after the lines with planning
5088 information like deadlines.
5090 - {{{kbd(C-c C-c)}}} (~org-property-action~) ::
5093 #+findex: org-property-action
5094 With the cursor in a property drawer, this executes property
5097 - {{{kbd(C-c C-c s)}}} (~org-set-property~) ::
5100 #+findex: org-set-property
5101 Set a property in the current entry. Both the property and the value
5102 can be inserted using completion.
5104 - {{{kbd(S-right)}}} (~org-property-next-allowed-values~), {{{kbd(S-left)}}} (~org-property-previous-allowed-value~) ::
5108 Switch property at point to the next/previous allowed value.
5110 - {{{kbd(C-c C-c d)}}} (~org-delete-property~) ::
5113 #+findex: org-delete-property
5114 Remove a property from the current entry.
5116 - {{{kbd(C-c C-c D)}}} (~org-delete-property-globally~) ::
5119 #+findex: org-delete-property-globally
5120 Globally remove a property, from all entries in the current file.
5122 - {{{kbd(C-c C-c c)}}} (~org-compute-property-at-point~) ::
5125 #+findex: org-compute-property-at-point
5126 Compute the property at point, using the operator and scope from
5127 the nearest column format definition.
5129 ** Special properties
5131 :DESCRIPTION: Access to other Org mode features.
5133 #+cindex: properties, special
5135 Special properties provide an alternative access method to Org mode
5136 features, like the TODO state or the priority of an entry, discussed
5137 in the previous chapters. This interface exists so that you can
5138 include these states in a column view (see [[*Column view]]), or to use
5139 them in queries. The following property names are special and should
5140 not be used as keys in the properties drawer:
5142 #+cindex: ALLTAGS, special property
5143 #+cindex: BLOCKED, special property
5144 #+cindex: CLOCKSUM, special property
5145 #+cindex: CLOCKSUM_T, special property
5146 #+cindex: CLOSED, special property
5147 #+cindex: DEADLINE, special property
5148 #+cindex: FILE, special property
5149 #+cindex: ITEM, special property
5150 #+cindex: PRIORITY, special property
5151 #+cindex: SCHEDULED, special property
5152 #+cindex: TAGS, special property
5153 #+cindex: TIMESTAMP, special property
5154 #+cindex: TIMESTAMP_IA, special property
5155 #+cindex: TODO, special property
5156 | =ALLTAGS= | All tags, including inherited ones. |
5157 | =BLOCKED= | ~t~ if task is currently blocked by children or siblings. |
5158 | =CATEGORY= | The category of an entry. |
5159 | =CLOCKSUM= | The sum of CLOCK intervals in the subtree. ~org-clock-sum~ |
5160 | | must be run first to compute the values in the current buffer. |
5161 | =CLOCKSUM_T= | The sum of CLOCK intervals in the subtree for today. |
5162 | | ~org-clock-sum-today~ must be run first to compute the |
5163 | | values in the current buffer. |
5164 | =CLOSED= | When was this entry closed? |
5165 | =DEADLINE= | The deadline time string, without the angular brackets. |
5166 | =FILE= | The filename the entry is located in. |
5167 | =ITEM= | The headline of the entry. |
5168 | =PRIORITY= | The priority of the entry, a string with a single letter. |
5169 | =SCHEDULED= | The scheduling timestamp, without the angular brackets. |
5170 | =TAGS= | The tags defined directly in the headline. |
5171 | =TIMESTAMP= | The first keyword-less timestamp in the entry. |
5172 | =TIMESTAMP_IA= | The first inactive timestamp in the entry. |
5173 | =TODO= | The TODO keyword of the entry. |
5175 ** Property searches
5177 :DESCRIPTION: Matching property values.
5179 #+cindex: properties, searching
5180 #+cindex: searching, of properties
5182 To create sparse trees and special lists with selection based on
5183 properties, the same commands are used as for tag searches (see [[*Tag
5186 - {{{kbd(C-c / m)}}} or {{{kbd(C-c \)}}} (~org-match-sparse-tree~) ::
5190 #+findex: org-match-sparse-tree
5191 Create a sparse tree with all matching entries. With
5192 a {{{kbd(C-u)}}} prefix argument, ignore headlines that are not
5195 - {{{kbd(C-c a m)}}}, ~org-tags-view~ ::
5198 Create a global list of tag/property matches from all agenda
5201 - {{{kbd(C-c a M)}}} (~org-tags-view~) ::
5204 #+findex: org-tags-view
5205 #+vindex: org-tags-match-list-sublevels
5206 Create a global list of tag matches from all agenda files, but
5207 check only TODO items and force checking of subitems (see the
5208 option ~org-tags-match-list-sublevels~).
5210 The syntax for the search string is described in [[*Matching tags and
5213 There is also a special command for creating sparse trees based on a
5216 - {{{kbd(C-c / p)}}} ::
5219 Create a sparse tree based on the value of a property. This
5220 first prompts for the name of a property, and then for a value.
5221 A sparse tree is created with all entries that define this
5222 property with the given value. If you enclose the value in curly
5223 braces, it is interpreted as a regular expression and matched
5224 against the property values.
5226 ** Property inheritance
5228 :DESCRIPTION: Passing values down a tree.
5230 #+cindex: properties, inheritance
5231 #+cindex: inheritance, of properties
5233 #+vindex: org-use-property-inheritance
5234 The outline structure of Org documents lends itself to an inheritance
5235 model of properties: if the parent in a tree has a certain property,
5236 the children can inherit this property. Org mode does not turn this
5237 on by default, because it can slow down property searches
5238 significantly and is often not needed. However, if you find
5239 inheritance useful, you can turn it on by setting the variable
5240 ~org-use-property-inheritance~. It may be set to ~t~ to make all
5241 properties inherited from the parent, to a list of properties that
5242 should be inherited, or to a regular expression that matches inherited
5243 properties. If a property has the value ~nil~, this is interpreted as
5244 an explicit un-define of the property, so that inheritance search
5245 stops at this value and returns ~nil~.
5247 Org mode has a few properties for which inheritance is hard-coded, at
5248 least for the special applications for which they are used:
5252 #+cindex: COLUMNS, property
5253 The =COLUMNS= property defines the format of column view (see
5254 [[*Column view]]). It is inherited in the sense that the level where
5255 a =COLUMNS= property is defined is used as the starting point for
5256 a column view table, independently of the location in the subtree
5257 from where columns view is turned on.
5261 #+cindex: CATEGORY, property
5262 For agenda view, a category set through a =CATEGORY= property
5263 applies to the entire subtree.
5267 #+cindex: ARCHIVE, property
5268 For archiving, the =ARCHIVE= property may define the archive
5269 location for the entire subtree (see [[*Moving a tree to an archive
5274 #+cindex: LOGGING, property
5275 The =LOGGING= property may define logging settings for an entry
5276 or a subtree (see [[*Tracking TODO state changes]]).
5280 :DESCRIPTION: Tabular viewing and editing.
5283 A great way to view and edit properties in an outline tree is /column
5284 view/. In column view, each outline node is turned into a table row.
5285 Columns in this table provide access to properties of the entries.
5286 Org mode implements columns by overlaying a tabular structure over the
5287 headline of each item. While the headlines have been turned into
5288 a table row, you can still change the visibility of the outline tree.
5289 For example, you get a compact table by switching to "contents"
5290 view -- {{{kbd(S-TAB)}}} {{{kbd(S-TAB)}}}, or simply {{{kbd(c)}}}
5291 while column view is active -- but you can still open, read, and edit
5292 the entry below each headline. Or, you can switch to column view
5293 after executing a sparse tree command and in this way get a table only
5294 for the selected items. Column view also works in agenda buffers (see
5295 [[*Agenda views]]) where queries have collected selected items, possibly
5296 from a number of files.
5298 *** Defining columns
5300 :DESCRIPTION: The COLUMNS format property.
5302 #+cindex: column view, for properties
5303 #+cindex: properties, column view
5305 Setting up a column view first requires defining the columns. This is
5306 done by defining a column format line.
5308 **** Scope of column definitions
5310 :DESCRIPTION: Where defined, where valid?
5313 To define a column format for an entire file, use a line like:
5315 #+cindex: COLUMNS, keyword
5316 : #+COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
5318 To specify a format that only applies to a specific tree, add
5319 a =COLUMNS= property to the top node of that tree, for example:
5322 ,** Top node for columns view
5324 :COLUMNS: %25ITEM %TAGS %PRIORITY %TODO
5328 If a =COLUMNS= property is present in an entry, it defines columns for
5329 the entry itself, and for the entire subtree below it. Since the
5330 column definition is part of the hierarchical structure of the
5331 document, you can define columns on level 1 that are general enough
5332 for all sublevels, and more specific columns further down, when you
5333 edit a deeper part of the tree.
5335 **** Column attributes
5337 :DESCRIPTION: Appearance and content of a column.
5340 A column definition sets the attributes of a column. The general
5341 definition looks like this:
5343 : %[WIDTH]PROPERTY[(TITLE)][{SUMMARY-TYPE}]
5345 #+texinfo: @noindent
5346 Except for the percent sign and the property name, all items are
5347 optional. The individual parts have the following meaning:
5349 - {{{var(WIDTH)}}} ::
5351 An integer specifying the width of the column in characters. If
5352 omitted, the width is determined automatically.
5354 - {{{var(PROPERTY)}}} ::
5356 The property that should be edited in this column. Special
5357 properties representing meta data are allowed here as well (see
5358 [[*Special properties]]).
5360 - {{{var(TITLE)}}} ::
5362 The header text for the column. If omitted, the property name is
5365 - {{{var(SUMMARY-TYPE)}}} ::
5367 The summary type. If specified, the column values for parent
5368 nodes are computed from the children[fn:55].
5370 Supported summary types are:
5372 | =+= | Sum numbers in this column. |
5373 | =+;%.1f= | Like =+=, but format result with =%.1f=. |
5374 | =$= | Currency, short for =+;%.2f=. |
5375 | =min= | Smallest number in column. |
5376 | =max= | Largest number. |
5377 | =mean= | Arithmetic mean of numbers. |
5378 | =X= | Checkbox status, =[X]= if all children are =[X]=. |
5379 | =X/= | Checkbox status, =[n/m]=. |
5380 | =X%= | Checkbox status, =[n%]=. |
5381 | =:= | Sum times, HH:MM, plain numbers are hours. |
5382 | =:min= | Smallest time value in column. |
5383 | =:max= | Largest time value. |
5384 | =:mean= | Arithmetic mean of time values. |
5385 | =@min= | Minimum age[fn:56] (in days/hours/mins/seconds). |
5386 | =@max= | Maximum age (in days/hours/mins/seconds). |
5387 | =@mean= | Arithmetic mean of ages (in days/hours/mins/seconds). |
5388 | =est+= | Add low-high estimates. |
5390 #+texinfo: @noindent
5391 #+vindex: org-columns-summary-types
5392 You can also define custom summary types by setting
5393 ~org-columns-summary-types~.
5395 The =est+= summary type requires further explanation. It is used for
5396 combining estimates, expressed as low-high ranges. For example,
5397 instead of estimating a particular task will take 5 days, you might
5398 estimate it as 5-6 days if you're fairly confident you know how much
5399 work is required, or 1-10 days if you do not really know what needs to
5400 be done. Both ranges average at 5.5 days, but the first represents
5401 a more predictable delivery.
5403 When combining a set of such estimates, simply adding the lows and
5404 highs produces an unrealistically wide result. Instead, =est+= adds
5405 the statistical mean and variance of the sub-tasks, generating a final
5406 estimate from the sum. For example, suppose you had ten tasks, each
5407 of which was estimated at 0.5 to 2 days of work. Straight addition
5408 produces an estimate of 5 to 20 days, representing what to expect if
5409 everything goes either extremely well or extremely poorly. In
5410 contrast, =est+= estimates the full job more realistically, at 10-15
5413 Here is an example for a complete columns definition, along with
5414 allowed values[fn:57].
5417 :COLUMNS: %25ITEM %9Approved(Approved?){X} %Owner %11Status \
5418 %10Time_Estimate{:} %CLOCKSUM %CLOCKSUM_T
5419 :Owner_ALL: Tammy Mark Karl Lisa Don
5420 :Status_ALL: "In progress" "Not started yet" "Finished" ""
5421 :Approved_ALL: "[ ]" "[X]"
5424 #+texinfo: @noindent
5425 The first column, =%25ITEM=, means the first 25 characters of the item
5426 itself, i.e., of the headline. You probably always should start the
5427 column definition with the =ITEM= specifier. The other specifiers
5428 create columns =Owner= with a list of names as allowed values, for
5429 =Status= with four different possible values, and for a checkbox field
5430 =Approved=. When no width is given after the =%= character, the
5431 column is exactly as wide as it needs to be in order to fully display
5432 all values. The =Approved= column does have a modified title
5433 (=Approved?=, with a question mark). Summaries are created for the
5434 =Time_Estimate= column by adding time duration expressions like HH:MM,
5435 and for the =Approved= column, by providing an =[X]= status if all
5436 children have been checked. The =CLOCKSUM= and =CLOCKSUM_T= columns
5437 are special, they lists the sums of CLOCK intervals in the subtree,
5438 either for all clocks or just for today.
5440 *** Using column view
5442 :DESCRIPTION: How to create and use column view.
5445 **** Turning column view on or off
5450 - {{{kbd(C-c C-x C-c)}}} (~org-columns~) ::
5452 #+kindex: C-c C-x C-c
5453 #+vindex: org-columns
5454 #+vindex: org-columns-default-format
5455 Turn on column view. If the cursor is before the first headline
5456 in the file, column view is turned on for the entire file, using
5457 the =#+COLUMNS= definition. If the cursor is somewhere inside
5458 the outline, this command searches the hierarchy, up from point,
5459 for a =COLUMNS= property that defines a format. When one is
5460 found, the column view table is established for the tree starting
5461 at the entry that contains the =COLUMNS= property. If no such
5462 property is found, the format is taken from the =#+COLUMNS= line
5463 or from the variable ~org-columns-default-format~, and column
5464 view is established for the current entry and its subtree.
5466 - {{{kbd(r)}}} or {{{kbd(g)}}} (~org-columns-redo~) ::
5470 #+findex: org-columns-redo
5471 Recreate the column view, to include recent changes made in the
5474 - {{{kbd(q)}}} (~org-columns-quit~) ::
5477 #+findex: org-columns-quit
5485 #+attr_texinfo: :sep and
5486 - {{{kbd(left)}}}, {{{kbd(right)}}}, {{{kbd(up)}}}, {{{kbd(down)}}} ::
5488 Move through the column view from field to field.
5490 - {{{kbd(1..9\,0)}}} ::
5493 Directly select the Nth allowed value, {{{kbd(0)}}} selects the
5496 - {{{kbd(n)}}} or {{{kbd(S-right)}}} (~org-columns-next-allowed-value~) and {{{kbd(p)}}} or {{{kbd(S-left)}}} (~org-columns-previous-allowed-value~) ::
5502 #+findex: org-columns-next-allowed-value
5503 #+findex: org-columns-previous-allowed-value
5504 Switch to the next/previous allowed value of the field. For
5505 this, you have to have specified allowed values for a property.
5507 - {{{kbd(e)}}} (~org-columns-edit-value~) ::
5510 #+findex: org-columns-edit-value
5511 Edit the property at point. For the special properties, this
5512 invokes the same interface that you normally use to change that
5513 property. For example, the tag completion or fast selection
5514 interface pops up when editing a =TAGS= property.
5516 - {{{kbd(C-c C-c)}}} (~org-columns-set-tags-or-toggle~) ::
5519 #+findex: org-columns-set-tags-or-toggle
5520 When there is a checkbox at point, toggle it.
5522 - {{{kbd(v)}}} (~org-columns-show-value~) ::
5525 #+findex: org-columns-show-value
5526 View the full value of this property. This is useful if the
5527 width of the column is smaller than that of the value.
5529 - {{{kbd(a)}}} (~org-columns-edit-allowed~) ::
5532 #+findex: org-columns-edit-allowed
5533 Edit the list of allowed values for this property. If the list
5534 is found in the hierarchy, the modified values is stored there.
5535 If no list is found, the new value is stored in the first entry
5536 that is part of the current column view.
5538 **** Modifying column view on-the-fly:
5543 #+attr_texinfo: :sep and
5544 - {{{kbd(<)}}} (~org-columns-narrow~) and {{{kbd(>)}}} (~org-columns-widen~) ::
5548 #+findex: org-columns-narrow
5549 #+findex: org-columns-widen
5550 Make the column narrower/wider by one character.
5552 - {{{kbd(S-M-right)}}} (~org-columns-new~) ::
5555 #+findex: org-columns-new
5556 Insert a new column, to the left of the current column.
5558 - {{{kbd(S-M-left)}}} (~org-columns-delete~) ::
5561 #+findex: org-columns-delete
5562 Delete the current column.
5564 *** Capturing column view
5566 :DESCRIPTION: A dynamic block for column view.
5569 Since column view is just an overlay over a buffer, it cannot be
5570 exported or printed directly. If you want to capture a column view,
5571 use a =columnview= dynamic block (see [[*Dynamic blocks]]). The frame of
5572 this block looks like this:
5574 #+cindex: BEGIN columnview
5577 ,#+BEGIN: columnview :hlines 1 :id "label"
5582 #+texinfo: @noindent
5583 This dynamic block has the following parameters:
5587 This is the most important parameter. Column view is a feature
5588 that is often localized to a certain (sub)tree, and the capture
5589 block might be at a different location in the file. To identify
5590 the tree whose view to capture, you can use four values:
5594 Use the tree in which the capture block is located.
5598 Make a global view, including all headings in the file.
5600 - =file:FILENAME= ::
5602 Run column view at the top of the {{{var(FILENAME)}}} file
5606 #+cindex: ID, property
5607 Call column view in the tree that has an =ID= property with
5608 the value {{{var(LABEL)}}}. You can use {{{kbd(M-x
5609 org-id-copy)}}} to create a globally unique ID for the
5610 current entry and copy it to the kill-ring.
5614 When ~t~, insert an hline after every line. When a number N,
5615 insert an hline before each headline with level ~<= N~.
5619 When non-~nil~, force column groups to get vertical lines.
5623 When set to a number, do not capture entries below this level.
5625 - =:skip-empty-rows= ::
5627 When non-~nil~, skip rows where the only non-empty specifier of
5628 the column view is =ITEM=.
5632 When non-~nil~, indent each =ITEM= field according to its level.
5634 #+texinfo: @noindent
5635 The following commands insert or update the dynamic block:
5637 - {{{kbd(C-c C-x i)}}} (~org-insert-columns-dblock~) ::
5640 #+findex: org-insert-columns-dblock
5641 Insert a dynamic block capturing a column view. Prompt for the
5642 scope or ID of the view.
5644 - {{{kbd(C-c C-c)}}} {{{kbd(C-c C-x C-u)}}} (~org-dblock-update~) ::
5647 #+kindex: C-c C-x C-u
5648 #+findex: org-dblock-update
5649 Update dynamic block at point. The cursor needs to be in the
5650 =#+BEGIN= line of the dynamic block.
5652 - {{{kbd(C-u C-c C-x C-u)}}} (~org-update-all-dblocks~) ::
5654 #+kindex: C-u C-c C-x C-u
5655 Update all dynamic blocks (see [[*Dynamic blocks]]). This is useful
5656 if you have several clock table blocks, column-capturing blocks
5657 or other dynamic blocks in a buffer.
5659 You can add formulas to the column view table and you may add plotting
5660 instructions in front of the table -- these survive an update of the
5661 block. If there is a =TBLFM= keyword after the table, the table is
5662 recalculated automatically after an update.
5664 An alternative way to capture and process property values into a table
5665 is provided by Eric Schulte's =org-collector.el= which is
5666 a contributed package[fn:58]. It provides a general API to collect
5667 properties from entries in a certain scope, and arbitrary Lisp
5668 expressions to process these values before inserting them into a table
5673 :DESCRIPTION: Making items useful for planning.
5674 :ALT_TITLE: Dates and Times
5679 #+cindex: date stamp
5681 To assist project planning, TODO items can be labeled with a date
5682 and/or a time. The specially formatted string carrying the date and
5683 time information is called a /timestamp/ in Org mode. This may be
5684 a little confusing because timestamp is often used as indicating when
5685 something was created or last changed. However, in Org mode this term
5686 is used in a much wider sense.
5688 ** Timestamps, deadlines, and scheduling
5690 :DESCRIPTION: Assigning a time to a tree entry.
5691 :ALT_TITLE: Timestamps
5693 #+cindex: timestamps
5694 #+cindex: ranges, time
5695 #+cindex: date stamps
5697 #+cindex: scheduling
5699 A timestamp is a specification of a date (possibly with a time or
5700 a range of times) in a special format, either =<2003-09-16 Tue>= or
5701 =<2003-09-16 Tue 09:39>= or =<2003-09-16 Tue 12:00-12:30>=[fn:59].
5702 A timestamp can appear anywhere in the headline or body of an Org tree
5703 entry. Its presence causes entries to be shown on specific dates in
5704 the agenda (see [[*Weekly/daily agenda]]). We distinguish:
5706 - Plain timestamp; Event; Appointment ::
5709 #+cindex: appointment
5710 A simple timestamp just assigns a date/time to an item. This is
5711 just like writing down an appointment or event in a paper agenda.
5712 In the timeline and agenda displays, the headline of an entry
5713 associated with a plain timestamp is shown exactly on that date.
5716 ,* Meet Peter at the movies
5717 <2006-11-01 Wed 19:15>
5718 ,* Discussion on climate change
5719 <2006-11-02 Thu 20:00-22:00>
5722 - Timestamp with repeater interval ::
5724 #+cindex: timestamp, with repeater interval
5725 A timestamp may contain a /repeater interval/, indicating that it
5726 applies not only on the given date, but again and again after
5727 a certain interval of N days (d), weeks (w), months (m), or years
5728 (y). The following shows up in the agenda every Wednesday:
5731 ,* Pick up Sam at school
5732 <2007-05-16 Wed 12:30 +1w>
5735 - Diary-style sexp entries ::
5737 #+cindex: diary style timestamps
5738 #+cindex: sexp timestamps
5739 For more complex date specifications, Org mode supports using the
5740 special sexp diary entries implemented in the Emacs
5741 calendar/diary package[fn:60]. For example, with optional time:
5744 ,* 22:00-23:00 The nerd meeting on every 2nd Thursday of the month
5745 <%%(org-float t 4 2)>
5748 - Time/Date range ::
5751 #+cindex: date range
5752 Two timestamps connected by =--= denote a range. The headline is
5753 shown on the first and last day of the range, and on any dates
5754 that are displayed and fall in the range. Here is an example:
5757 ,** Meeting in Amsterdam
5758 <2004-08-23 Mon>--<2004-08-26 Thu>
5761 - Inactive timestamp ::
5763 #+cindex: timestamp, inactive
5764 #+cindex: inactive timestamp
5765 Just like a plain timestamp, but with square brackets instead of
5766 angular ones. These timestamps are inactive in the sense that
5767 they do /not/ trigger an entry to show up in the agenda.
5770 ,* Gillian comes late for the fifth time
5774 ** Creating timestamps
5776 :DESCRIPTION: Commands to insert timestamps.
5779 For Org mode to recognize timestamps, they need to be in the specific
5780 format. All commands listed below produce timestamps in the correct
5783 #+attr_texinfo: :sep ,
5784 - {{{kbd(C-c .)}}} (~org-time-stamp~) ::
5787 #+findex: org-time-stamp
5788 Prompt for a date and insert a corresponding timestamp. When the
5789 cursor is at an existing timestamp in the buffer, the command is
5790 used to modify this timestamp instead of inserting a new one.
5791 When this command is used twice in succession, a time range is
5794 - {{{kbd(C-c !)}}} (~org-time-stamp-inactive~) ::
5797 #+findex: org-time-stamp-inactive
5798 Like {{{kbd(C-c .)}}}, but insert an inactive timestamp that does
5799 not cause an agenda entry.
5801 - {{{kbd(C-u C-c .)}}}, {{{kbd(C-u C-c !)}}} ::
5806 #+vindex: org-time-stamp-rounding-minutes
5807 Like {{{kbd(C-c .)}}} and {{{kbd(C-c !)}}}, but use the
5808 alternative format which contains date and time. The default
5809 time can be rounded to multiples of 5 minutes, see the option
5810 ~org-time-stamp-rounding-minutes~.
5812 - {{{kbd(C-c C-c)}}} ::
5815 Normalize timestamp, insert/fix day name if missing or wrong.
5817 - {{{kbd(C-c <)}}} (~org-date-from-calendar~) ::
5820 #+findex: org-date-from-calendar
5821 Insert a timestamp corresponding to the cursor date in the Calendar.
5823 - {{{kbd(C-c >)}}} (~org-goto-calendar~) ::
5826 #+findex: org-goto-calendar
5827 Access the Emacs calendar for the current date. If there is a
5828 timestamp in the current line, go to the corresponding date instead.
5830 - {{{kbd(C-c C-o)}}} (~org-open-at-point~) ::
5833 #+findex: org-open-at-point
5834 Access the agenda for the date given by the timestamp or -range
5835 at point (see [[*Weekly/daily agenda]]).
5837 - {{{kbd(S-left)}}} (~org-timestamp-down-day~), {{{kbd(S-right)}}} (~org-timestamp-up-day~) ::
5841 #+findex: org-timestamp-down-day
5842 #+findex: org-timestamp-up-day
5843 Change date at cursor by one day. These key bindings conflict
5844 with shift-selection and related modes (see [[*Packages that
5845 conflict with Org mode]]).
5847 - {{{kbd(S-up)}}} (~org-timestamp-up~), {{{kbd(S-down)}}} (~org-timestamp-down~) ::
5850 Change the item under the cursor in a timestamp. The cursor can
5851 be on a year, month, day, hour or minute. When the timestamp
5852 contains a time range like =15:30-16:30=, modifying the first
5853 time also shifts the second, shifting the time block with
5854 constant length. To change the length, modify the second time.
5855 Note that if the cursor is in a headline and not at a timestamp,
5856 these same keys modify the priority of an item. (see
5857 [[*Priorities]]). The key bindings also conflict with
5858 shift-selection and related modes (see [[*Packages that conflict
5861 - {{{kbd(C-c C-y)}}} (~org-evaluate-time-range~) ::
5864 #+findex: org-evaluate-time-range
5865 #+cindex: evaluate time range
5866 Evaluate a time range by computing the difference between start
5867 and end. With a prefix argument, insert result after the time
5868 range (in a table: into the following column).
5870 *** The date/time prompt
5872 :DESCRIPTION: How Org mode helps you enter dates and times.
5874 #+cindex: date, reading in minibuffer
5875 #+cindex: time, reading in minibuffer
5877 #+vindex: org-read-date-prefer-future
5878 When Org mode prompts for a date/time, the default is shown in default
5879 date/time format, and the prompt therefore seems to ask for a specific
5880 format. But it in fact accepts date/time information in a variety of
5881 formats. Generally, the information should start at the beginning of
5882 the string. Org mode finds whatever information is in there and
5883 derives anything you have not specified from the /default date and
5884 time/. The default is usually the current date and time, but when
5885 modifying an existing timestamp, or when entering the second stamp of
5886 a range, it is taken from the stamp in the buffer. When filling in
5887 information, Org mode assumes that most of the time you want to enter
5888 a date in the future: if you omit the month/year and the given
5889 day/month is /before/ today, it assumes that you mean a future
5890 date[fn:61]. If the date has been automatically shifted into the
5891 future, the time prompt shows this with =(=>F)=.
5893 For example, let's assume that today is *June 13, 2006*. Here is how
5894 various inputs are interpreted, the items filled in by Org mode are in
5897 | =3-2-5= | \rArr{} 2003-02-05 |
5898 | =2/5/3= | \rArr{} 2003-02-05 |
5899 | =14= | \rArr{} *2006*-*06*-14 |
5900 | =12= | \rArr{} *2006*-*07*-12 |
5901 | =2/5= | \rArr{} *2007*-02-05 |
5902 | =Fri= | \rArr{} nearest Friday (default date or later) |
5903 | =sep 15= | \rArr{} *2006*-09-15 |
5904 | =feb 15= | \rArr{} *2007*-02-15 |
5905 | =sep 12 9= | \rArr{} 2009-09-12 |
5906 | =12:45= | \rArr{} *2006*-*06*-*13* 12:45 |
5907 | =22 sept 0:34= | \rArr{} *2006*-09-22 0:34 |
5908 | =w4= | \rArr{} ISO week for of the current year *2006* |
5909 | =2012 w4 fri= | \rArr{} Friday of ISO week 4 in 2012 |
5910 | =2012-w04-5= | \rArr{} Same as above |
5912 Furthermore you can specify a relative date by giving, as the /first/
5913 thing in the input: a plus/minus sign, a number and a letter -- =d=,
5914 =w=, =m= or =y= -- to indicate change in days, weeks, months, or
5915 years. With a single plus or minus, the date is always relative to
5916 today. With a double plus or minus, it is relative to the default
5917 date. If instead of a single letter, you use the abbreviation of day
5918 name, the date is the Nth such day, e.g.:
5920 | =+0= | \rArr{} today |
5921 | =.= | \rArr{} today |
5922 | =+4d= | \rArr{} four days from today |
5923 | =+4= | \rArr{} same as +4d |
5924 | =+2w= | \rArr{} two weeks from today |
5925 | =++5= | \rArr{} five days from default date |
5926 | =+2tue= | \rArr{} second Tuesday from now |
5928 #+vindex: parse-time-months
5929 #+vindex: parse-time-weekdays
5930 The function understands English month and weekday abbreviations. If
5931 you want to use un-abbreviated names and/or other languages, configure
5932 the variables ~parse-time-months~ and ~parse-time-weekdays~.
5934 #+vindex: org-read-date-force-compatible-dates
5935 Not all dates can be represented in a given Emacs implementation. By
5936 default Org mode forces dates into the compatibility range 1970--2037
5937 which works on all Emacs implementations. If you want to use dates
5938 outside of this range, read the docstring of the variable
5939 ~org-read-date-force-compatible-dates~.
5941 You can specify a time range by giving start and end times or by
5942 giving a start time and a duration (in HH:MM format). Use one or two
5943 dash(es) as the separator in the former case and use =+= as the
5944 separator in the latter case, e.g.:
5946 | =11am-1:15pm= | \rArr{} 11:00-13:15 |
5947 | =11am--1:15pm= | \rArr{} same as above |
5948 | =11am+2:15= | \rArr{} same as above |
5950 #+cindex: calendar, for selecting date
5951 #+vindex: org-popup-calendar-for-date-prompt
5952 Parallel to the minibuffer prompt, a calendar is popped up[fn:62].
5953 When you exit the date prompt, either by clicking on a date in the
5954 calendar, or by pressing {{{kbd(RET)}}}, the date selected in the
5955 calendar is combined with the information entered at the prompt. You
5956 can control the calendar fully from the minibuffer:
5970 #+attr_texinfo: :columns 0.25 0.55
5971 | {{{kbd(RET)}}} | Choose date at cursor in calendar. |
5972 | {{{kbd(mouse-1)}}} | Select date by clicking on it. |
5973 | {{{kbd(S-right)}}} | One day forward. |
5974 | {{{kbd(S-left)}}} | One day backward. |
5975 | {{{kbd(S-down)}}} | One week forward. |
5976 | {{{kbd(S-up)}}} | One week backward. |
5977 | {{{kbd(M-S-right)}}} | One month forward. |
5978 | {{{kbd(M-S-left)}}} | One month backward. |
5979 | {{{kbd(>)}}} | Scroll calendar forward by one month. |
5980 | {{{kbd(<)}}} | Scroll calendar backward by one month. |
5981 | {{{kbd(M-v)}}} | Scroll calendar forward by 3 months. |
5982 | {{{kbd(C-v)}}} | Scroll calendar backward by 3 months. |
5984 #+vindex: org-read-date-display-live
5985 The actions of the date/time prompt may seem complex, but I assure you
5986 they will grow on you, and you will start getting annoyed by pretty
5987 much any other way of entering a date/time out there. To help you
5988 understand what is going on, the current interpretation of your input
5989 is displayed live in the minibuffer[fn:63].
5991 *** Custom time format
5993 :DESCRIPTION: Making dates look different.
5995 #+cindex: custom date/time format
5996 #+cindex: time format, custom
5997 #+cindex: date format, custom
5999 #+vindex: org-display-custom-times
6000 #+vindex: org-time-stamp-custom-formats
6001 Org mode uses the standard ISO notation for dates and times as it is
6002 defined in ISO 8601. If you cannot get used to this and require
6003 another representation of date and time to keep you happy, you can get
6004 it by customizing the variables ~org-display-custom-times~ and
6005 ~org-time-stamp-custom-formats~.
6007 - {{{kbd(C-c C-x C-t)}}} (~org-toggle-time-stamp-overlays~) ::
6009 #+kindex: C-c C-x C-t
6010 #+findex: org-toggle-time-stamp-overlays
6011 Toggle the display of custom formats for dates and times.
6013 #+texinfo: @noindent
6014 Org mode needs the default format for scanning, so the custom
6015 date/time format does not /replace/ the default format. Instead, it
6016 is put /over/ the default format using text properties. This has the
6017 following consequences:
6019 - You cannot place the cursor onto a timestamp anymore, only before or
6022 - The {{{kbd(S-up)}}} and {{{kbd(S-down)}}} keys can no longer be used
6023 to adjust each component of a timestamp. If the cursor is at the
6024 beginning of the stamp, {{{kbd(S-up)}}} and {{{kbd(S-down)}}} change
6025 the stamp by one day, just like {{{kbd(S-left)}}}
6026 {{{kbd(S-right)}}}. At the end of the stamp, change the time by one
6029 - If the timestamp contains a range of clock times or a repeater,
6030 these are not overlaid, but remain in the buffer as they were.
6032 - When you delete a timestamp character-by-character, it only
6033 disappears from the buffer after /all/ (invisible) characters
6034 belonging to the ISO timestamp have been removed.
6036 - If the custom timestamp format is longer than the default and you
6037 are using dates in tables, table alignment will be messed up. If
6038 the custom format is shorter, things do work as expected.
6040 ** Deadlines and scheduling
6042 :DESCRIPTION: Planning your work.
6045 A timestamp may be preceded by special keywords to facilitate
6046 planning. Both the timestamp and the keyword have to be positioned
6047 immediately after the task they refer to.
6052 Meaning: the task (most likely a TODO item, though not
6053 necessarily) is supposed to be finished on that date.
6055 #+vindex: org-deadline-warning-days
6056 On the deadline date, the task is listed in the agenda. In
6057 addition, the agenda for /today/ carries a warning about the
6058 approaching or missed deadline, starting
6059 ~org-deadline-warning-days~ before the due date, and continuing
6060 until the entry is marked DONE. An example:
6063 ,*** TODO write article about the Earth for the Guide
6064 DEADLINE: <2004-02-29 Sun>
6065 The editor in charge is [[bbdb:Ford Prefect]]
6068 #+vindex: org-agenda-skip-deadline-prewarning-if-scheduled
6069 You can specify a different lead time for warnings for a specific
6070 deadlines using the following syntax. Here is an example with
6071 a warning period of 5 days =DEADLINE: <2004-02-29 Sun -5d>=.
6072 This warning is deactivated if the task gets scheduled and you
6073 set ~org-agenda-skip-deadline-prewarning-if-scheduled~ to ~t~.
6078 Meaning: you are planning to start working on that task on the
6081 #+vindex: org-agenda-skip-scheduled-if-done
6082 The headline is listed under the given date[fn:64]. In addition,
6083 a reminder that the scheduled date has passed is present in the
6084 compilation for /today/, until the entry is marked DONE, i.e.,
6085 the task is automatically forwarded until completed.
6088 ,*** TODO Call Trillian for a date on New Years Eve.
6089 SCHEDULED: <2004-12-25 Sat>
6092 #+vindex: org-scheduled-delay-days
6093 #+vindex: org-agenda-skip-scheduled-delay-if-deadline
6094 If you want to /delay/ the display of this task in the agenda,
6095 use =SCHEDULED: <2004-12-25 Sat -2d>=: the task is still
6096 scheduled on the 25th but will appear two days later. In case
6097 the task contains a repeater, the delay is considered to affect
6098 all occurrences; if you want the delay to only affect the first
6099 scheduled occurrence of the task, use =--2d= instead. See
6100 ~org-scheduled-delay-days~ and
6101 ~org-agenda-skip-scheduled-delay-if-deadline~ for details on how
6102 to control this globally or per agenda.
6104 #+texinfo: @noindent
6105 *Important:* Scheduling an item in Org mode should /not/ be
6106 understood in the same way that we understand /scheduling
6107 a meeting/. Setting a date for a meeting is just a simple
6108 appointment, you should mark this entry with a simple plain
6109 timestamp, to get this item shown on the date where it applies.
6110 This is a frequent misunderstanding by Org users. In Org mode,
6111 /scheduling/ means setting a date when you want to start working
6114 You may use timestamps with repeaters in scheduling and deadline
6115 entries. Org mode issues early and late warnings based on the
6116 assumption that the timestamp represents the /nearest instance/ of the
6117 repeater. However, the use of diary S-exp entries like
6119 : <%%(org-float t 42)>
6121 #+texinfo: @noindent
6122 in scheduling and deadline timestamps is limited. Org mode does not
6123 know enough about the internals of each S-exp function to issue early
6124 and late warnings. However, it shows the item on each day where the
6125 S-exp entry matches.
6127 *** Inserting deadlines or schedules
6129 :DESCRIPTION: Planning items.
6130 :ALT_TITLE: Inserting deadline/schedule
6133 The following commands allow you to quickly insert a deadline or to
6134 schedule an item:[fn:65]
6136 - {{{kbd(C-c C-d)}}} (~org-deadline~) ::
6139 #+findex: org-deadline
6140 #+vindex: org-log-redeadline
6141 Insert =DEADLINE= keyword along with a stamp. The insertion
6142 happens in the line directly following the headline. Remove any
6143 =CLOSED= timestamp . When called with a prefix argument, also
6144 remove any existing deadline from the entry. Depending on the
6145 variable ~org-log-redeadline~, take a note when changing an
6146 existing deadline[fn:66].
6148 - {{{kbd(C-c C-s)}}} (~org-schedule~) ::
6151 #+findex: org-schedule
6152 #+vindex: org-log-reschedule
6153 Insert =SCHEDULED= keyword along with a stamp. The insertion
6154 happens in the line directly following the headline. Remove any
6155 =CLOSED= timestamp. When called with a prefix argument, also
6156 remove the scheduling date from the entry. Depending on the
6157 variable ~org-log-reschedule~, take a note when changing an
6158 existing scheduling time[fn:67].
6160 - {{{kbd(C-c C-x C-k)}}} (~org-mark-entry-for-agenda-action~) ::
6162 #+kindex: C-c C-x C-k
6165 #+findex: org-mark-entry-for-agenda-action
6166 Mark the current entry for agenda action. After you have marked
6167 the entry like this, you can open the agenda or the calendar to
6168 find an appropriate date. With the cursor on the selected date,
6169 press {{{kbd(k s)}}} or {{{kbd(k d)}}} to schedule the marked
6172 - {{{kbd(C-c / d)}}} (~org-check-deadlines~) ::
6175 #+findex: org-check-deadlines
6176 #+cindex: sparse tree, for deadlines
6177 #+vindex: org-deadline-warning-days
6178 Create a sparse tree with all deadlines that are either past-due,
6179 or which will become due within ~org-deadline-warning-days~.
6180 With {{{kbd(C-u)}}} prefix, show all deadlines in the file. With
6181 a numeric prefix, check that many days. For example, {{{kbd(C-1
6182 C-c / d)}}} shows all deadlines due tomorrow.
6184 - {{{kbd(C-c / b)}}}, ~org-check-before-date~ ::
6187 #+findex: org-check-before-date
6188 Sparse tree for deadlines and scheduled items before a given
6191 - {{{kbd(C-c / a)}}}, ~org-check-after-date~ ::
6194 #+findex: org-check-after-date
6195 Sparse tree for deadlines and scheduled items after a given date.
6197 Note that ~org-schedule~ and ~org-deadline~ supports setting the date
6198 by indicating a relative time e.g., =+1d= sets the date to the next
6199 day after today, and =--1w= sets the date to the previous week before
6200 any current timestamp.
6204 :DESCRIPTION: Items that show up again and again.
6206 #+cindex: tasks, repeated
6207 #+cindex: repeated tasks
6209 Some tasks need to be repeated again and again. Org mode helps to
6210 organize such tasks using a so-called repeater in a =DEADLINE=,
6211 =SCHEDULED=, or plain timestamp. In the following example:
6214 ,** TODO Pay the rent
6215 DEADLINE: <2005-10-01 Sat +1m>
6219 the =+1m= is a repeater; the intended interpretation is that the task
6220 has a deadline on =<2005-10-01>= and repeats itself every (one) month
6221 starting from that time. You can use yearly, monthly, weekly, daily
6222 and hourly repeat cookies by using the ~y/w/m/d/h~ letters. If you
6223 need both a repeater and a special warning period in a deadline entry,
6224 the repeater should come first and the warning period last: =DEADLINE:
6225 <2005-10-01 Sat +1m -3d>=.
6227 #+vindex: org-todo-repeat-to-state
6228 Deadlines and scheduled items produce entries in the agenda when they
6229 are over-due, so it is important to be able to mark such an entry as
6230 completed once you have done so. When you mark a =DEADLINE= or
6231 a =SCHEDULED= with the TODO keyword =DONE=, it no longer produces
6232 entries in the agenda. The problem with this is, however, that then
6233 also the /next/ instance of the repeated entry will not be active.
6234 Org mode deals with this in the following way: when you try to mark
6235 such an entry DONE -- using {{{kbd(C-c C-t)}}}, it shifts the base
6236 date of the repeating timestamp by the repeater interval, and
6237 immediately sets the entry state back to TODO[fn:68]. In the example
6238 above, setting the state to DONE would actually switch the date like
6242 ,** TODO Pay the rent
6243 DEADLINE: <2005-11-01 Tue +1m>
6246 To mark a task with a repeater as DONE, use {{{kbd(C-- 1 C-c C-t)}}},
6247 i.e., ~org-todo~ with a numeric prefix argument of =-1=.
6249 #+vindex: org-log-repeat
6250 A timestamp[fn:69] is added under the deadline, to keep a record that
6251 you actually acted on the previous instance of this deadline.
6253 As a consequence of shifting the base date, this entry is no longer
6254 visible in the agenda when checking past dates, but all future
6255 instances will be visible.
6257 With the =+1m= cookie, the date shift is always exactly one month. So
6258 if you have not paid the rent for three months, marking this entry
6259 DONE still keeps it as an overdue deadline. Depending on the task,
6260 this may not be the best way to handle it. For example, if you forgot
6261 to call your father for 3 weeks, it does not make sense to call him
6262 3 times in a single day to make up for it. Finally, there are tasks
6263 like changing batteries which should always repeat a certain time
6264 /after/ the last time you did it. For these tasks, Org mode has
6265 special repeaters =++= and =.+=. For example:
6268 ,** TODO Call Father
6269 DEADLINE: <2008-02-10 Sun ++1w>
6270 Marking this DONE shifts the date by at least one week, but also
6271 by as many weeks as it takes to get this date into the future.
6272 However, it stays on a Sunday, even if you called and marked it
6275 ,** TODO Empty kitchen trash
6276 DEADLINE: <2008-02-08 Fri 20:00 ++1d>
6277 Marking this DONE shifts the date by at least one day, and also
6278 by as many days as it takes to get the timestamp into the future.
6279 Since there is a time in the timestamp, the next deadline in the
6280 future will be on today's date if you complete the task before
6283 ,** TODO Check the batteries in the smoke detectors
6284 DEADLINE: <2005-11-01 Tue .+1m>
6285 Marking this DONE will shift the date to one month after today.
6288 #+vindex: org-agenda-skip-scheduled-if-deadline-is-shown
6289 You may have both scheduling and deadline information for a specific
6290 task. If the repeater is set for the scheduling information only, you
6291 probably want the repeater to be ignored after the deadline. If so,
6292 set the variable ~org-agenda-skip-scheduled-if-deadline-is-shown~ to
6293 ~repeated-after-deadline~. However, any scheduling information
6294 without a repeater is no longer relevant once the task is done, and
6295 thus, removed upon repeating the task. If you want both scheduling
6296 and deadline information to repeat after the same interval, set the
6297 same repeater for both timestamps.
6299 An alternative to using a repeater is to create a number of copies of
6300 a task subtree, with dates shifted in each copy. The command
6301 {{{kbd(C-c C-x c)}}} was created for this purpose; it is described in
6302 [[*Structure editing]].
6304 ** Clocking work time
6306 :DESCRIPTION: Tracking how long you spend on a task.
6308 #+cindex: clocking time
6309 #+cindex: time clocking
6311 Org mode allows you to clock the time you spend on specific tasks in
6312 a project. When you start working on an item, you can start the
6313 clock. When you stop working on that task, or when you mark the task
6314 done, the clock is stopped and the corresponding time interval is
6315 recorded. It also computes the total time spent on each
6316 subtree[fn:70] of a project. And it remembers a history or tasks
6317 recently clocked, to that you can jump quickly between a number of
6318 tasks absorbing your time.
6320 To save the clock history across Emacs sessions, use:
6322 #+begin_src emacs-lisp
6323 (setq org-clock-persist 'history)
6324 (org-clock-persistence-insinuate)
6327 #+vindex: org-clock-persist
6328 When you clock into a new task after resuming Emacs, the incomplete
6329 clock[fn:71] is retrieved (see [[*Resolving idle time]]) and you are
6330 prompted about what to do with it.
6332 *** Clocking commands
6334 :DESCRIPTION: Starting and stopping a clock.
6337 #+attr_texinfo: :sep ,
6338 - {{{kbd(C-c C-x C-i)}}} (~org-clock-in~) ::
6340 #+kindex: C-c C-x C-i
6341 #+findex: org-clock-in
6342 #+vindex: org-clock-into-drawer
6343 #+vindex: org-clock-continuously
6344 #+cindex: LOG_INTO_DRAWER, property
6345 Start the clock on the current item (clock-in). This inserts the
6346 CLOCK keyword together with a timestamp. If this is not the
6347 first clocking of this item, the multiple CLOCK lines are wrapped
6348 into a =LOGBOOK= drawer (see also the variable
6349 ~org-clock-into-drawer~). You can also overrule the setting of
6350 this variable for a subtree by setting a =CLOCK_INTO_DRAWER= or
6351 =LOG_INTO_DRAWER= property. When called with a {{{kbd(C-u)}}}
6352 prefix argument, select the task from a list of recently clocked
6353 tasks. With two {{{kbd(C-u C-u)}}} prefixes, clock into the task
6354 at point and mark it as the default task; the default task is
6355 always be available with letter {{{kbd(d)}}} when selecting
6356 a clocking task. With three {{{kbd(C-u C-u C-u)}}} prefixes,
6357 force continuous clocking by starting the clock when the last
6360 #+cindex: CLOCK_MODELINE_TOTAL, property
6361 #+cindex: LAST_REPEAT, property
6362 #+vindex: org-clock-modeline-total
6363 #+vindex: org-clock-in-prepare-hook
6364 While the clock is running, Org shows the current clocking time
6365 in the mode line, along with the title of the task. The clock
6366 time shown is all time ever clocked for this task and its
6367 children. If the task has an effort estimate (see [[*Effort
6368 estimates]]), the mode line displays the current clocking time
6369 against it[fn:72]. If the task is a repeating one (see [[*Repeated
6370 tasks]]), show only the time since the last reset of the
6371 task[fn:73]. You can exercise more control over show time with
6372 the =CLOCK_MODELINE_TOTAL= property. It may have the values
6373 =current= to show only the current clocking instance, =today= to
6374 show all time clocked on this tasks today -- see also the
6375 variable ~org-extend-today-until~, ~all~ to include all time, or
6376 ~auto~ which is the default[fn:74]. Clicking with
6377 {{{kbd(mouse-1)}}} onto the mode line entry pops up a menu with
6380 - {{{kbd(C-c C-x C-o)}}} (~org-clock-out~) ::
6382 #+kindex: C-c C-x C-o
6383 #+findex: org-clock-out
6384 #+vindex: org-log-note-clock-out
6385 Stop the clock (clock-out). This inserts another timestamp at
6386 the same location where the clock was last started. It also
6387 directly computes the resulting time in inserts it after the time
6388 range as ==>HH:MM=. See the variable ~org-log-note-clock-out~
6389 for the possibility to record an additional note together with
6390 the clock-out timestamp[fn:75].
6392 - {{{kbd(C-c C-x C-x)}}} (~org-clock-in-last~) ::
6394 #+kindex: C-c C-x C-x
6395 #+findex: org-clock-in-last
6396 #+vindex: org-clock-continuously
6397 Re-clock the last clocked task. With one {{{kbd(C-u)}}} prefix
6398 argument, select the task from the clock history. With two
6399 {{{kbd(C-u)}}} prefixes, force continuous clocking by starting
6400 the clock when the last clock stopped.
6402 - {{{kbd(C-c C-x C-e)}}} (~org-clock-modify-effort-estimate~) ::
6404 #+kindex: C-c C-x C-e
6405 #+findex: org-clock-modify-effort-estimate
6406 Update the effort estimate for the current clock task.
6408 - {{{kbd(C-c C-c)}}} or {{{kbd(C-c C-y)}}} (~org-evaluate-time-range~) ::
6412 #+findex: org-evaluate-time-range
6413 Recompute the time interval after changing one of the timestamps.
6414 This is only necessary if you edit the timestamps directly. If
6415 you change them with {{{kbd(S-<cursor>)}}} keys, the update is
6418 - {{{kbd(C-S-up)}}} (~org-clock-timestamps-up~), {{{kbd(C-S-down)}}} (~org-clock-timestamps-down~) ::
6421 #+findex: org-clock-timestamps-up
6423 #+findex: org-clock-timestamps-down
6424 On CLOCK log lines, increase/decrease both timestamps so that the
6425 clock duration keeps the same value.
6427 - {{{kbd(S-M-up)}}} (~org-timestamp-up~), {{{kbd(S-M-down)}}} (~org-timestamp-down~) ::
6430 #+findex: org-clock-timestamp-up
6432 #+findex: org-clock-timestamp-down
6433 On =CLOCK= log lines, increase/decrease the timestamp at point
6434 and the one of the previous, or the next, clock timestamp by the
6435 same duration. For example, if you hit {{{kbd(S-M-up)}}} to
6436 increase a clocked-out timestamp by five minutes, then the
6437 clocked-in timestamp of the next clock is increased by five
6440 - {{{kbd(C-c C-t)}}} (~org-todo~) ::
6444 Changing the TODO state of an item to DONE automatically stops
6445 the clock if it is running in this same item.
6447 - {{{kbd(C-c C-x C-q)}}} (~org-clock-cancel~) ::
6449 #+kindex: C-c C-x C-q
6450 #+findex: org-clock-cancel
6451 Cancel the current clock. This is useful if a clock was started
6452 by mistake, or if you ended up working on something else.
6454 - {{{kbd(C-c C-x C-j)}}} (~org-clock-goto~) ::
6456 #+kindex: C-c C-x C-j
6457 #+findex: or-clock-goto
6458 Jump to the headline of the currently clocked in task. With
6459 a {{{kbd(C-u)}}} prefix argument, select the target task from
6460 a list of recently clocked tasks.
6462 - {{{kbd(C-c C-x C-d)}}} (~org-clock-display~) ::
6464 #+kindex: C-c C-x C-d
6465 #+findex: org-clock-display
6466 #+vindex: org-remove-highlights-with-change
6467 Display time summaries for each subtree in the current buffer.
6468 This puts overlays at the end of each headline, showing the total
6469 time recorded under that heading, including the time of any
6470 subheadings. You can use visibility cycling to study the tree,
6471 but the overlays disappear when you change the buffer (see
6472 variable ~org-remove-highlights-with-change~) or press {{{kbd(C-c
6475 The {{{kbd(l)}}} key may be used in the agenda (see [[*Weekly/daily
6476 agenda]]) to show which tasks have been worked on or closed during
6479 *Important:* note that both ~org-clock-out~ and ~org-clock-in-last~
6480 can have a global keybinding and do not modify the window disposition.
6484 :DESCRIPTION: Detailed reports.
6486 #+cindex: clocktable, dynamic block
6487 #+cindex: report, of clocked time
6489 Org mode can produce quite complex reports based on the time clocking
6490 information. Such a report is called a /clock table/, because it is
6491 formatted as one or several Org tables.
6493 #+attr_texinfo: :sep ,
6494 - {{{kbd(C-c C-x C-r)}}} (~org-clock-report~) ::
6496 #+kindex: C-c C-x C-r
6497 #+findex: org-clock-report
6498 Insert a dynamic block (see [[*Dynamic blocks]]) containing a clock
6499 report as an Org mode table into the current file. When the
6500 cursor is at an existing clock table, just update it. When
6501 called with a prefix argument, jump to the first clock report in
6502 the current document and update it. The clock table always
6503 includes also trees with =ARCHIVE= tag.
6505 - {{{kbd(C-c C-c)}}} or {{{kbd(C-c C-x C-u)}}} (~org-dblock-update~) ::
6508 #+kindex: C-c C-x C-u
6509 #+findex: org-dblock-update
6510 Update dynamic block at point. The cursor needs to be in the
6511 ~#+BEGIN~ line of the dynamic block.
6513 - {{{kbd(C-u C-c C-x C-u)}}} ::
6515 #+kindex: C-u C-c C-x C-u
6516 Update all dynamic blocks (see [[*Dynamic blocks]]). This is useful
6517 if you have several clock table blocks in a buffer.
6519 - {{{kbd(S-left)}}}, {{{kbd(S-right)}}} (~org-clocktable-try-shift~) ::
6523 #+findex: org-clocktable-try-shift
6524 Shift the current =:block= interval and update the table. The
6525 cursor needs to be in the =#+BEGIN: clocktable= line for this
6526 command. If =:block= is =today=, it is shifted to =today-1=,
6529 Here is an example of the frame for a clock table as it is inserted
6530 into the buffer with the {{{kbd(C-c C-x C-r)}}} command:
6532 #+cindex: BEGIN clocktable
6534 ,#+BEGIN: clocktable :maxlevel 2 :emphasize nil :scope file
6538 #+texinfo: @noindent
6539 #+vindex: org-clocktable-defaults
6540 The =#+BEGIN= line and specify a number of options to define the
6541 scope, structure, and formatting of the report. Defaults for all
6542 these options can be configured in the variable
6543 ~org-clocktable-defaults~.
6545 #+texinfo: @noindent
6546 First there are options that determine which clock entries are to
6551 Maximum level depth to which times are listed in the table.
6552 Clocks at deeper levels are summed into the upper level.
6556 The scope to consider. This can be any of the following:
6558 | ~nil~ | the current buffer or narrowed region |
6559 | ~file~ | the full current buffer |
6560 | ~subtree~ | the subtree where the clocktable is located |
6561 | ~treeN~ | the surrounding level N tree, for example =tree3= |
6562 | ~tree~ | the surrounding level 1 tree |
6563 | ~agenda~ | all agenda files |
6564 | =("file" ...)= | scan these files |
6565 | =FUNCTION= | scan files returned by calling FUNCTION with no argument |
6566 | ~file-with-archives~ | current file and its archives |
6567 | ~agenda-with-archives~ | all agenda files, including archives |
6571 The time block to consider. This block is specified either
6572 absolute, or relative to the current time and may be any of these
6575 | =2007-12-31= | New year eve 2007 |
6576 | =2007-12= | December 2007 |
6577 | =2007-W50= | ISO-week 50 in 2007 |
6578 | =2007-Q2= | 2nd quarter in 2007 |
6579 | =2007= | the year 2007 |
6580 | ~today~, ~yesterday~, ~today-N~ | a relative day |
6581 | ~thisweek~, ~lastweek~, ~thisweek-N~ | a relative week |
6582 | ~thismonth~, ~lastmonth~, ~thismonth-N~ | a relative month |
6583 | ~thisyear~, ~lastyear~, ~thisyear-N~ | a relative year |
6585 Use {{{kbd(S-left)}}} or {{{kbd(S-right)}}} to shift the
6590 A time string specifying when to start considering times.
6594 A time string specifying when to stop considering times.
6598 The starting day of the week. The default is 1 for Monday.
6602 The starting day of the month. The default is 1 for the first.
6606 Set to ~week~ or ~day~ to split the table into chunks. To use
6607 this, ~:block~ or ~:tstart~, ~:tend~ are needed.
6611 Do not show steps that have zero time.
6615 Do not show table sections from files which did not contribute.
6619 A tags match to select entries that should contribute. See
6620 [[*Matching tags and properties]] for the match syntax.
6622 #+findex: org-clocktable-write-default
6623 Then there are options which determine the formatting of the table.
6624 There options are interpreted by the function
6625 ~org-clocktable-write-default~, but you can specify your own function
6626 using the ~:formatter~ parameter.
6630 When ~t~, emphasize level one and level two items.
6634 Language[fn:76] to use for descriptive cells like "Task".
6638 Link the item headlines in the table to their origins.
6642 An integer to limit the width of the headline column in the Org
6643 table. If you write it like =50!=, then the headline is also
6644 shortened in export.
6648 Indent each headline field according to its level.
6652 Number of columns to be used for times. If this is smaller than
6653 ~:maxlevel~, lower levels are lumped into one column.
6657 Should a level number column be included?
6661 A cons cell containing the column to sort and a sorting type.
6662 E.g., =:sort (1 . ?a)= sorts the first column alphabetically.
6666 Abbreviation for =:level nil :indent t :narrow 40! :tcolumns 1=.
6667 All are overwritten except if there is an explicit =:narrow=.
6671 A timestamp for the entry, when available. Look for SCHEDULED,
6672 DEADLINE, TIMESTAMP and TIMESTAMP_IA special properties (see
6673 [[*Special properties]]), in this order.
6677 List of properties shown in the table. Each property gets its
6682 When this flag is non-~nil~, the values for =:properties= are
6687 Content of a =TBLFM= keyword to be added and evaluated. As
6688 a special case, =:formula %= adds a column with % time. If you
6689 do not specify a formula here, any existing formula below the
6690 clock table survives updates and is evaluated.
6694 A function to format clock data and insert it into the buffer.
6696 To get a clock summary of the current level 1 tree, for the current
6697 day, you could write:
6700 ,#+BEGIN: clocktable :maxlevel 2 :block today :scope tree1 :link t
6704 #+texinfo: @noindent
6705 To use a specific time range you could write[fn:77]
6708 ,#+BEGIN: clocktable :tstart "<2006-08-10 Thu 10:00>"
6709 :tend "<2006-08-10 Thu 12:00>"
6713 A range starting a week ago and ending right now could be written as
6716 ,#+BEGIN: clocktable :tstart "<-1w>" :tend "<now>"
6720 A summary of the current subtree with % times would be:
6723 ,#+BEGIN: clocktable :scope subtree :link t :formula %
6727 A horizontally compact representation of everything clocked during
6731 ,#+BEGIN: clocktable :scope agenda :block lastweek :compact t
6735 *** Resolving idle time and continuous clocking
6737 :DESCRIPTION: Resolving time when you've been idle.
6738 :ALT_TITLE: Resolving idle time
6741 **** Resolving idle time
6746 #+cindex: resolve idle time
6747 #+cindex: idle, resolve, dangling
6749 If you clock in on a work item, and then walk away from your
6750 computer -- perhaps to take a phone call -- you often need to
6751 "resolve" the time you were away by either subtracting it from the
6752 current clock, or applying it to another one.
6754 #+vindex: org-clock-idle-time
6755 #+vindex: org-clock-x11idle-program-name
6756 By customizing the variable ~org-clock-idle-time~ to some integer,
6757 such as 10 or 15, Emacs can alert you when you get back to your
6758 computer after being idle for that many minutes[fn:78], and ask what
6759 you want to do with the idle time. There will be a question waiting
6760 for you when you get back, indicating how much idle time has passed
6761 constantly updated with the current amount, as well as a set of
6762 choices to correct the discrepancy:
6767 To keep some or all of the minutes and stay clocked in, press
6768 {{{kbd(k)}}}. Org asks how many of the minutes to keep. Press
6769 {{{kbd(RET)}}} to keep them all, effectively changing nothing, or
6770 enter a number to keep that many minutes.
6775 If you use the shift key and press {{{kbd(K)}}}, it keeps however
6776 many minutes you request and then immediately clock out of that
6777 task. If you keep all of the minutes, this is the same as just
6778 clocking out of the current task.
6783 To keep none of the minutes, use {{{kbd(s)}}} to subtract all the
6784 away time from the clock, and then check back in from the moment
6790 To keep none of the minutes and just clock out at the start of
6791 the away time, use the shift key and press {{{kbd(S)}}}.
6792 Remember that using shift always leave you clocked out, no matter
6793 which option you choose.
6798 To cancel the clock altogether, use {{{kbd(C)}}}. Note that if
6799 instead of canceling you subtract the away time, and the
6800 resulting clock amount is less than a minute, the clock is still
6801 canceled rather than cluttering up the log with an empty entry.
6803 What if you subtracted those away minutes from the current clock, and
6804 now want to apply them to a new clock? Simply clock in to any task
6805 immediately after the subtraction. Org will notice that you have
6806 subtracted time "on the books", so to speak, and will ask if you want
6807 to apply those minutes to the next task you clock in on.
6809 There is one other instance when this clock resolution magic occurs.
6810 Say you were clocked in and hacking away, and suddenly your cat chased
6811 a mouse who scared a hamster that crashed into your UPS's power
6812 button! You suddenly lose all your buffers, but thanks to auto-save
6813 you still have your recent Org mode changes, including your last clock
6816 If you restart Emacs and clock into any task, Org will notice that you
6817 have a dangling clock which was never clocked out from your last
6818 session. Using that clock's starting time as the beginning of the
6819 unaccounted-for period, Org will ask how you want to resolve that
6820 time. The logic and behavior is identical to dealing with away time
6821 due to idleness; it is just happening due to a recovery event rather
6822 than a set amount of idle time.
6824 You can also check all the files visited by your Org agenda for
6825 dangling clocks at any time using {{{kbd(M-x org-resolve-clocks
6826 RET)}}} (or {{{kbd(C-c C-x C-z)}}}).
6828 **** Continuous clocking
6832 #+cindex: continuous clocking
6834 #+vindex: org-clock-continuously
6835 You may want to start clocking from the time when you clocked out the
6836 previous task. To enable this systematically, set
6837 ~org-clock-continuously~ to non-~nil~. Each time you clock in, Org
6838 retrieves the clock-out time of the last clocked entry for this
6839 session, and start the new clock from there.
6841 If you only want this from time to time, use three universal prefix
6842 arguments with ~org-clock-in~ and two {{{kbd(C-u C-u)}}} with
6843 ~org-clock-in-last~.
6847 :DESCRIPTION: Planning work effort in advance.
6849 #+cindex: effort estimates
6850 #+cindex: EFFORT, property
6851 #+vindex: org-effort-property
6853 If you want to plan your work in a very detailed way, or if you need
6854 to produce offers with quotations of the estimated work effort, you
6855 may want to assign effort estimates to entries. If you are also
6856 clocking your work, you may later want to compare the planned effort
6857 with the actual working time, a great way to improve planning
6858 estimates. Effort estimates are stored in a special property
6859 =EFFORT=. You can set the effort for an entry with the following
6862 - {{{kbd(C-c C-x e)}}} (~org-set-effort~) ::
6865 #+findex: org-set-effort
6866 Set the effort estimate for the current entry. With a numeric
6867 prefix argument, set it to the Nth allowed value (see below).
6868 This command is also accessible from the agenda with the
6871 - {{{kbd(C-c C-x C-e)}}} (~org-clock-modify-effort-estimate~) ::
6873 #+kindex: C-c C-x C-e
6874 #+findex: org-clock-modify-effort-estimate
6875 Modify the effort estimate of the item currently being clocked.
6877 Clearly the best way to work with effort estimates is through column
6878 view (see [[*Column view]]). You should start by setting up discrete
6879 values for effort estimates, and a =COLUMNS= format that displays
6880 these values together with clock sums -- if you want to clock your
6881 time. For a specific buffer you can use:
6884 ,#+PROPERTY: Effort_ALL 0 0:10 0:30 1:00 2:00 3:00 4:00 5:00 6:00 7:00
6885 ,#+COLUMNS: %40ITEM(Task) %17Effort(Estimated Effort){:} %CLOCKSUM
6889 #+vindex: org-global-properties
6890 #+vindex: org-columns-default-format
6891 or, even better, you can set up these values globally by customizing
6892 the variables ~org-global-properties~ and
6893 ~org-columns-default-format~. In particular if you want to use this
6894 setup also in the agenda, a global setup may be advised.
6896 The way to assign estimates to individual items is then to switch to
6897 column mode, and to use {{{kbd(S-right)}}} and {{{kbd(S-left)}}} to
6898 change the value. The values you enter are immediately summed up in
6899 the hierarchy. In the column next to it, any clocked time is
6902 #+vindex: org-agenda-columns-add-appointments-to-effort-sum
6903 If you switch to column view in the daily/weekly agenda, the effort
6904 column summarizes the estimated work effort for each day[fn:79], and
6905 you can use this to find space in your schedule. To get an overview
6906 of the entire part of the day that is committed, you can set the
6907 option ~org-agenda-columns-add-appointments-to-effort-sum~. The
6908 appointments on a day that take place over a specified time interval
6909 are then also added to the load estimate of the day.
6911 Effort estimates can be used in secondary agenda filtering that is
6912 triggered with the {{{kbd(/)}}} key in the agenda (see [[*Commands in
6913 the agenda buffer]]). If you have these estimates defined consistently,
6914 two or three key presses narrow down the list to stuff that fits into
6915 an available time slot.
6917 ** Taking notes with a relative timer
6919 :DESCRIPTION: Notes with a running timer.
6922 #+cindex: relative timer
6923 #+cindex: countdown timer
6925 Org provides two types of timers. There is a relative timer that
6926 counts up, which can be useful when taking notes during, for example,
6927 a meeting or a video viewing. There is also a countdown timer.
6929 The relative and countdown are started with separate commands.
6931 - {{{kbd(C-c C-x 0)}}} (~org-timer-start~) ::
6934 #+findex: org-timer-start
6935 Start or reset the relative timer. By default, the timer is set
6936 to 0. When called with a {{{kbd(C-u)}}} prefix, prompt the user
6937 for a starting offset. If there is a timer string at point, this
6938 is taken as the default, providing a convenient way to restart
6939 taking notes after a break in the process. When called with
6940 a double prefix argument {{{kbd(C-u C-u)}}}, change all timer
6941 strings in the active region by a certain amount. This can be
6942 used to fix timer strings if the timer was not started at exactly
6945 - {{{kbd(C-c C-x ;)}}} (~org-timer-set-timer~) ::
6948 #+findex: org-timer-set-timer
6949 #+vindex: org-timer-default-timer
6950 Start a countdown timer. The user is prompted for a duration.
6951 ~org-timer-default-timer~ sets the default countdown value.
6952 Giving a numeric prefix argument overrides this default value.
6953 This command is available as {{{kbd(;)}}} in agenda buffers.
6955 Once started, relative and countdown timers are controlled with the
6958 - {{{kbd(C-c C-x .)}}} (~org-timer~) ::
6962 Insert a relative time into the buffer. The first time you use
6963 this, the timer starts. Using a prefix argument restarts it.
6965 - {{{kbd(C-c C-x -)}}} (~org-timer-item~) ::
6968 #+findex: org-timer-item
6969 Insert a description list item with the current relative time.
6970 With a prefix argument, first reset the timer to 0.
6972 - {{{kbd(M-RET)}}} (~org-insert-heading~) ::
6975 #+findex: org-insert-heading
6976 Once the timer list is started, you can also use
6977 {{{kbd(M-RET)}}} to insert new timer items.
6979 - {{{kbd(C-c C-x \,)}}} (~org-timer-pause-or-continue~) ::
6982 #+findex: org-timer-pause-or-continue
6983 Pause the timer, or continue it if it is already paused.
6985 - {{{kbd(C-c C-x _)}}} (~org-timer-stop~) ::
6988 #+findex: org-timer-stop
6989 Stop the timer. After this, you can only start a new timer, not
6990 continue the old one. This command also removes the timer from
6993 * Capture - Refile - Archive
6995 :DESCRIPTION: The ins and outs for projects.
6999 An important part of any organization system is the ability to quickly
7000 capture new ideas and tasks, and to associate reference material with
7001 them. Org does this using a process called /capture/. It also can
7002 store files related to a task (/attachments/) in a special directory.
7003 Once in the system, tasks and projects need to be moved around.
7004 Moving completed project trees to an archive file keeps the system
7009 :DESCRIPTION: Capturing new stuff.
7013 Capture lets you quickly store notes with little interruption of your
7014 work flow. Org's method for capturing new items is heavily inspired
7015 by John Wiegley's excellent =remember.el= package.
7017 *** Setting up capture
7019 :DESCRIPTION: Where notes will be stored.
7022 The following customization sets a default target file for notes, and
7023 defines a global key[fn:80] for capturing new material.
7025 #+vindex: org-default-notes-file
7026 #+begin_src emacs-lisp
7027 (setq org-default-notes-file (concat org-directory "/notes.org"))
7028 (define-key global-map "\C-cc" 'org-capture)
7033 :DESCRIPTION: Commands to invoke and terminate capture.
7036 - {{{kbd(C-c c)}}} (~org-capture~) ::
7039 #+findex: org-capture
7041 Call the command ~org-capture~. Note that this keybinding is
7042 global and not active by default: you need to install it. If you
7043 have templates defined (see [[*Capture templates]]), it offers these
7044 templates for selection or use a new Org outline node as the
7045 default template. It inserts the template into the target file
7046 and switch to an indirect buffer narrowed to this new node. You
7047 may then insert the information you want.
7049 - {{{kbd(C-c C-c)}}} (~org-capture-finalize~) ::
7052 #+findex: org-capture-finalize
7053 Once you have finished entering information into the capture
7054 buffer, {{{kbd(C-c C-c)}}} returns you to the window
7055 configuration before the capture process, so that you can resume
7056 your work without further distraction. When called with a prefix
7057 argument, finalize and then jump to the captured item.
7059 - {{{kbd(C-c C-w)}}} (~org-capture-refile~) ::
7062 #+findex: org-capture-refile
7063 Finalize the capture process by refiling the note to a different
7064 place (see [[*Refile and copy]]). Please realize that this is
7065 a normal refiling command that will be executed -- so the cursor
7066 position at the moment you run this command is important. If you
7067 have inserted a tree with a parent and children, first move the
7068 cursor back to the parent. Any prefix argument given to this
7069 command is passed on to the ~org-refile~ command.
7071 - {{{kbd(C-c C-k)}}} (~org-capture-kill~) ::
7074 #+findex: org-capture-kill
7075 Abort the capture process and return to the previous state.
7077 You can also call ~org-capture~ in a special way from the agenda,
7078 using the {{{kbd(k c)}}} key combination. With this access, any
7079 timestamps inserted by the selected capture template defaults to the
7080 cursor date in the agenda, rather than to the current date.
7082 To find the locations of the last stored capture, use ~org-capture~
7083 with prefix commands:
7085 - {{{kbd(C-u C-c c)}}} ::
7088 Visit the target location of a capture template. You get to
7089 select the template in the usual way.
7091 - {{{kbd(C-u C-u C-c c)}}} ::
7093 #+kindex: C-u C-u C-c c
7094 Visit the last stored capture item in its buffer.
7096 #+vindex: org-capture-bookmark
7097 #+cindex: org-capture-last-stored
7098 You can also jump to the bookmark ~org-capture-last-stored~, which is
7099 automatically created unless you set ~org-capture-bookmark~ to ~nil~.
7101 To insert the capture at point in an Org buffer, call ~org-capture~
7102 with a ~C-0~ prefix argument.
7104 *** Capture templates
7106 :DESCRIPTION: Define the outline of different note types.
7108 #+cindex: templates, for Capture
7110 You can use templates for different types of capture items, and for
7111 different target locations. The easiest way to create such templates
7112 is through the customize interface.
7114 - {{{kbd(C-c c C)}}} ::
7117 Customize the variable ~org-capture-templates~.
7119 Before we give the formal description of template definitions, let's
7120 look at an example. Say you would like to use one template to create
7121 general TODO entries, and you want to put these entries under the
7122 heading =Tasks= in your file =~/org/gtd.org=. Also, a date tree in
7123 the file =journal.org= should capture journal entries. A possible
7124 configuration would look like:
7126 #+begin_src emacs-lisp
7127 (setq org-capture-templates
7128 '(("t" "Todo" entry (file+headline "~/org/gtd.org" "Tasks")
7129 "* TODO %?\n %i\n %a")
7130 ("j" "Journal" entry (file+datetree "~/org/journal.org")
7131 "* %?\nEntered on %U\n %i\n %a")))
7134 #+texinfo: @noindent
7135 If you then press {{{kbd(C-c c t)}}}, Org will prepare the template
7140 [[file:LINK TO WHERE YOU INITIATED CAPTURE]]
7143 #+texinfo: @noindent
7144 During expansion of the template, ~%a~ has been replaced by a link to
7145 the location from where you called the capture command. This can be
7146 extremely useful for deriving tasks from emails, for example. You
7147 fill in the task definition, press {{{kbd(C-c C-c)}}} and Org returns
7148 you to the same place where you started the capture process.
7150 To define special keys to capture to a particular template without
7151 going through the interactive template selection, you can create your
7152 key binding like this:
7154 #+begin_src emacs-lisp
7155 (define-key global-map "\C-cx"
7156 (lambda () (interactive) (org-capture nil "x")))
7159 **** Template elements
7161 :DESCRIPTION: What is needed for a complete template entry.
7164 Now lets look at the elements of a template definition. Each entry in
7165 ~org-capture-templates~ is a list with the following items:
7169 The keys that selects the template, as a string, characters only,
7170 for example ="a"=, for a template to be selected with a single
7171 key, or ="bt"= for selection with two keys. When using several
7172 keys, keys using the same prefix key must be sequential in the
7173 list and preceded by a 2-element entry explaining the prefix key,
7176 #+begin_src emacs-lisp
7177 ("b" "Templates for marking stuff to buy")
7180 #+texinfo: @noindent
7181 If you do not define a template for the {{{kbd(C)}}} key, this
7182 key opens the Customize buffer for this complex variable.
7186 A short string describing the template, shown during selection.
7190 The type of entry, a symbol. Valid values are:
7194 An Org mode node, with a headline. Will be filed as the child
7195 of the target entry or as a top-level entry. The target file
7196 should be an Org file.
7200 A plain list item, placed in the first plain list at the
7201 target location. Again the target file should be an Org
7206 A checkbox item. This only differs from the plain list item
7207 by the default template.
7211 A new line in the first table at the target location. Where
7212 exactly the line will be inserted depends on the properties
7213 ~:prepend~ and ~:table-line-pos~ (see below).
7217 Text to be inserted as it is.
7221 #+vindex: org-default-notes-file
7222 #+vindex: org-directory
7223 Specification of where the captured item should be placed. In
7224 Org files, targets usually define a node. Entries will become
7225 children of this node. Other types will be added to the table or
7226 list in the body of this node. Most target specifications
7227 contain a file name. If that file name is the empty string, it
7228 defaults to ~org-default-notes-file~. A file can also be given
7229 as a variable or as a function called with no argument. When an
7230 absolute path is not specified for a target, it is taken as
7231 relative to ~org-directory~.
7235 - =(file "path/to/file")= ::
7237 Text will be placed at the beginning or end of that file.
7239 - =(id "id of existing org entry")= ::
7241 Filing as child of this entry, or in the body of the entry.
7243 - =(file+headline "filename" "node headline")= ::
7245 Fast configuration if the target heading is unique in the file.
7247 - =(file+olp "filename" "Level 1 heading" "Level 2" ...)= ::
7249 For non-unique headings, the full path is safer.
7251 - =(file+regexp "filename" "regexp to find location")= ::
7253 Use a regular expression to position the cursor.
7255 - =(file+olp+datetree "filename" [ "Level 1 heading" ...])= ::
7257 This target[fn:81] creates a heading in a date tree[fn:82] for
7258 today's date. If the optional outline path is given, the tree
7259 will be built under the node it is pointing to, instead of at
7260 top level. Check out the ~:time-prompt~ and ~:tree-type~
7261 properties below for additional options.
7263 - ~(file+function "filename" function-finding-location)~ ::
7265 A function to find the right location in the file.
7269 File to the entry that is currently being clocked.
7271 - ~(function function-finding-location)~ ::
7273 Most general way: write your own function which both visits the
7274 file and moves point to the right location.
7278 The template for creating the capture item. If you leave this
7279 empty, an appropriate default template will be used. Otherwise
7280 this is a string with escape codes, which will be replaced
7281 depending on time and context of the capture call. The string
7282 with escapes may be loaded from a template file, using the
7283 special syntax =(file "template filename")=. See below for more
7288 The rest of the entry is a property list of additional options.
7289 Recognized properties are:
7293 Normally new captured information will be appended at the
7294 target location (last child, last table line, last list item,
7295 ...). Setting this property changes that.
7297 - ~:immediate-finish~ ::
7299 When set, do not offer to edit the information, just file it
7300 away immediately. This makes sense if the template only needs
7301 information that can be added automatically.
7305 Set this to the number of lines to insert before and after the
7306 new item. Default 0, and the only other common value is 1.
7310 Start the clock in this item.
7314 Keep the clock running when filing the captured entry.
7316 - ~:clock-resume~ ::
7318 If starting the capture interrupted a clock, restart that clock
7319 when finished with the capture. Note that ~:clock-keep~ has
7320 precedence over ~:clock-resume~. When setting both to
7321 non-~nil~, the current clock will run and the previous one will
7326 Prompt for a date/time to be used for date/week trees and when
7327 filling the template. Without this property, capture uses the
7328 current date and time. Even if this property has not been set,
7329 you can force the same behavior by calling ~org-capture~ with
7330 a {{{kbd(C-1)}}} prefix argument.
7334 When ~week~, make a week tree instead of the month tree, i.e.,
7335 place the headings for each day under a heading with the
7340 Do not narrow the target buffer, simply show the full buffer. Default
7341 is to narrow it so that you only see the new material.
7343 - ~:table-line-pos~ ::
7345 Specification of the location in the table where the new line
7346 should be inserted. It should be a string like =II-3= meaning
7347 that the new line should become the third line before the
7348 second horizontal separator line.
7352 If the target file was not yet visited when capture was invoked, kill
7353 the buffer again after capture is completed.
7355 **** Template expansion
7357 :DESCRIPTION: Filling in information about time and context.
7360 In the template itself, special "%-escapes"[fn:83] allow dynamic
7361 insertion of content. The templates are expanded in the order given
7366 Insert the contents of the file given by {{{var(FILE)}}}.
7370 Evaluate Elisp SEXP and replace with the result. The
7371 {{{var(SEXP)}}} must return a string.
7375 The result of format-time-string on the {{{var(FORMAT)}}}
7380 Timestamp, date only.
7384 Timestamp, with date and time.
7388 Like ~%t~, ~%T~ above, but inactive timestamps.
7392 Initial content, the region when capture is called while the
7393 region is active. The entire text will be indented like ~%i~
7398 Annotation, normally the link created with ~org-store-link~.
7402 Like ~%a~, but prompt for the description part.
7406 Like ~%a~, but only insert the literal link.
7410 Current kill ring head.
7414 Content of the X clipboard.
7418 Title of the currently clocked task.
7422 Link to the currently clocked task.
7426 User name (taken from ~user-full-name~).
7430 File visited by current buffer when org-capture was called.
7434 Full path of the file or directory visited by current buffer.
7438 Specific information for certain link types, see below.
7442 Prompt for tags, with completion on tags in target file.
7446 Prompt for tags, with completion all tags in all agenda files.
7450 Like ~%t~, but prompt for date. Similarly ~%^T~, ~%^u~, ~%^U~. You may
7451 define a prompt like ~%^{Birthday}t~.
7455 Interactive selection of which kill or clip to use.
7459 Like ~%^C~, but insert as link.
7463 Prompt the user for a value for property PROP.
7467 Prompt the user for a string and replace this sequence with it.
7468 You may specify a default value and a completion table with
7469 ~%^{prompt|default|completion2|completion3...}~. The arrow keys
7470 access a prompt-specific history.
7474 Insert the text entered at the Nth ~%^{PROMPT}~, where N is
7475 a number, starting from 1.
7479 After completing the template, position cursor here.
7481 #+texinfo: @noindent
7482 #+vindex: org-store-link-props
7483 For specific link types, the following keywords are defined[fn:84]:
7485 #+vindex: org-from-is-user-regexp
7486 | Link type | Available keywords |
7487 |--------------+----------------------------------------------------------|
7488 | bbdb | ~%:name~, ~%:company~ |
7489 | irc | ~%:server~, ~%:port~, ~%:nick~ |
7490 | mh, rmail | ~%:type~, ~%:subject~, ~%:message-id~ |
7491 | | ~%:from~, ~%:fromname~, ~%:fromaddress~ |
7492 | | ~%:to~, ~%:toname~, ~%:toaddress~ |
7493 | | ~%:date~ (message date header field) |
7494 | | ~%:date-timestamp~ (date as active timestamp) |
7495 | | ~%:date-timestamp-inactive~ (date as inactive timestamp) |
7496 | | ~%:fromto~ (either "to NAME" or "from NAME")[fn:85] |
7497 | gnus | ~%:group~, for messages also all email fields |
7498 | w3, w3m | ~%:url~ |
7499 | info | ~%:file~, ~%:node~ |
7500 | calendar | ~%:date~ |
7501 | org-protocol | ~%:link~, ~%:description~, ~%:annotation~ |
7503 **** Templates in contexts
7505 :DESCRIPTION: Only show a template in a specific context.
7508 #+vindex: org-capture-templates-contexts
7509 To control whether a capture template should be accessible from
7510 a specific context, you can customize
7511 ~org-capture-templates-contexts~. Let's say, for example, that you
7512 have a capture template "p" for storing Gnus emails containing
7513 patches. Then you would configure this option like this:
7515 #+begin_src emacs-lisp
7516 (setq org-capture-templates-contexts
7517 '(("p" (in-mode . "message-mode"))))
7520 You can also tell that the command key {{{kbd(p)}}} should refer to
7521 another template. In that case, add this command key like this:
7523 #+begin_src emacs-lisp
7524 (setq org-capture-templates-contexts
7525 '(("p" "q" (in-mode . "message-mode"))))
7528 See the docstring of the variable for more information.
7532 :DESCRIPTION: Add files to tasks.
7534 #+cindex: attachments
7535 #+vindex: org-attach-directory
7537 It is often useful to associate reference material with an outline
7538 node/task. Small chunks of plain text can simply be stored in the
7539 subtree of a project. Hyperlinks (see [[*Hyperlinks]]) can establish
7540 associations with files that live elsewhere on your computer or in the
7541 cloud, like emails or source code files belonging to a project.
7542 Another method is /attachments/, which are files located in
7543 a directory belonging to an outline node. Org uses directories named
7544 by the unique ID of each entry. These directories are located in the
7545 ~data~ directory which lives in the same directory where your Org file
7546 lives[fn:86]. If you initialize this directory with =git init=, Org
7547 automatically commits changes when it sees them. The attachment
7548 system has been contributed to Org by John Wiegley.
7550 In cases where it seems better to do so, you can attach a directory of
7551 your choice to an entry. You can also make children inherit the
7552 attachment directory from a parent, so that an entire subtree uses the
7553 same attached directory.
7555 #+texinfo: @noindent
7556 The following commands deal with attachments:
7558 - {{{kbd(C-c C-a)}}} (~org-attach~) ::
7561 #+findex: org-attach
7562 The dispatcher for commands related to the attachment system.
7563 After these keys, a list of commands is displayed and you must
7564 press an additional key to select a command:
7566 - {{{kbd(a)}}} (~org-attach-attach~) ::
7569 #+findex: org-attach-attach
7570 #+vindex: org-attach-method
7571 Select a file and move it into the task's attachment
7572 directory. The file is copied, moved, or linked, depending
7573 on ~org-attach-method~. Note that hard links are not
7574 supported on all systems.
7576 - {{{kbd(c)}}}/{{{kbd(m)}}}/{{{kbd(l)}}} ::
7581 Attach a file using the copy/move/link method. Note that
7582 hard links are not supported on all systems.
7584 - {{{kbd(n)}}} (~org-attach-new~) ::
7587 #+findex: org-attach-new
7588 Create a new attachment as an Emacs buffer.
7590 - {{{kbd(z)}}} (~org-attach-sync~) ::
7593 #+findex: org-attach-sync
7594 Synchronize the current task with its attachment directory, in case
7595 you added attachments yourself.
7597 - {{{kbd(o)}}} (~org-attach-open~) ::
7600 #+findex: org-attach-open
7601 #+vindex: org-file-apps
7602 Open current task's attachment. If there is more than one,
7603 prompt for a file name first. Opening follows the rules set
7604 by ~org-file-apps~. For more details, see the information
7605 on following hyperlinks (see [[*Handling links]]).
7607 - {{{kbd(O)}}} (~org-attach-open-in-emacs~) ::
7610 #+findex: org-attach-open-in-emacs
7611 Also open the attachment, but force opening the file in
7614 - {{{kbd(f)}}} (~org-attach-reveal~) ::
7617 #+findex: org-attach-reveal
7618 Open the current task's attachment directory.
7620 - {{{kbd(F)}}} (~org-attach-reveal-in-emacs~) ::
7623 #+findex: org-attach-reveal-in-emacs
7624 Also open the directory, but force using Dired in Emacs.
7626 - {{{kbd(d)}}} (~org-attach-delete-one~) ::
7629 Select and delete a single attachment.
7631 - {{{kbd(D)}}} (~org-attach-delete-all~) ::
7634 Delete all of a task's attachments. A safer way is to open
7635 the directory in Dired and delete from there.
7637 - {{{kbd(s)}}} (~org-attach-set-directory~) ::
7640 #+cindex: ATTACH_DIR, property
7641 Set a specific directory as the entry's attachment
7642 directory. This works by putting the directory path into
7643 the =ATTACH_DIR= property.
7645 - {{{kbd(i)}}} (~org-attach-set-inherit~) ::
7648 #+cindex: ATTACH_DIR_INHERIT, property
7649 Set the =ATTACH_DIR_INHERIT= property, so that children use
7650 the same directory for attachments as the parent does.
7652 #+cindex: attach from Dired
7653 #+findex: org-attach-dired-to-subtree
7654 It is possible to attach files to a subtree from a Dired buffer. To
7655 use this feature, have one window in Dired mode containing the file(s)
7656 to be attached and another window with point in the subtree that shall
7657 get the attachments. In the Dired window, with point on a file,
7658 {{{kbd(M-x org-attach-dired-to-subtree)}}} attaches the file to the
7659 subtree using the attachment method set by variable
7660 ~org-attach-method~. When files are marked in the Dired window then
7661 all marked files get attached.
7663 Add the following lines to the Emacs init file to have {{{kbd(C-c C-x
7664 a)}}} attach files in Dired buffers.
7666 #+begin_src emacs-lisp
7667 (add-hook 'dired-mode-hook
7669 (define-key dired-mode-map
7671 #'org-attach-dired-to-subtree))))
7674 The following code shows how to bind the previous command with
7675 a specific attachment method.
7677 #+begin_src emacs-lisp
7678 (add-hook 'dired-mode-hook
7680 (define-key dired-mode-map (kbd "C-c C-x c")
7683 (let ((org-attach-method 'cp))
7684 (call-interactively #'org-attach-dired-to-subtree))))))
7689 :DESCRIPTION: Getting input from RSS feeds.
7692 #+cindex: Atom feeds
7694 Org can add and change entries based on information found in RSS feeds
7695 and Atom feeds. You could use this to make a task out of each new
7696 podcast in a podcast feed. Or you could use a phone-based
7697 note-creating service on the web to import tasks into Org. To access
7698 feeds, configure the variable ~org-feed-alist~. The docstring of this
7699 variable has detailed information. With the following
7701 #+begin_src emacs-lisp
7702 (setq org-feed-alist
7704 "http://rss.slashdot.org/Slashdot/slashdot"
7705 "~/txt/org/feeds.org" "Slashdot Entries")))
7708 #+texinfo: @noindent
7709 new items from the feed provided by =rss.slashdot.org= result in new
7710 entries in the file =~/org/feeds.org= under the heading =Slashdot
7711 Entries=, whenever the following command is used:
7713 - {{{kbd(C-c C-x g)}}} (~org-feed-update-all~) ::
7716 Collect items from the feeds configured in ~org-feed-alist~ and
7719 - {{{kbd(C-c C-x G)}}} (~org-feed-goto-inbox~) ::
7722 Prompt for a feed name and go to the inbox configured for this feed.
7724 Under the same headline, Org creates a drawer =FEEDSTATUS= in which it
7725 stores information about the status of items in the feed, to avoid
7726 adding the same item several times.
7728 For more information, including how to read atom feeds, see
7729 =org-feed.el= and the docstring of ~org-feed-alist~.
7731 ** Protocols for external access
7733 :DESCRIPTION: External access to Emacs and Org.
7734 :ALT_TITLE: Protocols
7736 #+cindex: protocols, for external access
7738 Org protocol is a means to trigger custom actions in Emacs from
7739 external applications. Any application that supports calling external
7740 programs with an URL as argument may be used with this functionality.
7741 For example, you can configure bookmarks in your web browser to send
7742 a link to the current page to Org and create a note from it using
7743 capture (see [[*Capture]]). You can also create a bookmark that tells
7744 Emacs to open the local source file of a remote website you are
7747 #+cindex: Org protocol, set-up
7748 #+cindex: Installing Org protocol
7749 In order to use Org protocol from an application, you need to register
7750 =org-protocol://= as a valid scheme-handler. External calls are
7751 passed to Emacs through the =emacsclient= command, so you also need to
7752 ensure an Emacs server is running. More precisely, when the
7755 : emacsclient org-protocol://PROTOCOL?key1=val1&key2=val2
7757 #+texinfo: @noindent
7758 Emacs calls the handler associated to {{{var(PROTOCOL)}}} with
7759 argument =(:key1 val1 :key2 val2)=.
7761 #+cindex: protocol, new protocol
7762 #+cindex: defining new protocols
7763 Org protocol comes with three predefined protocols, detailed in the
7764 following sections. Configure ~org-protocol-protocol-alist~ to define
7767 *** ~store-link~ protocol
7769 :DESCRIPTION: Store a link, push URL to kill-ring.
7771 #+cindex: store-link protocol
7772 #+cindex: protocol, store-link
7774 Using ~store-link~ handler, you can copy links, insertable through
7775 {{{kbd(M-x org-insert-link)}}} or yanking thereafter. More precisely,
7778 : emacsclient org-protocol://store-link?url=URL&title=TITLE
7780 #+texinfo: @noindent
7781 stores the following link:
7785 In addition, {{{var(URL)}}} is pushed on the kill-ring for yanking.
7786 You need to encode {{{var(URL)}}} and {{{var(TITLE)}}} if they contain
7787 slashes, and probably quote those for the shell.
7789 To use this feature from a browser, add a bookmark with an arbitrary
7790 name, e.g., =Org: store-link= and enter this as /Location/:
7793 javascript:location.href='org-protocol://store-link?url='+
7794 encodeURIComponent(location.href);
7797 *** ~capture~ protocol
7799 :DESCRIPTION: Fill a buffer with external information.
7801 #+cindex: capture protocol
7802 #+cindex: protocol, capture
7804 Activating "capture" handler pops up a =Capture= buffer and fills the
7805 capture template associated to the =X= key with them.
7807 : emacsclient org-protocol://capture?template=X?url=URL?title=TITLE?body=BODY
7809 To use this feature, add a bookmark with an arbitrary name, e.g.
7810 =Org: capture= and enter this as =Location=:
7813 javascript:location.href='org-protocol://template=x'+
7814 '&url='+encodeURIComponent(window.location.href)+
7815 '&title='+encodeURIComponent(document.title)+
7816 '&body='+encodeURIComponent(window.getSelection());
7819 #+vindex: org-protocol-default-template-key
7820 The result depends on the capture template used, which is set in the
7821 bookmark itself, as in the example above, or in
7822 ~org-protocol-default-template-key~.
7824 The following template placeholders are available:
7828 %:description The webpage title
7829 %:annotation Equivalent to [[%:link][%:description]]
7830 %i The selected text
7833 *** ~open-source~ protocol
7835 :DESCRIPTION: Edit published contents.
7837 #+cindex: open-source protocol
7838 #+cindex: protocol, open-source
7840 The ~open-source~ handler is designed to help with editing local
7841 sources when reading a document. To that effect, you can use
7842 a bookmark with the following location:
7845 javascript:location.href='org-protocol://open-source?&url='+
7846 encodeURIComponent(location.href)
7849 #+vindex: org-protocol-project-alist
7850 The variable ~org-protocol-project-alist~ maps URLs to local file
7851 names, by stripping URL parameters from the end and replacing the
7852 ~:base-url~ with ~:working-directory~ and ~:online-suffix~ with
7853 ~:working-suffix~. For example, assuming you own a local copy of
7854 =http://orgmode.org/worg/= contents at =/home/user/worg=, you can set
7855 ~org-protocol-project-alist~ to the following
7857 #+begin_src emacs-lisp
7858 (setq org-protocol-project-alist
7860 :base-url "http://orgmode.org/worg/"
7861 :working-directory "/home/user/worg/"
7862 :online-suffix ".html"
7863 :working-suffix ".org")))
7866 #+texinfo: @noindent
7867 If you are now browsing
7868 =http://orgmode.org/worg/org-contrib/org-protocol.html= and find
7869 a typo or have an idea about how to enhance the documentation, simply
7870 click the bookmark and start editing.
7872 #+cindex: rewritten URL in open-source protocol
7873 #+cindex: protocol, open-source rewritten URL
7874 However, such mapping may not yield the desired results. Suppose you
7875 maintain an online store located at =http://example.com/=. The local
7876 sources reside in =/home/user/example/=. It is common practice to
7877 serve all products in such a store through one file and rewrite URLs
7878 that do not match an existing file on the server. That way, a request
7879 to =http://example.com/print/posters.html= might be rewritten on the
7880 server to something like
7881 =http://example.com/shop/products.php/posters.html.php=. The
7882 ~open-source~ handler probably cannot find a file named
7883 =/home/user/example/print/posters.html.php= and fails.
7885 Such an entry in ~org-protocol-project-alist~ may hold an additional
7886 property ~:rewrites~. This property is a list of cons cells, each of
7887 which maps a regular expression to a path relative to the
7888 ~:working-directory~.
7890 Now map the URL to the path =/home/user/example/products.php= by
7891 adding ~:rewrites~ rules like this:
7893 #+begin_src emacs-lisp
7894 (setq org-protocol-project-alist
7896 :base-url "http://example.com/"
7897 :working-directory "/home/user/example/"
7898 :online-suffix ".php"
7899 :working-suffix ".php"
7900 :rewrites (("example.com/print/" . "products.php")
7901 ("example.com/$" . "index.php")))))
7904 #+texinfo: @noindent
7905 Since =example.com/$= is used as a regular expression, it maps
7906 =http://example.com/=, =https://example.com=,
7907 =http://www.example.com/= and similar to
7908 =/home/user/example/index.php=.
7910 The ~:rewrites~ rules are searched as a last resort if and only if no
7911 existing file name is matched.
7913 #+cindex: protocol, open-source, set-up mapping
7914 #+cindex: mappings in open-source protocol
7915 #+findex: org-protocol-create
7916 #+findex: org-protocol-create-for-org
7917 Two functions can help you filling ~org-protocol-project-alist~ with
7918 valid contents: ~org-protocol-create~ and
7919 ~org-protocol-create-for-org~. The latter is of use if you're editing
7920 an Org file that is part of a publishing project.
7924 :DESCRIPTION: Moving/copying a tree from one place to another.
7926 #+cindex: refiling notes
7927 #+cindex: copying notes
7929 When reviewing the captured data, you may want to refile or to copy
7930 some of the entries into a different list, for example into a project.
7931 Cutting, finding the right location, and then pasting the note is
7932 cumbersome. To simplify this process, you can use the following
7935 - {{{kbd(C-c M-w)}}} (~org-copy~) ::
7939 Copying works like refiling, except that the original note is not
7942 - {{{kbd(C-c C-w)}}} (~org-refile~) ::
7945 #+findex: org-refile
7946 #+vindex: org-reverse-note-order
7947 #+vindex: org-refile-targets
7948 #+vindex: org-refile-use-outline-path
7949 #+vindex: org-outline-path-complete-in-steps
7950 #+vindex: org-refile-allow-creating-parent-nodes
7951 #+vindex: org-log-refile
7952 Refile the entry or region at point. This command offers
7953 possible locations for refiling the entry and lets you select one
7954 with completion. The item (or all items in the region) is filed
7955 below the target heading as a subitem. Depending on
7956 ~org-reverse-note-order~, it is either the first or last subitem.
7958 By default, all level 1 headlines in the current buffer are
7959 considered to be targets, but you can have more complex
7960 definitions across a number of files. See the variable
7961 ~org-refile-targets~ for details. If you would like to select
7962 a location via a file-path-like completion along the outline
7963 path, see the variables ~org-refile-use-outline-path~ and
7964 ~org-outline-path-complete-in-steps~. If you would like to be
7965 able to create new nodes as new parents for refiling on the fly,
7966 check the variable ~org-refile-allow-creating-parent-nodes~.
7967 When the variable ~org-log-refile~[fn:87] is set, a timestamp or
7968 a note is recorded whenever an entry is refiled.
7970 - {{{kbd(C-u C-c C-w)}}} ::
7972 #+kindex: C-u C-c C-w
7973 Use the refile interface to jump to a heading.
7975 - {{{kbd(C-u C-u C-c C-w)}}} (~org-refile-goto-last-stored~) ::
7977 #+kindex: C-u C-u C-c C-w
7978 #+findex: org-refile-goto-last-stored
7979 Jump to the location where ~org-refile~ last moved a tree to.
7981 - {{{kbd(C-2 C-c C-w)}}} ::
7983 #+kindex: C-2 C-c C-w
7984 Refile as the child of the item currently being clocked.
7986 - {{{kbd(C-3 C-c C-w)}}} ::
7988 #+kindex: C-3 C-c C-w
7989 #+vindex: org-refile-keep
7990 Refile and keep the entry in place. Also see ~org-refile-keep~
7991 to make this the default behavior, and beware that this may
7992 result in duplicated ~ID~ properties.
7994 - {{{kbd(C-0 C-c C-w)}}} or {{{kbd(C-u C-u C-u C-c C-w)}}} (~org-refile-cache-clear~) ::
7996 #+kindex: C-u C-u C-u C-c C-w
7997 #+kindex: C-0 C-c C-w
7998 #+findex: org-refile-cache-clear
7999 #+vindex: org-refile-use-cache
8000 Clear the target cache. Caching of refile targets can be turned
8001 on by setting ~org-refile-use-cache~. To make the command see
8002 new possible targets, you have to clear the cache with this
8007 :DESCRIPTION: What to do with finished products.
8011 When a project represented by a (sub)tree is finished, you may want to
8012 move the tree out of the way and to stop it from contributing to the
8013 agenda. Archiving is important to keep your working files compact and
8014 global searches like the construction of agenda views fast.
8016 - {{{kbd(C-c C-x C-a)}}} (~org-archive-subtree-default~) ::
8018 #+kindex: C-c C-x C-a
8019 #+findex: org-archive-subtree-default
8020 #+vindex: org-archive-default-command
8021 Archive the current entry using the command specified in the
8022 variable ~org-archive-default-command~.
8024 *** Moving a tree to an archive file
8026 :DESCRIPTION: Moving a tree to an archive file.
8027 :ALT_TITLE: Moving subtrees
8029 #+cindex: external archiving
8031 The most common archiving action is to move a project tree to another
8032 file, the archive file.
8034 - {{{kbd(C-c C-x C-s)}}} or short {{{kbd(C-c $)}}} (~org-archive-subtree~) ::
8036 #+kindex: C-c C-x C-s
8038 #+findex: org-archive-subtree
8039 #+vindex: org-archive-location
8040 Archive the subtree starting at the cursor position to the
8041 location given by ~org-archive-location~.
8043 - {{{kbd(C-u C-c C-x C-s)}}} ::
8045 #+kindex: C-u C-c C-x C-s
8046 Check if any direct children of the current headline could be
8047 moved to the archive. To do this, check each subtree for open
8048 TODO entries. If none is found, the command offers to move it to
8049 the archive location. If the cursor is /not/ on a headline when
8050 this command is invoked, check level 1 trees.
8052 - {{{kbd(C-u C-u C-c C-x C-s)}}} ::
8054 #+kindex: C-u C-u C-c C-x C-s
8055 As above, but check subtree for timestamps instead of TODO
8056 entries. The command offers to archive the subtree if it /does/
8057 contain a timestamp, and that timestamp is in the past.
8059 #+cindex: archive locations
8060 The default archive location is a file in the same directory as the
8061 current file, with the name derived by appending =_archive= to the
8062 current file name. You can also choose what heading to file archived
8063 items under, with the possibility to add them to a datetree in a file.
8064 For information and examples on how to specify the file and the
8065 heading, see the documentation string of the variable
8066 ~org-archive-location~.
8068 There is also an in-buffer option for setting this variable, for
8071 #+cindex: ARCHIVE, keyword
8072 : #+ARCHIVE: %s_done::
8074 #+texinfo: @noindent
8075 #+cindex: ARCHIVE, property
8076 If you would like to have a special archive location for a single
8077 entry or a (sub)tree, give the entry an =ARCHIVE= property with the
8078 location as the value (see [[*Properties and columns]]).
8080 #+vindex: org-archive-save-context-info
8081 When a subtree is moved, it receives a number of special properties
8082 that record context information like the file from where the entry
8083 came, its outline path the archiving time etc. Configure the variable
8084 ~org-archive-save-context-info~ to adjust the amount of information
8087 *** Internal archiving
8089 :DESCRIPTION: Switch off a tree but keep it in the file.
8092 If you want to just switch off -- for agenda views -- certain subtrees
8093 without moving them to a different file, you can use the =ARCHIVE=
8096 A headline that is marked with the =ARCHIVE= tag (see [[*Tags]]) stays at
8097 its location in the outline tree, but behaves in the following way:
8100 #+vindex: org-cycle-open-archived-trees
8101 It does not open when you attempt to do so with a visibility cycling
8102 command (see [[*Visibility cycling]]). You can force cycling archived
8103 subtrees with {{{kbd(C-TAB)}}}, or by setting the option
8104 ~org-cycle-open-archived-trees~. Also normal outline commands, like
8105 ~outline-show-all~, open archived subtrees.
8108 #+vindex: org-sparse-tree-open-archived-trees
8109 During sparse tree construction (see [[*Sparse trees]]), matches in
8110 archived subtrees are not exposed, unless you configure the option
8111 ~org-sparse-tree-open-archived-trees~.
8114 #+vindex: org-agenda-skip-archived-trees
8115 During agenda view construction (see [[*Agenda views]]), the content of
8116 archived trees is ignored unless you configure the option
8117 ~org-agenda-skip-archived-trees~, in which case these trees are
8118 always included. In the agenda you can press {{{kbd(v a)}}} to get
8119 archives temporarily included.
8122 #+vindex: org-export-with-archived-trees
8123 Archived trees are not exported (see [[*Exporting]]), only the headline
8124 is. Configure the details using the variable
8125 ~org-export-with-archived-trees~.
8128 #+vindex: org-columns-skip-archived-trees
8129 Archived trees are excluded from column view unless the variable
8130 ~org-columns-skip-archived-trees~ is configured to ~nil~.
8132 The following commands help manage the =ARCHIVE= tag:
8134 - {{{kbd(C-c C-x a)}}} (~org-toggle-archive-tag~) ::
8137 #+findex: org-toggle-archive-tag
8138 Toggle the archive tag for the current headline. When the tag is
8139 set, the headline changes to a shadowed face, and the subtree
8142 - {{{kbd(C-u C-c C-x a)}}} ::
8144 #+kindex: C-u C-c C-x a
8145 Check if any direct children of the current headline should be
8146 archived. To do this, check each subtree for open TODO entries.
8147 If none is found, the command offers to set the =ARCHIVE= tag for
8148 the child. If the cursor is /not/ on a headline when this
8149 command is invoked, check the level 1 trees.
8151 - {{{kbd(C-TAB)}}}, ~org-force-cycle-archived~ ::
8154 Cycle a tree even if it is tagged with =ARCHIVE=.
8156 - {{{kbd(C-c C-x A)}}} (~org-archive-to-archive-sibling~) ::
8159 #+findex: org-archive-to-archive-sibling
8160 Move the current entry to the /Archive Sibling/. This is
8161 a sibling of the entry with the heading =Archive= and the archive
8162 tag. The entry becomes a child of that sibling and in this way
8163 retains a lot of its original context, including inherited tags
8164 and approximate position in the outline.
8168 :DESCRIPTION: Collecting information into views.
8169 :ALT_TITLE: Agenda Views
8171 #+cindex: agenda views
8173 Due to the way Org works, TODO items, time-stamped items, and tagged
8174 headlines can be scattered throughout a file or even a number of
8175 files. To get an overview of open action items, or of events that are
8176 important for a particular date, this information must be collected,
8177 sorted and displayed in an organized way.
8179 Org can select items based on various criteria and display them in
8180 a separate buffer. Seven different view types are provided:
8182 - an /agenda/ that is like a calendar and shows information for
8185 - a /TODO list/ that covers all unfinished action items,
8187 - a /match view/, showings headlines based on the tags, properties,
8188 and TODO state associated with them,
8190 - a /timeline view/ that shows all events in a single Org file, in
8193 - a /text search view/ that shows all entries from multiple files that
8194 contain specified keywords,
8196 - a /stuck projects view/ showing projects that currently do not move
8199 - /custom views/ that are special searches and combinations of
8202 #+texinfo: @noindent
8203 The extracted information is displayed in a special /agenda buffer/.
8204 This buffer is read-only, but provides commands to visit the
8205 corresponding locations in the original Org files, and even to edit
8206 these files remotely.
8208 #+vindex: org-agenda-skip-comment-trees
8209 #+vindex: org-agenda-skip-archived-trees
8210 #+cindex: commented entries, in agenda views
8211 #+cindex: archived entries, in agenda views
8212 By default, the report ignores commented (see [[*Comment lines]]) and
8213 archived (see [[*Internal archiving]]) entries. You can override this by
8214 setting ~org-agenda-skip-comment-trees~ and
8215 ~org-agenda-skip-archived-trees~ to ~nil~.
8217 #+vindex: org-agenda-window-setup
8218 #+vindex: org-agenda-restore-windows-after-quit
8219 Two variables control how the agenda buffer is displayed and whether
8220 the window configuration is restored when the agenda exits:
8221 ~org-agenda-window-setup~ and ~org-agenda-restore-windows-after-quit~.
8225 :DESCRIPTION: Files being searched for agenda information.
8227 #+cindex: agenda files
8228 #+cindex: files for agenda
8230 #+vindex: org-agenda-files
8231 The information to be shown is normally collected from all /agenda
8232 files/, the files listed in the variable ~org-agenda-files~[fn:88].
8233 If a directory is part of this list, all files with the extension
8234 =.org= in this directory are part of the list.
8236 Thus, even if you only work with a single Org file, that file should
8237 be put into the list[fn:89]. You can customize ~org-agenda-files~,
8238 but the easiest way to maintain it is through the following commands
8240 #+attr_texinfo: :sep and
8241 - {{{kbd(C-c [)}}} (~org-agenda-file-to-front~) ::
8244 #+findex: org-agenda-file-to-front
8245 #+cindex: files, adding to agenda list
8246 Add current file to the list of agenda files. The file is added
8247 to the front of the list. If it was already in the list, it is
8248 moved to the front. With a prefix argument, file is added/moved
8251 - {{{kbd(C-c ])}}} (~org-remove-file~) ::
8254 #+findex: org-remove-file
8255 Remove current file from the list of agenda files.
8257 - {{{kbd(C-')}}} and {{{kbd(C-\,)}}} (~org-cycle-agenda-files~) ::
8261 #+findex: org-cycle-agenda-files
8262 #+cindex: cycling, of agenda files
8263 Cycle through agenda file list, visiting one file after the other.
8265 - {{{kbd(M-x org-iswitchb)}}} ::
8267 #+findex: org-iswitchb
8268 Command to use an ~iswitchb~-like interface to switch to and
8269 between Org buffers.
8271 #+texinfo: @noindent
8272 The Org menu contains the current list of files and can be used to
8275 If you would like to focus the agenda temporarily on a file not in
8276 this list, or on just one file in the list, or even on only a subtree
8277 in a file, then this can be done in different ways. For a single
8278 agenda command, you may press {{{kbd(<)}}} once or several times in
8279 the dispatcher (see [[*The agenda dispatcher]]). To restrict the agenda
8280 scope for an extended period, use the following commands:
8282 - {{{kbd(C-c C-x <)}}} (~org-agenda-set-restriction-lock~) ::
8285 #+findex: org-agenda-set-restriction-lock
8286 Permanently restrict the agenda to the current subtree. When
8287 called with a prefix argument, or with the cursor before the
8288 first headline in a file, set the agenda scope to the entire
8289 file. This restriction remains in effect until removed with
8290 {{{kbd(C-c C-x >)}}}, or by typing either {{{kbd(<)}}} or
8291 {{{kbd(>)}}} in the agenda dispatcher. If there is a window
8292 displaying an agenda view, the new restriction takes effect
8295 - {{{kbd(C-c C-x >)}}} (~org-agenda-remove-restriction-lock~) ::
8298 #+findex: org-agenda-remove-restriction-lock
8299 Remove the permanent restriction created by {{{kbd(C-c C-x <)}}}.
8301 #+texinfo: @noindent
8302 When working with =speedbar.el=, you can use the following commands in
8305 - {{{kbd(<)}}} (~org-speedbar-set-agenda-restriction~) ::
8307 #+findex: org-speedbar-set-agenda-restriction
8308 Permanently restrict the agenda to the item -- either an Org file
8309 or a subtree in such a file -- at the cursor in the Speedbar
8310 frame. If there is a window displaying an agenda view, the new
8311 restriction takes effect immediately.
8313 - {{{kbd(>)}}} (~org-agenda-remove-restriction-lock~) ::
8315 #+findex: org-agenda-remove-restriction-lock
8316 Lift the restriction.
8318 ** The agenda dispatcher
8320 :DESCRIPTION: Keyboard access to agenda views.
8321 :ALT_TITLE: Agenda dispatcher
8323 #+cindex: agenda dispatcher
8324 #+cindex: dispatching agenda commands
8326 The views are created through a dispatcher, which should be bound to
8327 a global key -- for example {{{kbd(C-c a)}}} (see [[*Activation]]). In
8328 the following we will assume that {{{kbd(C-c a)}}} is indeed how the
8329 dispatcher is accessed and list keyboard access to commands
8330 accordingly. After pressing {{{kbd(C-c a)}}}, an additional letter is
8331 required to execute a command. The dispatcher offers the following
8337 Create the calendar-like agenda (see [[*Weekly/daily agenda]]).
8339 - {{{kbd(t)}}} or {{{kbd(T)}}} ::
8343 Create a list of all TODO items (see [[*The global TODO list]]).
8345 - {{{kbd(m)}}} or {{{kbd(M)}}} ::
8349 Create a list of headlines matching a given expression (see
8350 [[*Matching tags and properties]]).
8355 Create a list of entries selected by a boolean expression of
8356 keywords and/or regular expressions that must or must not occur
8362 #+vindex: org-agenda-text-search-extra-files
8363 Search for a regular expression in all agenda files and
8364 additionally in the files listed in
8365 ~org-agenda-text-search-extra-files~. This uses the Emacs
8366 command ~multi-occur~. A prefix argument can be used to specify
8367 the number of context lines for each match, default is
8370 - {{{kbd(#)}}} or {{{kbd(!)}}} ::
8374 Create a list of stuck projects (see [[*Stuck projects]]).
8379 Restrict an agenda command to the current buffer[fn:90]. After
8380 pressing {{{kbd(<)}}}, you still need to press the character
8381 selecting the command.
8386 If there is an active region, restrict the following agenda
8387 command to the region. Otherwise, restrict it to the current
8388 subtree[fn:91]. After pressing {{{kbd(< <)}}}, you still need to
8389 press the character selecting the command.
8394 #+vindex: org-agenda-sticky
8395 #+findex: org-toggle-sticky-agenda
8396 Toggle sticky agenda views. By default, Org maintains only
8397 a single agenda buffer and rebuilds it each time you change the
8398 view, to make sure everything is always up to date. If you
8399 switch between views often and the build time bothers you, you
8400 can turn on sticky agenda buffers (make this the default by
8401 customizing the variable ~org-agenda-sticky~). With sticky
8402 agendas, the dispatcher only switches to the selected view, you
8403 need to update it by hand with {{{kbd(r)}}} or {{{kbd(g)}}}. You
8404 can toggle sticky agenda view any time with
8405 ~org-toggle-sticky-agenda~.
8407 You can also define custom commands that are accessible through the
8408 dispatcher, just like the default commands. This includes the
8409 possibility to create extended agenda buffers that contain several
8410 blocks together, for example the weekly agenda, the global TODO list
8411 and a number of special tags matches. See [[*Custom agenda views]].
8413 ** The built-in agenda views
8415 :DESCRIPTION: What is available out of the box?
8416 :ALT_TITLE: Built-in agenda views
8419 In this section we describe the built-in views.
8421 *** Weekly/daily agenda
8423 :DESCRIPTION: The calendar page with current tasks.
8426 #+cindex: weekly agenda
8427 #+cindex: daily agenda
8429 The purpose of the weekly/daily /agenda/ is to act like a page of
8430 a paper agenda, showing all the tasks for the current week or day.
8432 - {{{kbd(C-c a a)}}} (~org-agenda-list~) ::
8435 #+findex: org-agenda-list
8436 #+cindex: org-agenda, command
8437 Compile an agenda for the current week from a list of Org files.
8438 The agenda shows the entries for each day. With a numeric
8439 prefix[fn:92] (like {{{kbd(C-u 2 1 C-c a a)}}}) you may set the
8440 number of days to be displayed.
8442 #+vindex: org-agenda-span
8443 #+vindex: org-agenda-start-day
8444 #+vindex: org-agenda-start-on-weekday
8445 The default number of days displayed in the agenda is set by the
8446 variable ~org-agenda-span~. This variable can be set to any number of
8447 days you want to see by default in the agenda, or to a span name, such
8448 a ~day~, ~week~, ~month~ or ~year~. For weekly agendas, the default
8449 is to start on the previous Monday (see
8450 ~org-agenda-start-on-weekday~). You can also set the start date using
8451 a date shift: ~(setq org-agenda-start-day "+10d")~ starts the agenda
8452 ten days from today in the future.
8454 Remote editing from the agenda buffer means, for example, that you can
8455 change the dates of deadlines and appointments from the agenda buffer.
8456 The commands available in the Agenda buffer are listed in [[*Commands
8457 in the agenda buffer]].
8459 **** Calendar/Diary integration
8463 #+cindex: calendar integration
8464 #+cindex: diary integration
8466 Emacs contains the calendar and diary by Edward M. Reingold. The
8467 calendar displays a three-month calendar with holidays from different
8468 countries and cultures. The diary allows you to keep track of
8469 anniversaries, lunar phases, sunrise/set, recurrent appointments
8470 (weekly, monthly) and more. In this way, it is quite complementary to
8471 Org. It can be very useful to combine output from Org with the diary.
8473 In order to include entries from the Emacs diary into Org mode's
8474 agenda, you only need to customize the variable
8476 #+begin_src emacs-lisp
8477 (setq org-agenda-include-diary t)
8480 #+texinfo: @noindent
8481 After that, everything happens automatically. All diary entries
8482 including holidays, anniversaries, etc., are included in the agenda
8483 buffer created by Org mode. {{{kbd(SPC)}}}, {{{kbd(TAB)}}}, and
8484 {{{kbd(RET)}}} can be used from the agenda buffer to jump to the diary
8485 file in order to edit existing diary entries. The {{{kbd(i)}}}
8486 command to insert new entries for the current date works in the agenda
8487 buffer, as well as the commands {{{kbd(S)}}}, {{{kbd(M)}}}, and
8488 {{{kbd(C)}}} to display Sunrise/Sunset times, show lunar phases and to
8489 convert to other calendars, respectively. {{{kbd(c)}}} can be used to
8490 switch back and forth between calendar and agenda.
8492 If you are using the diary only for S-exp entries and holidays, it is
8493 faster to not use the above setting, but instead to copy or even move
8494 the entries into an Org file. Org mode evaluates diary-style sexp
8495 entries, and does it faster because there is no overhead for first
8496 creating the diary display. Note that the sexp entries must start at
8497 the left margin, no whitespace is allowed before them, as seen in the
8498 following segment of an Org file:[fn:93]
8505 %%(org-calendar-holiday) ; special function for holiday names
8511 %%(org-anniversary 1956 5 14) Arthur Dent is %d years old
8512 %%(org-anniversary 1869 10 2) Mahatma Gandhi would be %d years old
8515 **** Anniversaries from BBDB
8519 #+cindex: BBDB, anniversaries
8520 #+cindex: anniversaries, from BBDB
8522 #+findex: org-bbdb-anniversaries
8523 If you are using the Insidious Big Brother Database to store your
8524 contacts, you very likely prefer to store anniversaries in BBDB rather
8525 than in a separate Org or diary file. Org supports this and can show
8526 BBDB anniversaries as part of the agenda. All you need to do is to
8527 add the following to one of your agenda files:
8534 %%(org-bbdb-anniversaries)
8537 You can then go ahead and define anniversaries for a BBDB record.
8538 Basically, you need to press {{{kbd(C-o anniversary RET)}}} with the
8539 cursor in a BBDB record and then add the date in the format
8540 =YYYY-MM-DD= or =MM-DD=, followed by a space and the class of the
8541 anniversary (=birthday=, =wedding=, or a format string). If you omit
8542 the class, it defaults to =birthday=. Here are a few examples, the
8543 header for the file =org-bbdb.el= contains more detailed information.
8549 2008-04-14 %s released version 6.01 of Org mode, %d years ago
8552 After a change to BBDB, or for the first agenda display during an
8553 Emacs session, the agenda display suffers a short delay as Org updates
8554 its hash with anniversaries. However, from then on things will be
8555 very fast, much faster in fact than a long list of
8556 =%%(diary-anniversary)= entries in an Org or Diary file.
8558 #+findex: org-bbdb-anniversaries-future
8559 If you would like to see upcoming anniversaries with a bit of
8560 forewarning, you can use the following instead:
8567 %%(org-bbdb-anniversaries-future 3)
8570 That will give you three days' warning: on the anniversary date itself
8571 and the two days prior. The argument is optional: if omitted, it
8574 **** Appointment reminders
8578 #+cindex: @file{appt.el}
8579 #+cindex: appointment reminders
8580 #+cindex: appointment
8583 #+cindex: APPT_WARNTIME, keyword
8584 Org can interact with Emacs appointments notification facility. To
8585 add the appointments of your agenda files, use the command
8586 ~org-agenda-to-appt~. This command lets you filter through the list
8587 of your appointments and add only those belonging to a specific
8588 category or matching a regular expression. It also reads
8589 a =APPT_WARNTIME= property which overrides the value of
8590 ~appt-message-warning-time~ for this appointment. See the docstring
8593 *** The global TODO list
8595 :DESCRIPTION: All unfinished action items.
8596 :ALT_TITLE: Global TODO list
8598 #+cindex: global TODO list
8599 #+cindex: TODO list, global
8601 The global TODO list contains all unfinished TODO items formatted and
8602 collected into a single place.
8604 - {{{kbd(C-c a t)}}} (~org-todo-list~) ::
8607 #+findex: org-todo-list
8608 Show the global TODO list. This collects the TODO items from all
8609 agenda files (see [[*Agenda views]]) into a single buffer. By
8610 default, this lists items with a state the is not a DONE state.
8611 The buffer is in ~agenda-mode~, so there are commands to examine
8612 and manipulate the TODO entries directly from that buffer (see
8613 [[*Commands in the agenda buffer]]).
8615 - {{{kbd(C-c a T)}}} (~org-todo-list~) ::
8618 #+findex: org-todo-list
8619 #+cindex: TODO keyword matching
8620 #+vindex: org-todo-keywords
8621 Like the above, but allows selection of a specific TODO keyword.
8622 You can also do this by specifying a prefix argument to
8623 {{{kbd(C-c a t)}}}. You are prompted for a keyword, and you may
8624 also specify several keywords by separating them with =|= as the
8625 boolean OR operator. With a numeric prefix, the Nth keyword in
8626 ~org-todo-keywords~ is selected.
8629 The {{{kbd(r)}}} key in the agenda buffer regenerates it, and you
8630 can give a prefix argument to this command to change the selected
8631 TODO keyword, for example {{{kbd(3 r)}}}. If you often need
8632 a search for a specific keyword, define a custom command for it
8633 (see [[*The agenda dispatcher]]).
8635 Matching specific TODO keywords can also be done as part of
8636 a tags search (see [[*Tag searches]]).
8638 Remote editing of TODO items means that you can change the state of
8639 a TODO entry with a single key press. The commands available in the
8640 TODO list are described in [[*Commands in the agenda buffer]].
8642 #+cindex: sublevels, inclusion into TODO list
8643 Normally the global TODO list simply shows all headlines with TODO
8644 keywords. This list can become very long. There are two ways to keep
8648 #+vindex: org-agenda-todo-ignore-scheduled
8649 #+vindex: org-agenda-todo-ignore-deadlines
8650 #+vindex: org-agenda-todo-ignore-timestamp
8651 #+vindex: org-agenda-todo-ignore-with-date
8652 Some people view a TODO item that has been /scheduled/ for execution
8653 or have a /deadline/ (see [[*Timestamps, deadlines, and scheduling]]) as
8654 no longer /open/. Configure the variables
8655 ~org-agenda-todo-ignore-scheduled~,
8656 ~org-agenda-todo-ignore-deadlines~,
8657 ~org-agenda-todo-ignore-timestamp~ and/or
8658 ~org-agenda-todo-ignore-with-date~ to exclude such items from the
8662 #+vindex: org-agenda-todo-list-sublevels
8663 TODO items may have sublevels to break up the task into subtasks.
8664 In such cases it may be enough to list only the highest level TODO
8665 headline and omit the sublevels from the global list. Configure the
8666 variable ~org-agenda-todo-list-sublevels~ to get this behavior.
8668 *** Matching tags and properties
8670 :DESCRIPTION: Structured information with fine-tuned search.
8672 #+cindex: matching, of tags
8673 #+cindex: matching, of properties
8675 #+cindex: match view
8677 If headlines in the agenda files are marked with /tags/ (see [[*Tags]]),
8678 or have properties (see [[*Properties and columns]]), you can select
8679 headlines based on this metadata and collect them into an agenda
8680 buffer. The match syntax described here also applies when creating
8681 sparse trees with {{{kbd(C-c / m)}}}.
8683 - {{{kbd(C-c a m)}}} (~org-tags-view~) ::
8686 #+findex: org-tags-view
8687 Produce a list of all headlines that match a given set of tags.
8688 The command prompts for a selection criterion, which is a boolean
8689 logic expression with tags, like =+work+urgent-withboss= or
8690 =work|home= (see [[*Tags]]). If you often need a specific search,
8691 define a custom command for it (see [[*The agenda dispatcher]]).
8693 - {{{kbd(C-c a M)}}} (~org-tags-view~) ::
8696 #+findex: org-tags-view
8697 #+vindex: org-tags-match-list-sublevels
8698 #+vindex: org-agenda-tags-todo-honor-ignore-options
8699 Like {{{kbd(C-c a m)}}}, but only select headlines that are also
8700 TODO items and force checking subitems (see the variable
8701 ~org-tags-match-list-sublevels~). To exclude scheduled/deadline
8702 items, see the variable
8703 ~org-agenda-tags-todo-honor-ignore-options~. Matching specific
8704 TODO keywords together with a tags match is also possible, see
8707 The commands available in the tags list are described in [[*Commands
8708 in the agenda buffer]].
8710 #+cindex: boolean logic, for agenda searches
8711 A search string can use Boolean operators =&= for AND and =|= for OR.
8712 =&= binds more strongly than =|=. Parentheses are currently not
8713 implemented. Each element in the search is either a tag, a regular
8714 expression matching tags, or an expression like =PROPERTY OPERATOR
8715 VALUE= with a comparison operator, accessing a property value. Each
8716 element may be preceded by =-= to select against it, and =+= is
8717 syntactic sugar for positive selection. The AND operator =&= is
8718 optional when =+= or =-= is present. Here are some examples, using
8723 Select headlines tagged =work=, but discard those also tagged
8728 Selects lines tagged =work= or =laptop=.
8730 - ~work|laptop+night~ ::
8732 Like before, but require the =laptop= lines to be tagged
8735 #+cindex: regular expressions, with tags search
8736 Instead of a tag, you may also specify a regular expression enclosed
8737 in curly braces. For example, =work+{^boss.*}= matches headlines that
8738 contain the tag =:work:= and any tag /starting/ with =boss=.
8740 #+cindex: group tags, as regular expressions
8741 Group tags (see [[*Tag hierarchy]]) are expanded as regular expressions.
8742 E.g., if =work= is a group tag for the group =:work:lab:conf:=, then
8743 searching for =work= also searches for ={\(?:work\|lab\|conf\)}= and
8744 searching for =-work= searches for all headlines but those with one of
8745 the tags in the group (i.e., =-{\(?:work\|lab\|conf\)}=).
8747 #+cindex: TODO keyword matching, with tags search
8748 #+cindex: level, for tags/property match
8749 #+cindex: category, for tags/property match
8750 #+vindex: org-odd-levels-only
8751 You may also test for properties (see [[*Properties and columns]]) at the
8752 same time as matching tags. The properties may be real properties, or
8753 special properties that represent other metadata (see [[*Special
8754 properties]]). For example, the property =TODO= represents the TODO
8755 keyword of the entry. Or, the property =LEVEL= represents the level
8756 of an entry. So searching =+LEVEL=3+boss-TODO​="DONE"= lists all level
8757 three headlines that have the tag =boss= and are /not/ marked with the
8758 TODO keyword =DONE=. In buffers with ~org-odd-levels-only~ set,
8759 =LEVEL= does not count the number of stars, but =LEVEL=2= corresponds
8762 Here are more examples:
8764 - =work+TODO​="WAITING"= ::
8766 Select =work=-tagged TODO lines with the specific TODO keyword
8769 - =work+TODO​="WAITING"|home+TODO​="WAITING"= ::
8771 Waiting tasks both at work and at home.
8773 When matching properties, a number of different operators can be used
8774 to test the value of a property. Here is a complex example:
8777 +work-boss+PRIORITY="A"+Coffee="unlimited"+Effort<2
8778 +With={Sarah|Denny}+SCHEDULED>="<2008-10-11>"
8781 #+texinfo: @noindent
8782 The type of comparison depends on how the comparison value is written:
8784 - If the comparison value is a plain number, a numerical comparison is
8785 done, and the allowed operators are =<=, ===, =>=, =<==, =>==, and
8788 - If the comparison value is enclosed in double-quotes, a string
8789 comparison is done, and the same operators are allowed.
8791 - If the comparison value is enclosed in double-quotes /and/ angular
8792 brackets (like =DEADLINE<​="<2008-12-24 18:30>"=), both values are
8793 assumed to be date/time specifications in the standard Org way, and
8794 the comparison is done accordingly. Valid values also include
8795 ="<now>"= for now (including time), ="<today>"=, and ="<tomorrow>"=
8796 for these days at 0:00 hours, i.e., without a time specification.
8797 You can also use strings like ="<+5d>"= or ="<-2m>"= with units =d=,
8798 =w=, =m=, and =y= for day, week, month, and year, respectively.
8800 - If the comparison value is enclosed in curly braces, a regexp match
8801 is performed, with === meaning that the regexp matches the property
8802 value, and =<>= meaning that it does not match.
8804 So the search string in the example finds entries tagged =work= but
8805 not =boss=, which also have a priority value =A=, a =Coffee= property
8806 with the value =unlimited=, an =EFFORT= property that is numerically
8807 smaller than 2, a =With= property that is matched by the regular
8808 expression =Sarah|Denny=, and that are scheduled on or after October
8811 You can configure Org mode to use property inheritance during
8812 a search, but beware that this can slow down searches considerably.
8813 See [[*Property inheritance]], for details.
8815 For backward compatibility, and also for typing speed, there is also
8816 a different way to test TODO states in a search. For this, terminate
8817 the tags/property part of the search string (which may include several
8818 terms connected with =|=) with a =/= and then specify a Boolean
8819 expression just for TODO keywords. The syntax is then similar to that
8820 for tags, but should be applied with care: for example, a positive
8821 selection on several TODO keywords cannot meaningfully be combined
8822 with boolean AND. However, /negative selection/ combined with AND can
8823 be meaningful. To make sure that only lines are checked that actually
8824 have any TODO keyword (resulting in a speed-up), use {{{kbd(C-c
8825 a M)}}}, or equivalently start the TODO part after the slash with =!=.
8826 Using {{{kbd(C-c a M)}}} or =/!= does not match TODO keywords in
8827 a DONE state. Examples:
8831 Same as =work+TODO​="WAITING"=.
8833 - =work/!-WAITING-NEXT= ::
8835 Select =work=-tagged TODO lines that are neither =WAITING= nor
8838 - =work/!+WAITING|+NEXT= ::
8840 Select =work=-tagged TODO lines that are either =WAITING= or
8845 :DESCRIPTION: Find entries by searching for text.
8847 #+cindex: search view
8848 #+cindex: text search
8849 #+cindex: searching, for text
8851 This agenda view is a general text search facility for Org mode
8852 entries. It is particularly useful to find notes.
8854 - {{{kbd(C-c a s)}}} (~org-search-view~) ::
8857 #+findex: org-search-view
8858 This is a special search that lets you select entries by matching
8859 a substring or specific words using a boolean logic.
8861 For example, the search string =computer equipment= matches entries
8862 that contain =computer equipment= as a substring, even if the two
8863 words are separated by more space or a line break.
8865 Search view can also search for specific keywords in the entry, using
8866 Boolean logic. The search string =+computer
8867 +wifi -ethernet -{8\.11[bg]}= matches note entries that contain the
8868 keywords =computer= and =wifi=, but not the keyword =ethernet=, and
8869 which are also not matched by the regular expression =8\.11[bg]=,
8870 meaning to exclude both =8.11b= and =8.11g=. The first =+= is
8871 necessary to turn on boolean search, other =+= characters are
8872 optional. For more details, see the docstring of the command
8875 You can incrementally adjust a boolean search with the following keys
8877 #+attr_texinfo: :columns 0.1 0.6
8878 | {{{kbd([)}}} | Add a positive search word |
8879 | {{{kbd(])}}} | Add a negative search word |
8880 | {{{kbd({)}}} | Add a positive regular expression |
8881 | {{{kbd(})}}} | Add a negative regular expression |
8883 #+vindex: org-agenda-text-search-extra-files
8884 Note that in addition to the agenda files, this command also searches
8885 the files listed in ~org-agenda-text-search-extra-files~.
8889 :DESCRIPTION: Find projects you need to review.
8891 #+pindex: GTD, Getting Things Done
8893 If you are following a system like David Allen's GTD to organize your
8894 work, one of the "duties" you have is a regular review to make sure
8895 that all projects move along. A /stuck/ project is a project that has
8896 no defined next actions, so it never shows up in the TODO lists Org
8897 mode produces. During the review, you need to identify such projects
8898 and define next actions for them.
8900 - {{{kbd(C-c a #)}}} (~org-agenda-list-stuck-projects~) ::
8903 #+findex: org-agenda-list-stuck-projects
8904 List projects that are stuck.
8906 - {{{kbd(C-c a !)}}} ::
8909 #+vindex: org-stuck-projects
8910 Customize the variable ~org-stuck-projects~ to define what
8911 a stuck project is and how to find it.
8913 You almost certainly need to configure this view before it works for
8914 you. The built-in default assumes that all your projects are level-2
8915 headlines, and that a project is not stuck if it has at least one
8916 entry marked with a TODO keyword =TODO= or =NEXT= or =NEXTACTION=.
8918 Let's assume that you, in your own way of using Org mode, identify
8919 projects with a tag =:PROJECT:=, and that you use a TODO keyword
8920 =MAYBE= to indicate a project that should not be considered yet.
8921 Let's further assume that the TODO keyword =DONE= marks finished
8922 projects, and that =NEXT= and =TODO= indicate next actions. The tag
8923 =:@shop:= indicates shopping and is a next action even without the
8924 NEXT tag. Finally, if the project contains the special word =IGNORE=
8925 anywhere, it should not be listed either. In this case you would
8926 start by identifying eligible projects with a tags/TODO match (see
8927 [[*Tag searches]]) =+PROJECT/-MAYBE-DONE=, and then check for =TODO=,
8928 =NEXT=, =@shop=, and =IGNORE= in the subtree to identify projects that
8929 are not stuck. The correct customization for this is:
8931 #+begin_src emacs-lisp
8932 (setq org-stuck-projects
8933 '("+PROJECT/-MAYBE-DONE" ("NEXT" "TODO") ("@shop")
8937 Note that if a project is identified as non-stuck, the subtree of this
8938 entry is searched for stuck projects.
8940 ** Presentation and sorting
8942 :DESCRIPTION: How agenda items are prepared for display.
8944 #+cindex: presentation, of agenda items
8946 #+vindex: org-agenda-prefix-format
8947 #+vindex: org-agenda-tags-column
8948 Before displaying items in an agenda view, Org mode visually prepares
8949 the items and sorts them. Each item occupies a single line. The line
8950 starts with a /prefix/ that contains the /category/ (see [[*Categories]])
8951 of the item and other important information. You can customize in
8952 which column tags are displayed through ~org-agenda-tags-column~. You
8953 can also customize the prefix using the option
8954 ~org-agenda-prefix-format~. This prefix is followed by a cleaned-up
8955 version of the outline headline associated with the item.
8959 :DESCRIPTION: Not all tasks are equal.
8962 #+cindex: CATEGORY, keyword
8964 The category is a broad label assigned to each agenda item. By
8965 default, the category is simply derived from the file name, but you
8966 can also specify it with a special line in the buffer, like
8969 : #+CATEGORY: Thesis
8971 #+texinfo: @noindent
8972 #+cindex: CATEGORY, property
8973 If you would like to have a special category for a single entry or
8974 a (sub)tree, give the entry a =CATEGORY= property with the special
8975 category you want to apply as the value.
8977 #+texinfo: @noindent
8978 The display in the agenda buffer looks best if the category is not
8979 longer than 10 characters.
8981 #+texinfo: @noindent
8982 #+vindex: org-agenda-category-icon-alist
8983 You can set up icons for category by customizing the
8984 ~org-agenda-category-icon-alist~ variable.
8986 *** Time-of-day specifications
8988 :DESCRIPTION: How the agenda knows the time.
8990 #+cindex: time-of-day specification
8992 Org mode checks each agenda item for a time-of-day specification. The
8993 time can be part of the timestamp that triggered inclusion into the
8996 : <2005-05-10 Tue 19:00>
8998 #+texinfo: @noindent
8999 Time ranges can be specified with two timestamps:
9001 : <2005-05-10 Tue 20:30>--<2005-05-10 Tue 22:15>
9003 In the headline of the entry itself, a time(range) may also appear as
9004 plain text (like =12:45= or a =8:30-1pm=). If the agenda integrates
9005 the Emacs diary (see [[*Weekly/daily agenda]]), time specifications in
9006 diary entries are recognized as well.
9008 For agenda display, Org mode extracts the time and displays it in
9009 a standard 24 hour format as part of the prefix. The example times in
9010 the previous paragraphs would end up in the agenda like this:
9013 8:30-13:00 Arthur Dent lies in front of the bulldozer
9014 12:45...... Ford Prefect arrives and takes Arthur to the pub
9015 19:00...... The Vogon reads his poem
9016 20:30-22:15 Marvin escorts the Hitchhikers to the bridge
9020 If the agenda is in single-day mode, or for the display of today, the
9021 timed entries are embedded in a time grid, like
9024 8:00...... ------------------
9025 8:30-13:00 Arthur Dent lies in front of the bulldozer
9026 10:00...... ------------------
9027 12:00...... ------------------
9028 12:45...... Ford Prefect arrives and takes Arthur to the pub
9029 14:00...... ------------------
9030 16:00...... ------------------
9031 18:00...... ------------------
9032 19:00...... The Vogon reads his poem
9033 20:00...... ------------------
9034 20:30-22:15 Marvin escorts the Hitchhikers to the bridge
9037 #+vindex: org-agenda-use-time-grid
9038 #+vindex: org-agenda-time-grid
9039 The time grid can be turned on and off with the variable
9040 ~org-agenda-use-time-grid~, and can be configured with
9041 ~org-agenda-time-grid~.
9043 *** Sorting of agenda items
9045 :DESCRIPTION: The order of things.
9047 #+cindex: sorting, of agenda items
9048 #+cindex: priorities, of agenda items
9050 Before being inserted into a view, the items are sorted. How this is
9051 done depends on the type of view.
9054 #+vindex: org-agenda-files
9055 For the daily/weekly agenda, the items for each day are sorted. The
9056 default order is to first collect all items containing an explicit
9057 time-of-day specification. These entries are shown at the beginning
9058 of the list, as a /schedule/ for the day. After that, items remain
9059 grouped in categories, in the sequence given by ~org-agenda-files~.
9060 Within each category, items are sorted by priority (see
9061 [[*Priorities]]), which is composed of the base priority (2000 for
9062 priority =A=, 1000 for =B=, and 0 for =C=), plus additional
9063 increments for overdue scheduled or deadline items.
9065 - For the TODO list, items remain in the order of categories, but
9066 within each category, sorting takes place according to priority (see
9067 [[*Priorities]]). The priority used for sorting derives from the
9068 priority cookie, with additions depending on how close an item is to
9069 its due or scheduled date.
9071 - For tags matches, items are not sorted at all, but just appear in
9072 the sequence in which they are found in the agenda files.
9074 #+vindex: org-agenda-sorting-strategy
9075 Sorting can be customized using the variable
9076 ~org-agenda-sorting-strategy~, and may also include criteria based on
9077 the estimated effort of an entry (see [[*Effort estimates]]).
9079 *** Filtering/limiting agenda times
9081 :DESCRIPTION: Dynamically narrow the agenda.
9084 Agenda built-in or customized commands are statically defined. Agenda
9085 filters and limits provide two ways of dynamically narrowing down the
9086 list of agenda entries: /filters/ and /limits/. Filters only act on
9087 the display of the items, while limits take effect before the list of
9088 agenda entries is built. Filters are more often used interactively,
9089 while limits are mostly useful when defined as local variables within
9090 custom agenda commands.
9092 **** Filtering in the agenda
9096 #+cindex: agenda filtering
9097 #+cindex: filtering entries, in agenda
9098 #+cindex: tag filtering, in agenda
9099 #+cindex: category filtering, in agenda
9100 #+cindex: top headline filtering, in agenda
9101 #+cindex: effort filtering, in agenda
9102 #+cindex: query editing, in agenda
9104 - {{{kbd(/)}}} (~org-agenda-filter-by-tag~) ::
9106 #+findex: org-agenda-filter-by-tag
9107 #+vindex: org-agenda-tag-filter-preset
9108 Filter the agenda view with respect to a tag and/or effort
9109 estimates. The difference between this and a custom agenda
9110 command is that filtering is very fast, so that you can switch
9111 quickly between different filters without having to recreate the
9114 You are prompted for a tag selection letter; {{{kbd(SPC)}}} means
9115 any tag at all. Pressing {{{kbd(TAB)}}} at that prompt offers
9116 completion to select a tag, including any tags that do not have
9117 a selection character. The command then hides all entries that
9118 do not contain or inherit this tag. When called with prefix
9119 argument, remove the entries that /do/ have the tag. A second
9120 {{{kbd(/)}}} at the prompt turns off the filter and shows any
9121 hidden entries. Pressing {{{kbd(+)}}} or {{{kbd(-)}}} switches
9122 between filtering and excluding the next tag.
9124 #+vindex: org-agenda-auto-exclude-function
9125 Org also supports automatic, context-aware tag filtering. If the
9126 variable ~org-agenda-auto-exclude-function~ is set to
9127 a user-defined function, that function can decide which tags
9128 should be excluded from the agenda automatically. Once this is
9129 set, the {{{kbd(/)}}} command then accepts {{{kbd(RET)}}} as
9130 a sub-option key and runs the auto exclusion logic. For example,
9131 let's say you use a =Net= tag to identify tasks which need
9132 network access, an =Errand= tag for errands in town, and a =Call=
9133 tag for making phone calls. You could auto-exclude these tags
9134 based on the availability of the Internet, and outside of
9135 business hours, with something like this:
9137 #+begin_src emacs-lisp
9138 (defun org-my-auto-exclude-function (tag)
9140 ((string= tag "Net")
9141 (/= 0 (call-process "/sbin/ping" nil nil nil
9142 "-c1" "-q" "-t1" "mail.gnu.org")))
9143 ((or (string= tag "Errand") (string= tag "Call"))
9144 (let ((hour (nth 2 (decode-time))))
9145 (or (< hour 8) (> hour 21)))))
9148 (setq org-agenda-auto-exclude-function 'org-my-auto-exclude-function)
9151 - {{{kbd(<)}}} (~org-agenda-filter-by-category~) ::
9153 #+findex: org-agenda-filter-by-category
9154 Filter the current agenda view with respect to the category of
9155 the item at point. Pressing {{{kbd(<)}}} another time removes
9156 this filter. When called with a prefix argument exclude the
9157 category of the item at point from the agenda.
9159 #+vindex: org-agenda-category-filter-preset
9160 You can add a filter preset in custom agenda commands through the
9161 option ~org-agenda-category-filter-preset~. See [[*Setting options
9162 for custom commands]].
9164 - {{{kbd(^)}}} (~org-agenda-filter-by-top-headline~) ::
9166 #+findex: org-agenda-filter-by-top-headline
9167 Filter the current agenda view and only display the siblings and
9168 the parent headline of the one at point.
9170 - {{{kbd(=)}}} (~org-agenda-filter-by-regexp~) ::
9172 #+findex: org-agenda-filter-by-regexp
9173 Filter the agenda view by a regular expression: only show agenda
9174 entries matching the regular expression the user entered. When
9175 called with a prefix argument, it filters /out/ entries matching
9176 the regexp. With two universal prefix arguments, it removes all
9177 the regexp filters, which can be accumulated.
9179 #+vindex: org-agenda-regexp-filter-preset
9180 You can add a filter preset in custom agenda commands through the
9181 option ~org-agenda-regexp-filter-preset~. See [[*Setting options
9182 for custom commands]].
9184 - {{{kbd(_)}}} (~org-agenda-filter-by-effort~) ::
9186 #+findex: org-agenda-filter-by-effort
9187 Filter the agenda view with respect to effort estimates. You
9188 first need to set up allowed efforts globally, for example
9190 #+begin_src emacs-lisp
9191 (setq org-global-properties
9192 '(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00")))
9195 #+vindex: org-sort-agenda-noeffort-is-high
9196 You can then filter for an effort by first typing an operator,
9197 one of {{{kbd(<)}}}, {{{kbd(>)}}} and {{{kbd(=)}}}, and then the
9198 one-digit index of an effort estimate in your array of allowed
9199 values, where {{{kbd(0)}}} means the 10th value. The filter then
9200 restricts to entries with effort smaller-or-equal, equal, or
9201 larger-or-equal than the selected value. For application of the
9202 operator, entries without a defined effort are treated according
9203 to the value of ~org-sort-agenda-noeffort-is-high~.
9205 When called with a prefix argument, it removes entries matching
9206 the condition. With two universal prefix arguments, it clears
9207 effort filters, which can be accumulated.
9209 #+vindex: org-agenda-effort-filter-preset
9210 You can add a filter preset in custom agenda commands through the
9211 option ~org-agenda-effort-filter-preset~. See [[*Setting options
9212 for custom commands]].
9214 - {{{kbd(|)}}} (~org-agenda-filter-remove-all~) ::
9216 Remove all filters in the current agenda view.
9218 **** Setting limits for the agenda
9222 #+cindex: limits, in agenda
9224 Here is a list of options that you can set, either globally, or
9225 locally in your custom agenda views (see [[*Custom agenda views]]).
9227 - ~org-agenda-max-entries~ ::
9229 #+vindex: org-agenda-max-entries
9230 Limit the number of entries.
9232 - ~org-agenda-max-effort~ ::
9234 #+vindex: org-agenda-max-effort
9235 Limit the duration of accumulated efforts (as minutes).
9237 - ~org-agenda-max-todos~ ::
9239 #+vindex: org-agenda-max-todos
9240 Limit the number of entries with TODO keywords.
9242 - ~org-agenda-max-tags~ ::
9244 #+vindex: org-agenda-max-tags
9245 Limit the number of tagged entries.
9247 When set to a positive integer, each option excludes entries from
9248 other categories: for example, ~(setq org-agenda-max-effort 100)~
9249 limits the agenda to 100 minutes of effort and exclude any entry that
9250 has no effort property. If you want to include entries with no effort
9251 property, use a negative value for ~org-agenda-max-effort~. One
9252 useful setup is to use ~org-agenda-max-entries~ locally in a custom
9253 command. For example, this custom command displays the next five
9254 entries with a =NEXT= TODO keyword.
9256 #+begin_src emacs-lisp
9257 (setq org-agenda-custom-commands
9259 ((org-agenda-max-entries 5)))))
9262 Once you mark one of these five entry as DONE, rebuilding the agenda
9263 will again the next five entries again, including the first entry that
9264 was excluded so far.
9266 You can also dynamically set temporary limits, which are lost when
9267 rebuilding the agenda:
9269 - {{{kbd(~ )}}} (~org-agenda-limit-interactively~) ::
9271 #+findex: org-agenda-limit-interactively
9272 This prompts for the type of limit to apply and its value.
9274 ** Commands in the agenda buffer
9276 :DESCRIPTION: Remote editing of Org trees.
9277 :ALT_TITLE: Agenda commands
9279 #+cindex: commands, in agenda buffer
9281 Entries in the agenda buffer are linked back to the Org file or diary
9282 file where they originate. You are not allowed to edit the agenda
9283 buffer itself, but commands are provided to show and jump to the
9284 original entry location, and to edit the Org files "remotely" from the
9285 agenda buffer. In this way, all information is stored only once,
9286 removing the risk that your agenda and note files may diverge.
9288 Some commands can be executed with mouse clicks on agenda lines. For
9289 the other commands, the cursor needs to be in the desired line.
9295 #+cindex: motion commands in agenda
9297 - {{{kbd(n)}}} (~org-agenda-next-line~) ::
9300 #+findex: org-agenda-next-line
9301 Next line (same as {{{kbd(down)}}} and {{{kbd(C-n)}}}).
9303 - {{{kbd(p)}}} (~org-agenda-previous-line~) ::
9306 #+findex: org-agenda-previous-line
9307 Previous line (same as {{{kbd(up)}}} and {{{kbd(C-p)}}}).
9309 *** View/Go to Org file
9313 #+cindex: view file commands in agenda
9315 - {{{kbd(SPC)}}} or {{{kbd(mouse-3)}}} (~org-agenda-show-and-scroll-up~) ::
9319 #+findex: org-agenda-show-and-scroll-up
9320 Display the original location of the item in another window.
9321 With a prefix argument, make sure that drawers stay folded.
9323 - {{{kbd(L)}}} (~org-agenda-recenter~) ::
9325 #+findex: org-agenda-recenter
9326 Display original location and recenter that window.
9328 - {{{kbd(TAB)}}} or {{{kbd(mouse-2)}}} (~org-agenda-goto~) ::
9332 #+findex: org-agenda-goto
9333 Go to the original location of the item in another window.
9335 - {{{kbd(RET)}}} (~org-agenda-switch-to~) ::
9338 #+findex: org-agenda-switch-to
9339 Go to the original location of the item and delete other windows.
9341 - {{{kbd(F)}}} (~org-agenda-follow-mode~) ::
9344 #+findex: org-agenda-follow-mode
9345 #+vindex: org-agenda-start-with-follow-mode
9346 Toggle Follow mode. In Follow mode, as you move the cursor
9347 through the agenda buffer, the other window always shows the
9348 corresponding location in the Org file. The initial setting for
9349 this mode in new agenda buffers can be set with the variable
9350 ~org-agenda-start-with-follow-mode~.
9352 - {{{kbd(C-c C-x b)}}} (~org-agenda-tree-to-indirect-buffer~) ::
9355 #+findex: org-agenda-tree-to-indirect-buffer
9356 Display the entire subtree of the current item in an indirect
9357 buffer. With a numeric prefix argument N, go up to level N and
9358 then take that tree. If N is negative, go up that many levels.
9359 With a {{{kbd(C-u)}}} prefix, do not remove the previously used
9362 - {{{kbd(C-c C-o)}}} (~org-agenda-open-link~) ::
9365 #+findex: org-agenda-open-link
9366 Follow a link in the entry. This offers a selection of any links
9367 in the text belonging to the referenced Org node. If there is
9368 only one link, follow it without a selection prompt.
9374 #+cindex: change agenda display
9375 #+cindex: display changing, in agenda
9377 #+attr_texinfo: :sep ,
9381 Interactively select another agenda view and append it to the
9387 Delete other windows.
9389 - {{{kbd(v d)}}} or short {{{kbd(d)}}} (~org-agenda-day-view~) ::
9393 #+findex: org-agenda-day-view
9394 Switch to day view. When switching to day view, this setting
9395 becomes the default for subsequent agenda refreshes. A numeric
9396 prefix argument may be used to jump directly to a specific day of
9397 the year. For example, {{{kbd(32 d)}}} jumps to February 1st.
9398 When setting day view, a year may be encoded in the prefix
9399 argument as well. For example, {{{kbd(200712 d)}}} jumps to
9400 January 12, 2007. If such a year specification has only one or
9401 two digits, it is expanded into one of the 30 next years or the
9404 - {{{kbd(v w)}}} or short {{{kbd(w)}}} (~org-agenda-week-view~) ::
9408 #+findex: org-agenda-week-view
9409 Switch to week view. When switching week view, this setting
9410 becomes the default for subsequent agenda refreshes. A numeric
9411 prefix argument may be used to jump directly to a specific day of
9412 the ISO week. For example {{{kbd(9 w)}}} to ISO week number 9.
9413 When setting week view, a year may be encoded in the prefix
9414 argument as well. For example, {{{kbd(200712 w)}}} jumps to week
9415 12 in 2007. If such a year specification has only one or two
9416 digits, it is expanded into one of the 30 next years or the last
9419 - {{{kbd(v m)}}} (~org-agenda-month-view~) ::
9422 #+findex: org-agenda-month-view
9423 Switch to month view. Because month views are slow to create,
9424 they do not become the default for subsequent agenda refreshes.
9425 A numeric prefix argument may be used to jump directly to
9426 a specific day of the month. When setting month view, a year may
9427 be encoded in the prefix argument as well. For example,
9428 {{{kbd(200712 m)}}} jumps to December, 2007. If such a year
9429 specification has only one or two digits, it is expanded into one
9430 of the 30 next years or the last 69 years.
9432 - {{{kbd(v y)}}} (~org-agenda-year-view~) ::
9435 #+findex: org-agenda-year-view
9436 Switch to year view. Because year views are slow to create, they
9437 do not become the default for subsequent agenda refreshes.
9438 A numeric prefix argument may be used to jump directly to
9439 a specific day of the year.
9441 - {{{kbd(v SPC)}}} (~org-agenda-reset-view~) ::
9444 #+findex: org-agenda-reset-view
9445 #+vindex: org-agenda-span
9446 Reset the current view to ~org-agenda-span~.
9448 - {{{kbd(f)}}} (~org-agenda-later~) ::
9451 #+findex: org-agenda-later
9452 Go forward in time to display the span following the current one.
9453 For example, if the display covers a week, switch to the
9454 following week. With a prefix argument, repeat that many times.
9456 - {{{kbd(b)}}} (~org-agenda-earlier~) ::
9459 #+findex: org-agenda-earlier
9460 Go backward in time to display earlier dates.
9462 - {{{kbd(.)}}} (~org-agenda-goto-today~) ::
9465 #+findex: org-agenda-goto-today
9468 - {{{kbd(j)}}} (~org-agenda-goto-date~) ::
9471 #+findex: org-agenda-goto-date
9472 Prompt for a date and go there.
9474 - {{{kbd(J)}}} (~org-agenda-clock-goto~) ::
9477 #+findex: org-agenda-clock-goto
9478 Go to the currently clocked-in task /in the agenda buffer/.
9480 - {{{kbd(D)}}} (~org-agenda-toggle-diary~) ::
9483 #+findex: org-agenda-toggle-diary
9484 Toggle the inclusion of diary entries. See [[*Weekly/daily agenda]].
9486 - {{{kbd(v l)}}} or {{{kbd(v L)}}} or short {{{kbd(l)}}} (~org-agenda-log-mode~) ::
9491 #+findex: org-agenda-log-mode
9492 #+vindex: org-log-done
9493 #+vindex: org-agenda-log-mode-items
9494 Toggle Logbook mode. In Logbook mode, entries that were marked
9495 DONE while logging was on (see the variable ~org-log-done~) are
9496 shown in the agenda, as are entries that have been clocked on
9497 that day. You can configure the entry types that should be
9498 included in log mode using the variable
9499 ~org-agenda-log-mode-items~. When called with a {{{kbd(C-u)}}}
9500 prefix, show all possible logbook entries, including state
9501 changes. When called with two prefix arguments {{{kbd(C-u
9502 C-u)}}}, show only logging information, nothing else. {{{kbd(v
9503 L)}}} is equivalent to {{{kbd(C-u v l)}}}.
9505 - {{{kbd(v [)}}} or short {{{kbd([)}}} (~org-agenda-manipulate-query-add~) ::
9509 #+findex: org-agenda-manipulate-query-add
9510 Include inactive timestamps into the current view. Only for
9511 weekly/daily agenda and timeline views.
9513 - {{{kbd(v a)}}} (~org-agenda-archives-mode~) ::
9516 #+findex: org-agenda-archives-mode
9517 Toggle Archives mode. In Archives mode, trees that are archived
9518 (see [[*Internal archiving]]) are also scanned when producing the
9519 agenda. To exit archives mode, press {{{kbd(v a)}}} again.
9524 Toggle Archives mode. Include all archive files as well.
9526 - {{{kbd(v R)}}} or short {{{kbd(R)}}} (~org-agenda-clockreport-mode~) ::
9530 #+findex: org-agenda-clockreport-mode
9531 #+vindex: org-agenda-start-with-clockreport-mode
9532 #+vindex: org-clock-report-include-clocking-task
9533 Toggle Clockreport mode. In Clockreport mode, the daily/weekly
9534 agenda always shows a table with the clocked times for the time
9535 span and file scope covered by the current agenda view. The
9536 initial setting for this mode in new agenda buffers can be set
9537 with the variable ~org-agenda-start-with-clockreport-mode~. By
9538 using a prefix argument when toggling this mode (i.e., {{{kbd(C-u
9539 R)}}}), the clock table does not show contributions from entries
9540 that are hidden by agenda filtering[fn:95]. See also the
9541 variable ~org-clock-report-include-clocking-task~.
9546 #+vindex: org-agenda-clock-consistency-checks
9547 Show overlapping clock entries, clocking gaps, and other clocking
9548 problems in the current agenda range. You can then visit
9549 clocking lines and fix them manually. See the variable
9550 ~org-agenda-clock-consistency-checks~ for information on how to
9551 customize the definition of what constituted a clocking problem.
9552 To return to normal agenda display, press {{{kbd(l)}}} to exit
9555 - {{{kbd(v E)}}} or short {{{kbd(E)}}} (~org-agenda-entry-text-mode~) ::
9559 #+findex: org-agenda-entry-text-mode
9560 #+vindex: org-agenda-start-with-entry-text-mode
9561 #+vindex: org-agenda-entry-text-maxlines
9562 Toggle entry text mode. In entry text mode, a number of lines
9563 from the Org outline node referenced by an agenda line are
9564 displayed below the line. The maximum number of lines is given
9565 by the variable ~org-agenda-entry-text-maxlines~. Calling this
9566 command with a numeric prefix argument temporarily modifies that
9567 number to the prefix value.
9569 - {{{kbd(G)}}} (~org-agenda-toggle-time-grid~) ::
9572 #+vindex: org-agenda-use-time-grid
9573 #+vindex: org-agenda-time-grid
9574 Toggle the time grid on and off. See also the variables
9575 ~org-agenda-use-time-grid~ and ~org-agenda-time-grid~.
9577 - {{{kbd(r)}}} (~org-agenda-redo~), {{{kbd(g)}}} ::
9581 #+findex: org-agenda-redo
9582 Recreate the agenda buffer, for example to reflect the changes
9583 after modification of the timestamps of items with
9584 {{{kbd(S-left)}}} and {{{kbd(S-right)}}}. When the
9585 buffer is the global TODO list, a prefix argument is interpreted
9586 to create a selective list for a specific TODO keyword.
9588 - {{{kbd(C-x C-s)}}} or short {{{kbd(s)}}} (~org-save-all-org-buffers~) ::
9591 #+findex: org-save-all-org-buffers
9593 Save all Org buffers in the current Emacs session, and also the
9596 - {{{kbd(C-c C-x C-c)}}} (~org-agenda-columns~) ::
9598 #+kindex: C-c C-x C-c
9599 #+findex: org-agenda-columns
9600 #+vindex: org-columns-default-format
9601 Invoke column view (see [[*Column view]]) in the agenda buffer. The
9602 column view format is taken from the entry at point, or, if there
9603 is no entry at point, from the first entry in the agenda view.
9604 So whatever the format for that entry would be in the original
9605 buffer (taken from a property, from a =COLUMNS= keyword, or from
9606 the default variable ~org-columns-default-format~) is used in the
9609 - {{{kbd(C-c C-x >)}}} (~org-agenda-remove-restriction-lock~) ::
9612 #+findex: org-agenda-remove-restriction-lock
9613 Remove the restriction lock on the agenda, if it is currently
9614 restricted to a file or subtree (see [[*Agenda files]]).
9616 - {{{kbd(M-up)}}} (~org-agenda-drag-line-backward~) ::
9619 #+findex: org-agenda-drag-line-backward
9620 Drag the line at point backward one line. With a numeric prefix
9621 argument, drag backward by that many lines.
9623 Moving agenda lines does not persist after an agenda refresh and
9624 does not modify the contributing Org files.
9626 - {{{kbd(M-down)}}} (~org-agenda-drag-line-forward~) ::
9629 #+findex: org-agenda-drag-line-forward
9630 Drag the line at point forward one line. With a numeric prefix
9631 argument, drag forward by that many lines.
9637 #+cindex: remote editing, from agenda
9639 - {{{kbd(0--9)}}} ::
9643 - {{{kbd(C-_)}}} (~org-agenda-undo~) ::
9646 #+findex: org-agenda-undo
9647 #+cindex: undoing remote-editing events
9648 #+cindex: remote editing, undo
9649 Undo a change due to a remote editing command. The change is
9650 undone both in the agenda buffer and in the remote buffer.
9652 - {{{kbd(t)}}} (~org-agenda-todo~) ::
9655 #+findex: org-agenda-todo
9656 Change the TODO state of the item, both in the agenda and in the
9659 - {{{kbd(C-S-right)}}} (~org-agenda-todo-nextset~) ::
9662 #+findex: org-agenda-todo-nextset
9663 Switch to the next set of TODO keywords.
9665 - {{{kbd(C-S-left)}}}, ~org-agenda-todo-previousset~ ::
9668 Switch to the previous set of TODO keywords.
9670 - {{{kbd(C-k)}}} (~org-agenda-kill~) ::
9673 #+findex: org-agenda-kill
9674 #+vindex: org-agenda-confirm-kill
9675 Delete the current agenda item along with the entire subtree
9676 belonging to it in the original Org file. If the text to be
9677 deleted remotely is longer than one line, the kill needs to be
9678 confirmed by the user. See variable ~org-agenda-confirm-kill~.
9680 - {{{kbd(C-c C-w)}}} (~org-agenda-refile~) ::
9683 #+findex: org-agenda-refile
9684 Refile the entry at point.
9686 - {{{kbd(C-c C-x C-a)}}} or short {{{kbd(a)}}} (~org-agenda-archive-default-with-confirmation~) ::
9688 #+kindex: C-c C-x C-a
9690 #+findex: org-agenda-archive-default-with-confirmation
9691 #+vindex: org-archive-default-command
9692 Archive the subtree corresponding to the entry at point using the
9693 default archiving command set in ~org-archive-default-command~.
9694 When using the {{{kbd(a)}}} key, confirmation is required.
9696 - {{{kbd(C-c C-x a)}}} (~org-agenda-toggle-archive-tag~) ::
9699 #+findex: org-agenda-toggle-archive-tag
9700 Toggle the archive tag (see [[*Internal archiving]]) for the current
9703 - {{{kbd(C-c C-x A)}}} (~org-agenda-archive-to-archive-sibling~) ::
9706 #+findex: org-agenda-archive-to-archive-sibling
9707 Move the subtree corresponding to the current entry to its
9710 - {{{kbd(C-c C-x C-s)}}} or short {{{kbd($)}}} (~org-agenda-archive~) ::
9712 #+kindex: C-c C-x C-s
9714 #+findex: org-agenda-archive
9715 Archive the subtree corresponding to the current headline. This
9716 means the entry is moved to the configured archive location, most
9717 likely a different file.
9719 - {{{kbd(T)}}} (~org-agenda-show-tags~) ::
9722 #+findex: org-agenda-show-tags
9723 #+vindex: org-agenda-show-inherited-tags
9724 Show all tags associated with the current item. This is useful
9725 if you have turned off ~org-agenda-show-inherited-tags~, but
9726 still want to see all tags of a headline occasionally.
9728 - {{{kbd(:)}}} (~org-agenda-set-tags~) ::
9731 #+findex: org-agenda-set-tags
9732 Set tags for the current headline. If there is an active region
9733 in the agenda, change a tag for all headings in the region.
9735 - {{{kbd(\,)}}} (~org-agenda-priority~) ::
9738 #+findex: org-agenda-priority
9739 Set the priority for the current item. Org mode prompts for the
9740 priority character. If you reply with {{{kbd(SPC)}}}, the
9741 priority cookie is removed from the entry.
9743 - {{{kbd(P)}}} (~org-agenda-show-priority~) ::
9746 #+findex: org-agenda-show-priority
9747 Display weighted priority of current item.
9749 - {{{kbd(+)}}} or {{{kbd(S-up)}}} (~org-agenda-priority-up~) ::
9753 #+findex: org-agenda-priority-up
9754 Increase the priority of the current item. The priority is
9755 changed in the original buffer, but the agenda is not resorted.
9756 Use the {{{kbd(r)}}} key for this.
9758 - {{{kbd(-)}}} or {{{kbd(S-down)}}} (~org-agenda-priority-down~) ::
9762 #+findex: orga-agenda-priority-down
9763 Decrease the priority of the current item.
9765 - {{{kbd(C-c C-z)}}} or short {{{kbd(z)}}} (~org-agenda-add-note~) ::
9769 #+findex: org-agenda-add-note
9770 #+vindex: org-log-into-drawer
9771 Add a note to the entry. This note is recorded, and then filed
9772 to the same location where state change notes are put. Depending
9773 on ~org-log-into-drawer~, this may be inside a drawer.
9775 - {{{kbd(C-c C-a)}}} (~org-attach~) ::
9778 #+findex: org-attach
9779 Dispatcher for all command related to attachments.
9781 - {{{kbd(C-c C-s)}}} (~org-agenda-schedule~) ::
9784 #+findex: org-agenda-schedule
9785 Schedule this item. With a prefix argument, remove the
9786 scheduling timestamp
9788 - {{{kbd(C-c C-d)}}} (~org-agenda-deadline~) ::
9791 #+findex: org-agenda-deadline
9792 Set a deadline for this item. With a prefix argument, remove the
9795 - {{{kbd(S-right)}}} (~org-agenda-do-date-later~) ::
9798 #+findex: org-agenda-do-date-later
9799 Change the timestamp associated with the current line by one day
9800 into the future. If the date is in the past, the first call to
9801 this command moves it to today. With a numeric prefix argument,
9802 change it by that many days. For example, {{{kbd(3
9803 6 5 S-right)}}} changes it by a year. With a {{{kbd(C-u)}}}
9804 prefix, change the time by one hour. If you immediately repeat
9805 the command, it will continue to change hours even without the
9806 prefix argument. With a double {{{kbd(C-u C-u)}}} prefix, do the
9807 same for changing minutes. The stamp is changed in the original
9808 Org file, but the change is not directly reflected in the agenda
9809 buffer. Use {{{kbd(r)}}} or {{{kbd(g)}}} to update the buffer.
9811 - {{{kbd(S-left)}}} (~org-agenda-do-date-earlier~) ::
9814 #+findex: org-agenda-do-date-earlier
9815 Change the timestamp associated with the current line by one day
9818 - {{{kbd(>)}}} (~org-agenda-date-prompt~) ::
9821 #+findex: org-agenda-date-prompt
9822 Change the timestamp associated with the current line. The key
9823 {{{kbd(>)}}} has been chosen, because it is the same as
9824 {{{kbd(S-.)}}} on my keyboard.
9826 - {{{kbd(I)}}} (~org-agenda-clock-in~) ::
9829 #+findex: org-agenda-clock-in
9830 Start the clock on the current item. If a clock is running
9831 already, it is stopped first.
9833 - {{{kbd(O)}}} (~org-agenda-clock-out~) ::
9836 #+findex: org-agenda-clock-out
9837 Stop the previously started clock.
9839 - {{{kbd(X)}}} (~org-agenda-clock-cancel~) ::
9842 #+findex: org-agenda-clock-cancel
9843 Cancel the currently running clock.
9845 - {{{kbd(J)}}} (~org-agenda-clock-goto~) ::
9848 #+findex: org-agenda-clock-goto
9849 Jump to the running clock in another window.
9851 - {{{kbd(k)}}} (~org-agenda-capture~) ::
9854 #+findex: org-agenda-capture
9855 #+cindex: capturing, from agenda
9856 #+vindex: org-capture-use-agenda-date
9857 Like ~org-capture~, but use the date at point as the default date
9858 for the capture template. See ~org-capture-use-agenda-date~ to
9859 make this the default behavior of ~org-capture~.
9861 *** Bulk remote editing selected entries
9865 #+cindex: remote editing, bulk, from agenda
9866 #+vindex: org-agenda-bulk-custom-functions
9868 - {{{kbd(m)}}} (~org-agenda-bulk-mark~) ::
9870 #+findex: org-agenda-bulk-mark
9872 Mark the entry at point for bulk action. If there is an active
9873 region in the agenda, mark the entries in the region. With
9874 numeric prefix argument, mark that many successive entries.
9876 - {{{kbd(*)}}} (~org-agenda-bulk-mark-all~) ::
9878 #+findex: org-agenda-bulk-mark-all
9880 Mark all visible agenda entries for bulk action.
9882 - {{{kbd(u)}}} (~org-agenda-bulk-unmark~) ::
9884 #+findex: org-agenda-bulk-unmark
9886 Unmark entry for bulk action.
9888 - {{{kbd(U)}}} (~org-agenda-bulk-remove-all-marks~) ::
9890 #+findex: org-agenda-bulk-remove-all-marks
9892 Unmark all marked entries for bulk action.
9894 - {{{kbd(M-m)}}} (~org-agenda-bulk-toggle~) ::
9896 #+findex: org-agenda-bulk-toggle
9898 Toggle mark of the entry at point for bulk action.
9900 - {{{kbd(M-*)}}} (~org-agenda-bulk-toggle-all~) ::
9902 #+findex: org-agenda-bulk-toggle-all
9904 Mark entries matching a regular expression for bulk action.
9906 - {{{kbd(%)}}} (~org-agenda-bulk-mark-regexp~) ::
9908 #+findex: org-agenda-bulk-mark-regexp
9910 Mark entries matching a regular expression for bulk action.
9912 - {{{kbd(B)}}} (~org-agenda-bulk-action~) ::
9914 #+findex: org-agenda-bulk-action
9915 #+vindex: org-agenda-bulk-persistent-marks
9917 Bulk action: act on all marked entries in the agenda. This
9918 prompts for another key to select the action to be applied. The
9919 prefix argument to {{{kbd(B)}}} is passed through to the
9920 {{{kbd(s)}}} and {{{kbd(d)}}} commands, to bulk-remove these
9921 special timestamps. By default, marks are removed after the
9922 bulk. If you want them to persist, set
9923 ~org-agenda-bulk-persistent-marks~ to ~t~ or hit {{{kbd(p)}}} at
9928 Toggle persistent marks.
9932 Archive all selected entries.
9936 Archive entries by moving them to their respective archive
9941 Change TODO state. This prompts for a single TODO keyword and
9942 changes the state of all selected entries, bypassing blocking
9943 and suppressing logging notes -- but not timestamps.
9947 Add a tag to all selected entries.
9951 Remove a tag from all selected entries.
9955 Schedule all items to a new date. To shift existing schedule
9956 dates by a fixed number of days, use something starting with
9957 double plus at the prompt, for example =++8d= or =++2w=.
9961 Set deadline to a specific date.
9965 Prompt for a single refile target and move all entries. The
9966 entries are no longer in the agenda; refresh ({{{kbd(g)}}}) to
9971 Reschedule randomly into the coming N days. N is prompted for.
9972 With a prefix argument ({{{kbd(C-u B S)}}}), scatter only
9977 #+vindex: org-agenda-bulk-custom-functions
9978 Apply a function[fn:96] to marked entries. For example, the
9979 function below sets the =CATEGORY= property of the entries to
9982 #+begin_src emacs-lisp
9983 (defun set-category ()
9985 (let ((marker (or (org-get-at-bol 'org-hd-marker)
9986 (org-agenda-error))))
9987 (org-with-point-at marker
9988 (org-back-to-heading t)
9989 (org-set-property "CATEGORY" "web"))))
9992 *** Calendar commands
9996 #+cindex: calendar commands, from agenda
9998 - {{{kbd(c)}}} (~org-agenda-goto-calendar~) ::
10001 #+findex: org-agenda-goto-calendar
10002 Open the Emacs calendar and move to the date at the agenda
10005 - {{{kbd(c)}}} (~org-calendar-goto-agenda~) ::
10008 #+findex: org-calendar-goto-agenda
10009 When in the calendar, compute and show the Org agenda for the
10010 date at the cursor.
10012 - {{{kbd(i)}}} (~org-agenda-diary-entry~) ::
10014 #+findex: org-agenda-diary-entry
10016 #+cindex: diary entries, creating from agenda
10017 Insert a new entry into the diary, using the date at the cursor
10018 and (for block entries) the date at the mark. This adds to the
10019 Emacs diary file[fn:97], in a way similar to the {{{kbd(i)}}}
10020 command in the calendar. The diary file pops up in another
10021 window, where you can add the entry.
10023 #+vindex: org-agenda-diary-file
10024 If you configure ~org-agenda-diary-file~ to point to an Org file,
10025 Org creates entries in that file instead. Most entries are
10026 stored in a date-based outline tree that will later make it easy
10027 to archive appointments from previous months/years. The tree is
10028 built under an entry with a =DATE_TREE= property, or else with
10029 years as top-level entries. Emacs prompts you for the entry
10030 text -- if you specify it, the entry is created in
10031 ~org-agenda-diary-file~ without further interaction. If you
10032 directly press {{{kbd(RET)}}} at the prompt without typing text,
10033 the target file is shown in another window for you to finish the
10034 entry there. See also the {{{kbd(k r)}}} command.
10036 - {{{kbd(M)}}} (~org-agenda-phases-of-moon~) ::
10039 #+findex: org-agenda-phases-of-moon
10040 Show the phases of the moon for the three months around current
10043 - {{{kbd(S)}}} (~org-agenda-sunrise-sunset~) ::
10046 #+findex: org-agenda-sunrise-sunset
10047 Show sunrise and sunset times. The geographical location must be
10048 set with calendar variables, see the documentation for the Emacs
10051 - {{{kbd(C)}}} (~org-agenda-convert-date~) ::
10054 #+findex: org-agenda-convert-date
10055 Convert the date at cursor into many other cultural and historic
10058 - {{{kbd(H)}}} (~org-agenda-holidays~) ::
10061 #+findex: org-agenda-holidays
10062 Show holidays for three months around the cursor date.
10069 - {{{kbd(q)}}} (~org-agenda-quit~) ::
10071 #+findex: org-agenda-quit
10073 Quit agenda, remove the agenda buffer.
10075 - {{{kbd(x)}}} (~org-agenda-exit~) ::
10077 #+findex: org-agenda-exit
10079 #+cindex: agenda files, removing buffers
10080 Exit agenda, remove the agenda buffer and all buffers loaded by
10081 Emacs for the compilation of the agenda. Buffers created by the
10082 user to visit Org files are not removed.
10084 ** Custom agenda views
10086 :DESCRIPTION: Defining special searches and views.
10088 #+cindex: custom agenda views
10089 #+cindex: agenda views, custom
10091 Custom agenda commands serve two purposes: to store and quickly access
10092 frequently used TODO and tags searches, and to create special
10093 composite agenda buffers. Custom agenda commands are accessible
10094 through the dispatcher (see [[*The agenda dispatcher]]), just like the
10097 *** Storing searches
10099 :DESCRIPTION: Type once, use often.
10102 The first application of custom searches is the definition of keyboard
10103 shortcuts for frequently used searches, either creating an agenda
10104 buffer, or a sparse tree (the latter covering of course only the
10108 #+vindex: org-agenda-custom-commands
10109 #+cindex: agenda views, main example
10110 #+cindex: agenda, as an agenda views
10111 #+cindex: agenda*, as an agenda views
10112 #+cindex: tags, as an agenda view
10113 #+cindex: todo, as an agenda view
10114 #+cindex: tags-todo
10115 #+cindex: todo-tree
10116 #+cindex: occur-tree
10117 #+cindex: tags-tree
10118 Custom commands are configured in the variable
10119 ~org-agenda-custom-commands~. You can customize this variable, for
10120 example by pressing {{{kbd(C-c a C)}}}. You can also directly set it
10121 with Emacs Lisp in the Emacs init file. The following example
10122 contains all valid agenda views:
10124 #+begin_src emacs-lisp
10125 (setq org-agenda-custom-commands
10128 ("w" todo "WAITING")
10129 ("W" todo-tree "WAITING")
10130 ("u" tags "+boss-urgent")
10131 ("v" tags-todo "+boss-urgent")
10132 ("U" tags-tree "+boss-urgent")
10133 ("f" occur-tree "\\<FIXME\\>")
10134 ("h" . "HOME+Name tags searches") ;description for "h" prefix
10135 ("hl" tags "+home+Lisa")
10136 ("hp" tags "+home+Peter")
10137 ("hk" tags "+home+Kim")))
10140 #+texinfo: @noindent
10141 The initial string in each entry defines the keys you have to press
10142 after the dispatcher command {{{kbd(C-c a)}}} in order to access the
10143 command. Usually this will be just a single character, but if you
10144 have many similar commands, you can also define two-letter
10145 combinations where the first character is the same in several
10146 combinations and serves as a prefix key[fn:98]. The second parameter
10147 is the search type, followed by the string or regular expression to be
10148 used for the matching. The example above will therefore define:
10150 - {{{kbd(C-c a x)}}} ::
10152 as a global search for agenda entries planned[fn:99] this
10155 - {{{kbd(C-c a y)}}} ::
10157 as the same search, but only for entries with an hour
10158 specification like =[h]h:mm= -- think of them as appointments.
10160 - {{{kbd(C-c a w)}}} ::
10162 as a global search for TODO entries with =WAITING= as the TODO
10165 - {{{kbd(C-c a W)}}} ::
10167 as the same search, but only in the current buffer and displaying
10168 the results as a sparse tree.
10170 - {{{kbd(C-c a u)}}} ::
10172 as a global tags search for headlines tagged =boss= but not
10175 - {{{kbd(C-c a v)}}} ::
10177 The same search, but limiting it to headlines that are also TODO
10180 - {{{kbd(C-c a U)}}} ::
10182 as the same search, but only in the current buffer and displaying
10183 the result as a sparse tree.
10185 - {{{kbd(C-c a f)}}} ::
10187 to create a sparse tree (again, current buffer only) with all
10188 entries containing the word =FIXME=.
10190 - {{{kbd(C-c a h)}}} ::
10192 as a prefix command for a =HOME= tags search where you have to
10193 press an additional key ({{{kbd(l)}}}, {{{kbd(p)}}} or
10194 {{{kbd(k)}}}) to select a name (Lisa, Peter, or Kim) as
10195 additional tag to match.
10197 Note that ~*-tree~ agenda views need to be called from an Org buffer
10198 as they operate on the current buffer only.
10201 :DESCRIPTION: All the stuff you need in a single buffer.
10203 #+cindex: block agenda
10204 #+cindex: agenda, with block views
10206 Another possibility is the construction of agenda views that comprise
10207 the results of /several/ commands, each of which creates a block in
10208 the agenda buffer. The available commands include ~agenda~ for the
10209 daily or weekly agenda (as created with {{{kbd(C-c a a)}}}), ~alltodo~
10210 for the global TODO list (as constructed with {{{kbd(C-c a t)}}}), and
10211 the matching commands discussed above: ~todo~, ~tags~, and
10212 ~tags-todo~. Here are two examples:
10214 #+begin_src emacs-lisp
10215 (setq org-agenda-custom-commands
10216 '(("h" "Agenda and Home-related tasks"
10220 ("o" "Agenda and Office-related tasks"
10223 (tags "office")))))
10226 #+texinfo: @noindent
10227 This defines {{{kbd(C-c a h)}}} to create a multi-block view for stuff
10228 you need to attend to at home. The resulting agenda buffer contains
10229 your agenda for the current week, all TODO items that carry the tag
10230 =home=, and also all lines tagged with =garden=. Finally the command
10231 {{{kbd(C-c a o)}}} provides a similar view for office tasks.
10233 *** Setting options for custom commands
10235 :DESCRIPTION: Changing the rules.
10236 :ALT_TITLE: Setting options
10238 #+cindex: options, for custom agenda views
10240 #+vindex: org-agenda-custom-commands
10241 Org mode contains a number of variables regulating agenda construction
10242 and display. The global variables define the behavior for all agenda
10243 commands, including the custom commands. However, if you want to
10244 change some settings just for a single custom view, you can do so.
10245 Setting options requires inserting a list of variable names and values
10246 at the right spot in ~org-agenda-custom-commands~. For example:
10248 #+begin_src emacs-lisp
10249 (setq org-agenda-custom-commands
10250 '(("w" todo "WAITING"
10251 ((org-agenda-sorting-strategy '(priority-down))
10252 (org-agenda-prefix-format " Mixed: ")))
10253 ("U" tags-tree "+boss-urgent"
10254 ((org-show-context-detail 'minimal)))
10256 ((org-agenda-files '("~org/notes.org"))
10257 (org-agenda-text-search-extra-files nil)))))
10260 #+texinfo: @noindent
10261 Now the {{{kbd(C-c a w)}}} command sorts the collected entries only by
10262 priority, and the prefix format is modified to just say =Mixed:=
10263 instead of giving the category of the entry. The sparse tags tree of
10264 {{{kbd(C-c a U)}}} now turns out ultra-compact, because neither the
10265 headline hierarchy above the match, nor the headline following the
10266 match are shown. The command {{{kbd(C-c a N)}}} does a text search
10267 limited to only a single file.
10269 For command sets creating a block agenda, ~org-agenda-custom-commands~
10270 has two separate spots for setting options. You can add options that
10271 should be valid for just a single command in the set, and options that
10272 should be valid for all commands in the set. The former are just
10273 added to the command entry; the latter must come after the list of
10274 command entries. Going back to the block agenda example (see [[*Block
10275 agenda]]), let's change the sorting strategy for the {{{kbd(C-c a h)}}}
10276 commands to ~priority-down~, but let's sort the results for GARDEN
10277 tags query in the opposite order, ~priority-up~. This would look like
10280 #+begin_src emacs-lisp
10281 (setq org-agenda-custom-commands
10282 '(("h" "Agenda and Home-related tasks"
10286 ((org-agenda-sorting-strategy '(priority-up)))))
10287 ((org-agenda-sorting-strategy '(priority-down))))
10288 ("o" "Agenda and Office-related tasks"
10291 (tags "office")))))
10294 As you see, the values and parentheses setting is a little complex.
10295 When in doubt, use the customize interface to set this variable -- it
10296 fully supports its structure. Just one caveat: when setting options
10297 in this interface, the /values/ are just Lisp expressions. So if the
10298 value is a string, you need to add the double-quotes around the value
10301 #+vindex: org-agenda-custom-commands-contexts
10302 To control whether an agenda command should be accessible from
10303 a specific context, you can customize
10304 ~org-agenda-custom-commands-contexts~. Let's say for example that you
10305 have an agenda command {{{kbd(o)}}} displaying a view that you only
10306 need when reading emails. Then you would configure this option like
10309 #+begin_src emacs-lisp
10310 (setq org-agenda-custom-commands-contexts
10311 '(("o" (in-mode . "message-mode"))))
10314 You can also tell that the command key {{{kbd(o)}}} should refer to
10315 another command key {{{kbd(r)}}}. In that case, add this command key
10318 #+begin_src emacs-lisp
10319 (setq org-agenda-custom-commands-contexts
10320 '(("o" "r" (in-mode . "message-mode"))))
10323 See the docstring of the variable for more information.
10325 ** Exporting agenda views
10327 :DESCRIPTION: Writing a view to a file.
10329 #+cindex: agenda views, exporting
10331 If you are away from your computer, it can be very useful to have
10332 a printed version of some agenda views to carry around. Org mode can
10333 export custom agenda views as plain text, HTML[fn:100], Postscript,
10334 PDF[fn:101], and iCalendar files. If you want to do this only
10335 occasionally, use the following command:
10337 - {{{kbd(C-x C-w)}}} (~org-agenda-write~) ::
10339 #+findex: org-agenda-write
10340 #+cindex: exporting agenda views
10341 #+cindex: agenda views, exporting
10343 #+vindex: org-agenda-exporter-settings
10344 Write the agenda view to a file.
10346 If you need to export certain agenda views frequently, you can
10347 associate any custom agenda command with a list of output file
10348 names[fn:102]. Here is an example that first defines custom commands
10349 for the agenda and the global TODO list, together with a number of
10350 files to which to export them. Then we define two block agenda
10351 commands and specify file names for them as well. File names can be
10352 relative to the current working directory, or absolute.
10354 #+begin_src emacs-lisp
10355 (setq org-agenda-custom-commands
10356 '(("X" agenda "" nil ("agenda.html" "agenda.ps"))
10357 ("Y" alltodo "" nil ("todo.html" "todo.txt" "todo.ps"))
10358 ("h" "Agenda and Home-related tasks"
10363 ("~/views/home.html"))
10364 ("o" "Agenda and Office-related tasks"
10369 ("~/views/office.ps" "~/calendars/office.ics"))))
10372 The extension of the file name determines the type of export. If it
10373 is =.html=, Org mode uses the htmlize package to convert the buffer to
10374 HTML and save it to this file name. If the extension is =.ps=,
10375 ~ps-print-buffer-with-faces~ is used to produce Postscript output. If
10376 the extension is =.ics=, iCalendar export is run export over all files
10377 that were used to construct the agenda, and limit the export to
10378 entries listed in the agenda. Any other extension produces a plain
10381 The export files are /not/ created when you use one of those
10382 commands interactively because this might use too much overhead.
10383 Instead, there is a special command to produce /all/ specified
10386 #+attr_texinfo: :table-type table :indic @asis
10387 - {{{kbd(C-c a e)}}} (~org-store-agenda-views~) ::
10389 #+findex: org-store-agenda-views
10391 Export all agenda views that have export file names associated
10394 You can use the options section of the custom agenda commands to also
10395 set options for the export commands. For example:
10397 #+begin_src emacs-lisp
10398 (setq org-agenda-custom-commands
10400 ((ps-number-of-columns 2)
10401 (ps-landscape-mode t)
10402 (org-agenda-prefix-format " [ ] ")
10403 (org-agenda-with-colors nil)
10404 (org-agenda-remove-tags t))
10405 ("theagenda.ps"))))
10408 #+texinfo: @noindent
10409 #+vindex: org-agenda-exporter-settings
10410 This command sets two options for the Postscript exporter, to make it
10411 print in two columns in landscape format -- the resulting page can be
10412 cut in two and then used in a paper agenda. The remaining settings
10413 modify the agenda prefix to omit category and scheduling information,
10414 and instead include a checkbox to check off items. We also remove the
10415 tags to make the lines compact, and we do not want to use colors for
10416 the black-and-white printer. Settings specified in
10417 ~org-agenda-exporter-settings~ also apply, e.g.,
10419 #+begin_src emacs-lisp
10420 (setq org-agenda-exporter-settings
10421 '((ps-number-of-columns 2)
10422 (ps-landscape-mode t)
10423 (org-agenda-add-entry-text-maxlines 5)
10424 (htmlize-output-type 'css)))
10427 #+texinfo: @noindent
10428 but the settings in ~org-agenda-custom-commands~ take precedence.
10430 #+texinfo: @noindent
10431 From the command line you may also use:
10434 emacs -eval (org-batch-store-agenda-views) -kill
10437 #+texinfo: @noindent
10438 or, if you need to modify some parameters[fn:103]
10441 emacs -eval '(org-batch-store-agenda-views \
10442 org-agenda-span (quote month) \
10443 org-agenda-start-day "2007-11-01" \
10444 org-agenda-include-diary nil \
10445 org-agenda-files (quote ("~/org/project.org")))' \
10449 #+texinfo: @noindent
10450 which creates the agenda views restricted to the file
10451 =~/org/project.org=, without diary entries and with a 30-day extent.
10453 You can also extract agenda information in a way that allows further
10454 processing by other programs. See [[*Extracting agenda information]], for
10457 ** Using column view in the agenda
10459 :DESCRIPTION: Using column view for collected entries.
10460 :ALT_TITLE: Agenda column view
10462 #+cindex: column view, in agenda
10463 #+cindex: agenda, column view
10465 Column view (see [[*Column view]]) is normally used to view and edit
10466 properties embedded in the hierarchical structure of an Org file. It
10467 can be quite useful to use column view also from the agenda, where
10468 entries are collected by certain criteria.
10470 - {{{kbd(C-c C-x C-c)}}} (~org-agenda-columns~) ::
10471 #+kindex: C-c C-x C-c
10472 #+findex: org-agenda-columns
10474 Turn on column view in the agenda.
10476 To understand how to use this properly, it is important to realize
10477 that the entries in the agenda are no longer in their proper outline
10478 environment. This causes the following issues:
10481 #+vindex: org-columns-default-format
10482 #+vindex: org-overriding-columns-format
10483 Org needs to make a decision which columns format to use. Since
10484 the entries in the agenda are collected from different files, and
10485 different files may have different columns formats, this is
10486 a non-trivial problem. Org first checks if the variable
10487 ~org-agenda-overriding-columns-format~ is currently set, and if so,
10488 takes the format from there. Otherwise it takes the format
10489 associated with the first item in the agenda, or, if that item does
10490 not have a specific format (defined in a property, or in its file),
10491 it uses ~org-columns-default-format~.
10494 #+cindex: CLOCKSUM, special property
10495 If any of the columns has a summary type defined (see [[*Column
10496 attributes]]), turning on column view in the agenda visits all
10497 relevant agenda files and make sure that the computations of this
10498 property are up to date. This is also true for the special
10499 =CLOCKSUM= property. Org then sums the values displayed in the
10500 agenda. In the daily/weekly agenda, the sums cover a single day;
10501 in all other views they cover the entire block.
10503 It is important to realize that the agenda may show the same entry
10504 /twice/ -- for example as scheduled and as a deadline -- and it may
10505 show two entries from the same hierarchy (for example a /parent/
10506 and its /child/). In these cases, the summation in the agenda
10507 leads to incorrect results because some values count double.
10509 3. When the column view in the agenda shows the =CLOCKSUM= property,
10510 that is always the entire clocked time for this item. So even in
10511 the daily/weekly agenda, the clocksum listed in column view may
10512 originate from times outside the current view. This has the
10513 advantage that you can compare these values with a column listing
10514 the planned total effort for a task -- one of the major
10515 applications for column view in the agenda. If you want
10516 information about clocked time in the displayed period use clock
10517 table mode (press {{{kbd(R)}}} in the agenda).
10520 #+cindex: CLOCKSUM_T, special property
10521 When the column view in the agenda shows the =CLOCKSUM_T= property,
10522 that is always today's clocked time for this item. So even in the
10523 weekly agenda, the clocksum listed in column view only originates
10524 from today. This lets you compare the time you spent on a task for
10525 today, with the time already spent -- via =CLOCKSUM= -- and with
10526 the planned total effort for it.
10528 * Markup for rich export
10530 :DESCRIPTION: Prepare text for rich export.
10534 When exporting Org documents, the exporter tries to reflect the
10535 structure of the document as accurately as possible in the back-end.
10536 Since export targets like HTML and LaTeX allow much richer formatting,
10537 Org mode has rules on how to prepare text for rich export. This
10538 section summarizes the markup rules used in an Org mode buffer.
10542 :DESCRIPTION: The basic unit of text.
10544 #+cindex: paragraphs, markup rules
10546 Paragraphs are separated by at least one empty line. If you need to
10547 enforce a line break within a paragraph, use ~\\~ at the end of
10550 To preserve the line breaks, indentation and blank lines in a region,
10551 but otherwise use normal formatting, you can use this construct, which
10552 can also be used to format poetry.
10554 #+cindex: BEGIN_VERSE
10555 #+cindex: verse blocks
10558 Great clouds overhead
10559 Tiny black birds rise and fall
10566 When quoting a passage from another document, it is customary to
10567 format this as a paragraph that is indented on both the left and the
10568 right margin. You can include quotations in Org documents like this:
10570 #+cindex: BEGIN_QUOTE
10571 #+cindex: quote blocks
10574 Everything should be made as simple as possible,
10575 but not any simpler -- Albert Einstein
10579 If you would like to center some text, do it like this:
10581 #+cindex: BEGIN_CENTER
10582 #+cindex: center blocks
10585 Everything should be made as simple as possible, \\
10586 but not any simpler
10590 ** Emphasis and monospace
10592 :DESCRIPTION: Bold, italic, etc.
10594 #+cindex: underlined text, markup rules
10595 #+cindex: bold text, markup rules
10596 #+cindex: italic text, markup rules
10597 #+cindex: verbatim text, markup rules
10598 #+cindex: code text, markup rules
10599 #+cindex: strike-through text, markup rules
10601 You can make words =*bold*=, =/italic/=, =_underlined_=, ==verbatim==
10602 and =~code~=, and, if you must, =+strike-through+=. Text in the code
10603 and verbatim string is not processed for Org mode specific syntax; it
10604 is exported verbatim.
10606 #+vindex: org-fontify-emphasized-text
10607 To turn off fontification for marked up text, you can set
10608 ~org-fontify-emphasized-text~ to ~nil~. To narrow down the list of
10609 available markup syntax, you can customize ~org-emphasis-alist~.
10611 ** Horizontal rules
10613 :DESCRIPTION: Make a line.
10615 #+cindex: horizontal rules, markup rules
10617 A line consisting of only dashes, and at least 5 of them, is exported
10618 as a horizontal line.
10620 ** Images and tables
10622 :DESCRIPTION: Images, tables and caption mechanism.
10624 #+cindex: tables, markup rules
10625 #+cindex: CAPTION, keyword
10626 #+cindex: NAME, keyword
10628 Both the native Org mode tables (see [[*Tables]]) and tables formatted
10629 with the =table.el= package are exported properly. For Org mode
10630 tables, the lines before the first horizontal separator line become
10631 table header lines. You can use the following lines somewhere before
10632 the table to assign a caption and a label for cross references, and in
10633 the text you can refer to the object with =[[tab:basic-data]]= (see
10634 [[*Internal links]]):
10637 ,#+CAPTION: This is the caption for the next table (or link)
10638 ,#+NAME: tab:basic-data
10643 Optionally, the caption can take the form:
10645 : #+CAPTION[Caption for list of tables]: Caption for table.
10647 #+cindex: inlined images, markup rules
10648 Some back-ends allow you to directly include images into the exported
10649 document. Org does this, if a link to an image file does not have
10650 a description part, for example =[[./img/a.jpg]]=. If you wish to define
10651 a caption for the image and maybe a label for internal cross
10652 references, make sure that the link is on a line by itself and precede
10653 it with =CAPTION= and =NAME= keywords as follows:
10656 ,#+CAPTION: This is the caption for the next figure link (or table)
10657 ,#+NAME: fig:SED-HR4049
10661 #+texinfo: @noindent
10662 Such images can be displayed within the buffer. See [[*Handling links][the discussion of
10665 Even though images and tables are prominent examples of captioned
10666 structures, the same caption mechanism can apply to many others --
10667 e.g., LaTeX equations, source code blocks. Depending on the export
10668 back-end, those may or may not be handled.
10670 ** Literal examples
10672 :DESCRIPTION: Source code examples with special formatting.
10674 #+cindex: literal examples, markup
10675 #+cindex: code line references, markup
10677 You can include literal examples that should not be subjected to
10678 markup. Such examples are typeset in monospace, so this is well
10679 suited for source code and similar examples.
10681 #+cindex: BEGIN_EXAMPLE
10682 #+cindex: example block
10685 Some example from a text file.
10689 Note that such blocks may be /indented/ in order to align nicely with
10690 indented text and in particular with plain list structure (see
10691 [[*Plain lists]]). For simplicity when using small examples, you can
10692 also start the example lines with a colon followed by a space. There
10693 may also be additional whitespace before the colon:
10697 : Some example from a text file.
10700 #+cindex: formatting source code, markup rules
10701 #+vindex: org-latex-listings
10702 If the example is source code from a programming language, or any
10703 other text that can be marked up by Font Lock in Emacs, you can ask
10704 for the example to look like the fontified Emacs buffer[fn:104]. This
10705 is done with the code block, where you also need to specify the name
10706 of the major mode that should be used to fontify the example[fn:105],
10707 see [[*Structure templates]] for shortcuts to easily insert code blocks.
10709 #+cindex: BEGIN_SRC
10710 #+cindex: src block
10712 ,#+BEGIN_SRC emacs-lisp
10713 (defun org-xor (a b)
10719 Both in =example= and in =src= snippets, you can add a =-n= switch to
10720 the end of the =#+BEGIN= line, to get the lines of the example
10721 numbered. The =-n= takes an optional numeric argument specifying the
10722 starting line number of the block. If you use a =+n= switch, the
10723 numbering from the previous numbered snippet is continued in the
10724 current one. The =+n= switch can also take a numeric argument. This
10725 adds the value of the argument to the last line of the previous block
10726 to determine the starting line number.
10729 ,#+BEGIN_SRC emacs-lisp -n 20
10730 ;; This exports with line number 20.
10731 (message "This is line 21")
10734 ,#+BEGIN_SRC emacs-lisp +n 10
10735 ;; This is listed as line 31.
10736 (message "This is line 32")
10740 In literal examples, Org interprets strings like =(ref:name)= as
10741 labels, and use them as targets for special hyperlinks like
10742 =[[(name)]]= -- i.e., the reference name enclosed in single parenthesis.
10743 In HTML, hovering the mouse over such a link remote-highlights the
10744 corresponding code line, which is kind of cool.
10746 You can also add a =-r= switch which /removes/ the labels from the
10747 source code[fn:106]. With the =-n= switch, links to these references
10748 are labeled by the line numbers from the code listing. Otherwise
10749 links use the labels with no parentheses. Here is an example:
10751 #+begin_example -l "(dumb-reference:%s)"
10752 ,#+BEGIN_SRC emacs-lisp -n -r
10753 (save-excursion (ref:sc)
10754 (goto-char (point-min)) (ref:jump)
10756 In line [[(sc)]] we remember the current position. [[(jump)][Line (jump)]]
10757 jumps to point-min.
10760 #+cindex: indentation, in source blocks
10761 Finally, you can use =-i= to preserve the indentation of a specific
10762 code block (see [[*Editing source code]]).
10764 #+vindex: org-coderef-label-format
10765 If the syntax for the label format conflicts with the language syntax,
10766 use a =-l= switch to change the format, for example
10768 : #+BEGIN_SRC pascal -n -r -l "((%s))"
10770 #+texinfo: @noindent
10771 See also the variable ~org-coderef-label-format~.
10773 HTML export also allows examples to be published as text areas (see
10774 [[*Text areas in HTML export]]).
10776 Because the =#+BEGIN= ... =#+END= patterns need to be added so often,
10777 a shortcut is provided (see [[*Structure templates]]).
10779 - {{{kbd(C-c ')}}} (~org-edit-special~) ::
10782 #+findex: org-edit-special
10783 Edit the source code example at point in its native mode. This
10784 works by switching to a temporary buffer with the source code.
10785 You need to exit by pressing {{{kbd(C-c ')}}} again[fn:107]. The
10786 edited version then replaces the old version in the Org buffer.
10787 Fixed-width regions -- where each line starts with a colon
10788 followed by a space -- are edited using ~artist-mode~[fn:108] to
10789 allow creating ASCII drawings easily. Using this command in an
10790 empty line creates a new fixed-width region.
10792 - {{{kbd(C-c l)}}} (~org-store-link~) ::
10795 #+findex: org-store-link
10796 Calling ~org-store-link~ while editing a source code example in
10797 a temporary buffer created with {{{kbd(C-c ')}}} prompts for
10798 a label. Make sure that it is unique in the current buffer, and
10799 insert it with the proper formatting like =(ref:label)= at the
10800 end of the current line. Then the label is stored as a link
10801 =(label)=, for retrieval with {{{kbd(C-c C-l)}}}.
10805 :DESCRIPTION: Greek letters and other symbols.
10807 #+cindex: math symbols
10808 #+cindex: special symbols
10809 #+cindex: @TeX{} macros
10810 #+cindex: @LaTeX{} fragments, markup rules
10811 #+cindex: HTML entities
10812 #+cindex: @LaTeX{} entities
10814 You can use LaTeX-like syntax to insert special symbols -- named
10815 entities -- like =\alpha= to indicate the Greek letter, or =\to= to indicate
10816 an arrow. Completion for these symbols is available, just type =\=
10817 and maybe a few letters, and press {{{kbd(M-TAB)}}} to see possible
10818 completions. If you need such a symbol inside a word, terminate it
10819 with a pair of curly brackets. For example
10822 Pro tip: Given a circle \Gamma of diameter d, the length of its
10823 circumference is \pi{}d.
10826 #+findex: org-entities-help
10827 #+vindex: org-entities-user
10828 A large number of entities is provided, with names taken from both
10829 HTML and LaTeX; you can comfortably browse the complete list from
10830 a dedicated buffer using the command ~org-entities-help~. It is also
10831 possible to provide your own special symbols in the variable
10832 ~org-entities-user~.
10834 During export, these symbols are transformed into the native format of
10835 the exporter back-end. Strings like =\alpha= are exported as =α= in
10836 the HTML output, and as =\(\alpha\)= in the LaTeX output. Similarly, =\nbsp=
10837 becomes = = in HTML and =~= in LaTeX.
10839 #+cindex: escaping characters
10840 Entities may also be used as a way to escape markup in an Org
10841 document, e.g., =\under{}not underlined\under= exports as =_not underlined_=.
10843 #+cindex: special symbols, in-buffer display
10844 If you would like to see entities displayed as UTF-8 characters, use
10845 the following command[fn:109]:
10847 - {{{kbd(C-c C-x \)}}} (~org-toggle-pretty-entities~) ::
10848 #+kindex: C-c C-x \
10849 #+findex: org-toggle-pretty-entities
10851 Toggle display of entities as UTF-8 characters. This does not
10852 change the buffer content which remains plain ASCII, but it
10853 overlays the UTF-8 character for display purposes only.
10855 #+cindex: shy hyphen, special symbol
10856 #+cindex: dash, special symbol
10857 #+cindex: ellipsis, special symbol
10858 In addition to regular entities defined above, Org exports in
10859 a special way[fn:110] the following commonly used character
10860 combinations: =\-= is treated as a shy hyphen, =--= and =---= are
10861 converted into dashes, and =...= becomes a compact set of dots.
10863 ** Subscripts and superscripts
10865 :DESCRIPTION: Simple syntax for raising/lowering text.
10867 #+cindex: subscript
10868 #+cindex: superscript
10870 =^= and =_= are used to indicate super- and subscripts. To increase
10871 the readability of ASCII text, it is not necessary, but OK, to
10872 surround multi-character sub- and superscripts with curly braces. For
10876 The radius of the sun is R_sun = 6.96 x 10^8 m. On the other hand,
10877 the radius of Alpha Centauri is R_{Alpha Centauri} = 1.28 x R_{sun}.
10880 #+vindex: org-use-sub-superscripts
10881 If you write a text where the underscore is often used in a different
10882 context, Org's convention to always interpret these as subscripts can
10883 get in your way. Configure the variable ~org-use-sub-superscripts~ to
10884 change this convention. For example, when setting this variable to
10885 ~{}~, =a_b= is not interpreted as a subscript, but =a_{b}= is.
10887 - {{{kbd(C-c C-x \)}}} (~org-toggle-pretty-entities~~) ::
10888 #+kindex: C-c C-x \
10889 #+findex: org-toggle-pretty-entities
10891 In addition to showing entities as UTF-8 characters, this command
10892 also formats sub- and superscripts in a WYSIWYM way.
10896 :DESCRIPTION: LaTeX can be freely used inside Org documents.
10897 :ALT_TITLE: Embedded Latex
10899 #+cindex: @TeX{} interpretation
10900 #+cindex: @LaTeX{} interpretation
10902 Plain ASCII is normally sufficient for almost all note taking.
10903 Exceptions include scientific notes, which often require mathematical
10904 symbols and the occasional formula. LaTeX[fn:111] is widely used to
10905 typeset scientific documents. Org mode supports embedding LaTeX code
10906 into its files, because many academics are used to writing and reading
10907 LaTeX source code, and because it can be readily processed to produce
10908 pretty output for a number of export back-ends.
10910 *** LaTeX fragments
10912 :DESCRIPTION: Complex formulas made easy.
10914 #+cindex: @LaTeX{} fragments
10916 #+vindex: org-format-latex-header
10917 Org mode can contain LaTeX math fragments, and it supports ways to
10918 process these for several export back-ends. When exporting to LaTeX,
10919 the code is left as it is. When exporting to HTML, Org can use either
10920 [[http://www.mathjax.org][MathJax]] (see [[*Math formatting in HTML export]]) or transcode the math
10921 into images (see [[*Previewing LaTeX fragments]]).
10923 LaTeX fragments do not need any special marking at all. The following
10924 snippets are identified as LaTeX source code:
10926 - Environments of any kind[fn:112]. The only requirement is that the
10927 =\begin= statement appears on a new line, preceded by only
10930 - Text within the usual LaTeX math delimiters. To avoid conflicts
10931 with currency specifications, single =$= characters are only
10932 recognized as math delimiters if the enclosed text contains at most
10933 two line breaks, is directly attached to the =$= characters with no
10934 whitespace in between, and if the closing =$= is followed by
10935 whitespace, punctuation or a dash. For the other delimiters, there
10936 is no such restriction, so when in doubt, use =\(...\)= as inline
10939 #+texinfo: @noindent
10943 \begin{equation} % arbitrary environments,
10944 x=\sqrt{b} % even tables, figures
10945 \end{equation} % etc
10947 If $a^2=b$ and \( b=2 \), then the solution must be
10948 either $$ a=+\sqrt{2} $$ or \[ a=-\sqrt{2} \].
10951 #+vindex: org-export-with-latex
10952 LaTeX processing can be configured with the variable
10953 ~org-export-with-latex~. The default setting is ~t~ which means
10954 MathJax for HTML, and no processing for ASCII and LaTeX back-ends.
10955 You can also set this variable on a per-file basis using one of these
10958 | =#+OPTIONS: tex:t= | Do the right thing automatically (MathJax) |
10959 | =#+OPTIONS: tex:nil= | Do not process LaTeX fragments at all |
10960 | =#+OPTIONS: tex:verbatim= | Verbatim export, for jsMath or so |
10962 *** Previewing LaTeX fragments
10964 :DESCRIPTION: What will this snippet look like?
10966 #+cindex: @LaTeX{} fragments, preview
10968 #+vindex: org-preview-latex-default-process
10969 If you have a working LaTeX installation and =dvipng=, =dvisvgm= or
10970 =convert= installed[fn:113], LaTeX fragments can be processed to
10971 produce images of the typeset expressions to be used for inclusion
10972 while exporting to HTML (see [[*LaTeX fragments]]), or for inline
10973 previewing within Org mode.
10975 #+vindex: org-format-latex-options
10976 #+vindex: org-format-latex-header
10977 You can customize the variables ~org-format-latex-options~ and
10978 ~org-format-latex-header~ to influence some aspects of the preview.
10979 In particular, the ~:scale~ (and for HTML export, ~:html-scale~)
10980 property of the former can be used to adjust the size of the preview
10983 - {{{kbd(C-c C-x C-l)}}} (~org-toggle-latex-fragment~) ::
10984 #+kindex: C-c C-x C-l
10985 #+findex: org-toggle-latex-fragment
10987 Produce a preview image of the LaTeX fragment at point and
10988 overlay it over the source code. If there is no fragment at
10989 point, process all fragments in the current entry (between two
10990 headlines). When called with a prefix argument, process the
10991 entire subtree. When called with two prefix arguments, or when
10992 the cursor is before the first headline, process the entire
10995 #+vindex: org-startup-with-latex-preview
10996 You can turn on the previewing of all LaTeX fragments in a file with
10998 : #+STARTUP: latexpreview
11000 To disable it, simply use
11002 : #+STARTUP: nolatexpreview
11004 *** Using CDLaTeX to enter math
11006 :DESCRIPTION: Speed up entering of formulas.
11007 :ALT_TITLE: CDLaTeX mode
11009 #+cindex: CD@LaTeX{}
11011 CDLaTeX mode is a minor mode that is normally used in combination with
11012 a major LaTeX mode like AUCTeX in order to speed-up insertion of
11013 environments and math templates. Inside Org mode, you can make use of
11014 some of the features of CDLaTeX mode. You need to install
11015 =cdlatex.el= and =texmathp.el= (the latter comes also with AUCTeX)
11016 from [[http://www.astro.uva.nl/~dominik/Tools/cdlatex]]. Do not use
11017 CDLaTeX mode itself under Org mode, but use the light version
11018 ~org-cdlatex-mode~ that comes as part of Org mode. Turn it on for the
11019 current buffer with {{{kbd(M-x org-cdlatex-mode)}}}, or for all Org
11022 #+begin_src emacs-lisp
11023 (add-hook 'org-mode-hook 'turn-on-org-cdlatex)
11026 When this mode is enabled, the following features are present (for
11027 more details see the documentation of CDLaTeX mode):
11029 #+attr_texinfo: :sep ,
11030 - {{{kbd(C-c {)}}} ::
11033 Insert an environment template.
11035 - {{{kbd(TAB)}}} ::
11038 The {{{kbd(TAB)}}} expands the template if the cursor is inside
11039 a LaTeX fragment[fn:114]. For example, {{{kbd(TAB)}}} expands
11040 =fr= to =\frac{}{}= and position the cursor correctly inside the
11041 first brace. Another {{{kbd(TAB)}}} gets you into the second
11044 Even outside fragments, {{{kbd(TAB)}}} expands environment
11045 abbreviations at the beginning of a line. For example, if you
11046 write =equ= at the beginning of a line and press {{{kbd(TAB)}}},
11047 this abbreviation is expanded to an =equation= environment. To
11048 get a list of all abbreviations, type {{{kbd(M-x
11049 cdlatex-command-help)}}}.
11051 - {{{kbd(^)}}}, {{{kbd(_)}}} ::
11054 #+vindex: cdlatex-simplify-sub-super-scripts
11056 Pressing {{{kbd(_)}}} and {{{kbd(^)}}} inside a LaTeX fragment
11057 inserts these characters together with a pair of braces. If you
11058 use {{{kbd(TAB)}}} to move out of the braces, and if the braces
11059 surround only a single character or macro, they are removed again
11060 (depending on the variable ~cdlatex-simplify-sub-super-scripts~).
11065 Pressing the backquote followed by a character inserts math
11066 macros, also outside LaTeX fragments. If you wait more than 1.5
11067 seconds after the backquote, a help window pops up.
11072 Pressing the single-quote followed by another character modifies
11073 the symbol before point with an accent or a font. If you wait
11074 more than 1.5 seconds after the single-quote, a help window pops
11075 up. Character modification works only inside LaTeX fragments;
11076 outside the quote is normal.
11080 :DESCRIPTION: Sharing and publishing notes.
11082 #+cindex: exporting
11084 Sometimes, you may want to pretty print your notes, publish them on
11085 the web or even share them with people not using Org. In these cases,
11086 the Org export facilities can be used to convert your documents to
11087 a variety of other formats, while retaining as much structure (see
11088 [[*Document structure]]) and markup (see [[*Markup for rich export]]) as
11091 #+cindex: export back-end
11092 Libraries responsible for such translation are called back-ends. Org
11093 ships with the following ones
11095 - /ascii/ (ASCII format)
11096 - /beamer/ (LaTeX Beamer format)
11097 - /html/ (HTML format)
11098 - /icalendar/ (iCalendar format)
11099 - /latex/ (LaTeX format)
11100 - /md/ (Markdown format)
11101 - /odt/ (OpenDocument Text format)
11102 - /org/ (Org format)
11103 - /texinfo/ (Texinfo format)
11104 - /man/ (Man page format)
11106 #+texinfo: @noindent
11107 Org also uses additional libraries located in =contrib/= directory
11108 (see [[*Installation]]). Users can install additional export libraries
11109 for additional formats from the Emacs packaging system. For easy
11110 discovery, these packages have a common naming scheme: ~ox-NAME~,
11111 where {{{var(NAME)}}} is one of the formats. For example,
11112 ~ox-koma-letter~ /koma-letter/ back-end.
11114 #+vindex: org-export-backends
11115 Org loads back-ends for the following formats by default: ASCII, HTML,
11116 iCalendar, LaTeX and ODT. Org can load additional back-ends either of
11117 two ways: through the ~org-export-backends~ variable configuration;
11118 or, by requiring the library in the Emacs init file like this:
11120 #+begin_src emacs-lisp
11124 ** The export dispatcher
11126 :DESCRIPTION: The main interface.
11128 #+cindex: dispatcher, for export commands
11129 #+cindex: Export, dispatcher
11131 The export dispatcher is the main interface for Org's exports.
11132 A hierarchical menu presents the currently configured export formats.
11133 Options are shown as easy toggle switches on the same screen.
11135 #+vindex: org-export-dispatch-use-expert-ui
11136 Org also has a minimal prompt interface for the export dispatcher.
11137 When the variable ~org-export-dispatch-use-expert-ui~ is set to
11138 a non-~nil~ value, Org prompts in the minibuffer. To switch back to
11139 the hierarchical menu, press {{{kbd(?)}}}.
11141 - {{{kbd(C-c C-e)}}} (~org-export~) ::
11143 #+findex: org-export
11145 Invokes the export dispatcher interface. The options show
11146 default settings. The {{{kbd(C-u)}}} prefix argument preserves
11147 options from the previous export, including any sub-tree
11150 Org exports the entire buffer by default. If the Org buffer has an
11151 active region, then Org exports just that region.
11153 Within the dispatcher interface, the following key combinations can
11154 further alter what is exported, and how.
11156 - {{{kbd(C-a)}}} ::
11157 #+kindex: C-c C-e C-a
11159 Toggle asynchronous export. Asynchronous export uses an external
11160 Emacs process with a specially configured initialization file to
11161 complete the exporting process in the background thereby
11162 releasing the current interface. This is particularly useful
11163 when exporting long documents.
11165 Output from an asynchronous export is saved on the "the export
11166 stack". To view this stack, call the export dispatcher with
11167 a double {{{kbd(C-u)}}} prefix argument. If already in the
11168 export dispatcher menu, {{{kbd(&)}}} displays the stack.
11170 #+vindex: org-export-async-init-file
11171 To make the background export process the default, customize the
11172 variable, ~org-export-in-background~. Additionally, you can set
11173 the initialization file used by the background process with
11174 ~org-export-async-init-file~.
11176 #+vindex: org-export-in-background
11177 You can make asynchronous export the default by setting
11178 ~org-export-in-background~.
11180 - {{{kbd(C-b)}}} ::
11181 #+kindex: C-c C-e C-b
11183 Toggle body-only export. Useful for excluding headers and
11184 footers in the export. Affects only those back-end formats that
11185 have such sections -- like =<head>...</head>= in HTML.
11188 #+kindex: C-c C-e C-s
11190 Toggle sub-tree export. When turned on, Org exports only the
11191 sub-tree starting from the cursor position at the time the export
11192 dispatcher was invoked. Org uses the top heading of this
11193 sub-tree as the document's title. If the cursor is not on
11194 a heading, Org uses the nearest enclosing header. If the cursor
11195 is in the document preamble, Org signals an error and aborts
11198 #+vindex: org-export-initial-scope
11199 To make the sub-tree export the default, customize the variable
11200 ~org-export-initial-scope~.
11202 - {{{kbd(C-v)}}} ::
11203 #+kindex: C-c C-e C-v
11205 Toggle visible-only export. Useful for exporting only visible
11206 parts of an Org document by adjusting outline visibility
11211 :DESCRIPTION: Common export settings.
11213 #+cindex: options, for export
11214 #+cindex: Export, settings
11216 #+cindex: OPTIONS, keyword
11217 Export options can be set: globally with variables; for an individual
11218 file by making variables buffer-local with in-buffer settings (see
11219 [[*Summary of in-buffer settings]]), by setting individual keywords, or by
11220 specifying them in a compact form with the =OPTIONS= keyword; or for
11221 a tree by setting properties (see [[*Properties and columns]]). Options
11222 set at a specific level override options set at a more general level.
11224 #+cindex: SETUPFILE, keyword
11225 In-buffer settings may appear anywhere in the file, either directly or
11226 indirectly through a file included using =#+SETUPFILE: filename or
11227 URL= syntax. Option keyword sets tailored to a particular back-end
11228 can be inserted from the export dispatcher (see [[*The export
11229 dispatcher]]) using the =Insert template= command by pressing
11230 {{{kbd(#)}}}. To insert keywords individually, a good way to make
11231 sure the keyword is correct is to type =#+= and then to use
11232 {{{kbd(M-TAB)}}}[fn:16] for completion.
11234 The export keywords available for every back-end, and their equivalent
11235 global variables, include:
11239 #+cindex: AUTHOR, keyword
11240 #+vindex: user-full-name
11241 The document author (~user-full-name~).
11245 #+cindex: CREATOR, keyword
11246 #+vindex: org-expot-creator-string
11247 Entity responsible for output generation
11248 (~org-export-creator-string~).
11252 #+cindex: DATE, keyword
11253 #+vindex: org-export-date-timestamp-format
11254 A date or a time-stamp[fn:115].
11258 #+cindex: EMAIL, keyword
11259 #+vindex: user-mail-address
11260 The email address (~user-mail-address~).
11264 #+cindex: LANGUAGE, keyword
11265 #+vindex: org-export-default-language
11266 Language to use for translating certain strings
11267 (~org-export-default-language~). With =#+LANGUAGE: fr=, for
11268 example, Org translates =Table of contents= to the French =Table
11273 #+cindex: SELECT_TAGS, keyword
11274 #+vindex: org-export-select-tags
11275 The default value is ~("export")~. When a tree is tagged with
11276 =export= (~org-export-select-tags~), Org selects that tree and
11277 its sub-trees for export. Org excludes trees with =noexport=
11278 tags, see below. When selectively exporting files with =export=
11279 tags set, Org does not export any text that appears before the
11282 - =EXCLUDE_TAGS= ::
11284 #+cindex: EXCLUDE_TAGS, keyword
11285 #+vindex: org-export-exclude-tags
11286 The default value is ~("noexport")~. When a tree is tagged with
11287 =noexport= (~org-export-exclude-tags~), Org excludes that tree
11288 and its sub-trees from export. Entries tagged with =noexport=
11289 are unconditionally excluded from the export, even if they have
11290 an =export= tag. Even if a sub-tree is not exported, Org
11291 executes any code blocks contained there.
11295 #+cindex: TITLE, keyword
11296 #+cindex: document title
11297 Org displays this title. For long titles, use multiple =#+TITLE=
11300 - =EXPORT_FILE_NAME= ::
11302 #+cindex: EXPORT_FILE_NAME, keyword
11303 The name of the output file to be generated. Otherwise, Org
11304 generates the file name based on the buffer name and the
11305 extension based on the back-end format.
11307 The =OPTIONS= keyword is a compact form. To configure multiple
11308 options, use several =OPTIONS= lines. =OPTIONS= recognizes the
11309 following arguments.
11313 #+vindex: org-export-with-smart-quotes
11314 Toggle smart quotes (~org-export-with-smart-quotes~). Depending
11315 on the language used, when activated, Org treats pairs of double
11316 quotes as primary quotes, pairs of single quotes as secondary
11317 quotes, and single quote marks as apostrophes.
11321 #+vindex: org-export-with-emphasize
11322 Toggle emphasized text (~org-export-with-emphasize~).
11326 #+vindex: org-export-with-special-strings
11327 Toggle conversion of special strings
11328 (~org-export-with-special-strings~).
11332 #+vindex: org-export-with-fixed-width
11333 Toggle fixed-width sections (~org-export-with-fixed-width~).
11337 #+vindex: org-export-with-timestamps
11338 Toggle inclusion of time/date active/inactive stamps
11339 (~org-export-with-timestamps~).
11343 #+vindex: org-export-preserve-breaks
11344 Toggles whether to preserve line breaks
11345 (~org-export-preserve-breaks~).
11349 #+vindex: org-export-with-sub-superscripts
11350 Toggle TeX-like syntax for sub- and superscripts. If you write
11351 =^:{}=, =a_{b}= is interpreted, but the simple =a_b= is left as
11352 it is (~org-export-with-sub-superscripts~).
11356 #+vindex: org-export-with-archived-trees
11357 Configure how archived trees are exported. When set to
11358 ~headline~, the export process skips the contents and processes
11359 only the headlines (~org-export-with-archived-trees~).
11363 #+vindex: org-export-with-author
11364 Toggle inclusion of author name into exported file
11365 (~org-export-with-author~).
11367 - ~broken-links~ ::
11369 #+vindex: org-export-with-broken-links
11370 Toggles if Org should continue exporting upon finding a broken
11371 internal link. When set to ~mark~, Org clearly marks the problem
11372 link in the output (~org-export-with-broken-links~).
11376 #+vindex: org-export-with-clocks
11377 Toggle inclusion of CLOCK keywords (~org-export-with-clocks~).
11381 #+vindex: org-export-with-creator
11382 Toggle inclusion of creator information in the exported file
11383 (~org-export-with-creator~).
11387 #+vindex: org-export-with-drawers
11388 Toggles inclusion of drawers, or list of drawers to include, or
11389 list of drawers to exclude (~org-export-with-drawers~).
11393 #+vindex: org-export-with-date
11394 Toggle inclusion of a date into exported file
11395 (~org-export-with-date~).
11399 #+vindex: org-export-with-entities
11400 Toggle inclusion of entities (~org-export-with-entities~).
11404 #+vindex: org-export-with-email
11405 Toggle inclusion of the author's e-mail into exported file
11406 (~org-export-with-email~).
11410 #+vindex: org-export-with-footnotes
11411 Toggle the inclusion of footnotes (~org-export-with-footnotes~).
11415 #+vindex: org-export-headline-levels
11416 Set the number of headline levels for export
11417 (~org-export-headline-levels~). Below that level, headlines are
11418 treated differently. In most back-ends, they become list items.
11422 #+vindex: org-export-with-inlinetasks
11423 Toggle inclusion of inlinetasks (~org-export-with-inlinetasks~).
11427 #+vindex: org-export-with-section-numbers
11428 #+cindex: UNNUMBERED, property
11429 Toggle section-numbers (~org-export-with-section-numbers~). When
11430 set to number N, Org numbers only those headlines at level N or
11431 above. Set =UNNUMBERED= property to non-~nil~ to disable
11432 numbering of heading and subheadings entirely. Moreover, when
11433 the value is =notoc= the headline, and all its children, do not
11434 appear in the table of contents either (see [[*Table of contents]]).
11438 #+vindex: org-export-with-planning
11439 Toggle export of planning information
11440 (~org-export-with-planning~). "Planning information" comes from
11441 lines located right after the headline and contain any
11442 combination of these cookies: =SCHEDULED=, =DEADLINE=, or
11447 #+vindex: org-export-with-priority
11448 Toggle inclusion of priority cookies
11449 (~org-export-with-priority~).
11453 #+vindex: org-export-with-properties
11454 Toggle inclusion of property drawers, or list the properties to
11455 include (~org-export-with-properties~).
11459 #+vindex: org-export-with-statistics-cookies
11460 Toggle inclusion of statistics cookies
11461 (~org-export-with-statistics-cookies~).
11465 #+vindex: org-export-with-tags
11466 Toggle inclusion of tags, may also be ~not-in-toc~
11467 (~org-export-with-tags~).
11471 #+vindex: org-export-with-tasks
11472 Toggle inclusion of tasks (TODO items); or ~nil~ to remove all
11473 tasks; or ~todo~ to remove DONE tasks; or list the keywords to
11474 keep (~org-export-with-tasks~).
11478 #+vindex: org-export-with-latex
11479 ~nil~ does not export; ~t~ exports; ~verbatim~ keeps everything
11480 in verbatim (~org-export-with-latex~).
11484 #+vindex: org-export-time-stamp-file
11485 Toggle inclusion of the creation time in the exported file
11486 (~org-export-time-stamp-file~).
11490 #+vindex: org-export-with-title
11491 Toggle inclusion of title (~org-export-with-title~).
11495 #+vindex: org-export-with-toc
11496 Toggle inclusion of the table of contents, or set the level limit
11497 (~org-export-with-toc~).
11501 #+vindex: org-export-with-todo-keywords
11502 Toggle inclusion of TODO keywords into exported text
11503 (~org-export-with-todo-keywords~).
11507 #+vindex: org-export-with-tables
11508 Toggle inclusion of tables (~org-export-with-tables~).
11510 When exporting sub-trees, special node properties in them can override
11511 the above keywords. They are special because they have an =EXPORT_=
11512 prefix. For example, =DATE= and =EXPORT_FILE_NAME= keywords become,
11513 respectively, =EXPORT_DATE= and =EXPORT_FILE_NAME=. Except for
11514 =SETUPFILE=, all other keywords listed above have an =EXPORT_=
11517 #+cindex: BIND, keyword
11518 #+vindex: org-export-allow-bind-keywords
11519 If ~org-export-allow-bind-keywords~ is non-~nil~, Emacs variables can
11520 become buffer-local during export by using the =BIND= keyword. Its
11521 syntax is =#+BIND: variable value=. This is particularly useful for
11522 in-buffer settings that cannot be changed using keywords.
11524 ** Table of contents
11526 :DESCRIPTION: The if and where of the table of contents.
11528 #+cindex: table of contents
11529 #+cindex: list of tables
11530 #+cindex: list of listings
11532 #+cindex: @samp{toc}, in OPTIONS keyword
11533 #+vindex: org-export-with-toc
11534 The table of contents includes all headlines in the document. Its
11535 depth is therefore the same as the headline levels in the file. If
11536 you need to use a different depth, or turn it off entirely, set the
11537 ~org-export-with-toc~ variable accordingly. You can achieve the same
11538 on a per file basis, using the following =toc= item in =OPTIONS=
11542 ,#+OPTIONS: toc:2 (only include two levels in TOC)
11543 ,#+OPTIONS: toc:nil (no default TOC at all)
11546 #+cindex: excluding entries from table of contents
11547 #+cindex: table of contents, exclude entries
11548 Org includes both numbered and unnumbered headlines in the table of
11549 contents[fn:116]. If you need to exclude an unnumbered headline,
11550 along with all its children, set the =UNNUMBERED= property to =notoc=
11554 ,* Subtree not numbered, not in table of contents either
11560 #+cindex: TOC, keyword
11561 Org normally inserts the table of contents directly before the first
11562 headline of the file. To move the table of contents to a different
11563 location, first turn off the default with ~org-export-with-toc~
11564 variable or with =#+OPTIONS: toc:nil=. Then insert =#+TOC: headlines
11565 N= at the desired location(s).
11568 ,#+OPTIONS: toc:nil
11570 ,#+TOC: headlines 2
11573 To adjust the table of contents depth for a specific section of the
11574 Org document, append an additional =local= parameter. This parameter
11575 becomes a relative depth for the current level. The following example
11576 inserts a local table of contents, with direct children only.
11580 ,#+TOC: headlines 1 local
11583 Note that for this feature to work properly in LaTeX export, the Org
11584 file requires the inclusion of the titletoc package. Because of
11585 compatibility issues, titletoc has to be loaded /before/ hyperref.
11586 Customize the ~org-latex-default-packages-alist~ variable.
11588 Use the =TOC= keyword to generate list of tables -- respectively, all
11589 listings -- with captions.
11596 #+cindex: ALT_TITLE, property
11597 Normally Org uses the headline for its entry in the table of contents.
11598 But with =ALT_TITLE= property, a different entry can be specified for
11599 the table of contents.
11603 :DESCRIPTION: Include additional files into a document.
11605 #+cindex: include files, during export
11606 #+cindex: Export, include files
11607 #+cindex: INCLUDE, keyword
11609 During export, you can include the content of another file. For
11610 example, to include your =.emacs= file, you could use:
11612 : #+INCLUDE: "~/.emacs" src emacs-lisp
11614 #+texinfo: @noindent
11615 The optional second and third parameter are the markup (e.g., =quote=,
11616 =example=, or =src=), and, if the markup is =src=, the language for
11617 formatting the contents. The markup is optional; if it is not given,
11618 assume text is in Org syntax and process it normally. The =INCLUDE=
11619 keyword also allows additional parameters =:prefix1= and =:prefix= to
11620 specify prefixes for the first line and for each following line,
11621 =:minlevel= in order to get Org mode content demoted to a specified
11622 level, as well as any options accepted by the selected markup. For
11623 example, to include a file as an item, use:
11625 : #+INCLUDE: "~/snippets/xx" :prefix1 " + " :prefix " "
11627 You can also include a portion of a file by specifying a lines range
11628 using the =:lines= parameter. The line at the upper end of the range
11629 is not included. The start and/or the end of the range may be omitted
11630 to use the obvious defaults.
11632 - =#+INCLUDE: "~/.emacs" :lines "5-10"= ::
11634 Include lines 5 to 10, 10 excluded.
11636 - =#+INCLUDE: "~/.emacs" :lines "-10"= ::
11638 Include lines 1 to 10, 10 excluded.
11640 - =#+INCLUDE: "~/.emacs" :lines "10-"= ::
11642 Include lines from 10 to EOF.
11644 You can visit the file being included with the following command.
11646 - {{{kbd(C-c ')}}} (~org-edit~special~) ::
11648 #+findex: org-edit-special
11650 Visit the include file at point.
11652 ** Macro replacement
11654 :DESCRIPTION: Use macros to create templates.
11656 #+cindex: macro replacement, during export
11657 #+cindex: MACRO, keyword
11659 #+vindex: org-export-global-macros
11660 Macros replace text snippets during export. Macros are defined
11661 globally in ~org-export-global-macros~, or document-wise with the
11664 : #+MACRO: name replacement text; $1, $2 are arguments
11666 #+texinfo: @noindent
11667 which can be referenced using ={{{name(arg1, arg2)}}}=[fn:117]. For
11671 ,#+MACRO: poem The rose is $1, The violet's $2. Life's ordered: Org assists you.
11672 {{{poem(red,blue)}}}
11675 #+texinfo: @noindent
11678 : The rose is red, The violet's blue. Life's ordered: Org assists you.
11680 As a special case, Org parses any replacement text starting with
11681 =(eval= as an Emacs Lisp expression and evaluates it accordingly.
11682 Within such templates, arguments become strings. Thus, the following
11685 : #+MACRO: gnucheck (eval (concat "GNU/" (capitalize $1)))
11687 #+texinfo: @noindent
11688 turns ={{{gnucheck(linux)}}}= into =GNU/Linux= during export.
11690 Org recognizes macro references in following Org markup areas:
11691 paragraphs, headlines, verse blocks, tables cells and lists. Org also
11692 recognizes macro references in keywords, such as =CAPTION=, =TITLE=,
11693 =AUTHOR=, =DATE=, and for some back-end specific export options.
11695 Org comes with following pre-defined macros:
11697 #+attr_texinfo: :sep ;
11698 - ={{{keyword(NAME)}}}=; ={{{title}}}=; ={{{author}}}=; ={{{email}}}= ::
11700 #+cindex: keyword, macro
11701 #+cindex: title, macro
11702 #+cindex: author, macro
11703 #+cindex: email, macro
11704 The =keyword= macro collects all values from {{{var(NAME)}}}
11705 keywords throughout the buffer, separated with white space.
11706 =title=, =author= and =email= macros are shortcuts for,
11707 respectively, ={{{keyword(TITLE)}}}=, ={{{keyword(AUTHOR)}}}= and
11708 ={{{keyword(EMAIL)}}}=.
11710 - ={{{date}}}=; ={{{date(FORMAT)}}}= ::
11712 #+cindex: date, macro
11713 This macro refers to the =DATE= keyword. {{{var(FORMAT)}}} is an
11714 optional argument to the =date= macro that is used only if =DATE=
11715 is a single timestamp. {{{var(FORMAT)}}} should be a format
11716 string understood by ~format-time-string~.
11718 - ={{{time(FORMAT)}}}=; ={{{modification-time(FORMAT, VC)}}}= ::
11720 #+cindex: time, macro
11721 #+cindex: modification time, macro
11722 These macros refer to the document's date and time of export and
11723 date and time of modification. {{{var(FORMAT)}}} is a string
11724 understood by ~format-time-string~. If the second argument to
11725 the ~modification-time~ macro is non-~nil~, Org uses =vc.el= to
11726 retrieve the document's modification time from the version
11727 control system. Otherwise Org reads the file attributes.
11729 - ={{{input-file}}}= ::
11731 #+cindex: input file, macro
11732 This macro refers to the filename of the exported file.
11734 - ={{{property(PROPERTY-NAME)}}}=; ={{{property(PROPERTY-NAME, SEARCH OPTION)}}}= ::
11736 #+cindex: property, macro
11737 This macro returns the value of property {{{var(PROPERTY-NAME)}}}
11738 in the current entry. If {{{var(SEARCH-OPTION)}}} (see [[*Search
11739 options in file links]]) refers to a remote entry, use it instead.
11741 - ={{{n}}}=; ={{{n(NAME)}}}=; ={{{n(NAME, ACTION)}}}= ::
11744 #+cindex: counter, macro
11745 This macro implements custom counters by returning the number of
11746 times the macro has been expanded so far while exporting the
11747 buffer. You can create more than one counter using different
11748 {{{var(NAME)}}} values. If {{{var(ACTION)}}} is =-=, previous
11749 value of the counter is held, i.e., the specified counter is not
11750 incremented. If the value is a number, the specified counter is
11751 set to that value. If it is any other non-empty string, the
11752 specified counter is reset to 1. You may leave {{{var(NAME)}}}
11753 empty to reset the default counter.
11755 #+vindex: org-hide-macro-markers
11756 The surrounding brackets can be made invisible by setting
11757 ~org-hide-macro-markers~ non-~nil~.
11759 Org expands macros at the very beginning of the export process.
11763 :DESCRIPTION: What will not be exported.
11765 #+cindex: exporting, not
11767 #+cindex: comment lines
11768 Lines starting with zero or more whitespace characters followed by one
11769 =#= and a whitespace are treated as comments and, as such, are not
11772 #+cindex: BEGIN_COMMENT
11773 #+cindex: comment block
11774 Likewise, regions surrounded by =#+BEGIN_COMMENT= ... =#+END_COMMENT=
11777 #+cindex: comment trees
11778 Finally, a =COMMENT= keyword at the beginning of an entry, but after
11779 any other keyword or priority cookie, comments out the entire subtree.
11780 In this case, the subtree is not exported and no code block within it
11781 is executed either[fn:118]. The command below helps changing the
11782 comment status of a headline.
11784 - {{{kbd(C-c ;)}}} (~org-toggle-comment~) ::
11786 #+findex: org-toggle-comment
11788 Toggle the =COMMENT= keyword at the beginning of an entry.
11790 ** ASCII/Latin-1/UTF-8 export
11792 :DESCRIPTION: Exporting to flat files with encoding.
11794 #+cindex: ASCII export
11795 #+cindex: Latin-1 export
11796 #+cindex: UTF-8 export
11798 ASCII export produces an output file containing only plain ASCII
11799 characters. This is the simplest and most direct text output. It
11800 does not contain any Org markup. Latin-1 and UTF-8 export use
11801 additional characters and symbols available in these encoding
11802 standards. All three of these export formats offer the most basic of
11803 text output for maximum portability.
11805 #+vindex: org-ascii-text-width
11806 On export, Org fills and justifies text according to the text width
11807 set in ~org-ascii-text-width~.
11809 #+vindex: org-ascii-links-to-notes
11810 Org exports links using a footnote-like style where the descriptive
11811 part is in the text and the link is in a note before the next heading.
11812 See the variable ~org-ascii-links-to-notes~ for details.
11814 *** ASCII export commands
11819 #+attr_texinfo: :sep ,
11820 - {{{kbd(C-c C-e t a)}}} (~org-ascii-export-to-ascii~), {{{kbd(C-c C-e t l)}}}, {{{kbd(C-c C-e t u)}}} ::
11821 #+kindex: C-c C-e t a
11822 #+kindex: C-c C-e t l
11823 #+kindex: C-c C-e t u
11824 #+findex: org-ascii-export-to-ascii
11826 Export as an ASCII file with a =.txt= extension. For
11827 =myfile.org=, Org exports to =myfile.txt=, overwriting without
11828 warning. For =myfile.txt=, Org exports to =myfile.txt.txt= in
11829 order to prevent data loss.
11831 #+attr_texinfo: :sep ,
11832 - {{{kbd(C-c C-e t A)}}} (~org-ascii-export-to-ascii~), {{{kbd(C-c C-e t L)}}}, {{{kbd(C-c C-e t U)}}} ::
11833 #+kindex: C-c C-e t A
11834 #+kindex: C-c C-e t L
11835 #+kindex: C-c C-e t U
11836 #+findex: org-ascii-export-to-ascii
11838 Export to a temporary buffer. Does not create a file.
11840 *** ASCII specific export settings
11845 The ASCII export back-end has one extra keyword for customizing ASCII
11846 output. Setting this keyword works similar to the general options
11847 (see [[*Export settings]]).
11851 #+cindex: SUBTITLE, keyword
11852 The document subtitle. For long subtitles, use multiple
11853 =#+SUBTITLE= lines in the Org file. Org prints them on one
11854 continuous line, wrapping into multiple lines if necessary.
11856 *** Header and sectioning structure
11861 Org converts the first three outline levels into headlines for ASCII
11862 export. The remaining levels are turned into lists. To change this
11863 cut-off point where levels become lists, see [[*Export settings]].
11865 *** Quoting ASCII text
11870 To insert text within the Org file by the ASCII back-end, use one the
11871 following constructs, inline, keyword, or export block:
11873 #+cindex: ASCII, keyword
11874 #+cindex: BEGIN_EXPORT ascii
11876 Inline text @@ascii:and additional text@@ within a paragraph.
11878 ,#+ASCII: Some text
11880 ,#+BEGIN_EXPORT ascii
11881 Org exports text in this block only when using ASCII back-end.
11885 *** ASCII specific attributes
11889 #+cindex: ATTR_ASCII, keyword
11890 #+cindex: horizontal rules, in ASCII export
11892 ASCII back-end recognizes only one attribute, ~:width~, which
11893 specifies the width of an horizontal rule in number of characters.
11894 The keyword and syntax for specifying widths is:
11897 ,#+ATTR_ASCII: :width 10
11901 *** ASCII special blocks
11905 #+cindex: special blocks, in ASCII export
11906 #+cindex: BEGIN_JUSTIFYLEFT
11907 #+cindex: BEGIN_JUSTIFYRIGHT
11909 Besides =#+BEGIN_CENTER= blocks (see [[*Paragraphs]]), ASCII back-end has
11910 these two left and right justification blocks:
11913 ,#+BEGIN_JUSTIFYLEFT
11914 It's just a jump to the left...
11917 ,#+BEGIN_JUSTIFYRIGHT
11918 ...and then a step to the right.
11919 ,#+END_JUSTIFYRIGHT
11923 #+cindex: Beamer export
11925 Org uses Beamer export to convert an Org file tree structure into
11926 high-quality interactive slides for presentations. Beamer is a LaTeX
11927 document class for creating presentations in PDF, HTML, and other
11928 popular display formats.
11930 *** Beamer export commands
11932 :DESCRIPTION: For creating Beamer documents.
11935 - {{{kbd(C-c C-e l b)}}} (~org-beamer-export-to-latex~) ::
11936 #+kindex: C-c C-e l b
11937 #+findex: org-beamer-export-to-latex
11939 Export as LaTeX file with a =.tex= extension. For =myfile.org=,
11940 Org exports to =myfile.tex=, overwriting without warning.
11942 - {{{kbd(C-c C-e l B)}}} (~org-beamer-export-as-latex~) ::
11943 #+kindex: C-c C-e l B
11944 #+findex: org-beamer-export-as-latex
11946 Export to a temporary buffer. Does not create a file.
11948 - {{{kbd(C-c C-e l P)}}} (~org-beamer-export-to-pdf~) ::
11949 #+kindex: C-c C-e l P
11950 #+findex: org-beamer-export-to-pdf
11952 Export as LaTeX file and then convert it to PDF format.
11954 - {{{kbd(C-c C-e l O)}}} ::
11955 #+kindex: C-c C-e l O
11957 Export as LaTeX file, convert it to PDF format, and then open the
11960 *** Beamer specific export settings
11962 :DESCRIPTION: For customizing Beamer export.
11965 Beamer export back-end has several additional keywords for customizing
11966 Beamer output. These keywords work similar to the general options
11967 settings (see [[*Export settings]]).
11969 - =BEAMER_THEME= ::
11971 #+cindex: BEAMER_THEME, keyword
11972 #+vindex: org-beamer-theme
11973 The Beamer layout theme (~org-beamer-theme~). Use square
11974 brackets for options. For example:
11976 : #+BEAMER_THEME: Rochester [height=20pt]
11978 - =BEAMER_FONT_THEME= ::
11980 #+cindex: BEAMER_FONT_THEME, keyword
11981 The Beamer font theme.
11983 - =BEAMER_INNER_THEME= ::
11985 #+cindex: BEAMER_INNER_THEME, keyword
11986 The Beamer inner theme.
11988 - =BEAMER_OUTER_THEME= ::
11990 #+cindex: BEAMER_OUTER_THEME, keyword
11991 The Beamer outer theme.
11993 - =BEAMER_HEADER= ::
11995 #+cindex: BEAMER_HEADER, keyword
11996 Arbitrary lines inserted in the preamble, just before the
11997 =hyperref= settings.
12001 #+cindex: DESCRIPTION, keyword
12002 The document description. For long descriptions, use multiple
12003 =DESCRIPTION= keywords. By default, =hyperref= inserts
12004 =DESCRIPTION= as metadata. Use ~org-latex-hyperref-template~ to
12005 configure document metadata. Use ~org-latex-title-command~ to
12006 configure typesetting of description as part of front matter.
12010 #+cindex: KEYWORDS, keyword
12011 The keywords for defining the contents of the document. Use
12012 multiple =KEYWORDS= lines if necessary. By default, =hyperref=
12013 inserts =KEYWORDS= as metadata. Use
12014 ~org-latex-hyperref-template~ to configure document metadata.
12015 Use ~org-latex-title-command~ to configure typesetting of
12016 keywords as part of front matter.
12020 #+cindex: SUBTITLE, keyword
12021 Document's subtitle. For typesetting, use
12022 ~org-beamer-subtitle-format~ string. Use
12023 ~org-latex-hyperref-template~ to configure document metadata.
12024 Use ~org-latex-title-command~ to configure typesetting of
12025 subtitle as part of front matter.
12027 *** Frames and Blocks in Beamer
12029 :DESCRIPTION: For composing Beamer slides.
12032 Org transforms heading levels into Beamer's sectioning elements,
12033 frames and blocks. Any Org tree with a not-too-deep-level nesting
12034 should in principle be exportable as a Beamer presentation.
12037 #+vindex: org-beamer-frame-level
12038 Org headlines become Beamer frames when the heading level in Org is
12039 equal to ~org-beamer-frame-level~ or =H= value in a =OPTIONS= line
12040 (see [[*Export settings]]).
12042 #+cindex: BEAMER_ENV, property
12043 Org overrides headlines to frames conversion for the current tree of
12044 an Org file if it encounters the =BEAMER_ENV= property set to
12045 =frame= or =fullframe=. Org ignores whatever
12046 ~org-beamer-frame-level~ happens to be for that headline level in
12047 the Org tree. In Beamer terminology, a full frame is a frame
12050 - Org exports a Beamer frame's objects as block environments. Org can
12051 enforce wrapping in special block types when =BEAMER_ENV= property
12052 is set[fn:119]. For valid values see
12053 ~org-beamer-environments-default~. To add more values, see
12054 ~org-beamer-environments-extra~.
12055 #+vindex: org-beamer-environments-default
12056 #+vindex: org-beamer-environments-extra
12059 #+cindex: BEAMER_REF, property
12060 If =BEAMER_ENV= is set to =appendix=, Org exports the entry as an
12061 appendix. When set to =note=, Org exports the entry as a note
12062 within the frame or between frames, depending on the entry's heading
12063 level. When set to =noteNH=, Org exports the entry as a note
12064 without its title. When set to =againframe=, Org exports the entry
12065 with =\againframe= command, which makes setting the =BEAMER_REF=
12066 property mandatory because =\againframe= needs frame to resume.
12068 When =ignoreheading= is set, Org export ignores the entry's headline
12069 but not its content. This is useful for inserting content between
12070 frames. It is also useful for properly closing a =column=
12071 environment. @end itemize
12073 #+cindex: BEAMER_ACT, property
12074 #+cindex: BEAMER_OPT, property
12075 When =BEAMER_ACT= is set for a headline, Org export translates that
12076 headline as an overlay or action specification. When enclosed in
12077 square brackets, Org export makes the overlay specification
12078 a default. Use =BEAMER_OPT= to set any options applicable to the
12079 current Beamer frame or block. The Beamer export back-end wraps
12080 with appropriate angular or square brackets. It also adds the
12081 =fragile= option for any code that may require a verbatim block.
12083 #+cindex: BEAMER_COL, property
12084 To create a column on the Beamer slide, use the =BEAMER_COL=
12085 property for its headline in the Org file. Set the value of
12086 =BEAMER_COL= to a decimal number representing the fraction of the
12087 total text width. Beamer export uses this value to set the column's
12088 width and fills the column with the contents of the Org entry. If
12089 the Org entry has no specific environment defined, Beamer export
12090 ignores the heading. If the Org entry has a defined environment,
12091 Beamer export uses the heading as title. Behind the scenes, Beamer
12092 export automatically handles LaTeX column separations for contiguous
12093 headlines. To manually adjust them for any unique configurations
12094 needs, use the =BEAMER_ENV= property.
12096 *** Beamer specific syntax
12098 :DESCRIPTION: For using in Org documents.
12101 Since Org's Beamer export back-end is an extension of the LaTeX
12102 back-end, it recognizes other LaTeX specific syntax -- for example,
12103 =#+LATEX:= or =#+ATTR_LATEX:=. See [[*LaTeX export]], for details.
12105 Beamer export wraps the table of contents generated with =toc:t=
12106 =OPTION= keyword in a =frame= environment. Beamer export does not
12107 wrap the table of contents generated with =TOC= keyword (see [[*Table of
12108 contents]]). Use square brackets for specifying options.
12110 : #+TOC: headlines [currentsection]
12112 Insert Beamer-specific code using the following constructs:
12114 #+cindex: BEAMER, keyword
12115 #+cindex: BEGIN_EXPORT beamer
12119 ,#+BEGIN_EXPORT beamer
12120 Only Beamer export back-end exports this.
12123 Text @@beamer:some code@@ within a paragraph.
12126 Inline constructs, such as the last one above, are useful for adding
12127 overlay specifications to objects with ~bold~, ~item~, ~link~,
12128 ~radio-target~ and ~target~ types. Enclose the value in angular
12129 brackets and place the specification at the beginning of the object as
12130 shown in this example:
12132 : A *@@beamer:<2->@@useful* feature
12134 #+cindex: ATTR_BEAMER, keyword
12135 Beamer export recognizes the =ATTR_BEAMER= keyword with the following
12136 attributes from Beamer configurations: =:environment= for changing
12137 local Beamer environment, =:overlay= for specifying Beamer overlays in
12138 angular or square brackets, and =:options= for inserting optional
12142 ,#+ATTR_BEAMER: :environment nonindentlist
12143 - item 1, not indented
12144 - item 2, not indented
12145 - item 3, not indented
12149 ,#+ATTR_BEAMER: :overlay <+->
12155 ,#+ATTR_BEAMER: :options [Lagrange]
12156 Let $G$ be a finite group, and let $H$ be
12157 a subgroup of $G$. Then the order of $H$ divides the order of $G$.
12160 *** Editing support
12162 :DESCRIPTION: Editing support.
12165 The ~org-beamer-mode~ is a special minor mode for faster editing of
12168 : #+STARTUP: beamer
12170 - {{{kbd(C-c C-b)}}} (~org-beamer-select-environment~) ::
12172 #+findex: org-beamer-select-environment
12174 The ~org-beamer-mode~ provides this key for quicker selections in
12175 Beamer normal environments, and for selecting the =BEAMER_COL=
12178 *** A Beamer example
12180 :DESCRIPTION: A complete presentation.
12183 Here is an example of an Org document ready for Beamer export.
12186 ;#+TITLE: Example Presentation
12187 ;#+AUTHOR: Carsten Dominik
12188 ;#+OPTIONS: H:2 toc:t num:t
12189 ;#+LATEX_CLASS: beamer
12190 ;#+LATEX_CLASS_OPTIONS: [presentation]
12191 ;#+BEAMER_THEME: Madrid
12192 ;#+COLUMNS: %45ITEM %10BEAMER_ENV(Env) %10BEAMER_ACT(Act) %4BEAMER_COL(Col) %8BEAMER_OPT(Opt)
12194 ,* This is the first structural section
12197 ,*** Thanks to Eric Fraga :B_block:
12202 for the first viable Beamer setup in Org
12203 ,*** Thanks to everyone else :B_block:
12209 for contributing to the discussion
12210 ,**** This will be formatted as a beamer note :B_note:
12214 ,** Frame 2 (where we will not use columns)
12216 Please test this stuff!
12221 :DESCRIPTION: Exporting to HTML.
12223 #+cindex: HTML export
12225 Org mode contains an HTML exporter with extensive HTML formatting
12226 compatible with XHTML 1.0 strict standard.
12228 *** HTML export commands
12230 :DESCRIPTION: Invoking HTML export.
12233 - {{{kbd(C-c C-e h h)}}} (~org-html-export-to-html~) ::
12234 #+kindex: C-c C-e h h
12235 #+kindex: C-c C-e h o
12236 #+findex: org-html-export-to-html
12238 Export as HTML file with a =.html= extension. For =myfile.org=,
12239 Org exports to =myfile.html=, overwriting without warning.
12240 {{{kbd{C-c C-e h o)}}} exports to HTML and opens it in a web
12243 - {{{kbd(C-c C-e h H)}}} (~org-html-export-as-html~) ::
12244 #+kindex: C-c C-e h H
12245 #+findex: org-html-export-as-html
12247 Exports to a temporary buffer. Does not create a file.
12249 *** HTML specific export settings
12251 :DESCRIPTION: Settings for HTML export.
12254 HTML export has a number of keywords, similar to the general options
12255 settings described in [[*Export settings]].
12259 #+cindex: DESCRIPTION, keyword
12260 This is the document's description, which the HTML exporter
12261 inserts it as a HTML meta tag in the HTML file. For long
12262 descriptions, use multiple =DESCRIPTION= lines. The exporter
12263 takes care of wrapping the lines properly.
12265 - =HTML_DOCTYPE= ::
12267 #+cindex: HTML_DOCTYPE, keyword
12268 #+vindex: org-html-doctype
12269 Specify the document type, for example: HTML5
12270 (~org-html-doctype~).
12272 - =HTML_CONTAINER= ::
12274 #+cindex: HTML_CONTAINER, keyword
12275 #+vindex: org-html-container-element
12276 Specify the HTML container, such as =div=, for wrapping sections
12277 and elements (~org-html-container-element~).
12279 - =HTML_LINK_HOME= ::
12281 #+cindex: HTML_LINK_HOME, keyword
12282 #+vindex: org-html-link-home
12283 The URL for home link (~org-html-link-home~).
12285 - =HTML_LINK_UP= ::
12287 #+cindex: HTML_LINK_UP, keyword
12288 #+vindex: org-html-link-up
12289 The URL for the up link of exported HTML pages
12290 (~org-html-link-up~).
12292 - =HTML_MATHJAX= ::
12294 #+cindex: HTML_MATHJAX, keyword
12295 #+vindex: org-html-mathjax-options
12296 Options for MathJax (~org-html-mathjax-options~). MathJax is
12297 used to typeset LaTeX math in HTML documents. See [[*Math
12298 formatting in HTML export]], for an example.
12302 #+cindex: HTML_HEAD, keyword
12303 #+vindex: org-html-head
12304 Arbitrary lines for appending to the HTML document's head
12307 - =HTML_HEAD_EXTRA= ::
12309 #+cindex: HTML_HEAD_EXTRA, keyword
12310 #+vindex: org-html-head-extra
12311 More arbitrary lines for appending to the HTML document's head
12312 (~org-html-head-extra~).
12316 #+cindex: KEYWORDS, keyword
12317 Keywords to describe the document's content. HTML exporter
12318 inserts these keywords as HTML meta tags. For long keywords, use
12319 multiple =KEYWORDS= lines.
12321 - =LATEX_HEADER= ::
12323 #+cindex: LATEX_HEADER, keyword
12324 Arbitrary lines for appending to the preamble; HTML exporter
12325 appends when transcoding LaTeX fragments to images (see [[*Math
12326 formatting in HTML export]]).
12330 #+cindex: SUBTITLE, keyword
12331 The document's subtitle. HTML exporter formats subtitle if
12332 document type is =HTML5= and the CSS has a =subtitle= class.
12334 Some of these keywords are explained in more detail in the following
12335 sections of the manual.
12339 :DESCRIPTION: Exporting various (X)HTML flavors.
12342 Org can export to various (X)HTML flavors.
12344 #+vindex: org-html-doctype
12345 #+vindex: org-html-doctype-alist
12346 Set the ~org-html-doctype~ variable for different (X)HTML variants.
12347 Depending on the variant, the HTML exporter adjusts the syntax of HTML
12348 conversion accordingly. Org includes the following ready-made
12352 - ~"html4-transitional"~
12353 - ~"html4-frameset"~
12355 - ~"xhtml-transitional"~
12356 - ~"xhtml-frameset"~
12361 #+texinfo: @noindent
12362 See the variable ~org-html-doctype-alist~ for details. The default is
12365 #+vindex: org-html-html5-fancy
12366 #+cindex: HTML5, export new elements
12367 Org's HTML exporter does not by default enable new block elements
12368 introduced with the HTML5 standard. To enable them, set
12369 ~org-html-html5-fancy~ to non-~nil~. Or use an =OPTIONS= line in the
12370 file to set =html5-fancy=.
12372 HTML5 documents can now have arbitrary =#+BEGIN= ... =#+END= blocks.
12381 #+texinfo: @noindent
12390 #+texinfo: @noindent
12394 ,#+ATTR_HTML: :controls controls :width 350
12396 ,#+HTML: <source src="movie.mp4" type="video/mp4">
12397 ,#+HTML: <source src="movie.ogg" type="video/ogg">
12398 Your browser does not support the video tag.
12402 #+texinfo: @noindent
12406 <video controls="controls" width="350">
12407 <source src="movie.mp4" type="video/mp4">
12408 <source src="movie.ogg" type="video/ogg">
12409 <p>Your browser does not support the video tag.</p>
12413 #+vindex: org-html-html5-elements
12414 When special blocks do not have a corresponding HTML5 element, the
12415 HTML exporter reverts to standard translation (see
12416 ~org-html-html5-elements~). For example, =#+BEGIN_lederhosen= exports
12417 to ~<div class="lederhosen">~.
12419 Special blocks cannot have headlines. For the HTML exporter to wrap
12420 the headline and its contents in ~<section>~ or ~<article>~ tags, set
12421 the =HTML_CONTAINER= property for the headline.
12423 *** HTML preamble and postamble
12425 :DESCRIPTION: Inserting preamble and postamble.
12427 #+vindex: org-html-preamble
12428 #+vindex: org-html-postamble
12429 #+vindex: org-html-preamble-format
12430 #+vindex: org-html-postamble-format
12431 #+vindex: org-html-validation-link
12432 #+vindex: org-export-creator-string
12433 #+vindex: org-export-time-stamp-file
12435 The HTML exporter has delineations for preamble and postamble. The
12436 default value for ~org-html-preamble~ is ~t~, which makes the HTML
12437 exporter insert the preamble. See the variable
12438 ~org-html-preamble-format~ for the format string.
12440 Set ~org-html-preamble~ to a string to override the default format
12441 string. If the string is a function, the HTML exporter expects the
12442 function to return a string upon execution. The HTML exporter inserts
12443 this string in the preamble. The HTML exporter does not insert
12444 a preamble if ~org-html-preamble~ is set ~nil~.
12446 The default value for ~org-html-postamble~ is ~auto~, which makes the
12447 HTML exporter build a postamble from looking up author's name, email
12448 address, creator's name, and date. Set ~org-html-postamble~ to ~t~ to
12449 insert the postamble in the format specified in the
12450 ~org-html-postamble-format~ variable. The HTML exporter does not
12451 insert a postamble if ~org-html-postamble~ is set to ~nil~.
12453 *** Quoting HTML tags
12455 :DESCRIPTION: Using direct HTML in Org files.
12458 The HTML export back-end transforms =<= and =>= to =<= and =>=.
12460 To include raw HTML code in the Org file so the HTML export back-end
12461 can insert that HTML code in the output, use this inline syntax:
12462 =@@html:...@@=. For example:
12464 : @@html:<b>@@bold text@@html:</b>@@
12466 #+cindex: HTML, keyword
12467 #+cindex: BEGIN_EXPORT html
12468 For larger raw HTML code blocks, use these HTML export code blocks:
12471 ,#+HTML: Literal HTML code for export
12473 ,#+BEGIN_EXPORT html
12474 All lines between these markers are exported literally
12478 *** Links in HTML export
12480 :DESCRIPTION: Inserting and formatting links.
12482 #+cindex: links, in HTML export
12483 #+cindex: internal links, in HTML export
12484 #+cindex: external links, in HTML export
12486 The HTML export back-end transforms Org's internal links (see
12487 [[*Internal links]]) to equivalent HTML links in the output. The back-end
12488 similarly handles Org's automatic links created by radio targets (see
12489 [[*Radio targets]]) similarly. For Org links to external files, the
12490 back-end transforms the links to /relative/ paths.
12492 #+vindex: org-html-link-org-files-as-html
12493 For Org links to other =.org= files, the back-end automatically
12494 changes the file extension to =.html= and makes file paths relative.
12495 If the =.org= files have an equivalent =.html= version at the same
12496 location, then the converted links should work without any further
12497 manual intervention. However, to disable this automatic path
12498 translation, set ~org-html-link-org-files-as-html~ to ~nil~. When
12499 disabled, the HTML export back-end substitutes the ID-based links in
12500 the HTML output. For more about linking files when publishing to
12501 a directory, see [[*Publishing links]].
12503 Org files can also have special directives to the HTML export
12504 back-end. For example, by using =#+ATTR_HTML= lines to specify new
12505 format attributes to ~<a>~ or ~<img>~ tags. This example shows
12506 changing the link's title and style:
12508 #+cindex: ATTR_HTML, keyword
12510 ,#+ATTR_HTML: :title The Org mode homepage :style color:red;
12511 [[http://orgmode.org]]
12514 *** Tables in HTML export
12516 :DESCRIPTION: How to modify the formatting of tables.
12518 #+cindex: tables, in HTML
12519 #+vindex: org-export-html-table-tag
12521 The HTML export back-end uses ~org-html-table-default-attributes~ when
12522 exporting Org tables to HTML. By default, the exporter does not draw
12523 frames and cell borders. To change for this for a table, use the
12524 following lines before the table in the Org file:
12526 #+cindex: CAPTION, keyword
12527 #+cindex: ATTR_HTML, keyword
12529 ,#+CAPTION: This is a table with lines around and between cells
12530 ,#+ATTR_HTML: border="2" rules="all" frame="border"
12533 The HTML export back-end preserves column groupings in Org tables (see
12534 [[*Column groups]]) when exporting to HTML.
12536 Additional options for customizing tables for HTML export.
12538 - ~org-html-table-align-individual-fields~ ::
12540 #+vindex: org-html-table-align-individual-fields
12541 Non-~nil~ attaches style attributes for alignment to each table
12544 - ~org-html-table-caption-above~ ::
12546 #+vindex: org-html-table-caption-above
12547 Non-~nil~ places caption string at the beginning of the table.
12549 - ~org-html-table-data-tags~ ::
12551 #+vindex: org-html-table-data-tags
12552 Opening and ending tags for table data fields.
12554 - ~org-html-table-default-attributes~ ::
12556 #+vindex: org-html-table-default-attributes
12557 Default attributes and values for table tags.
12559 - ~org-html-table-header-tags~ ::
12561 #+vindex: org-html-table-header-tags
12562 Opening and ending tags for table's header fields.
12564 - ~org-html-table-row-tags~ ::
12566 #+vindex: org-html-table-row-tags
12567 Opening and ending tags for table rows.
12569 - ~org-html-table-use-header-tags-for-first-column~ ::
12571 #+vindex: org-html-table-use-header-tags-for-first-column
12572 Non-~nil~ formats column one in tables with header tags.
12574 *** Images in HTML export
12576 :DESCRIPTION: How to insert figures into HTML output.
12578 #+cindex: images, inline in HTML
12579 #+cindex: inlining images in HTML
12581 The HTML export back-end has features to convert Org image links to
12582 HTML inline images and HTML clickable image links.
12584 #+vindex: org-html-inline-images
12585 When the link in the Org file has no description, the HTML export
12586 back-end by default in-lines that image. For example:
12587 =[[file:myimg.jpg]]= is in-lined, while =[[file:myimg.jpg][the image]]= links to the text,
12588 =the image=. For more details, see the variable
12589 ~org-html-inline-images~.
12591 On the other hand, if the description part of the Org link is itself
12592 another link, such as =file:= or =http:= URL pointing to an image, the
12593 HTML export back-end in-lines this image and links to the main image.
12594 This Org syntax enables the back-end to link low-resolution thumbnail
12595 to the high-resolution version of the image, as shown in this example:
12597 : [[file:highres.jpg][file:thumb.jpg]]
12599 To change attributes of in-lined images, use =#+ATTR_HTML= lines in
12600 the Org file. This example shows realignment to right, and adds ~alt~
12601 and ~title~ attributes in support of text viewers and modern web
12602 accessibility standards.
12604 #+cindex: CAPTION, keyword
12605 #+cindex: ATTR_HTML, keyword
12607 ,#+CAPTION: A black cat stalking a spider
12608 ,#+ATTR_HTML: :alt cat/spider image :title Action! :align right
12612 #+texinfo: @noindent
12613 The HTML export back-end copies the =http= links from the Org file as
12616 *** Math formatting in HTML export
12618 :DESCRIPTION: Beautiful math also on the web.
12623 #+cindex: ImageMagick
12625 #+vindex: org-html-mathjax-options~
12626 LaTeX math snippets (see [[*LaTeX fragments]]) can be displayed in two
12627 different ways on HTML pages. The default is to use the [[http://www.mathjax.org][MathJax]],
12628 which should work out of the box with Org[fn:120]. Some MathJax
12629 display options can be configured via ~org-html-mathjax-options~, or
12630 in the buffer. For example, with the following settings,
12633 ,#+HTML_MATHJAX: align: left indent: 5em tagside: left font: Neo-Euler
12634 ,#+HTML_MATHJAX: cancel.js noErrors.js
12637 #+texinfo: @noindent
12638 equation labels are displayed on the left margin and equations are
12639 five em from the left margin. In addition, it loads the two MathJax
12640 extensions =cancel.js= and =noErrors.js=[fn:121].
12642 #+vindex: org-html-mathjax-template
12643 See the docstring of ~org-html-mathjax-options~ for all supported
12644 variables. The MathJax template can be configure via
12645 ~org-html-mathjax-template~.
12647 If you prefer, you can also request that LaTeX fragments are processed
12648 into small images that will be inserted into the browser page. Before
12649 the availability of MathJax, this was the default method for Org
12650 files. This method requires that the dvipng program, dvisvgm or
12651 ImageMagick suite is available on your system. You can still get this
12654 : #+OPTIONS: tex:dvipng
12656 : #+OPTIONS: tex:dvisvgm
12658 #+texinfo: @noindent
12661 : #+OPTIONS: tex:imagemagick
12663 *** Text areas in HTML export
12665 :DESCRIPTION: An alternate way to show an example.
12668 #+cindex: text areas, in HTML
12669 Before Org mode's Babel, one popular approach to publishing code in
12670 HTML was by using =:textarea=. The advantage of this approach was
12671 that copying and pasting was built into browsers with simple
12672 JavaScript commands. Even editing before pasting was made simple.
12674 The HTML export back-end can create such text areas. It requires an
12675 =#+ATTR_HTML= line as shown in the example below with the =:textarea=
12676 option. This must be followed by either an example or a source code
12677 block. Other Org block types do not honor the =:textarea= option.
12679 By default, the HTML export back-end creates a text area 80 characters
12680 wide and height just enough to fit the content. Override these
12681 defaults with =:width= and =:height= options on the =#+ATTR_HTML=
12685 ,#+ATTR_HTML: :textarea t :width 40
12687 (defun org-xor (a b)
12695 :DESCRIPTION: Changing the appearance of the output.
12697 #+cindex: CSS, for HTML export
12698 #+cindex: HTML export, CSS
12700 #+vindex: org-export-html-todo-kwd-class-prefix
12701 #+vindex: org-export-html-tag-class-prefix
12702 You can modify the CSS style definitions for the exported file. The
12703 HTML exporter assigns the following special CSS classes[fn:122] to
12704 appropriate parts of the document -- your style specifications may
12705 change these, in addition to any of the standard classes like for
12706 headlines, tables, etc.
12708 | ~p.author~ | author information, including email |
12709 | ~p.date~ | publishing date |
12710 | ~p.creator~ | creator info, about org mode version |
12711 | ~.title~ | document title |
12712 | ~.subtitle~ | document subtitle |
12713 | ~.todo~ | TODO keywords, all not-done states |
12714 | ~.done~ | the DONE keywords, all states that count as done |
12715 | ~.WAITING~ | each TODO keyword also uses a class named after itself |
12716 | ~.timestamp~ | timestamp |
12717 | ~.timestamp-kwd~ | keyword associated with a timestamp, like =SCHEDULED= |
12718 | ~.timestamp-wrapper~ | span around keyword plus timestamp |
12719 | ~.tag~ | tag in a headline |
12720 | ~._HOME~ | each tag uses itself as a class, "@" replaced by "_" |
12721 | ~.target~ | target for links |
12722 | ~.linenr~ | the line number in a code example |
12723 | ~.code-highlighted~ | for highlighting referenced code lines |
12724 | ~div.outline-N~ | div for outline level N (headline plus text) |
12725 | ~div.outline-text-N~ | extra div for text at outline level N |
12726 | ~.section-number-N~ | section number in headlines, different for each level |
12727 | ~.figure-number~ | label like "Figure 1:" |
12728 | ~.table-number~ | label like "Table 1:" |
12729 | ~.listing-number~ | label like "Listing 1:" |
12730 | ~div.figure~ | how to format an in-lined image |
12731 | ~pre.src~ | formatted source code |
12732 | ~pre.example~ | normal example |
12733 | ~p.verse~ | verse paragraph |
12734 | ~div.footnotes~ | footnote section headline |
12735 | ~p.footnote~ | footnote definition paragraph, containing a footnote |
12736 | ~.footref~ | a footnote reference number (always a <sup>) |
12737 | ~.footnum~ | footnote number in footnote definition (always <sup>) |
12738 | ~.org-svg~ | default class for a linked =.svg= image |
12740 #+vindex: org-html-style-default
12741 #+vindex: org-html-head
12742 #+vindex: org-html-head-extra
12743 #+cindex: HTML_INCLUDE_STYLE, keyword
12744 The HTML export back-end includes a compact default style in each
12745 exported HTML file. To override the default style with another style,
12746 use these keywords in the Org file. They will replace the global
12747 defaults the HTML exporter uses.
12749 #+cindex: HTML_HEAD, keyword
12750 #+cindex: HTML_HEAD_EXTRA, keyword
12752 ,#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="style1.css" />
12753 ,#+HTML_HEAD_EXTRA: <link rel="alternate stylesheet" type="text/css" href="style2.css" />
12756 #+vindex: org-html-head-include-default-style
12757 To just turn off the default style, customize
12758 ~org-html-head-include-default-style~ variable, or use this option
12759 line in the Org file.
12761 #+cindex: html-style, OPTIONS item
12762 : #+OPTIONS: html-style:nil
12764 For longer style definitions, either use several =HTML_HEAD= and
12765 =HTML_HEAD_EXTRA= keywords, or use ~<style> ... </style>~ blocks
12766 around them. Both of these approaches can avoid referring to an
12769 #+cindex: HTML_CONTAINER_CLASS, property
12770 In order to add styles to a sub-tree, use the =HTML_CONTAINER_CLASS=
12771 property to assign a class to the tree. In order to specify CSS
12772 styles for a particular headline, you can use the id specified in
12773 a =CUSTOM_ID= property.
12775 Never change the ~org-html-style-default~ constant. Instead use other
12776 simpler ways of customizing as described above.
12778 *** JavaScript supported display of web pages
12780 :DESCRIPTION: Info and folding in a web browser.
12781 :ALT_TITLE: JavaScript support
12784 Sebastian Rose has written a JavaScript program especially designed to
12785 enhance the web viewing experience of HTML files created with Org.
12786 This program enhances large files in two different ways of viewing.
12787 One is an /Info/-like mode where each section is displayed separately
12788 and navigation can be done with the {{{kbd(n)}}} and {{{kbd(p)}}}
12789 keys, and some other keys as well, press {{{kbd(?)}}} for an overview
12790 of the available keys. The second one has a /folding/ view, much like
12791 Org provides inside Emacs. The script is available at
12792 http://orgmode.org/org-info.js and the documentation at
12793 http://orgmode.org/worg/code/org-info-js/. The script is hosted on
12794 http://orgmode.org, but for reliability, prefer installing it on your
12797 To use this program, just add this line to the Org file:
12799 #+cindex: INFOJS_OPT, keyword
12800 : #+INFOJS_OPT: view:info toc:nil
12802 #+texinfo: @noindent
12803 The HTML header now has the code needed to automatically invoke the
12804 script. For setting options, use the syntax from the above line for
12805 options described below:
12809 The path to the script. The default is to grab the script from
12810 [[http://orgmode.org/org-info.js]], but you might want to have
12811 a local copy and use a path like =../scripts/org-info.js=.
12815 Initial view when the website is first shown. Possible values are:
12817 | =info= | Info-like interface with one section per page |
12818 | =overview= | Folding interface, initially showing only top-level |
12819 | =content= | Folding interface, starting with all headlines visible |
12820 | =showall= | Folding interface, all headlines and text visible |
12824 Maximum headline level still considered as an independent section
12825 for info and folding modes. The default is taken from
12826 ~org-export-headline-levels~, i.e., the =H= switch in =OPTIONS=.
12827 If this is smaller than in ~org-export-headline-levels~, each
12828 info/folding section can still contain child headlines.
12832 Should the table of contents /initially/ be visible? Even when
12833 =nil=, you can always get to the "toc" with {{{kbd(i)}}}.
12837 The depth of the table of contents. The defaults are taken from
12838 the variables ~org-export-headline-levels~ and
12839 ~org-export-with-toc~.
12843 Does the CSS of the page specify a fixed position for the "toc"?
12844 If yes, the toc is displayed as a section.
12848 Should there be short contents (children) in each section? Make
12849 this =above= if the section should be above initial text.
12853 Headings are highlighted when the mouse is over them. Should be
12854 =underline= (default) or a background color like =#cccccc=.
12858 Should view-toggle buttons be everywhere? When =nil= (the
12859 default), only one such button is present.
12861 #+texinfo: @noindent
12862 #+vindex: org-infojs-options
12863 #+vindex: org-export-html-use-infojs
12864 You can choose default values for these options by customizing the
12865 variable ~org-infojs-options~. If you always want to apply the script
12866 to your pages, configure the variable ~org-export-html-use-infojs~.
12870 :DESCRIPTION: Exporting to @LaTeX{} and processing to PDF.
12872 #+cindex: @LaTeX{} export
12873 #+cindex: PDF export
12875 The LaTeX export back-end can handle complex documents, incorporate
12876 standard or custom LaTeX document classes, generate documents using
12877 alternate LaTeX engines, and produce fully linked PDF files with
12878 indexes, bibliographies, and tables of contents, destined for
12879 interactive online viewing or high-quality print publication.
12881 While the details are covered in-depth in this section, here are some
12882 quick references to variables for the impatient: for engines, see
12883 ~org-latex-compiler~; for build sequences, see
12884 ~org-latex-pdf-process~; for packages, see
12885 ~org-latex-default-packages-alist~ and ~org-latex-packages-alist~.
12887 An important note about the LaTeX export back-end: it is sensitive to
12888 blank lines in the Org document. That's because LaTeX itself depends
12889 on blank lines to tell apart syntactical elements, such as paragraphs.
12891 *** LaTeX/PDF export commands
12893 :DESCRIPTION: For producing @LaTeX{} and PDF documents.
12896 - {{{kbd(C-c C-e l l)}}} (~org-latex-export-to-latex~) ::
12898 #+kindex: C-c C-e l l
12899 #+findex: org-latex-export-to-latex~
12900 Export to a LaTeX file with a =.tex= extension. For
12901 =myfile.org=, Org exports to =myfile.tex=, overwriting without
12904 - {{{kbd(C-c C-e l L)}}} (~org-latex-export-as-latex~) ::
12906 #+kindex: C-c C-e l L
12907 #+findex: org-latex-export-as-latex
12908 Export to a temporary buffer. Do not create a file.
12910 - {{{kbd(C-c C-e l p)}}} (~org-latex-export-to-pdf~) ::
12912 #+kindex: C-c C-e l p
12913 #+findex: org-latex-export-to-pdf
12914 Export as LaTeX file and convert it to PDF file.
12916 - {{{kbd(C-c C-e l o)}}} ::
12918 #+kindex: C-c C-e l o
12919 Export as LaTeX file and convert it to PDF, then open the PDF
12920 using the default viewer.
12922 - {{{kbd(M-x org-export-region-as-latex)}}} ::
12924 Convert the region to LaTeX under the assumption that it was in Org
12925 mode syntax before. This is a global command that can be invoked in
12928 #+vindex: org-latex-compiler
12929 #+vindex: org-latex-bibtex-compiler
12930 #+vindex: org-latex-default-packages-alist
12934 #+cindex: LATEX_COMPILER, keyword
12935 The LaTeX export back-end can use any of these LaTeX engines:
12936 =pdflatex=, =xelatex=, and =lualatex=. These engines compile LaTeX
12937 files with different compilers, packages, and output options. The
12938 LaTeX export back-end finds the compiler version to use from
12939 ~org-latex-compiler~ variable or the =#+LATEX_COMPILER= keyword in the
12940 Org file. See the docstring for the
12941 ~org-latex-default-packages-alist~ for loading packages with certain
12942 compilers. Also see ~org-latex-bibtex-compiler~ to set the
12943 bibliography compiler[fn:123].
12945 *** LaTeX specific export settings
12947 :DESCRIPTION: Unique to this @LaTeX{} back-end.
12950 The LaTeX export back-end has several additional keywords for
12951 customizing LaTeX output. Setting these keywords works similar to the
12952 general options (see [[*Export settings]]).
12954 #+attr_texinfo: :sep ,
12956 #+cindex: DESCRIPTION, keyword
12957 #+vindex: org-latex-hyperref-template
12958 #+vindex: org-latex-title-command
12959 The document's description. The description along with author
12960 name, keywords, and related file metadata are inserted in the
12961 output file by the hyperref package. See
12962 ~org-latex-hyperref-template~ for customizing metadata items.
12963 See ~org-latex-title-command~ for typesetting description into
12964 the document's front matter. Use multiple =DESCRIPTION= keywords
12965 for long descriptions.
12969 #+cindex: LATEX_CLASS, keyword
12970 #+vindex: org-latex-default-class
12971 #+vindex: org-latex-classes
12972 This is LaTeX document class, such as /article/, /report/,
12973 /book/, and so on, which contain predefined preamble and headline
12974 level mapping that the LaTeX export back-end needs. The back-end
12975 reads the default class name from the ~org-latex-default-class~
12976 variable. Org has /article/ as the default class. A valid
12977 default class must be an element of ~org-latex-classes~.
12979 - =LATEX_CLASS_OPTIONS= ::
12981 #+cindex: LATEX_CLASS_OPTIONS, keyword
12982 Options the LaTeX export back-end uses when calling the LaTeX
12985 - =LATEX_COMPILER= ::
12987 #+cindex: LATEX_COMPILER, keyword
12988 #+vindex: org-latex-compiler
12989 The compiler, such as =pdflatex=, =xelatex=, =lualatex=, for
12990 producing the PDF. See ~org-latex-compiler~.
12992 - =LATEX_HEADER=, =LATEX_HEADER_EXTRA= ::
12994 #+cindex: LATEX_HEADER, keyword
12995 #+cindex: LATEX_HEADER_EXTRA, keyword
12996 #+vindex: org-latex-classes
12997 Arbitrary lines to add to the document's preamble, before the
12998 hyperref settings. See ~org-latex-classes~ for adjusting the
12999 structure and order of the LaTeX headers.
13003 #+cindex: KEYWORDS, keyword
13004 #+vindex: org-latex-hyperref-template
13005 #+vindex: org-latex-title-command
13006 The keywords for the document. The description along with author
13007 name, keywords, and related file metadata are inserted in the
13008 output file by the hyperref package. See
13009 ~org-latex-hyperref-template~ for customizing metadata items.
13010 See ~org-latex-title-command~ for typesetting description into
13011 the document's front matter. Use multiple =KEYWORDS= lines if
13016 #+cindex: SUBTITLE, keyword
13017 #+vindex: org-latex-subtitle-separate
13018 #+vindex: org-latex-subtitle-format
13019 The document's subtitle. It is typeset as per
13020 ~org-latex-subtitle-format~. If ~org-latex-subtitle-separate~ is
13021 non-~nil~, it is typed as part of the ~\title~ macro. See
13022 ~org-latex-hyperref-template~ for customizing metadata items.
13023 See ~org-latex-title-command~ for typesetting description
13024 into the document's front matter.
13026 The following sections have further details.
13028 *** LaTeX header and sectioning structure
13030 :DESCRIPTION: Setting up the export file structure.
13031 :ALT_TITLE: LaTeX header and sectioning
13033 #+cindex: @LaTeX{} class
13034 #+cindex: @LaTeX{} sectioning structure
13035 #+cindex: @LaTeX{} header
13036 #+cindex: header, for @LaTeX{} files
13037 #+cindex: sectioning structure, for @LaTeX{} export
13039 The LaTeX export back-end converts the first three of Org's outline
13040 levels into LaTeX headlines. The remaining Org levels are exported as
13041 lists. To change this globally for the cut-off point between levels
13042 and lists, (see [[*Export settings]]).
13044 By default, the LaTeX export back-end uses the /article/ class.
13046 #+vindex: org-latex-default-class
13047 #+vindex: org-latex-classes
13048 #+vindex: org-latex-default-packages-alist
13049 #+vindex: org-latex-packages-alist
13050 To change the default class globally, edit ~org-latex-default-class~.
13051 To change the default class locally in an Org file, add option lines
13052 =#+LATEX_CLASS: myclass=. To change the default class for just a part
13053 of the Org file, set a sub-tree property, =EXPORT_LATEX_CLASS=. The
13054 class name entered here must be valid member of ~org-latex-classes~.
13055 This variable defines a header template for each class into which the
13056 exporter splices the values of ~org-latex-default-packages-alist~ and
13057 ~org-latex-packages-alist~. Use the same three variables to define
13058 custom sectioning or custom classes.
13060 #+cindex: LATEX_CLASS, keyword
13061 #+cindex: LATEX_CLASS_OPTIONS, keyword
13062 #+cindex: EXPORT_LATEX_CLASS, property
13063 #+cindex: EXPORT_LATEX_CLASS_OPTIONS, property
13064 The LaTeX export back-end sends the =LATEX_CLASS_OPTIONS= keyword and
13065 =EXPORT_LATEX_CLASS_OPTIONS= property as options to the LaTeX
13066 ~\documentclass~ macro. The options and the syntax for specifying
13067 them, including enclosing them in square brackets, follow LaTeX
13070 : #+LATEX_CLASS_OPTIONS: [a4paper,11pt,twoside,twocolumn]
13072 #+cindex: LATEX_HEADER, keyword
13073 #+cindex: LATEX_HEADER_EXTRA, keyword
13074 The LaTeX export back-end appends values from =LATEX_HEADER= and
13075 =LATEX_HEADER_EXTRA= keywords to the LaTeX header. The docstring for
13076 ~org-latex-classes~ explains in more detail. Also note that LaTeX
13077 export back-end does not append =LATEX_HEADER_EXTRA= to the header
13078 when previewing LaTeX snippets (see [[*Previewing LaTeX fragments]]).
13080 A sample Org file with the above headers:
13083 ,#+LATEX_CLASS: article
13084 ,#+LATEX_CLASS_OPTIONS: [a4paper]
13085 ,#+LATEX_HEADER: \usepackage{xyz}
13093 *** Quoting LaTeX code
13095 :DESCRIPTION: Incorporating literal @LaTeX{} code.
13098 The LaTeX export back-end can insert any arbitrary LaTeX code, see
13099 [[*Embedded LaTeX]]. There are three ways to embed such code in the Org
13100 file and they all use different quoting syntax.
13102 #+cindex: inline, in @LaTeX{} export
13103 Inserting in-line quoted with @ symbols:
13105 : Code embedded in-line @@latex:any arbitrary LaTeX code@@ in a paragraph.
13107 #+cindex: LATEX, keyword
13108 Inserting as one or more keyword lines in the Org file:
13110 : #+LATEX: any arbitrary LaTeX code
13112 #+cindex: BEGIN_EXPORT latex
13113 Inserting as an export block in the Org file, where the back-end
13114 exports any code between begin and end markers:
13117 ,#+BEGIN_EXPORT latex
13118 any arbitrary LaTeX code
13122 *** Tables in LaTeX export
13124 :DESCRIPTION: Options for exporting tables to @LaTeX{}.
13126 #+cindex: tables, in @LaTeX{} export
13128 The LaTeX export back-end can pass several LaTeX attributes for table
13129 contents and layout. Besides specifying label and caption (see
13130 [[*Images and tables]]), the other valid LaTeX attributes include:
13132 #+attr_texinfo: :sep ,
13135 #+vindex: org-latex-default-table-mode
13136 The LaTeX export back-end wraps the table differently depending
13137 on the mode for accurate rendering of math symbols. Mode is
13138 either =table=, =math=, =inline-math= or =verbatim=.
13140 For =math= or =inline-math= mode, LaTeX export back-end wraps the
13141 table in a math environment, but every cell in it is exported
13142 as-is. The LaTeX export back-end determines the default mode
13143 from ~org-latex-default-table-mode~. The LaTeX export back-end
13144 merges contiguous tables in the same mode into a single
13147 - =:environment= ::
13149 #+vindex: org-latex-default-table-environment
13150 Set the default LaTeX table environment for the LaTeX export
13151 back-end to use when exporting Org tables. Common LaTeX table
13152 environments are provided by these packages: tabularx, longtable,
13153 array, tabu, and bmatrix. For packages, such as tabularx and
13154 tabu, or any newer replacements, include them in the
13155 ~org-latex-packages-alist~ variable so the LaTeX export back-end
13156 can insert the appropriate load package headers in the converted
13157 LaTeX file. Look in the docstring for the
13158 ~org-latex-packages-alist~ variable for configuring these
13159 packages for LaTeX snippet previews, if any.
13163 Use =CAPTION= keyword to set a simple caption for a table (see
13164 [[*Images and tables]]). For custom captions, use =:caption=
13165 attribute, which accepts raw LaTeX code. =:caption= value
13166 overrides =CAPTION= value.
13168 - =:float=, =:placement= ::
13170 The table environments by default are not floats in LaTeX. To
13171 make them floating objects use =:float= with one of the following
13172 options: =sideways=, =multicolumn=, =t=, and =nil=.
13174 LaTeX floats can also have additional layout =:placement=
13175 attributes. These are the usual =[h t b p ! H]= permissions
13176 specified in square brackets. Note that for =:float sideways=
13177 tables, the LaTeX export back-end ignores =:placement=
13180 - =:align=, =:font=, =:width= ::
13182 The LaTeX export back-end uses these attributes for regular
13183 tables to set their alignments, fonts, and widths.
13187 When =:spread= is non-~nil~, the LaTeX export back-end spreads or
13188 shrinks the table by the =:width= for tabu and longtabu
13189 environments. =:spread= has no effect if =:width= is not set.
13191 - =:booktabs=, =:center=, =:rmlines= ::
13193 #+vindex: org-latex-tables-booktabs
13194 #+vindex: org-latex-tables-centered
13195 All three commands are toggles. =:booktabs= brings in modern
13196 typesetting enhancements to regular tables. The booktabs package
13197 has to be loaded through ~org-latex-packages-alist~. =:center=
13198 is for centering the table. =:rmlines= removes all but the very
13199 first horizontal line made of ASCII characters from "table.el"
13202 - =:math-prefix=, =:math-suffix=, =:math-arguments= ::
13204 The LaTeX export back-end inserts =:math-prefix= string value in
13205 a math environment before the table. The LaTeX export back-end
13206 inserts =:math-suffix= string value in a math environment after
13207 the table. The LaTeX export back-end inserts =:math-arguments=
13208 string value between the macro name and the table's contents.
13209 =:math-arguments= comes in use for matrix macros that require
13210 more than one argument, such as =qbordermatrix=.
13212 LaTeX table attributes help formatting tables for a wide range of
13213 situations, such as matrix product or spanning multiple pages:
13216 ,#+ATTR_LATEX: :environment longtable :align l|lp{3cm}r|l
13220 ,#+ATTR_LATEX: :mode math :environment bmatrix :math-suffix \times
13223 ,#+ATTR_LATEX: :mode math :environment bmatrix
13228 Set the caption with the LaTeX command
13229 =\bicaption{HeadingA}{HeadingB}=:
13232 ,#+ATTR_LATEX: :caption \bicaption{HeadingA}{HeadingB}
13237 *** Images in LaTeX export
13239 :DESCRIPTION: How to insert figures into @LaTeX{} output.
13241 #+cindex: images, inline in LaTeX
13242 #+cindex: inlining images in LaTeX
13243 #+cindex: ATTR_LATEX, keyword
13245 The LaTeX export back-end processes image links in Org files that do
13246 not have descriptions, such as these links =[[file:img.jpg]]= or
13247 =[[./img.jpg]]=, as direct image insertions in the final PDF output. In
13248 the PDF, they are no longer links but actual images embedded on the
13249 page. The LaTeX export back-end uses =\includegraphics= macro to
13250 insert the image. But for TikZ (http://sourceforge.net/projects/pgf/)
13251 images, the back-end uses an ~\input~ macro wrapped within
13252 a ~tikzpicture~ environment.
13254 For specifying image =:width=, =:height=, and other =:options=, use
13258 ,#+ATTR_LATEX: :width 5cm :options angle=90
13259 [[./img/sed-hr4049.pdf]]
13262 For custom commands for captions, use the =:caption= attribute. It
13263 overrides the default =#+CAPTION= value:
13266 ,#+ATTR_LATEX: :caption \bicaption{HeadingA}{HeadingB}
13267 [[./img/sed-hr4049.pdf]]
13270 When captions follow the method as described in [[*Images and tables]],
13271 the LaTeX export back-end wraps the picture in a floating =figure=
13272 environment. To float an image without specifying a caption, set the
13273 =:float= attribute to one of the following:
13277 For a standard =figure= environment; used by default whenever an
13278 image has a caption.
13282 To span the image across multiple columns of a page; the back-end
13283 wraps the image in a =figure*= environment.
13287 For text to flow around the image on the right; the figure
13288 occupies the left half of the page.
13292 For a new page with the image sideways, rotated ninety degrees,
13293 in a =sidewaysfigure= environment; overrides =:placement=
13298 To avoid a =:float= even if using a caption.
13300 #+texinfo: @noindent
13301 Use the =placement= attribute to modify a floating environment's
13305 ,#+ATTR_LATEX: :float wrap :width 0.38\textwidth :placement {r}{0.4\textwidth}
13309 #+vindex: org-latex-images-centered
13310 #+cindex: center image in LaTeX export
13311 #+cindex: image, centering in LaTeX export
13312 The LaTeX export back-end centers all images by default. Setting
13313 =:center= to =nil= disables centering. To disable centering globally,
13314 set ~org-latex-images-centered~ to =t=.
13316 Set the =:comment-include= attribute to non-~nil~ value for the LaTeX
13317 export back-end to comment out the =\includegraphics= macro.
13319 *** Plain lists in LaTeX export
13321 :DESCRIPTION: Attributes specific to lists.
13324 #+cindex: plain lists, in @LaTeX{} export
13325 #+cindex: ATTR_LATEX, keyword
13326 The LaTeX export back-end accepts the =environment= and =options=
13327 attributes for plain lists. Both attributes work together for
13328 customizing lists, as shown in the examples:
13331 ,#+LATEX_HEADER: \usepackage[inline]{enumitem}
13332 Some ways to say "Hello":
13333 ,#+ATTR_LATEX: :environment itemize*
13334 ,#+ATTR_LATEX: :options [label={}, itemjoin={,}, itemjoin*={, and}]
13340 Since LaTeX supports only four levels of nesting for lists, use an
13341 external package, such as =enumitem= in LaTeX, for levels deeper than
13345 ,#+LATEX_HEADER: \usepackage{enumitem}
13346 ,#+LATEX_HEADER: \renewlist{itemize}{itemize}{9}
13347 ,#+LATEX_HEADER: \setlist[itemize]{label=$\circ$}
13355 *** Source blocks in LaTeX export
13357 :DESCRIPTION: Attributes specific to source code blocks.
13359 #+cindex: source blocks, in @LaTeX{} export
13360 #+cindex: ATTR_LATEX, keyword
13362 The LaTeX export back-end can make source code blocks into floating
13363 objects through the attributes =:float= and =:options=. For =:float=:
13367 Makes a source block float; by default floats any source block
13372 Spans the source block across multiple columns of a page.
13376 Avoids a =:float= even if using a caption; useful for source code
13377 blocks that may not fit on a page.
13380 ,#+ATTR_LATEX: :float nil
13381 ,#+BEGIN_SRC emacs-lisp
13382 Lisp code that may not fit in a single page.
13386 #+vindex: org-latex-listings-options
13387 #+vindex: org-latex-minted-options
13388 The LaTeX export back-end passes string values in =:options= to LaTeX
13389 packages for customization of that specific source block. In the
13390 example below, the =:options= are set for Minted. Minted is a source
13391 code highlighting LaTeX package with many configurable options.
13394 ,#+ATTR_LATEX: :options commentstyle=\bfseries
13395 ,#+BEGIN_SRC emacs-lisp
13397 (if (< n 2) n (+ (Fib (- n 1)) (Fib (- n 2)))))
13401 To apply similar configuration options for all source blocks in
13402 a file, use the ~org-latex-listings-options~ and
13403 ~org-latex-minted-options~ variables.
13405 *** Example blocks in LaTeX export
13407 :DESCRIPTION: Attributes specific to example blocks.
13409 #+cindex: example blocks, in @LaTeX{} export
13410 #+cindex: verbatim blocks, in @LaTeX{} export
13411 #+cindex: ATTR_LATEX, keyword
13413 The LaTeX export back-end wraps the contents of example blocks in
13414 a =verbatim= environment. To change this behavior to use another
13415 environment globally, specify an appropriate export filter (see
13416 [[*Advanced configuration]]). To change this behavior to use another
13417 environment for each block, use the =:environment= parameter to
13418 specify a custom environment.
13421 ,#+ATTR_LATEX: :environment myverbatim
13423 This sentence is false.
13427 *** Special blocks in LaTeX export
13429 :DESCRIPTION: Attributes specific to special blocks.
13432 #+cindex: special blocks, in @LaTeX{} export
13433 #+cindex: abstract, in @LaTeX{} export
13434 #+cindex: proof, in @LaTeX{} export
13435 #+cindex: ATTR_LATEX, keyword
13437 For other special blocks in the Org file, the LaTeX export back-end
13438 makes a special environment of the same name. The back-end also takes
13439 =:options=, if any, and appends as-is to that environment's opening
13440 string. For example:
13444 We demonstrate how to solve the Syracuse problem.
13447 ,#+ATTR_LATEX: :options [Proof of important theorem]
13450 Therefore, any even number greater than 2 is the sum of two primes.
13454 #+texinfo: @noindent
13459 We demonstrate how to solve the Syracuse problem.
13462 \begin{proof}[Proof of important theorem]
13464 Therefore, any even number greater than 2 is the sum of two primes.
13468 If you need to insert a specific caption command, use =:caption=
13469 attribute. It overrides standard =CAPTION= value, if any. For
13473 ,#+ATTR_LATEX: :caption \MyCaption{HeadingA}
13479 *** Horizontal rules in LaTeX export
13481 :DESCRIPTION: Attributes specific to horizontal rules.
13483 #+cindex: horizontal rules, in @LaTeX{} export
13484 #+cindex: ATTR_LATEX, keyword
13486 The LaTeX export back-end converts horizontal rules by the specified
13487 =:width= and =:thickness= attributes. For example:
13490 ,#+ATTR_LATEX: :width .6\textwidth :thickness 0.8pt
13496 :DESCRIPTION: Exporting to Markdown.
13498 #+cindex: Markdown export
13500 The Markdown export back-end, "md", converts an Org file to a Markdown
13501 format, as defined at http://daringfireball.net/projects/markdown/.
13503 Since "md" is built on top of the HTML back-end, any Org constructs
13504 not supported by Markdown, such as tables, the underlying "html"
13505 back-end (see [[*HTML export]]) converts them.
13507 *** Markdown export commands
13512 - {{{kbd(C-c C-e m m)}}} (~org-md-export-to-markdown~) ::
13514 #+kindex: C-c C-c m m
13515 #+findex: org-md-export-to-markdown
13516 Export to a text file with Markdown syntax. For =myfile.org=,
13517 Org exports to =myfile.md=, overwritten without warning.
13519 - {{{kbd(C-c C-e m M)}}} (~org-md-export-as-markdown~) ::
13521 #+kindex: C-c C-c m M
13522 #+findex: org-md-export-as-markdown
13523 Export to a temporary buffer. Does not create a file.
13525 - {{{kbd(C-c C-e m o)}}} ::
13527 #+kindex: C-c C-e m o
13528 Export as a text file with Markdown syntax, then open it.
13530 *** Header and sectioning structure
13535 #+vindex: org-md-headline-style
13536 Based on ~org-md-headline-style~, Markdown export can generate
13537 headlines of both /atx/ and /setext/ types. /atx/ limits headline
13538 levels to two whereas /setext/ limits headline levels to six. Beyond
13539 these limits, the export back-end converts headlines to lists. To set
13540 a limit to a level before the absolute limit (see [[*Export settings]]).
13542 ** OpenDocument Text export
13544 :DESCRIPTION: Exporting to OpenDocument Text.
13547 #+cindex: OpenDocument
13548 #+cindex: export, OpenDocument
13549 #+cindex: LibreOffice
13551 The ODT export back-end handles creating of OpenDocument Text (ODT)
13552 format. Documents created by this exporter use the
13553 {{{cite(OpenDocument-v1.2 specification)}}}[fn:124] and are compatible
13554 with LibreOffice 3.4.
13556 *** Pre-requisites for ODT export
13558 :DESCRIPTION: Required packages.
13562 The ODT export back-end relies on the zip program to create the final
13563 compressed ODT output. Check if =zip= is locally available and
13564 executable. Without it, export cannot finish.
13566 *** ODT export commands
13568 :DESCRIPTION: Invoking export.
13571 - {{{kbd(C-c C-e o o)}}} (~org-export-to-odt~) ::
13573 #+kindex: C-c C-e o o
13574 #+findex: org-export-to-odt
13575 Export as OpenDocument Text file.
13577 #+cindex: EXPORT_FILE_NAME, property
13578 #+vindex: org-odt-preferred-output-format
13580 If ~org-odt-preferred-output-format~ is specified, the ODT export
13581 back-end automatically converts the exported file to that format.
13583 For =myfile.org=, Org exports to =myfile.odt=, overwriting
13584 without warning. The ODT export back-end exports a region only
13585 if a region was active.
13587 If the selected region is a single tree, the ODT export back-end
13588 makes the tree head the document title. Incidentally, {{{kbd(C-c
13589 @)}}} selects the current sub-tree. If the tree head entry has,
13590 or inherits, an =EXPORT_FILE_NAME= property, the ODT export
13591 back-end uses that for file name.
13593 - {{{kbd(C-c C-e o O)}}} ::
13595 #+kindex: C-c C-e o O
13596 Export as an OpenDocument Text file and open the resulting file.
13598 #+vindex: org-export-odt-preferred-output-format
13599 If ~org-export-odt-preferred-output-format~ is specified, open
13600 the converted file instead. See [[*Automatically exporting to
13603 *** ODT specific export settings
13605 :DESCRIPTION: Configuration options.
13608 The ODT export back-end has several additional keywords for
13609 customizing ODT output. Setting these keywords works similar to the
13610 general options (see [[*Export settings]]).
13614 #+cindex: DESCRIPTION, keyword
13615 This is the document's description, which the ODT export back-end
13616 inserts as document metadata. For long descriptions, use
13617 multiple lines, prefixed with =DESCRIPTION=.
13621 #+cindex: KEYWORDS, keyword
13622 The keywords for the document. The ODT export back-end inserts
13623 the description along with author name, keywords, and related
13624 file metadata as metadata in the output file. Use multiple
13625 =KEYWORDS= if necessary.
13627 - =ODT_STYLES_FILE= ::
13629 #+cindex: ODT_STYLES_FILE, keyword
13630 #+vindex: org-odt-styles-file
13631 The ODT export back-end uses the ~org-odt-styles-file~ by
13632 default. See [[*Applying custom styles]] for details.
13636 #+cindex: SUBTITLE, keyword
13637 The document subtitle.
13639 *** Extending ODT export
13641 :DESCRIPTION: Producing DOC, PDF files.
13644 The ODT export back-end can produce documents in other formats besides
13645 ODT using a specialized ODT converter process. Its common interface
13646 works with popular converters to produce formats such as =doc=, or
13647 convert a document from one format, say =csv=, to another format, say
13650 #+cindex: @file{unoconv}
13651 #+vindex: org-odt-convert-process
13652 Customize ~org-odt-convert-process~ variable to point to =unoconv=,
13653 which is the ODT's preferred converter. Working installations of
13654 LibreOffice would already have =unoconv= installed. Alternatively,
13655 other converters may be substituted here. See [[*Configuring
13656 a document converter]].
13658 **** Automatically exporting to other formats
13663 #+vindex: org-odt-preferred-output-format
13664 If ODT format is just an intermediate step to get to other formats,
13665 such as =doc=, =docx=, =rtf=, or =pdf=, etc., then extend the ODT
13666 export back-end to directly produce that format. Specify the final
13667 format in the ~org-odt-preferred-output-format~ variable. This is one
13668 way to extend (see [[*ODT export commands]]).
13670 **** Converting between document formats
13675 The Org export back-end is made to be inter-operable with a wide range
13676 of text document format converters. Newer generation converters, such
13677 as LibreOffice and Pandoc, can handle hundreds of formats at once.
13678 Org provides a consistent interaction with whatever converter is
13679 installed. Here are some generic commands:
13681 - {{{kbd(M-x org-odt-convert)}}} ::
13683 #+findex: org-odt-convert
13684 Convert an existing document from one format to another. With
13685 a prefix argument, opens the newly produced file.
13687 *** Applying custom styles
13689 :DESCRIPTION: Styling the output.
13691 #+cindex: styles, custom
13692 #+cindex: template, custom
13694 The ODT export back-end comes with many OpenDocument styles (see
13695 [[*Working with OpenDocument style files]]). To expand or further
13696 customize these built-in style sheets, either edit the style sheets
13697 directly or generate them using an application such as LibreOffice.
13698 The example here shows creating a style using LibreOffice.
13700 **** Applying custom styles: the easy way
13705 1. Create a sample =example.org= file with settings as shown below,
13706 and export it to ODT format.
13708 : #+OPTIONS: H:10 num:t
13710 2. Open the above =example.odt= using LibreOffice. Use the /Stylist/
13711 to locate the target styles, which typically have the "Org" prefix.
13712 Open one, modify, and save as either OpenDocument Text (ODT) or
13713 OpenDocument Template (OTT) file.
13716 #+vindex: org-odt-styles-file
13717 Customize the variable ~org-odt-styles-file~ and point it to the
13718 newly created file. For additional configuration options, see
13719 [[x-overriding-factory-styles][Overriding factory styles]].
13721 #+cindex: ODT_STYLES_FILE, keyword
13722 To apply an ODT style to a particular file, use the
13723 =ODT_STYLES_FILE= keyword as shown in the example below:
13725 : #+ODT_STYLES_FILE: "/path/to/example.ott"
13727 #+texinfo: @noindent
13730 : #+ODT_STYLES_FILE: ("/path/to/file.ott" ("styles.xml" "image/hdr.png"))
13732 **** Using third-party styles and templates
13737 The ODT export back-end relies on many templates and style names.
13738 Using third-party styles and templates can lead to mismatches.
13739 Templates derived from built in ODT templates and styles seem to have
13742 *** Links in ODT export
13744 :DESCRIPTION: Handling and formatting links.
13746 #+cindex: links, in ODT export
13748 ODT exporter creates native cross-references for internal links. It
13749 creates Internet-style links for all other links.
13751 A link with no description and pointing to a regular, un-itemized,
13752 outline heading is replaced with a cross-reference and section number
13755 A =\ref{label}=-style reference to an image, table etc., is replaced
13756 with a cross-reference and sequence number of the labeled entity. See
13757 [[*Labels and captions in ODT export]].
13759 *** Tables in ODT export
13761 :DESCRIPTION: Org tables conversions.
13764 #+cindex: tables, in ODT export
13766 The ODT export back-end handles native Org mode tables (see [[*Tables]])
13767 and simple =table.el= tables. Complex =table.el= tables having column
13768 or row spans are not supported. Such tables are stripped from the
13771 By default, the ODT export back-end exports a table with top and
13772 bottom frames and with ruled lines separating row and column groups
13773 (see [[*Column groups]]). All tables are typeset to occupy the same
13774 width. The ODT export back-end honors any table alignments and
13775 relative widths for columns (see [[*Column width and alignment]]).
13777 Note that the ODT export back-end interprets column widths as weighted
13778 ratios, the default weight being 1.
13780 #+cindex: ATTR_ODT, keyword
13781 Specifying =:rel-width= property on an =ATTR_ODT= line controls the
13782 width of the table. For example:
13785 ,#+ATTR_ODT: :rel-width 50
13786 | Area/Month | Jan | Feb | Mar | Sum |
13787 |---------------+-------+-------+-------+-------|
13789 | <l13> | <r5> | <r5> | <r5> | <r6> |
13790 | North America | 1 | 21 | 926 | 948 |
13791 | Middle East | 6 | 75 | 844 | 925 |
13792 | Asia Pacific | 9 | 27 | 790 | 826 |
13793 |---------------+-------+-------+-------+-------|
13794 | Sum | 16 | 123 | 2560 | 2699 |
13797 On export, the above table takes 50% of text width area. The exporter
13798 sizes the columns in the ratio: 13:5:5:5:6. The first column is
13799 left-aligned and rest of the columns, right-aligned. Vertical rules
13800 separate the header and the last column. Horizontal rules separate
13801 the header and the last row.
13803 For even more customization, create custom table styles and associate
13804 them with a table using the =ATTR_ODT= keyword. See [[*Customizing
13805 tables in ODT export]].
13807 *** Images in ODT export
13809 :DESCRIPTION: Inserting images.
13811 #+cindex: images, embedding in ODT
13812 #+cindex: embedding images in ODT
13814 **** Embedding images
13819 The ODT export back-end processes image links in Org files that do not
13820 have descriptions, such as these links =[[file:img.jpg]]= or =[[./img.jpg]]=,
13821 as direct image insertions in the final output. Either of these
13828 **** Embedding clickable images
13833 For clickable images, provide a link whose description is another link
13834 to an image file. For example, to embed a image
13835 =org-mode-unicorn.png= which when clicked jumps to http://orgmode.org
13836 website, do the following
13838 : [[http://orgmode.org][./org-mode-unicorn.png]]
13840 **** Sizing and scaling of embedded images
13845 #+cindex: ATTR_ODT, keyword
13847 Control the size and scale of the embedded images with the =ATTR_ODT=
13850 #+cindex: identify, ImageMagick
13851 #+vindex: org-odt-pixels-per-inch
13852 The ODT export back-end starts with establishing the size of the image
13853 in the final document. The dimensions of this size are measured in
13854 centimeters. The back-end then queries the image file for its
13855 dimensions measured in pixels. For this measurement, the back-end
13856 relies on ImageMagick's identify program or Emacs ~create-image~ and
13857 ~image-size~ API. ImageMagick is the preferred choice for large file
13858 sizes or frequent batch operations. The back-end then converts the
13859 pixel dimensions using ~org-odt-pixels-per-inch~ into the familiar 72
13860 dpi or 96 dpi. The default value for this is in
13861 ~display-pixels-per-inch~, which can be tweaked for better results
13862 based on the capabilities of the output device. Here are some common
13863 image scaling operations:
13865 - Explicitly size the image ::
13867 To embed =img.png= as a 10 cm x 10 cm image, do the following:
13870 ,#+ATTR_ODT: :width 10 :height 10
13874 - Scale the image ::
13876 To embed =img.png= at half its size, do the following:
13879 ,#+ATTR_ODT: :scale 0.5
13883 - Scale the image to a specific width ::
13885 To embed =img.png= with a width of 10 cm while retaining the
13886 original height:width ratio, do the following:
13889 ,#+ATTR_ODT: :width 10
13893 - Scale the image to a specific height ::
13895 To embed =img.png= with a height of 10 cm while retaining the
13896 original height:width ratio, do the following:
13899 ,#+ATTR_ODT: :height 10
13903 **** Anchoring of images
13908 #+cindex: ATTR_ODT, keyword
13909 The ODT export back-end can anchor images to ="as-char"=,
13910 ="paragraph"=, or ="page"=. Set the preferred anchor using the
13911 =:anchor= property of the =ATTR_ODT= line.
13913 To create an image that is anchored to a page:
13916 ,#+ATTR_ODT: :anchor "page"
13920 *** Math formatting in ODT export
13922 :DESCRIPTION: Formatting @LaTeX{} fragments.
13925 The ODT exporter has special support for handling math.
13927 **** LaTeX math snippets
13929 :DESCRIPTION: Embedding in @LaTeX{} format.
13932 LaTeX math snippets (see [[*LaTeX fragments]]) can be embedded in the ODT
13933 document in one of the following ways:
13938 Add this line to the Org file. This option is activated on
13943 With this option, LaTeX fragments are first converted into MathML
13944 fragments using an external LaTeX-to-MathML converter program.
13945 The resulting MathML fragments are then embedded as an
13946 OpenDocument Formula in the exported document.
13948 #+vindex: org-latex-to-mathml-convert-command
13949 #+vindex: org-latex-to-mathml-jar-file
13950 You can specify the LaTeX-to-MathML converter by customizing the
13951 variables ~org-latex-to-mathml-convert-command~ and
13952 ~org-latex-to-mathml-jar-file~.
13954 If you prefer to use MathToWeb[fn:125] as your converter, you can
13955 configure the above variables as shown below.
13957 #+begin_src emacs-lisp
13958 (setq org-latex-to-mathml-convert-command
13959 "java -jar %j -unicode -force -df %o %I"
13960 org-latex-to-mathml-jar-file
13961 "/path/to/mathtoweb.jar")
13964 To use LaTeX​ML[fn:126] use
13966 #+begin_src emacs-lisp
13967 (setq org-latex-to-mathml-convert-command
13968 "latexmlmath \"%i\" --presentationmathml=%o")
13971 To quickly verify the reliability of the LaTeX-to-MathML
13972 converter, use the following commands:
13974 - {{{kbd(M-x org-export-as-odf)}}} ::
13976 Convert a LaTeX math snippet to an OpenDocument formula
13979 - {{{kbd(M-x org-export-as-odf-and-open)}}} ::
13981 Convert a LaTeX math snippet to an OpenDocument formula
13982 (=.odf=) file and open the formula file with the
13983 system-registered application.
13989 #+cindex: ImageMagick
13990 Add this line to the Org file. This option is activated on
13993 : #+OPTIONS: tex:dvipng
13995 : #+OPTIONS: tex:dvisvgm
13997 #+texinfo: @noindent
14000 : #+OPTIONS: tex:imagemagick
14002 Under this option, LaTeX fragments are processed into PNG or SVG
14003 images and the resulting images are embedded in the exported
14004 document. This method requires dvipng program, dvisvgm or
14005 ImageMagick programs.
14007 **** MathML and OpenDocument formula files
14009 :DESCRIPTION: Embedding in native format.
14012 When embedding LaTeX math snippets in ODT documents is not reliable,
14013 there is one more option to try. Embed an equation by linking to its
14014 MathML (=.mml=) source or its OpenDocument formula (=.odf=) file as
14017 : [[./equation.mml]]
14019 #+texinfo: @noindent
14022 : [[./equation.odf]]
14024 *** Labels and captions in ODT export
14026 :DESCRIPTION: Rendering objects.
14029 ODT format handles labeling and captioning of objects based on their
14030 types. Inline images, tables, LaTeX fragments, and Math formulas are
14031 numbered and captioned separately. Each object also gets a unique
14032 sequence number based on its order of first appearance in the Org
14033 file. Each category has its own sequence. A caption is just a label
14034 applied to these objects.
14037 ,#+CAPTION: Bell curve
14038 ,#+NAME: fig:SED-HR4049
14042 When rendered, it may show as follows in the exported document:
14044 : Figure 2: Bell curve
14046 #+vindex: org-odt-category-map-alist
14047 To modify the category component of the caption, customize the option
14048 ~org-odt-category-map-alist~. For example, to tag embedded images
14049 with the string "Illustration" instead of the default string "Figure",
14050 use the following setting:
14052 #+begin_src emacs-lisp
14053 (setq org-odt-category-map-alist
14054 '(("__Figure__" "Illustration" "value" "Figure" org-odt--enumerable-image-p)))
14057 With the above modification, the previous example changes to:
14059 : Illustration 2: Bell curve
14061 *** Literal examples in ODT export
14063 :DESCRIPTION: For source code and example blocks.
14066 The ODT export back-end supports literal examples (see [[*Literal
14067 examples]]) with full fontification. Internally, the ODT export
14068 back-end relies on =htmlfontify.el= to generate the style definitions
14069 needed for fancy listings. The auto-generated styles get =OrgSrc=
14070 prefix and inherit colors from the faces used by Emacs Font Lock
14071 library for that source language.
14073 #+vindex: org-odt-fontify-srcblocks
14074 For custom fontification styles, customize the
14075 ~org-odt-create-custom-styles-for-srcblocks~ option.
14077 #+vindex: org-odt-create-custom-styles-for-srcblocks
14078 To turn off fontification of literal examples, customize the
14079 ~org-odt-fontify-srcblocks~ option.
14081 *** Advanced topics in ODT export
14083 :DESCRIPTION: For power users.
14086 The ODT export back-end has extensive features useful for power users
14087 and frequent uses of ODT formats.
14089 **** Configuring a document converter
14091 :DESCRIPTION: Registering a document converter.
14095 #+cindex: doc, docx, rtf
14096 #+cindex: converter
14098 The ODT export back-end works with popular converters with little or
14099 no extra configuration. See [[*Extending ODT export]]. The following is
14100 for unsupported converters or tweaking existing defaults.
14102 - Register the converter ::
14104 #+vindex: org-export-odt-convert-processes
14105 Add the name of the converter to the ~org-odt-convert-processes~
14106 variable. Note that it also requires how the converter is
14107 invoked on the command line. See the variable's docstring for
14110 - Configure its capabilities ::
14112 #+vindex: org-export-odt-convert-capabilities
14113 Specify which formats the converter can handle by customizing the
14114 variable ~org-odt-convert-capabilities~. Use the entry for the
14115 default values in this variable for configuring the new
14116 converter. Also see its docstring for details.
14118 - Choose the converter ::
14120 #+vindex: org-export-odt-convert-process
14121 Select the newly added converter as the preferred one by
14122 customizing the option ~org-odt-convert-process~.
14124 **** Working with OpenDocument style files
14126 :DESCRIPTION: Exploring internals.
14129 #+cindex: styles, custom
14130 #+cindex: template, custom
14132 This section explores the internals of the ODT exporter; the means by which
14133 it produces styled documents; the use of automatic and custom OpenDocument
14136 The ODT exporter relies on two files for generating its output. These
14137 files are bundled with the distribution under the directory pointed to
14138 by the variable ~org-odt-styles-dir~. The two files are:
14140 - =OrgOdtStyles.xml= <<x-orgodtstyles-xml>> ::
14142 This file contributes to the =styles.xml= file of the final ODT
14143 document. This file gets modified for the following purposes:
14145 1. To control outline numbering based on user settings;
14147 2. To add styles generated by =htmlfontify.el= for fontification of
14150 - =OrgOdtContentTemplate.xml= <<x-orgodtcontenttemplate-xml>> ::
14152 This file contributes to the =content.xml= file of the final ODT
14153 document. The contents of the Org outline are inserted between the
14154 =<office:text>= ... =</office:text>= elements of this file.
14156 Apart from serving as a template file for the final =content.xml=,
14157 the file serves the following purposes:
14159 1. It contains automatic styles for formatting of tables which are
14160 referenced by the exporter;
14162 2. It contains =<text:sequence-decl>= ... =</text:sequence-decl>=
14163 elements that control numbering of tables, images, equations, and
14166 <<x-overriding-factory-styles>> The following two variables control
14167 the location from where the ODT exporter picks up the custom styles
14168 and content template files. Customize these variables to override the
14169 factory styles used by the exporter.
14171 - ~org-odt-styles-file~ ::
14173 The ODT export back-end uses the file pointed to by this
14174 variable, such as =styles.xml=, for the final output. It can
14175 take one of the following values:
14179 Use this file instead of the default =styles.xml=
14181 - =FILE.odt= or =FILE.ott= ::
14183 Use the =styles.xml= contained in the specified OpenDocument
14184 Text or Template file
14186 - =FILE.odt= or =FILE.ott= and a subset of included files ::
14188 Use the =styles.xml= contained in the specified OpenDocument
14189 Text or Template file. Additionally extract the specified
14190 member files and embed those within the final ODT document.
14192 Use this option if the =styles.xml= file references additional
14193 files like header and footer images.
14197 Use the default =styles.xml=.
14199 - ~org-odt-content-template-file~ ::
14201 Use this variable to specify the blank =content.xml= used in the
14204 **** Creating one-off styles
14206 :DESCRIPTION: Customizing styles, highlighting...
14210 The ODT export back-end can read embedded raw OpenDocument XML from
14211 the Org file. Such direct formatting is useful for one-off instances.
14213 - Embedding ODT tags as part of regular text ::
14215 Enclose OpenDocument syntax in =@@odt:...@@= for inline markup.
14216 For example, to highlight a region of text do the following:
14219 @@odt:<text:span text:style-name="Highlight">This is highlighted
14220 text</text:span>@@. But this is regular text.
14223 *Hint:* To see the above example in action, edit the =styles.xml=
14224 (see [[x-orgodtstyles-xml][Factory styles]]) and add a custom /Highlight/ style as shown
14228 <style:style style:name="Highlight" style:family="text">
14229 <style:text-properties fo:background-color="#ff0000"/>
14233 - Embedding a one-line OpenDocument XML ::
14235 #+cindex: ODT, keyword
14236 The ODT export back-end can read one-liner options with =#+ODT:=
14237 in the Org file. For example, to force a page break:
14240 ,#+ODT: <text:p text:style-name="PageBreak"/>
14243 *Hint:* To see the above example in action, edit your
14244 =styles.xml= (see [[x-orgodtstyles-xml][Factory styles]]) and add a custom =PageBreak=
14245 style as shown below.
14248 <style:style style:name="PageBreak" style:family="paragraph"
14249 style:parent-style-name="Text_20_body">
14250 <style:paragraph-properties fo:break-before="page"/>
14254 - Embedding a block of OpenDocument XML ::
14256 The ODT export back-end can also read ODT export blocks for
14257 OpenDocument XML. Such blocks use the =#+BEGIN_EXPORT odt=
14258 ... =#+END_EXPORT= constructs.
14260 For example, to create a one-off paragraph that uses bold text,
14264 ,#+BEGIN_EXPORT odt
14265 <text:p text:style-name="Text_20_body_20_bold">
14266 This paragraph is specially formatted and uses bold text.
14271 **** Customizing tables in ODT export
14273 :DESCRIPTION: Defining table templates.
14276 #+cindex: tables, in ODT export
14277 #+cindex: ATTR_ODT, keyword
14279 Override the default table format by specifying a custom table style
14280 with the =#+ATTR_ODT= line. For a discussion on default formatting of
14281 tables, see [[*Tables in ODT export]].
14283 This feature closely mimics the way table templates are defined in the
14284 OpenDocument-v1.2 specification.[fn:127]
14286 #+vindex: org-odt-table-styles
14287 For quick preview of this feature, install the settings below and export the
14288 table that follows:
14290 #+begin_src emacs-lisp
14291 (setq org-export-odt-table-styles
14292 (append org-export-odt-table-styles
14293 '(("TableWithHeaderRowAndColumn" "Custom"
14294 ((use-first-row-styles . t)
14295 (use-first-column-styles . t)))
14296 ("TableWithFirstRowandLastRow" "Custom"
14297 ((use-first-row-styles . t)
14298 (use-last-row-styles . t))))))
14302 ,#+ATTR_ODT: :style TableWithHeaderRowAndColumn
14303 | Name | Phone | Age |
14304 | Peter | 1234 | 17 |
14305 | Anna | 4321 | 25 |
14308 The example above used =Custom= template and installed two table
14309 styles =TableWithHeaderRowAndColumn= and
14310 =TableWithFirstRowandLastRow=. *Important:* The OpenDocument styles
14311 needed for producing the above template were pre-defined. They are
14312 available in the section marked =Custom Table Template= in
14313 =OrgOdtContentTemplate.xml= (see [[x-orgodtcontenttemplate-xml][Factory styles]]). For adding new
14314 templates, define new styles there.
14316 To use this feature proceed as follows:
14318 1. Create a table template[fn:128].
14320 A table template is set of =table-cell= and =paragraph= styles for
14321 each of the following table cell categories:
14333 The names for the above styles must be chosen based on the name of
14334 the table template using a well-defined convention.
14336 The naming convention is better illustrated with an example. For
14337 a table template with the name =Custom=, the needed style names are
14338 listed in the following table.
14340 | Cell type | Cell style | Paragraph style |
14341 |--------------+------------------------------+-----------------------------------|
14342 | Body | =CustomTableCell= | =CustomTableParagraph= |
14343 | First column | =CustomFirstColumnTableCell= | =CustomFirstColumnTableParagraph= |
14344 | Last column | =CustomLastColumnTableCell= | =CustomLastColumnTableParagraph= |
14345 | First row | =CustomFirstRowTableCell= | =CustomFirstRowTableParagraph= |
14346 | Last row | =CustomLastRowTableCell= | =CustomLastRowTableParagraph= |
14347 | Even row | =CustomEvenRowTableCell= | =CustomEvenRowTableParagraph= |
14348 | Odd row | =CustomOddRowTableCell= | =CustomOddRowTableParagraph= |
14349 | Even column | =CustomEvenColumnTableCell= | =CustomEvenColumnTableParagraph= |
14350 | Odd column | =CustomOddColumnTableCell= | =CustomOddColumnTableParagraph= |
14352 To create a table template with the name =Custom=, define the above
14353 styles in the =<office:automatic-styles>= ...
14354 =</office:automatic-styles>= element of the content template file
14355 (see [[x-orgodtcontenttemplate-xml][Factory styles]]).
14357 2. Define a table style[fn:129].
14359 #+vindex: org-odt-table-styles
14360 To define a table style, create an entry for the style in the
14361 variable ~org-odt-table-styles~ and specify the following:
14363 - the name of the table template created in step (1),
14364 - the set of cell styles in that template that are to be activated.
14366 For example, the entry below defines two different table styles
14367 =TableWithHeaderRowAndColumn= and =TableWithFirstRowandLastRow=
14368 based on the same template =Custom=. The styles achieve their
14369 intended effect by selectively activating the individual cell
14370 styles in that template.
14372 #+begin_src emacs-lisp
14373 (setq org-export-odt-table-styles
14374 (append org-export-odt-table-styles
14375 '(("TableWithHeaderRowAndColumn" "Custom"
14376 ((use-first-row-styles . t)
14377 (use-first-column-styles . t)))
14378 ("TableWithFirstRowandLastRow" "Custom"
14379 ((use-first-row-styles . t)
14380 (use-last-row-styles . t))))))
14383 3. Associate a table with the table style.
14385 To do this, specify the table style created in step (2) as part of
14386 the =ATTR_ODT= line as shown below.
14389 ,#+ATTR_ODT: :style TableWithHeaderRowAndColumn
14390 | Name | Phone | Age |
14391 | Peter | 1234 | 17 |
14392 | Anna | 4321 | 25 |
14395 **** Validating OpenDocument XML
14397 :DESCRIPTION: Debugging corrupted OpenDocument files.
14401 Sometimes ODT format files may not open due to =.odt= file corruption.
14402 To verify if such a file is corrupt, validate it against the
14403 OpenDocument Relax NG Compact (RNC) syntax schema. But first the
14404 =.odt= files have to be decompressed using =zip=. Note that =.odt=
14405 files are ZIP archives: [[info:emacs::File Archives]]. The contents of
14406 ODT files are in XML. For general help with validation -- and
14407 schema-sensitive editing -- of XML files:
14408 [[info:nxml-mode::Introduction]].
14410 #+vindex: org-export-odt-schema-dir
14411 Customize ~org-odt-schema-dir~ to point to a directory with
14412 OpenDocument RNC files and the needed schema-locating rules. The ODT
14413 export back-end takes care of updating the
14414 ~rng-schema-locating-files~.
14418 :DESCRIPTION: Exporting to Org.
14421 #+cindex: Org export
14422 /org/ export back-end creates a normalized version of the Org document
14423 in current buffer. The exporter evaluates Babel code (see [[*Evaluating
14424 code blocks]]) and removes content specific to other back-ends.
14426 *** Org export commands
14431 - {{{kbd(C-c C-e O o)}}} (~org-org-export-to-org~) ::
14433 #+kindex: C-c C-e O o
14434 #+findex: org-org-export-to-org
14435 Export as an Org file with a =.org= extension. For =myfile.org=,
14436 Org exports to =myfile.org.org=, overwriting without warning.
14438 - {{{kbd(C-c C-e O v)}}} (~~) ::
14440 #+kindex: C-c C-e O v
14441 Export to an Org file, then open it.
14445 :DESCRIPTION: Exporting to Texinfo.
14448 *** Texinfo export commands
14450 :DESCRIPTION: Invoking commands.
14453 - {{{kbd(C-c C-e i t)}}} (~org-texinfo-export-to-texinfo~) ::
14455 #+kindex: C-c C-e i t
14456 #+findex: org-texinfo-export-to-texinfo
14457 Export as a Texinfo file with =.texi= extension. For
14458 =myfile.org=, Org exports to =myfile.texi=, overwriting without
14461 - {{{kbd(C-c C-e i i)}}} (~org-texinfo-export-to-info~) ::
14463 #+kindex: C-c C-e i i
14464 #+findex: org-texinfo-export-to-info
14465 #+vindex: org-texinfo-info-process
14466 Export to Texinfo format first and then process it to make an
14467 Info file. To generate other formats, such as DocBook, customize
14468 the ~org-texinfo-info-process~ variable.
14470 *** Texinfo specific export settings
14472 :DESCRIPTION: Setting the environment.
14475 The Texinfo export back-end has several additional keywords for
14476 customizing Texinfo output. Setting these keywords works similar to
14477 the general options (see [[*Export settings]]).
14481 #+cindex: SUBTITLE, keyword
14482 The document subtitle.
14486 #+cindex: SUBAUTHOR, keyword
14487 Additional authors for the document.
14489 - =TEXINFO_FILENAME= ::
14491 #+cindex: TEXINFO_FILENAME, keyword
14492 The Texinfo filename.
14494 - =TEXINFO_CLASS= ::
14496 #+cindex: TEXINFO_CLASS, keyword
14497 #+vindex: org-texinfo-default-class
14498 The default document class (~org-texinfo-default-class~), which
14499 must be a member of ~org-texinfo-classes~.
14501 - =TEXINFO_HEADER= ::
14503 #+cindex: TEXINFO_HEADER, keyword
14504 Arbitrary lines inserted at the end of the header.
14506 - =TEXINFO_POST_HEADER= ::
14508 #+cindex: TEXINFO_POST_HEADER, keyword
14509 Arbitrary lines inserted after the end of the header.
14511 - =TEXINFO_DIR_CATEGORY= ::
14513 #+cindex: TEXINFO_DIR_CATEGORY, keyword
14514 The directory category of the document.
14516 - =TEXINFO_DIR_TITLE= ::
14518 #+cindex: TEXINFO_DIR_TITLE, keyword
14519 The directory title of the document.
14521 - =TEXINFO_DIR_DESC= ::
14523 #+cindex: TEXINFO_DIR_DESC, keyword
14524 The directory description of the document.
14526 - =TEXINFO_PRINTED_TITLE= ::
14528 #+cindex: TEXINFO_PRINTED_TITLE, keyword
14529 The printed title of the document.
14531 *** Texinfo file header
14533 :DESCRIPTION: Generating the header.
14536 #+cindex: TEXINFO_FILENAME, keyword
14537 After creating the header for a Texinfo file, the Texinfo back-end
14538 automatically generates a name and destination path for the Info file.
14539 To override this default with a more sensible path and name, specify
14540 the =TEXINFO_FILENAME= keyword.
14542 #+vindex: org-texinfo-coding-system
14543 #+cindex: TEXINFO_HEADER, keyword
14544 Along with the output's file name, the Texinfo header also contains
14545 language details (see [[*Export settings]]) and encoding system as set in
14546 the ~org-texinfo-coding-system~ variable. Insert =TEXINFO_HEADER=
14547 keywords for each additional command in the header, for example:
14549 : #+TEXINFO_HEADER: @synindex
14551 #+cindex: TEXINFO_CLASS, keyword
14552 #+vindex: org-texinfo-classes
14553 Instead of repeatedly installing the same set of commands, define
14554 a class in ~org-texinfo-classes~ once, and then activate it in the
14555 document by setting the =TEXINFO_CLASS= keyword to that class.
14557 *** Texinfo title and copyright page
14559 :DESCRIPTION: Creating preamble pages.
14562 #+cindex: TEXINFO_PRINTED_TITLE, keyword
14563 The default template for hard copy output has a title page with
14564 =TITLE= and =AUTHOR= keywords (see [[*Export settings]]). To replace the
14565 regular title with something different for the printed version, use
14566 the =TEXINFO_PRINTED_TITLE= and =SUBTITLE= keywords. Both expect raw
14567 Texinfo code for setting their values.
14569 #+cindex: SUBAUTHOR, keyword
14570 If one =AUTHOR= line is not sufficient, add multiple =SUBAUTHOR=
14571 keywords. They have to be set in raw Texinfo code.
14574 ,#+AUTHOR: Jane Smith
14575 ,#+SUBAUTHOR: John Doe
14576 ,#+TEXINFO_PRINTED_TITLE: This Long Title@@inlinefmt{tex,@*} Is Broken in @TeX{}
14579 #+cindex: COPYING, property
14580 Copying material is defined in a dedicated headline with a non-~nil~
14581 =COPYING= property. The back-end inserts the contents within
14582 a =@copying= command at the beginning of the document. The heading
14583 itself does not appear in the structure of the document.
14585 Copyright information is printed on the back of the title page.
14593 This is a short example of a complete Texinfo file, version 1.0.
14595 Copyright \copy 2016 Free Software Foundation, Inc.
14598 *** Info directory file
14600 :DESCRIPTION: Installing a manual in Info file hierarchy.
14603 #+cindex: @samp{dir} file, in Texinfo export
14604 #+cindex: Info directory file, in Texinfo export
14605 #+cindex: @code{install-info}, in Texinfo export
14607 #+cindex: TEXINFO_DIR_CATEGORY, keyword
14608 #+cindex: TEXINFO_DIR_TITLE, keyword
14609 #+cindex: TEXINFO_DIR_DESC, keyword
14610 The end result of the Texinfo export process is the creation of an
14611 Info file. This Info file's metadata has variables for category,
14612 title, and description: =TEXINFO_DIR_CATEGORY=, =TEXINFO_DIR_TITLE=,
14613 and =TEXINFO_DIR_DESC= keywords that establish where in the Info
14614 hierarchy the file fits.
14616 Here is an example that writes to the Info directory file:
14619 ,#+TEXINFO_DIR_CATEGORY: Emacs
14620 ,#+TEXINFO_DIR_TITLE: Org Mode: (org)
14621 ,#+TEXINFO_DIR_DESC: Outline-based notes management and organizer
14624 *** Headings and sectioning structure
14626 :DESCRIPTION: Building document structure.
14629 #+vindex: org-texinfo-classes
14630 #+vindex: org-texinfo-default-class
14631 #+cindex: TEXINFO_CLASS, keyword
14632 The Texinfo export back-end uses a pre-defined scheme to convert Org
14633 headlines to equivalent Texinfo structuring commands. A scheme like
14634 this maps top-level headlines to numbered chapters tagged as
14635 ~@chapter~ and lower-level headlines to unnumbered chapters tagged as
14636 ~@unnumbered~. To override such mappings to introduce ~@part~ or
14637 other Texinfo structuring commands, define a new class in
14638 ~org-texinfo-classes~. Activate the new class with the
14639 =TEXINFO_CLASS= keyword. When no new class is defined and activated,
14640 the Texinfo export back-end defaults to the
14641 ~org-texinfo-default-class~.
14643 If an Org headline's level has no associated Texinfo structuring
14644 command, or is below a certain threshold (see [[*Export settings]]), then
14645 the Texinfo export back-end makes it into a list item.
14647 #+cindex: APPENDIX, property
14648 The Texinfo export back-end makes any headline with a non-~nil~
14649 =APPENDIX= property into an appendix. This happens independent of the
14650 Org headline level or the =TEXINFO_CLASS= keyword.
14652 #+cindex: ALT_TITLE, property
14653 #+cindex: DESCRIPTION, property
14654 The Texinfo export back-end creates a menu entry after the Org
14655 headline for each regular sectioning structure. To override this with
14656 a shorter menu entry, use the =ALT_TITLE= property (see [[*Table of
14657 contents]]). Texinfo menu entries also have an option for a longer
14658 =DESCRIPTION= property. Here's an example that uses both to override
14659 the default menu entry:
14662 ,* Controlling Screen Display
14664 :ALT_TITLE: Display
14665 :DESCRIPTION: Controlling Screen Display
14669 #+cindex: Top node, in Texinfo export
14670 The text before the first headline belongs to the /Top/ node, i.e.,
14671 the node in which a reader enters an Info manual. As such, it is
14672 expected not to appear in printed output generated from the =.texi=
14673 file. See [[info:texinfo::The%20Top%20Node]], for more information.
14677 :DESCRIPTION: Creating indices.
14680 #+cindex: CINDEX, keyword
14681 #+cindex: concept index, in Texinfo export
14682 #+cindex: FINDEX, keyword
14683 #+cindex: function index, in Texinfo export
14684 #+cindex: KINDEX, keyword
14685 #+cindex: keystroke index, in Texinfo export
14686 #+cindex: PINDEX, keyword
14687 #+cindex: program index, in Texinfo export
14688 #+cindex: TINDEX, keyword
14689 #+cindex: data type index, in Texinfo export
14690 #+cindex: VINDEX, keyword
14691 #+cindex: variable index, in Texinfo export
14692 The Texinfo export back-end recognizes these indexing keywords if used
14693 in the Org file: =CINDEX=, =FINDEX=, =KINDEX=, =PINDEX=, =TINDEX= and
14694 =VINDEX=. Write their value as verbatim Texinfo code; in particular,
14695 ={=, =}= and =@= characters need to be escaped with =@= if they do not
14696 belong to a Texinfo command.
14698 : #+CINDEX: Defining indexing entries
14700 #+cindex: INDEX, property
14701 For the back-end to generate an index entry for a headline, set the
14702 =INDEX= property to =cp= or =vr=. These abbreviations come from
14703 Texinfo that stand for concept index and variable index. The Texinfo
14704 manual has abbreviations for all other kinds of indexes. The back-end
14705 exports the headline as an unnumbered chapter or section command, and
14706 then inserts the index after its contents.
14715 *** Quoting Texinfo code
14717 :DESCRIPTION: Incorporating literal Texinfo code.
14720 Use any of the following three methods to insert or escape raw Texinfo
14723 #+cindex: TEXINFO, keyword
14724 #+cindex: BEGIN_EXPORT texinfo
14726 Richard @@texinfo:@sc{@@Stallman@@texinfo:}@@ commence' GNU.
14728 ,#+TEXINFO: @need800
14729 This paragraph is preceded by...
14731 ,#+BEGIN_EXPORT texinfo
14732 @auindex Johnson, Mark
14733 @auindex Lakoff, George
14737 *** Plain lists in Texinfo export
14739 :DESCRIPTION: List attributes.
14742 #+cindex: ATTR_TEXINFO, keyword
14743 #+cindex: two-column tables, in Texinfo export
14745 #+cindex: table types, in Texinfo export
14746 The Texinfo export back-end by default converts description lists in
14747 the Org file using the default command =@table=, which results in
14748 a table with two columns. To change this behavior, specify
14749 =:table-type= with =ftable= or =vtable= attributes. For more
14750 information, see [[info:texinfo::Two-column Tables]].
14752 #+vindex: org-texinfo-table-default-markup
14753 The Texinfo export back-end by default also applies a text highlight
14754 based on the defaults stored in ~org-texinfo-table-default-markup~.
14755 To override the default highlight command, specify another one with
14756 the =:indic= attribute.
14758 #+cindex: multiple items in Texinfo lists
14759 Org syntax is limited to one entry per list item. Nevertheless, the
14760 Texinfo export back-end can split that entry according to any text
14761 provided through the =:sep= attribute. Each part then becomes a new
14762 entry in the first column of the table.
14764 The following example illustrates all the attributes above:
14767 ,#+ATTR_TEXINFO: :table-type vtable :sep , :indic asis
14768 - foo, bar :: This is the common text for variables foo and bar.
14771 #+texinfo: @noindent
14778 This is the common text for variables foo and bar.
14782 *** Tables in Texinfo export
14784 :DESCRIPTION: Table attributes.
14787 #+cindex: ATTR_TEXINFO, keyword
14788 When exporting tables, the Texinfo export back-end uses the widest
14789 cell width in each column. To override this and instead specify as
14790 fractions of line length, use the =:columns= attribute. See example
14794 #+ATTR_TEXINFO: :columns .5 .5
14795 | a cell | another cell |
14798 *** Images in Texinfo export
14800 :DESCRIPTION: Image attributes.
14803 #+cindex: ATTR_TEXINFO, keyword
14804 Insert a file link to the image in the Org file, and the Texinfo
14805 export back-end inserts the image. These links must have the usual
14806 supported image extensions and no descriptions. To scale the image,
14807 use =:width= and =:height= attributes. For alternate text, use =:alt=
14808 and specify the text using Texinfo code, as shown in the example:
14811 ,#+ATTR_TEXINFO: :width 1in :alt Alternate @i{text}
14815 *** Special blocks in Texinfo export
14817 :DESCRIPTION: Special block attributes.
14820 #+cindex: ATTR_TEXINFO, keyword
14822 The Texinfo export back-end converts special blocks to commands with
14823 the same name. It also adds any =:options= attributes to the end of
14824 the command, as shown in this example:
14827 ,#+ATTR_TEXINFO: :options org-org-export-to-org ...
14829 A somewhat obsessive function name.
14833 #+texinfo: @noindent
14837 @defun org-org-export-to-org ...
14838 A somewhat obsessive function name.
14842 *** A Texinfo example
14844 :DESCRIPTION: Processing Org to Texinfo.
14847 Here is a more detailed example Org file. See
14848 [[info:texinfo::GNU%20Sample%20Texts]] for an equivalent example using
14852 ,#+TITLE: GNU Sample {{{version}}}
14853 ,#+SUBTITLE: for version {{{version}}}, {{{updated}}}
14854 ,#+AUTHOR: A.U. Thor
14855 ,#+EMAIL: bug-sample@gnu.org
14857 ,#+OPTIONS: ':t toc:t author:t email:t
14860 ,#+MACRO: version 2.0
14861 ,#+MACRO: updated last updated 4 March 2014
14863 ,#+TEXINFO_FILENAME: sample.info
14864 ,#+TEXINFO_HEADER: @syncodeindex pg cp
14866 ,#+TEXINFO_DIR_CATEGORY: Texinfo documentation system
14867 ,#+TEXINFO_DIR_TITLE: sample: (sample)
14868 ,#+TEXINFO_DIR_DESC: Invoking sample
14870 ,#+TEXINFO_PRINTED_TITLE: GNU Sample
14872 This manual is for GNU Sample (version {{{version}}},
14880 This manual is for GNU Sample (version {{{version}}},
14881 {{{updated}}}), which is an example in the Texinfo documentation.
14883 Copyright \copy 2016 Free Software Foundation, Inc.
14886 Permission is granted to copy, distribute and/or modify this
14887 document under the terms of the GNU Free Documentation License,
14888 Version 1.3 or any later version published by the Free Software
14889 Foundation; with no Invariant Sections, with no Front-Cover Texts,
14890 and with no Back-Cover Texts. A copy of the license is included in
14891 the section entitled "GNU Free Documentation License".
14897 ,#+CINDEX: invoking @command{sample}
14899 This is a sample manual. There is no sample program to invoke, but
14900 if there were, you could see its basic usage and command line
14903 ,* GNU Free Documentation License
14908 ,#+TEXINFO: @include fdl.texi
14916 ** iCalendar export
14918 :DESCRIPTION: Exporting to iCalendar.
14920 #+cindex: iCalendar export
14922 A large part of Org mode's interoperability success is its ability to
14923 easily export to or import from external applications. The iCalendar
14924 export back-end takes calendar data from Org files and exports to the
14925 standard iCalendar format.
14927 #+vindex: org-icalendar-include-todo
14928 #+vindex: org-icalendar-use-deadline
14929 #+vindex: org-icalendar-use-scheduled
14930 The iCalendar export back-end can also incorporate TODO entries based
14931 on the configuration of the ~org-icalendar-include-todo~ variable.
14932 The back-end exports plain timestamps as =VEVENT=, TODO items as
14933 =VTODO=, and also create events from deadlines that are in non-TODO
14934 items. The back-end uses the deadlines and scheduling dates in Org
14935 TODO items for setting the start and due dates for the iCalendar TODO
14936 entry. Consult the ~org-icalendar-use-deadline~ and
14937 ~org-icalendar-use-scheduled~ variables for more details.
14939 #+vindex: org-icalendar-categories
14940 #+vindex: org-icalendar-alarm-time
14941 For tags on the headline, the iCalendar export back-end makes them
14942 into iCalendar categories. To tweak the inheritance of tags and TODO
14943 states, configure the variable ~org-icalendar-categories~. To assign
14944 clock alarms based on time, configure the ~org-icalendar-alarm-time~
14947 #+vindex: org-icalendar-store-UID
14948 #+cindex: ID, property
14949 The iCalendar format standard requires globally unique identifier --
14950 or UID -- for each entry. The iCalendar export back-end creates UIDs
14951 during export. To save a copy of the UID in the Org file set the
14952 variable ~org-icalendar-store-UID~. The back-end looks for the =ID=
14953 property of the entry for re-using the same UID for subsequent
14956 Since a single Org entry can result in multiple iCalendar entries --
14957 timestamp, deadline, scheduled item, or TODO item -- Org adds prefixes
14958 to the UID, depending on which part of the Org entry triggered the
14959 creation of the iCalendar entry. Prefixing ensures UIDs remains
14960 unique, yet enable synchronization programs trace the connections.
14962 - {{{kbd(C-c C-e c f)}}} (~org-icalendar-export-to-ics~) ::
14964 #+kindex: C-c C-e c f
14965 #+findex: org-icalendar-export-to-ics
14966 Create iCalendar entries from the current Org buffer and store
14967 them in the same directory, using a file extension =.ics=.
14969 - {{{kbd(C-c C-e c a)}}} (~org-icalendar-export-agenda-files~) ::
14971 #+kindex: C-c C-e c a
14972 #+findex: org-icalendar-export-agenda-files
14973 Create iCalendar entries from Org files in ~org-agenda-files~ and
14974 store in a separate iCalendar file for each Org file.
14976 - {{{kbd(C-c C-e c c)}}} (~org-icalendar-combine-agenda-files~) ::
14978 #+kindex: C-c C-e c c
14979 #+findex: org-icalendar-combine-agenda-files
14980 #+vindex: org-icalendar-combined-agenda-file
14981 Create a combined iCalendar file from Org files in
14982 ~org-agenda-files~ and write it to
14983 ~org-icalendar-combined-agenda-file~ file name.
14985 #+cindex: SUMMARY, property
14986 #+cindex: DESCRIPTION, property
14987 #+cindex: LOCATION, property
14988 #+cindex: TIMEZONE, property
14989 The iCalendar export back-end includes =SUMMARY=, =DESCRIPTION=,
14990 =LOCATION= and =TIMEZONE= properties from the Org entries when
14991 exporting. To force the back-end to inherit the =LOCATION= and
14992 =TIMEZONE= properties, configure the ~org-use-property-inheritance~
14995 #+vindex: org-icalendar-include-body
14996 When Org entries do not have =SUMMARY=, =DESCRIPTION= and =LOCATION=
14997 properties, the iCalendar export back-end derives the summary from the
14998 headline, and derives the description from the body of the Org item.
14999 The ~org-icalendar-include-body~ variable limits the maximum number of
15000 characters of the content are turned into its description.
15002 The =TIMEZONE= property can be used to specify a per-entry time zone,
15003 and is applied to any entry with timestamp information. Time zones
15004 should be specified as per the IANA time zone database format, e.g.,
15005 =Asia/Almaty=. Alternately, the property value can be =UTC=, to force
15006 UTC time for this entry only.
15008 Exporting to iCalendar format depends in large part on the
15009 capabilities of the destination application. Some are more lenient
15010 than others. Consult the Org mode FAQ for advice on specific
15013 ** Other built-in back-ends
15015 :DESCRIPTION: Exporting to a man page.
15018 Other export back-ends included with Org are:
15020 - =ox-man.el=: Export to a man page.
15022 To activate such back-ends, either customize ~org-export-backends~ or
15023 load directly with ~(require 'ox-man)~. On successful load, the
15024 back-end adds new keys in the export dispatcher (see [[*The export
15027 Follow the comment section of such files, for example, =ox-man.el=,
15028 for usage and configuration details.
15030 ** Advanced configuration
15032 :DESCRIPTION: Fine-tuning the export output.
15040 #+vindex: org-export-before-processing-hook
15041 #+vindex: org-export-before-parsing-hook
15042 The export process executes two hooks before the actual exporting
15043 begins. The first hook, ~org-export-before-processing-hook~, runs
15044 before any expansions of macros, Babel code, and include keywords in
15045 the buffer. The second hook, ~org-export-before-parsing-hook~, runs
15046 before the buffer is parsed.
15048 Functions added to these hooks are called with a single argument: the
15049 export back-end actually used, as a symbol. You may use them for
15050 heavy duty structural modifications of the document. For example, you
15051 can remove every headline in the buffer during export like this:
15053 #+begin_src emacs-lisp
15054 (defun my-headline-removal (backend)
15055 "Remove all headlines in the current buffer.
15056 BACKEND is the export back-end being used, as a symbol."
15058 (lambda () (delete-region (point) (line-beginning-position 2)))))
15060 (add-hook 'org-export-before-parsing-hook 'my-headline-removal)
15068 #+cindex: Filters, exporting
15069 Filters are lists of functions to be applied to certain parts for
15070 a given back-end. The output from the first function in the filter is
15071 passed on to the next function in the filter. The final output is the
15072 output from the final function in the filter.
15074 The Org export process has many filter sets applicable to different
15075 types of objects, plain text, parse trees, export options, and final
15076 output formats. The filters are named after the element type or
15077 object type: ~org-export-filter-TYPE-functions~, where {{{var(TYPE)}}}
15078 is the type targeted by the filter. Valid types are:
15080 #+attr_texinfo: :columns 0.33 0.33 0.33
15081 | body | bold | babel-call |
15082 | center-block | clock | code |
15083 | diary-sexp | drawer | dynamic-block |
15084 | entity | example-block | export-block |
15085 | export-snippet | final-output | fixed-width |
15086 | footnote-definition | footnote-reference | headline |
15087 | horizontal-rule | inline-babel-call | inline-src-block |
15088 | inlinetask | italic | item |
15089 | keyword | latex-environment | latex-fragment |
15090 | line-break | link | node-property |
15091 | options | paragraph | parse-tree |
15092 | plain-list | plain-text | planning |
15093 | property-drawer | quote-block | radio-target |
15094 | section | special-block | src-block |
15095 | statistics-cookie | strike-through | subscript |
15096 | superscript | table | table-cell |
15097 | table-row | target | timestamp |
15098 | underline | verbatim | verse-block |
15100 Here is an example filter that replaces non-breaking spaces ~Â ~ in the
15101 Org buffer with =~= for the LaTeX back-end.
15103 #+begin_src emacs-lisp
15104 (defun my-latex-filter-nobreaks (text backend info)
15105 "Ensure \"Â \" are properly handled in LaTeX export."
15106 (when (org-export-derived-backend-p backend 'latex)
15107 (replace-regexp-in-string "Â " "~" text)))
15109 (add-to-list 'org-export-filter-plain-text-functions
15110 'my-latex-filter-nobreaks)
15113 A filter requires three arguments: the code to be transformed, the
15114 name of the back-end, and some optional information about the export
15115 process. The third argument can be safely ignored. Note the use of
15116 ~org-export-derived-backend-p~ predicate that tests for /latex/
15117 back-end or any other back-end, such as /beamer/, derived from
15120 *** Defining filters for individual files
15125 The Org export can filter not just for back-ends, but also for
15126 specific files through the =BIND= keyword. Here is an example with
15127 two filters; one removes brackets from time stamps, and the other
15128 removes strike-through text. The filter functions are defined in
15129 a code block in the same Org file, which is a handy location for
15133 ,#+BIND: org-export-filter-timestamp-functions (tmp-f-timestamp)
15134 ,#+BIND: org-export-filter-strike-through-functions (tmp-f-strike-through)
15135 ,#+BEGIN_SRC emacs-lisp :exports results :results none
15136 (defun tmp-f-timestamp (s backend info)
15137 (replace-regexp-in-string "&[lg]t;\\|[][]" "" s))
15138 (defun tmp-f-strike-through (s backend info) "")
15142 *** Extending an existing back-end
15147 Some parts of the conversion process can be extended for certain
15148 elements so as to introduce a new or revised translation. That is how
15149 the HTML export back-end was extended to handle Markdown format. The
15150 extensions work seamlessly so any aspect of filtering not done by the
15151 extended back-end is handled by the original back-end. Of all the
15152 export customization in Org, extending is very powerful as it operates
15153 at the parser level.
15155 For this example, make the /ascii/ back-end display the language used
15156 in a source code block. Also make it display only when some attribute
15157 is non-~nil~, like the following:
15159 : #+ATTR_ASCII: :language t
15161 Then extend /ascii/ back-end with a custom "my-ascii" back-end.
15163 #+begin_src emacs-lisp
15164 (defun my-ascii-src-block (src-block contents info)
15165 "Transcode a SRC-BLOCK element from Org to ASCII.
15166 CONTENTS is nil. INFO is a plist used as a communication
15168 (if (not (org-export-read-attribute :attr_ascii src-block :language))
15169 (org-export-with-backend 'ascii src-block contents info)
15171 (format ",--[ %s ]--\n%s`----"
15172 (org-element-property :language src-block)
15173 (replace-regexp-in-string
15175 (org-element-normalize-string
15176 (org-export-format-code-default src-block info)))))))
15178 (org-export-define-derived-backend 'my-ascii 'ascii
15179 :translate-alist '((src-block . my-ascii-src-block)))
15182 The ~my-ascii-src-block~ function looks at the attribute above the
15183 current element. If not true, hands over to /ascii/ back-end. If
15184 true, which it is in this example, it creates a box around the code
15185 and leaves room for the inserting a string for language. The last
15186 form creates the new back-end that springs to action only when
15187 translating ~src-block~ type elements.
15189 To use the newly defined back-end, evaluate the following from an Org
15192 #+begin_src emacs-lisp
15193 (org-export-to-buffer 'my-ascii "*Org MY-ASCII Export*")
15196 Further steps to consider would be an interactive function,
15197 self-installing an item in the export dispatcher menu, and other
15198 user-friendly improvements.
15200 ** Export in foreign buffers
15202 :DESCRIPTION: Author tables and lists in Org syntax.
15205 The export back-ends in Org often include commands to convert selected
15206 regions. A convenient feature of this in-place conversion is that the
15207 exported output replaces the original source. Here are such
15210 - ~org-html-convert-region-to-html~ ::
15212 #+findex: org-html-convert-region-to-html
15213 Convert the selected region into HTML.
15215 - ~org-latex-convert-region-to-latex~ ::
15217 #+findex: org-latex-convert-region-to-latex
15218 Convert the selected region into LaTeX.
15220 - ~org-texinfo-convert-region-to-texinfo~ ::
15222 #+findex: org-texinfo-convert-region-to-texinfo
15223 Convert the selected region into Texinfo.
15225 - ~org-md-convert-region-to-md~ ::
15227 #+findex: org-md-convert-region-to-md
15228 Convert the selected region into Markdown.
15230 In-place conversions are particularly handy for quick conversion of
15231 tables and lists in foreign buffers. For example, turn on the minor
15232 mode {{{kbd(M-x orgstruct-mode)}}} in an HTML buffer, then use the
15233 convenient Org keyboard commands to create a list, select it, and
15234 covert it to HTML with {{{kbd(M-x org-html-convert-region-to-html)}}}.
15238 :DESCRIPTION: Create a web site of linked Org files.
15240 #+cindex: publishing
15242 Org includes a publishing management system that allows you to
15243 configure automatic HTML conversion of /projects/ composed of
15244 interlinked org files. You can also configure Org to automatically
15245 upload your exported HTML pages and related attachments, such as
15246 images and source code files, to a web server.
15248 You can also use Org to convert files into PDF, or even combine HTML
15249 and PDF conversion so that files are available in both formats on the
15252 Publishing has been contributed to Org by David O'Toole.
15256 :DESCRIPTION: Defining projects.
15258 Publishing needs significant configuration to specify files,
15259 destination and many other properties of a project.
15261 *** The variable ~org-publish-project-alist~
15263 :DESCRIPTION: The central configuration variable.
15264 :ALT_TITLE: Project alist
15266 #+cindex: projects, for publishing
15268 #+cindex: org-publish-project-alist
15269 Publishing is configured almost entirely through setting the value of
15270 one variable, called ~org-publish-project-alist~. Each element of the
15271 list configures one project, and may be in one of the two following
15274 #+begin_src emacs-lisp
15275 ("project-name" :property value :property value ...)
15278 #+texinfo: @noindent
15279 i.e., a well-formed property list with alternating keys and values,
15282 #+begin_src emacs-lisp
15283 ("project-name" :components ("project-name" "project-name" ...))
15286 In both cases, projects are configured by specifying property values.
15287 A project defines the set of files that are to be published, as well
15288 as the publishing configuration to use when publishing those files.
15289 When a project takes the second form listed above, the individual
15290 members of the ~:components~ property are taken to be sub-projects,
15291 which group together files requiring different publishing options.
15292 When you publish such a "meta-project", all the components are also
15293 published, in the sequence given.
15295 *** Sources and destinations for files
15297 :DESCRIPTION: From here to there.
15298 :ALT_TITLE: Sources and destinations
15300 #+cindex: directories, for publishing
15302 Most properties are optional, but some should always be set. In
15303 particular, Org needs to know where to look for source files, and
15304 where to put published files.
15306 - ~:base-directory~ ::
15308 Directory containing publishing source files.
15310 - ~:publishing-directory~ ::
15312 Directory where output files are published. You can directly
15313 publish to a webserver using a file name syntax appropriate for
15314 the Emacs tramp package. Or you can publish to a local directory
15315 and use external tools to upload your website (see [[*Uploading
15318 - ~:preparation-function~ ::
15320 Function or list of functions to be called before starting the
15321 publishing process, for example, to run =make= for updating files
15322 to be published. Each preparation function is called with
15323 a single argument, the project property list.
15325 - ~:completion-function~ ::
15327 Function or list of functions called after finishing the
15328 publishing process, for example, to change permissions of the
15329 resulting files. Each completion function is called with
15330 a single argument, the project property list.
15332 *** Selecting files
15334 :DESCRIPTION: What files are part of the project?
15336 #+cindex: files, selecting for publishing
15338 By default, all files with extension =.org= in the base directory are
15339 considered part of the project. This can be modified by setting the
15340 following properties
15342 - ~:base-extension~ ::
15344 Extension -- without the dot -- of source files. This actually
15345 is a regular expression. Set this to the symbol ~any~ if you
15346 want to get all files in ~:base-directory~, even without
15351 Regular expression to match file names that should not be published,
15352 even though they have been selected on the basis of their extension.
15356 List of files to be included regardless of ~:base-extension~ and
15361 Non-~nil~ means, check base-directory recursively for files to
15364 *** Publishing action
15366 :DESCRIPTION: Setting the function doing the publishing.
15368 #+cindex: action, for publishing
15370 Publishing means that a file is copied to the destination directory
15371 and possibly transformed in the process. The default transformation
15372 is to export Org files as HTML files, and this is done by the function
15373 ~org-publish-org-to-html~ which calls the HTML exporter (see [[*HTML
15374 export]]). But you can also publish your content as PDF files using
15375 ~org-publish-org-to-pdf~, or as ASCII, Texinfo, etc., using the
15376 corresponding functions.
15378 If you want to publish the Org file as an =.org= file but with
15379 /archived/, /commented/, and /tag-excluded/ trees removed, use
15380 ~org-publish-org-to-org~. This produces =file.org= and put it in the
15381 publishing directory. If you want a htmlized version of this file,
15382 set the parameter ~:htmlized-source~ to ~t~. It produces
15383 =file.org.html= in the publishing directory[fn:130].
15385 Other files like images only need to be copied to the publishing
15386 destination; for this you can use ~org-publish-attachment~. For
15387 non-Org files, you always need to specify the publishing function:
15389 - ~:publishing-function~ ::
15391 Function executing the publication of a file. This may also be
15392 a list of functions, which are all called in turn.
15394 - ~:plain-source~ ::
15396 Non-~nil~ means, publish plain source.
15398 - ~:htmlized-source~ ::
15400 Non-~nil~ means, publish htmlized source.
15402 The function must accept three arguments: a property list containing
15403 at least a ~:publishing-directory~ property, the name of the file to
15404 be published, and the path to the publishing directory of the output
15405 file. It should take the specified file, make the necessary
15406 transformation, if any, and place the result into the destination
15409 *** Options for the exporters
15411 :DESCRIPTION: Tweaking HTML/@LaTeX{} export.
15412 :ALT_TITLE: Publishing options
15414 #+cindex: options, for publishing
15415 #+cindex: publishing options
15417 The property list can be used to set many export options for the HTML
15418 and LaTeX exporters. In most cases, these properties correspond to
15419 user variables in Org. The table below lists these properties along
15420 with the variable they belong to. See the documentation string for
15421 the respective variable for details.
15423 #+vindex: org-publish-project-alist
15424 When a property is given a value in ~org-publish-project-alist~, its
15425 setting overrides the value of the corresponding user variable, if
15426 any, during publishing. Options set within a file (see [[*Export
15427 settings]]), however, override everything.
15429 **** Generic properties
15434 | ~:archived-trees~ | ~org-export-with-archived-trees~ |
15435 | ~:exclude-tags~ | ~org-export-exclude-tags~ |
15436 | ~:headline-levels~ | ~org-export-headline-levels~ |
15437 | ~:language~ | ~org-export-default-language~ |
15438 | ~:preserve-breaks~ | ~org-export-preserve-breaks~ |
15439 | ~:section-numbers~ | ~org-export-with-section-numbers~ |
15440 | ~:select-tags~ | ~org-export-select-tags~ |
15441 | ~:with-author~ | ~org-export-with-author~ |
15442 | ~:with-broken-links~ | ~org-export-with-broken-links~ |
15443 | ~:with-clocks~ | ~org-export-with-clocks~ |
15444 | ~:with-creator~ | ~org-export-with-creator~ |
15445 | ~:with-date~ | ~org-export-with-date~ |
15446 | ~:with-drawers~ | ~org-export-with-drawers~ |
15447 | ~:with-email~ | ~org-export-with-email~ |
15448 | ~:with-emphasize~ | ~org-export-with-emphasize~ |
15449 | ~:with-fixed-width~ | ~org-export-with-fixed-width~ |
15450 | ~:with-footnotes~ | ~org-export-with-footnotes~ |
15451 | ~:with-latex~ | ~org-export-with-latex~ |
15452 | ~:with-planning~ | ~org-export-with-planning~ |
15453 | ~:with-priority~ | ~org-export-with-priority~ |
15454 | ~:with-properties~ | ~org-export-with-properties~ |
15455 | ~:with-special-strings~ | ~org-export-with-special-strings~ |
15456 | ~:with-sub-superscript~ | ~org-export-with-sub-superscripts~ |
15457 | ~:with-tables~ | ~org-export-with-tables~ |
15458 | ~:with-tags~ | ~org-export-with-tags~ |
15459 | ~:with-tasks~ | ~org-export-with-tasks~ |
15460 | ~:with-timestamps~ | ~org-export-with-timestamps~ |
15461 | ~:with-title~ | ~org-export-with-title~ |
15462 | ~:with-toc~ | ~org-export-with-toc~ |
15463 | ~:with-todo-keywords~ | ~org-export-with-todo-keywords~ |
15465 **** ASCII specific properties
15470 | ~:ascii-bullets~ | ~org-ascii-bullets~ |
15471 | ~:ascii-caption-above~ | ~org-ascii-caption-above~ |
15472 | ~:ascii-charset~ | ~org-ascii-charset~ |
15473 | ~:ascii-global-margin~ | ~org-ascii-global-margin~ |
15474 | ~:ascii-format-drawer-function~ | ~org-ascii-format-drawer-function~ |
15475 | ~:ascii-format-inlinetask-function~ | ~org-ascii-format-inlinetask-function~ |
15476 | ~:ascii-headline-spacing~ | ~org-ascii-headline-spacing~ |
15477 | ~:ascii-indented-line-width~ | ~org-ascii-indented-line-width~ |
15478 | ~:ascii-inlinetask-width~ | ~org-ascii-inlinetask-width~ |
15479 | ~:ascii-inner-margin~ | ~org-ascii-inner-margin~ |
15480 | ~:ascii-links-to-notes~ | ~org-ascii-links-to-notes~ |
15481 | ~:ascii-list-margin~ | ~org-ascii-list-margin~ |
15482 | ~:ascii-paragraph-spacing~ | ~org-ascii-paragraph-spacing~ |
15483 | ~:ascii-quote-margin~ | ~org-ascii-quote-margin~ |
15484 | ~:ascii-table-keep-all-vertical-lines~ | ~org-ascii-table-keep-all-vertical-lines~ |
15485 | ~:ascii-table-use-ascii-art~ | ~org-ascii-table-use-ascii-art~ |
15486 | ~:ascii-table-widen-columns~ | ~org-ascii-table-widen-columns~ |
15487 | ~:ascii-text-width~ | ~org-ascii-text-width~ |
15488 | ~:ascii-underline~ | ~org-ascii-underline~ |
15489 | ~:ascii-verbatim-format~ | ~org-ascii-verbatim-format~ |
15491 **** Beamer specific properties
15496 | ~:beamer-theme~ | ~org-beamer-theme~ |
15497 | ~:beamer-column-view-format~ | ~org-beamer-column-view-format~ |
15498 | ~:beamer-environments-extra~ | ~org-beamer-environments-extra~ |
15499 | ~:beamer-frame-default-options~ | ~org-beamer-frame-default-options~ |
15500 | ~:beamer-outline-frame-options~ | ~org-beamer-outline-frame-options~ |
15501 | ~:beamer-outline-frame-title~ | ~org-beamer-outline-frame-title~ |
15502 | ~:beamer-subtitle-format~ | ~org-beamer-subtitle-format~ |
15504 **** HTML specific properties
15509 | ~:html-allow-name-attribute-in-anchors~ | ~org-html-allow-name-attribute-in-anchors~ |
15510 | ~:html-checkbox-type~ | ~org-html-checkbox-type~ |
15511 | ~:html-container~ | ~org-html-container-element~ |
15512 | ~:html-divs~ | ~org-html-divs~ |
15513 | ~:html-doctype~ | ~org-html-doctype~ |
15514 | ~:html-extension~ | ~org-html-extension~ |
15515 | ~:html-footnote-format~ | ~org-html-footnote-format~ |
15516 | ~:html-footnote-separator~ | ~org-html-footnote-separator~ |
15517 | ~:html-footnotes-section~ | ~org-html-footnotes-section~ |
15518 | ~:html-format-drawer-function~ | ~org-html-format-drawer-function~ |
15519 | ~:html-format-headline-function~ | ~org-html-format-headline-function~ |
15520 | ~:html-format-inlinetask-function~ | ~org-html-format-inlinetask-function~ |
15521 | ~:html-head-extra~ | ~org-html-head-extra~ |
15522 | ~:html-head-include-default-style~ | ~org-html-head-include-default-style~ |
15523 | ~:html-head-include-scripts~ | ~org-html-head-include-scripts~ |
15524 | ~:html-head~ | ~org-html-head~ |
15525 | ~:html-home/up-format~ | ~org-html-home/up-format~ |
15526 | ~:html-html5-fancy~ | ~org-html-html5-fancy~ |
15527 | ~:html-indent~ | ~org-html-indent~ |
15528 | ~:html-infojs-options~ | ~org-html-infojs-options~ |
15529 | ~:html-infojs-template~ | ~org-html-infojs-template~ |
15530 | ~:html-inline-image-rules~ | ~org-html-inline-image-rules~ |
15531 | ~:html-inline-images~ | ~org-html-inline-images~ |
15532 | ~:html-link-home~ | ~org-html-link-home~ |
15533 | ~:html-link-org-files-as-html~ | ~org-html-link-org-files-as-html~ |
15534 | ~:html-link-up~ | ~org-html-link-up~ |
15535 | ~:html-link-use-abs-url~ | ~org-html-link-use-abs-url~ |
15536 | ~:html-mathjax-options~ | ~org-html-mathjax-options~ |
15537 | ~:html-mathjax-template~ | ~org-html-mathjax-template~ |
15538 | ~:html-metadata-timestamp-format~ | ~org-html-metadata-timestamp-format~ |
15539 | ~:html-postamble-format~ | ~org-html-postamble-format~ |
15540 | ~:html-postamble~ | ~org-html-postamble~ |
15541 | ~:html-preamble-format~ | ~org-html-preamble-format~ |
15542 | ~:html-preamble~ | ~org-html-preamble~ |
15543 | ~:html-table-align-individual-field~ | ~de{org-html-table-align-individual-fields~ |
15544 | ~:html-table-attributes~ | ~org-html-table-default-attributes~ |
15545 | ~:html-table-caption-above~ | ~org-html-table-caption-above~ |
15546 | ~:html-table-data-tags~ | ~org-html-table-data-tags~ |
15547 | ~:html-table-header-tags~ | ~org-html-table-header-tags~ |
15548 | ~:html-table-row-tags~ | ~org-html-table-row-tags~ |
15549 | ~:html-table-use-header-tags-for-first-column~ | ~org-html-table-use-header-tags-for-first-column~ |
15550 | ~:html-tag-class-prefix~ | ~org-html-tag-class-prefix~ |
15551 | ~:html-text-markup-alist~ | ~org-html-text-markup-alist~ |
15552 | ~:html-todo-kwd-class-prefix~ | ~org-html-todo-kwd-class-prefix~ |
15553 | ~:html-toplevel-hlevel~ | ~org-html-toplevel-hlevel~ |
15554 | ~:html-use-infojs~ | ~org-html-use-infojs~ |
15555 | ~:html-validation-link~ | ~org-html-validation-link~ |
15556 | ~:html-viewport~ | ~org-html-viewport~ |
15557 | ~:html-xml-declaration~ | ~org-html-xml-declaration~ |
15559 **** LaTeX specific properties
15564 | ~:latex-active-timestamp-format~ | ~org-latex-active-timestamp-format~ |
15565 | ~:latex-caption-above~ | ~org-latex-caption-above~ |
15566 | ~:latex-classes~ | ~org-latex-classes~ |
15567 | ~:latex-class~ | ~org-latex-default-class~ |
15568 | ~:latex-compiler~ | ~org-latex-compiler~ |
15569 | ~:latex-default-figure-position~ | ~org-latex-default-figure-position~ |
15570 | ~:latex-default-table-environment~ | ~org-latex-default-table-environment~ |
15571 | ~:latex-default-table-mode~ | ~org-latex-default-table-mode~ |
15572 | ~:latex-diary-timestamp-format~ | ~org-latex-diary-timestamp-format~ |
15573 | ~:latex-footnote-defined-format~ | ~org-latex-footnote-defined-format~ |
15574 | ~:latex-footnote-separator~ | ~org-latex-footnote-separator~ |
15575 | ~:latex-format-drawer-function~ | ~org-latex-format-drawer-function~ |
15576 | ~:latex-format-headline-function~ | ~org-latex-format-headline-function~ |
15577 | ~:latex-format-inlinetask-function~ | ~org-latex-format-inlinetask-function~ |
15578 | ~:latex-hyperref-template~ | ~org-latex-hyperref-template~ |
15579 | ~:latex-image-default-height~ | ~org-latex-image-default-height~ |
15580 | ~:latex-image-default-option~ | ~org-latex-image-default-option~ |
15581 | ~:latex-image-default-width~ | ~org-latex-image-default-width~ |
15582 | ~:latex-images-centered~ | ~org-latex-images-centered~ |
15583 | ~:latex-inactive-timestamp-format~ | ~org-latex-inactive-timestamp-format~ |
15584 | ~:latex-inline-image-rules~ | ~org-latex-inline-image-rules~ |
15585 | ~:latex-link-with-unknown-path-format~ | ~org-latex-link-with-unknown-path-format~ |
15586 | ~:latex-listings-langs~ | ~org-latex-listings-langs~ |
15587 | ~:latex-listings-options~ | ~org-latex-listings-options~ |
15588 | ~:latex-listings~ | ~org-latex-listings~ |
15589 | ~:latex-minted-langs~ | ~org-latex-minted-langs~ |
15590 | ~:latex-minted-options~ | ~org-latex-minted-options~ |
15591 | ~:latex-prefer-user-labels~ | ~org-latex-prefer-user-labels~ |
15592 | ~:latex-subtitle-format~ | ~org-latex-subtitle-format~ |
15593 | ~:latex-subtitle-separate~ | ~org-latex-subtitle-separate~ |
15594 | ~:latex-table-scientific-notation~ | ~org-latex-table-scientific-notation~ |
15595 | ~:latex-tables-booktabs~ | ~org-latex-tables-booktabs~ |
15596 | ~:latex-tables-centered~ | ~org-latex-tables-centered~ |
15597 | ~:latex-text-markup-alist~ | ~org-latex-text-markup-alist~ |
15598 | ~:latex-title-command~ | ~org-latex-title-command~ |
15599 | ~:latex-toc-command~ | ~org-latex-toc-command~ |
15601 **** Markdown specific properties
15606 | ~:md-footnote-format~ | ~org-md-footnote-format~ |
15607 | ~:md-footnotes-section~ | ~org-md-footnotes-section~ |
15608 | ~:md-headline-style~ | ~org-md-headline-style~ |
15610 **** ODT specific properties
15615 | ~:odt-content-template-file~ | ~org-odt-content-template-file~ |
15616 | ~:odt-display-outline-level~ | ~org-odt-display-outline-level~ |
15617 | ~:odt-fontify-srcblocks~ | ~org-odt-fontify-srcblocks~ |
15618 | ~:odt-format-drawer-function~ | ~org-odt-format-drawer-function~ |
15619 | ~:odt-format-headline-function~ | ~org-odt-format-headline-function~ |
15620 | ~:odt-format-inlinetask-function~ | ~org-odt-format-inlinetask-function~ |
15621 | ~:odt-inline-formula-rules~ | ~org-odt-inline-formula-rules~ |
15622 | ~:odt-inline-image-rules~ | ~org-odt-inline-image-rules~ |
15623 | ~:odt-pixels-per-inch~ | ~org-odt-pixels-per-inch~ |
15624 | ~:odt-styles-file~ | ~org-odt-styles-file~ |
15625 | ~:odt-table-styles~ | ~org-odt-table-styles~ |
15626 | ~:odt-use-date-fields~ | ~org-odt-use-date-fields~ |
15628 **** Texinfo specific properties
15633 | ~:texinfo-active-timestamp-format~ | ~org-texinfo-active-timestamp-format~ |
15634 | ~:texinfo-classes~ | ~org-texinfo-classes~ |
15635 | ~:texinfo-class~ | ~org-texinfo-default-class~ |
15636 | ~:texinfo-table-default-markup~ | ~org-texinfo-table-default-markup~ |
15637 | ~:texinfo-diary-timestamp-format~ | ~org-texinfo-diary-timestamp-format~ |
15638 | ~:texinfo-filename~ | ~org-texinfo-filename~ |
15639 | ~:texinfo-format-drawer-function~ | ~org-texinfo-format-drawer-function~ |
15640 | ~:texinfo-format-headline-function~ | ~org-texinfo-format-headline-function~ |
15641 | ~:texinfo-format-inlinetask-function~ | ~org-texinfo-format-inlinetask-function~ |
15642 | ~:texinfo-inactive-timestamp-format~ | ~org-texinfo-inactive-timestamp-format~ |
15643 | ~:texinfo-link-with-unknown-path-format~ | ~org-texinfo-link-with-unknown-path-format~ |
15644 | ~:texinfo-node-description-column~ | ~org-texinfo-node-description-column~ |
15645 | ~:texinfo-table-scientific-notation~ | ~org-texinfo-table-scientific-notation~ |
15646 | ~:texinfo-tables-verbatim~ | ~org-texinfo-tables-verbatim~ |
15647 | ~:texinfo-text-markup-alist~ | ~org-texinfo-text-markup-alist~ |
15649 *** Publishing links
15651 :DESCRIPTION: Which links keep working after publishing?
15653 #+cindex: links, publishing
15655 To create a link from one Org file to another, you would use something
15656 like =[[file:foo.org][The foo]]= or simply =[[file:foo.org]]= (see [[*External links]]). When
15657 published, this link becomes a link to =foo.html=. You can thus
15658 interlink the pages of your "Org web" project and the links will work
15659 as expected when you publish them to HTML. If you also publish the
15660 Org source file and want to link to it, use an =http= link instead of
15661 a =file:= link, because =file= links are converted to link to the
15662 corresponding =.html= file.
15664 You may also link to related files, such as images. Provided you are
15665 careful with relative file names, and provided you have also
15666 configured Org to upload the related files, these links will work too.
15667 See [[*Example: complex publishing configuration]], for an example of this
15670 Eventually, links between published documents can contain some search
15671 options (see [[*Search options in file links]]), which will be resolved to
15672 the appropriate location in the linked file. For example, once
15673 published to HTML, the following links all point to a dedicated anchor
15677 [[file:foo.org::*heading]]
15678 [[file:foo.org::#custom-id]]
15679 [[file:foo.org::target]]
15682 *** Generating a sitemap
15684 :DESCRIPTION: Generating a list of all pages.
15685 :ALT_TITLE: Site map
15687 #+cindex: sitemap, of published pages
15689 The following properties may be used to control publishing of
15690 a map of files for a given project.
15692 - ~:auto-sitemap~ ::
15694 When non-~nil~, publish a sitemap during
15695 ~org-publish-current-project~ or ~org-publish-all~.
15697 - ~:sitemap-filename~ ::
15699 Filename for output of sitemap. Defaults to =sitemap.org=, which
15700 becomes =sitemap.html=.
15702 - ~:sitemap-title~ ::
15704 Title of sitemap page. Defaults to name of file.
15706 - ~:sitemap-format-entry~ ::
15708 #+findex: org-publish-find-date
15709 #+findex: org-publish-find-property
15710 #+findex: org-publish-find-title
15711 With this option one can tell how a site-map entry is formatted
15712 in the site-map. It is a function called with three arguments:
15713 the file or directory name relative to base directory of the
15714 project, the site-map style and the current project. It is
15715 expected to return a string. Default value turns file names into
15716 links and use document titles as descriptions. For specific
15717 formatting needs, one can use ~org-publish-find-date~,
15718 ~org-publish-find-title~ and ~org-publish-find-property~, to
15719 retrieve additional information about published documents.
15721 - ~:sitemap-function~ ::
15723 Plug-in function to use for generation of the sitemap. It is
15724 called with two arguments: the title of the site-map and
15725 a representation of the files and directories involved in the
15726 project as a radio list (see [[*Radio lists]]). The latter can
15727 further be transformed using ~org-list-to-generic~,
15728 ~org-list-to-subtree~ and alike. Default value generates a plain
15729 list of links to all files in the project.
15731 - ~:sitemap-sort-folders~ ::
15733 Where folders should appear in the sitemap. Set this to ~first~
15734 (default) or ~last~ to display folders first or last,
15735 respectively. When set to ~ignore~, folders are ignored
15736 altogether. Any other value mixes files and folders. This
15737 variable has no effect when site-map style is ~tree~.
15739 - ~:sitemap-sort-files~ ::
15741 How the files are sorted in the site map. Set this to
15742 ~alphabetically~ (default), ~chronologically~ or
15743 ~anti-chronologically~. ~chronologically~ sorts the files with
15744 older date first while ~anti-chronologically~ sorts the files
15745 with newer date first. ~alphabetically~ sorts the files
15746 alphabetically. The date of a file is retrieved with
15747 ~org-publish-find-date~.
15749 - ~:sitemap-ignore-case~ ::
15751 Should sorting be case-sensitive? Default ~nil~.
15753 - ~:sitemap-file-entry-format~ ::
15755 With this option one can tell how a sitemap's entry is formatted
15756 in the sitemap. This is a format string with some escape
15757 sequences: ~%t~ stands for the title of the file, ~%a~ stands for
15758 the author of the file and ~%d~ stands for the date of the file.
15759 The date is retrieved with the ~org-publish-find-date~ function
15760 and formatted with ~org-publish-sitemap-date-format~. Default
15763 - ~:sitemap-date-format~ ::
15765 Format string for the ~format-time-string~ function that tells
15766 how a sitemap entry's date is to be formatted. This property
15767 bypasses ~org-publish-sitemap-date-format~ which defaults to
15770 *** Generating an index
15772 :DESCRIPTION: An index that reaches across pages.
15774 #+cindex: index, in a publishing project
15776 Org mode can generate an index across the files of a publishing project.
15780 When non-~nil~, generate in index in the file =theindex.org= and
15781 publish it as =theindex.html=.
15783 The file is created when first publishing a project with the
15784 ~:makeindex~ set. The file only contains a statement =#+INCLUDE:
15785 "theindex.inc"=. You can then build around this include statement by
15786 adding a title, style information, etc.
15788 #+cindex: INDEX, keyword
15789 Index entries are specified with =INDEX= keyword. An entry that
15790 contains an exclamation mark creates a sub item.
15793 ,*** Curriculum Vitae
15795 ,#+INDEX: Application!CV
15800 :DESCRIPTION: How to get files up on the server.
15805 For those people already utilizing third party sync tools such as
15806 Rsync or Unison, it might be preferable not to use the built-in remote
15807 publishing facilities of Org mode which rely heavily on Tramp. Tramp,
15808 while very useful and powerful, tends not to be so efficient for
15809 multiple file transfer and has been known to cause problems under
15812 Specialized synchronization utilities offer several advantages. In
15813 addition to timestamp comparison, they also do content and
15814 permissions/attribute checks. For this reason you might prefer to
15815 publish your web to a local directory -- possibly even /in place/ with
15816 your Org files -- and then use Unison or Rsync to do the
15817 synchronization with the remote host.
15819 Since Unison, for example, can be configured as to which files to
15820 transfer to a certain remote destination, it can greatly simplify the
15821 project publishing definition. Simply keep all files in the correct
15822 location, process your Org files with ~org-publish~ and let the
15823 synchronization tool do the rest. You do not need, in this scenario,
15824 to include attachments such as JPG, CSS or PNG files in the project
15825 definition since the third-party tool syncs them.
15827 Publishing to a local directory is also much faster than to a remote
15828 one, so that you can afford more easily to republish entire projects.
15829 If you set ~org-publish-use-timestamps-flag~ to ~nil~, you gain the
15830 main benefit of re-including any changed external files such as source
15831 example files you might include with =INCLUDE= keyword. The timestamp
15832 mechanism in Org is not smart enough to detect if included files have
15835 ** Sample configuration
15837 :DESCRIPTION: Example projects.
15840 Below we provide two example configurations. The first one is
15841 a simple project publishing only a set of Org files. The second
15842 example is more complex, with a multi-component project.
15844 *** Example: simple publishing configuration
15846 :DESCRIPTION: One-component publishing.
15847 :ALT_TITLE: Simple example
15850 This example publishes a set of Org files to the =public_html=
15851 directory on the local machine.
15853 #+begin_src emacs-lisp
15854 (setq org-publish-project-alist
15856 :base-directory "~/org/"
15857 :publishing-directory "~/public_html"
15858 :section-numbers nil
15859 :table-of-contents nil
15860 :style "<link rel=\"stylesheet\"
15861 href=\"../other/mystyle.css\"
15862 type=\"text/css\"/>")))
15865 *** Example: complex publishing configuration
15867 :DESCRIPTION: A multi-component publishing example.
15868 :ALT_TITLE: Complex example
15871 This more complicated example publishes an entire website, including
15872 Org files converted to HTML, image files, Emacs Lisp source code, and
15873 style sheets. The publishing directory is remote and private files
15876 To ensure that links are preserved, care should be taken to replicate
15877 your directory structure on the web server, and to use relative file
15878 paths. For example, if your Org files are kept in =~/org/= and your
15879 publishable images in =~/images/=, you would link to an image with
15881 : file:../images/myimage.png
15883 On the web server, the relative path to the image should be the same.
15884 You can accomplish this by setting up an =images/= folder in the right
15885 place on the web server, and publishing images to it.
15887 #+begin_src emacs-lisp
15888 (setq org-publish-project-alist
15890 :base-directory "~/org/"
15891 :base-extension "org"
15892 :publishing-directory "/ssh:user@host:~/html/notebook/"
15893 :publishing-function org-html-publish-to-html
15894 :exclude "PrivatePage.org" ;; regexp
15896 :section-numbers nil
15898 :html-head "<link rel=\"stylesheet\"
15899 href=\"../other/mystyle.css\" type=\"text/css\"/>"
15903 :base-directory "~/images/"
15904 :base-extension "jpg\\|gif\\|png"
15905 :publishing-directory "/ssh:user@host:~/html/images/"
15906 :publishing-function org-publish-attachment)
15909 :base-directory "~/other/"
15910 :base-extension "css\\|el"
15911 :publishing-directory "/ssh:user@host:~/html/other/"
15912 :publishing-function org-publish-attachment)
15913 ("website" :components ("orgfiles" "images" "other"))))
15916 ** Triggering publication
15918 :DESCRIPTION: Publication commands.
15921 Once properly configured, Org can publish with the following commands:
15923 - {{{kbd(C-c C-e X)}}} (~org-publish~) ::
15925 #+kindex: C-c C-e X
15926 #+findex: org-publish
15927 Prompt for a specific project and publish all files that belong
15930 - {{{kbd(C-c C-e P)}}} (~org-publish-current-project~) ::
15932 #+kindex: C-c C-e P
15933 #+findex: org-publish-current-project
15934 Publish the project containing the current file.
15936 - {{{kbd(C-c C-e F)}}} (~org-publish-current-file~) ::
15938 #+kindex: C-c C-e F
15939 #+findex: org-publish-current-file
15940 Publish only the current file.
15942 - {{{kbd(C-c C-e E)}}} (~org-publish-all~) ::
15944 #+kindex: C-c C-e E
15945 #+findex: org-publish-all
15946 Publish every project.
15948 #+vindex: org-publish-use-timestamps-flag
15949 Org uses timestamps to track when a file has changed. The above
15950 functions normally only publish changed files. You can override this
15951 and force publishing of all files by giving a prefix argument to any
15952 of the commands above, or by customizing the variable
15953 ~org-publish-use-timestamps-flag~. This may be necessary in
15954 particular if files include other files via =SETUPFILE= or =INCLUDE=
15957 * Working with source code
15959 :DESCRIPTION: Export, evaluate, and tangle code blocks.
15961 #+cindex: source code, working with
15963 Source code here refers to any plain text collection of computer
15964 instructions, possibly with comments, written using a human-readable
15965 programming language. Org can manage source code in an Org document
15966 when the source code is identified with begin and end markers.
15967 Working with source code begins with identifying source code blocks.
15968 A source code block can be placed almost anywhere in an Org document;
15969 it is not restricted to the preamble or the end of the document.
15970 However, Org cannot manage a source code block if it is placed inside
15971 an Org comment or within a fixed width section.
15973 Here is an example source code block in the Emacs Lisp language:
15976 ,#+BEGIN_SRC emacs-lisp
15977 (defun org-xor (a b)
15983 Org can manage the source code in the block delimited by =#+BEGIN_SRC=
15984 ... =#+END_SRC= in several ways that can simplify housekeeping tasks
15985 essential to modern source code maintenance. Org can edit, format,
15986 extract, export, and publish source code blocks. Org can also compile
15987 and execute a source code block, then capture the results. The Org
15988 mode literature sometimes refers to source code blocks as /live code/
15989 blocks because they can alter the content of the Org document or the
15990 material that it exports. Users can control how live they want each
15991 source code block by tweaking the header arguments (see [[*Using
15992 header arguments]]) for compiling, execution, extraction, and
15995 Source code blocks are one of many Org block types, which also include
15996 =quote=, =export=, =verse=, =latex=, =example=, and =verbatim=. This
15997 section pertains to blocks between =#+BEGIN_SRC= and =#+END_SRC=.
15999 For editing and formatting a source code block, Org uses an
16000 appropriate Emacs major mode that includes features specifically
16001 designed for source code in that language.
16003 Org can extract one or more source code blocks and write them to one
16004 or more source files---a process known as /tangling/ in literate
16005 programming terminology.
16007 For exporting and publishing, Org's back-ends can format a source code
16008 block appropriately, often with native syntax highlighting.
16010 For executing and compiling a source code block, the user can
16011 configure Org to select the appropriate compiler. Org provides
16012 facilities to collect the result of the execution or compiler output,
16013 insert it into the Org document, and/or export it. In addition to
16014 text results, Org can insert links to other data types, including
16015 audio, video, and graphics. Org can also link a compiler error
16016 message to the appropriate line in the source code block.
16018 An important feature of Org's management of source code blocks is the
16019 ability to pass variables, functions, and results to one another using
16020 a common syntax for source code blocks in any language. Although most
16021 literate programming facilities are restricted to one language or
16022 another, Org's language-agnostic approach lets the literate programmer
16023 match each programming task with the appropriate computer language and
16024 to mix them all together in a single Org document. This
16025 interoperability among languages explains why Org's source code
16026 management facility was named /Org Babel/ by its originators, Eric
16027 Schulte and Dan Davison.
16029 Org mode fulfills the promise of easy verification and maintenance of
16030 publishing reproducible research by keeping text, data, code,
16031 configuration settings of the execution environment, the results of
16032 the execution, and associated narratives, claims, references, and
16033 internal and external links in a single Org document.
16035 Details of Org's facilities for working with source code are described
16036 in the following sections.
16038 ** Structure of code blocks
16040 :DESCRIPTION: Code block syntax described.
16042 #+cindex: code block, structure
16043 #+cindex: source code, block structure
16044 #+cindex: NAME keyword, in source blocks
16045 #+cindex: BEGIN_SRC
16047 Org offers two ways to structure source code in Org documents: in
16048 a source code block, and directly inline. Both specifications are
16051 A source code block conforms to this structure:
16055 ,#+BEGIN_SRC <language> <switches> <header arguments>
16060 Do not be put-off by having to remember the source block syntax. Org
16061 mode offers a command for wrapping existing text in a block (see
16062 [[*Structure templates]]). Org also works with other completion systems
16063 in Emacs, some of which predate Org and have custom domain-specific
16064 languages for defining templates. Regular use of templates reduces
16065 errors, increases accuracy, and maintains consistency.
16067 #+cindex: source code, inline
16068 An inline code block conforms to this structure:
16070 : src_<language>{<body>}
16072 #+texinfo: @noindent
16075 : src_<language>[<header arguments>]{<body>}
16077 - =#+NAME: <name>= ::
16079 Optional. Names the source block so it can be called, like
16080 a function, from other source blocks or inline code to evaluate
16081 or to capture the results. Code from other blocks, other files,
16082 and from table formulas (see [[*The spreadsheet]]) can use the name
16083 to reference a source block. This naming serves the same purpose
16084 as naming Org tables. Org mode requires unique names. For
16085 duplicate names, Org mode's behavior is undefined.
16087 - =#+BEGIN_SRC= ... =#+END_SRC= ::
16089 Mandatory. They mark the start and end of a block that Org
16090 requires. The =#+BEGIN_SRC= line takes additional arguments, as
16095 #+cindex: language, in code blocks
16096 Mandatory. It is the identifier of the source code language in
16097 the block. See [[*Languages]], for identifiers of supported
16102 #+cindex: switches, in code blocks
16103 Optional. Switches provide finer control of the code execution,
16104 export, and format (see the discussion of switches in [[*Literal
16107 - =<header arguments>= ::
16109 #+cindex: header arguments, in code blocks
16110 Optional. Heading arguments control many aspects of evaluation,
16111 export and tangling of code blocks (see [[*Using header arguments]]).
16112 Using Org's properties feature, header arguments can be
16113 selectively applied to the entire buffer or specific sub-trees of
16118 Source code in the dialect of the specified language identifier.
16120 ** Using header arguments
16122 :DESCRIPTION: Different ways to set header arguments.
16125 Org comes with many header arguments common to all languages. New
16126 header arguments are added for specific languages as they become
16127 available for use in source code blocks. A header argument is
16128 specified with an initial colon followed by the argument's name in
16131 Since header arguments can be set in several ways, Org prioritizes
16132 them in case of overlaps or conflicts by giving local settings
16133 a higher priority. Header values in function calls, for example,
16134 override header values from global defaults.
16136 *** System-wide header arguments
16140 #+vindex: org-babel-default-header-args
16142 #+vindex: org-babel-default-header-args
16143 System-wide values of header arguments can be specified by customizing
16144 the ~org-babel-default-header-args~ variable, which defaults to the
16149 :results => "replace"
16155 The example below sets =:noweb= header arguments to =yes=, which makes
16156 Org expand =:noweb= references by default.
16158 #+begin_src emacs-lisp
16159 (setq org-babel-default-header-args
16160 (cons '(:noweb . "yes")
16161 (assq-delete-all :noweb org-babel-default-header-args)))
16164 #+cindex: language specific default header arguments
16165 #+cindex: default header arguments per language
16166 Each language can have separate default header arguments by
16167 customizing the variable ~org-babel-default-header-args:<LANG>~, where
16168 {{{var(<LANG>)}}} is the name of the language. For details, see the
16169 language-specific online documentation at
16170 http://orgmode.org/worg/org-contrib/babel.
16172 *** Header arguments in Org mode properties
16177 For header arguments applicable to the buffer, use =PROPERTY= keyword
16178 anywhere in the Org file (see [[*Property syntax]]).
16180 The following example makes all the R code blocks execute in the same
16181 session. Setting =:results= to =silent= ignores the results of
16182 executions for all blocks, not just R code blocks; no results inserted
16186 ,#+PROPERTY: header-args:R :session *R*
16187 ,#+PROPERTY: header-args :results silent
16190 #+vindex: org-use-property-inheritance
16191 Header arguments set through Org's property drawers (see [[*Property
16192 syntax]]) apply at the sub-tree level on down. Since these property
16193 drawers can appear anywhere in the file hierarchy, Org uses outermost
16194 call or source block to resolve the values. Org ignores
16195 ~org-use-property-inheritance~ setting.
16197 In this example, =:cache= defaults to =yes= for all code blocks in the
16203 :header-args: :cache yes
16207 #+kindex: C-c C-x p
16208 #+findex: org-set-property
16209 Properties defined through ~org-set-property~ function, bound to
16210 {{{kbd(C-c C-x p)}}}, apply to all active languages. They override
16211 properties set in ~org-babel-default-header-args~.
16213 #+cindex: language specific header arguments properties
16214 #+cindex: header arguments per language
16215 Language-specific header arguments are also read from properties
16216 =header-args:<LANG>= where {{{var(<LANG>)}}} is the language
16217 identifier. For example,
16222 :header-args:clojure: :session *clojure-1*
16223 :header-args:R: :session *R*
16227 :header-args:clojure: :session *clojure-2*
16231 #+texinfo: @noindent
16232 would force separate sessions for Clojure blocks in =Heading= and
16233 =Subheading=, but use the same session for all R blocks. Blocks in
16234 =Subheading= inherit settings from =Heading=.
16236 *** Code block specific header arguments
16241 Header arguments are most commonly set at the source code block level,
16242 on the =#+BEGIN_SRC= line. Arguments set at this level take
16243 precedence over those set in the ~org-babel-default-header-args~
16244 variable, and also those set as header properties.
16246 In the following example, setting =:results= to =silent= makes it
16247 ignore results of the code execution. Setting =:exports= to =code=
16248 exports only the body of the code block to HTML or LaTeX.
16252 ,#+BEGIN_SRC haskell :results silent :exports code :var n=0
16254 fac n = n * fac (n-1)
16258 The same header arguments in an inline code block:
16260 : src_haskell[:exports both]{fac 5}
16262 #+cindex: HEADER, keyword
16263 Code block header arguments can span multiple lines using =#+HEADER:=
16264 on each line. Note that Org currently accepts the plural spelling of
16265 =#+HEADER:= only as a convenience for backward-compatibility. It may
16266 be removed at some point.
16268 Multi-line header arguments on an unnamed code block:
16271 ,#+HEADER: :var data1=1
16272 ,#+BEGIN_SRC emacs-lisp :var data2=2
16273 (message "data1:%S, data2:%S" data1 data2)
16280 Multi-line header arguments on a named code block:
16283 ,#+NAME: named-block
16284 ,#+HEADER: :var data=2
16285 ,#+BEGIN_SRC emacs-lisp
16286 (message "data:%S" data)
16289 ,#+RESULTS: named-block
16293 *** Header arguments in function calls
16298 Header arguments in function calls are the most specific and override
16299 all other settings in case of an overlap. They get the highest
16300 priority. Two =#+CALL:= examples are shown below. For the complete
16301 syntax of =CALL= keyword, see [[*Evaluating code blocks]].
16303 In this example, =:exports results= header argument is applied to the
16304 evaluation of the =#+CALL:= line.
16306 : #+CALL: factorial(n=5) :exports results
16308 In this example, =:session special= header argument is applied to the
16309 evaluation of =factorial= code block.
16311 : #+CALL: factorial[:session special](n=5)
16313 ** Environment of a code block
16315 :DESCRIPTION: Arguments, sessions, working directory...
16318 *** Passing arguments
16323 #+cindex: passing arguments to code blocks
16324 #+cindex: arguments, in code blocks
16325 #+cindex: @samp{var}, header argument
16326 Use =var= for passing arguments to source code blocks. The specifics
16327 of variables in code blocks vary by the source language and are
16328 covered in the language-specific documentation. The syntax for =var=,
16329 however, is the same for all languages. This includes declaring
16330 a variable, and assigning a default value.
16332 The following syntax is used to pass arguments to code blocks using
16333 the =var= header argument.
16337 #+texinfo: @noindent
16338 {{{var(NAME)}}} is the name of the variable bound in the code block
16339 body. {{{var(ASSIGN)}}} is a literal value, such as a string,
16340 a number, a reference to a table, a list, a literal example, another
16341 code block -- with or without arguments --, or the results of
16342 evaluating a code block.
16344 Here are examples of passing values by reference:
16348 A table named with a =NAME= keyword.
16351 ,#+NAME: example-table
16357 ,#+NAME: table-length
16358 ,#+BEGIN_SRC emacs-lisp :var table=example-table
16362 ,#+RESULTS: table-length
16366 When passing a table, you can treat specially the row, or the
16367 column, containing labels for the columns, or the rows, in the
16370 #+cindex: @samp{colnames}, header argument
16371 The =colnames= header argument accepts =yes=, =no=, or =nil=
16372 values. The default value is =nil=: if an input table has column
16373 names -- because the second row is a horizontal rule --, then Org
16374 removes the column names, processes the table, puts back the
16375 column names, and then writes the table to the results block.
16376 Using =yes=, Org does the same to the first row, even if the
16377 initial table does not contain any horizontal rule. When set to
16378 =no=, Org does not pre-process column names at all.
16387 ,#+BEGIN_SRC python :var tab=less-cols :colnames nil
16388 return [[val + '*' for val in row] for row in tab]
16398 #+cindex: @samp{rownames}, header argument
16399 Similarly, the =rownames= header argument can take two values:
16400 =yes= or =no=. When set to =yes=, Org removes the first column,
16401 processes the table, puts back the first column, and then writes
16402 the table to the results block. The default is =no=, which means
16403 Org does not pre-process the first column. Note that Emacs Lisp
16404 code blocks ignore =rownames= header argument because of the ease
16405 of table-handling in Emacs.
16408 ,#+NAME: with-rownames
16409 | one | 1 | 2 | 3 | 4 | 5 |
16410 | two | 6 | 7 | 8 | 9 | 10 |
16412 ,#+BEGIN_SRC python :var tab=with-rownames :rownames yes
16413 return [[val + 10 for val in row] for row in tab]
16417 | one | 11 | 12 | 13 | 14 | 15 |
16418 | two | 16 | 17 | 18 | 19 | 20 |
16423 A simple named list.
16426 ,#+NAME: example-list
16432 ,#+BEGIN_SRC emacs-lisp :var x=example-list
16440 Note that only the top level list items are passed along. Nested
16441 list items are ignored.
16443 - code block without arguments ::
16445 A code block name, as assigned by =NAME= keyword from the example
16446 above, optionally followed by parentheses.
16449 ,#+BEGIN_SRC emacs-lisp :var length=table-length()
16457 - code block with arguments ::
16459 A code block name, as assigned by =NAME= keyword, followed by
16460 parentheses and optional arguments passed within the parentheses.
16464 ,#+BEGIN_SRC emacs-lisp :var input=8
16472 ,#+BEGIN_SRC emacs-lisp :var input=double(input=1)
16476 ,#+RESULTS: squared
16480 - literal example ::
16482 A literal example block named with a =NAME= keyword.
16485 ,#+NAME: literal-example
16491 ,#+NAME: read-literal-example
16492 ,#+BEGIN_SRC emacs-lisp :var x=literal-example
16493 (concatenate #'string x " for you.")
16496 ,#+RESULTS: read-literal-example
16497 : A literal example
16498 : on two lines for you.
16501 Indexing variable values enables referencing portions of a variable.
16502 Indexes are 0 based with negative values counting backwards from the
16503 end. If an index is separated by commas then each subsequent section
16504 indexes as the next dimension. Note that this indexing occurs
16505 /before/ other table-related header arguments are applied, such as
16506 =hlines=, =colnames= and =rownames=. The following example assigns
16507 the last cell of the first row the table =example-table= to the
16511 ,#+NAME: example-table
16517 ,#+BEGIN_SRC emacs-lisp :var data=example-table[0,-1]
16525 Two integers separated by a colon reference a range of variable
16526 values. In that case the entire inclusive range is referenced. For
16527 example the following assigns the middle three rows of =example-table=
16531 ,#+NAME: example-table
16538 ,#+BEGIN_SRC emacs-lisp :var data=example-table[1:3]
16548 To pick the entire range, use an empty index, or the single character
16549 =*=. =0:-1= does the same thing. Example below shows how to
16550 reference the first column only.
16553 ,#+NAME: example-table
16559 ,#+BEGIN_SRC emacs-lisp :var data=example-table[,0]
16567 Index referencing can be used for tables and code blocks. Index
16568 referencing can handle any number of dimensions. Commas delimit
16569 multiple dimensions, as shown below.
16573 ,#+BEGIN_SRC emacs-lisp
16574 '(((1 2 3) (4 5 6) (7 8 9))
16575 ((10 11 12) (13 14 15) (16 17 18))
16576 ((19 20 21) (22 23 24) (25 26 27)))
16579 ,#+BEGIN_SRC emacs-lisp :var data=3D[1,,1]
16587 Note that row names and column names are not removed prior to variable
16588 indexing. You need to take them into account, even when =colnames= or
16589 =rownames= header arguments remove them.
16591 Emacs lisp code can also set the values for variables. To
16592 differentiate a value from Lisp code, Org interprets any value
16593 starting with =(=, =[=, ='= or =`= as Emacs Lisp code. The result of
16594 evaluating that code is then assigned to the value of that variable.
16595 The following example shows how to reliably query and pass the file
16596 name of the Org mode buffer to a code block using headers. We need
16597 reliability here because the file's name could change once the code in
16598 the block starts executing.
16601 ,#+BEGIN_SRC sh :var filename=(buffer-file-name) :exports both
16606 Note that values read from tables and lists are not mistakenly
16607 evaluated as Emacs Lisp code, as illustrated in the following example.
16613 ,#+HEADERS: :var data=table[0,0]
16627 #+cindex: using sessions in code blocks
16628 #+cindex: @samp{session}, header argument
16629 Two code blocks can share the same environment. The =session= header
16630 argument is for running multiple source code blocks under one session.
16631 Org runs code blocks with the same session name in the same
16632 interpreter process.
16636 Default. Each code block gets a new interpreter process to
16637 execute. The process terminates once the block is evaluated.
16639 - {{{var(STRING)}}} ::
16641 Any string besides =none= turns that string into the name of that
16642 session. For example, =:session STRING= names it =STRING=. If
16643 =session= has no value, then the session name is derived from the
16644 source language identifier. Subsequent blocks with the same
16645 source code language use the same session. Depending on the
16646 language, state variables, code from other blocks, and the
16647 overall interpreted environment may be shared. Some interpreted
16648 languages support concurrent sessions when subsequent source code
16649 language blocks change session names.
16651 Only languages that provide interactive evaluation can have session
16652 support. Not all languages provide this support, such as C and ditaa.
16653 Even languages, such as Python and Haskell, that do support
16654 interactive evaluation impose limitations on allowable language
16655 constructs that can run interactively. Org inherits those limitations
16656 for those code blocks running in a session.
16658 *** Choosing a working directory
16663 #+cindex: working directory, in a code block
16664 #+cindex: @samp{dir}, header argument
16665 The =dir= header argument specifies the default directory during code
16666 block execution. If it is absent, then the directory associated with
16667 the current buffer is used. In other words, supplying =:dir PATH=
16668 temporarily has the same effect as changing the current directory with
16669 {{{kbd(M-x cd PATH)}}}, and then not setting =dir=. Under the
16670 surface, =dir= simply sets the value of the Emacs variable
16671 ~default-directory~.
16673 For example, to save the plot file in the =Work/= folder of the home
16674 directory -- notice tilde is expanded:
16677 ,#+BEGIN_SRC R :file myplot.png :dir ~/Work
16678 matplot(matrix(rnorm(100), 10), type="l")
16682 To evaluate the code block on a remote machine, supply a remote
16683 directory name using Tramp syntax. For example:
16686 ,#+BEGIN_SRC R :file plot.png :dir /scp:dand@yakuba.princeton.edu:
16687 plot(1:10, main=system("hostname", intern=TRUE))
16691 Org first captures the text results as usual for insertion in the Org
16692 file. Then Org also inserts a link to the remote file, thanks to
16693 Emacs Tramp. Org constructs the remote path to the file name from
16694 =dir= and ~default-directory~, as illustrated here:
16696 : [[file:/scp:dand@yakuba.princeton.edu:/home/dand/plot.png][plot.png]]
16698 When =dir= is used with =session=, Org sets the starting directory for
16699 a new session. But Org does not alter the directory of an already
16702 Do not use =dir= with =:exports results= or with =:exports both= to
16703 avoid Org inserting incorrect links to remote files. That is because
16704 Org does not expand ~default directory~ to avoid some underlying
16705 portability issues.
16707 *** Inserting headers and footers
16712 #+cindex: headers, in code blocks
16713 #+cindex: footers, in code blocks
16714 #+cindex: @samp{prologue}, header argument
16715 The =prologue= header argument is for appending to the top of the code
16716 block for execution, like a reset instruction. For example, you may
16717 use =:prologue "reset"= in a Gnuplot code block or, for every such
16720 #+begin_src emacs-lisp
16721 (add-to-list 'org-babel-default-header-args:gnuplot
16722 '((:prologue . "reset")))
16726 #+cindex: @samp{epilogue}, header argument
16727 Likewise, the value of the =epilogue= header argument is for appending
16728 to the end of the code block for execution.
16730 ** Evaluating code blocks
16732 :DESCRIPTION: Place results of evaluation in the Org buffer.
16734 #+cindex: code block, evaluating
16735 #+cindex: source code, evaluating
16736 #+cindex: RESULTS, keyword
16738 A note about security: With code evaluation comes the risk of harm.
16739 Org safeguards by prompting for user's permission before executing any
16740 code in the source block. To customize this safeguard -- or disable
16741 it --, see [[*Code evaluation and security issues]].
16743 *** How to evaluate source code
16748 Org captures the results of the code block evaluation and inserts them
16749 in the Org file, right after the code block. The insertion point is
16750 after a newline and the =RESULTS= keyword. Org creates the =RESULTS=
16751 keyword if one is not already there.
16753 By default, Org enables only Emacs Lisp code blocks for execution.
16754 See [[*Languages]] to enable other languages.
16757 #+kindex: C-c C-v e
16758 #+findex: org-babel-execute-src-block
16759 Org provides many ways to execute code blocks. {{{kbd(C-c C-c)}}} or
16760 {{{kbd(C-c C-v e)}}} with the point on a code block[fn:131] calls the
16761 ~org-babel-execute-src-block~ function, which executes the code in the
16762 block, collects the results, and inserts them in the buffer.
16764 #+cindex: CALL, keyword
16765 #+vindex: org-babel-inline-result-wrap
16766 By calling a named code block[fn:132] from an Org mode buffer or
16767 a table. Org can call the named code blocks from the current Org mode
16768 buffer or from the "Library of Babel" (see [[*Library of Babel]]).
16770 The syntax for =CALL= keyword is:
16773 ,#+CALL: <name>(<arguments>)
16774 ,#+CALL: <name>[<inside header arguments>](<arguments>) <end header arguments>
16777 The syntax for inline named code blocks is:
16780 ... call_<name>(<arguments>) ...
16781 ... call_<name>[<inside header arguments>](<arguments>)[<end header arguments>] ...
16784 When inline syntax is used, the result is wrapped based on the
16785 variable ~org-babel-inline-result-wrap~, which by default is set to
16786 ~"=%s="~ to produce verbatim text suitable for markup.
16790 This is the name of the code block to be evaluated (see
16791 [[*Structure of code blocks]]).
16795 Org passes arguments to the code block using standard function
16796 call syntax. For example, a =#+CALL:= line that passes =4= to
16797 a code block named =double=, which declares the header argument
16798 =:var n=2=, would be written as:
16800 : #+CALL: double(n=4)
16802 #+texinfo: @noindent
16803 Note how this function call syntax is different from the header
16806 - =<inside header arguments>= ::
16808 Org passes inside header arguments to the named code block using
16809 the header argument syntax. Inside header arguments apply to
16810 code block evaluation. For example, =[:results output]= collects
16811 results printed to stdout during code execution of that block.
16812 Note how this header argument syntax is different from the
16813 function call syntax.
16815 - =<end header arguments>= ::
16817 End header arguments affect the results returned by the code
16818 block. For example, =:results html= wraps the results in
16819 a =#+BEGIN_EXPORT html= block before inserting the results in the
16822 *** Limit code block evaluation
16827 #+cindex: @samp{eval}, header argument
16828 #+cindex: control code block evaluation
16829 The =eval= header argument can limit evaluation of specific code
16830 blocks and =CALL= keyword. It is useful for protection against
16831 evaluating untrusted code blocks by prompting for a confirmation.
16833 - =never= or =no= ::
16835 Org never evaluates the source code.
16839 Org prompts the user for permission to evaluate the source code.
16841 - =never-export= or =no-export= ::
16843 Org does not evaluate the source code when exporting, yet the
16844 user can evaluate it interactively.
16846 - =query-export= ::
16848 Org prompts the user for permission to evaluate the source code
16851 If =eval= header argument is not set, then Org determines whether to
16852 evaluate the source code from the ~org-confirm-babel-evaluate~
16853 variable (see [[*Code evaluation and security issues]]).
16855 *** Cache results of evaluation
16860 #+cindex: @samp{cache}, header argument
16861 #+cindex: cache results of code evaluation
16862 The =cache= header argument is for caching results of evaluating code
16863 blocks. Caching results can avoid re-evaluating a code block that
16864 have not changed since the previous run. To benefit from the cache
16865 and avoid redundant evaluations, the source block must have a result
16866 already present in the buffer, and neither the header arguments --
16867 including the value of =var= references -- nor the text of the block
16868 itself has changed since the result was last computed. This feature
16869 greatly helps avoid long-running calculations. For some edge cases,
16870 however, the cached results may not be reliable.
16872 The caching feature is best for when code blocks are pure functions,
16873 that is functions that return the same value for the same input
16874 arguments (see [[*Environment of a code block]]), and that do not have
16875 side effects, and do not rely on external variables other than the
16876 input arguments. Functions that depend on a timer, file system
16877 objects, and random number generators are clearly unsuitable for
16880 A note of warning: when =cache= is used in a session, caching may
16881 cause unexpected results.
16883 When the caching mechanism tests for any source code changes, it does
16884 not expand Noweb style references (see [[*Noweb reference syntax]]). For
16885 reasons why, see http://thread.gmane.org/gmane.emacs.orgmode/79046.
16887 The =cache= header argument can have one of two values: =yes= or =no=.
16891 Default. No caching of results; code block evaluated every
16896 Whether to run the code or return the cached results is
16897 determined by comparing the SHA1 hash value of the combined code
16898 block and arguments passed to it. This hash value is packed on
16899 the =#+RESULTS:= line from previous evaluation. When hash values
16900 match, Org does not evaluate the code block. When hash values
16901 mismatch, Org evaluates the code block, inserts the results,
16902 recalculates the hash value, and updates =#+RESULTS:= line.
16904 In this example, both functions are cached. But =caller= runs only if
16905 the result from =random= has changed since the last run.
16909 ,#+BEGIN_SRC R :cache yes
16913 ,#+RESULTS[a2a72cd647ad44515fab62e144796432793d68e1]: random
16917 ,#+BEGIN_SRC emacs-lisp :var x=random :cache yes
16921 ,#+RESULTS[bec9c8724e397d5df3b696502df3ed7892fc4f5f]: caller
16925 ** Results of evaluation
16927 :DESCRIPTION: Choosing a results type, post-processing...
16929 #+cindex: code block, results of evaluation
16930 #+cindex: source code, results of evaluation
16932 #+cindex: @samp{results}, header argument
16933 How Org handles results of a code block execution depends on many
16934 header arguments working together. The primary determinant, however,
16935 is the =results= header argument. It accepts four classes of options.
16936 Each code block can take only one option per class:
16940 For how the results should be collected from the code block;
16944 For which type of result the code block will return; affects how
16945 Org processes and inserts results in the Org buffer;
16949 For the result; affects how Org processes and inserts results in
16954 For processing results after evaluation of the code block;
16961 Collection options specify the results. Choose one of the options;
16962 they are mutually exclusive.
16966 Default. Functional mode. Org gets the value by wrapping the
16967 code in a function definition in the language of the source
16968 block. That is why when using =:results value=, code should
16969 execute like a function and return a value. For languages like
16970 Python, an explicit ~return~ statement is mandatory when using
16971 =:results value=. Result is the value returned by the last
16972 statement in the code block.
16974 When evaluating the code block in a session (see [[*Environment of
16975 a code block]]), Org passes the code to an interpreter running as
16976 an interactive Emacs inferior process. Org gets the value from
16977 the source code interpreter's last statement output. Org has to
16978 use language-specific methods to obtain the value. For example,
16979 from the variable ~_~ in Python and Ruby, and the value of
16980 ~.Last.value~ in R.
16984 Scripting mode. Org passes the code to an external process
16985 running the interpreter. Org returns the contents of the
16986 standard output stream as text results.
16988 When using a session, Org passes the code to the interpreter
16989 running as an interactive Emacs inferior process. Org
16990 concatenates any text output from the interpreter and returns the
16991 collection as a result.
16993 Note that this collection is not the same as that would be
16994 collected from stdout of a non-interactive interpreter running as
16995 an external process. Compare for example these two blocks:
16998 ,#+BEGIN_SRC python :results output
17009 In the above non-session mode, the "2" is not printed; so it does
17010 not appear in results.
17013 ,#+BEGIN_SRC python :results output :session
17025 In the above session, the interactive interpreter receives and
17026 prints "2". Results show that.
17033 Type tells what result types to expect from the execution of the code
17034 block. Choose one of the options; they are mutually exclusive. The
17035 default behavior is to automatically determine the result type.
17037 #+attr_texinfo: :sep ,
17038 - =table=, =vector= ::
17040 Interpret the results as an Org table. If the result is a single
17041 value, create a table with one row and one column. Usage
17042 example: =:results value table=.
17044 #+cindex: @samp{hlines}, header argument
17045 In-between each table row or below the table headings, sometimes
17046 results have horizontal lines, which are also known as "hlines".
17047 The =hlines= argument with the default =no= value strips such
17048 lines from the input table. For most code, this is desirable, or
17049 else those =hline= symbols raise unbound variable errors.
17050 A =yes= accepts such lines, as demonstrated in the following
17062 ,#+BEGIN_SRC python :var tab=many-cols :hlines no
17066 ,#+RESULTS: no-hline
17072 ,#+BEGIN_SRC python :var tab=many-cols :hlines yes
17086 Interpret the results as an Org list. If the result is a single
17087 value, create a list of one element.
17089 - =scalar=, =verbatim= ::
17091 Interpret literally and insert as quoted text. Do not create
17092 a table. Usage example: =:results value verbatim=.
17096 Interpret as a filename. Save the results of execution of the
17097 code block to that file, then insert a link to it. You can
17098 control both the filename and the description associated to the
17101 #+cindex: @samp{file}, header argument
17102 #+cindex: @samp{output-dir}, header argument
17103 Org first tries to generate the filename from the value of the
17104 =file= header argument and the directory specified using the
17105 =output-dir= header arguments. If =output-dir= is not specified,
17106 Org assumes it is the current directory.
17109 ,#+BEGIN_SRC asymptote :results value file :file circle.pdf :output-dir img/
17115 #+cindex: @samp{file-ext}, header argument
17116 If =file= is missing, Org generates the base name of the output
17117 file from the name of the code block, and its extension from the
17118 =file-ext= header argument. In that case, both the name and the
17119 extension are mandatory.
17123 ,#+BEGIN_SRC asymptote :results value file :file-ext pdf
17129 #+cindex: @samp{file-desc}, header argument
17130 The =file-desc= header argument defines the description (see
17131 [[*Link format]]) for the link. If =file-desc= has no value, Org
17132 uses the generated file name for both the "link" and
17133 "description" parts of the link.
17140 Format pertains to the type of the result returned by the code block.
17141 Choose one of the options; they are mutually exclusive. The default
17142 follows from the type specified above.
17146 Interpreted as raw Org mode. Inserted directly into the buffer.
17147 Aligned if it is a table. Usage example: =:results value raw=.
17151 Results enclosed in a =BEGIN_SRC org= block. For comma-escape,
17152 either {{{kbd(TAB)}}} in the block, or export the file. Usage
17153 example: =:results value org=.
17157 Results enclosed in a =BEGIN_EXPORT html= block. Usage example:
17158 =:results value html=.
17162 Results enclosed in a =BEGIN_EXPORT latex= block. Usage example:
17163 =:results value latex=.
17167 Result enclosed in a code block. Useful for parsing. Usage
17168 example: =:results value code=.
17172 Result converted to pretty-print source code. Enclosed in a code
17173 block. Languages supported: Emacs Lisp, Python, and Ruby. Usage
17174 example: =:results value pp=.
17178 Result wrapped in a =RESULTS= drawer. Useful for containing
17179 =raw= or =org= results for later scripting and automated
17180 processing. Usage example: =:results value drawer=.
17187 Handling options after collecting the results.
17191 Do not insert results in the Org mode buffer, but echo them in
17192 the minibuffer. Usage example: =:results output silent=.
17196 Default. Insert results in the Org buffer. Remove previous
17197 results. Usage example: =:results output replace=.
17201 Append results to the Org buffer. Latest results are at the
17202 bottom. Does not remove previous results. Usage example:
17203 =:results output append=.
17207 Prepend results to the Org buffer. Latest results are at the
17208 top. Does not remove previous results. Usage example: =:results
17211 *** Post-processing
17216 #+cindex: @samp{post}, header argument
17217 #+cindex: @samp{*this*}, in @samp{post} header argument
17218 The =post= header argument is for post-processing results from block
17219 evaluation. When =post= has any value, Org binds the results to
17220 ~*this*~ variable for easy passing to =var= header argument
17221 specifications (see [[*Environment of a code block]]). That makes results
17222 available to other code blocks, or even for direct Emacs Lisp code
17225 The following two examples illustrate =post= header argument in
17226 action. The first one shows how to attach an =ATTR_LATEX= keyword
17231 ,#+BEGIN_SRC sh :var data="" :var width="\\textwidth" :results output
17232 echo "#+ATTR_LATEX: :width $width"
17236 ,#+HEADER: :file /tmp/it.png
17237 ,#+BEGIN_SRC dot :post attr_wrap(width="5cm", data=*this*) :results drawer
17247 ,#+ATTR_LATEX :width 5cm
17248 [[file:/tmp/it.png]]
17252 The second example shows use of =colnames= header argument in =post=
17253 to pass data between code blocks.
17257 ,#+BEGIN_SRC emacs-lisp :var tbl="" fmt="%.3f"
17258 (mapcar (lambda (row)
17259 (mapcar (lambda (cell)
17267 ,#+BEGIN_SRC R :colnames yes :post round-tbl[:colnames yes](*this*)
17269 data.frame(foo=rnorm(1))
17278 ** Exporting code blocks
17280 :DESCRIPTION: Export contents and/or results.
17282 #+cindex: code block, exporting
17283 #+cindex: source code, exporting
17285 It is possible to export the /code/ of code blocks, the /results/ of
17286 code block evaluation, /both/ the code and the results of code block
17287 evaluation, or /none/. Org defaults to exporting /code/ for most
17288 languages. For some languages, such as ditaa, Org defaults to
17289 /results/. To export just the body of code blocks, see [[*Literal
17290 examples]]. To selectively export sub-trees of an Org document, see
17293 #+cindex: @samp{export}, header argument
17294 The =exports= header argument is to specify if that part of the Org
17295 file is exported to, say, HTML or LaTeX formats.
17299 The default. The body of code is included into the exported
17300 file. Example: =:exports code=.
17304 The results of evaluation of the code is included in the exported
17305 file. Example: =:exports results=.
17309 Both the code and results of evaluation are included in the
17310 exported file. Example: =:exports both=.
17314 Neither the code nor the results of evaluation is included in the
17315 exported file. Whether the code is evaluated at all depends on
17316 other options. Example: =:exports none=.
17318 #+vindex: org-export-use-babel
17319 To stop Org from evaluating code blocks to speed exports, use the
17320 header argument =:eval never-export= (see [[*Evaluating code blocks]]).
17321 To stop Org from evaluating code blocks for greater security, set the
17322 ~org-export-use-babel~ variable to ~nil~, but understand that header
17323 arguments will have no effect.
17325 Turning off evaluation comes in handy when batch processing. For
17326 example, markup languages for wikis, which have a high risk of
17327 untrusted code. Stopping code block evaluation also stops evaluation
17328 of all header arguments of the code block. This may not be desirable
17329 in some circumstances. So during export, to allow evaluation of just
17330 the header arguments but not any code evaluation in the source block,
17331 set =:eval never-export= (see [[*Evaluating code blocks]]).
17333 Org never evaluates code blocks in commented sub-trees when exporting
17334 (see [[*Comment lines]]). On the other hand, Org does evaluate code
17335 blocks in sub-trees excluded from export (see [[*Export settings]]).
17337 ** Extracting source code
17339 :DESCRIPTION: Create pure source code files.
17342 #+cindex: source code, extracting
17343 #+cindex: code block, extracting source code
17345 Extracting source code from code blocks is a basic task in literate
17346 programming. Org has features to make this easy. In literate
17347 programming parlance, documents on creation are /woven/ with code and
17348 documentation, and on export, the code is tangled for execution by
17349 a computer. Org facilitates weaving and tangling for producing,
17350 maintaining, sharing, and exporting literate programming documents.
17351 Org provides extensive customization options for extracting source
17354 When Org tangles code blocks, it expands, merges, and transforms them.
17355 Then Org recomposes them into one or more separate files, as
17356 configured through the options. During this tangling process, Org
17357 expands variables in the source code, and resolves any Noweb style
17358 references (see [[*Noweb reference syntax]]).
17360 *** Header arguments
17365 #+cindex: @samp{tangle}, header argument
17366 The =tangle= header argument specifies if the code block is exported
17371 Export the code block to source file. The file name for the
17372 source file is derived from the name of the Org file, and the
17373 file extension is derived from the source code language
17374 identifier. Example: =:tangle yes=.
17378 The default. Do not extract the code in a source code file.
17379 Example: =:tangle no=.
17381 - {{{var(FILENAME)}}} ::
17383 Export the code block to source file whose file name is derived
17384 from any string passed to the =tangle= header argument. Org
17385 derives the file name as being relative to the directory of the
17386 Org file's location. Example: =:tangle FILENAME=.
17388 #+cindex: @samp{mkdirp}, header argument
17389 The =mkdirp= header argument creates parent directories for tangled
17390 files if the directory does not exist. =yes= enables directory
17391 creation and =no= inhibits directory creation.
17393 #+cindex: @samp{comments}, header argument
17394 The =comments= header argument controls inserting comments into
17395 tangled files. These are above and beyond whatever comments may
17396 already exist in the code block.
17400 The default. Do not insert any extra comments during tangling.
17404 Wrap the code block in comments. Include links pointing back to
17405 the place in the Org file from where the code was tangled.
17409 Kept for backward compatibility; same as =link=.
17413 Nearest headline text from Org file is inserted as comment. The
17414 exact text that is inserted is picked from the leading context of
17419 Includes both =link= and =org= options.
17423 Includes =link= option, expands Noweb references (see [[*Noweb
17424 reference syntax]]), and wraps them in link comments inside the
17425 body of the code block.
17427 #+cindex: @samp{padline}, header argument
17428 The =padline= header argument controls insertion of newlines to pad
17429 source code in the tangled file.
17433 Default. Insert a newline before and after each code block in
17438 Do not insert newlines to pad the tangled code blocks.
17440 #+cindex: @samp{shebang}, header argument
17441 The =shebang= header argument can turn results into executable script
17442 files. By setting it to a string value -- for example, =:shebang
17443 "#!/bin/bash"= --, Org inserts that string as the first line of the
17444 tangled file that the code block is extracted to. Org then turns on
17445 the tangled file's executable permission.
17447 #+cindex: @samp{no-expand}, header argument
17448 By default Org expands code blocks during tangling. The =no-expand=
17449 header argument turns off such expansions. Note that one side-effect
17450 of expansion by ~org-babel-expand-src-block~ also assigns values (see
17451 [[*Environment of a code block]]) to variables. Expansions also replace
17452 Noweb references with their targets (see [[*Noweb reference syntax]]).
17453 Some of these expansions may cause premature assignment, hence this
17454 option. This option makes a difference only for tangling. It has no
17455 effect when exporting since code blocks for execution have to be
17463 - ~org-babel-tangle~ ::
17465 #+findex: org-babel-tangle
17466 #+kindex: C-c C-v t
17467 Tangle the current file. Bound to {{{kbd(C-c C-v t)}}}.
17469 With prefix argument only tangle the current code block.
17471 - ~org-babel-tangle-file~ ::
17473 #+findex: org-babel-tangle-file
17474 #+kindex: C-c C-v f
17475 Choose a file to tangle. Bound to {{{kbd(C-c C-v f)}}}.
17482 - ~org-babel-post-tangle-hook~ ::
17484 #+vindex: org-babel-post-tangle-hook
17485 This hook is run from within code files tangled by
17486 ~org-babel-tangle~, making it suitable for post-processing,
17487 compilation, and evaluation of code in the tangled files.
17489 *** Jumping between code and Org
17494 #+findex: org-babel-tangle-jump-to-org
17495 Debuggers normally link errors and messages back to the source code.
17496 But for tangled files, we want to link back to the Org file, not to
17497 the tangled source file. To make this extra jump, Org uses
17498 ~org-babel-tangle-jump-to-org~ function with two additional source
17499 code block header arguments:
17501 1. Set =padline= to true -- this is the default setting.
17502 2. Set =comments= to =link=, which makes Org insert links to the Org
17507 :DESCRIPTION: List of supported code block languages.
17509 #+cindex: babel, languages
17510 #+cindex: source code, languages
17511 #+cindex: code block, languages
17513 Code blocks in the following languages are supported.
17515 | Language | Identifier | Language | Identifier |
17516 |------------+------------+----------------+------------|
17517 | Asymptote | asymptote | Awk | awk |
17518 | C | C | C++ | C++ |
17519 | Clojure | clojure | CSS | css |
17520 | D | d | ditaa | ditaa |
17521 | Graphviz | dot | Emacs Calc | calc |
17522 | Emacs Lisp | emacs-lisp | Fortran | fortran |
17523 | Gnuplot | gnuplot | Haskell | haskell |
17524 | Java | java | Javascript | js |
17525 | LaTeX | latex | Ledger | ledger |
17526 | Lisp | lisp | Lilypond | lilypond |
17527 | Lua | lua | MATLAB | matlab |
17528 | Mscgen | mscgen | Objective Caml | ocaml |
17529 | Octave | octave | Org mode | org |
17530 | Oz | oz | Perl | perl |
17531 | Plantuml | plantuml | Processing.js | processing |
17532 | Python | python | R | R |
17533 | Ruby | ruby | Sass | sass |
17534 | Scheme | scheme | GNU Screen | screen |
17535 | Sed | sed | shell | sh |
17536 | SQL | sql | SQLite | sqlite |
17537 | Vala | vala | | |
17539 Additional documentation for some languages is at
17540 http://orgmode.org/worg/org-contrib/babel/languages.html.
17542 #+vindex: org-babel-load-languages
17543 By default, only Emacs Lisp is enabled for evaluation. To enable or
17544 disable other languages, customize the ~org-babel-load-languages~
17545 variable either through the Emacs customization interface, or by
17546 adding code to the init file as shown next.
17548 In this example, evaluation is disabled for Emacs Lisp, and enabled
17551 #+begin_src emacs-lisp
17552 (org-babel-do-load-languages
17553 'org-babel-load-languages
17554 '((emacs-lisp . nil)
17558 Note that this is not the only way to enable a language. Org also
17559 enables languages when loaded with ~require~ statement. For example,
17560 the following enables execution of Clojure code blocks:
17562 #+begin_src emacs-lisp
17563 (require 'ob-clojure)
17566 ** Editing source code
17568 :DESCRIPTION: Language major-mode editing.
17570 #+cindex: code block, editing
17571 #+cindex: source code, editing
17574 Use {{{kbd(C-c ')}}} to edit the current code block. It opens a new
17575 major-mode edit buffer containing the body of the source code block,
17576 ready for any edits. Use {{{kbd(C-c ')}}} again to close the buffer
17577 and return to the Org buffer.
17580 #+vindex: org-edit-src-auto-save-idle-delay
17581 #+cindex: auto-save, in code block editing
17582 {{{kbd(C-x C-s)}}} saves the buffer and updates the contents of the
17583 Org buffer. Set ~org-edit-src-auto-save-idle-delay~ to save the base
17584 buffer after a certain idle delay time. Set
17585 ~org-edit-src-turn-on-auto-save~ to auto-save this buffer into
17586 a separate file using Auto-save mode.
17588 While editing the source code in the major mode, the Org Src minor
17589 mode remains active. It provides these customization variables as
17590 described below. For even more variables, look in the customization
17591 group ~org-edit-structure~.
17593 - ~org-src-lang-modes~ ::
17595 #+vindex: org-src-lang-modes
17596 If an Emacs major-mode named ~<LANG>-mode~ exists, where
17597 {{{var(<LANG>)}}} is the language identifier from code block's
17598 header line, then the edit buffer uses that major mode. Use this
17599 variable to arbitrarily map language identifiers to major modes.
17601 - ~org-src-window-setup~ ::
17603 #+vindex: org-src-window-setup
17604 For specifying Emacs window arrangement when the new edit buffer
17607 - ~org-src-preserve-indentation~ ::
17609 #+cindex: indentation, in code blocks
17610 #+vindex: org-src-preserve-indentation
17611 Default is ~nil~. Source code is indented. This indentation
17612 applies during export or tangling, and depending on the context,
17613 may alter leading spaces and tabs. When non-~nil~, source code
17614 is aligned with the leftmost column. No lines are modified
17615 during export or tangling, which is very useful for white-space
17616 sensitive languages, such as Python.
17618 - ~org-src-ask-before-returning-to-edit-buffer~ ::
17620 #+vindex: org-src-ask-before-returning-to-edit-buffer
17621 When ~nil~, Org returns to the edit buffer without further
17622 prompts. The default prompts for a confirmation.
17624 #+vindex: org-src-fontify-natively
17625 #+vindex: org-src-block-faces
17626 Set ~org-src-fontify-natively~ to non-~nil~ to turn on native code
17627 fontification in the /Org/ buffer. Fontification of code blocks can
17628 give visual separation of text and code on the display page. To
17629 further customize the appearance of ~org-block~ for specific
17630 languages, customize ~org-src-block-faces~. The following example
17631 shades the background of regular blocks, and colors source blocks only
17632 for Python and Emacs Lisp languages.
17634 #+begin_src emacs-lisp
17636 (set-face-attribute 'org-block nil :background
17638 (face-attribute 'default :background) 3))
17640 (setq org-src-block-faces '(("emacs-lisp" (:background "#EEE2FF"))
17641 ("python" (:background "#E5FFB8"))))
17644 ** Noweb reference syntax
17646 :DESCRIPTION: Literate programming in Org mode.
17648 #+cindex: code block, Noweb reference
17649 #+cindex: syntax, Noweb
17650 #+cindex: source code, Noweb reference
17652 Org supports named blocks in Noweb[fn:133] style syntax:
17654 : <<CODE-BLOCK-ID>>
17656 Org can replace the construct with the source code, or the results of
17657 evaluation, of the code block identified as {{{var(CODE-BLOCK-ID)}}}.
17659 #+cindex: @samp{noweb}, header argument
17660 The =noweb= header argument controls expansion of Noweb syntax
17661 references. Expansions occur when source code blocks are evaluated,
17662 tangled, or exported.
17666 Default. No expansion of Noweb syntax references in the body of
17667 the code when evaluating, tangling, or exporting.
17671 Expansion of Noweb syntax references in the body of the code
17672 block when evaluating, tangling, or exporting.
17676 Expansion of Noweb syntax references in the body of the code
17677 block when tangling. No expansion when evaluating or exporting.
17681 Expansion of Noweb syntax references in the body of the code
17682 block when evaluating or tangling. No expansion when exporting.
17684 - =strip-export= ::
17686 Expansion of Noweb syntax references in the body of the code
17687 block when expanding prior to evaluating or tangling. Removes
17688 Noweb syntax references when exporting.
17692 Expansion of Noweb syntax references in the body of the code
17693 block only before evaluating.
17695 In the following example,
17698 ,#+NAME: initialization
17699 ,#+BEGIN_SRC emacs-lisp
17700 (setq sentence "Never a foot too far, even.")
17703 ,#+BEGIN_SRC emacs-lisp :noweb yes
17709 #+texinfo: @noindent
17710 the second code block is expanded as
17713 ,#+BEGIN_SRC emacs-lisp :noweb yes
17714 (setq sentence "Never a foot too far, even.")
17719 Noweb insertions honor prefix characters that appear before the Noweb
17720 syntax reference. This behavior is illustrated in the following
17721 example. Because the =<<example>>= Noweb reference appears behind the
17722 SQL comment syntax, each line of the expanded Noweb reference is
17729 multi-line body of example
17733 #+texinfo: @noindent
17737 ,#+BEGIN_SRC sql :noweb yes
17742 #+texinfo: @noindent
17746 ,#+BEGIN_SRC sql :noweb yes
17748 -- multi-line body of example
17752 Since this change does not affect Noweb replacement text without
17753 newlines in them, inline Noweb references are acceptable.
17755 This feature can also be used for management of indentation in
17756 exported code snippets. With:
17760 ,#+BEGIN_SRC python :exports none
17761 print('do things when true')
17765 ,#+begin_src python :exports none
17766 print('do things when false')
17770 #+texinfo: @noindent
17774 ,#+begin_src python :noweb yes :results output
17782 #+texinfo: @noindent
17787 print('do things when true')
17789 print('do things when false')
17792 #+cindex: @samp{noweb-ref}, header argument
17793 When expanding Noweb style references, Org concatenates code blocks by
17794 matching the reference name to either the code block name or, if none
17795 is found, to the =noweb-ref= header argument.
17797 For simple concatenation, set this =noweb-ref= header argument at the
17798 sub-tree or file level. In the example Org file shown next, the body
17799 of the source code in each block is extracted for concatenation to
17800 a pure code file when tangled.
17803 ,#+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh
17806 ,* the mount point of the fullest disk
17808 :header-args: :noweb-ref fullest-disk
17811 ,** query all mounted disks
17816 ,** strip the header row
17821 ,** output mount point of fullest disk
17823 |awk '{if (u < +$5) {u = +$5; m = $6}} END {print m}'
17827 #+cindex: @samp{noweb-sep}, header argument
17828 By default a newline separates each noweb reference concatenation. To
17829 change this newline separator, edit the =noweb-sep= header argument.
17831 Eventually, Org can include the results of a code block rather than
17832 its body. To that effect, append parentheses, possibly including
17833 arguments, to the code block name, as shown below.
17835 : <<code-block-name(optional arguments)>>
17837 Note that when using the above approach to a code block's results, the
17838 code block name set by =NAME= keyword is required; the reference set
17839 by =noweb-ref= does not work in that case.
17841 Here is an example that demonstrates how the exported content changes
17842 when Noweb style references are used with parentheses versus without.
17847 ,#+BEGIN_SRC python :var num=0 :results output :exports none
17852 #+texinfo: @noindent
17856 ,#+BEGIN_SRC text :noweb yes
17861 #+texinfo: @noindent
17866 Below, a similar Noweb style reference is used, but with parentheses,
17867 while setting a variable =num= to 10:
17870 ,#+BEGIN_SRC text :noweb yes
17871 <<some-code(num=10)>>
17875 #+texinfo: @noindent
17876 Note that now the expansion contains the results of the code block
17877 =some-code=, not the code block itself:
17881 ** Library of Babel
17883 :DESCRIPTION: Use and contribute to a library of useful code blocks.
17885 #+cindex: babel, library of
17886 #+cindex: source code, library
17887 #+cindex: code block, library
17889 The "Library of Babel" is a collection of code blocks. Like
17890 a function library, these code blocks can be called from other Org
17891 files. A collection of useful code blocks is available on [[http://orgmode.org/worg/library-of-babel.html][Worg]]. For
17892 remote code block evaluation syntax, see [[*Evaluating code blocks]].
17894 #+kindex: C-c C-v i
17895 #+findex: org-babel-lob-ingest
17896 For any user to add code to the library, first save the code in
17897 regular code blocks of an Org file, and then load the Org file with
17898 ~org-babel-lob-ingest~, which is bound to {{{kbd(C-c C-v i)}}}.
17900 ** Key bindings and useful functions
17902 :DESCRIPTION: Work quickly with code blocks.
17904 #+cindex: code block, key bindings
17906 Many common Org mode key sequences are re-bound depending on
17909 Active key bindings in code blocks:
17912 #+findex: org-babel-execute-src-block
17914 #+findex: org-babel-open-src-block-result
17916 #+findex: org-babel-load-in-session
17918 #+findex: org-babel-pop-to-session
17919 #+attr_texinfo: :columns 0.2 0.55
17920 | Key binding | Function |
17921 |--------------------+-----------------------------------|
17922 | {{{kbd(C-c C-c)}}} | ~org-babel-execute-src-block~ |
17923 | {{{kbd(C-c C-o)}}} | ~org-babel-open-src-block-result~ |
17924 | {{{kbd(M-up)}}} | ~org-babel-load-in-session~ |
17925 | {{{kbd(M-down)}}} | ~org-babel-pop-to-session~ |
17927 Active key bindings in Org mode buffer:
17929 #+kindex: C-c C-v p
17930 #+kindex: C-c C-v C-p
17931 #+kindex: C-c C-v n
17932 #+kindex: C-c C-v C-n
17933 #+kindex: C-c C-v e
17934 #+kindex: C-c C-v C-e
17935 #+kindex: C-c C-v o
17936 #+kindex: C-c C-v C-o
17937 #+kindex: C-c C-v v
17938 #+kindex: C-c C-v C-v
17939 #+kindex: C-c C-v u
17940 #+kindex: C-c C-v C-u
17941 #+kindex: C-c C-v g
17942 #+kindex: C-c C-v C-g
17943 #+kindex: C-c C-v r
17944 #+kindex: C-c C-v C-r
17945 #+kindex: C-c C-v b
17946 #+kindex: C-c C-v C-b
17947 #+kindex: C-c C-v s
17948 #+kindex: C-c C-v C-s
17949 #+kindex: C-c C-v d
17950 #+kindex: C-c C-v C-d
17951 #+kindex: C-c C-v t
17952 #+kindex: C-c C-v C-t
17953 #+kindex: C-c C-v f
17954 #+kindex: C-c C-v C-f
17955 #+kindex: C-c C-v c
17956 #+kindex: C-c C-v C-c
17957 #+kindex: C-c C-v j
17958 #+kindex: C-c C-v C-j
17959 #+kindex: C-c C-v l
17960 #+kindex: C-c C-v C-l
17961 #+kindex: C-c C-v i
17962 #+kindex: C-c C-v C-i
17963 #+kindex: C-c C-v I
17964 #+kindex: C-c C-v C-I
17965 #+kindex: C-c C-v z
17966 #+kindex: C-c C-v C-z
17967 #+kindex: C-c C-v a
17968 #+kindex: C-c C-v C-a
17969 #+kindex: C-c C-v h
17970 #+kindex: C-c C-v C-h
17971 #+kindex: C-c C-v x
17972 #+kindex: C-c C-v C-x
17973 #+findex: org-babel-previous-src-block
17974 #+findex: org-babel-next-src-block
17975 #+findex: org-babel-execute-maybe
17976 #+findex: org-babel-open-src-block-result
17977 #+findex: org-babel-expand-src-block
17978 #+findex: org-babel-goto-src-block-head
17979 #+findex: org-babel-goto-named-src-block
17980 #+findex: org-babel-goto-named-result
17981 #+findex: org-babel-execute-buffer
17982 #+findex: org-babel-execute-subtree
17983 #+findex: org-babel-demarcate-block
17984 #+findex: org-babel-tangle
17985 #+findex: org-babel-tangle-file
17986 #+findex: org-babel-check-src-block
17987 #+findex: org-babel-insert-header-arg
17988 #+findex: org-babel-load-in-session
17989 #+findex: org-babel-lob-ingest
17990 #+findex: org-babel-view-src-block-info
17991 #+findex: org-babel-switch-to-session-with-code
17992 #+findex: org-babel-sha1-hash
17993 #+findex: org-babel-describe-bindings
17994 #+findex: org-babel-do-key-sequence-in-edit-buffer
17995 #+attr_texinfo: :columns 0.45 0.55
17996 | Key binding | Function |
17997 |------------------------------------------------+--------------------------------------------|
17998 | {{{kbd(C-c C-v p)}}} or {{{kbd(C-c C-v C-p)}}} | ~org-babel-previous-src-block~ |
17999 | {{{kbd(C-c C-v n)}}} or {{{kbd(C-c C-v C-n)}}} | ~org-babel-next-src-block~ |
18000 | {{{kbd(C-c C-v e)}}} or {{{kbd(C-c C-v C-e)}}} | ~org-babel-execute-maybe~ |
18001 | {{{kbd(C-c C-v o)}}} or {{{kbd(C-c C-v C-o)}}} | ~org-babel-open-src-block-result~ |
18002 | {{{kbd(C-c C-v v)}}} or {{{kbd(C-c C-v C-v)}}} | ~org-babel-expand-src-block~ |
18003 | {{{kbd(C-c C-v u)}}} or {{{kbd(C-c C-v C-u)}}} | ~org-babel-goto-src-block-head~ |
18004 | {{{kbd(C-c C-v g)}}} or {{{kbd(C-c C-v C-g)}}} | ~org-babel-goto-named-src-block~ |
18005 | {{{kbd(C-c C-v r)}}} or {{{kbd(C-c C-v C-r)}}} | ~org-babel-goto-named-result~ |
18006 | {{{kbd(C-c C-v b)}}} or {{{kbd(C-c C-v C-b)}}} | ~org-babel-execute-buffer~ |
18007 | {{{kbd(C-c C-v s)}}} or {{{kbd(C-c C-v C-s)}}} | ~org-babel-execute-subtree~ |
18008 | {{{kbd(C-c C-v d)}}} or {{{kbd(C-c C-v C-d)}}} | ~org-babel-demarcate-block~ |
18009 | {{{kbd(C-c C-v t)}}} or {{{kbd(C-c C-v C-t)}}} | ~org-babel-tangle~ |
18010 | {{{kbd(C-c C-v f)}}} or {{{kbd(C-c C-v C-f)}}} | ~org-babel-tangle-file~ |
18011 | {{{kbd(C-c C-v c)}}} or {{{kbd(C-c C-v C-c)}}} | ~org-babel-check-src-block~ |
18012 | {{{kbd(C-c C-v j)}}} or {{{kbd(C-c C-v C-j)}}} | ~org-babel-insert-header-arg~ |
18013 | {{{kbd(C-c C-v l)}}} or {{{kbd(C-c C-v C-l)}}} | ~org-babel-load-in-session~ |
18014 | {{{kbd(C-c C-v i)}}} or {{{kbd(C-c C-v C-i)}}} | ~org-babel-lob-ingest~ |
18015 | {{{kbd(C-c C-v I)}}} or {{{kbd(C-c C-v C-I)}}} | ~org-babel-view-src-block-info~ |
18016 | {{{kbd(C-c C-v z)}}} or {{{kbd(C-c C-v C-z)}}} | ~org-babel-switch-to-session-with-code~ |
18017 | {{{kbd(C-c C-v a)}}} or {{{kbd(C-c C-v C-a)}}} | ~org-babel-sha1-hash~ |
18018 | {{{kbd(C-c C-v h)}}} or {{{kbd(C-c C-v C-h)}}} | ~org-babel-describe-bindings~ |
18019 | {{{kbd(C-c C-v x)}}} or {{{kbd(C-c C-v C-x)}}} | ~org-babel-do-key-sequence-in-edit-buffer~ |
18023 :DESCRIPTION: Call functions from the command line.
18025 #+cindex: code block, batch execution
18026 #+cindex: source code, batch execution
18028 Org mode features, including working with source code facilities can
18029 be invoked from the command line. This enables building shell scripts
18030 for batch processing, running automated system tasks, and expanding
18031 Org mode's usefulness.
18033 The sample script shows batch processing of multiple files using
18034 ~org-babel-tangle~.
18038 # Tangle files with Org mode
18040 emacs -Q --batch --eval "
18042 (require 'ob-tangle)
18043 (dolist (file command-line-args-left)
18044 (with-current-buffer (find-file-noselect file)
18045 (org-babel-tangle))))
18051 :DESCRIPTION: All the rest which did not fit elsewhere.
18056 :DESCRIPTION: M-TAB guesses completions.
18058 #+cindex: completion, of @TeX{} symbols
18059 #+cindex: completion, of TODO keywords
18060 #+cindex: completion, of dictionary words
18061 #+cindex: completion, of option keywords
18062 #+cindex: completion, of tags
18063 #+cindex: completion, of property keys
18064 #+cindex: completion, of link abbreviations
18065 #+cindex: @TeX{} symbol completion
18066 #+cindex: TODO keywords completion
18067 #+cindex: dictionary word completion
18068 #+cindex: option keyword completion
18069 #+cindex: tag completion
18070 #+cindex: link abbreviations, completion of
18072 Org has in-buffer completions. Unlike minibuffer completions, which
18073 are useful for quick command interactions, Org's in-buffer completions
18074 are more suitable for content creation in Org documents. Type one or
18075 more letters and invoke the hot key to complete the text in-place.
18076 Depending on the context and the keys, Org offers different types of
18077 completions. No minibuffer is involved. Such mode-specific hot keys
18078 have become an integral part of Emacs and Org provides several
18081 - {{{kbd(M-TAB)}}} ::
18084 Complete word at point.
18086 - At the beginning of a headline, complete TODO keywords.
18088 - After =\=, complete TeX symbols supported by the exporter.
18090 - After =*=, complete headlines in the current buffer so that
18091 they can be used in search links like:
18093 : [[*find this headline]]
18095 - After =:= in a headline, complete tags. The list of tags is
18096 taken from the variable ~org-tag-alist~ -- possibly set through
18097 the =#+TAGS= in-buffer option, see [[*Setting tags]] --, or it is
18098 created dynamically from all tags used in the current buffer.
18100 - After =:= and not in a headline, complete property keys. The
18101 list of keys is constructed dynamically from all keys used in
18102 the current buffer.
18104 - After =[=, complete link abbreviations (see [[*Link
18107 - After =#+=, complete the special keywords like =TYP_TODO= or
18108 file-specific =OPTIONS=. After option keyword is complete,
18109 pressing {{{kbd(M-TAB)}}} again inserts example settings for
18112 - After =STARTUP= keyword, complete startup items.
18114 - When point is anywhere else, complete dictionary words using
18117 ** Structure templates
18119 :DESCRIPTION: Quick insertion of structural elements.
18121 #+cindex: template insertion
18122 #+cindex: insertion, of templates
18124 With just a few keystrokes, it is possible to insert empty structural
18125 blocks, such as =#+BEGIN_SRC= ... =#+END_SRC=, or to wrap existing
18126 text in such a block.
18128 - {{{kbd(C-c C-x w)}}} (~org-insert-structure-template~) ::
18130 Prompt for a type of block structure, and insert the block at
18131 point. If the region is active, it is wrapped in the block.
18132 First prompts the user for a key, which is used to look up
18133 a structure type from the values below. If the key is
18134 {{{kbd(TAB)}}}, the user is prompted to enter a type.
18136 #+vindex: org-structure-template-alist
18137 Available structure types are defined in
18138 ~org-structure-template-alist~, see the docstring for adding or
18142 #+cindex: template expansion
18143 #+cindex: insertion, of templates
18144 #+vindex: org-tempo-keywords-alist
18145 #+vindex: org-structure-template-alist
18146 Org Tempo expands snippets to structures defined in
18147 ~org-structure-template-alist~ and ~org-tempo-keywords-alist~. For
18148 example, {{{kbd(< s TAB)}}} creates a code block. Enable it by
18149 customizing ~org-modules~ or add ~(require 'org-tempo)~ to your Emacs
18153 #+attr_texinfo: :columns 0.1 0.9
18154 | {{{kbd(a)}}} | =#+BEGIN_EXPORT ascii= ... =#+END_EXPORT= |
18155 | {{{kbd(c)}}} | =#+BEGIN_CENTER= ... =#+END_CENTER= |
18156 | {{{kbd(C)}}} | =#+BEGIN_COMMENT= ... =#+END_COMMENT= |
18157 | {{{kbd(e)}}} | =#+BEGIN_EXAMPLE= ... =#+END_EXAMPLE= |
18158 | {{{kbd(h)}}} | =#+BEGIN_EXPORT html= ... =#+END_EXPORT= |
18159 | {{{kbd(l)}}} | =#+BEGIN_EXPORT latex= ... =#+END_EXPORT= |
18160 | {{{kbd(q)}}} | =#+BEGIN_QUOTE= ... =#+END_QUOTE= |
18161 | {{{kbd(s)}}} | =#+BEGIN_SRC= ... =#+END_SRC= |
18162 | {{{kbd(v)}}} | =#+BEGIN_VERSE= ... =#+END_VERSE= |
18166 :DESCRIPTION: Electric commands at the beginning of a headline.
18168 #+cindex: speed keys
18170 Single keystrokes can execute custom commands in an Org file when the
18171 cursor is on a headline. Without the extra burden of a meta or
18172 modifier key, Speed Keys can speed navigation or execute custom
18173 commands. Besides faster navigation, Speed Keys may come in handy on
18174 small mobile devices that do not have full keyboards. Speed Keys may
18175 also work on TTY devices known for their problems when entering Emacs
18178 #+vindex: org-use-speed-commands
18179 By default, Org has Speed Keys disabled. To activate Speed Keys, set
18180 the variable ~org-use-speed-commands~ to a non-~nil~ value. To
18181 trigger a Speed Key, the cursor must be at the beginning of an Org
18182 headline, before any of the stars.
18184 #+vindex: org-speed-commands-user
18185 #+findex: org-speed-command-help
18186 Org comes with a pre-defined list of Speed Keys. To add or modify
18187 Speed Keys, customize the variable, ~org-speed-commands-user~. For
18188 more details, see the variable's docstring. With Speed Keys
18189 activated, {{{kbd(M-x org-speed-command-help)}}}, or {{{kbd(?)}}} when
18190 cursor is at the beginning of an Org headline, shows currently active
18191 Speed Keys, including the user-defined ones.
18193 ** Code evaluation and security issues
18195 :DESCRIPTION: Org files evaluate in-line code.
18196 :ALT_TITLE: Code evaluation security
18199 Unlike plain text, running code comes with risk. Each =src= code
18200 block, in terms of risk, is equivalent to an executable file. Org
18201 therefore puts a few confirmation prompts by default. This is to
18202 alert the casual user from accidentally running untrusted code.
18204 For users who do not run code blocks or write code regularly, Org's
18205 default settings should suffice. However, some users may want to
18206 tweak the prompts for fewer interruptions. To weigh the risks of
18207 automatic execution of code blocks, here are some details about code
18210 Org evaluates code in the following circumstances:
18212 - /Source code blocks/ ::
18214 Org evaluates =src= code blocks in an Org file during export.
18215 Org also evaluates a =src= code block with the {{{kbd(C-c C-c)}}}
18216 key chord. Users exporting or running code blocks must load
18217 files only from trusted sources. Be wary of customizing
18218 variables that remove or alter default security measures.
18220 #+attr_texinfo: :options org-confirm-babel-evaluate
18222 When ~t~, Org prompts the user for confirmation before executing
18223 each code block. When ~nil~, Org executes code blocks without
18224 prompting the user for confirmation. When this option is set to
18225 a custom function, Org invokes the function with these two
18226 arguments: the source code language and the body of the code
18227 block. The custom function must return either a ~t~ or ~nil~,
18228 which determines if the user is prompted. Each source code
18229 language can be handled separately through this function
18233 For example, here is how to execute ditaa code blocks without
18236 #+begin_src emacs-lisp
18237 (defun my-org-confirm-babel-evaluate (lang body)
18238 (not (string= lang "ditaa"))) ;don't ask for ditaa
18239 (setq org-confirm-babel-evaluate #'my-org-confirm-babel-evaluate)
18242 - /Following =shell= and =elisp= links/ ::
18244 Org has two link types that can directly evaluate code (see
18245 [[*External links]]). Because such code is not visible, these links
18246 have a potential risk. Org therefore prompts the user when it
18247 encounters such links. The customization variables are:
18249 #+attr_texinfo: :options org-confirm-shell-link-function
18251 Function that prompts the user before executing a shell link.
18254 #+attr_texinfo: :options org-confirm-elisp-link-function
18256 Function that prompts the user before executing an Emacs Lisp link.
18259 - /Formulas in tables/ ::
18261 Formulas in tables (see [[*The spreadsheet]]) are code that is
18262 evaluated either by the Calc interpreter, or by the Emacs Lisp
18267 :DESCRIPTION: Adapting Org to your taste.
18269 #+cindex: customization
18270 #+cindex: options, for customization
18271 #+cindex: variables, for customization
18273 Org has more than 500 variables for customization. They can be
18274 accessed through the usual {{{kbd(M-x org-customize)}}} command. Or
18275 through the Org menu: Org \rarr Customization \rarr Browse Org Group.
18277 Org also has per-file settings for some variables (see [[*Summary of
18278 in-buffer settings]]).
18280 ** Summary of in-buffer settings
18282 :DESCRIPTION: Overview of the #+KEYWORDS.
18283 :ALT_TITLE: In-buffer settings
18285 #+cindex: in-buffer settings
18286 #+cindex: special keywords
18288 In-buffer settings start with =#+=, followed by a keyword, a colon,
18289 and then a word for each setting. Org accepts multiple settings on
18290 the same line. Org also accepts multiple lines for a keyword. This
18291 manual describes these settings throughout. A summary follows here.
18293 #+cindex: refresh set-up
18294 {{{kbd(C-c C-c)}}} activates any changes to the in-buffer settings.
18295 Closing and reopening the Org file in Emacs also activates the
18298 #+attr_texinfo: :sep ,
18299 - =#+ARCHIVE: %s_done= ::
18301 #+cindex: ARCHIVE, keyword
18302 #+vindex: org-archive-location
18303 Sets the archive location of the agenda file. The corresponding
18304 variable is ~org-archive-location~.
18308 #+cindex: CATEGORY, keyword
18309 Sets the category of the agenda file, which applies to the entire
18312 - =#+COLUMNS: %25ITEM ...= ::
18314 #+cindex: COLUMNS, property
18315 Set the default format for columns view. This format applies
18316 when columns view is invoked in locations where no =COLUMNS=
18319 - =#+CONSTANTS: name1=value1 ...= ::
18321 #+cindex: CONSTANTS, keyword
18322 #+vindex: org-table-formula-constants
18323 #+vindex: org-table-formula
18324 Set file-local values for constants that table formulas can use.
18325 This line sets the local variable
18326 ~org-table-formula-constants-local~. The global version of this
18327 variable is ~org-table-formula-constants~.
18329 - =#+FILETAGS: :tag1:tag2:tag3:= ::
18331 #+cindex: FILETAGS, keyword
18332 Set tags that all entries in the file inherit from, including the
18335 - =#+LINK: linkword replace= ::
18337 #+cindex: LINK, keyword
18338 #+vindex: org-link-abbrev-alist
18339 Each line specifies one abbreviation for one link. Use multiple
18340 =LINK= keywords for more, see [[*Link abbreviations]]. The
18341 corresponding variable is ~org-link-abbrev-alist~.
18343 - =#+PRIORITIES: highest lowest default= ::
18345 #+cindex: PRIORITIES, keyword
18346 #+vindex: org-highest-priority
18347 #+vindex: org-lowest-priority
18348 #+vindex: org-default-priority
18349 This line sets the limits and the default for the priorities.
18350 All three must be either letters A--Z or numbers 0--9. The
18351 highest priority must have a lower ASCII number than the lowest
18354 - =#+PROPERTY: Property_Name Value= ::
18356 #+cindex: PROPERTY, keyword
18357 This line sets a default inheritance value for entries in the
18358 current buffer, most useful for specifying the allowed values of
18361 - =#+SETUPFILE: file= ::
18363 #+cindex: SETUPFILE, keyword
18364 The setup file or a URL pointing to such file is for additional
18365 in-buffer settings. Org loads this file and parses it for any
18366 settings in it only when Org opens the main file. If URL is
18367 specified, the contents are downloaded and stored in a temporary
18368 file cache. {{{kbd(C-c C-c)}}} on the settings line parses and
18369 loads the file, and also resets the temporary file cache. Org
18370 also parses and loads the document during normal exporting
18371 process. Org parses the contents of this document as if it was
18372 included in the buffer. It can be another Org file. To visit
18373 the file -- not a URL --, use {{{kbd(C-c ')}}} while the cursor
18374 is on the line with the file name.
18378 #+cindex: STARTUP, keyword
18379 Startup options Org uses when first visiting a file.
18381 #+vindex: org-startup-folded
18382 The first set of options deals with the initial visibility of the
18383 outline tree. The corresponding variable for global default
18384 settings is ~org-startup-folded~ with a default value of ~t~,
18385 which is the same as ~overview~.
18389 Top-level headlines only.
18397 No folding on any entry.
18399 - =showeverything= ::
18401 Show even drawer contents.
18403 #+vindex: org-startup-indented
18404 Dynamic virtual indentation is controlled by the variable
18405 ~org-startup-indented~.[fn:135]
18409 Start with ~org-indent-mode~ turned on.
18413 Start with ~org-indent-mode~ turned off.
18415 #+vindex: org-startup-align-all-tables
18416 Aligns tables consistently upon visiting a file. The corresponding
18417 variable is ~org-startup-align-all-tables~ with ~nil~ as default
18426 Do not align tables on startup.
18428 #+vindex: org-startup-shrink-all-tables
18429 Shrink table columns with a width cookie. The corresponding
18430 variable is ~org-startup-shrink-all-tables~ with ~nil~ as default
18433 #+vindex: org-startup-with-inline-images
18434 When visiting a file, inline images can be automatically displayed.
18435 The corresponding variable is ~org-startup-with-inline-images~,
18436 with a default value ~nil~ to avoid delays when visiting a file.
18438 - =inlineimages= ::
18440 Show inline images.
18442 - =noinlineimages= ::
18444 Do not show inline images on startup.
18446 #+vindex: org-log-done
18447 #+vindex: org-log-note-clock-out
18448 #+vindex: org-log-repeat
18449 Logging the closing and reopening of TODO items and clock
18450 intervals can be configured using these options (see variables
18451 ~org-log-done~, ~org-log-note-clock-out~, and ~org-log-repeat~).
18455 Record a timestamp when an item is marked DONE.
18459 Record timestamp and a note when DONE.
18463 Do not record when items are marked DONE.
18467 Record a time when reinstating a repeating item.
18469 - =lognoterepeat= ::
18471 Record a note when reinstating a repeating item.
18475 Do not record when reinstating repeating item.
18477 - =lognoteclock-out= ::
18479 Record a note when clocking out.
18481 - =nolognoteclock-out= ::
18483 Do not record a note when clocking out.
18485 - =logreschedule= ::
18487 Record a timestamp when scheduling time changes.
18489 - =lognotereschedule= ::
18491 Record a note when scheduling time changes.
18493 - =nologreschedule= ::
18495 Do not record when a scheduling date changes.
18497 - =logredeadline= ::
18499 Record a timestamp when deadline changes.
18501 - =lognoteredeadline= ::
18503 Record a note when deadline changes.
18505 - =nologredeadline= ::
18507 Do not record when a deadline date changes.
18511 Record a timestamp when refiling.
18513 - =lognoterefile= ::
18515 Record a note when refiling.
18519 Do not record when refiling.
18521 #+vindex: org-hide-leading-stars
18522 #+vindex: org-odd-levels-only
18523 Here are the options for hiding leading stars in outline headings,
18524 and for indenting outlines. The corresponding variables are
18525 ~org-hide-leading-stars~ and ~org-odd-levels-only~, both with
18526 a default setting ~nil~ (meaning =showstars= and =oddeven=).
18530 Make all but one of the stars starting a headline invisible.
18534 Show all stars starting a headline.
18538 Virtual indentation according to outline level.
18542 No virtual indentation according to outline level.
18546 Allow only odd outline levels (1, 3, ...).
18550 Allow all outline levels.
18552 #+vindex: org-put-time-stamp-overlays
18553 #+vindex: org-time-stamp-overlay-formats
18554 To turn on custom format overlays over timestamps (variables
18555 ~org-put-time-stamp-overlays~ and ~org-time-stamp-overlay-formats~),
18560 Overlay custom time format.
18562 #+vindex: constants-unit-system
18563 The following options influence the table spreadsheet (variable
18564 ~constants-unit-system~).
18568 =constants.el= should use the c-g-s unit system.
18572 =constants.el= should use the SI unit system.
18574 #+vindex: org-footnote-define-inline
18575 #+vindex: org-footnote-auto-label
18576 #+vindex: org-footnote-auto-adjust
18577 To influence footnote settings, use the following keywords. The
18578 corresponding variables are ~org-footnote-define-inline~,
18579 ~org-footnote-auto-label~, and ~org-footnote-auto-adjust~.
18583 Define footnotes inline.
18587 Define footnotes in separate section.
18591 Define footnotes near first reference, but not inline.
18595 Prompt for footnote labels.
18599 Create =[fn:1]=-like labels automatically (default).
18603 Offer automatic label for editing or confirmation.
18607 Automatically renumber and sort footnotes.
18611 Do not renumber and sort automatically.
18613 #+cindex: org-hide-block-startup
18614 To hide blocks on startup, use these keywords. The corresponding
18615 variable is ~org-hide-block-startup~.
18619 Hide all begin/end blocks on startup.
18621 - =nohideblocks= ::
18623 Do not hide blocks on startup.
18625 #+cindex: org-pretty-entities
18626 The display of entities as UTF-8 characters is governed by the
18627 variable ~org-pretty-entities~ and the keywords
18629 - =entitiespretty= ::
18631 Show entities as UTF-8 characters where possible.
18633 - =entitiesplain= ::
18635 Leave entities plain.
18637 - =#+TAGS: TAG1(c1) TAG2(c2)= ::
18639 #+cindex: TAGS, keyword
18640 #+vindex: org-tag-alist
18641 These lines (several such lines are allowed) specify the valid
18642 tags in this file, and (potentially) the corresponding /fast tag
18643 selection/ keys. The corresponding variable is ~org-tag-alist~.
18645 - =#+TODO:=, =#+SEQ_TODO:=, =#+TYP_TODO:= ::
18647 #+cindex: SEQ_TODO, keyword
18648 #+cindex: TODO, keyword
18649 #+cindex: TYP_TODO, keyword
18650 #+vindex: org-todo-keywords
18651 These lines set the TODO keywords and their interpretation in the
18652 current file. The corresponding variable is ~org-todo-keywords~.
18654 ** The very busy {{{kbd(C-c C-c)}}} key
18656 :DESCRIPTION: When in doubt, press @kbd{C-c C-c}.
18659 #+cindex: C-c C-c, overview
18661 The {{{kbd(C-c C-c)}}} key in Org serves many purposes depending on
18662 the context. It is probably the most over-worked, multi-purpose key
18663 combination in Org. Its uses are well documented throughout this
18664 manual, but here is a consolidated list for easy reference.
18666 - If any highlights shown in the buffer from the creation of a sparse
18667 tree, or from clock display, remove such highlights.
18669 - If the cursor is in one of the special =KEYWORD= lines, scan the
18670 buffer for these lines and update the information. Also reset the
18671 Org file cache used to temporary store the contents of URLs used as
18672 values for keywords like =SETUPFILE=.
18674 - If the cursor is inside a table, realign the table. The table
18675 realigns even if automatic table editor is turned off.
18677 - If the cursor is on a =TBLFM= keyword, re-apply the formulas to the
18680 - If the current buffer is a capture buffer, close the note and file
18681 it. With a prefix argument, also jump to the target location after
18684 - If the cursor is on a =<<<target>>>=, update radio targets and
18685 corresponding links in this buffer.
18687 - If the cursor is on a property line or at the start or end of
18688 a property drawer, offer property commands.
18690 - If the cursor is at a footnote reference, go to the corresponding
18691 definition, and /vice versa/.
18693 - If the cursor is on a statistics cookie, update it.
18695 - If the cursor is in a plain list item with a checkbox, toggle the
18696 status of the checkbox.
18698 - If the cursor is on a numbered item in a plain list, renumber the
18701 - If the cursor is on the =#+BEGIN= line of a dynamic block, the block
18704 - If the cursor is at a timestamp, fix the day name in the timestamp.
18706 ** A cleaner outline view
18708 :DESCRIPTION: Getting rid of leading stars in the outline.
18709 :ALT_TITLE: Clean view
18711 #+cindex: hiding leading stars
18712 #+cindex: dynamic indentation
18713 #+cindex: odd-levels-only outlines
18714 #+cindex: clean outline view
18716 Org's default outline with stars and no indents can become too
18717 cluttered for short documents. For /book-like/ long documents, the
18718 effect is not as noticeable. Org provides an alternate stars and
18719 indentation scheme, as shown on the right in the following table. It
18720 uses only one star and indents text to line with the heading:
18723 ,* Top level headline | * Top level headline
18724 ,** Second level | * Second level
18725 ,*** Third level | * Third level
18726 some text | some text
18727 ,*** Third level | * Third level
18728 more text | more text
18729 ,* Another top level headline | * Another top level headline
18732 #+texinfo: @noindent
18733 #+cindex: Indent mode
18734 #+findex: org-indent-mode
18735 To turn this mode on, use the minor mode, ~org-indent-mode~. Text
18736 lines that are not headlines are prefixed with spaces to vertically
18737 align with the headline text[fn:136].
18739 #+vindex: org-indent-indentation-per-level
18740 To make more horizontal space, the headlines are shifted by two stars.
18741 This can be configured by the ~org-indent-indentation-per-level~
18742 variable. Only one star on each headline is visible, the rest are
18743 masked with the same font color as the background.
18745 Note that turning on ~org-indent-mode~ sets ~org-hide-leading-stars~
18746 to ~t~ and ~org-adapt-indentation~ to ~nil~.
18748 #+vindex: org-startup-indented
18749 To globally turn on ~org-indent-mode~ for all files, customize the
18750 variable ~org-startup-indented~.
18752 To turn on indenting for individual files, use =STARTUP= keyword as
18755 : #+STARTUP: indent
18757 Indent on startup makes Org use hard spaces to align text with
18758 headings as shown in examples below.
18760 - /Indentation of text below headlines/ ::
18762 Indent text to align with the headline.
18766 more text, now indented
18769 #+vindex: org-adapt-indentation
18770 Org supports this with paragraph filling, line wrapping, and
18771 structure editing, preserving or adapting the indentation as
18772 appropriate[fn:137].
18774 - /Hiding leading stars/ ::
18776 #+vindex: org-hide-leading-stars
18777 Org can make leading stars invisible. For global preference,
18778 configure the variable ~org-hide-leading-stars~. For per-file
18779 preference, use these file =STARTUP= options:
18782 ,#+STARTUP: hidestars
18783 ,#+STARTUP: showstars
18786 With stars hidden, the tree is shown as:
18789 ,* Top level headline
18795 #+texinfo: @noindent
18796 #+vindex: org-hide, face
18797 Because Org makes the font color the same as the background color
18798 to hide to stars, sometimes ~org-hide~ face may need tweaking to
18799 get the effect right. For some black and white combinations,
18800 ~grey90~ on a white background might mask the stars better.
18804 #+vindex: org-odd-levels-only
18805 Using stars for only odd levels, 1, 3, 5, ..., can also clean up
18806 the clutter. This removes two stars from each level[fn:138].
18807 For Org to properly handle this cleaner structure during edits
18808 and exports, configure the variable ~org-odd-levels-only~. To
18809 set this per-file, use either one of the following lines:
18813 ,#+STARTUP: oddeven
18816 To switch between single and double stars layouts, use {{{kbd(M-x
18817 org-convert-to-odd-levels)}}} and {{{kbd(M-x
18818 org-convert-to-oddeven-levels)}}}.
18820 ** Using Org on a TTY
18822 :DESCRIPTION: Using Org on a tty.
18823 :ALT_TITLE: TTY keys
18825 #+cindex: tty key bindings
18827 Org provides alternative key bindings for TTY and modern mobile
18828 devices that cannot handle cursor keys and complex modifier key
18829 chords. Some of these workarounds may be more cumbersome than
18830 necessary. Users should look into customizing these further based on
18831 their usage needs. For example, the normal {{{kbd(S-cursor)}}} for
18832 editing timestamp might be better with {{{kbd(C-c .)}}} chord.
18834 #+attr_texinfo: :columns 0.2 0.25 0.1 0.25
18835 | Default | Alternative 1 | Speed key | Alternative 2 |
18836 |----------------------+--------------------------+--------------+----------------------|
18837 | {{{kbd(S-TAB)}}} | {{{kbd(C-u TAB)}}} | {{{kbd(C)}}} | |
18838 | {{{kbd(M-left)}}} | {{{kbd(C-c C-x l)}}} | {{{kbd(l)}}} | {{{kbd(Esc left)}}} |
18839 | {{{kbd(M-S-left)}}} | {{{kbd(C-c C-x L)}}} | {{{kbd(L)}}} | |
18840 | {{{kbd(M-right)}}} | {{{kbd(C-c C-x r)}}} | {{{kbd(r)}}} | {{{kbd(Esc right)}}} |
18841 | {{{kbd(M-S-right)}}} | {{{kbd(C-c C-x R)}}} | {{{kbd(R)}}} | |
18842 | {{{kbd(M-up)}}} | {{{kbd(C-c C-x u)}}} | | {{{kbd(Esc up)}}} |
18843 | {{{kbd(M-S-up)}}} | {{{kbd(C-c C-x U)}}} | {{{kbd(U)}}} | |
18844 | {{{kbd(M-down)}}} | {{{kbd(C-c C-x d)}}} | | {{{kbd(Esc down)}}} |
18845 | {{{kbd(M-S-down)}}} | {{{kbd(C-c C-x D)}}} | {{{kbd(D)}}} | |
18846 | {{{kbd(S-RET)}}} | {{{kbd(C-c C-x c)}}} | | |
18847 | {{{kbd(M-RET)}}} | {{{kbd(C-c C-x m)}}} | | {{{kbd(Esc RET)}}} |
18848 | {{{kbd(M-S-RET)}}} | {{{kbd(C-c C-x M)}}} | | |
18849 | {{{kbd(S-left)}}} | {{{kbd(C-c left)}}} | | |
18850 | {{{kbd(S-right)}}} | {{{kbd(C-c right)}}} | | |
18851 | {{{kbd(S-up)}}} | {{{kbd(C-c up)}}} | | |
18852 | {{{kbd(S-down)}}} | {{{kbd(C-c down)}}} | | |
18853 | {{{kbd(C-S-left)}}} | {{{kbd(C-c C-x left)}}} | | |
18854 | {{{kbd(C-S-right)}}} | {{{kbd(C-c C-x right)}}} | | |
18856 ** Interaction with other packages
18858 :DESCRIPTION: With other Emacs packages.
18859 :ALT_TITLE: Interaction
18861 #+cindex: packages, interaction with other
18863 Org's compatibility and the level of interaction with other Emacs
18864 packages are documented here.
18866 *** Packages that Org cooperates with
18868 :DESCRIPTION: Packages Org cooperates with.
18869 :ALT_TITLE: Cooperation
18872 - =calc.el= by Dave Gillespie ::
18873 #+cindex: @file{calc.el}
18875 Org uses the Calc package for implementing spreadsheet
18876 functionality in its tables (see [[*The spreadsheet]]). Org also
18877 uses Calc for embedded calculations. See [[info:calc:Embedded%20Mode][GNU Emacs Calc Manual]].
18879 - =constants.el= by Carsten Dominik ::
18880 #+cindex: @file{constants.el}
18881 #+vindex: org-table-formula-constants
18883 Org can use names for constants in formulas in tables. Org can
18884 also use calculation suffixes for units, such as =M= for =Mega=.
18885 For a standard collection of such constants, install the
18886 =constants= package. Install version 2.0 of this package,
18887 available at [[http://www.astro.uva.nl/~dominik/Tools]]. Org checks
18888 if the function ~constants-get~ has been autoloaded.
18889 Installation instructions are in the file =constants.el=.
18891 - =cdlatex.el= by Carsten Dominik ::
18892 #+cindex: @file{cdlatex.el}
18894 Org mode can make use of the CDLaTeX package to efficiently enter
18895 LaTeX fragments into Org files. See [[*Using CDLaTeX to enter
18898 - =imenu.el= by Ake Stenhoff and Lars Lindberg ::
18899 #+cindex: @file{imenu.el}
18901 Imenu creates dynamic menus based on an index of items in a file.
18902 Org mode supports Imenu menus. Enable it with a mode hook as
18905 #+begin_src emacs-lisp
18906 (add-hook 'org-mode-hook
18907 (lambda () (imenu-add-to-menubar "Imenu")))
18910 #+vindex: org-imenu-depth
18911 By default the index is two levels deep -- you can modify the
18912 depth using the option ~org-imenu-depth~.
18914 - =speedbar.el= by Eric M. Ludlam ::
18915 #+cindex: @file{speedbar.el}
18917 Speedbar package creates a special Emacs frame for displaying
18918 files and index items in files. Org mode supports Speedbar;
18919 users can drill into Org files directly from the Speedbar. The
18920 {{{kbd(<)}}} in the Speedbar frame tweaks the agenda commands to
18921 that file or to a subtree.
18923 - =table.el= by Takaaki Ota ::
18924 #+cindex: table editor, @file{table.el}
18925 #+cindex: @file{table.el}
18927 Complex ASCII tables with automatic line wrapping, column- and
18928 row-spanning, and alignment can be created using the Emacs table
18929 package by Takaaki Ota. Org mode recognizes such tables and
18930 exports them properly. {{{kbd(C-c ')}}} to edit these tables in
18931 a special buffer, much like Org's code blocks. Because of
18932 interference with other Org mode functionality, Takaaki Ota
18933 tables cannot be edited directly in the Org buffer.
18935 - {{{kbd(C-c ')}}} (~org-edit-special~) ::
18938 #+findex: org-edit-special
18939 Edit a =table.el= table. Works when the cursor is in
18940 a =table.el= table.
18942 - {{{kbd(C-c ~ )}}} (~org-table-create-with-table.el~) ::
18945 #+findex: org-table-create-with-table.el
18946 Insert a =table.el= table. If there is already a table at
18947 point, this command converts it between the =table.el=
18948 format and the Org mode format. See the documentation
18949 string of the command ~org-convert-table~ for the
18950 restrictions under which this is possible.
18952 *** Packages that conflict with Org mode
18954 :DESCRIPTION: Packages that lead to conflicts.
18955 :ALT_TITLE: Conflicts
18958 #+cindex: shift-selection-mode
18959 #+vindex: org-support-shift-select
18960 In Emacs, ~shift-selection-mode~ combines cursor motions with shift
18961 key to enlarge regions. Emacs sets this mode by default. This
18962 conflicts with Org's use of {{{kbd(S-<cursor>)}}} commands to change
18963 timestamps, TODO keywords, priorities, and item bullet types, etc.
18964 Since {{{kbd(S-<cursor>)}}} commands outside of specific contexts do
18965 not do anything, Org offers the variable ~org-support-shift-select~
18966 for customization. Org mode accommodates shift selection by (i)
18967 making it available outside of the special contexts where special
18968 commands apply, and (ii) extending an existing active region even if
18969 the cursor moves across a special context.
18971 - =cua.el= by Kim. F. Storm ::
18973 #+cindex: @file{cua.el}
18974 #+vindex: org-replace-disputed-keys
18975 Org key bindings conflict with {{{kbd(S-cursor)}}} keys used by
18976 CUA mode. For Org to relinquish these bindings to CUA mode,
18977 configure the variable ~org-replace-disputed-keys~. When set,
18978 Org moves the following key bindings in Org files, and in the
18979 agenda buffer -- but not during date selection.
18981 | S-UP \rArr{} M-p | S-DOWN \rArr{} M-n |
18982 | S-LEFT \rArr{} M-- | S-RIGHT \rArr{} M-+ |
18983 | C-S-LEFT \rArr{} M-S-- | C-S-RIGHT \rArr{} M-S-+ |
18985 #+vindex: org-disputed-keys
18986 Yes, these are unfortunately more difficult to remember. If you
18987 want to have other replacement keys, look at the variable
18988 ~org-disputed-keys~.
18990 - =ecomplete.el= by Lars Magne Ingebrigtsen ::
18992 #+cindex: @file{ecomplete.el}
18993 Ecomplete provides "electric" address completion in address
18994 header lines in message buffers. Sadly Orgtbl mode cuts
18995 Ecomplete's power supply: no completion happens when Orgtbl mode
18996 is enabled in message buffers while entering text in address
18997 header lines. If one wants to use ecomplete one should /not/
18998 follow the advice to automagically turn on Orgtbl mode in message
18999 buffers (see [[*The Orgtbl minor mode]]), but instead -- after
19000 filling in the message headers -- turn on Orgtbl mode manually
19001 when needed in the messages body.
19003 - =filladapt.el= by Kyle Jones ::
19005 #+cindex: @file{filladapt.el}
19006 Org mode tries to do the right thing when filling paragraphs,
19007 list items and other elements. Many users reported problems
19008 using both =filladapt.el= and Org mode, so a safe thing to do is
19009 to disable filladapt like this:
19011 #+begin_src emacs-lisp
19012 (add-hook 'org-mode-hook 'turn-off-filladapt-mode)
19015 - =viper.el= by Michael Kifer ::
19016 #+cindex: @file{viper.el}
19019 Viper uses {{{kbd(C-c /)}}} and therefore makes this key not
19020 access the corresponding Org mode command ~org-sparse-tree~. You
19021 need to find another key for this command, or override the key in
19022 ~viper-vi-global-user-map~ with
19024 #+begin_src emacs-lisp
19025 (define-key viper-vi-global-user-map "C-c /" 'org-sparse-tree)
19028 - =windmove.el= by Hovav Shacham ::
19029 #+cindex: @file{windmove.el}
19031 This package also uses the {{{kbd(S-<cursor>)}}} keys, so
19032 everything written in the paragraph above about CUA mode also
19033 applies here. If you want to make the windmove function active
19034 in locations where Org mode does not have special functionality
19035 on {{{kbd(S-<cursor>)}}}, add this to your configuration:
19037 #+begin_src emacs-lisp
19038 ;; Make windmove work in Org mode:
19039 (add-hook 'org-shiftup-final-hook 'windmove-up)
19040 (add-hook 'org-shiftleft-final-hook 'windmove-left)
19041 (add-hook 'org-shiftdown-final-hook 'windmove-down)
19042 (add-hook 'org-shiftright-final-hook 'windmove-right)
19045 - =yasnippet.el= ::
19047 #+cindex: @file{yasnippet.el}
19048 The way Org mode binds the {{{kbd(TAB)}}} key (binding to ~[tab]~
19049 instead of ~"\t"~) overrules YASnippet's access to this key. The
19050 following code fixed this problem:
19052 #+begin_src emacs-lisp
19053 (add-hook 'org-mode-hook
19055 (setq-local yas/trigger-key [tab])
19056 (define-key yas/keymap [tab] 'yas/next-field-or-maybe-expand)))
19059 The latest version of YASnippet does not play well with Org mode.
19060 If the above code does not fix the conflict, start by defining
19061 the following function:
19063 #+begin_src emacs-lisp
19064 (defun yas/org-very-safe-expand ()
19065 (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
19068 Then, tell Org mode to use that function:
19070 #+begin_src emacs-lisp
19071 (add-hook 'org-mode-hook
19073 (make-variable-buffer-local 'yas/trigger-key)
19074 (setq yas/trigger-key [tab])
19075 (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
19076 (define-key yas/keymap [tab] 'yas/next-field)))
19081 :DESCRIPTION: Encrypting Org files.
19084 Org Crypt encrypts the text of an entry, but not the headline, or
19085 properties. Behind the scene, it uses the Emacs EasyPG library to
19086 encrypt and decrypt files.
19088 #+vindex: org-crypt-tag-matcher
19089 Any text below a headline that has a =crypt= tag is automatically
19090 encrypted when the file is saved. To use a different tag, customize
19091 the ~org-crypt-tag-matcher~ setting.
19093 Here is a suggestion for Org Crypt settings in Emacs init file:
19095 #+begin_src emacs-lisp
19096 (require 'org-crypt)
19097 (org-crypt-use-before-save-magic)
19098 (setq org-tags-exclude-from-inheritance '("crypt"))
19100 (setq org-crypt-key nil)
19101 ;; GPG key to use for encryption
19102 ;; Either the Key ID or set to nil to use symmetric encryption.
19104 (setq auto-save-default nil)
19105 ;; Auto-saving does not cooperate with org-crypt.el: so you need to
19106 ;; turn it off if you plan to use org-crypt.el quite often. Otherwise,
19107 ;; you'll get an (annoying) message each time you start Org.
19109 ;; To turn it off only locally, you can insert this:
19111 ;; # -*- buffer-auto-save-file-name: nil; -*-
19114 Excluding the =crypt= tag from inheritance prevents already encrypted
19115 text from being encrypted again.
19119 :DESCRIPTION: How to hack your way around.
19120 :APPENDIX: Appendix
19124 This appendix describes some ways a user can extend the functionality
19129 :DESCRIPTION: How to reach into Org's internals.
19133 Org has a large number of hook variables for adding functionality.
19134 This appendix illustrates using a few. A complete list of hooks with
19135 documentation is maintained by the Worg project at
19136 http://orgmode.org/worg/doc.html#hooks.
19140 :DESCRIPTION: Available extensions.
19142 #+cindex: add-on packages
19144 Various authors wrote a large number of add-on packages for Org.
19146 These packages are not part of Emacs, but they are distributed as
19147 contributed packages with the separate release available at
19148 http://orgmode.org. See the =contrib/README= file in the source code
19149 directory for a list of contributed files. Worg page with more
19150 information is at: http://orgmode.org/worg/org-contrib/.
19152 ** Adding hyperlink types
19154 :DESCRIPTION: New custom link types.
19156 #+cindex: hyperlinks, adding new types
19158 Org has many built-in hyperlink types (see [[*Hyperlinks]]), and an
19159 interface for adding new link types. The example file, =org-man.el=,
19160 shows the process of adding Org links to Unix man pages, which look
19163 : [[man:printf][The printf manual]]
19165 #+begin_src emacs-lisp
19166 ;;; org-man.el - Support for links to manpages in Org
19170 (org-add-link-type "man" 'org-man-open)
19171 (add-hook 'org-store-link-functions 'org-man-store-link)
19173 (defcustom org-man-command 'man
19174 "The Emacs command to be used to display a man page."
19176 :type '(choice (const man) (const woman)))
19178 (defun org-man-open (path)
19179 "Visit the manpage on PATH.
19180 PATH should be a topic that can be thrown at the man command."
19181 (funcall org-man-command path))
19183 (defun org-man-store-link ()
19184 "Store a link to a manpage."
19185 (when (memq major-mode '(Man-mode woman-mode))
19186 ;; This is a man page, we do make this link
19187 (let* ((page (org-man-get-page-name))
19188 (link (concat "man:" page))
19189 (description (format "Manpage for %s" page)))
19190 (org-store-link-props
19193 :description description))))
19195 (defun org-man-get-page-name ()
19196 "Extract the page name from the buffer name."
19197 ;; This works for both `Man-mode' and `woman-mode'.
19198 (if (string-match " \\(\\S-+\\)\\*" (buffer-name))
19199 (match-string 1 (buffer-name))
19200 (error "Cannot create link to this man page")))
19204 ;;; org-man.el ends here
19207 #+texinfo: @noindent
19208 To activate links to man pages in Org, enter this in the init file:
19210 #+begin_src emacs-lisp
19214 #+texinfo: @noindent
19215 A review of =org-man.el=:
19217 1. First, ~(require 'org)~ ensures =org.el= is loaded.
19219 2. Then ~org-add-link-type~ defines a new link type with =man= prefix.
19220 The call contains the function to call that follows the link type.
19223 #+vindex: org-store-link-functions
19224 The next line adds a function to ~org-store-link-functions~ that
19225 records a useful link with the command {{{kbd(C-c l)}}} in a buffer
19226 displaying a man page.
19228 The rest of the file defines necessary variables and functions. First
19229 is the customization variable ~org-man-command~. It has two options,
19230 ~man~ and ~woman~. Next is a function whose argument is the link
19231 path, which for man pages is the topic of the man command. To follow
19232 the link, the function calls the ~org-man-command~ to display the man
19235 {{{kbd(C-c l)}}} constructs and stores the link.
19237 {{{kbd(C-c l)}}} calls the function ~org-man-store-link~, which first
19238 checks if the ~major-mode~ is appropriate. If check fails, the
19239 function returns ~nil~. Otherwise the function makes a link string by
19240 combining the =man:= prefix with the man topic. The function then
19241 calls ~org-store-link-props~ with ~:type~ and ~:link~ properties.
19242 A ~:description~ property is an optional string that is displayed when
19243 the function inserts the link in the Org buffer.
19245 {{{kbd(C-c C-l)}}} inserts the stored link.
19247 To define new link types, define a function that implements completion
19248 support with {{{kbd(C-c C-l)}}}. This function should not accept any
19249 arguments but return the appropriate prefix and complete link string.
19251 ** Adding export back-ends
19253 :DESCRIPTION: How to write new export back-ends.
19255 #+cindex: Export, writing back-ends
19257 Org's export engine makes it easy for writing new back-ends. The
19258 framework on which the engine was built makes it easy to derive new
19259 back-ends from existing ones.
19261 #+findex: org-export-define-backend
19262 #+findex: org-export-define-derived-backend
19263 The two main entry points to the export engine are:
19264 ~org-export-define-backend~ and ~org-export-define-derived-backend~.
19265 To grok these functions, see =ox-latex.el= for an example of defining
19266 a new back-end from scratch, and =ox-beamer.el= for an example of
19267 deriving from an existing engine.
19269 For creating a new back-end from scratch, first set its name as
19270 a symbol in an alist consisting of elements and export functions. To
19271 make the back-end visible to the export dispatcher, set ~:menu-entry~
19272 keyword. For export options specific to this back-end, set the
19275 For creating a new back-end from an existing one, set
19276 ~:translate-alist~ to an alist of export functions. This alist
19277 replaces the parent back-end functions.
19279 For complete documentation, see [[http://orgmode.org/worg/dev/org-export-reference.html][the Org Export Reference on Worg]].
19281 ** Tables in arbitrary syntax
19283 :DESCRIPTION: Orgtbl for LaTeX and other programs.
19285 #+cindex: tables, in other modes
19286 #+cindex: lists, in other modes
19287 #+cindex: Orgtbl mode
19289 Due to Org's success in handling tables with Orgtbl, a frequently
19290 requested feature is the use of Org's table functions in other modes,
19291 e.g., LaTeX. This would be hard to do in a general way without
19292 complicated customization nightmares. Moreover, that would take Org
19293 away from its simplicity roots that Orgtbl has proven. There is,
19294 however, an alternate approach to accomplishing the same.
19296 This approach involves implementing a custom /translate/ function that
19297 operates on a native Org /source table/ to produce a table in another
19298 format. This strategy would keep the excellently working Orgtbl
19299 simple and isolate complications, if any, confined to the translate
19300 function. To add more alien table formats, we just add more translate
19301 functions. Also the burden of developing custom translate functions
19302 for new table formats is in the hands of those who know those formats
19305 For an example of how this strategy works, see Orgstruct mode. In
19306 that mode, Bastien added the ability to use Org's facilities to edit
19307 and re-structure lists. He did this by turning Orgstruct mode on, and
19308 then exporting the list locally to another format, such as HTML, LaTeX
19313 :DESCRIPTION: Sending and receiving radio tables.
19315 #+cindex: radio tables
19317 Radio tables are target locations for translated tables that are not near
19318 their source. Org finds the target location and inserts the translated
19321 The key to finding the target location is the magic words =BEGIN/END
19322 RECEIVE ORGTBL=. They have to appear as comments in the current mode.
19323 If the mode is C, then:
19326 /* BEGIN RECEIVE ORGTBL table_name */
19327 /* END RECEIVE ORGTBL table_name */
19330 #+texinfo: @noindent
19331 At the location of source, Org needs a special line to direct Orgtbl
19332 to translate and to find the target for inserting the translated
19333 table. For example:
19335 #+cindex: ORGTBL, keyword
19336 : #+ORGTBL: SEND table_name translation_function arguments ...
19338 #+texinfo: @noindent
19339 =table_name= is the table's reference name, which is also used in the
19340 receiver lines, and the =translation_function= is the Lisp function
19341 that translates. This line, in addition, may also contain alternating
19342 key and value arguments at the end. The translation function gets
19343 these values as a property list. A few standard parameters are
19344 already recognized and acted upon before the translation function is
19349 Skip the first N lines of the table. Hlines do count; include
19350 them if they are to be skipped.
19352 - =:skipcols (n1 n2 ...)= ::
19354 List of columns to be skipped. First Org automatically discards
19355 columns with calculation marks and then sends the table to the
19356 translator function, which then skips columns as specified in
19359 #+texinfo: @noindent
19360 To keep the source table intact in the buffer without being disturbed
19361 when the source file is compiled or otherwise being worked on, use one
19362 of these strategies:
19364 - Place the table in a block comment. For example, in C mode you
19365 could wrap the table between =/*= and =*/= lines.
19367 - Put the table after an "end" statement. For example ~\bye~ in TeX
19368 and ~\end{document}~ in LaTeX.
19370 - Comment and un-comment each line of the table during edits. The
19371 {{{kbd(M-x orgtbl-toggle-comment)}}} command makes toggling easy.
19373 *** A LaTeX example of radio tables
19375 :DESCRIPTION: Step by step, almost a tutorial.
19376 :ALT_TITLE: A LaTeX example
19378 #+cindex: @LaTeX{}, and Orgtbl mode
19380 To wrap a source table in LaTeX, use the =comment= environment
19381 provided by =comment.sty=[fn:139]. To activate it, put
19382 ~\usepackage{comment}~ in the document header. Orgtbl mode inserts
19383 a radio table skeleton[fn:138] with the command {{{kbd(M-x
19384 orgtbl-insert-radio-table)}}}, which prompts for a table name. For
19385 example, if =salesfigures= is the name, the template inserts:
19388 % BEGIN RECEIVE ORGTBL salesfigures
19389 % END RECEIVE ORGTBL salesfigures
19391 ,#+ORGTBL: SEND salesfigures orgtbl-to-latex
19396 #+vindex: @LaTeX{}-verbatim-environments
19397 #+texinfo: @noindent
19398 The line =#+ORGTBL: SEND= tells Orgtbl mode to use the function
19399 ~orgtbl-to-latex~ to convert the table to LaTeX format, then insert
19400 the table at the target (receive) location named =salesfigures=. Now
19401 the table is ready for data entry. It can even use spreadsheet
19405 % BEGIN RECEIVE ORGTBL salesfigures
19406 % END RECEIVE ORGTBL salesfigures
19408 ,#+ORGTBL: SEND salesfigures orgtbl-to-latex
19409 | Month | Days | Nr sold | per day |
19410 |-------+------+---------+---------|
19411 | Jan | 23 | 55 | 2.4 |
19412 | Feb | 21 | 16 | 0.8 |
19413 | March | 22 | 278 | 12.6 |
19414 ,#+TBLFM: $4=$3/$2;%.1f
19415 % $ (optional extra dollar to keep Font Lock happy, see footnote)
19419 #+texinfo: @noindent
19420 After editing, {{{kbd(C-c C-c)}}} inserts the translated table at the
19421 target location, between the two marker lines.
19423 For hand-made custom tables, note that the translator needs to skip
19424 the first two lines of the source table. Also the command has to
19425 /splice/ out the target table without the header and footer.
19428 \begin{tabular}{lrrr}
19429 Month & \multicolumn{1}{c}{Days} & Nr.\ sold & per day\\
19430 % BEGIN RECEIVE ORGTBL salesfigures
19431 % END RECEIVE ORGTBL salesfigures
19435 ,#+ORGTBL: SEND salesfigures orgtbl-to-latex :splice t :skip 2
19436 | Month | Days | Nr sold | per day |
19437 |-------+------+---------+---------|
19438 | Jan | 23 | 55 | 2.4 |
19439 | Feb | 21 | 16 | 0.8 |
19440 | March | 22 | 278 | 12.6 |
19441 ,#+TBLFM: $4=$3/$2;%.1f
19445 The LaTeX translator function ~orgtbl-to-latex~ is already part of
19446 Orgtbl mode and uses a =tabular= environment to typeset the table and
19447 marks horizontal lines with ~\hline~. For additional parameters to
19448 control output, see [[*Translator functions]]:
19450 - ~:splice nil/t~ ::
19452 When non-~nil~, return only table body lines; not wrapped in
19453 tabular environment. Default is ~nil~.
19457 Format to warp each field. It should contain =%s= for the
19458 original field value. For example, to wrap each field value in
19459 dollar symbol, you could use =:fmt "$%s$"=. Format can also wrap
19460 a property list with column numbers and formats, for example
19461 =:fmt (2 "$%s$" 4 "%s\\%%")=. In place of a string, a function
19462 of one argument can be used; the function must return a formatted
19467 Format numbers as exponentials. The spec should have =%s= twice
19468 for inserting mantissa and exponent, for example ="%s\\times10^{%s}"=.
19469 This may also be a property list with column numbers and formats,
19470 for example =:efmt (2 "$%s\\times10^{%s}$" 4 "$%s\\cdot10^{%s}$")=. After
19471 {{{var(EFMT)}}} has been applied to a value, {{{var(FMT)}}} --
19472 see above -- is also be applied. Functions with two arguments
19473 can be supplied instead of strings. By default, no special
19474 formatting is applied.
19476 *** Translator functions
19478 :DESCRIPTION: Copy and modify.
19480 #+cindex: HTML, and Orgtbl mode
19481 #+cindex: translator function
19483 #+findex: orgtbl-to-csv
19484 #+findex: orgtbl-to-tsv
19485 #+findex: orgtbl-to-latex
19486 #+findex: orgtbl-to-html
19487 #+findex: orgtbl-to-texinfo
19488 #+findex: orgtbl-to-unicode
19489 #+findex: orgtbl-to-orgtbl
19490 #+findex: orgtbl-to-generic
19491 Orgtbl mode has built-in translator functions: ~orgtbl-to-csv~
19492 (comma-separated values), ~orgtbl-to-tsv~ (TAB-separated values),
19493 ~orgtbl-to-latex~, ~orgtbl-to-html~, ~orgtbl-to-texinfo~,
19494 ~orgtbl-to-unicode~ and ~orgtbl-to-orgtbl~. They use the generic
19495 translator, ~orgtbl-to-generic~, which delegates translations to
19496 various export back-ends.
19498 Properties passed to the function through the =ORGTBL SEND= line take
19499 precedence over properties defined inside the function. For example,
19500 this overrides the default LaTeX line endings, ~\\~, with ~\\[2mm]~:
19502 : #+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]"
19504 For a new language translator, define a converter function. It can be
19505 a generic function, such as shown in this example. It marks
19506 a beginning and ending of a table with =!BTBL!= and =!ETBL!=;
19507 a beginning and ending of lines with =!BL!= and =!EL!=; and uses a TAB
19508 for a field separator:
19510 #+begin_src emacs-lisp
19511 (defun orgtbl-to-language (table params)
19512 "Convert the orgtbl-mode TABLE to language."
19515 (org-combine-plists
19516 '(:tstart "!BTBL!" :tend "!ETBL!" :lstart "!BL!" :lend "!EL!" :sep "\t")
19520 #+texinfo: @noindent
19521 The documentation for the ~orgtbl-to-generic~ function shows
19522 a complete list of parameters, each of which can be passed through to
19523 ~orgtbl-to-latex~, ~orgtbl-to-texinfo~, and any other function using
19524 that generic function.
19526 For complicated translations the generic translator function could be
19527 replaced by a custom translator function. Such a custom function must
19528 take two arguments and return a single string containing the formatted
19529 table. The first argument is the table whose lines are a list of
19530 fields or the symbol ~hline~. The second argument is the property
19531 list consisting of parameters specified in the =#+ORGTBL: SEND= line.
19532 Please share your translator functions by posting them to the Org
19533 users mailing list, at mailto:emacs-orgmode@gnu.org.
19537 :DESCRIPTION: Sending and receiving lists.
19539 #+cindex: radio lists
19541 #+findex: org-list-insert-radio-list
19542 Call the ~org-list-insert-radio-list~ function to insert a radio list
19543 template in HTML, LaTeX, and Texinfo mode documents. Sending and
19544 receiving radio lists works is the same as for radio tables (see
19545 [[*Radio tables]]) except for these differences:
19547 #+cindex: ORGLST, keyword
19548 - Orgstruct mode must be active.
19549 - Use the =ORGLST= keyword instead of =ORGTBL=.
19550 - {{{kbd(C-c C-c)}}} works only on the first list item.
19552 #+findex: org-list-to-latex
19553 #+findex: org-list-to-html
19554 #+findex: org-list-to-texinfo
19555 #+findex: org-list-to-generic
19556 Built-in translator functions are: ~org-list-to-latex~,
19557 ~org-list-to-html~ and ~org-list-to-texinfo~. They use the
19558 ~org-list-to-generic~ translator function. See its documentation for
19559 parameters for accurate customizations of lists. Here is a LaTeX
19563 % BEGIN RECEIVE ORGLST to-buy
19564 % END RECEIVE ORGLST to-buy
19566 ,#+ORGLST: SEND to-buy org-list-to-latex
19575 {{{kbd(C-c C-c)}}} on =a new house= inserts the translated LaTeX list
19576 in-between the =BEGIN= and =END= marker lines.
19580 :DESCRIPTION: Automatically filled blocks.
19582 #+cindex: dynamic blocks
19584 Org supports /dynamic blocks/ in Org documents. They are inserted
19585 with begin and end markers like any other code block, but the contents
19586 are updated automatically by a user function. For example, {{{kbd(C-c
19587 C-x C-r)}}} inserts a dynamic table that updates the work time (see
19588 [[*Clocking work time]]).
19590 Dynamic blocks can have names and function parameters. The syntax is
19591 similar to source code block specifications:
19594 ,#+BEGIN: myblock :parameter1 value1 :parameter2 value2 ...
19599 These commands update dynamic blocks:
19601 - {{{kbd(C-c C-x C-u)}}} (~org-dblock-update~) ::
19603 #+kindex: C-c C-x C-u
19604 #+findex: org-dblock-update
19605 Update dynamic block at point.
19607 - {{{kbd(C-u C-c C-x C-u)}}} ::
19609 #+kindex: C-u C-c C-x C-u
19610 Update all dynamic blocks in the current file.
19612 Before updating a dynamic block, Org removes content between the
19613 =BEGIN= and =END= markers. Org then reads the parameters on the
19614 =BEGIN= line for passing to the writer function. If the function
19615 expects to access the removed content, then Org expects an extra
19616 parameter, =:content=, on the =BEGIN= line.
19618 The syntax for naming a writer function with a dynamic block labelled
19619 =myblock= is: ~org-dblock-write:myblock~. Parameters come from the
19622 The following is an example of a dynamic block and a block writer function
19623 that updates the time when the function was last run:
19626 ,#+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M"
19631 #+texinfo: @noindent
19632 The dynamic block's writer function:
19634 #+begin_src emacs-lisp
19635 (defun org-dblock-write:block-update-time (params)
19636 (let ((fmt (or (plist-get params :format) "%d. %m. %Y")))
19637 (insert "Last block update at: "
19638 (format-time-string fmt))))
19641 To keep dynamic blocks up-to-date in an Org file, use the function,
19642 ~org-update-all-dblocks~ in hook, such as ~before-save-hook~. The
19643 ~org-update-all-dblocks~ function does not run if the file is not in
19646 #+findex: org-narrow-to-block
19647 Dynamic blocks, like any other block, can be narrowed with
19648 ~org-narrow-to-block~.
19650 ** Special agenda views
19652 :DESCRIPTION: Customized views.
19654 #+cindex: agenda views, user-defined
19656 #+vindex: org-agenda-skip-function
19657 #+vindex: org-agenda-skip-function-global
19658 Org provides a special hook to further limit items in agenda views:
19659 ~agenda~, ~agenda*~[fn:141], ~todo~, ~alltodo~, ~tags~, ~tags-todo~,
19660 ~tags-tree~. Specify a custom function that tests inclusion of every
19661 matched item in the view. This function can also skip as much as is
19664 For a global condition applicable to agenda views, use the
19665 ~org-agenda-skip-function-global~ variable. Org uses a global
19666 condition with ~org-agenda-skip-function~ for custom searching.
19668 This example defines a function for a custom view showing TODO items
19669 with =waiting= status. Manually this is a multi-step search process,
19670 but with a custom view, this can be automated as follows:
19672 The custom function searches the subtree for the =waiting= tag and
19673 returns ~nil~ on match. Otherwise it gives the location from where
19674 the search continues.
19676 #+begin_src emacs-lisp
19677 (defun my-skip-unless-waiting ()
19678 "Skip trees that are not waiting"
19679 (let ((subtree-end (save-excursion (org-end-of-subtree t))))
19680 (if (re-search-forward ":waiting:" subtree-end t)
19681 nil ; tag found, do not skip
19682 subtree-end))) ; tag not found, continue after end of subtree
19685 To use this custom function in a custom agenda command:
19687 #+begin_src emacs-lisp
19688 (org-add-agenda-custom-command
19689 '("b" todo "PROJECT"
19690 ((org-agenda-skip-function 'my-skip-unless-waiting)
19691 (org-agenda-overriding-header "Projects waiting for something: "))))
19694 #+vindex: org-agenda-overriding-header
19695 Note that this also binds ~org-agenda-overriding-header~ to a more
19696 meaningful string suitable for the agenda view.
19698 #+vindex: org-odd-levels-only
19699 #+vindex: org-agenda-skip-function
19700 Search for entries with a limit set on levels for the custom search.
19701 This is a general approach to creating custom searches in Org. To
19702 include all levels, use =LEVEL>0=[fn:142]. Then to selectively pick
19703 the matched entries, use ~org-agenda-skip-function~, which also
19704 accepts Lisp forms, such as ~org-agenda-skip-entry-if~ and
19705 ~org-agenda-skip-subtree-if~. For example:
19707 - ~(org-agenda-skip-entry-if 'scheduled)~ ::
19709 Skip current entry if it has been scheduled.
19711 - ~(org-agenda-skip-entry-if 'notscheduled)~ ::
19713 Skip current entry if it has not been scheduled.
19715 - ~(org-agenda-skip-entry-if 'deadline)~ ::
19717 Skip current entry if it has a deadline.
19719 - ~(org-agenda-skip-entry-if 'scheduled 'deadline)~ ::
19721 Skip current entry if it has a deadline, or if it is scheduled.
19723 - ~(org-agenda-skip-entry-if 'todo '("TODO" "WAITING"))~ ::
19725 Skip current entry if the TODO keyword is TODO or WAITING.
19727 - ~(org-agenda-skip-entry-if 'todo 'done)~ ::
19729 Skip current entry if the TODO keyword marks a DONE state.
19731 - ~(org-agenda-skip-entry-if 'timestamp)~ ::
19733 Skip current entry if it has any timestamp, may also be deadline
19736 - ~(org-agenda-skip-entry-if 'regexp "regular expression")~ ::
19738 Skip current entry if the regular expression matches in the
19741 - ~(org-agenda-skip-entry-if 'notregexp "regular expression")~ ::
19743 Skip current entry unless the regular expression matches.
19745 - ~(org-agenda-skip-subtree-if 'regexp "regular expression")~ ::
19747 Same as above, but check and skip the entire subtree.
19749 The following is an example of a search for =waiting= without the
19752 #+begin_src emacs-lisp
19753 (org-add-agenda-custom-command
19754 '("b" todo "PROJECT"
19755 ((org-agenda-skip-function '(org-agenda-skip-subtree-if
19756 'regexp ":waiting:"))
19757 (org-agenda-overriding-header "Projects waiting for something: "))))
19760 ** Speeding up your agendas
19762 :DESCRIPTION: Tips on how to speed up your agendas.
19764 #+cindex: agenda views, optimization
19766 Some agenda commands slow down when the Org files grow in size or
19767 number. Here are tips to speed up:
19769 - Reduce the number of Org agenda files to avoid slowdowns due to hard drive
19772 - Reduce the number of DONE and archived headlines so agenda
19773 operations that skip over these can finish faster.
19775 - Do not dim blocked tasks:
19776 #+vindex: org-agenda-dim-blocked-tasks
19778 #+begin_src emacs-lisp
19779 (setq org-agenda-dim-blocked-tasks nil)
19782 - Stop preparing agenda buffers on startup:
19783 #+vindex: org-startup-folded
19784 #+vindex: org-agenda-inhibit-startup
19786 #+begin_src emacs-lisp
19787 (setq org-agenda-inhibit-startup nil)
19790 - Disable tag inheritance for agendas:
19791 #+vindex: org-agenda-show-inherited-tags
19792 #+vindex: org-agenda-use-tag-inheritance
19794 #+begin_src emacs-lisp
19795 (setq org-agenda-use-tag-inheritance nil)
19798 These options can be applied to selected agenda views. For more
19799 details about generation of agenda views, see the docstrings for the
19800 relevant variables, and this [[http://orgmode.org/worg/agenda-optimization.html][dedicated Worg page]] for agenda
19803 ** Extracting agenda information
19805 :DESCRIPTION: Post-processing agenda information.
19807 #+cindex: agenda, pipe
19808 #+cindex: scripts, for agenda processing
19810 Org provides commands to access agendas through Emacs batch mode.
19811 Through this command-line interface, agendas are automated for further
19812 processing or printing.
19814 #+vindex: org-agenda-custom-commands
19815 #+findex: org-batch-agenda
19816 ~org-batch-agenda~ creates an agenda view in ASCII and outputs to
19817 standard output. This command takes one string parameter. When
19818 string consists of a single character, Org uses it as a key to
19819 ~org-agenda-custom-commands~. These are the same ones available
19820 through {{{kbd(C-c a)}}}.
19822 This example command line directly prints the TODO list to the printer:
19824 : emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr
19826 When the string parameter length is two or more characters, Org
19827 matches it with tags/TODO strings. For example, this example command
19828 line prints items tagged with =shop=, but excludes items tagged with
19832 emacs -batch -l ~/.emacs \
19833 -eval '(org-batch-agenda "+shop-NewYork")' | lpr
19836 #+texinfo: @noindent
19837 An example showing on-the-fly parameter modifications:
19840 emacs -batch -l ~/.emacs \
19841 -eval '(org-batch-agenda "a" \
19842 org-agenda-span (quote month) \
19843 org-agenda-include-diary nil \
19844 org-agenda-files (quote ("~/org/project.org")))' \
19848 #+texinfo: @noindent
19849 which produces an agenda for the next 30 days from just the
19850 =~/org/projects.org= file.
19852 #+findex: org-batch-agenda-csv
19853 For structured processing of agenda output, use ~org-batch-agenda-csv~
19854 with the following fields:
19856 - category :: The category of the item
19857 - head :: The headline, without TODO keyword, TAGS and PRIORITY
19858 - type :: The type of the agenda entry, can be
19860 | ~todo~ | selected in TODO match |
19861 | ~tagsmatch~ | selected in tags match |
19862 | ~diary~ | imported from diary |
19863 | ~deadline~ | a deadline |
19864 | ~scheduled~ | scheduled |
19865 | ~timestamp~ | appointment, selected by timestamp |
19866 | ~closed~ | entry was closed on date |
19867 | ~upcoming-deadline~ | warning about nearing deadline |
19868 | ~past-scheduled~ | forwarded scheduled item |
19869 | ~block~ | entry has date block including date |
19871 - todo :: The TODO keyword, if any
19872 - tags :: All tags including inherited ones, separated by colons
19873 - date :: The relevant date, like =2007-2-14=
19874 - time :: The time, like =15:00-16:50=
19875 - extra :: String with extra planning info
19876 - priority-l :: The priority letter if any was given
19877 - priority-n :: The computed numerical priority
19879 #+texinfo: @noindent
19880 If the selection of the agenda item was based on a timestamp,
19881 including those items with =DEADLINE= and =SCHEDULED= keywords, then
19882 Org includes date and time in the output.
19884 If the selection of the agenda item was based on a timestamp (or
19885 deadline/scheduled), then Org includes date and time in the output.
19887 Here is an example of a post-processing script in Perl. It takes the
19888 CSV output from Emacs and prints with a checkbox:
19893 # define the Emacs command to run
19894 $cmd = "emacs -batch -l ~/.emacs -eval '(org-batch-agenda-csv \"t\")'";
19896 # run it and capture the output
19897 $agenda = qx{$cmd 2>/dev/null};
19899 # loop over all lines
19900 foreach $line (split(/\n/,$agenda)) {
19901 # get the individual values
19902 ($category,$head,$type,$todo,$tags,$date,$time,$extra,
19903 $priority_l,$priority_n) = split(/,/,$line);
19904 # process and print
19905 print "[ ] $head\n";
19909 ** Using the property API
19911 :DESCRIPTION: Writing programs that use entry properties.
19913 #+cindex: API, for properties
19914 #+cindex: properties, API
19916 Here is a description of the functions that can be used to work with
19919 #+attr_texinfo: :options org-entry-properties &optional pom which
19921 Get all properties of the entry at point-or-marker {{{var(POM)}}}.
19922 This includes the TODO keyword, the tags, time strings for deadline,
19923 scheduled, and clocking, and any additional properties defined in the
19924 entry. The return value is an alist. Keys may occur multiple times
19925 if the property key was used several times. {{{var(POM)}}} may also
19926 be ~nil~, in which case the current entry is used. If
19927 {{{var(WHICH)}}} is ~nil~ or ~all~, get all properties. If
19928 {{{var(WHICH)}}} is ~special~ or ~standard~, only get that subclass.
19931 #+vindex: org-use-property-inheritance
19932 #+findex: org-insert-property-drawer
19933 #+attr_texinfo: :options org-entry-get pom property &optional inherit
19935 Get value of {{{var(PROPERTY)}}} for entry at point-or-marker
19936 {{{var(POM)}}}. By default, this only looks at properties defined
19937 locally in the entry. If {{{var(INHERIT)}}} is non-~nil~ and the
19938 entry does not have the property, then also check higher levels of the
19939 hierarchy. If {{{var(INHERIT)}}} is the symbol ~selective~, use
19940 inheritance if and only if the setting of
19941 ~org-use-property-inheritance~ selects {{{var(PROPERTY)}}} for
19945 #+attr_texinfo: :options org-entry-delete pom property
19947 Delete the property {{{var(PROPERTY)}}} from entry at point-or-marker
19951 #+attr_texinfo: :options org-entry-put pom property value
19953 Set {{{var(PROPERTY)}}} to {{{var(VALUES)}}} for entry at
19954 point-or-marker POM.
19957 #+attr_texinfo: :options org-buffer-property-keys &optional include-specials
19959 Get all property keys in the current buffer.
19962 #+attr_texinfo: :options org-insert-property-drawer
19964 Insert a property drawer for the current entry. Also
19967 #+attr_texinfo: :options org-entry-put-multivalued-property pom property &rest values
19969 Set {{{var(PROPERTY)}}} at point-or-marker {{{var(POM)}}} to
19970 {{{var(VALUES)}}}. {{{var(VALUES)}}} should be a list of strings.
19971 They are concatenated, with spaces as separators.
19974 #+attr_texinfo: :options org-entry-get-multivalued-property pom property
19976 Treat the value of the property {{{var(PROPERTY)}}} as
19977 a whitespace-separated list of values and return the values as a list
19981 #+attr_texinfo: :options org-entry-add-to-multivalued-property pom property value
19983 Treat the value of the property {{{var(PROPERTY)}}} as
19984 a whitespace-separated list of values and make sure that
19985 {{{var(VALUE)}}} is in this list.
19988 #+attr_texinfo: :options org-entry-remove-from-multivalued-property pom property value
19990 Treat the value of the property {{{var(PROPERTY)}}} as
19991 a whitespace-separated list of values and make sure that
19992 {{{var(VALUE)}}} is /not/ in this list.
19995 #+attr_texinfo: :options org-entry-member-in-multivalued-property pom property value
19997 Treat the value of the property {{{var(PROPERTY)}}} as
19998 a whitespace-separated list of values and check if {{{var(VALUE)}}} is
20002 #+attr_texinfo: :options org-property-allowed-value-functions
20004 Hook for functions supplying allowed values for a specific property.
20005 The functions must take a single argument, the name of the property,
20006 and return a flat list of allowed values. If =:ETC= is one of the
20007 values, use the values as completion help, but allow also other values
20008 to be entered. The functions must return ~nil~ if they are not
20009 responsible for this property.
20012 ** Using the mapping API
20014 :DESCRIPTION: Mapping over all or selected entries.
20016 #+cindex: API, for mapping
20017 #+cindex: mapping entries, API
20019 Org has sophisticated mapping capabilities to find all entries
20020 satisfying certain criteria. Internally, this functionality is used
20021 to produce agenda views, but there is also an API that can be used to
20022 execute arbitrary functions for each or selected entries. The main
20023 entry point for this API is:
20025 #+attr_texinfo: :options org-map-entries func &optional match scope &rest skip
20027 Call {{{(var(FUNC))}}} at each headline selected by {{{var(MATCH)}}}
20028 in {{{var(SCOPE)}}}.
20030 {{{var(FUNC)}}} is a function or a Lisp form. With the cursor
20031 positioned at the beginning of the headline, call the function without
20032 arguments. Org returns an alist of return values of calls to the
20035 To avoid preserving point, Org wraps the call to {{{var(FUNC)}}} in
20036 save-excursion form. After evaluation, Org moves the cursor to the
20037 end of the line that was just processed. Search continues from that
20038 point forward. This may not always work as expected under some
20039 conditions, such as if the current sub-tree was removed by a previous
20040 archiving operation. In such rare circumstances, Org skips the next
20041 entry entirely when it should not. To stop Org from such skips, make
20042 {{{var(FUNC)}}} set the variable ~org-map-continue-from~ to a specific
20045 {{{var(MATCH)}}} is a tags/property/TODO match. Org iterates only
20046 matched headlines. Org iterates over all headlines when
20047 {{{var(MATCH)}}} is ~nil~ or ~t~.
20049 {{{var(SCOPE)}}} determines the scope of this command. It can be any
20054 The current buffer, respecting the restriction, if any.
20058 The subtree started with the entry at point.
20062 The entries within the active region, if any.
20066 The current buffer, without restriction.
20068 - ~file-with-archives~ ::
20070 The current buffer, and any archives associated with it.
20076 - ~agenda-with-archives~ ::
20078 All agenda files with any archive files associated with them.
20080 - ~(file1 file2 ...)~ ::
20082 If this is a list, all files in the list are scanned.
20084 #+texinfo: @noindent
20085 The remaining arguments are treated as settings for the scanner's
20086 skipping facilities. Valid arguments are:
20090 Skip trees with the archive tag.
20094 Skip trees with the COMMENT keyword.
20096 - function or Lisp form ::
20098 #+vindex: org-agenda-skip-function
20099 Used as value for ~org-agenda-skip-function~, so whenever the
20100 function returns ~t~, {{{var(FUNC)}}} is called for that entry
20101 and search continues from the point where the function leaves it.
20104 The mapping routine can call any arbitrary function, even functions
20105 that change meta data or query the property API (see [[*Using the
20106 property API]]). Here are some handy functions:
20108 #+attr_texinfo: :options org-todo &optional arg
20110 Change the TODO state of the entry. See the docstring of the
20111 functions for the many possible values for the argument
20115 #+attr_texinfo: :options org-priority &optional action
20117 Change the priority of the entry. See the docstring of this function
20118 for the possible values for {{{var(ACTION)}}}.
20121 #+attr_texinfo: :options org-toggle-tag tag &optional onoff
20123 Toggle the tag {{{var(TAG)}}} in the current entry. Setting
20124 {{{var(ONOFF)}}} to either ~on~ or ~off~ does not toggle tag, but
20125 ensure that it is either on or off.
20128 #+attr_texinfo: :options org-promote
20130 Promote the current entry.
20133 #+attr_texinfo: :options org-demote
20135 Demote the current entry.
20138 This example turns all entries tagged with =TOMORROW= into TODO
20139 entries with keyword =UPCOMING=. Org ignores entries in comment trees
20142 #+begin_src emacs-lisp
20143 (org-map-entries '(org-todo "UPCOMING")
20144 "+TOMORROW" 'file 'archive 'comment)
20147 The following example counts the number of entries with TODO keyword
20148 =WAITING=, in all agenda files.
20150 #+begin_src emacs-lisp
20151 (length (org-map-entries t "/+WAITING" 'agenda))
20156 :DESCRIPTION: Viewing and capture on a mobile device.
20157 :APPENDIX: Appendix
20160 #+cindex: smartphone
20162 #+cindex: MobileOrg
20164 MobileOrg is a companion mobile app that runs on iOS and Android
20165 devices. MobileOrg enables offline-views and capture support for an
20166 Org mode system that is rooted on a "real" computer. MobileOrg can
20167 record changes to existing entries.
20169 The [[https://github.com/MobileOrg/][iOS implementation]] for the /iPhone/iPod Touch/iPad/ series of
20170 devices, was started by Richard Moreland and is now in the hands of
20171 Sean Escriva. Android users should check out [[http://wiki.github.com/matburt/mobileorg-android/][MobileOrg Android]] by
20172 Matt Jones. Though the two implementations are not identical, they
20173 offer similar features.
20175 This appendix describes Org's support for agenda view formats
20176 compatible with MobileOrg. It also describes synchronizing changes,
20177 such as to notes, between MobileOrg and the computer.
20179 To change tags and TODO states in MobileOrg, first customize the
20180 variables ~org-todo-keywords~ and ~org-tag-alist~. These should cover
20181 all the important tags and TODO keywords, even if Org files use only
20182 some of them. Though MobileOrg has in-buffer settings, it understands
20183 TODO states /sets/ (see [[*Setting up keywords for individual files]]) and
20184 /mutually exclusive/ tags (see [[*Setting tags]]) only for those set in
20187 ** Setting up the staging area
20189 :DESCRIPTION: For the mobile device.
20192 MobileOrg needs access to a file directory on a server to interact
20193 with Emacs. With a public server, consider encrypting the files.
20194 MobileOrg version 1.5 supports encryption for the iPhone. Org also
20195 requires =openssl= installed on the local computer. To turn on
20196 encryption, set the same password in MobileOrg and in Emacs. Set the
20197 password in the variable ~org-mobile-use-encryption~[fn:143]. Note
20198 that even after MobileOrg encrypts the file contents, the file name
20199 remains visible on the file systems of the local computer, the server,
20200 and the mobile device.
20202 For a server to host files, consider options like [[http://dropbox.com][Dropbox.com]]
20203 account[fn:144]. On first connection, MobileOrg creates a directory
20204 =MobileOrg= on Dropbox. Pass its location to Emacs through an
20205 initialisation file variable as follows:
20207 #+begin_src emacs-lisp
20208 (setq org-mobile-directory "~/Dropbox/MobileOrg")
20211 Org copies files to the above directory for MobileOrg. Org also uses
20212 the same directory for sharing notes between Org and MobileOrg.
20214 ** Pushing to MobileOrg
20216 :DESCRIPTION: Uploading Org files and agendas.
20219 #+vindex: org-mobile-files
20220 #+vindex: org-directory
20221 Org pushes files listed in ~org-mobile-files~ to
20222 ~org-mobile-directory~. Files include agenda files (as listed in
20223 ~org-agenda-files~). Customize ~org-mobile-files~ to add other files.
20224 File names are staged with paths relative to ~org-directory~, so all
20225 files should be inside this directory[fn:145].
20227 Push creates a special Org file =agendas.org= with custom agenda views
20228 defined by the user[fn:146].
20230 Finally, Org writes the file =index.org=, containing links to other
20231 files. MobileOrg reads this file first from the server to determine
20232 what other files to download for agendas. For faster downloads,
20233 MobileOrg only reads files whose checksums[fn:147] have changed.
20235 ** Pulling from MobileOrg
20237 :DESCRIPTION: Integrating captured and flagged items.
20240 When MobileOrg synchronizes with the server, it pulls the Org files
20241 for viewing. It then appends to the file =mobileorg.org= on the
20242 server the captured entries, pointers to flagged and changed entries.
20243 Org integrates its data in an inbox file format.
20246 #+vindex: org-mobile-inbox-for-pull
20247 Org moves all entries found in =mobileorg.org=[fn:148] and appends
20248 them to the file pointed to by the variable
20249 ~org-mobile-inbox-for-pull~. Each captured entry and each editing
20250 event is a top-level entry in the inbox file.
20252 2. After moving the entries, Org attempts changes to MobileOrg. Some
20253 changes are applied directly and without user interaction.
20254 Examples include changes to tags, TODO state, headline and body
20255 text. Entries for further action are tagged as =FLAGGED=. Org
20256 marks entries with problems with an error message in the inbox.
20257 They have to be resolved manually.
20259 3. Org generates an agenda view for flagged entries for user
20260 intervention to clean up. For notes stored in flagged entries,
20261 MobileOrg displays them in the echo area when the cursor is on the
20262 corresponding agenda item.
20267 Pressing {{{kbd(?)}}} displays the entire flagged note in
20268 another window. Org also pushes it to the kill ring. To
20269 store flagged note as a normal note, use {{{kbd(? z C-y C-c
20270 C-c)}}}. Pressing{{{kbd(?)}}} twice does these things: first
20271 it removes the =FLAGGED= tag; second, it removes the flagged
20272 note from the property drawer; third, it signals that manual
20273 editing of the flagged entry is now finished.
20276 {{{kbd(C-c a ?)}}} returns to the agenda view to finish processing
20277 flagged entries. Note that these entries may not be the most recent
20278 since MobileOrg searches files that were last pulled. To get an
20279 updated agenda view with changes since the last pull, pull again.
20281 * History and acknowledgments
20283 :DESCRIPTION: How Org came into being.
20292 Org was born in 2003, out of frustration over the user interface of
20293 the Emacs Outline mode. I was trying to organize my notes and
20294 projects, and using Emacs seemed to be the natural way to go.
20295 However, having to remember eleven different commands with two or
20296 three keys per command, only to hide and show parts of the outline
20297 tree, that seemed entirely unacceptable to me. Also, when using
20298 outlines to take notes, I constantly wanted to restructure the tree,
20299 organizing it parallel to my thoughts and plans. /Visibility cycling/
20300 and /structure editing/ were originally implemented in the package
20301 =outline-magic.el=, but quickly moved to the more general =org.el=.
20302 As this environment became comfortable for project planning, the next
20303 step was adding /TODO entries/, basic /timestamps/, and /table
20304 support/. These areas highlighted the two main goals that Org still
20305 has today: to be a new, outline-based, plain text mode with innovative
20306 and intuitive editing features, and to incorporate project planning
20307 functionality directly into a notes file.
20309 Since the first release, literally thousands of emails to me or to the
20310 [[mailto:emacs-orgmode@gnu.org][mailing list]] have provided a constant stream of bug reports, feedback,
20311 new ideas, and sometimes patches and add-on code. Many thanks to
20312 everyone who has helped to improve this package. I am trying to keep
20313 here a list of the people who had significant influence in shaping one
20314 or more aspects of Org. The list may not be complete, if I have
20315 forgotten someone, please accept my apologies and let me know.
20317 Before I get to this list, a few special mentions are in order:
20319 - Bastien Guerry ::
20321 Bastien has written a large number of extensions to Org (most of
20322 them integrated into the core by now), including the LaTeX
20323 exporter and the plain list parser. His support during the early
20324 days was central to the success of this project. Bastien also
20325 invented Worg, helped establishing the Web presence of Org, and
20326 sponsored hosting costs for the orgmode.org website. Bastien
20327 stepped in as maintainer of Org between 2011 and 2013, at a time
20328 when I desperately needed a break.
20330 - Eric Schulte and Dan Davison ::
20332 Eric and Dan are jointly responsible for the Org-babel system,
20333 which turns Org into a multi-language environment for evaluating
20334 code and doing literate programming and reproducible research.
20335 This has become one of Org's killer features that define what Org
20340 John has contributed a number of great ideas and patches directly
20341 to Org, including the attachment system (=org-attach.el=),
20342 integration with Apple Mail (=org-mac-message.el=), hierarchical
20343 dependencies of TODO items, habit tracking (=org-habits.el=), and
20344 encryption (=org-crypt.el=). Also, the capture system is really
20345 an extended copy of his great =remember.el=.
20347 - Sebastian Rose ::
20349 Without Sebastian, the HTML/XHTML publishing of Org would be the
20350 pitiful work of an ignorant amateur. Sebastian has pushed this
20351 part of Org onto a much higher level. He also wrote
20352 =org-info.js=, a Java script for displaying webpages derived from
20353 Org using an Info-like or a folding interface with single-key
20356 #+texinfo: @noindent
20357 See below for the full list of contributions! Again, please let me
20358 know what I am missing here!
20365 I (Bastien) have been maintaining Org between 2011 and 2013. This
20366 appendix would not be complete without adding a few more
20367 acknowledgments and thanks.
20369 I am first grateful to Carsten for his trust while handing me over the
20370 maintainership of Org. His unremitting support is what really helped
20371 me getting more confident over time, with both the community and the
20374 When I took over maintainership, I knew I would have to make Org more
20375 collaborative than ever, as I would have to rely on people that are
20376 more knowledgeable than I am on many parts of the code. Here is
20377 a list of the persons I could rely on, they should really be
20378 considered co-maintainers, either of the code or the community:
20382 Eric is maintaining the Babel parts of Org. His reactivity here
20383 kept me away from worrying about possible bugs here and let me
20384 focus on other parts.
20386 - Nicolas Goaziou ::
20388 Nicolas is maintaining the consistency of the deepest parts of
20389 Org. His work on =org-element.el= and =ox.el= has been
20390 outstanding, and it opened the doors for many new ideas and
20391 features. He rewrote many of the old exporters to use the new
20392 export engine, and helped with documenting this major change.
20393 More importantly (if that's possible), he has been more than
20394 reliable during all the work done for Org 8.0, and always very
20395 reactive on the mailing list.
20399 Achim rewrote the building process of Org, turning some /ad hoc/
20400 tools into a flexible and conceptually clean process. He
20401 patiently coped with the many hiccups that such a change can
20406 The Org mode mailing list would not be such a nice place without
20407 Nick, who patiently helped users so many times. It is impossible
20408 to overestimate such a great help, and the list would not be so
20409 active without him.
20411 I received support from so many users that it is clearly impossible to
20412 be fair when shortlisting a few of them, but Org's history would not
20413 be complete if the ones above were not mentioned in this manual.
20415 ** List of contributions
20420 - Russel Adams came up with the idea for drawers.
20422 - Thomas Baumann wrote =org-bbdb.el= and =org-mhe.el=.
20424 - Christophe Bataillon created the great unicorn logo that we use on
20425 the Org mode website.
20427 - Alex Bochannek provided a patch for rounding timestamps.
20429 - Jan Böcker wrote =org-docview.el=.
20431 - Brad Bozarth showed how to pull RSS feed data into Org files.
20433 - Tom Breton wrote =org-choose.el=.
20435 - Charles Cave's suggestion sparked the implementation of templates
20436 for Remember, which are now templates for capture.
20438 - Pavel Chalmoviansky influenced the agenda treatment of items with
20441 - Gregory Chernov patched support for Lisp forms into table
20442 calculations and improved XEmacs compatibility, in particular by
20443 porting =nouline.el= to XEmacs.
20445 - Sacha Chua suggested copying some linking code from Planner.
20447 - Baoqiu Cui contributed the DocBook exporter.
20449 - Eddward DeVilla proposed and tested checkbox statistics. He also
20450 came up with the idea of properties, and that there should be an API
20453 - Nick Dokos tracked down several nasty bugs.
20455 - Kees Dullemond used to edit projects lists directly in HTML and so
20456 inspired some of the early development, including HTML export. He
20457 also asked for a way to narrow wide table columns.
20459 - Thomas S. Dye contributed documentation on Worg and helped
20460 integrating the Org Babel documentation into the manual.
20462 - Christian Egli converted the documentation into Texinfo format,
20463 inspired the agenda, patched CSS formatting into the HTML exporter,
20464 and wrote =org-taskjuggler.el=.
20466 - David Emery provided a patch for custom CSS support in exported HTML
20469 - Nic Ferrier contributed mailcap and XOXO support.
20471 - Miguel A. Figueroa-Villanueva implemented hierarchical checkboxes.
20473 - John Foerch figured out how to make incremental search show context
20474 around a match in a hidden outline tree.
20476 - Raimar Finken wrote =org-git-line.el=.
20478 - Mikael Fornius works as a mailing list moderator.
20480 - Austin Frank works as a mailing list moderator.
20482 - Eric Fraga drove the development of Beamer export with ideas and
20485 - Barry Gidden did proofreading the manual in preparation for the book
20486 publication through Network Theory Ltd.
20488 - Niels Giesen had the idea to automatically archive DONE trees.
20490 - Nicolas Goaziou rewrote much of the plain list code.
20492 - Kai Grossjohann pointed out key-binding conflicts with other
20495 - Brian Gough of Network Theory Ltd publishes the Org mode manual as
20498 - Bernt Hansen has driven much of the support for auto-repeating
20499 tasks, task state change logging, and the clocktable. His clear
20500 explanations have been critical when we started to adopt the Git
20501 version control system.
20503 - Manuel Hermenegildo has contributed various ideas, small fixes and
20506 - Phil Jackson wrote =org-irc.el=.
20508 - Scott Jaderholm proposed footnotes, control over whitespace between
20509 folded entries, and column view for properties.
20511 - Matt Jones wrote MobileOrg Android.
20513 - Tokuya Kameshima wrote =org-wl.el= and =org-mew.el=.
20515 - Shidai Liu ("Leo") asked for embedded LaTeX and tested it. He also
20516 provided frequent feedback and some patches.
20518 - Matt Lundin has proposed last-row references for table formulas and
20519 named invisible anchors. He has also worked a lot on the FAQ.
20521 - David Maus wrote =org-atom.el=, maintains the issues file for Org,
20522 and is a prolific contributor on the mailing list with competent
20523 replies, small fixes and patches.
20525 - Jason F. McBrayer suggested agenda export to CSV format.
20527 - Max Mikhanosha came up with the idea of refiling.
20529 - Dmitri Minaev sent a patch to set priority limits on a per-file
20532 - Stefan Monnier provided a patch to keep the Emacs Lisp compiler
20535 - Richard Moreland wrote MobileOrg for the iPhone.
20537 - Rick Moynihan proposed allowing multiple TODO sequences in a file
20538 and being able to quickly restrict the agenda to a subtree.
20540 - Todd Neal provided patches for links to Info files and Elisp forms.
20542 - Greg Newman refreshed the unicorn logo into its current form.
20544 - Tim O'Callaghan suggested in-file links, search options for general
20545 file links, and tags.
20547 - Osamu Okano wrote =orgcard2ref.pl=, a Perl program to create a text
20548 version of the reference card.
20550 - Takeshi Okano translated the manual and David O'Toole's tutorial
20553 - Oliver Oppitz suggested multi-state TODO items.
20555 - Scott Otterson sparked the introduction of descriptive text for
20556 links, among other things.
20558 - Pete Phillips helped during the development of the TAGS feature,
20559 and provided frequent feedback.
20561 - Martin Pohlack provided the code snippet to bundle character
20562 insertion into bundles of 20 for undo.
20564 - T.V. Raman reported bugs and suggested improvements.
20566 - Matthias Rempe (Oelde) provided ideas, Windows support, and quality
20569 - Paul Rivier provided the basic implementation of named footnotes.
20570 He also acted as mailing list moderator for some time.
20572 - Kevin Rogers contributed code to access VM files on remote hosts.
20574 - Frank Ruell solved the mystery of the =keymapp nil= bug, a conflict
20577 - Jason Riedy generalized the send-receive mechanism for Orgtbl
20578 tables with extensive patches.
20580 - Philip Rooke created the Org reference card, provided lots of
20581 feedback, developed and applied standards to the Org documentation.
20583 - Christian Schlauer proposed angular brackets around links, among
20586 - Paul Sexton wrote =org-ctags.el=.
20588 - Tom Shannon's =organizer-mode.el= inspired linking to VM/BBDB/Gnus.
20590 - Ilya Shlyakhter proposed the Archive Sibling, line numbering in
20591 literal examples, and remote highlighting for referenced code lines.
20593 - Stathis Sideris wrote the =ditaa.jar= ASCII to PNG converter that is
20594 now packaged into Org's =contrib/= directory.
20596 - Daniel Sinder came up with the idea of internal archiving by locking
20599 - Dale Smith proposed link abbreviations.
20601 - James TD Smith has contributed a large number of patches for
20602 useful tweaks and features.
20604 - Adam Spiers asked for global linking commands, inspired the link
20605 extension system, added support for Mairix, and proposed the mapping
20608 - Ulf Stegemann created the table to translate special symbols to
20609 HTML, LaTeX, UTF-8, Latin-1 and ASCII.
20611 - Andy Stewart contributed code to =org-w3m.el=, to copy
20612 HTML content with links transformation to Org syntax.
20614 - David O'Toole wrote =org-publish.el= and drafted the
20615 manual chapter about publishing.
20617 - Jambunathan K. contributed the ODT exporter.
20619 - Sebastien Vauban reported many issues with LaTeX and Beamer export
20620 and enabled source code highlighting in Gnus.
20622 - Stefan Vollmar organized a video-recorded talk at the
20623 Max-Planck-Institute for Neurology. He also inspired the creation
20624 of a concept index for HTML export.
20626 - Jürgen Vollmer contributed code generating the table of contents in
20629 - Samuel Wales has provided important feedback and bug reports.
20631 - Chris Wallace provided a patch implementing the =QUOTE= block.
20633 - David Wainberg suggested archiving, and improvements to the
20636 - Carsten Wimmer suggested some changes and helped fix a bug in
20639 - Roland Winkler requested additional key bindings to make Org work on
20642 - Piotr Zielinski wrote =org-mouse.el=, proposed agenda
20643 blocks and contributed various ideas and code snippets.
20645 * GNU Free Documentation License
20648 :DESCRIPTION: The license for this documentation.
20651 #+TEXINFO: @include ../doc/doclicense.texi
20655 :ALT_TITLE: Main Index
20657 :DESCRIPTION: An index of Org's concepts and features.
20662 :DESCRIPTION: Key bindings and where they are described.
20663 :ALT_TITLE: Key Index
20667 * Command and function index
20669 :DESCRIPTION: Command names and some internal functions.
20670 :ALT_TITLE: Command and Function Index
20676 :DESCRIPTION: Variables mentioned in the manual.
20677 :ALT_TITLE: Variable Index
20681 This is not a complete index of variables and faces, only the ones
20682 that are mentioned in the manual. For a more complete list, use
20683 {{{kbd(M-x org-customize)}}} and then click yourself through the tree.
20690 This manual is for Org version {{{version}}}.
20692 Copyright \copy 2004--2017 Free Software Foundation, Inc.
20695 Permission is granted to copy, distribute and/or modify this document
20696 under the terms of the GNU Free Documentation License, Version 1.3 or
20697 any later version published by the Free Software Foundation; with no
20698 Invariant Sections, with the Front-Cover texts being "A GNU Manual",
20699 and with the Back-Cover Texts as in (a) below. A copy of the license
20700 is included in the section entitled "GNU Free Documentation License".
20702 (a) The FSF's Back-Cover Text is: "You have the freedom to copy and
20703 modify this GNU manual."
20706 * Export setup :noexport:
20708 #+subtitle: Release {{{version}}}
20709 #+author: by Carsten Dominik
20710 #+subauthor: with contributions by Bastien Guerry, Nicolas Goaziou, Eric Schulte, Jambunathan K, Dan Davison, Thomas Dye, David O'Toole, and Philip Rooke.
20711 #+date: {{{modification-time}}}
20712 #+email: tsd@tsdye.com
20715 # XXX: We cannot use TODO keyword as a node starts with "TODO".
20716 #+todo: REVIEW FIXME | DONE
20717 #+property: header-args :eval no
20718 #+startup: overview nologdone
20720 #+texinfo_dir_category: Emacs editing modes
20721 #+texinfo_dir_title: Org Mode: (org)
20722 #+texinfo_dir_desc: Outline-based notes management and organizer
20724 # Use proper quote and backtick for code sections in PDF output
20725 # Cf. Texinfo manual 14.2
20726 #+texinfo_header: @set txicodequoteundirected
20727 #+texinfo_header: @set txicodequotebacktick
20730 #+texinfo_header: @set MAINTAINERSITE @uref{http://orgmode.org,maintainers webpage}
20731 #+texinfo_header: @set MAINTAINER Carsten Dominik
20732 #+texinfo_header: @set MAINTAINEREMAIL @email{carsten at orgmode dot org}
20733 #+texinfo_header: @set MAINTAINERCONTACT @uref{mailto:carsten at orgmode dot org,contact the maintainer}
20735 #+options: H:4 num:t toc:t author:t \n:nil ::t |:t ^:nil -:t f:t *:t <:t e:t ':t
20736 #+options: d:nil todo:nil pri:nil tags:not-in-toc stat:nil broken-links:mark
20737 #+select_tags: export
20738 #+exclude_tags: noexport
20740 #+macro: cite @@texinfo:@cite{@@$1@@texinfo:}@@
20741 #+macro: var @@texinfo:@var{@@$1@@texinfo:}@@
20743 # The "version" macro returns major.minor version number. This is
20744 # sufficient since bugfix releases are not expected to add features
20745 # and therefore imply manual modifications.
20746 #+macro: version (eval (mapconcat #'identity (cl-subseq (split-string (org-version) "\\.") 0 -1) "."))
20748 # The "kbd" macro turns KBD into @kbd{KBD}. Additionnally, it
20749 # encloses case-sensitive special keys (SPC, RET...) within @key{...}.
20750 #+macro: kbd (eval (let ((case-fold-search nil) (regexp (regexp-opt '("SPC" "RET" "LFD" "TAB" "BS" "ESC" "DELETE" "SHIFT" "CTRL" "META" "up" "left" "right" "down") 'words))) (format "@@texinfo:@kbd{@@%s@@texinfo:}@@" (replace-regexp-in-string regexp "@@texinfo:@key{@@\\&@@texinfo:}@@" $1 t))))
20754 [fn:1] If you do not use Font Lock globally turn it on in Org buffer
20755 with ~(add-hook 'org-mode-hook 'turn-on-font-lock)~.
20757 [fn:2] Please consider subscribing to the mailing list in order to
20758 minimize the work the mailing list moderators have to do.
20760 [fn:3] See the variables ~org-special-ctrl-a/e~, ~org-special-ctrl-k~,
20761 and ~org-ctrl-k-protect-subtree~ to configure special behavior of
20762 {{{kbd(C-a)}}}, {{{kbd(C-e)}}}, and {{{kbd(C-k)}}} in headlines. Note
20763 also that clocking only works with headings indented less than 30
20766 [fn:4] See, however, the option ~org-cycle-emulate-tab~.
20768 [fn:5] The indirect buffer contains the entire buffer, but is narrowed
20769 to the current tree. Editing the indirect buffer also changes the
20770 original buffer, but without affecting visibility in that buffer. For
20771 more information about indirect buffers, see [[info:emacs:Indirect%20Buffers][GNU Emacs Manual]].
20773 [fn:6] When ~org-agenda-inhibit-startup~ is non-~nil~, Org does not
20774 honor the default visibility state when first opening a file for the
20775 agenda (see [[*Speeding up your agendas]]).
20777 [fn:7] See also the variable ~org-show-context-detail~ to decide how
20778 much context is shown around each match.
20780 [fn:8] This depends on the option ~org-remove-highlights-with-change~.
20782 [fn:9] When using =*= as a bullet, lines must be indented so that they
20783 are not interpreted as headlines. Also, when you are hiding leading
20784 stars to get a clean outline view, plain list items starting with
20785 a star may be hard to distinguish from true headlines. In short: even
20786 though =*= is supported, it may be better to not use it for plain list
20789 [fn:10] You can filter out any of them by configuring
20790 ~org-plain-list-ordered-item-terminator~.
20792 [fn:11] You can also get =a.=, =A.=, =a)= and =A)= by configuring
20793 ~org-list-allow-alphabetical~. To minimize confusion with normal
20794 text, those are limited to one character only. Beyond that limit,
20795 bullets automatically fallback to numbers.
20797 [fn:12] If there's a checkbox in the item, the cookie must be put
20798 /before/ the checkbox. If you have activated alphabetical lists, you
20799 can also use counters like =[@b]=.
20801 [fn:13] If you do not want the item to be split, customize the
20802 variable ~org-M-RET-may-split-line~.
20804 [fn:14] If you want to cycle around items that way, you may customize
20805 ~org-list-use-circular-motion~.
20807 [fn:15] See ~org-list-use-circular-motion~ for a cyclic behavior.
20809 [fn:16] Many desktops intercept {{{kbd(M-TAB)}}} to switch windows.
20810 Use {{{kbd(C-M-i)}}} or {{{kbd(ESC TAB)}}} instead.
20812 [fn:17] The corresponding in-buffer setting is: =#+STARTUP: fninline=
20813 or =#+STARTUP: nofninline=.
20815 [fn:18] The corresponding in-buffer options are =#+STARTUP: fnadjust=
20816 and =#+STARTUP: nofnadjust=.
20818 [fn:19] To insert a vertical bar into a table field, use =\vert= or,
20819 inside a word =abc\vert{}def=.
20821 [fn:20] Org understands references typed by the user as =B4=, but it
20822 does not use this syntax when offering a formula for editing. You can
20823 customize this behavior using the variable
20824 ~org-table-use-standard-references~.
20826 [fn:21] The computation time scales as O(N^2) because table
20827 {{{var(FOO)}}} is parsed for each field to be copied.
20829 [fn:22] The file =constants.el= can supply the values of constants in
20830 two different unit systems, =SI= and =cgs=. Which one is used depends
20831 on the value of the variable ~constants-unit-system~. You can use the
20832 =STARTUP= options =constSI= and =constcgs= to set this value for the
20835 [fn:23] The printf reformatting is limited in precision because the
20836 value passed to it is converted into an "integer" or "double". The
20837 "integer" is limited in size by truncating the signed value to 32
20838 bits. The "double" is limited in precision to 64 bits overall which
20839 leaves approximately 16 significant decimal digits.
20841 [fn:24] Such names must start with an alphabetic character and use
20842 only alphanumeric/underscore characters.
20844 [fn:25] To insert a link targeting a headline, in-buffer completion
20845 can be used. Just type a star followed by a few optional letters into
20846 the buffer and press {{{kbd(M-TAB)}}}. All headlines in the current
20847 buffer are offered as completions.
20849 [fn:26] When targeting a =NAME= keyword, =CAPTION= keyword is
20850 mandatory in order to get proper numbering (see [[*Images and tables]]).
20852 [fn:27] The actual behavior of the search depends on the value of the
20853 variable ~org-link-search-must-match-exact-headline~. If its value is
20854 ~nil~, then a fuzzy text search is done. If it is ~t~, then only the
20855 exact headline is matched, ignoring spaces and statistic cookies. If
20856 the value is ~query-to-create~, then an exact headline is searched; if
20857 it is not found, then the user is queried to create it.
20859 [fn:28] If the headline contains a timestamp, it is removed from the
20860 link, which results in a wrong link -- you should avoid putting
20861 a timestamp in the headline.
20863 [fn:29] The Org Id library must first be loaded, either through
20864 ~org-customize~, by enabling ~id~ in ~org-modules~, or by adding
20865 ~(require 'org-id)~ in your Emacs init file.
20867 [fn:30] Note that you do not have to use this command to insert
20868 a link. Links in Org are plain text, and you can type or paste them
20869 straight into the buffer. By using this command, the links are
20870 automatically enclosed in double brackets, and you will be asked for
20871 the optional descriptive text.
20873 [fn:31] After insertion of a stored link, the link will be removed
20874 from the list of stored links. To keep it in the list later use, use
20875 a triple {{{kbd(C-u)}}} prefix argument to {{{kbd(C-c C-l)}}}, or
20876 configure the option ~org-keep-stored-link-after-insertion~.
20878 [fn:32] This works if a function has been defined in the ~:complete~
20879 property of a link in ~org-link-parameters~.
20881 [fn:33] See the variable ~org-display-internal-link-with-indirect-buffer~.
20883 [fn:34] The variable ~org-startup-with-inline-images~ can be set
20884 within a buffer with the =STARTUP= options =inlineimages= and
20887 [fn:35] For backward compatibility, line numbers can also follow a
20890 [fn:36] Of course, you can make a document that contains only long
20891 lists of TODO items, but this is not required.
20893 [fn:37] Changing the variable ~org-todo-keywords~ only becomes
20894 effective after restarting Org mode in a buffer.
20896 [fn:38] This is also true for the {{{kbd(t)}}} command in the timeline
20897 and agenda buffers.
20899 [fn:39] All characters are allowed except =@=, =^= and =!=, which have
20900 a special meaning here.
20902 [fn:40] Check also the variable ~org-fast-tag-selection-include-todo~,
20903 it allows you to change the TODO state through the tags interface
20904 ([[*Setting tags]]), in case you like to mingle the two concepts. Note
20905 that this means you need to come up with unique keys across both sets
20908 [fn:41] Org mode parses these lines only when Org mode is activated
20909 after visiting a file. {{{kbd(C-c C-c)}}} with the cursor in a line
20910 starting with =#+= is simply restarting Org mode for the current
20913 [fn:42] The corresponding in-buffer setting is: =#+STARTUP: logdone=.
20915 [fn:43] The corresponding in-buffer setting is: =#+STARTUP:
20918 [fn:44] See the variable ~org-log-states-order-reversed~.
20920 [fn:45] Note that the =LOGBOOK= drawer is unfolded when pressing
20921 {{{kbd(SPC)}}} in the agenda to show an entry -- use {{{kbd(C-u
20922 SPC)}}} to keep it folded here.
20924 [fn:46] It is possible that Org mode records two timestamps when you
20925 are using both ~org-log-done~ and state change logging. However, it
20926 never prompts for two notes: if you have configured both, the state
20927 change recording note takes precedence and cancel the closing note.
20929 [fn:47] See also the option ~org-priority-start-cycle-with-default~.
20931 [fn:48] To keep subtasks out of the global TODO list, see the
20932 ~org-agenda-todo-list-sublevels~.
20934 [fn:49] With the exception of description lists. But you can allow it
20935 by modifying ~org-list-automatic-rules~ accordingly.
20937 [fn:50] Set the variable ~org-hierarchical-checkbox-statistics~ if you
20938 want such cookies to count all checkboxes below the cookie, not just
20939 those belonging to direct children.
20941 [fn:51] {{{kbd(C-u C-c C-c)}}} on the /first/ item of a list with no
20942 checkbox adds checkboxes to the rest of the list.
20944 [fn:52] As with all these in-buffer settings, pressing {{{kbd(C-c
20945 C-c)}}} activates any changes in the line.
20947 [fn:53] This is only true if the search does not involve more complex
20948 tests including properties (see [[*Property searches]]).
20950 [fn:54] Keys are automatically assigned to tags that have no
20953 [fn:55] If more than one summary type applies to the same property,
20954 the parent values are computed according to the first of them.
20956 [fn:56] An age is defined as a duration, using effort modifiers
20957 defined in ~org-effort-durations~, e.g., =3d 1h=. If any value in the
20958 column is as such, the summary is also an effort duration.
20960 [fn:57] Please note that the =COLUMNS= definition must be on a single
20961 line; it is wrapped here only because of formatting constraints.
20963 [fn:58] Contributed packages are not part of Emacs, but are
20964 distributed with the main distribution of Org -- visit
20965 [[http://orgmode.org]].
20967 [fn:59] The Org date format is inspired by the standard ISO 8601
20968 date/time format. To use an alternative format, see [[*Custom time
20969 format]]. The day name is optional when you type the date yourself.
20970 However, any date inserted or modified by Org adds that day name, for
20971 reading convenience.
20973 [fn:60] When working with the standard diary sexp functions, you need
20974 to be very careful with the order of the arguments. That order
20975 depends evilly on the variable ~calendar-date-style~. For example, to
20976 specify a date December 12, 2005, the call might look like
20977 =(diary-date 12 1 2005)= or =(diary-date 1 12 2005)= or =(diary-date
20978 2005 12 1)=, depending on the settings. This has been the source of
20979 much confusion. Org mode users can resort to special versions of
20980 these functions like ~org-date~ or ~org-anniversary~. These work just
20981 like the corresponding ~diary-~ functions, but with stable ISO order
20982 of arguments (year, month, day) wherever applicable, independent of
20983 the value of ~calendar-date-style~.
20985 [fn:61] See the variable ~org-read-date-prefer-future~. You may set
20986 that variable to the symbol ~time~ to even make a time before now
20987 shift the date to tomorrow.
20989 [fn:62] If you do not need/want the calendar, configure the variable
20990 ~org-popup-calendar-for-date-prompt~.
20992 [fn:63] If you find this distracting, turn off the display with
20993 ~org-read-date-display-live~.
20995 [fn:64] It will still be listed on that date after it has been marked
20996 DONE. If you do not like this, set the variable
20997 ~org-agenda-skip-scheduled-if-done~.
20999 [fn:65] The =SCHEDULED= and =DEADLINE= dates are inserted on the line
21000 right below the headline. Do not put any text between this line and
21003 [fn:66] Note the corresponding =STARTUP= options =logredeadline=,
21004 =lognoteredeadline=, and =nologredeadline=.
21006 [fn:67] Note the corresponding =STARTUP= options =logreschedule=,
21007 =lognotereschedule=, and =nologreschedule=.
21009 [fn:68] In fact, the target state is taken from, in this sequence, the
21010 =REPEAT_TO_STATE= property or the variable ~org-todo-repeat-to-state~.
21011 If neither of these is specified, the target state defaults to the
21012 first state of the TODO state sequence.
21014 [fn:69] You can change this using the option ~org-log-repeat~, or the
21015 =STARTUP= options =logrepeat=, =lognoterepeat=, and =nologrepeat=.
21016 With =lognoterepeat=, you will also be prompted for a note.
21018 [fn:70] Clocking only works if all headings are indented with less
21019 than 30 stars. This is a hard-coded limitation of ~lmax~ in
21022 [fn:71] To resume the clock under the assumption that you have worked
21023 on this task while outside Emacs, use ~(setq org-clock-persist t)~.
21025 [fn:72] To add an effort estimate "on the fly", hook a function doing
21026 this to ~org-clock-in-prepare-hook~.
21028 [fn:73] The last reset of the task is recorded by the =LAST_REPEAT=
21031 [fn:74] See also the variable ~org-clock-modeline-total~.
21033 [fn:75] The corresponding in-buffer setting is: =#+STARTUP:
21036 [fn:76] Language terms can be set through the variable
21037 ~org-clock-clocktable-language-setup~.
21039 [fn:77] Note that all parameters must be specified in a single line --
21040 the line is broken here only to fit it into the manual.
21042 [fn:78] On computers using Mac OS X, idleness is based on actual user
21043 idleness, not just Emacs' idle time. For X11, you can install
21044 a utility program =x11idle.c=, available in the =contrib/scripts/=
21045 directory of the Org Git distribution, or install the xprintidle
21046 package and set it to the variable ~org-clock-x11idle-program-name~ if
21047 you are running Debian, to get the same general treatment of idleness.
21048 On other systems, idle time refers to Emacs idle time only.
21050 [fn:79] Please note the pitfalls of summing hierarchical data in
21051 a flat list ([[*Using column view in the agenda]]).
21053 [fn:80] Please select your own key, {{{kbd(C-c c)}}} is only
21056 [fn:81] Org used to offer four different targets for date/week tree
21057 capture. Now, Org automatically translates these to use
21058 ~file+olp+datetree~, applying the ~:time-prompt~ and ~:tree-type~
21059 properties. Please rewrite your date/week-tree targets using
21060 ~file+olp+datetree~ since the older targets are now deprecated.
21062 [fn:82] A date tree is an outline structure with years on the highest
21063 level, months or ISO weeks as sublevels and then dates on the lowest
21064 level. Tags are allowed in the tree structure.
21066 [fn:83] If you need one of these sequences literally, escape the =%=
21069 [fn:84] If you define your own link types (see [[*Adding hyperlink
21070 types]]), any property you store with ~org-store-link-props~ can be
21071 accessed in capture templates in a similar way.
21073 [fn:85] This is always the other, not the user. See the variable
21074 ~org-from-is-user-regexp~.
21076 [fn:86] If you move entries or Org files from one directory to
21077 another, you may want to configure ~org-attach-directory~ to contain
21080 [fn:87] Note the corresponding =STARTUP= options =logrefile=,
21081 =lognoterefile=, and =nologrefile=.
21083 [fn:88] If the value of that variable is not a list, but a single file
21084 name, then the list of agenda files in maintained in that external
21087 [fn:89] When using the dispatcher, pressing {{{kbd(<)}}} before
21088 selecting a command actually limits the command to the current file,
21089 and ignores ~org-agenda-files~ until the next dispatcher command.
21091 [fn:90] For backward compatibility, you can also press {{{kbd(1)}}} to
21092 restrict to the current buffer.
21094 [fn:91] For backward compatibility, you can also press {{{kbd(0)}}} to
21095 restrict to the current region/subtree.
21097 [fn:92] For backward compatibility, the universal prefix
21098 {{{kbd(C-u)}}} causes all TODO entries to be listed before the agenda.
21099 This feature is deprecated, use the dedicated TODO list, or a block
21100 agenda instead (see [[*Block agenda]]).
21102 [fn:93] The variable ~org-anniversary~ used in the example is just
21103 like ~diary-anniversary~, but the argument order is always according
21104 to ISO and therefore independent of the value of
21105 ~calendar-date-style~.
21107 [fn:94] Custom commands can preset a filter by binding the variable
21108 ~org-agenda-tag-filter-preset~ as an option. This filter is then
21109 applied to the view and persists as a basic filter through refreshes
21110 and more secondary filtering. The filter is a global property of the
21111 entire agenda view -- in a block agenda, you should only set this in
21112 the global options section, not in the section of an individual block.
21114 [fn:95] Only tags filtering is respected here, effort filtering is
21117 [fn:96] You can also create persistent custom functions through
21118 ~org-agenda-bulk-custom-functions~.
21120 [fn:97] This file is parsed for the agenda when
21121 ~org-agenda-include-diary~ is set.
21123 [fn:98] You can provide a description for a prefix key by inserting
21124 a cons cell with the prefix and the description.
21126 [fn:99] /Planned/ means here that these entries have some planning
21127 information attached to them, like a time-stamp, a scheduled or
21128 a deadline string. See ~org-agenda-entry-types~ on how to set what
21129 planning information is taken into account.
21131 [fn:100] For HTML you need to install Hrvoje Niksic's =htmlize.el=
21132 from [[https://github.com/hniksic/emacs-htmlize][Hrvoje Niksic's repository]].
21134 [fn:101] To create PDF output, the Ghostscript ps2pdf utility must be
21135 installed on the system. Selecting a PDF file also creates the
21138 [fn:102] If you want to store standard views like the weekly agenda or
21139 the global TODO list as well, you need to define custom commands for
21140 them in order to be able to specify file names.
21142 [fn:103] Quoting depends on the system you use, please check the FAQ
21145 [fn:104] This works automatically for the HTML backend (it requires
21146 version 1.34 of the =htmlize.el= package, which you need to install).
21147 Fontified code chunks in LaTeX can be achieved using either the
21148 listings package or the [[https://github.com/gpoore/minted][minted]] package. Refer to
21149 ~org-export-latex-listings~ for details.
21151 [fn:105] Source code in code blocks may also be evaluated either
21152 interactively or on export. See [[*Working with source code]] for more
21153 information on evaluating code blocks.
21155 [fn:106] Adding =-k= to =-n -r= /keeps/ the labels in the source code
21156 while using line numbers for the links, which might be useful to
21157 explain those in an Org mode example code.
21159 [fn:107] Upon exit, lines starting with =*=, =,*=, =#+= and =,#+= get
21160 a comma prepended, to keep them from being interpreted by Org as
21161 outline nodes or special syntax. These commas are stripped when
21162 editing with {{{kbd(C-c ')}}}, and also before export.
21164 [fn:108] You may select a different-mode with the variable
21165 ~org-edit-fixed-width-region-mode~.
21167 [fn:109] You can turn this on by default by setting the variable
21168 ~org-pretty-entities~, or on a per-file base with the =STARTUP= option
21171 [fn:110] This behaviour can be disabled with =-= export setting (see
21172 [[*Export settings]]).
21174 [fn:111] LaTeX is a macro system based on Donald\nbsp{}E.\nbsp{}Knuth's TeX
21175 system. Many of the features described here as "LaTeX" are really
21176 from TeX, but for simplicity I am blurring this distinction.
21178 [fn:112] When MathJax is used, only the environments recognized by
21179 MathJax are processed. When dvipng, dvisvgm, or ImageMagick suite is
21180 used to create images, any LaTeX environment is handled.
21182 [fn:113] These are respectively available at
21183 [[http://sourceforge.net/projects/dvipng/]], [[http://dvisvgm.bplaced.net/]]
21184 and from the ImageMagick suite. Choose the converter by setting the
21185 variable ~org-preview-latex-default-process~ accordingly.
21187 [fn:114] Org mode has a method to test if the cursor is inside such
21188 a fragment, see the documentation of the function
21189 ~org-inside-LaTeX-fragment-p~.
21191 [fn:115] The variable ~org-export-date-timestamp-format~ defines how
21192 this timestamp are exported.
21194 [fn:116] At the moment, some export back-ends do not obey this
21195 specification. For example, LaTeX export excludes every unnumbered
21196 headline from the table of contents.
21198 [fn:117] Since commas separate the arguments, commas within arguments
21199 have to be escaped with the backslash character. So only those
21200 backslash characters before a comma need escaping with another
21201 backslash character.
21203 [fn:118] For a less drastic behavior, consider using a select tag (see
21204 [[*Export settings]]) instead.
21206 [fn:119] If =BEAMER_ENV= is set, Org export adds =B_environment= tag
21207 to make it visible. The tag serves as a visual aid and has no
21208 semantic relevance.
21210 [fn:120] By default Org loads MathJax from [[https://cdnjs.com][cdnjs.com]] as recommended by
21211 [[http://www.mathjax.org][MathJax]].
21213 [fn:121] See [[http://docs.mathjax.org/en/latest/tex.html#tex-extensions][TeX and LaTeX extensions]] in the [[http://docs.mathjax.org][MathJax manual]] to learn
21216 [fn:122] If the classes on TODO keywords and tags lead to conflicts,
21217 use the variables ~org-html-todo-kwd-class-prefix~ and
21218 ~org-html-tag-class-prefix~ to make them unique.
21220 [fn:123] This does not allow setting different bibliography compilers
21221 for different files. However, "smart" LaTeX compilation systems, such
21222 as latexmk, can select the correct bibliography compiler.
21224 [fn:124] See [[http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html][Open Document Format for Office Applications
21225 (OpenDocument) Version 1.2]].
21227 [fn:125] See [[http://www.mathtoweb.com/cgi-bin/mathtoweb_home.pl][MathToWeb]].
21229 [fn:126] See [[http://dlmf.nist.gov/LaTeXML/]].
21231 [fn:127] [[http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html][OpenDocument-v1.2 Specification]]
21233 [fn:128] See the =<table:table-template>= element of the
21234 OpenDocument-v1.2 specification.
21236 [fn:129] See the attributes =table:template-name=,
21237 =table:use-first-row-styles=, =table:use-last-row-styles=,
21238 =table:use-first-column-styles=, =table:use-last-column-styles=,
21239 =table:use-banding-rows-styles=, and =table:use-banding-column-styles=
21240 of the =<table:table>= element in the OpenDocument-v1.2 specification.
21242 [fn:130] If the publishing directory is the same as the source
21243 directory, =file.org= is exported as =file.org.org=, so you probably
21244 do not want to do this.
21246 [fn:131] The option ~org-babel-no-eval-on-ctrl-c-ctrl-c~ can be used
21247 to remove code evaluation from the {{{kbd(C-c C-c)}}} key binding.
21249 [fn:132] Actually, the constructs =call_<name>()= and =src_<lang>{}=
21250 are not evaluated when they appear in a keyword line -- i.e. lines
21251 starting with =#+KEYWORD:=, see [[*Summary of in-buffer settings]].
21253 [fn:133] For Noweb literate programming details, see
21254 http://www.cs.tufts.edu/~nr/noweb/.
21256 [fn:134] For more information, please refer to the commentary section
21259 [fn:135] Note that ~org-indent-mode~ also sets the ~wrap-prefix~
21260 property, such that ~visual-line-mode~ (or purely setting ~word-wrap~)
21261 wraps long lines (including headlines) correctly indented.
21263 [fn:136] The ~org-indent-mode~ also sets the ~wrap-prefix~ correctly
21264 for indenting and wrapping long lines of headlines or text. This
21265 minor mode handles ~visual-line-mode~ and directly applied settings
21266 through ~word-wrap~.
21268 [fn:137] Also see the variable ~org-adapt-indentation~.
21270 [fn:138] Because =LEVEL=2= has 3 stars, =LEVEL=3= has 4 stars, and so
21273 [fn:139] https://ctan.org/tex-archive/macros/latex/contrib/comment?lang=en
21275 [fn:140] If the =TBLFM= keyword contains an odd number of dollar
21276 characters, this may cause problems with Font Lock in LaTeX mode. As
21277 shown in the example you can fix this by adding an extra line inside
21278 the =comment= environment that is used to balance the dollar
21279 expressions. If you are using AUCTeX with the font-latex library,
21280 a much better solution is to add the =comment= environment to the
21281 variable ~LaTeX-verbatim-environments~.
21283 [fn:141] The ~agenda*~ view is the same as ~agenda~ except that it
21284 only considers /appointments/, i.e., scheduled and deadline items that
21285 have a time specification =[h]h:mm= in their time-stamps.
21287 [fn:142] Note that, for ~org-odd-levels-only~, a level number
21288 corresponds to order in the hierarchy, not to the number of stars.
21290 [fn:143] If Emacs is configured for safe storing of passwords, then
21291 configure the variable, ~org-mobile-encryption-password~; please read
21292 the docstring of that variable.
21294 [fn:144] An alternative is to use a WebDAV server. MobileOrg
21295 documentation has details of WebDAV server configuration. Additional
21296 help is at this [[http://orgmode.org/worg/org-faq.html#mobileorg_webdav][FAQ entry]].
21298 [fn:145] Symbolic links in ~org-directory~ need to have the same name
21301 [fn:146] While creating the agendas, Org mode forces ID properties on
21302 all referenced entries, so that these entries can be uniquely
21303 identified if MobileOrg flags them for further action. To avoid
21304 setting properties configure the variable
21305 ~org-mobile-force-id-on-agenda-items~ to ~nil~. Org mode then relies
21306 on outline paths, assuming they are unique.
21308 [fn:147] Checksums are stored automatically in the file
21311 [fn:148] The file will be empty after this operation.