2 #+OPTIONS: H:2 num:t toc:t \n:nil @:t ::t |:t ^:t *:t TeX:t
3 #+EMAIL: carsten.dominik@gmail.com
6 #+TITLE: Org-mode Frequently Asked Questions
7 #+INFOJS_OPT: view:content toc:1 path:http://orgmode.org/worg/code/org-info-js/org-info.js tdepth:1 ftoc:t buttons:0 mouse:underline
8 #+OPTIONS: H:3 num:nil toc:t \n:nil @:t ::t |:t ^:{} -:t f:t *:t TeX:t LaTeX:t skip:nil d:(HIDE) tags:not-in-toc
11 <a href="/"><img src="http://orgmode.org/img/org-mode-unicorn.png" class="logo-link" /></a>
14 [[file:index.org][{Back to Worg's index}]]
21 Welcome to the Org-mode FAQ.
23 You can navigate the FAQ by clicking on any of the topics in the Table of
26 If your browser supports JavaScript, you can...
28 - move through the topics by typing "=n=" (next) and "=p=" (previous).
30 - see an outline view of the FAQ by typing "=m=" or clicking "=toggle
33 - search the FAQ by typing "=s=" (basic search) or "=o=" (occur tree).
35 - see a full list of navigation commands by typing "=?=" or clicking
40 :CUSTOM_ID: What-is-org-mode
42 ** Can I implement a GTD workflow with Org-mode?
44 :CUSTOM_ID: GTD-workflow-with-Org-mode
47 Yes, you can. Check for discussions and pointers [[http://orgmode.org/worg/org-gtd-etc.html][here]].
49 ** What is the difference between Org and TaskPaper?
51 :CUSTOM_ID: Org-and-TaskPaper
54 There is really no difference. Org is as /simple/ as [[http://hogbaysoftware.com/products/taskpaper][TaskPaper]]. It
55 is just that, when using Org within Emacs, it lets you do many things
56 that you wouldn't be able to do with TaskPaper. Yes, TaskPaper is
57 fiddle-proof and people using Emacs tends to like fiddling (which is
58 orthogonal to the idea of using todo-list efficiently), but this is
59 just a matter of discipline and common sense, not one of Org's design.
61 Read [[http://article.gmane.org/gmane.emacs.orgmode/6224][Carsten's enlightening statement]] on this.
62 ** What is the meaning of the Unicorn on Org's website?
67 The Unicorn is the logo of Org-mode because:
69 - Org-mode is the UNICs of ORgaNizers.
71 - Org-mode is an Emacs mode, so it makes sense to use an animal
72 similar or related to the gnu used for GNU Emacs.
74 - Org-mode is meant to show you the way, and an animal with two horns
75 can not do this very well, can it?
77 - Unicorn tears are said to reverse petrification, and wasn't this how
78 we all felt before getting to some degree of time and task
81 - It will take forever to learn everything there is to know about a
84 - A unicorn is a fabulous creature. Org-mode wants to be a fabulous
87 Using a unicorn was originally /Bastien Guerry's/ idea, his friend
88 /Christophe Bataillon/ designed the logo for us, and /Greg Newman/
89 gave it a refresh some time later. Bastien writes why he chose a
93 The first reason is not linked to the animal, but to the sounding of the
94 word "Unicorn" - because Org gives you a /uni/que way of producing files
95 in several format (HTML, LaTeX, etc.)
97 The second reason is that a Unicorn doesn't really exist, it is just
98 something you can dream about, and make others believe it does exist.
99 Just like the perfect organizer.
102 There was a [[http://thread.gmane.org/gmane.emacs.orgmode/11641/focus%3D11641][thread about unicorns]] on the mailing list. [[http://thread.gmane.org/gmane.emacs.orgmode/11641/focus%3D11641][Christopher
103 Suckling]] posted a link showing how to make a simple foldable unicorn
104 (very appropriate for an outlining program!).
106 [[http://article.gmane.org/gmane.emacs.orgmode/11735][Tim Burt]] made a very complicated one which is now a treasured
107 possession of the Org-mode author.
109 - Official logo: [[http://orgmode.org/img/org-mode-unicorn.png]]
110 This logo is available in a number of different formats including
111 Photoshop /.psd/ and scaleable vector graphics /.svg/ [[http://orgmode.org/img/][here]].
113 - An [[http://orgmode.org/img/nrocinu4.jpg][alternative version]] from Christophe Bataillon (c):
115 - [[http://article.gmane.org/gmane.emacs.orgmode/14293][Chris Randle]] made a [[http://orgmode.org/img/nrocinu.txt][text version]] using the logo and [[http://glassgiant.com][glassgiant.com]]:
117 - [[http://article.gmane.org/gmane.emacs.orgmode/14362][Stefan Vollmar]] made a [[http://orgmode.org/img/nrocinu.pdf][pdf version]] (here in [[http://orgmode.org/img/nrocinu_pdf.png][png]]) using "a simple
118 threshold technique".
120 - [[http://article.gmane.org/gmane.emacs.orgmode/11735/match%3D][Tim Burt]] made a folded Unicorn to match the spirit of Org - see the
121 whole set of pictures [[http://www.flickr.com/photos/tcburt/sets/72157614543357071/][on his flickr page]].
123 - Are unicorns real? Answer [[http://article.gmane.org/gmane.emacs.orgmode/11687/match%3Drosslaird%2Bunicorn][here]] by Ross Laird.
126 ** Why hasn't my email to the mailing list shown up yet?
128 :CUSTOM_ID: ml-post-delay
131 The org-mode mailing list is moderated. Thus, if you are not
132 subscribed to the mailing list, your mail will only appear on the list
133 after it has been approved by a moderator. To ensure that your mail
134 appears quickly, please [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe to the list]].
136 ** I read the mailing list through gmane. Should I subscribe?
138 :CUSTOM_ID: ml-subscription-and-gmane
141 The org-mode mailing list is available via nntp at [[http://dir.gmane.org/gmane.emacs.orgmode][Gmane]]. Many
142 participants in the list prefer read the list in a newsreader, such as
143 Gnus, instead of receiving emails. If you choose to read the list via
144 nntp, you can still [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe]] to the list and then opt not to receive
145 any emails on the mailman settings page (see the "Mail Delivery"
148 This will ensure that your messages to the list get through quickly,
149 reduce the work load of the mailing list moderators (who need to clear
150 every mail from non-members), and provide more accurate information
151 about the number of list readers.
155 :CUSTOM_ID: Keeping-current
157 ** My Emacs ships with an older version Org-mode! How do I upgrade?
159 :CUSTOM_ID: updating-org
162 Org-mode develops quickly, which means that versions of Org-mode
163 shipped with Emacs are more or less out-of-date. If you'd like to
164 upgrade to the most recent version of org-mode, you have a number of
167 1. Download the most recent release of org-mode ([[http://orgmode.org/org-7.3.zip][zip]] or [[http://orgmode.org/org-7.3.tar.gz][tarball]]) and
168 follow the [[http://orgmode.org/manual/Installation.html#Installation][installation instructions]] in the manual.
169 2. Clone and install the development git repository as [[#keeping-current-with-Org-mode-development][explained
170 here]]. If you don't want to run the bleeding edge, you can still
171 use git [[#using-stable-releases-only][to track the most recent stable releases]].
172 3. Install and updated org-mode automatically through the Emacs
173 Package Manager as [[#installing-via-elpa][explained in this FAQ]].
175 ** How do I keep current with bleeding edge development?
177 :CUSTOM_ID: keeping-current-with-Org-mode-development
180 Org mode is developed in [[http://en.wikipedia.org/wiki/Git_(software)][Git]]. You can keep up-to-date with Org-mode
181 developement by cloning Org mode repository and refreshing your
182 copy with latest changes whenever you wish. You only need to use
183 two Git commands (clone and pull.) Here are the steps in brief
184 (please customize locations to suit your setup):
186 1. Select a location to house the Org mode repository (approx. 40
187 MB; includes documentation, compiled elisp files and history
188 going all the way back to v4.12a)
190 : $ mkdir $HOME/elisp && cd $HOME/elisp
192 2. Clone the Org mode Git repository.
194 Recommended approach:
196 : $ git clone git://repo.or.cz/org-mode.git
198 Alternate approach if you are behind a firewall that allows only
199 HTTP (can be quite slow):
201 : $ git clone http://repo.or.cz/r/org-mode.git
203 3. Compile and install Org mode and build documentation.
205 : $ cd org-mode && make && make doc && make install
207 Please note that you can choose to /not/ compile at all and run
208 using source =.el= files only. Compiled files speed things up.
210 Also note that running =make install= is necessary only if you'd
211 like to install org-mode system-wide.
213 4. This is where you configure Org mode with Emacs. Please refer
214 to [[./org-tutorials/index.org][Org tutorials]].
216 5. Keeping up-to-date.
218 Cloning the repository is a one time activity. From this point
219 onwards you only need to /pull/ the latest changes.
221 : $ cd $HOME/elisp/org-mode
225 : $ git pull && make clean && make && make doc && make install
227 6. You should restart org mode to have the changes take effect (if
228 you are not rebooting Emacs.) Also since the intention is to
229 "keep up" with Org mode, you should visit updated sections of
230 documentation for latest updates (use =git log=.)
232 7. As you use your repository over time it will accumulate loose objects.
233 You can reduce the total size of your git repository with
237 which will consolidate loose git objects into pack files. This
238 reduces the size of the repository and speeds up data access to
241 ** How can I keep local changes and still track Org mode development?
243 :CUSTOM_ID: keeping-local-changes-current-with-Org-mode-development
246 Say you want to make minor changes to the Makefile to reflect your
247 location for =emacs=.
249 Create a local branch for your changes on top of origin/master as
252 : $ git checkout -b local origin/master
253 : $ git config branch.local.rebase true
254 : # Make your changes to the Makefile and create a new commit
256 : $ git commit -m 'My local Makefile configurations'
257 : # Update git to a newer version
260 Now each time you pull new commits from the distribution repository
261 your local commits will be rewound and replayed on top of the new
266 You would normally work on your =local= branch which includes your
267 custom commits; there's no need to switch back to the =master=
272 Here is an example of dealing with conflict resolution during git pull.
274 If you get a conflict during a =git pull= you will need to edit the
275 file with the conflict to fix up the conflicting lines and then tell
276 git that you have resolved the conflict.
278 Conflict resolution goes something like this:
280 1. =git pull= fails with a conflict
282 3. =git add= the file to mark the conflict resolved
283 4. =git rebase --continue=
284 5. lather, rinse, and repeat 2-4 as needed
286 For this example we have the following Makefile:
296 and we need to change the =EMACS=emacs= line to =EMACS=myemacs= to
297 make it work well on our system.
301 - create a local branch for our work
303 : $ git checkout -b local origin/master
304 : $ git config branch.local.rebase true
306 This marks the branch so that all local commits on it are rebased
307 on top of any new commits we get in origin/master during a =git
310 - Make our custom changes
312 Edit the makefile so it looks like this:
322 - Create a commit with our custom changes
324 : $ git commit -m 'My local Makefile configurations'
326 - Later we do a =git pull= but that fails with conflicts.
329 : remote: Counting objects: 5, done.
331 : Patch failed at 0001.
333 : When you have resolved this problem run "git rebase --continue".
334 : If you would prefer to skip this patch, instead run "git rebase --skip".
335 : To restore the original branch and stop rebasing run "git rebase --abort".
337 - Fix the conflict in your favourite editor
339 Conflict markers look like this:
341 : <<<<<<< HEAD:Makefile
345 : >>>>>>> Change emacs location:Makefile
347 This attempted =git pull= caused a conflict. Fire up your
348 favourite editor and fix the conflict in the Makefile. The
349 conflict markers are <<<<<<<<<< , ======= , and >>>>>>>>>>. Fix
350 the Makefile appropriately and delete the conflict markers. You
351 already edited these lines earlier so fixing it should be trivial.
353 In this case we changed =EMACS=emacs= to =EMACS=myemacs= and
354 upstream changed =EMACS=emacs= to =EMACS=emacs22=. Just fix the
355 file and save it by deleting the conflict markers and keeping the
356 code you need (in this case the =EMACS=myemacs= line which we
357 originally modified.)
359 - Mark the file's conflict resolved
363 You use =git add= because you are adding new content to be tracked - you're not adding a file, but you are adding changes in content.
365 - Continue the rebase operation
367 : $ git rebase --continue
369 If any other conflicts arise you fix them the same way - edit the file, mark the conflict resolved, and continue.
371 At anytime during the rebase conflict resolution you can say "oops this is all wrong - put it back the way it was before I did a pull"
373 : $ git rebase --abort
375 ** How can I use a stable release version instead of the bleeding edge master?
377 :CUSTOM_ID: using-stable-releases-only
380 The master branch of the git repository always contains the bleeding
381 edge development code. This is important for Org's fast development,
382 because code on master gets checked out by many people daily and we
383 quickly receive bug reports if something is wrong. On rare occasions,
384 this code may not function perfectly for a limited time while we are
385 trying to fix things.
387 Not everyone like to use this bleeding-edge code and face the danger
388 to hit a surprising bug.
390 Therefore, from time to time, we make a release. This typically
391 happens when the maintainers feel that
393 1. they have reached a good point in the development
394 2. the code has a feature set that should stay and be supported in the
397 Stable releases are used as the basis for [[http://orgmode.org/index.html#sec-3_3][alternative distributions]] of
398 Org, and they are also the code that gets merged into the Emacs
399 distribution. If you want to work only with stable releases, you can
400 always download [[http://orgmode.org/index.html#sec-3][them here]], but you can also also use the git
401 repository to keep automatically up-to-date with the most recent
402 stable releases (and save bandwidth!). Here's how to do so:
404 *** Run a specific stable release
406 In the repository, do
411 To see which release tags are available. Let's say you decide to use
414 : $ git checkout release_7.01f
416 This set the working tree of the repository to the state of Org at the
417 moment of release 7.01f. You can then run Org from the repository be
418 sure to use the stable release while development continues on the
421 Later, when we release 7.02, you can switch to that using
423 : $ git fetch --tags # to get all the new stuff
425 : $ git checkout release_7.02
427 *** Always run the most recent stable release
429 Alternatively, if you just want to always run whatever the latest
430 stable release is, you can do
432 : $ git checkout -b stable origin/maint
434 and then regularly update this branch by doing
438 ** How can I install an up-to-date version of org-mode without "make" tools?
440 :CUSTOM_ID: installing-org-without-make-tools
443 If you are using org-mode on a computer that lacks developer tools for
444 compiling software, such as [[http://www.gnu.org/software/make/][GNU Make]], you will have to use a
445 *different* installation method than [[http://orgmode.org/manual/Installation.html#Installation][the one outlined in the manual]].
447 Please see [[http://article.gmane.org/gmane.emacs.orgmode/15264][this thread]] on the mailing list for several different ways
448 you can install a recent version of org-mode without using the
449 customary =make clean && make && make install=.
451 The result of that discussion is the file/function found in
452 [[http://orgmode.org/worg/org-hacks.html#compiling-org-without-make]].
454 ** I don't use git. Can I download bleeding edge .zip and .tar.gz archives?
456 Yes. You can download [[http://orgmode.org][org-latest.zip]] or [[http://orgmode.org/org-latest.tar.gz][org-latest.tar.gz]] of
457 Org-mode -- these archives are udpated every day at midnight.
459 Alternatively, you can download a [[http://repo.or.cz/w/org-mode.git/snapshot][tar.gz snapshot from repo.or.cz]].
461 ** How can I install Org-mode through Emacs' Package Manager?
463 :CUSTOM_ID: installing-via-elpa
466 Emacs 24 includes an automated package management tool ([[http://tromey.com/elpa/][ELPA]]) that
467 can be used to install and upgrade elisp packages such as Org-mode.
468 If you are running an older version of Emacs (23 or earlier), you
469 will have to install the package manager before using it to install
470 Org-mode. See [[#installing-elpa][this FAQ]] for more details.
472 Org-mode is distributed as an ELPA package from [[http://elpa.gnu.org/packages/][GNU Emacs Lisp
473 Package Archive]] as well as from [[http://orgmode.org/pkg/daily/][Org-mode Emacs Lisp Archive]].
475 Steps for adding Org-mode as a package archive:
476 1. Add Org-mode as a package archive. This can be done in two ways.
477 1. Use =M-x customize-variable RET package-archives=
478 2. Add the following line to your =.emacs= and reload Emacs.
480 #+begin_src emacs-lisp
481 (add-to-list 'package-archives '("Org-mode" . "http://orgmode.org/pkg/daily/"))
484 2. Use the Emacs package manager's =M-x list-packages= to browse
485 and install the latest version.
487 3. If you get the following error "*Failed to download `Org-mode'
488 archive.*" in step 2, you can manually download the tarball and
489 install it. Refer [[Installing from ELPA-tar][this FAQ entry]] for more information.
491 ** How do I install Emacs package manager?
493 :CUSTOM_ID: installing-elpa
496 If you are running Emacs-24 or find the command =M-x list-packages=
497 available you already have the package manager installed.
499 Steps for installing package manager:
500 1. Download the latest package manager -
501 [[http://repo.or.cz/w/emacs.git/blob_plain/HEAD:/lisp/emacs-lisp/package.el][package.el]].
502 2. Add the following to your =.emacs= and reload Emacs.
503 #+begin_src emacs-lisp
504 ;; change "~/elisp/" as appropiate
505 (setq load-path (cons "~/elisp" load-path))
510 ** I don't see Org-mode as an installation option in Package Manager Menu?
512 :CUSTOM_ID: why-no-org-in-elpa
515 Emacs Package Manager is a very recent addition to Emacs. Work is
516 under way to have have Org-mode seamlessly integrate with Emacs'
517 Package Manager. As a result, it will be some time before the
518 Org-mode packages are available and usable from either GNU or
519 Org-mode package archives.
521 In the meanwhile, you can install Org-mode via package manager
522 through ELPA-compatible tar. Refer [[Installing from ELPA-tar][this FAQ entry]] for more information.
524 ** How do I install Org-mode from a ELPA-compatible tarball?
526 :CUSTOM_ID: installing-from-elpa-tarball
528 # <<Installing from ELPA-tar>>
530 Org-mode is distributed as an ELPA-compatible tar which can be used
531 in conjunction with Emacs' package manager.
533 1. If you are already running Org-mode, note the current version
534 reported by M-x org-version.
535 2. Download the latest tarball from [[http://orgmode.org/pkg/daily/][Org-mode repo]].
536 3. Do =M-x package-install-file=. When prompted for =Package file
537 name=, point it to .tar file downloaded in step 2.
539 You will now see Package Manager compiling the files and
541 4. Reload emacs. This step is very important.
542 5. Note the version of the new installation using M-x
543 org-version. If the new and old versions are different, the
544 installation is done and you are all set to enjoy the updated
545 Org-mode. Otherwise skip to step 6.
546 6. Review you load-path using =C-h v load-path=. Most likely that
547 your old installation path takes precedence over the path chosen
548 by package manager (which is typically
549 =~/.emacs.d/elpa/...=). Fix this anamoly by moving
550 =(package-initialize)= line in .emacs to a more appropriate
553 - Additional Note on =org-install.el= :: Functionality of Org-mode's
554 =org-install.el= is supplanted by Package Manager's
555 =org-autoloads.el=. Since Package Manager autoloads Org-mode for
556 you, the following line =(require 'org-install)= in your =.emacs=
557 is no longer required and can be safely removed.
559 ** Why would I use ELPA tarballs instead of the snapshot tarballs?
564 ELPA-tarballs automate much the process of upgrading org-mode. Much
565 of the following grunt work is done automatically by the Package
568 1. Downloading, compiling, and activating of org-mode (including
569 setting org-mode's =load-path= and autoloads).
570 2. Updating info files.
576 ** How can I quickly browse all Org options?
578 =M-x org-customize RET=
580 See also [[file:org-tutorials/org-customize.org][Carsten's Org customize tutorial]] and [[file:org-configs/org-customization-guide.org][this customization guide]]
583 ** Can I use the editing features of org-mode in other modes?
585 :CUSTOM_ID: use-editing-features-in-other-modes
588 Not really---but there are a few editing features you can use in
591 - For tables there is =orgtbl-mode= which implements the table
592 editor as a minor mode. (To enable, type =M-x orgtbl-mode=)
593 - For ordered lists there is =orgstuct-mode= which allows for easy
594 list editing as a minor mode. (To enable, type =M-x
597 You can activate these modes automatically by using hooks:
599 : (add-hook 'mail-mode-hook 'turn-on-orgtbl)
600 : (add-hook 'mail-mode-hook 'turn-on-orgstruct)
602 For footnotes, there is the function =org-footnote-action=, which
603 works in non-org buffers. This function is a powerful tool for
604 creating and sorting footnotes. To use it globally, you can add the
605 following keybinding to your =.emacs= file (requires Org 6.17 or
608 : (global-set-key (kbd "C-c f") 'org-footnote-action)
610 For other features you need to switch to Org-mode temporarily, or
611 prepare text in a different buffer.
613 ** Why isn't feature "X" working the way it is described in the manual?
615 :CUSTOM_ID: making-sure-org-mode-is-up-to-date
618 Org-mode develops very quickly. If you are using a version of Org-mode
619 that shipped with emacs, there is a good chance that it is somewhat
622 Many of the users on the Org-mode mailing list are using either a
623 recent release of Org-mode or the
624 [[http://orgmode.org/index.html#sec-3.2][development version of
625 org-mode from the git repository]].
627 If some settings and features aren't working the way you expect, make
628 sure that the version of the manual you are consulting matches the
629 version of Org-mode you are using.
631 - You can check which version of Org-mode you are using by
632 selection =Org --> Documentation --> Show Version= in the Emacs
635 - The [[http://orgmode.org/manual/index.html][online manual]] at [[http://orgmode.org][orgmode.org]] corresponds to the most recent
638 - The [[http://www.gnu.org/software/emacs/manual/html_node/org/index.html][manual]] at [[http://www.gnu.org][www.gnu.org]] corresponds to the version of Org-mode
639 released with the latest official Gnu Emacs release. Compared
640 with the manual at the orgmode.org, the manual at www.gnu.org is
641 somewhat out of date.
643 For instructions on how to stay current with Org-mode, consult [[keeping-current-with-Org-mode-development][this
644 FAQ]] or follow the instructions on [[http://orgmode.org][the official Org-mode site]].
646 ** Can I get the visibility-cycling features in outline-mode and outline-minor-mode?
648 :CUSTOM_ID: use-visibility-cycling-in-outline-mode
651 Yes, these functions are written in a way that they are independent of
652 the outline setup. The following setup provides standard Org-mode
653 functionality in outline-mode on =TAB= and =S-TAB=. For
654 outline-minor-mode, we use =C-TAB= instead of =TAB=,
655 because =TAB= usually has mode-specific tasks.
657 #+BEGIN_SRC emacs-lisp
658 (add-hook 'outline-minor-mode-hook
660 (define-key outline-minor-mode-map [(control tab)] 'org-cycle)
661 (define-key outline-minor-mode-map [(shift tab)] 'org-global-cycle)))
662 (add-hook 'outline-mode-hook
664 (define-key outline-mode-map [(tab)] 'org-cycle)
665 (define-key outline-mode-map [(shift tab)] 'org-global-cycle)))
668 Or check out /outline-magic.el/, which does this and also provides
669 promotion and demotion functionality. /outline-magic.el/ is
670 available at [[http://www.astro.uva.nl/~dominik/Tools/outline-magic.el][Outline Magic]].
672 ** Can I save/restore the visibility state of an org-mode buffer?
674 :CUSTOM_ID: saving-visibility-state
677 Well, no---at least not automatically. You can, however, control the
678 visibility of an org-file or of individual trees by adding
679 instructions to your org file. See [[http://orgmode.org/manual/Visibility-cycling.html#Visibility-cycling][this section of the manual]] for more
682 ** How can I keep track of changes in my Org files?
684 :CUSTOM_ID: track-of-changes-in-Org-files
687 Use git to track the history of the files, use a cronjob to check in
688 changes regularly. Such a setup is described by Bernt Hansen
689 in [[http://article.gmane.org/gmane.emacs.orgmode/6233][this message]] on [[http://dir.gmane.org/gmane.emacs.orgmode][emacs-orgmode]].
691 ** Can I use Org-mode as the default mode for all README files?
693 :CUSTOM_ID: Org-mode-as-default-mode
696 Add the following to your .emacs file:
698 : (add-to-list 'auto-mode-alist '("README$" . org-mode))
700 You can even make it the default mode for any files with unspecified
703 : (setq default-major-mode 'org-mode)
705 ** Can I use ido.el for completing stuff in Org?
707 :CUSTOM_ID: ido-complete
710 Yes, you can. If you are an ido user and ido-mode is active, the
711 following setting will make Org use =ido-completing-read= for most
712 of its completing prompts.
714 : (setq org-completion-use-ido t)
716 ** Should I use one big org file or multiple files?
718 :CUSTOM_ID: how-to-organize-org-mode-files
721 Org-mode is flexible enough to accomodate a variety of organizational
722 and time management schemes. Org's [[http://orgmode.org/manual/Document-Structure.html#Document-Structure][outline cycling and convenient
723 editing and navigation commands]] make it possible to maintain all of
724 your projects and notes in a single file. But org-mode's [[http://orgmode.org/manual/Hyperlinks.html#Hyperlinks][quick and
725 easy hyperlinks]], along with [[http://orgmode.org/manual/Refiling-notes.html#Refiling-notes][easy refiling of notes and todos]], also
726 make it a delight to maintain a private "wiki" consisting of multiple
729 No matter how you organize your org files, org-mode's agenda commands
730 make it easy to search all your notes and gather together crucial data
733 Moreover, several org-mode settings can be configured either globally
734 in your =.emacs= file or locally (per file or per outline tree). See
735 the [[http://orgmode.org/manual/index.html#Top][manual]] for more details. For an example of local customizations
736 see [[limit-agenda-with-category-match][this FAQ]].
738 Here are a few ideas for organizing org-mode files:
740 - A single file for all your projects and notes.
741 - One file per project.
742 - One file per client.
743 - One file per area of responsibility or type of work (e.g.,
744 household, health, work, etc.).
745 - One file for projects, one for appointments, one for reference
746 material, one for someday/maybe items, etc.
747 - A wiki of hyperlinked files that grows and adapts to meet your
750 For more ideas, see some of the links on the [[file:org-tutorials/index.org][org-tutorial index]] or
751 [[file:org-gtd-etc.org][this page on org-mode and GTD]].
753 ** Why doesn't C-c a call the agenda? Why don't some org keybindings work?
755 :CUSTOM_ID: setting-global-keybindings
758 Org-mode has a few global keybindings that the user must set
759 explicitly in an =.emacs= file. These keybindings include the
760 customary shortcut for calling the agenda (=C-c a=). If nothing
761 happens when you type =C-c a=, then make sure that the following lines
762 are in your =.emacs= file:
764 #+BEGIN_SRC emacs-lisp
765 ;; The following lines are always needed. Choose your own keys.
766 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
767 (global-set-key "\C-cl" 'org-store-link)
768 (global-set-key "\C-ca" 'org-agenda)
769 (global-set-key "\C-cb" 'org-iswitchb)
772 You may, of course, choose whatever keybindings work best for you
773 and do not conflict with other modes.
775 Please see [[http://orgmode.org/manual/Activation.html][this section of the manual]] if you have additional
778 ** Why aren't some of the variables I've customized having an effect?
780 :CUSTOM_ID: load-org-after-setting-variables
783 Some org variables have to be set before org.el is loaded or else they
784 will not work. (An example is the new variable
785 =org-enforce-todo-dependencies=.)
787 To make sure all your variables work you should not use =(require
788 'org)=. Instead use the following setting:
790 : (require 'org-install)
792 You should also make sure that you do not require any other =org-...=
793 files in your =.emacs= file before you have set your org variables,
794 since these will also cause org.el to be loaded. To be safe, load org
795 files *after* you have set your variables.
797 ** How can I make sure that timestamps appear in English?
799 :CUSTOM_ID: timestamps-and-system-time-locale
802 If your system's locale is not set to English, but you would like the
803 timestamps in your org-mode files to appear in English, you can set
804 the following variable:
806 #+begin_src emacs-lisp
807 (setq system-time-locale "C")
810 ** What does a minimal .emacs look like?
812 :CUSTOM_ID: minimal-emacs
815 Using a stripped down minimal .emacs files removes broken custom
816 settings as the cause of an issue and makes it easy to reproduce for
817 other people. The example below has system-specific paths that you'll
818 need to change for your own use.
819 #+begin_src emacs-lisp
820 (add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
821 (add-to-list 'auto-mode-alist '("\\.\\(org\\ |org_archive\\|txt\\)$" . org-mode))
822 (setq org-agenda-files '("/tmp/test.org"))
823 (require 'org-install)
826 (global-set-key "\C-cl" 'org-store-link)
827 (global-set-key "\C-ca" 'org-agenda)
828 (global-set-key "\C-cb" 'org-iswitchb)
831 You can save the minimal .emacs file to ~/minimal.emacs, add suspect
832 configuration code to it, then start emacs something like this:
834 emacs -Q -l ~/minimal.emacs
837 On OS X, starting emacs with minimal configuration might look
840 /Applications/emacs.app/Contents/MacOS/Emacs -Q -l ~/minimal.emacs
843 ** Can I migrate from Planner?
845 Yes. This [[http://www.c0t0d0s0.de/plan2org/plan2org.pl][perl script]] can help.
847 * Errors and general problems
851 ** Opening Org files in Emacs leads to a crash
853 :CUSTOM_ID: Emacs-crashes-with-org-indent-mode
855 The only known case where Org-mode can crash Emacs is when you are
856 using =org-indent-mode= with Emacs 23.1 (in fact, any version of
857 Emacs before version 23.1.50.3). Upgrade to Emacs 23.2 and the
858 problem should go away.
860 ** When I try to use Org-mode, I always get the error message =(wrong-type-argument keymapp nil)=
862 :CUSTOM_ID: wrong-type-argument-keymapp
865 This is a conflict with an outdated version of the /allout.el/, see
866 the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section in the manual
868 ** How can I control the application launched by Org-mode to open a certain file type like pdf, html....
870 :CUSTOM_ID: external-application-launched-to-open-file-link
873 If you want special control about how Org-mode opens files, see the
874 variables =org-file-apps=, =org-file-apps-defaults-gnu=,
875 =org-file-apps-defaults-macosx=, =org-file-apps-defaults-windowsnt=.
877 *However*, normally it is best to just use the mechanism the
878 operating-system provides:
880 *** GNU/Linux systems
881 You you have to check your mailcap settings, find the files:
889 and modify them accordingly. Please read their manual entry.
892 + for html pages you may configure the =browse-url-= variables through
893 the Customize interface,
894 + the pdf files are automatically opened with Acrobat Reader (if it is
898 Change the application responsible for this file type by selecting
899 such a file in the Finder, select =File->Get Info= from the menu
900 and select the application to open this file with. Then, to
901 propagate the change to all files with the same extension, select
902 the =Change all= button.
904 ** Org-mode takes over the TAB key. I also want to use YASnippet, is there a way to fix this conflict?
906 :CUSTOM_ID: YASnippet
909 [[http://code.google.com/p/yasnippet/][yasnippet]] is yet another snippet expansion system for Emacs. It is
910 inspired by TextMate's templating syntax.
911 - watch the [[http://www.youtube.com/watch?v=vOj7btx3ATg][video on YouTube]]
912 - see the [[http://yasnippet.googlecode.com/svn/trunk/doc/index.html][intro and tutorial]]
914 *Note*: yasnippet is not compatible with =org-indent-mode= currently
915 there is no known way to use both successfully with =yas/trigger-key=
916 set to =TAB= (or =[tab]= etc...)
918 The way Org-mode binds the =TAB= key (binding to =[tab]= instead of
919 =\t=) overrules yasnippets' access to this key. The following code
922 #+begin_src emacs-lisp
923 (add-hook 'org-mode-hook
925 (org-set-local 'yas/trigger-key [tab])
926 (define-key yas/keymap [tab] 'yas/next-field-group)))
929 If the above code doesn't work (which it may not with later versions
930 of yasnippet). Then try the following
932 #+begin_src emacs-lisp
933 (defun yas/org-very-safe-expand ()
934 (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
936 (add-hook 'org-mode-hook
938 ;; yasnippet (using the new org-cycle hooks)
939 (make-variable-buffer-local 'yas/trigger-key)
940 (setq yas/trigger-key [tab])
941 (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
942 (define-key yas/keymap [tab] 'yas/next-field)))
945 Rick Moynihan maintains a [[http://github.com/RickMoynihan/yasnippet-org-mode][git repository]] (or [[http://github.com/eschulte/yasnippet-org-mode][Eric's fork of the same]])
946 with YASnippets for Org-mode.
948 ** Org-mode takes over the S-cursor keys. I also want to use CUA-mode, is there a way to fix this conflict?
953 Yes, see the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
955 ** Org-mode takes over the S-cursor keys. I also want to use windmove.el, is there a way to fix this conflict?
957 :CUSTOM_ID: windmove.el
960 Yes, see the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
962 ** Org behaves strangely: some keys don't work, some features are missing, my settings have no effect, ...
964 :CUSTOM_ID: loaded-old-org
967 When this sort of things happen, it probably is because Emacs is
968 loading an old version of Org-mode instead of the one you expected.
969 Check it with =M-x org-version=.
971 This happens because Emacs loads first the system org-mode (the one
972 included with Emacs) before the one in your directory. Check the
973 =load-path= variable; you might see that your org-mode appears /after/
974 the system-wide path; this is bad.
976 You should add your directories to the =load-path= at the beginning:
978 : (add-to-list 'load-path "~/.emacs.d/org-mode/lisp") (require 'org-install)
980 Function =add-to-list= adds at the beginning. Don't use =append=
981 because it appends at the end. Also be sure to use =(require
982 'org-install)= and not =(require 'org)=.
984 This wrong version loading may also happen if you have a byte-compiled
985 =org.elc= from an old version together with a new =org.el=. Since
986 Emacs prefers loading byte-compiled files (even if the =.el= is
987 newer), it will load the old Org-mode.
989 ** Why doesn't org-batch-agenda work under Win32?
991 :CUSTOM_ID: org-batch-agenda-under-win32
994 When I run the example batch files to print my agenda to the console
995 under Win32 I get the failure:
997 : End of file during parsing
999 and no agenda is printed.
1001 The problem is the use of single quotes surrounding the eval in the
1002 emacs command-line. This gets confused under Win32. All string
1003 parameters with spaces must be surrounded in double quotes. This means
1004 that double quotes being passed to the eval must be escaped.
1006 Therefore, instead of the following:
1008 : <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
1009 : -eval '(org-batch-agenda "a")'
1011 you need to use the following:
1013 : <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
1014 : -eval "(org-batch-agenda \"a\")"
1016 (all on one line, of course).
1018 ** Org agenda seems very slow
1020 :CUSTOM_ID: slow-agenda
1023 If it takes a long time to generate or refresh the agenda, you might
1024 want first check which version of org-mode you are using. There have
1025 been major optimizations of org-agenda since 6.21b, which was the
1026 version of org-mode released with Emacs 23. If you are using 6.21b or
1027 earlier (you can check with =M-x org-version=), then you might want to
1028 consider upgrading to a more recent version of org-mode.
1030 Here are some other ideas for speeding up the agenda:
1032 1. Use a one day agenda view (rather than a seven day view).
1034 =(setq org-agenda-ndays 1)=
1036 2. Archive inactive items to separate files.
1038 =C-c C-x C-s= (org-archive-subtree)
1040 3. Do not include the global todo list in your agenda view.
1042 (setq org-agenda-include-all-todo nil)
1044 4. Make sure that your org files are byte-compiled.
1046 I.e., make sure there are files ending in =.elc= in your org
1047 installation directory.
1049 5. Limit your agenda files (=org-agenda-files=) to files that have
1050 active todos and or projects.
1052 If you have a number of older reference files---i.e., files you
1053 search only occasionally---in your agenda files list, consider
1054 removing them from your agenda files and adding them to
1055 =org-agenda-text-search-extra-files= instead. Similarly, you might
1056 consider searching some of your older reference files with =M-x
1057 grep= so that Org-mode does not have to load them into memory when
1058 the agenda is called.
1060 ** Visual-line-mode doesn't work well with org-mode
1062 :CUSTOM_ID: visual-line-mode
1065 Visual-line-mode "soft wraps" lines so that the visual edge of the
1066 buffer is considered a line break for purposes of navigation, even
1067 though there is no line break in reality.
1069 In older versions of org-mode, org-beginning-of-line and
1070 org-end-of-line do not work well with visual line mode. (The two
1071 commands disregard soft line breaks and move to the beginning and end
1072 of the hard line break.) A patch was introduces to fix this behavior
1075 If you are using an older version of org mode, you can:
1077 1. Add a hook to turn off visual line mode.
1079 2. Add the following to your =.emacs=:
1081 #+begin_src emacs-lisp
1083 (add-hook 'org-mode-hook
1085 (define-key org-mode-map "\C-a" 'move-beginning-of-line)
1086 (define-key org-mode-map "\C-e" 'move-end-of-line)))
1089 * Faces and highlighting
1093 ** Org-mode has a lot of colors? How can I change them?
1095 :CUSTOM_ID: customizing-org-faces
1098 This is a question that applies to Emacs as a whole, but it comes up
1099 quite frequently on the org-mode mailing list, so it is appropriate to
1102 If you would like to change the style of a face in org-mode (or any
1103 other Emacs mode), simply type =M-x customize-face [RET]= while the
1104 cursor is on the color/style you are interested in modifying. You will
1105 be given the opportunity to customize all the faces located at that
1108 If you would like an overview of all the faces in org-mode, you can
1109 type =C-u M-x list-faces-display [RET] org= and you will be shown all
1110 the faces defined by org-mode along with an illustration of their
1113 If you would like to customize org-faces and other aspects of
1114 org-appearance, type =M-x customize-group org-font-lock [RET]=.
1116 Finally, if you would like verbose information about the properties of
1117 the text under the cursor, you can type =C-u C-x ==.
1119 See the Worg page on [[file:org-tutorials/org-appearance.org][customizing Org appearance]] for further information.
1120 ** Why do I get a tiny font in column view when using emacs daemon?
1122 :CUSTOM_ID: column-view-tiny-font
1125 When using emacs in daemon mode (=emacs --daemon=), client frames
1126 sometimes override the column view face settings, resulting in very
1127 small fonts. Here is a fix:
1129 #+begin_src emacs-lisp
1130 (defun org-column-view-uses-fixed-width-face ()
1131 ;; copy from org-faces.el
1132 (when (fboundp 'set-face-attribute)
1133 ;; Make sure that a fixed-width face is used when we have a column
1135 (set-face-attribute 'org-column nil
1136 :height (face-attribute 'default :height)
1137 :family (face-attribute 'default :family))))
1139 (when (and (fboundp 'daemonp) (daemonp))
1140 (add-hook 'org-mode-hook 'org-column-view-uses-fixed-width-face))
1143 This fix was provided in the following mailing list post:
1145 http://article.gmane.org/gmane.emacs.orgmode/27560
1146 ** How can I stop the mouse cursor from highlighting lines in the agenda?
1148 :CUSTOM_ID: ratpoison-for-agenda-highlighting
1151 You can add the following to your =.emacs=:
1153 #+begin_src emacs-lisp
1154 (add-hook 'org-finalize-agenda-hook
1155 (lambda () (remove-text-properties
1156 (point-min) (point-max) '(mouse-face t))))
1163 ** Can I have two windows on the same Org-mode file, with different outline visibilities?
1165 :CUSTOM_ID: indirect-buffers
1168 You may use /indirect buffers/ which do exactly this. See the
1169 documentation on the command =make-indirect-buffer=.
1171 Org-mode has built-in commands that allow you create an indirect
1172 buffer from a subtree of an outline. To open a subtree in new
1173 window, type =C-c C-x b=. Any changes you make in the new window
1174 will be saved to the original file, but the visibility of both
1175 buffers will remain independent of one another.
1177 For multiple indirect buffers from the same file, you must use the
1178 prefix =C-u= when creating the second (or third) buffer. Otherwise
1179 the new indirect buffer will replace the old.
1181 You can also create an independent view of an outline subtree by
1182 typing =b= on an item in the agenda.
1184 ** Emacs outlines are unreadable. Can I get rid of all those stars?
1186 :CUSTOM_ID: Emacs-outlines-are-unreadable
1189 See the section [[http://orgmode.org/manual/Clean-view.html#Clean-view][Clean outline view]] in the manual.
1190 ** C-k is killing whole subtrees! I lost my work!
1192 :CUSTOM_ID: C-k-is-killing-subtrees
1195 =(setq org-special-ctrl-k t)= before losing your work.
1197 ** Why aren't commands working on regions?
1199 :CUSTOM_ID: transient-mark-mode
1202 Some org-mode commands, such as M-right and M-left for demoting or
1203 promoting headlines (see [[demote-multiple-headlines][this FAQ]]), can be applied to entire regions.
1204 These commands, however, will only work on active regions set with
1205 [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Transient-Mark.html#Transient-Mark][transient mark mode]]. Transient mark mode is enabled by default in
1206 Emacs 23. To enable it in earlier versions of emacs, put the following
1207 in your =.emacs= file:
1209 : (transient-mark-mode 1)
1211 Alternatively, you may turn off transient mark mode and use [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Momentary-Mark.html][a
1212 momentary mark]] (=C-<SPC> C-<SPC>=).
1214 ** Why is a blank line inserted after headlines and list items?
1216 :ID: 2463F4D8-F686-4CF3-AA07-08976F8A4972
1219 :CUSTOM_ID: blank-line-after-headlines-and-list-items
1222 In org-mode, typing =M-RET= at the end of a headline will create a new
1223 headline of the same level on a new line. The same is true for plain
1224 lists. By default org-mode uses context to determine if a blank line
1225 should be inserted after each headline or plain list item when =M-RET=
1226 is pressed. For instance, if a there is a blank line before a
1227 headline, then typing =M-RET= at the end of the line will insert a
1228 blank line before the new headline. For instance, hitting =M-RET=
1229 at the end of "Headline Two" below inserts a new headline without a
1236 If there is a blank line between Headline One and Headline Two,
1237 however, the results will be as follows:
1245 If you do not like the default behavior you can change it with the
1246 variable =org-blank-before-new-entry=. You can set headings and/or
1247 plain lists to auto (the default setting), t (always), or nil (never).
1249 ** How can I promote or demote multiple headlines at once?
1251 :CUSTOM_ID: demote-multiple-headlines
1254 If you have a long list of first level headlines that you'd like to
1255 demote to second level headlines, you can select the headlines as a
1256 region and then hit =M-<right>= to demote all the headlines at once.
1258 Note: =M-S-<right>= will not work on a selected region. Its use is to
1259 demote a single subtree (i.e., a headline and all sub-headlines).
1261 If M-<right> doesn't seem to work, make sure transient mark mode is
1262 enabled. See [[transient-mark-mode][this FAQ]].
1264 ** What's the deal with all the ellipses in my org outlines?
1266 :CUSTOM_ID: org-ellipses
1269 Org-mode uses ellipses to indicate folded (and thus hidden) text. Most
1270 commonly, ellispes occur at the end of headings with folded content:
1274 Or, for instance, they may indicate closed drawers:
1278 Sometimes, as a result of editing and cycling an outline, ellipses may
1279 appear in unexpected places. You should *never* delete these ellipses,
1280 as you may accidentally delete hidden text. Instead, you can type =C-c
1281 C-r= (org-reveal) to display all hidden text in the vicinity. Or you
1282 may type =M-x RET show-all= to reveal all text in the org file.
1284 If you would prefer a symbol or face for indicating hidden text, you
1285 can customize the variable org-ellipses.
1287 ** How do I yank a subtree so it's indented according to the point's location?
1289 :CUSTOM_ID: yank-indent-subtree
1292 You can either use =C-c C-w= with a working [[http://orgmode.org/manual/Refiling-notes.html#Refiling-notes][refile-targets]] setup.
1294 Or set =org-yank-adjusted-subtrees= to =t= which will adjust the
1295 yanked headline's level correctly.
1297 Just use =C-k= and =C-y= as you would everywhere else in Emacs.
1299 ** Can I read org-mode outlines in vim?
1301 :CUSTOM_ID: org-outlines-in-vim
1304 Yes, there is a script that enables one to view and navigate folded
1305 outline/org files in vim (though without most of org-mode's
1306 functionality, of course).
1308 - [[http://www.vim.org/scripts/script.php?script_id%3D1266][Emacs outline mode - Imitates Emacsen : vim online]]
1310 For instructions on how to set it up, please see [[http://mid.gmane.org/EA275862-B97A-4BAC-B879-177FD07A2D56@gaillourdet.net][this mailing list
1313 Work is also underway on an org-mode clone for Vim. You can check it
1316 https://github.com/hsitz/VimOrganizer
1320 :CUSTOM_ID: Todos-and-Tags
1322 ** How can I cycle through the TODO keyword of an entry?
1324 :CUSTOM_ID: cycle-TODO-keywords
1327 =C-c C-t= or =S-<left/right>= is what you need.
1329 ** How do I track state changes for tasks in Org?
1331 :CUSTOM_ID: track-state-changes-for-tasks
1334 Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/6082][post by Bernt Hansen]] for setting up TODO keyword
1335 states and logging timestamps for task state changes.
1337 ** Can I select the TODO keywords with a tag-like interface?
1339 :CUSTOM_ID: select-TODO-keywords-with-tag-like-interface
1342 Yes. Use =(setq org-use-fast-todo-selection t)=
1344 If you want to set both your todos and your tags using a single
1345 interface, then check out the variable
1346 =org-fast-tag-selection-include-todo=.
1348 See [[http://orgmode.org/manual/Fast-access-to-TODO-states.html][this section of the manual]] for more details.
1350 ** How can I quickly set the tag of an entry?
1352 :CUSTOM_ID: quickly-set-tag-of-entry
1355 Use =C-c C-c= or =C-c C-q= on the headline. =C-c C-q= is useful for
1356 setting tabs in a [[http://orgmode.org/manual/Remember.html#Remember][remember]] buffer, since =C-c C-c= is the default
1357 keybinding for filing a note from the remember buffer.
1359 You can set tags even more quickly by setting one of the character
1360 shortcuts for [[http://orgmode.org/manual/Setting-tags.html#Setting-tags][fast tag selection]].
1362 To set tag shortcuts for all org buffers, put something like the
1363 following in your =.emacs= file (or create the same settings by
1364 typing =M-x customize-variable RET org-tag-alist=):
1366 : (setq org-tag-alist '(("computer" . ?c) ("office" . ?o) ("home" . ?h)))
1368 To set tag shortcuts for a single buffer, put something like the
1369 following at the top of your org file:
1371 : #+TAGS: computer(c) office(o) home(h)
1373 ** How can I change the colors of TODO keywords?
1375 You can use the variable org-todo-keyword-faces. Here are some sample
1378 #+begin_src emacs-lisp
1379 (setq org-todo-keyword-faces
1381 ("TODO" . (:foreground "firebrick2" :weight bold))
1382 ("WAITING" . (:foreground "olivedrab" :weight bold))
1383 ("LATER" . (:foreground "sienna" :weight bold))
1384 ("PROJECT" . (:foreground "steelblue" :weight bold))
1385 ("DONE" . (:foreground "forestgreen" :weight bold))
1386 ("MAYBE" . (:foreground "dimgrey" :weight bold))
1387 ("CANCELED" . shadow)
1391 If you want to change the color of all active todos or all inactive
1394 : M-x customize-face RET org-todo
1395 : M-x customize-face RET org-done
1397 You can also set values for each of these in your =.emacs= file:
1399 : (set-face-foreground 'org-todo "firebrick2")
1400 : (set-face-foreground 'org-done "forestgreen")
1404 :CUSTOM_ID: Hyperlinks
1406 ** Why do I have to confirm the execution of each shell/elisp link?
1408 :CUSTOM_ID: confirm-shell/elisp-link
1411 The confirmation is there to protect you from unwantingly execute
1412 potentially dangerous commands. For example, imagine a link
1414 : [[shell:rm -rf ~/*][Google Search]]
1416 In an Org-mode buffer, this command would look like /Google Search/,
1417 but really it would remove your home directory. If you wish, you can
1418 make it easier to respond to the query by setting
1420 : (setq org-confirm-shell-link-function 'y-or-n-p
1421 : org-confirm-elisp-link-function 'y-or-n-p).
1423 Then a single keypress will be enough to confirm those links. It is
1424 also possible to turn off this check entirely, but I strongly
1425 recommend against this. Be warned.
1427 ** Can I use RET or TAB to follow a link?
1429 :CUSTOM_ID: RET-or-TAB-to-follow-link
1434 : (setq org-return-follows-link t)
1435 : (setq org-tab-follows-link t)
1437 ** Can I keep mouse-1 clicks from following a link?
1439 :CUSTOM_ID: mouse-1-following-link
1442 Activating links with =mouse-1= is a new feature in Emacs 22, to make
1443 link behavior similar to other applications like web browsers. If
1444 you hold the mouse button down a bit longer, the cursor will be set
1445 without following the link. If you cannot get used to this behavior,
1446 you can (as in Emacs 21) use =mouse-2= to follow links and turn off
1447 link activation for =mouse-1= with
1449 : (setq org-mouse-1-follows-link nil)
1451 ** How can I get completion of file names when creating a link?
1453 :CUSTOM_ID: completion-of-file-links
1456 You can use org-insert-link with a prefix argument:
1460 You will be greeted with prompt in the minibuffer that allows for file
1461 completion using your preferred Emacs method for finding files.
1463 ** How can I use invisible targets within lists?
1465 :CUSTOM_ID: invisible-targets-in-lists
1468 The usual way of turning radio links invisible is to comment them, but
1469 Org comments need to be at the beginning of the line, which breaks list
1472 The workaround here is to add (INVISIBLE) after your <<target>>
1476 : 11. <<target>>(INVISIBLE)
1478 : 12. More text [[target][go to]]
1480 ** Org-mode is not opening mailto links in my default mail client
1482 :CUSTOM_ID: mailto-links
1485 You can customize the function org-mode uses to open mailto links by
1486 setting the variable =org-link-mailto-program=:
1488 =M-x customize-variable org-link-mailto-program=
1490 The default function called is =browse-url=, which opens a mail
1491 composition buffer within Emacs. The type of buffer opened by
1492 browse-url depends on the setting of the variable =mail-user-agent=.
1493 Thus, if you want to ensure that mailto links use Gnus to open a
1494 message buffer, you could add the following to your =.emacs=:
1497 (setq mail-user-agent 'gnus-user-agent)
1500 ** Can I use CamelCase links?
1502 :CUSTOM_ID: CamelCase-links
1505 Yes, you can with the contributed package org-wikinodes.el. Please
1506 consult the [[http://orgmode.org/worg/org-contrib/org-wikinodes.html][documentation]].
1510 :CUSTOM_ID: Plain-Lists
1512 ** How can I insert an empty line before each newly inserted headline, but not before each newly inserted plain-list item?
1514 :CUSTOM_ID: empty-line-before-each-new-headline-but-not-item
1517 : (setq org-blank-before-new-entry
1518 : '((heading . t) (plain-list-item . nil))
1520 See also [[id:2463F4D8-F686-4CF3-AA07-08976F8A4972][Why is a blank line inserted after headlines and list items?]].
1522 ** How can I convert itemized lists to enumerated lists?
1524 :CUSTOM_ID: convert-itemized-to-enumerated-lists
1527 You can use =C-c -= or =S-<left>/<right>= to cycle through the various
1528 bullet headlines available for lists: =-, +, *, 1., 1)=.
1530 See [[http://orgmode.org/manual/Plain-lists.html#Plain-lists][this section of the manual]] for more information.
1532 ** How can I convert plain lists to headlines and vice versa?
1534 :CUSTOM_ID: convert-plain-lists-to-headlines
1537 To convert a plain list item or line to a headline, type =C-c *= on
1538 the headline. This will make the line a subheading of the current
1541 To convert a headline to a plain list item, type =C-c -= while the
1542 cursor is on the headline.
1544 To convert a headline to an unadorned line of text, type =C-c *= on
1547 You can use query replace to accomplish the same things, as Bernt
1548 Hansen explains in [[http://article.gmane.org/gmane.emacs.orgmode/10148][this mailing list post]].
1550 ** Is there a good way to create a description list?
1552 :CUSTOM_ID: description-lists
1555 Yes, these are now built-in:
1558 - item1 :: Description of this item 1
1559 - item2 :: Description of this item 2
1560 - item1 :: Description of this item 3
1561 also in multiple lines
1568 ** How can I make table alignment work with Asian character sets
1570 :CUSTOM_ID: table-alignment-asian-characters
1573 When table alignment fails, it usually has to do with character sets
1574 where some characters have non-integer width. Org will deal correctly
1575 with characters that are one or two or three ASCII characters wide,
1576 but not with characters that are, for example, 1.5 ASCII characters
1577 wide. To make table alignment work you need to switch to a different
1580 ** Can I plot data from a table?
1582 :CUSTOM_ID: plotting-table-data
1585 Yes, you can, using org-plot.el written by Eric Schulte and now
1586 bundled with Org. See [[http://orgmode.org/manual/Org_002dPlot.html#Org-Plot][the manual section about this]].
1588 See also [[file:org-tutorials/org-plot.org][this excellent tutorial]] by Eric Schulte.
1590 ** How can I fill a table column with incremental numbers?
1592 :CUSTOM_ID: fill-table-column-with-incremental-numbers
1595 Here is how: Use a field formula to set the first value in the column:
1607 Then define a column formula in the second field:
1619 After recomputing the table, the column will be filled with
1620 incremental numbers:
1629 ,#+TBLFM: $1=@-1 + 1::@2$1=1
1632 Note that you could use arbitrary starting values and column formulas.
1634 ** Why does my table column get filled with #ERROR?
1636 :CUSTOM_ID: table-column-filled-with-ERROR
1639 Org-mode tried to compute the column from other fields using a
1640 formula stored in the =#+TBLFM:= line just below the table, and
1641 the evaluation of the formula fails. Fix the fields used in the
1642 formula, or fix the formula, or remove it!
1644 ** How can I stop the table editor from creating new lines?
1646 :CUSTOM_ID: table-editor-creates-new-lines
1649 When I am in the last column of a table and just above a horizontal
1650 line in the table, pressing TAB creates a new table line before the
1651 horizontal line. To move to the line below the
1652 horizontal line instead, do this:
1654 Press =down= (to get on the separator line) and then =TAB=.
1655 Or configure the variable
1657 : (setq org-table-tab-jumps-over-hlines t)
1659 ** How can I get table fields starting with "="?
1661 :CUSTOM_ID: table-fields-starting-with-=
1666 : (setq org-table-formula-evaluate-inline nil)
1668 this will no longer happen. You can still use formulas using the
1669 commands @<tt>C-c =@</tt> and @<tt>C-u C-c =@</tt>
1671 ** How can I change the indentation of an entire table without fixing every line by hand?
1673 :CUSTOM_ID: change-indentation-entire-table
1676 The indentation of a table is set by the first line. So just fix the
1677 indentation of the first line and realign with =TAB=.
1679 ** In my huge table the realigning after each TAB takes too long. What can I do?
1681 :CUSTOM_ID: table-realigning-after-TAB-takes-long
1684 Either split the table into several by inserting an empty line every
1685 100 lines or so. Or turn off the automatic re-align with
1687 : (setq org-table-automatic-realign nil)
1689 After this the only way to realign a table is to press =C-c C-c=. It
1690 will no longer happen automatically, removing the corresponding delays
1693 ** Recalculation of my table takes too long. What can I do?
1695 :CUSTOM_ID: Recalculation-of-my-table-takes-too-long
1698 Nothing, really. The spreadsheet in org is mostly done to make
1699 calculations possible, not so much to make them fast. Since Org-mode
1700 is firmly committed to the ASCII format, nothing is stopping you from
1701 editing the table by hand. Therefore, there is no internal
1702 representation of the data. Each time Org-mode starts a computation,
1703 it must scan the table for special lines, find the fields etc. This
1704 is slow. Furthermore, Calc is slow compared to hardware
1705 computations. To make this work with normal editing, recalculation
1706 is not happening automatically, or only for the current line, so that
1707 the long wait for a full table iteration only happens when you ask
1710 So for really complex tables, moving to a "real" spreadsheet may
1711 still be the best option.
1713 That said, there are some ways to optimize things in Org-mode, and I
1714 have been thinking about moving a bit further down this line.
1715 However, for my applications this has so far not been an issue at
1716 all. If you have a good case, you could try to convince me.
1718 ** =S-RET= in a table keeps increasing the copied numbers. How can I stop this?
1720 :CUSTOM_ID: S-RET-in-a-table-increases-copied-numbers
1723 Well, it is /supposed/ to be a feature, to make it easy to create a
1724 column with increasing numbers. If this gets into your way, turn it
1727 : (setq org-org-table-copy-increment nil)
1729 ** When I export tables to html, they don't have borders.
1731 :CUSTOM_ID: table-borders-in-html-export
1734 By default, org mode exports tables without borders.
1736 You can changed this by placing an =#+ATTR_HTML= line before the
1739 : #+ATTR_HTML: border="2" rules="all" frame="all"
1741 See [[http://orgmode.org/manual/Tables-in-HTML-export.html#Tables-in-HTML-export][the manual]] for more details.
1743 ** Why does the Calc high precision (e. g. =p20=) not work like expected?
1745 :CUSTOM_ID: table-high-precision
1751 : | 1 / 2 * 3 | 0.16666667000000 |
1752 : #+TBLFM: $2 = $1; p20 %.14f
1755 : | 1 / 2 * 3 | 0.16666666666667 |
1756 : #+TBLFM: $2 = $1 +.0; p20 f-14
1760 It is important to distinguish between the precision of
1761 1) =p20=: Calc internal calculation (=calc-internal-prec=)
1762 2) =f-14=: Calc float formatting, unlimited in precision (=calc-float-format=)
1763 3) =%.14f=: the =printf= reformatting, limited in precision
1765 See [[http://orgmode.org/manual/Formula-syntax-for-Calc.html#Formula-syntax-for-Calc][the Org manual]] (org-version 6.35 or newer) for more details.
1767 Use =C-h v org-calc-default-modes RET= to check the Org default settings
1768 which are used if no format specifiers are added to a table formula.
1769 The examples below have been made with the out_of_the_box Org defaults
1770 =calc-internal-prec = 12= and =calc-float-format = 8=.
1772 Remember the formula debugger, toggled with =C-c {=,
1773 to view the processing stages like:
1774 | | formula debugger label | processing stage |
1776 |---+------------------------+----------------------------|
1777 | | Result: | output of Calc |
1778 | | Format: | reformatting with =printf= |
1780 Following are some examples to demonstrate
1781 the interaction of the three precisions.
1783 - *display precision limitations for Calc formulas*
1784 - limited by Calc internal calculation precision from Org default
1786 : | 0.16666666666700 |
1787 : #+TBLFM: $1 = 1 / 2 * 3; f-14
1789 : | 0.1666666666670000000 |
1790 : #+TBLFM: $1 = 1 / 2 * 3; f-19
1792 - limited by Calc float format from Org default (here =f8=)
1794 : #+TBLFM: $1 = 1 / 2 * 3
1797 : #+TBLFM: $1 = 1 / 2 * 3; p20
1799 : | 0.16666667000000 |
1800 : #+TBLFM: $1 = 1 / 2 * 3; %.14f
1802 : | 0.16666667000000 |
1803 : #+TBLFM: $1 = 1 / 2 * 3; p20 %.14f
1805 - limited by Calc float format specified
1807 : #+TBLFM: $1 = 1 / 2 * 3; f-6
1809 : | 0.16666666666667 |
1810 : #+TBLFM: $1 = 1 / 2 * 3; p20 f-14
1812 : | 0.1666666666666666667 |
1813 : #+TBLFM: $1 = 1 / 2 * 3; p20 f-19
1815 - limited by =printf= conversion to Emacs Lisp float
1816 : | 0.1666666699999999900 | the inaccuracy is platform dependent |
1817 : #+TBLFM: $1 = 1 / 2 * 3; %.19f
1819 : | 0.1666666699999999900 | the inaccuracy is platform dependent |
1820 : #+TBLFM: $1 = 1 / 2 * 3; p20 %.19f
1822 : | 0.1666666666666666600 | the inaccuracy is platform dependent |
1823 : #+TBLFM: $1 = 1 / 2 * 3; p20 f-20 %.19f
1825 - limited by =printf= format specified
1827 : #+TBLFM: $1 = 1 / 2 * 3; %.6f
1829 - *display precision limitations for Emacs Lisp formulas*
1830 - limited by Emacs Lisp float
1831 : | 0.16666666666666666 |
1832 : #+TBLFM: $1 = '(/ 1.0 (* 2 3))
1834 : | 0.1666666666666666574 | the inaccuracy is platform dependent |
1835 : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.19f
1837 - limited by =printf= format specified
1838 : | 0.16666666666667 |
1839 : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.14f
1841 This FAQ entry is based on this [[http://thread.gmane.org/gmane.emacs.orgmode/22642][mailing list thread]]
1842 and is continued in the [[#table-float-fraction][next FAQ entry]].
1844 ** Which float format shows the fraction part also when the latter is zero?
1846 :CUSTOM_ID: table-float-fraction
1853 : #+TBLFM: $2 = $1; f-3
1856 : #+TBLFM: $2 = $1 +.0; f-3
1860 For =f3= and =f-3= see =`d f' (`calc-fix-notation')= in [[http://www.delorie.com/gnu/docs/calc/calc.html#SEC_Top][the Calc manual]]
1861 in the section Mode Settings -> Display Modes -> Float Formats
1862 [[http://www.delorie.com/gnu/docs/calc/calc_163.html][found here as long as the section numbering is unchanged]].
1864 Remember the formula debugger, toggled with =C-c {=,
1865 to view the processing stages like:
1866 | | formula debugger label | processing stage |
1868 |---+------------------------+----------------------------|
1869 | | Result: | output of Calc |
1870 | | Format: | reformatting with =printf= |
1872 Following are some examples to demonstrate different float formats.
1875 : |-----------+---------+-------+---------+----------+-------|
1876 : | number | f3 | f-3 | +.0; f3 | +.0; f-3 | %.3f |
1877 : |-----------+---------+-------+---------+----------+-------|
1878 : | 1 | 1 | 1 | 1.000 | 1.000 | 1.000 |
1879 : | 0 | 0 | 0 | 0.000 | 0.000 | 0.000 |
1880 : |-----------+---------+-------+---------+----------+-------|
1881 : | 1.0 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
1882 : | 0.0 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
1883 : |-----------+---------+-------+---------+----------+-------|
1884 : | 1.0001666 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
1885 : | 0.0001666 | 1.67e-4 | 0.000 | 1.67e-4 | 0.000 | 0.000 |
1886 : |-----------+---------+-------+---------+----------+-------|
1887 : | 1.0016666 | 1.002 | 1.002 | 1.002 | 1.002 | 1.002 |
1888 : | 0.0016666 | 0.002 | 0.002 | 0.002 | 0.002 | 0.002 |
1889 : |-----------+---------+-------+---------+----------+-------|
1890 : #+TBLFM: $2 = $1; f3 :: $3 = $1; f-3 :: $4 = $1 +.0; f3 :: $5 = $1 +.0; f-3 :: $6 = $1; %.3f
1893 : |----------------------+--------------------------+-----------------------|
1894 : | number | f19 | f-19 |
1895 : |----------------------+--------------------------+-----------------------|
1898 : |----------------------+--------------------------+-----------------------|
1899 : | 1.0 | 1.0000000000000000000 | 1.0000000000000000000 |
1900 : | 0.0 | 0.0000000000000000000 | 0.0000000000000000000 |
1901 : |----------------------+--------------------------+-----------------------|
1902 : | 1 + 1 / 2 * 3 * 1e19 | 1.0000000000000000000 | 1.0000000000000000000 |
1903 : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
1904 : |----------------------+--------------------------+-----------------------|
1905 : | 1 + 1 / 2 * 3 * 1e18 | 1.0000000000000000002 | 1.0000000000000000002 |
1906 : | 0 + 1 / 2 * 3 * 1e18 | 0.0000000000000000002 | 0.0000000000000000002 |
1907 : |----------------------+--------------------------+-----------------------|
1908 : #+TBLFM: $2 = $1; p20 f19 :: $3 = $1; p20 f-19
1910 : |----------------------+--------------------------+-----------------------|
1911 : | number | +.0; f19 | +.0; f-19 |
1912 : |----------------------+--------------------------+-----------------------|
1913 : | 1 | 1.0000000000000000000 | 1.0000000000000000000 |
1914 : | 0 | 0.0000000000000000000 | 0.0000000000000000000 |
1915 : |----------------------+--------------------------+-----------------------|
1916 : | 1.0 | 1.0000000000000000000 | 1.0000000000000000000 |
1917 : | 0.0 | 0.0000000000000000000 | 0.0000000000000000000 |
1918 : |----------------------+--------------------------+-----------------------|
1919 : | 1 + 1 / 2 * 3 * 1e19 | 1.0000000000000000000 | 1.0000000000000000000 |
1920 : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
1921 : |----------------------+--------------------------+-----------------------|
1922 : | 1 + 1 / 2 * 3 * 1e18 | 1.0000000000000000002 | 1.0000000000000000002 |
1923 : | 0 + 1 / 2 * 3 * 1e18 | 0.0000000000000000002 | 0.0000000000000000002 |
1924 : |----------------------+--------------------------+-----------------------|
1925 : #+TBLFM: $2 = $1 +.0; p20 f19 :: $3 = $1 +.0; p20 f-19
1927 The =printf= reformatting (=%.19f=) cannot be used with high precision,
1928 see the [[#table-high-precision][previous FAQ entry]].
1930 ** How can I center tables in LaTeX output?
1932 :CATEGORY: centered-tables-in-latex
1935 Set the `org-export-latex-tables-centered' to `t':
1937 : (defcustom org-export-latex-tables-centered t
1938 : "When non-nil, tables are exported in a center environment."
1939 : :group 'org-export-latex
1944 :CUSTOM_ID: Footnotes
1946 ** How can I get automatic renumbering of footnotes in org-mode?
1948 :CUSTOM_ID: footnote-auto-adjust
1951 You can add the following line to your .emacs file:
1953 : (setq org-footnote-auto-adjust t)
1955 Or, if you prefer, you can turn this option on locally by placing the
1956 following line at the top of your org file:
1958 : #+STARTUP: fnadjust
1960 When auto-adjust is turned on, footnotes in the file with numerical
1961 labels will be renumbered whenever a new footnote is added. Meanwhile,
1962 all footnotes, including those with custom labels such
1963 =[fn:custom-label ]=, will be sorted in the order of their appearance
1966 This emulates the footnote behavior that many users may be familiar
1967 with from word-processing programs or from the footnote-mode included
1970 If you do not turn on org-footnote-auto-adjust, you sort and/or
1971 renumber footnotes at any time by calling org-footnote-action with a
1974 ** Why isn't auto renumbering of footnotes turned on by default?
1976 :CUSTOM_ID: why-no-default-auto-adjust
1979 Org mode has a very robust footnote mechanism allowing for a variety
1980 of types of footnotes. With some of the following footnote notations,
1981 auto-adjust may be either irrelevant or undesired:
1983 - Automatically numbered
1984 - Footnotes with custom labels
1987 In addition, org mode can be customized to place footnotes either at
1988 the end of a document or at the end of the outline heading in which
1989 they appear. Users who change this setting while editing a document
1990 may be disconcerted to find all of their footnotes rearranged
1993 ** I have auto-fill-mode set and org-mode is inserting unwanted comment markers!
1995 :CUSTOM_ID: auto-fill-and-unwanted-comments
1998 If the following occurs:
2008 Make sure that the variable comment-start is nil.
2010 ** Are there any shortcuts for entering source blocks and comment lines?
2012 :CUSTOM_ID: shortcuts-for-entering-source-blocks
2015 Org mode has some [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][very convenient markup]] for including literal blocks
2016 and lines of code in a file. (This is especially useful when exporting
2017 documents or using the contributed package [[file:org-contrib/babel/index.org][org-babel]] for executing
2022 , print "Hello, world!\n";
2026 It can be tiresome to enter the block comment lines manually. There
2027 are several possible shortcuts you can use to enter them:
2029 1) Built-in expansion
2031 - Org mode has a "secret" method of expanding source code blocks
2034 - If you type "<s" followed by =TAB= or =M-TAB=, a source block will
2037 - For a full list of expansions, type =M-x describe-variable
2038 [RET] org-structure-template-alist=.
2040 2) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Registers]]
2042 - Add the following line to your emacs file:
2044 =(set-register ?p "#+begin_src\n\n#+end_src perl")=
2046 - Then type =C-x r i p= to insert the source block. Please note: if
2047 you save another value to the register "p" with =C-x r s p=, it
2048 will overwrite the setting above for the current emacs session.
2050 3) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Abbrevs]]
2052 - Activate the abbrev minor-mode in org-mode:
2058 + =(add-hook 'org-mode-hook (lambda () (abbrev-mode 1)))=
2060 - In org-mode, type "sbp" (a sample abbreviation for a perl source
2063 - Immediately after "sbp" type =C-x a i l=.
2065 - Enter the expansion:
2067 - =#+begin_src perl[C-q C-j][C-q C-j]#+end_src=
2069 - Note: =C-q C-j= creates a new line in the minibuffer
2071 - Now, whenever, you type sbp followed by =SPACE= or =RET= in an
2072 org-mode buffer, the src block will magically appear.
2074 - To review your list of abbrevs, type =M-x edit-abbrevs=.
2076 4) [[http://www.slashgear.com/nokia-n900-android-dual-boot-hack-video-2371099/][Skeletons]]
2078 - Skeletons offer a simple way of automatically entering text.
2079 Here's a skeleton that queries for the type of block and wraps
2080 the active region inside it:
2083 (define-skeleton skel-org-block
2084 "Insert an org block, querying for type."
2091 - Simply type skel-org-block to insert the block.
2093 - You can bind this to a key.
2095 - You can also create an abbrev that invokes this function:
2097 : (define-abbrev org-mode-abbrev-table "blk" "" 'skel-org-block)
2099 5) [[http://code.google.com/p/yasnippet/][Yasnippet]]
2101 - Several org-mode users install yasnippet for convenient, complex
2104 - See Bernt Hansen's [[http://doc.norang.ca/org-mode.html#Yasnippets][org-mode setup]] for a good introduction to
2107 * Capture and remember
2109 :CUSTOM_ID: Remember
2111 ** Can I use a variable or a function inside the `org-capture-templates' variable?
2113 :CUSTOM_ID: variable-inside-capture-templates
2116 Yes. Use [[http://www.gnu.org/s/emacs/manual/html_node/elisp/Backquote.html][backquotes]].
2118 E.g. if you have a variable called =org-test-file= and you want the
2119 variable =org-capture-templates= to "understand" (i.e. evaluate)
2120 =org-test-file= when Emacs evaluates the =(setq org-capture-templates
2121 [...])= expression, use backquotes like this:
2123 #+begin_src emacs-lisp
2124 (setq org-capture-templates
2125 `(("t" "Todo" entry (file+headline ,org-test-file "Tasks")
2126 "* TODO %?\n %i\n %a")
2127 ("b" "Buy" item (file+olp ,org-test-file "Stuff to Buy" "House")
2131 ** Can I use the remember buffer to clock a customer phone call?
2133 :CUSTOM_ID: use-remember-buffer-to-clock-phone-call
2136 Yes, you can. Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/5482][setup described by Bernt Hansen]]
2137 and check out (in the same thread) what Nick Docos had to fix to
2138 make Bernt's set-up work for him.
2139 ** Can I automatically start the clock when opening a remember template?
2141 :CUSTOM_ID: start-clock-when-opening-remember-template
2144 Yes, this is possible. Use the following code and make sure that
2145 after executing it, `my-start-clock-if-needed' is in
2146 `remember-mode-hook' /after/ `org-remember-apply-template'.
2148 : (add-hook 'remember-mode-hook 'my-start-clock-if-needed 'append)
2149 : (defun my-start-clock-if-needed ()
2151 : (goto-char (point-min))
2152 : (when (re-search-forward " *CLOCK-IN *" nil t)
2153 : (replace-match "")
2156 Then, when a template contains the key string CLOCK-IN, the clock
2157 will be started. Starting with Org-mode version 5.20, the clock will
2158 automatically be stopped when storing the remember buffer.
2162 :CUSTOM_ID: Searches
2164 ** Isearch does not find string hidden in links. What can I do?
2166 :CUSTOM_ID: isearch-in-links
2169 M-x =visible-mode= will display the full link, making them searchable.
2171 ** How can I reduce the amount of context shown in sparse trees?
2173 :CUSTOM_ID: context-in-sparse-trees
2176 Take a look at the following variables:
2178 - =org-show-hierarchy-above=
2179 - =org-show-following-headline=
2180 - =org-show-siblings=
2181 - =org-show-entry-blow=
2183 which give command-dependent control over how much context is shown
2184 by a particular operation.
2186 ** How can I combine the results of two calls to =org-occur=?
2188 :CUSTOM_ID: two-calls-to-org-occur
2191 You can construct a regular expression that matches all targets you
2192 want. Alternatively, use a =C-u= prefix with the second and any
2193 further calls to =org-occur= to keep the current visibility and
2194 highlighting in addition to the new ones.
2200 ** How can I change the advanced warning time for deadlines?
2202 :CUSTOM_ID: warning-period-for-deadlines
2204 ##<<warning-period-for-deadlines>>
2206 Deadline warnings appear in the daily agenda view a specified number
2207 of days before the deadline is due. The default setting is 14 days.
2208 You can change this with the variable =org-deadline-warning-days=.
2209 (See [[http://orgmode.org/manual/Deadlines-and-scheduling.html#Deadlines-and-scheduling][this section]] of the manual.)
2213 : (setq org-deadline-warning-days 30)
2215 would cause warnings for each deadline to appear 30 days in advance.
2217 Naturally, you might not want warnings for all of your deadlines to
2218 appear so far in advance. Thus, you can change the lead time for
2219 individual items as follows:
2221 : * TODO Get a gift for the party
2222 : DEADLINE: <2009-01-16 Fri -2d>
2224 The "-2d" above changes the lead time for this deadline warning to two
2225 days in advance. You can also use "w" for weeks and "m" for months.
2226 ** How can I postpone a task until a certain date?
2228 :CUSTOM_ID: deferring-tasks
2231 The easiest way to postpone a task is to schedule it in the future.
2232 For instance, typing =C-c C-s +2w= on a headline will push a task two
2233 weeks into the future, so that it won't show up on the daily agenda
2234 until two weeks from now.
2236 If you'd like to prevent the task from showing up on your global todo
2237 list, you have a couple of options.
2239 1. You can set the variable =org-agenda-todo-ignore-scheduled= to =t=.
2240 This will exclude any scheduled items from your global list of
2241 active todos (=C-c a t=). (The variable
2242 =org-agenda-todo-ignore-with-date= will exclude both scheduled and
2243 deadline items from your todo list).
2244 2. You can remove the todo keyword from the item (C-c C-t <SPC>). The
2245 item will still appear on your agenda two weeks from today, but it
2246 won't show up on your todo lists.
2247 ** Can I send myself an email containing tasks or other agenda info?
2249 :CUSTOM_ID: email-containing-tasks-or-other-agenda-info
2252 Yes. See [[http://article.gmane.org/gmane.emacs.orgmode/6112][this thread]] on the list.
2254 ** How can I limit the agenda view to my "work" tasks?
2256 :CUSTOM_ID: limit-agenda-with-tag-filtering
2259 It is often convenient to group org files into separate categories,
2260 such as "home" and "work" (or "personal" and "professional"). One
2261 of the main reasons for such classification is to create agenda
2262 views that are limited by type of work or area of responsibility.
2263 For instance, while at work, one may want to see only professional
2264 tasks; while away from work, one may want to see only personal
2267 One way to categorize files and tasks is to use a "#+FILETAGS"
2268 declaration at the top of each file, such as:
2272 As long as org-use-tag-inheritance is turned on, the filetags will
2273 be inherited by all tasks in the file. A file can have multiple
2274 filetags. And, of course, tags can be added to individual headings.
2276 Tasks can be quickly filtered by tag from within the agenda by
2277 typing "/" and the name of the tag. The full key sequence to filter
2278 for work items in an agenda view would be:
2280 : C-c a a / work [or a tag shortcut]
2282 ** How can I limit the agenda view to a particular category?
2284 :CUSTOM_ID: limit-agenda-with-category-match
2287 Another way to filter agenda views by type of work is to use a
2288 "#+CATEGORY" declaration at the top of each file, such as:
2292 Categories can also be added to individual headings within a file:
2299 All todos belonging to the category "work" can be found a with a
2300 simple tags-todo search:
2304 At the prompt, type:
2308 The same results can be achieved with custom agenda commands, such as:
2310 #+BEGIN_SRC emacs-lisp
2311 (setq org-agenda-custom-commands
2312 '(("h" tags-todo "CATEGORY=\"home\"")
2313 ("w" tags-todo "CATEGORY=\"work\"")
2314 ;; other custom agenda commands here
2318 ** How can include all org files in a directory in my agenda?
2320 :CUSTOM_ID: set-agenda-files-using-wildcards
2323 You can simply include the directory (as one of the items) in the
2324 value of the variable org-agenda-files:
2326 : (setq org-agenda-files '("/my/special/path/org/"))
2328 There is another way of accomplishing the same end:
2330 : (setq org-agenda-files (file-expand-wildcards "/my/special/path/org/*.org"))
2332 ** Why aren't items disappearing from my agenda once they are marked done?
2334 :CUSTOM_ID: removing-done-items-from-agenda
2337 If items remain on your daily/weekly agenda after they are marked
2338 done, check the configuration of the following variables:
2340 : org-agenda-skip-scheduled-if-done
2341 : org-agenda-skip-deadline-if-done
2342 : org-agenda-skip-timestamp-if-done
2346 : M-x customize-variable RET org-agenda-skip-scheduled-if-done
2348 If this variable is turned off (=nil=), then scheduled items will
2349 remain on the agenda even after they are marked done.
2351 If the variable is turned on (=t=), then scheduled items will
2352 disappear from the agenda after they are marked done.
2354 If these settings seem not to behave the way you expect, then make
2355 sure you understand [[scheduled-vs-deadline-vs-timestamp][the
2356 difference between SCHEDULED, DEADLINE, and timestamps]].
2358 ** What is the difference between SCHEDULED, DEADLINE, and plain timestamps?
2360 :CUSTOM_ID: scheduled-vs-deadline-vs-timestamp
2363 1. SCHEDULED items (set with =C-c C-s=) will appear on your agenda on
2364 the day they are scheduled and on every day thereafter until they
2365 are done. Schedule a task if you want to be reminded to do
2366 something beginning on a certain day and until it is done.
2368 : ** TODO Scheduled item
2369 : SCHEDULED: <2009-03-01 Sun>
2371 2. Items with a DEADLINE timestamp (set with =C-c C-d=) appear on your
2372 agenda in advance of the when they are due and remain on your
2373 agenda until they are done. Add a DEADLINE to an item if you want
2374 to make sure to complete it by a certain date. (The variable
2375 org-deadline-warning-days determines how far in advance items with
2376 deadlines will show up in the agenda. See [[warning-period-for-deadlines][this FAQ]] for more
2379 : ** TODO Item with a deadline
2380 : DEADLINE: <2009-01-20 Tue>
2382 3. An active timestamp (set with =C-c .=) will appear on your agenda
2383 only on the day it is scheduled. Use a timestamp for appointments
2384 or any reminders you want to show up only on a particular day.
2386 : ** TODO Item with an active timestamp
2389 Note: items with inactive timestamps (set with C-c ! and marked by
2390 square brackets) will not show up in the agenda at all.
2392 ** Can I add files recursively to my list of agenda files?
2394 :CUSTOM_ID: set-agenda-files-recursively
2397 Yes, you can use the library "find-lisp."
2399 : (load-library "find-lisp")
2400 : (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$"))
2402 This will add all files ending in =org= in the directory "~/org"
2403 and all of its subdirectories to your list of agenda files.
2405 See [[http://thread.gmane.org/gmane.emacs.orgmode/8992][this thread]] on the mailing list for more information.
2407 ** Why does an item appearing at the wrong time of day in my agenda?
2409 :CUSTOM_ID: agenda-wrong-time-of-day
2412 When preparing the agenda view, org-mode scans each relevant headline
2413 for a time designation. This approach is very nice for adding
2414 free-form timestamps to an item for scheduling. Thus, either of the
2415 following work would work to schedule an item at 10:00am:
2418 ,** 10:00am Get dried ice at the magic store
2419 , SCHEDULED: <2009-05-27 Wed>
2423 ,** Get dried ice at the magic store
2424 , SCHEDULED: <2009-05-27 Wed 10:00>
2427 To enable this flexibility, org-mode scans the entire headline for
2428 time of day notation. A potential problem can arise if you use
2429 inactive timestamps in the headline to note when an item was created.
2433 ,** Get dried ice at the magic store [2009-05-26 Tue 12:58]
2434 , SCHEDULED: <2009-05-27 Wed>
2437 Org mode would interpret the time in the inactive timestamp as a
2438 time-of-day indicator and the entry would appear in your agenda at
2441 If you would like to turn off the time-of-day search, you can
2442 configure the variable =org-agenda-search-headline-for-time= (requires
2445 ** How can I change the visibility of an item from the agenda?
2447 :CUSTOM_ID: cycling-visibility-from-agenda
2450 You can add a keybinding as follows:
2452 #+begin_src emacs-lisp
2453 (add-hook 'org-agenda-mode-hook
2455 (define-key org-agenda-mode-map " " 'org-agenda-cycle-show)))
2458 Then, as you press SPACE on an item on the agenda, it will cycle the
2459 visibility of its original location.
2461 ** Is there any way to set org-mode so that tags don't appear in the agenda view?
2463 See the =org-agenda-remove-tags= variable.
2465 ** I work late at night! How can I extend my current day past midnight?
2467 :CUSTOM_ID: org-extend-today-until
2470 If you work past midnight, you may not want your daily agenda view to
2471 switch to the next day at 12 a.m. (the default). To extend your day,
2472 simply set the value of org-extend-today-until to a positive number
2473 corresponding to the number of hours you work past midnight. For
2474 example, the following setting will cause the current day to extend
2477 : (setq org-extend-today-until 6)
2479 * Appointments/Diary
2481 :CUSTOM_ID: Appointments/Diary
2483 ** Is it possible to include entries from org-mode files into my emacs diary?
2485 :CUSTOM_ID: include-entries-from-org-mode-files-into-emacs-diary
2488 Since the org-mode agenda is much more powerful and can contain the
2489 diary, you should think twice before deciding to do this. If you
2490 insist, however, integrating Org-mode information into the diary is
2491 possible. You need to turn on /fancy diary display/ by setting in
2494 : (add-hook 'diary-display-hook 'diary-fancy-display)
2496 Then include the following line into your ~/diary file, in
2497 order to get the entries from all files listed in the variable
2502 You may also select specific files with
2504 : &%%(org-diary) ~/path/to/some/org-file.org
2505 : &%%(org-diary) ~/path/to/another/org-file.org
2507 If you now launch the calendar and press @<tt>d@</tt> to display a
2508 diary, the headlines of entries containing a timestamp, date range,
2509 schedule, or deadline referring to the selected date will be listed.
2510 Just like Org-mode's agenda view, the diary for /today/ contains
2511 additional entries for overdue deadlines and scheduled items. See
2512 also the documentation of the =org-diary= function. Under XEmacs, it
2513 is not possible to jump back from the diary to the org, this works
2514 only in the agenda buffer.
2515 ** I want to add my Org scheduled/deadlined entries in my diary!
2517 :CUSTOM_ID: add-Org-scheduled/deadlined-entries-to-diary!
2520 Put this in your ~/.diary:
2522 : &%%(org-diary :scheduled :timestamp :deadline)
2524 ** How can I set up automatic reminders based on Org information?
2526 :CUSTOM_ID: automatic-reminders
2529 See [[http://article.gmane.org/gmane.emacs.orgmode/5271][this post]] by N. Dokos on the list.
2530 ** How can I make =appt= notice my Org appointments?
2532 :CUSTOM_ID: appt-notice-my-Org-appointments
2535 : M-x org-agenda-to-appt RET
2537 ** How can I create more complex appointments in my org-files?
2539 :CUSTOM_ID: diary-sexp-in-org-files
2542 Org-mode's active timestamps work very well for scheduling individual
2543 or recurring appointments, such as:
2546 ,* 8:00am Dentist appointment <2009-01-16 Fri>
2552 , <2009-03-20 Fri>--<2009-04-01 Wed>
2558 ,* Weekly meeting with boss
2559 , <2009-01-20 Tue 14:00 +1w>
2562 Sometimes, however, you need to set up more complicated recurring
2563 appointments. Org-mode has built-in support for many of
2564 [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Sexp-Diary-Entries.html][the
2565 powerful sexp entries]] that work in [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Diary.html#Diary][Emacs diary]]. Let's say, for
2566 instance, that you teach a class that meets every Monday evening
2567 between February 16 and April 20, 2009. The way to enter this an
2571 ,** Class 7:00pm-9:00pm
2572 , <%%(and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009))>
2575 The expression above designates all Mondays that fall between February
2576 16 and April 20. How exactly does it work?
2578 - (and... :: Indicates that *both* of the conditions that follow have
2581 - (= 1 (calendar-day-of-week date)) :: Is the day of the week a
2584 - Note: the function calendar-day-of-week converts the date to the day of week
2585 expressed in numeric form, where 0 = Sunday, 1 = Monday, and so on.
2587 - (diary-block 2 16 2009 4 20 2009) :: Does the date fall between
2590 You can make a sexp as complex as you like. If you wanted to omit a
2591 week because of holidays, for instance, you could add another
2592 condition to the sexp:
2595 ,** Class 7:00pm-9:00pm
2596 , <%%(unless (diary-block 3 9 2009 3 13 2009) (and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009)))>
2599 The sexp above would omit Monday during the week of March 9, 2009. For
2600 another way to accomplish the same thing, see [[org-diary-class][this FAQ]].
2602 Another diary function commonly used for more complex scheduling is
2603 diary-float. For instance,
2607 , <%%(diary-float t 3 3)>
2610 ...would appear on the third Wednesday of every month.
2612 For more ideas on how to create diary special expressions, see [[http://www.emacswiki.org/cgi-bin/wiki/DiaryMode][this
2613 page on the Emacs wiki]].
2615 ** How can I schedule a weekly class that lasts for a limited period of time?
2617 :CUSTOM_ID: org-diary-class
2620 Org-mode offers a convenient diary sexp function for setting up a
2621 recurring appointment that lasts for a certain period of time, such as
2622 a class. It is called org-diary-class and it can be entered as
2626 ,** Class 7:00pm-9:00pm
2627 , <%%(org-diary-class 2 16 2009 4 20 2009 1 10)>
2630 The function above schedules an appointment for every Monday (1)
2631 between February 16 and April 20, 2009, except for ISO week 10 (March
2634 The function org-diary-class has the following format:
2636 : (org-diary-class M1 D1 Y1 M2 D2 Y2 DAYNAME &rest SKIP-WEEKS)
2638 M1/2, D1/2, and Y1/2 indicate the beginning and ending dates. Dayname
2639 takes the form of a number indicating the day of the week (0 = Sunday,
2640 1 = Monday, and so on...). In addition, one can add an optional
2641 argument SKIP-WEEKS to indicate weeks on the calendar that should be
2642 skipped. This argument should be expressed as an ISO week number. You
2643 can find the number by invoking emacs' built-in calendar (=M-x
2644 calendar=), navigating to the appropriate week, and typing =p c=
2645 (calendar-iso-print-date).
2647 Please note: the order of the month, day, and year arguments depends
2648 on the variables =calendar-date-style= and/or
2649 =european=calendar=style=. (See the documentation for these variables
2650 with C-h v or M-x describe variable.) For instance, the example above
2651 works if =calendar-date-style= is set to ='american=. If
2652 =calendar-date-style= is set to ='iso=, then the arguments to the
2653 org-diary-class sexp would have the following format:
2655 : (org-diary-class Y1 M1 D1 Y2 M2 D2 DAYNAME &rest SKIP-WEEKS)
2657 Here is an alternative method, shared by Paul Sexton on the org
2660 Let's say you are taking night classes in Spanish. The class is every
2661 Wednesday evening at 7pm, starting on 18 August, and runs for 8 weeks.
2662 Org-mode's timestamps do not support limited occurrences of recurrent
2663 items -- you have to schedule the item with infinite recurrences, then
2664 delete it when it finishes.
2666 To schedule the Spanish classes, put the following in your =.emacs=:
2668 #+begin_src emacs-lisp
2669 (defun diary-limited-cyclic (recurrences interval m d y)
2670 "For use in emacs diary. Cyclic item with limited number of recurrences.
2671 Occurs every INTERVAL days, starting on YYYY-MM-DD, for a total of
2672 RECURRENCES occasions."
2673 (let ((startdate (calendar-absolute-from-gregorian (list m d y)))
2674 (today (calendar-absolute-from-gregorian date)))
2675 (and (not (minusp (- today startdate)))
2676 (zerop (% (- today startdate) interval))
2677 (< (floor (- today startdate) interval) recurrences))))
2679 The item in the org file looks like this:
2682 ,** 19:00-21:00 Spanish lessons
2683 , <%%(diary-limited-cyclic 8 7 8 18 2010)>
2686 ** How can I set an event to occur every day except Saturday and Sunday?
2690 , <%%(memq (calendar-day-of-week date) '(1 2 3 4 5))>
2693 ** How do I schedule events relative to Easter Sunday?
2695 Easter's date moves around from year to year according to a
2696 complicated set of criteria which I do not claim to understand.
2697 However the following code will allow you to schedule recurring
2698 events relative to Easter Sunday.
2700 Note: the function da-easter is from:
2701 http://github.com/soren/elisp/blob/master/da-kalender.el
2703 Put the following in your .emacs:
2705 #+begin_src emacs-lisp
2706 (defun da-easter (year)
2707 "Calculate the date for Easter Sunday in YEAR. Returns the date in the
2708 Gregorian calendar, ie (MM DD YY) format."
2709 (let* ((century (1+ (/ year 100)))
2710 (shifted-epact (% (+ 14 (* 11 (% year 19))
2711 (- (/ (* 3 century) 4))
2712 (/ (+ 5 (* 8 century)) 25)
2715 (adjusted-epact (if (or (= shifted-epact 0)
2716 (and (= shifted-epact 1)
2717 (< 10 (% year 19))))
2720 (paschal-moon (- (calendar-absolute-from-gregorian
2723 (calendar-dayname-on-or-before 0 (+ paschal-moon 7))))
2726 (defun da-easter-gregorian (year)
2727 (calendar-gregorian-from-absolute (da-easter year)))
2729 (defun calendar-days-from-easter ()
2730 "When used in a diary sexp, this function will calculate how many days
2731 are between the current date (DATE) and Easter Sunday."
2732 (- (calendar-absolute-from-gregorian date)
2733 (da-easter (calendar-extract-year date))))
2736 Now we can schedule the public holidays associated with Easter as
2737 recurring events. Good Friday is 2 days before "Easter", Easter
2738 Monday is one day after.
2742 , <%%(= -2 (calendar-days-from-easter))>
2745 , <%%(= 0 (calendar-days-from-easter))>
2748 , <%%(= 1 (calendar-days-from-easter))>
2750 [Source: Posted by Paul Sexton on Org-mode mailing list.]
2752 ** How to schedule public holiday that is "the nearest Monday to DATE"?
2754 In New Zealand each regional capital has an "Anniversary Day". The
2755 date of Auckland's anniversary day is "the nearest Monday to 29
2758 Put this in your =.emacs=:
2760 #+begin_src emacs-lisp
2761 (defun calendar-nearest-to (target-dayname target-day target-month)
2762 "Recurring event that occurs in the nearest TARGET-DAYNAME to
2763 the date TARGET-DAY, TARGET-MONTH each year."
2765 (let* ((dayname (calendar-day-of-week date))
2766 (target-date (list target-month target-day (calendar-extract-year date)))
2767 (days-diff (abs (- (calendar-day-number date)
2768 (calendar-day-number target-date)))))
2769 (and (= dayname target-dayname)
2773 Now we can schedule Auckland Anniversary Day. The first argument,
2774 1, means Monday (days of the week are numbered starting with
2777 [Source: Originally posted by Paul Sexton on Org-mode mailing list.]
2779 ** How to schedule public holiday on "the 4th Monday in October"?
2781 This does not require any additions to =.emacs=:
2785 , <%%(diary-float 10 1 4)>
2788 ** Why isn't the agenda showing all the times I put under a single entry?
2790 :CATEGORY: multiple-timestamps-same-entry
2793 Probably because you have not set the following variable:
2795 : org-agenda-skip-additional-timestamps-same-entry
2797 The default value of this variable is t, which means that entries with
2798 multiple timestamps, such as the following...
2801 ,* Work really, really hard
2802 , <2010-11-20 Sat 10:00>
2803 , <2010-11-20 Sat 14:00>
2806 ...will only appear in the agenda at the time specified by the first
2807 timestamp. If you set org-agenda-skip-additional-timestamps-same-entry
2808 to nil, the item will appear will appear at all the times you specify.
2814 ** Can I get TODO items exported to HTML as lists, rather than as headlines?
2816 :CUSTOM_ID: export-TODO-items-as-lists
2819 If you plan to use ASCII or HTML export, make sure things you want to
2820 be exported as item lists are level 4 at least, even if that does
2821 mean there is a level jump. For example:
2823 : * Todays top priorities
2824 : **** TODO write a letter to xyz
2825 : **** TODO Finish the paper
2826 : **** Pick up kids at the school
2828 Alternatively, if you need a specific value for the heading/item
2829 transition in a particular file, use the =#+OPTIONS= line to
2830 configure the H switch.
2832 : #+OPTIONS: H:2; ...
2834 ** Can I export only a single subtree?
2836 :CUSTOM_ID: export-single-subtree
2839 If you want to export a subtree, mark the subtree as region and then
2840 export. Marking can be done with =C-c @ C-x C-x=, for example.
2842 Alternatively, you can select option =1= in the org export dispatcher
2843 (e.g.., =C-c C-e 1 h= to export the current subtree to html).
2845 By default, the title of the exported file will be set to the heading
2846 of the subtree. You can, however, [[#export-options-for-subtree][customize the title and other export
2849 ** How can I customize export options for a single subtree?
2851 :CUSTOM_ID: export-options-for-subtree
2854 You can set unique export options for a [[#export-single-subtree][single subtree]] by using
2855 properties. Relevant properties include:
2861 - EXPORT_OPTIONS (corresponds to the =#+OPTIONS:= [[http://orgmode.org/manual/Export-options.html#Export-options][configuration line]])
2863 ** How can I tell my calendar web application about appointments in my agenda files?
2865 Here is what you need to do:
2867 1. a script that calls Emacs in batch mode and produce a .ics file
2868 2. a script that uploads this .ics file somewhere on the web
2869 3. tell your webapp to fetch this .ics file on the web
2871 Here is the script I use for the first step:
2873 #+begin_src shell-script-mode
2876 /usr/local/bin/emacs --batch --eval \
2877 "(progn (load-file \"~/install/git/org-mode/org.el\") \
2878 (load-file \"~/elisp/config/org-batch-config.el\") \
2879 (setq org-combined-agenda-icalendar-file \"~/org/cal/org.ics\")
2880 (setq org-agenda-files (quote (\"~/org/bzg.org\"))))" \
2881 -f org-export-icalendar-combine-agenda-files
2884 Depending on your configuration, you might change the load sequence.
2886 Here is the script I use for the second step:
2888 #+begin_src shell-script-mode
2890 /usr/bin/rsync -rtv ~/org/org.ics -e ssh me@my_server:/home/me/public_html/
2893 Note: if you want to cron this rsync script, you will need to let
2894 =my_server= to know about your SSH public key. Check [[http://troy.jdmz.net/rsync/index.html][this page]] as a
2897 Now you can cron the two scripts above and your webapp will always be
2898 up to date with your Org agendas.
2900 Also see [[http://orgmode.org/org.html#Exporting-Agenda-Views][Exporting agenda views]] from Org manual.
2902 ** How can I get Mac OSX 10.3 iCal to import my Org-exported .ics files?
2904 :CUSTOM_ID: iCal-import-ics-files-old
2907 When using iCal under Apple MacOS X Tiger, you can create a new
2908 calendar /OrgMode/ (the default name for the calendar created by =C-c
2909 C-e c=, see the variables =org-icalendar-combined-name= and
2910 =org-combined-agenda-icalendar-file=). Then set Org-mode to
2911 overwrite the corresponding file /~/Library/Calendars/OrgMode.ics/.
2912 You may even use AppleScript to make iCal re-read the calendar files
2913 each time a new version of /OrgMode.ics/ is produced. Here is the
2914 setup needed for this:
2916 : (setq org-combined-agenda-icalendar-file
2917 : "~/Library/Calendars/OrgMode.ics")
2918 : (add-hook 'org-after-save-iCalendar-file-hook
2921 : "osascript -e 'tell application \"iCal\" to reload calendars'")))
2923 ** How can I get Mac OSX 10.4 or later iCal to import my Org-exported .ics files?
2925 :CUSTOM_ID: iCal-import-ics-files-new
2928 For Mac OS X 10.4, you need to write the ics file to
2929 =/Library/WebServer/Documents/= and then subscribe iCalendar to
2930 =http: //localhost/orgmode.ics=
2932 ** How can I remove timestamps and todo keywords from my exported file?
2934 :CUSTOM_ID: export-options-remove-timestamps
2937 You can place an options line at the top of your org file:
2939 : #+OPTIONS: <:nil todo:nil
2941 There is a whole host of export options you can set with an in-buffer
2942 options or via global variables. See [[http://orgmode.org/manual/Export-options.html#Export-options][this section]] of the manual for a
2945 ** How can I preserve faces when I export an agenda from the command line?
2947 :CUSTOM_ID: preserving-faces-during-batch-export
2950 Normally, when you export an org file or an agenda view from within
2951 emacs, htmlize will convert your face definitions to direct color css
2952 styles inlined into each =<span>= object, resulting in an HTML output
2953 that preserves the general look of your Org buffers and agenda views.
2955 Let's say you generate an export from the command line, such as the
2958 : emacs -batch -l ~/.emacs -eval '(org-batch-agenda "e")'
2962 : emacs -batch -l ~/.emacs -eval '(org-publish-all)'
2964 In such an instance, the exported HTML will contain only very basic
2965 color styles. The reason is that when Emacs is run in batch mode, it
2966 does not have a display and therefore only rudimentary face
2967 definitions. If you'd like to use more complex styles, you'll have to
2968 make sure that the export process only assigns classes instead of
2969 direct color values. This can be done by binding the variable
2970 =org-export-htmlize-output-style= to =css= for the duration of the
2971 export, for example with
2973 : emacs -batch -l ~/.emacs
2974 : -eval '(let ((org-export-htmlize-generate-css (quote css)))
2975 : (org-batch-agenda "e"))'
2977 Then you can use a style file to make these classes look any way you
2978 like. To generate face definitions for a CSS file based on any faces
2979 you are currently using in Emacs, you can use the following command:
2981 : M-x org-export-htmlize-generate-css RET
2983 This will generate a =<style>...</style>= section, the content of
2984 which you can add to your style file.
2986 ** How can I avoid dark color background when exporting agenda to ps format?
2988 :CUSTOM_ID: avoiding-dark-background-when-exporting-agenda
2991 Add this to your .emacs and evaluate it.
2993 #+BEGIN_SRC emacs-lisp
2994 (setq org-agenda-exporter-settings
2995 '((ps-print-color-p 'black-white)))
2998 ** How can I include e.g. an abstract in export to Latex and HTML?
3000 :CUSTOM_ID: include-abstract-in-export-to-latex-and-html
3003 Org does not currently have special markup for abstracts, but for
3004 export purposes, you can extend the block-level structural and
3005 semantic markup in Org with the contributed package [[file:org-contrib/org-special-blocks.org][org-special-blocks]]
3006 (by Chris Gray). To turn it on, put this in your =.emacs=:
3008 : (require 'org-special-blocks)
3010 Now, you can mark up the abstract of your article like this:
3013 : Falling apples were observed and compared with pears. Newton's laws
3014 : were confirmed at the 95% confidence level.
3017 Exporting to Latex wraps this in a
3018 =\begin{abstract}....\end{abstract}= environment, which just works.
3020 HTML export wraps it in a ~<div class="abstract">...</div>~
3021 element. The HTML result won't look like anything special until you
3022 style it. Here is some sample CSS to get you started; put these in
3023 your document header:
3025 : #+STYLE: <style>.abstract {margin: 1em; padding: 1em; border: 1px solid black}
3026 : #+STYLE: .abstract:before {content: "Abstract: "; font-weight: bold}</style>
3028 Generally, =#+begin_foo= will work for any simple Latex =foo=
3029 environment not supported by existing Org markup.
3031 If you need to pass parameters, process the block content in some way,
3032 or support other exporters, you may want to consider whether you can
3033 customize it using Eric Schulte's [[file:org-contrib/org-exp-blocks.org][org-exp-blocks]] instead.
3035 ** How can I get colored source code when exporting to LaTeX?
3037 :CUSTOM_ID: fontified_source_code_w_latex
3040 As of Sun Aug 9 2009 the "current" version of Org-mode (see
3041 [[keeping-current-with-Org-mode-development]]) supports exporting
3042 source code to LaTeX using the listings package.
3044 To turn on listing export add the following to your Org-mode
3046 #+begin_src emacs-lisp
3047 ;; requite org-latex so that the following variables are defined
3048 (require 'org-latex)
3050 ;; tell org to use listings
3051 (setq org-export-latex-listings t)
3053 ;; you must include the listings package
3054 (add-to-list 'org-export-latex-packages-alist '("" "listings"))
3056 ;; if you want colored source code then you need to include the color package
3057 (add-to-list 'org-export-latex-packages-alist '("" "color"))
3060 The listings package will now be used to fontify source code in your
3061 LaTeX documents. By default listings will not color any of your
3062 source code. If you would like to set colors for keywords and
3063 comments in your latex documents you can do so using LaTeX directives
3066 \lstset{keywordstyle=\color{blue},
3067 commentstyle=\color{red},
3068 stringstyle=\color{green}
3072 of if you want to get even fancier with your colors you can try
3073 something like the following
3075 \definecolor{keywords}{RGB}{255,0,90}
3076 \definecolor{comments}{RGB}{60,179,113}
3077 \definecolor{fore}{RGB}{249,242,215}
3078 \definecolor{back}{RGB}{51,51,51}
3080 basicstyle=\color{fore},
3081 keywordstyle=\color{keywords},
3082 commentstyle=\color{comments},
3083 backgroundcolor=\color{back}
3087 For more complex listings use cases consult the [[ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/listings/listings.pdf][listings manual]].
3089 ** How can I export to Latex Beamer
3093 The latex [[http://latex-beamer.sourceforge.net/][Beamer Class]] is a useful class for generating slide shows.
3094 The following can be used to export Org-mode documents to LaTeX
3097 Add the following to your Emacs initialization file.
3098 #+begin_src emacs-lisp
3099 (unless (boundp 'org-export-latex-classes)
3100 (setq org-export-latex-classes nil))
3101 (add-to-list 'org-export-latex-classes
3103 "\\documentclass[11pt]{beamer}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{hyperref}\n\\usepackage{verbatim}\n"
3104 ("\\section{%s}" . "\\section*{%s}")
3105 ("\\begin{frame}\\frametitle{%s}" "\\end{frame}"
3106 "\\begin{frame}\\frametitle{%s}" "\\end{frame}")))
3110 : #+LaTeX_CLASS: beamer
3111 in the header of your Org-mode document it will automatically export
3112 to the Beamer document class on LaTeX export. With the above
3113 configuration top-level headers will be mapped to sections in the
3114 Beamer document, second-level headers will be mapped to frames, and
3115 lower level headlines will be mapped to itemize objects.
3117 This above is adapted from an [[http://article.gmane.org/gmane.emacs.orgmode/15077/match=beamer+dokos][email by Nick Dokos]], and an [[http://article.gmane.org/gmane.emacs.orgmode/17767/match=beamer+dokos][email by
3118 Thomas Dye]]. For a much more complex Beamer setup see the [[http://article.gmane.org/gmane.emacs.orgmode/17767/match=beamer+dokos][email by
3121 ** How can I use RefTeX in Org-mode files for LaTeX export and in Org-babel LaTeX code blocks?
3123 :CUSTOM_ID: using-reftex-in-org-mode
3126 [[http://www.gnu.org/software/auctex/reftex.html][RefTeX]] is an indispensable tool for the author of LaTeX documents. It
3127 aids in creation of bibliographies, cross-references, indexes, and
3128 glossaries. RefTeX understands the structure of multi-file LaTeX
3129 documents and is able to collect from them information about the
3130 location(s) of external data stores used in creation of the final
3131 document. RefTeX was written by Carsten Dominik and is currently
3132 being maintained by the [[http://www.gnu.org/software/auctex/index.html][AucTeX]] project.
3134 *** Using RefTeX In Org-mode Files for LaTeX Export
3135 In Org-mode files for LaTeX export, the trick is to find a way to tell
3136 RefTeX the locations of external data stores. One way is to set the
3137 variable, =reftex-default-bibliography=. Add lines like these to
3140 #+begin_src emacs-lisp
3141 (setq reftex-default-bibliography
3143 ("default.bib" "other-default.bib")))
3146 In practice, this is a limited solution and the
3147 typical user will want to pass this information on a per-file basis.
3148 Two solutions to this problem were posted on a blog, [[http://www.mfasold.net/blog/2009/02/using-emacs-org-mode-to-draft-papers/][Mario's
3151 The first solution, proposed by Mario, enables the RefTeX citation
3152 function in Org-mode. Add these lines to .emacs:
3154 #+begin_src emacs-lisp
3155 (defun org-mode-reftex-setup ()
3156 (load-library "reftex")
3157 (and (buffer-file-name)
3158 (file-exists-p (buffer-file-name))
3160 (define-key org-mode-map (kbd "C-c )") 'reftex-citation))
3161 (add-hook 'org-mode-hook 'org-mode-reftex-setup)
3164 Then add the following lines anywhere in the Org-mode file (Org-mode
3165 will recognize them as LaTeX commands):
3168 \bibliographystyle{plain}
3169 \bibliography{BIB-NAME}
3172 With this setup, =C-c )= will invoke =reftex-citation= which will
3173 insert a reference in the usual way:
3178 ,This is a citation \cite{tierney90}.
3180 ,\bibliographystyle{plain}
3184 This Org-mode file will export the following LaTeX output:
3186 #+begin_src latex :exports code
3187 % Created 2010-03-22 Mon 14:34
3188 \documentclass[11pt,letter]{article}
3189 \usepackage[utf8]{inputenc}
3190 \usepackage[T1]{fontenc}
3191 \usepackage{hyperref}
3195 \date{2010-03-22 Mon}
3201 \setcounter{tocdepth}{3}
3205 \section{test reftex}
3209 This is a citation \cite{tierney90}.
3211 \bibliographystyle{plain}
3218 A second solution, to activate the RefTeX minor mode on a per-file
3219 basis, was posted by Kevin Brubeck Unhammer in response to this idea.
3220 Add the following lines to .emacs:
3222 #+begin_src emacs-lisp
3223 (add-hook ‘org-mode-hook
3225 (if (member “WRITE” org-todo-keywords-1)
3226 (org-mode-article-modes))))
3229 where =org-mode-article-modes= is defined as follows:
3231 #+begin_src emacs-lisp
3232 (defun org-mode-article-modes ()
3234 (bib-cite-minor-mode t)
3235 (and (buffer-file-name)
3236 (file-exists-p (buffer-file-name))
3237 (reftex-parse-all)))
3240 Add the =\bibliographystyle{}= and =\bibliography{}= lines to the
3241 Org-mode file as before and define a TODO keyword, =WRITE=, perhaps
3245 ,#+TODO: TODO(t) STARTED(s) WRITE | DONE(d) DEFERRED(f)
3248 With this setup, you insert a citation with =M-x reftex-citation RET=.
3250 *** Using RefTeX in Org-babel LaTeX Code Blocks
3252 In Org-babel LaTeX code blocks, the trick is to give RefTeX access to
3253 information in other Org-babel LaTeX code blocks. If you use an Emacs
3254 starter kit where configuration information is held in Org-mode files,
3255 then the second solution is preferable because you won't be asked for
3256 a master file when Emacs is started. For this reason, the second
3257 solution is modified for use with Org-babel latex code blocks. No
3258 key-binding is needed here because Org-babel code blocks are edited
3259 within the usual AucTeX environment.
3261 Add the following lines to .emacs (adapted from Kevin Brubeck Unhammer's [[http://www.mfasold.net/blog/2009/02/using-emacs-org-mode-to-draft-papers/][Reftex Setup]])
3262 #+begin_src emacs-lisp
3263 (defun org-mode-article-modes ()
3265 (and (buffer-file-name)
3266 (file-exists-p (buffer-file-name))
3267 (reftex-parse-all)))
3269 (add-hook 'org-mode-hook
3271 (if (member "REFTEX" org-todo-keywords-1)
3272 (org-mode-article-modes))))
3275 Then add a line like the following line to the top of your org-mode file:
3278 ,#+TODO: TODO(t) STARTED(s) | DONE(d) DEFERRED(f) REFTEX
3281 When you open an org-mode file with a line like this, RefTeX will
3282 prompt for the master .tex file, which will be parsed in the usual
3283 way. This means that the .tex file should already exist, perhaps by
3284 tangling the LaTeX preamble and postamble, before
3285 =org-mode-article-modes= is activated for the Org-mode file.
3287 ** Why is my exported PDF file almost unreadable?
3289 :CUSTOM_ID: unreadable-pdfs
3292 Some PDF viewers (earlier versions (< v6) of Acrobat Reader, Evince,
3293 possibly others) do not get along with Adobe Type3 fonts, producing
3294 almost unreadable screen output (printed output is OK). If you see
3295 this, first verify the fonts that your document uses: open it with
3296 Acrobat Reader or Evince, select "Properties" from the "File" menu and
3297 click on the "Fonts" tab; alternatively, you can use the pdffonts
3298 program (part of the xpdf-reader package) from the command line. If
3299 that is indeed the problem, then either use a different viewer or
3300 install Type1 versions of the problematic fonts. For more details, see
3301 the "PDF export" section of [[./org-dependencies.org][org-dependencies]].
3303 ** Can I add attributes to a link or an image in HTML export?
3305 :CUSTOM_ID: html-image-and-link-attributes
3308 Yes. Excerpt from [[http://orgmode.org/manual/Images-in-HTML-export.html#Images-in-HTML-export][Org's manual]]:
3310 If you need to add attributes to an inlined image, use a `#+ATTR_HTML'.
3311 In the example below we specify the `alt' and `title' attributes to
3312 support text viewers and accessibility, and align it to the right.
3314 : #+CAPTION: A black cat stalking a spider
3315 : #+ATTR_HTML: alt="cat/spider image" title="Action!" align="right"
3318 and you could use `http' addresses just as well.
3320 ** How can I export an org file to rtf, odt (Open Office), or doc (Word)?
3322 :CUSTOM_ID: convert-to-open-office
3325 While you cannot export directly from org to doc or odt, you can
3326 export to one of org-mode's supported export formats and then use an
3327 external tool or method to convert the exported file to doc or odt.
3328 While most of these methods work with simple documents, they may work
3329 more or less well when the document contains complex elements, such as
3330 footnotes, embedded images, math formulas, and so on. (Note, the lists
3331 below are by no means comprehensive).
3333 1. html -> odt/doc/rtf
3334 - open html in Open Office and save as odt/doc ([[http://permalink.gmane.org/gmane.emacs.orgmode/31482][see this post by
3336 - [[http://www.artofsolving.com/opensource/pyodconverter][PyODConverter]]
3337 - [[http://johnmacfarlane.net/pandoc/][Pandoc]] (this works for LaTeX and docbook as well)
3338 - (Mac only) The [[http://developer.apple.com/library/mac/#DOCUMENTATION/Darwin/Reference/ManPages/man1/textutil.1.html][textutil]] utility bundled with OS X can convert
3341 2. LaTeX -> odt/doc/rtf
3342 - [[http://latex2rtf.sourceforge.net/][LaTeX2rtf]] (works well with index, footnotes, and references)
3343 - [[http://www.tug.org/tex4ht/][TeX4ht]] (works with more complex latex elements, though can be
3344 difficult to install)
3345 - run =mk4ht oolatex file.tex=
3347 See [[http://permalink.gmane.org/gmane.emacs.orgmode/31168][this thread]] for further details.
3351 ** Which versions of MobileOrg do exist
3353 :CUSTOM_ID: mobileorg_versions
3356 - MobileOrg for the iPhone/iPod Touch/iPad series of devices, by
3357 Richard Moreland. Check out
3358 [[http://mobileorg.ncogni.to/][Richard's page]]
3359 - Matt Jones is developing a feature-equivalent application for
3361 [[http://wiki.github.com/matburt/mobileorg-android/][his project page]].
3363 ** What can I do if I don't want to use Dropbox.com
3365 :CUSTOM_ID: mobileorg_webdav
3368 Dropbox.com is the easiest way to connect between Emacs and MobileOrg,
3369 you can get a free account there. If for some reason you cannot or do
3370 not want to use this path, you can use any webdav server. On this
3371 webdav server you need to create a dedicated directory for the
3372 communication between Emacs and MobileOrg. If you can mount that
3373 directory locally so that Emacs can directly write to it, just point
3374 to that directory using the variable =org-mobile-directory=. Using
3375 the /tramp/ method, =org-mobile-directory= may point to a remote
3376 directory accessible through, for example, /ssh/ and /scp/:
3378 #+begin_src emacs-lisp
3379 (setq org-mobile-directory "/scpc:user@@remote.host:org/webdav/")
3382 If Emacs cannot access the WebDAV directory directly using a /tramp/
3383 method, you can use a local directory for staging. Other means must
3384 then be used to keep this directory in sync with the WebDAV directory.
3385 In the following example, files are staged in =~/stage/=, and Org-mode
3386 hooks take care of moving files to and from the WebDAV directory using
3389 #+begin_src emacs-lisp
3390 (setq org-mobile-directory "~/stage/")
3391 (add-hook 'org-mobile-post-push-hook
3392 (lambda () (shell-command "scp -r ~/stage/* user@@wdhost:mobile/")))
3393 (add-hook 'org-mobile-pre-pull-hook
3394 (lambda () (shell-command "scp user@@wdhost:mobile/mobileorg.org ~/stage/ ")))
3395 (add-hook 'org-mobile-post-pull-hook
3396 (lambda () (shell-command "scp ~/stage/mobileorg.org user@@wdhost:mobile/")))
3401 ** How to install MathJax on my server?
3404 :CUSTOM_ID: install_mathjax_on_server
3407 Org uses MathJax as its default HTML display engine for equations.
3409 Org relies on the version of MathJax available from orgmode.org, but you
3410 might want to use another version and install MathJax on your own server.
3412 1. Download a [[http://sourceforge.net/projects/mathjax/files/][MathJax archive]].
3414 2. Upload it somewhere on your server (say http://me.org/mathjax/)
3416 3. Set the correct path in =org-export-html-mathjax-options= (i.e. replace
3417 http://orgmode.org/mathjax/MathJax.js by
3418 http://me.org/mathjax/MathJax.js)
3420 You can also get [[http://www.mathjax.org/resources/docs/?installation.html][MathJax from git or svn]] -- in this case, be careful not to
3421 forget to unzip the fonts.zip archive in the mathjax directory.
3423 * COMMENT HTML style specifications
3425 #+begin_src emacs-lisp
3426 (defun org-faq-make-target ()
3427 "Make hard target for current headline."
3429 (if (not (org-on-heading-p))
3430 (error "Not on a headline"))
3431 (let ((h (org-trim (org-get-heading 'no-tags))))
3432 (if (string-match "[ \t]*\\?\\'" h)
3433 (setq h (replace-match "" t t h)))
3434 (while (string-match "[ \t]+" h)
3435 (setq h (replace-match "-" t t h)))
3436 (org-entry-put nil "CUSTOM_ID" h)))