Add hack/code: capture invitations/appointments from MS Exchange emails
[Worg.git] / org-faq.org
blob277bc768bd396cda48c5fc5f4a9d230afc35f6f9
1 #+EMAIL:     carsten.dominik@gmail.com
2 #+AUTHOR:    Worg people
3 #+LANGUAGE:  en
4 #+TITLE:     Org-mode Frequently Asked Questions
5 #+OPTIONS:   toc:t H:2
7 #+begin_html
8   <style type="text/css">
9     <!--/*--><![CDATA[/*><!--*/
10       #table-of-contents {
11         font-size: inherit;
12         position: relative;
13         background: white;
14         -webkit-box-shadow: 0 0 0 0;
15         -moz-box-shadow: 0 0 0 0;
16         -webkit-border-bottom-left-radius: 0;
17         -moz-border-radius-bottomleft: 0;
18         text-align: left;
19         max-height: none;
20         overflow: none; }
21         #table-of-contents h2 {
22           font-size: inherit;
23           max-width: none;
24           font-weight: bold;
25           padding-left: 0;
26           padding-left: 0;
27           padding-top: 0;
28           padding-bottom: 0; }
29         #table-of-contents #text-table-of-contents {
30           display: block;
31           text-align: left; }
32         #table-of-contents:hover #text-table-of-contents {
33           display: block;
34           padding: 0;
35           margin-top: 0; }
36     /*]]>*/-->
37   </style>
38 #+end_html
40 [[file:index.org][{Back to Worg's index}]]
42 * What is org-mode?
43   :PROPERTIES:
44   :CUSTOM_ID: What-is-org-mode
45   :END:
46 ** Can I implement a GTD workflow with Org-mode?
47    :PROPERTIES:
48    :CUSTOM_ID: GTD-workflow-with-Org-mode
49    :END:
51    Yes, you can.  Check for discussions and pointers [[http://orgmode.org/worg/org-gtd-etc.html][here]].
53 ** What is the difference between Org and TaskPaper?
54    :PROPERTIES:
55    :CUSTOM_ID: Org-and-TaskPaper
56    :END:
58   There is really no difference.  Org is as /simple/ as [[http://hogbaysoftware.com/products/taskpaper][TaskPaper]].  It
59   is just that, when using Org within Emacs, it lets you do many things
60   that you wouldn't be able to do with TaskPaper.  Yes, TaskPaper is
61   fiddle-proof and people using Emacs tends to like fiddling (which is
62   orthogonal to the idea of using todo-list efficiently), but this is
63   just a matter of discipline and common sense, not one of Org's design.
65   Read [[http://article.gmane.org/gmane.emacs.orgmode/6224][Carsten's enlightening statement]] on this.
66 ** What is the meaning of the Unicorn on Org's website?
67    :PROPERTIES:
68    :CUSTOM_ID: unicorn
69    :END:
71 The Unicorn is the logo of Org-mode because:
73 - Org-mode is the UNICs of ORgaNizers.
75 - Org-mode is an Emacs mode, so it makes sense to use an animal
76   similar or related to the gnu used for GNU Emacs.
78 - Org-mode is meant to show you the way, and an animal with two horns
79   can not do this very well, can it?
81 - Unicorn tears are said to reverse petrification, and wasn't this how
82   we all felt before getting to some degree of time and task
83   management?
85 - It will take forever to learn everything there is to know about a
86   unicorn.
88 - A unicorn is a fabulous creature.  Org-mode wants to be a fabulous
89   creation.
91 Using a unicorn was originally /Bastien Guerry's/ idea, his friend
92 /Christophe Bataillon/ designed the logo for us, and /Greg Newman/
93 gave it a refresh some time later.  Bastien writes why he chose a
94 unicorn:
96 #+BEGIN_QUOTE
97 The first reason is not linked to the animal, but to the sounding of the
98 word "Unicorn" - because Org gives you a /uni/que way of producing files
99 in several format (HTML, LaTeX, etc.)
101 The second reason is that a Unicorn doesn't really exist, it is just
102 something you can dream about, and make others believe it does exist.
103 Just like the perfect organizer.
104 #+END_QUOTE
106 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
107 Suckling]] posted a link showing how to make a simple foldable unicorn
108 (very appropriate for an outlining program!).
110 [[http://article.gmane.org/gmane.emacs.orgmode/11735][Tim Burt]] made a very complicated one which is now a treasured
111 possession of the Org-mode author.
113 - Official logo: [[http://orgmode.org/img/org-mode-unicorn.png]]
114   This logo is available in a number of different formats including
115   Photoshop /.psd/ and scaleable vector graphics /.svg/ [[http://orgmode.org/img/][here]].
117 - An [[http://orgmode.org/img/nrocinu4.jpg][alternative version]] from Christophe Bataillon (c):
119 - [[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]]:
121 - [[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
122   threshold technique".
124 - [[http://article.gmane.org/gmane.emacs.orgmode/11735/match%3D][Tim Burt]] made a folded Unicorn to match the spirit of Org - see the
125   whole set of pictures [[http://www.flickr.com/photos/tcburt/sets/72157614543357071/][on his flickr page]].
127 - Are unicorns real?  Answer [[http://article.gmane.org/gmane.emacs.orgmode/11687/match%3Drosslaird%2Bunicorn][here]] by Ross Laird.
129 ** Is Org's documentation written in Org?
131 No.  Org's documentation is written in TeXinfo, which is the standard
132 format for Emacs documentation.  There is no export mechanism from Org 
133 to TeXinfo (yet).
135 * Mailing list
136 ** Why hasn't my email to the mailing list shown up yet?
137    :PROPERTIES:
138    :CUSTOM_ID: ml-post-delay
139    :END:
141 The org-mode mailing list is moderated. Thus, if you are not
142 subscribed to the mailing list, your mail will only appear on the list
143 after it has been approved by a moderator. To ensure that your mail
144 appears quickly, please [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe to the list]].
146 ** I read the mailing list through gmane. Should I subscribe?
147    :PROPERTIES:
148    :CUSTOM_ID: ml-subscription-and-gmane
149    :END:
151 The org-mode mailing list is available via nntp at [[http://dir.gmane.org/gmane.emacs.orgmode][Gmane]]. Many
152 participants in the list prefer read the list in a newsreader, such as
153 Gnus, instead of receiving emails. If you choose to read the list via
154 nntp, you can still [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe]] to the list and then opt not to receive
155 any emails on the mailman settings page (see the "Mail Delivery"
156 setting).
158 This will ensure that your messages to the list get through quickly,
159 reduce the work load of the mailing list moderators (who need to clear
160 every mail from non-members), and provide more accurate information
161 about the number of list readers.
163 * Keeping current
164   :PROPERTIES:
165   :CUSTOM_ID: Keeping-current
166   :END:
167 ** My Emacs ships with an older version Org-mode! How do I upgrade?
168    :PROPERTIES:
169    :CUSTOM_ID: updating-org
170    :END:
172 Org-mode develops quickly, which means that versions of Org-mode
173 shipped with Emacs are more or less out-of-date. If you'd like to
174 upgrade to the most recent version of org-mode, you have a number of
175 options.
177  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
178     follow the [[http://orgmode.org/manual/Installation.html#Installation][installation instructions]] in the manual.
179  2. Clone and install the development git repository as [[#keeping-current-with-Org-mode-development][explained
180     here]]. If you don't want to run the bleeding edge, you can still
181     use git [[#using-stable-releases-only][to track the most recent stable releases]].
182  3. Install and updated org-mode automatically through the Emacs
183     Package Manager as [[#installing-via-elpa][explained in this FAQ]].
185 ** How do I keep current with bleeding edge development?
186    :PROPERTIES:
187    :CUSTOM_ID: keeping-current-with-Org-mode-development
188    :END:
190    Org mode is developed in [[http://en.wikipedia.org/wiki/Git_(software)][Git]]. You can keep up-to-date with Org-mode
191    developement by cloning Org mode repository and refreshing your
192    copy with latest changes whenever you wish. You only need to use
193    two Git commands (clone and pull.) Here are the steps in brief
194    (please customize locations to suit your setup):
196    1. Select a location to house the Org mode repository (approx. 40
197       MB; includes documentation, compiled elisp files and history
198       going all the way back to v4.12a)
200       : $ mkdir $HOME/elisp && cd $HOME/elisp
202    2. Clone the Org mode Git repository.
204       Recommended approach:
206       : $ git clone git://orgmode.org/org-mode.git
208       You can also clone from this mirror (lagging one hour behind
209       orgmode.org repo):
211       : $ git clone git://repo.or.cz/org-mode.git
213       For those of you behind a firewall that allows only HTTP, you can
214       clone like this (can be somewhat slow), either from orgmode.org or
215       from repo.or.cz:
217       : $ git clone http://orgmode.org/org-mode.git
218       : $ git clone http://repo.or.cz/r/org-mode.git
220    3. Compile and install Org mode and build documentation.
222       : $ cd org-mode && make && make doc && make install
224       Please note that you can choose to /not/ compile at all and run
225       using source =.el= files only.  Compiled files speed things up.
227       Also note that running =make install= is necessary only if you'd
228       like to install org-mode system-wide.
230    4. This is where you configure Org mode with Emacs.  Please refer
231       to [[./org-tutorials/index.org][Org tutorials]].
233    5. Keeping up-to-date.
235       Cloning the repository is a one time activity.  From this point
236       onwards you only need to /pull/ the latest changes.
238       : $ cd $HOME/elisp/org-mode
240       and then
242       : $ git pull && make clean && make && make doc && make install
244    6. You should restart org mode to have the changes take effect (if
245       you are not rebooting Emacs.)  Also since the intention is to
246       "keep up" with Org mode, you should visit updated sections of
247       documentation for latest updates (use =git log=.)
249    7. As you use your repository over time it will accumulate loose objects.
250       You can reduce the total size of your git repository with
252       : $ git gc
254       which will consolidate loose git objects into pack files.  This
255       reduces the size of the repository and speeds up data access to
256       the objects.
258 ** How can I keep local changes and still track Org mode development?
259    :PROPERTIES:
260    :CUSTOM_ID: keeping-local-changes-current-with-Org-mode-development
261    :END:
263   Say you want to make minor changes to the Makefile to reflect your
264   location for =emacs=.
266   Create a local branch for your changes on top of origin/master as
267   follows:
269   : $ git checkout -b local origin/master
270   : $ git config branch.local.rebase true
271   : # Make your changes to the Makefile and create a new commit
272   : $ git add Makefile
273   : $ git commit -m 'My local Makefile configurations'
274   : # Update git to a newer version
275   : $ git pull
277   Now each time you pull new commits from the distribution repository
278   your local commits will be rewound and replayed on top of the new
279   origin/master.
281 -----------
283   You would normally work on your =local= branch which includes your
284   custom commits; there's no need to switch back to the =master=
285   branch.
287 -----------
289 Here is an example of dealing with conflict resolution during git pull.
291 If you get a conflict during a =git pull= you will need to edit the
292 file with the conflict to fix up the conflicting lines and then tell
293 git that you have resolved the conflict.
295 Conflict resolution goes something like this:
297 1. =git pull= fails with a conflict
298 2. edit the file
299 3. =git add= the file to mark the conflict resolved
300 4. =git rebase --continue=
301 5. lather, rinse, and repeat 2-4 as needed
303 For this example we have the following Makefile:
305 : #
306 : # Example Makefile
307 : #
309 : EMACS=emacs
311 : VERSION=V1.0
313 and we need to change the =EMACS=emacs= line to =EMACS=myemacs= to
314 make it work well on our system.
316 To do this we
318   - create a local branch for our work
320     : $ git checkout -b local origin/master
321     : $ git config branch.local.rebase true
323     This marks the branch so that all local commits on it are rebased
324     on top of any new commits we get in origin/master during a =git
325     pull= operation.
327   - Make our custom changes
329     Edit the makefile so it looks like this:
331     : #
332     : # Example Makefile
333     : #
334     :
335     : EMACS=myemacs
336     :
337     : VERSION=V1.0
339   - Create a commit with our custom changes
340     : $ git add Makefile
341     : $ git commit -m 'My local Makefile configurations'
343   - Later we do a =git pull= but that fails with conflicts.
345     : $ git pull
346     : remote: Counting objects: 5, done.
347     : ...
348     : Patch failed at 0001.
349     :
350     : When you have resolved this problem run "git rebase --continue".
351     : If you would prefer to skip this patch, instead run "git rebase --skip".
352     : To restore the original branch and stop rebasing run "git rebase --abort".
354   - Fix the conflict in your favourite editor
356     Conflict markers look like this:
358     : <<<<<<< HEAD:Makefile
359     : EMACS=emacs22
360     : =======
361     : EMACS=myemacs
362     : >>>>>>> Change emacs location:Makefile
364     This attempted =git pull= caused a conflict.  Fire up your
365     favourite editor and fix the conflict in the Makefile.  The
366     conflict markers are <<<<<<<<<< , ======= , and >>>>>>>>>>.  Fix
367     the Makefile appropriately and delete the conflict markers.  You
368     already edited these lines earlier so fixing it should be trivial.
370     In this case we changed =EMACS=emacs= to =EMACS=myemacs= and
371     upstream changed =EMACS=emacs= to =EMACS=emacs22=.  Just fix the
372     file and save it by deleting the conflict markers and keeping the
373     code you need (in this case the =EMACS=myemacs= line which we
374     originally modified.)
376   - Mark the file's conflict resolved
378     : $ git add Makefile
380     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.
382   - Continue the rebase operation
384     : $ git rebase --continue
386     If any other conflicts arise you fix them the same way - edit the file, mark the conflict resolved, and continue.
388 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"
389 using
390 : $ git rebase --abort
392 ** How can I use a stable release version instead of the bleeding edge master?
393    :PROPERTIES:
394    :CUSTOM_ID: using-stable-releases-only
395    :END:
397 The master branch of the git repository always contains the bleeding
398 edge development code.  This is important for Org's fast development,
399 because code on master gets checked out by many people daily and we
400 quickly receive bug reports if something is wrong.  On rare occasions,
401 this code may not function perfectly for a limited time while we are
402 trying to fix things.
404 Not everyone like to use this bleeding-edge code and face the danger
405 to hit a surprising bug.
407 Therefore, from time to time, we make a release.  This typically
408 happens when the maintainers feel that
410 1. they have reached a good point in the development
411 2. the code has a feature set that should stay and be supported in the
412    future
414 Stable releases are used as the basis for [[http://orgmode.org/index.html#sec-3_3][alternative distributions]] of
415 Org, and they are also the code that gets merged into the Emacs
416 distribution. If you want to work only with stable releases, you can
417 always download [[http://orgmode.org/index.html#sec-3][them here]], but you can also also use the git
418 repository to keep automatically up-to-date with the most recent
419 stable releases (and save bandwidth!). Here's how to do so:
421 *** Run a specific stable release
423 In the repository, do
425 : $ git fetch --tags
426 : $ git tag
428 To see which release tags are available.  Let's say you decide to use
429 =release_7.01f=.
431 : $ git checkout release_7.01f
433 This set the working tree of the repository to the state of Org at the
434 moment of release 7.01f.  You can then run Org from the repository be
435 sure to use the stable release while development continues on the
436 master branch.
438 Later, when we release 7.02, you can switch to that using
440 : $ git fetch --tags                   # to get all the new stuff
441 : $ git tag
442 : $ git checkout release_7.02
444 *** Always run the most recent stable release
446 Alternatively, if you just want to always run whatever the latest
447 stable release is, you can do
449 : $ git checkout -b stable origin/maint
451 and then regularly update this branch by doing
453 : $ git pull
455 ** How can I install an up-to-date version of org-mode without "make" tools?
456    :PROPERTIES:
457    :CUSTOM_ID: installing-org-without-make-tools
458    :END:
460 If you are using org-mode on a computer that lacks developer tools for
461 compiling software, such as [[http://www.gnu.org/software/make/][GNU Make]], you will have to use a
462 *different* installation method than [[http://orgmode.org/manual/Installation.html#Installation][the one outlined in the manual]].
464 Please see [[http://article.gmane.org/gmane.emacs.orgmode/15264][this thread]] on the mailing list for several different ways
465 you can install a recent version of org-mode without using the
466 customary =make clean && make && make install=.
468 The result of that discussion is the file/function found in
469 [[http://orgmode.org/worg/org-hacks.html#compiling-org-without-make]].
471 ** I don't use git. Can I download bleeding edge .zip and .tar.gz archives?
473    Yes. You can download [[http://orgmode.org/org-latest.zip][org-latest.zip]] or [[http://orgmode.org/org-latest.tar.gz][org-latest.tar.gz]] of Org-mode --
474    these archives are udpated every day at midnight.
476    Alternatively, you can download a [[http://orgmode.org/w/org-mode.git/snapshot][tar.gz snapshot from orgmode.org]].
478 ** How can I install Org-mode through Emacs' Package Manager?
479    :PROPERTIES:
480    :CUSTOM_ID: installing-via-elpa
481    :END:
483    Emacs 24 includes an automated package management tool ([[http://tromey.com/elpa/][ELPA]]) that
484    can be used to install and upgrade elisp packages such as Org-mode.
485    If you are running an older version of Emacs (23 or earlier), you
486    will have to install the package manager before using it to install
487    Org-mode. See [[#installing-elpa][this FAQ]] for more details.
489    Org-mode is distributed as an ELPA package from [[http://elpa.gnu.org/packages/][GNU Emacs Lisp
490    Package Archive]] as well as from [[http://orgmode.org/pkg/daily/][Org-mode Emacs Lisp Archive]].
491    
492    Steps for adding Org-mode as a package archive:
493    1. Add Org-mode as a package archive. This can be done in two ways.
494       1. Use =M-x customize-variable RET package-archives=
495       2. Add the following line to your =.emacs= and reload Emacs.
497          #+begin_src emacs-lisp
498            (add-to-list 'package-archives '("Org-mode" . "http://orgmode.org/pkg/daily/"))
499          #+end_src
500                 
501    2. Use the Emacs package manager's =M-x list-packages= to browse
502       and install the latest version.
504    3. If you get the following error "*Failed to download `Org-mode'
505       archive.*" in step 2, you can manually download the tarball and
506       install it. Refer [[Installing from ELPA-tar][this FAQ entry]] for more information.
508 ** How do I install Emacs package manager?
509    :PROPERTIES:
510    :CUSTOM_ID: installing-elpa
511    :END:
512    
513    If you are running Emacs-24 or find the command =M-x list-packages=
514    available you already have the package manager installed.
515    
516    Steps for installing package manager:
517    1. Download the latest package manager -
518       [[http://repo.or.cz/w/emacs.git/blob_plain/HEAD:/lisp/emacs-lisp/package.el][package.el]].
519    2. Add the following to your =.emacs= and reload Emacs.
520       #+begin_src emacs-lisp
521         ;; change "~/elisp/" as appropiate
522         (setq load-path (cons "~/elisp" load-path))
523         (require 'package)
524         (package-initialize)
525       #+end_src
526    
527 ** I don't see Org-mode as an installation option in Package Manager Menu?
528    :PROPERTIES:
529    :CUSTOM_ID: why-no-org-in-elpa
530    :END:
531    
532    Emacs Package Manager is a very recent addition to Emacs. Work is
533    under way to have have Org-mode seamlessly integrate with Emacs'
534    Package Manager. As a result, it will be some time before the
535    Org-mode packages are available and usable from either GNU or
536    Org-mode package archives.
537    
538    In the meanwhile, you can install Org-mode via package manager
539    through ELPA-compatible tar. Refer [[Installing from ELPA-tar][this FAQ entry]] for more information.
540    
541 ** How do I install Org-mode from a ELPA-compatible tarball?
542    :PROPERTIES:
543    :CUSTOM_ID: installing-from-elpa-tarball
544    :END:
545 # <<Installing from ELPA-tar>>
546    
547    Org-mode is distributed as an ELPA-compatible tar which can be used
548    in conjunction with Emacs' package manager.
549    
550    1. If you are already running Org-mode, note the current version
551       reported by M-x org-version.
552    2. Download the latest tarball from [[http://orgmode.org/pkg/daily/][Org-mode repo]].
553    3. Do =M-x package-install-file=. When prompted for =Package file
554       name=, point it to .tar file downloaded in step 2.
555       
556       You will now see Package Manager compiling the files and
557       installing it.
558    4. Reload emacs. This step is very important.
559    5. Note the version of the new installation using M-x
560       org-version. If the new and old versions are different, the
561       installation is done and you are all set to enjoy the updated
562       Org-mode. Otherwise skip to step 6.
563    6. Review you load-path using =C-h v load-path=. Most likely that
564       your old installation path takes precedence over the path chosen
565       by package manager (which is typically
566       =~/.emacs.d/elpa/...=). Fix this anamoly by moving
567       =(package-initialize)= line in .emacs to a more appropriate
568       location.
569       
570    - Additional Note on =org-install.el= :: Functionality of Org-mode's
571      =org-install.el= is supplanted by Package Manager's
572      =org-autoloads.el=. Since Package Manager autoloads Org-mode for
573      you, the following line =(require 'org-install)= in your =.emacs=
574      is no longer required and can be safely removed.
575      
576 ** Why would I use ELPA tarballs instead of the snapshot tarballs?
577    :PROPERTIES:
578    :CUSTOM_ID: why-elpa
579    :END:
580    
581    ELPA-tarballs automate much the process of upgrading org-mode. Much
582    of the following grunt work is done automatically by the Package
583    Manager:
584    
585    1. Downloading, compiling, and activating of org-mode (including
586       setting org-mode's =load-path= and autoloads).
587    2. Updating info files.
589 * Setup
590   :PROPERTIES:
591   :CUSTOM_ID: Setup
592   :END:
593 ** How can I quickly browse all Org options?
595 =M-x org-customize RET=
597 See also [[file:org-tutorials/org-customize.org][Carsten's Org customize tutorial]] and [[file:org-configs/org-customization-guide.org][this customization guide]]
598 for details.
600 ** Can I use the editing features of org-mode in other modes?
601    :PROPERTIES:
602    :CUSTOM_ID: use-editing-features-in-other-modes
603    :END:
605    Not really---but there are a few editing features you can use in
606    other modes.
608    - For tables there is =orgtbl-mode= which implements the table
609      editor as a minor mode. (To enable, type =M-x orgtbl-mode=)
610    - For ordered lists there is =orgstuct-mode= which allows for easy
611      list editing as a minor mode. (To enable, type =M-x
612      orgstruct-mode=)
614    You can activate these modes automatically by using hooks:
616    : (add-hook 'mail-mode-hook 'turn-on-orgtbl)
617    : (add-hook 'mail-mode-hook 'turn-on-orgstruct)
619    For footnotes, there is the function =org-footnote-action=, which
620    works in non-org buffers. This function is a powerful tool for
621    creating and sorting footnotes. To use it globally, you can add the
622    following keybinding to your =.emacs= file (requires Org 6.17 or
623    greater):
625    : (global-set-key (kbd "C-c f") 'org-footnote-action)
627    For other features you need to switch to Org-mode temporarily, or
628    prepare text in a different buffer.
630 ** Why isn't feature "X" working the way it is described in the manual?
631    :PROPERTIES:
632    :CUSTOM_ID: making-sure-org-mode-is-up-to-date
633    :END:
635 Org-mode develops very quickly. If you are using a version of Org-mode
636 that shipped with emacs, there is a good chance that it is somewhat
637 out of date.
639 Many of the users on the Org-mode mailing list are using either a
640 recent release of Org-mode or the
641 [[http://orgmode.org/index.html#sec-3.2][development version of
642 org-mode from the git repository]].
644 If some settings and features aren't working the way you expect, make
645 sure that the version of the manual you are consulting matches the
646 version of Org-mode you are using.
648    - You can check which version of Org-mode you are using by
649      selection =Org --> Documentation --> Show Version= in the Emacs
650      menu.
652    - The [[http://orgmode.org/manual/index.html][online manual]] at [[http://orgmode.org][orgmode.org]] corresponds to the most recent
653      release.
655    - 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
656      released with the latest official Gnu Emacs release. Compared
657      with the manual at the orgmode.org, the manual at www.gnu.org is
658      somewhat out of date.
660 For instructions on how to stay current with Org-mode, consult [[keeping-current-with-Org-mode-development][this
661 FAQ]] or follow the instructions on [[http://orgmode.org][the official Org-mode site]].
663 ** Can I get the visibility-cycling features in outline-mode and outline-minor-mode?
664    :PROPERTIES:
665    :CUSTOM_ID: use-visibility-cycling-in-outline-mode
666    :END:
668    Yes, these functions are written in a way that they are independent of
669    the outline setup.  The following setup provides standard Org-mode
670    functionality in outline-mode on =TAB= and =S-TAB=.  For
671    outline-minor-mode, we use =C-TAB= instead of =TAB=,
672    because =TAB= usually has mode-specific tasks.
674 #+BEGIN_SRC emacs-lisp
675 (add-hook 'outline-minor-mode-hook
676   (lambda ()
677     (define-key outline-minor-mode-map [(control tab)] 'org-cycle)
678     (define-key outline-minor-mode-map [(shift tab)] 'org-global-cycle)))
679 (add-hook 'outline-mode-hook
680   (lambda ()
681     (define-key outline-mode-map [(tab)] 'org-cycle)
682     (define-key outline-mode-map [(shift tab)] 'org-global-cycle)))
683 #+END_SRC
685 Or check out /outline-magic.el/, which does this and also provides
686 promotion and demotion functionality.  /outline-magic.el/ is
687 available at [[http://www.astro.uva.nl/~dominik/Tools/outline-magic.el][Outline Magic]].
689 ** Can I save/restore the visibility state of an org-mode buffer?
690    :PROPERTIES:
691    :CUSTOM_ID: saving-visibility-state
692    :END:
694 Well, no---at least not automatically. You can, however, control the
695 visibility of an org-file or of individual trees by adding
696 instructions to your org file. See [[http://orgmode.org/manual/Visibility-cycling.html#Visibility-cycling][this section of the manual]] for more
697 information.
699 ** How can I keep track of changes in my Org files?
700    :PROPERTIES:
701    :CUSTOM_ID: track-of-changes-in-Org-files
702    :END:
704   Use git to track the history of the files, use a cronjob to check in
705   changes regularly.  Such a setup is described by Bernt Hansen
706   in [[http://article.gmane.org/gmane.emacs.orgmode/6233][this message]] on [[http://dir.gmane.org/gmane.emacs.orgmode][emacs-orgmode]].
708 ** Can I use Org-mode as the default mode for all README files?
709    :PROPERTIES:
710    :CUSTOM_ID: Org-mode-as-default-mode
711    :END:
713 Add the following to your .emacs file:
715 : (add-to-list 'auto-mode-alist '("README$" . org-mode))
717 You can even make it the default mode for any files with unspecified
718 mode using
720 : (setq default-major-mode 'org-mode)
722 ** Can I use ido.el for completing stuff in Org?
723    :PROPERTIES:
724    :CUSTOM_ID: ido-complete
725    :END:
727    Yes, you can.  If you are an ido user and ido-mode is active, the
728    following setting will make Org use =ido-completing-read= for most
729    of its completing prompts.
731 : (setq org-completion-use-ido t)
733 ** Should I use one big org file or multiple files?
734    :PROPERTIES:
735    :CUSTOM_ID: how-to-organize-org-mode-files
736    :END:
738 Org-mode is flexible enough to accomodate a variety of organizational
739 and time management schemes. Org's [[http://orgmode.org/manual/Document-Structure.html#Document-Structure][outline cycling and convenient
740 editing and navigation commands]] make it possible to maintain all of
741 your projects and notes in a single file. But org-mode's [[http://orgmode.org/manual/Hyperlinks.html#Hyperlinks][quick and
742 easy hyperlinks]], along with [[http://orgmode.org/manual/Refiling-notes.html#Refiling-notes][easy refiling of notes and todos]], also
743 make it a delight to maintain a private "wiki" consisting of multiple
744 files.
746 No matter how you organize your org files, org-mode's agenda commands
747 make it easy to search all your notes and gather together crucial data
748 in a single view.
750 Moreover, several org-mode settings can be configured either globally
751 in your =.emacs= file or locally (per file or per outline tree). See
752 the [[http://orgmode.org/manual/index.html#Top][manual]] for more details. For an example of local customizations
753 see [[limit-agenda-with-category-match][this FAQ]].
755 Here are a few ideas for organizing org-mode files:
757 - A single file for all your projects and notes.
758 - One file per project.
759 - One file per client.
760 - One file per area of responsibility or type of work (e.g.,
761   household, health, work, etc.).
762 - One file for projects, one for appointments, one for reference
763   material, one for someday/maybe items, etc.
764 - A wiki of hyperlinked files that grows and adapts to meet your
765   needs.
767 For more ideas, see some of the links on the [[file:org-tutorials/index.org][org-tutorial index]] or
768 [[file:org-gtd-etc.org][this page on org-mode and GTD]].
770 ** Why doesn't C-c a call the agenda? Why don't some org keybindings work?
771    :PROPERTIES:
772    :CUSTOM_ID: setting-global-keybindings
773    :END:
775 Org-mode has a few global keybindings that the user must set
776 explicitly in an =.emacs= file. These keybindings include the
777 customary shortcut for calling the agenda (=C-c a=). If nothing
778 happens when you type =C-c a=, then make sure that the following lines
779 are in your =.emacs= file:
781 #+BEGIN_SRC emacs-lisp
782 ;; The following lines are always needed.  Choose your own keys.
783 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
784 (global-set-key "\C-cl" 'org-store-link)
785 (global-set-key "\C-ca" 'org-agenda)
786 (global-set-key "\C-cb" 'org-iswitchb)
787 #+END_SRC emacs-lisp
789 You may, of course, choose whatever keybindings work best for you
790 and do not conflict with other modes.
792 Please see [[http://orgmode.org/manual/Activation.html][this section of the manual]] if you have additional
793 questions.
795 ** Why aren't some of the variables I've customized having an effect?
796    :PROPERTIES:
797    :CUSTOM_ID: load-org-after-setting-variables
798    :END:
800 Some org variables have to be set before org.el is loaded or else they
801 will not work. (An example is the new variable
802 =org-enforce-todo-dependencies=.)
804 To make sure all your variables work you should not use =(require
805 'org)=. Instead use the following setting:
807 : (require 'org-install)
809 You should also make sure that you do not require any other =org-...=
810 files in your =.emacs= file before you have set your org variables,
811 since these will also cause org.el to be loaded. To be safe, load org
812 files *after* you have set your variables.
814 ** How can I make sure that timestamps appear in English?
815    :PROPERTIES:
816    :CUSTOM_ID: timestamps-and-system-time-locale
817    :END:
819 If your system's locale is not set to English, but you would like the
820 timestamps in your org-mode files to appear in English, you can set
821 the following variable:
823 #+begin_src emacs-lisp
824   (setq system-time-locale "C")
825 #+end_src
827 ** What does a minimal .emacs look like?
828    :PROPERTIES:
829    :CUSTOM_ID: minimal-emacs
830    :END:
832 Using a stripped down minimal .emacs files removes broken custom
833 settings as the cause of an issue and makes it easy to reproduce for
834 other people.  The example below has system-specific paths that you'll
835 need to change for your own use.
836 #+begin_src emacs-lisp
837   (add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
838   (add-to-list 'auto-mode-alist '("\\.\\(org\\  |org_archive\\|txt\\)$" . org-mode))
839   (setq org-agenda-files '("/tmp/test.org"))
840   (require 'org-install)
841   (require 'org-habit)
843   (global-set-key "\C-cl" 'org-store-link)
844   (global-set-key "\C-ca" 'org-agenda)
845   (global-set-key "\C-cb" 'org-iswitchb)
846 #+end_src
848 You can save the minimal .emacs file to ~/minimal.emacs, add suspect
849 configuration code to it, then start emacs something like this:
850 #+begin_src sh
851   emacs -Q -l ~/minimal.emacs
852 #+end_src
854 On OS X, starting emacs with minimal configuration might look
855 something like this:
856 #+begin_src sh
857   /Applications/emacs.app/Contents/MacOS/Emacs -Q -l ~/minimal.emacs
858 #+end_src sh
860 ** Can I migrate from Planner?
862    Yes.  This [[http://www.c0t0d0s0.de/plan2org/plan2org.pl][perl script]] or [[http://gitorious.org/bkuhn-small-hacks/org-mode/blobs/master/planner2org.plx
863 ][this Perl script]] can help.
865 * Errors and general problems
866   :PROPERTIES:
867   :CUSTOM_ID: Errors
868   :END:
869 ** Opening Org files in Emacs leads to a crash
870    :PROPERTIES:
871    :CUSTOM_ID: Emacs-crashes-with-org-indent-mode
872    :END:
873    The only known case where Org-mode can crash Emacs is when you are
874    using =org-indent-mode= with Emacs 23.1 (in fact, any version of
875    Emacs before version 23.1.50.3).  Upgrade to Emacs 23.2 and the
876    problem should go away.
878 ** When I try to use Org-mode, I always get the error message =(wrong-type-argument keymapp nil)=
879    :PROPERTIES:
880    :CUSTOM_ID: wrong-type-argument-keymapp
881    :END:
883    This is a conflict with an outdated version of the /allout.el/, see
884    the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section in the manual
886 ** How can I control the application launched by Org-mode to open a certain file type like pdf, html....
887    :PROPERTIES:
888    :CUSTOM_ID: external-application-launched-to-open-file-link
889    :END:
891 If you want special control about how Org-mode opens files, see the
892 variables =org-file-apps=, =org-file-apps-defaults-gnu=,
893 =org-file-apps-defaults-macosx=, =org-file-apps-defaults-windowsnt=.
895 *However*, normally it is best to just use the mechanism the
896 operating-system provides:
898 *** GNU/Linux systems
899     You you have to check your mailcap settings, find the files:
901     : /etc/mailcap
902     :
903     : or
904     :
905     : $HOME/.mailcap
907 and modify them accordingly. Please read their manual entry.
909 *** Windows systems
910     + for html pages you may configure the =browse-url-= variables through
911       the Customize interface,
912     + the pdf files are automatically opened with Acrobat Reader (if it is
913       installed)
915 *** Mac OSX
916     Change the application responsible for this file type by selecting
917     such a file in the Finder, select =File->Get Info= from the menu
918     and select the application to open this file with.  Then, to
919     propagate the change to all files with the same extension, select
920     the =Change all= button.
922 ** Org-mode takes over the TAB key.  I also want to use YASnippet, is there a way to fix this conflict?
923    :PROPERTIES:
924    :CUSTOM_ID: YASnippet
925    :END:
927 [[http://code.google.com/p/yasnippet/][yasnippet]] is yet another snippet expansion system for Emacs.  It is
928 inspired by TextMate's templating syntax.
929 - watch the [[http://www.youtube.com/watch?v=vOj7btx3ATg][video on YouTube]]
930 - see the [[http://yasnippet.googlecode.com/svn/trunk/doc/index.html][intro and tutorial]]
932 *Note*: yasnippet is not compatible with =org-indent-mode= currently
933 there is no known way to use both successfully with =yas/trigger-key=
934 set to =TAB= (or =[tab]= etc...)
936 The way Org-mode binds the =TAB= key (binding to =[tab]= instead of
937 =\t=) overrules yasnippets' access to this key.  The following code
938 fixes this problem:
940 #+begin_src emacs-lisp
941 (add-hook 'org-mode-hook
942           (lambda ()
943             (org-set-local 'yas/trigger-key [tab])
944             (define-key yas/keymap [tab] 'yas/next-field-group)))
945 #+end_src
947 If the above code doesn't work (which it may not with later versions
948 of yasnippet).  Then try the following
950 #+begin_src emacs-lisp
951   (defun yas/org-very-safe-expand ()
952     (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
954   (add-hook 'org-mode-hook
955             (lambda ()
956               ;; yasnippet (using the new org-cycle hooks)
957               (make-variable-buffer-local 'yas/trigger-key)
958               (setq yas/trigger-key [tab])
959               (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
960               (define-key yas/keymap [tab] 'yas/next-field)))
961 #+end_src
963 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]])
964 with YASnippets for Org-mode.
966 ** Org-mode takes over the S-cursor keys.  I also want to use CUA-mode, is there a way to fix this conflict?
967    :PROPERTIES:
968    :CUSTOM_ID: CUA-mode
969    :END:
971 Yes, see the  [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
973 ** Org-mode takes over the S-cursor keys.  I also want to use windmove.el, is there a way to fix this conflict?
974    :PROPERTIES:
975    :CUSTOM_ID: windmove.el
976    :END:
978 Yes, see the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
980 ** Org behaves strangely: some keys don't work, some features are missing, my settings have no effect, ...
981    :PROPERTIES:
982    :CUSTOM_ID: loaded-old-org
983    :END:
985 When this sort of things happen, it probably is because Emacs is
986 loading an old version of Org-mode instead of the one you expected.
987 Check it with =M-x org-version=.
989 This happens because Emacs loads first the system org-mode (the one
990 included with Emacs) before the one in your directory. Check the
991 =load-path= variable; you might see that your org-mode appears /after/
992 the system-wide path; this is bad.
994 You should add your directories to the =load-path= at the beginning:
996 :  (add-to-list 'load-path "~/.emacs.d/org-mode/lisp") (require 'org-install)
998 Function =add-to-list= adds at the beginning. Don't use =append=
999 because it appends at the end. Also be sure to use =(require
1000 'org-install)= and not =(require 'org)=.
1002 This wrong version loading may also happen if you have a byte-compiled
1003 =org.elc= from an old version together with a new =org.el=. Since
1004 Emacs prefers loading byte-compiled files (even if the =.el= is
1005 newer), it will load the old Org-mode.
1007 ** Why doesn't org-batch-agenda work under Win32?
1008    :PROPERTIES:
1009    :CUSTOM_ID: org-batch-agenda-under-win32
1010    :END:
1012 When I run the example batch files to print my agenda to the console
1013 under Win32 I get the failure:
1015 : End of file during parsing
1017 and no agenda is printed.
1019 The problem is the use of single quotes surrounding the eval in the
1020 emacs command-line. This gets confused under Win32. All string
1021 parameters with spaces must be surrounded in double quotes. This means
1022 that double quotes being passed to the eval must be escaped.
1024 Therefore, instead of the following:
1026 : <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
1027 :     -eval '(org-batch-agenda "a")'
1029 you need to use the following:
1031 :  <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
1032 :     -eval "(org-batch-agenda \"a\")"
1034 (all on one line, of course).
1036 ** Org agenda seems very slow
1037    :PROPERTIES:
1038    :CUSTOM_ID: slow-agenda
1039    :END:
1041 If it takes a long time to generate or refresh the agenda, you might
1042 want first check which version of org-mode you are using. There have
1043 been major optimizations of org-agenda since 6.21b, which was the
1044 version of org-mode released with Emacs 23. If you are using 6.21b or
1045 earlier (you can check with =M-x org-version=), then you might want to
1046 consider upgrading to a more recent version of org-mode.
1048 Here are some other ideas for speeding up the agenda:
1050 1. Use a one day agenda view (rather than a seven day view).
1052    =(setq org-agenda-ndays 1)=
1054 2. Archive inactive items to separate files.
1056    =C-c C-x C-s= (org-archive-subtree)
1058 3. Do not include the global todo list in your agenda view.
1060    (setq org-agenda-include-all-todo nil)
1062 4. Make sure that your org files are byte-compiled.
1064    I.e., make sure there are files ending in =.elc= in your org
1065    installation directory.
1067 5. Limit your agenda files (=org-agenda-files=) to files that have
1068    active todos and or projects. 
1070    If you have a number of older reference files---i.e., files you
1071    search only occasionally---in your agenda files list, consider
1072    removing them from your agenda files and adding them to
1073    =org-agenda-text-search-extra-files= instead. Similarly, you might
1074    consider searching some of your older reference files with =M-x
1075    grep= so that Org-mode does not have to load them into memory when
1076    the agenda is called.
1078 ** Visual-line-mode doesn't work well with org-mode
1079    :PROPERTIES:
1080    :CUSTOM_ID: visual-line-mode
1081    :END:
1083 Visual-line-mode "soft wraps" lines so that the visual edge of the
1084 buffer is considered a line break for purposes of navigation, even
1085 though there is no line break in reality.
1087 In older versions of org-mode, org-beginning-of-line and
1088 org-end-of-line do not work well with visual line mode. (The two
1089 commands disregard soft line breaks and move to the beginning and end
1090 of the hard line break.) A patch was introduces to fix this behavior
1091 in July of 2009. n
1093 If you are using an older version of org mode, you can:
1095 1. Add a hook to turn off visual line mode.
1097 2. Add the following to your =.emacs=:
1099 #+begin_src emacs-lisp
1101 (add-hook 'org-mode-hook
1102   (lambda ()
1103     (define-key org-mode-map "\C-a" 'move-beginning-of-line)
1104     (define-key org-mode-map "\C-e" 'move-end-of-line)))
1106 #+end_src
1107 ** Can I hide blocks at startup?
1109 Yes:
1111 #+begin_src emacs-lisp
1112 (setq org-hide-block-startup t)
1113 #+end_src
1115 Or use
1117 #+begin_src org
1118 ,#+STARTUP: hideblocks
1119 #+end_src
1121 on a per-file basis.
1123 * Faces and highlighting
1124   :PROPERTIES:
1125   :CUSTOM_ID: Faces
1126   :END:
1127 ** Org-mode has a lot of colors?  How can I change them?
1128    :PROPERTIES:
1129    :CUSTOM_ID: customizing-org-faces
1130    :END:
1132 This is a question that applies to Emacs as a whole, but it comes up
1133 quite frequently on the org-mode mailing list, so it is appropriate to
1134 discuss it here.
1136 If you would like to change the style of a face in org-mode (or any
1137 other Emacs mode), simply type =M-x customize-face [RET]= while the
1138 cursor is on the color/style you are interested in modifying. You will
1139 be given the opportunity to customize all the faces located at that
1140 point.
1142 If you would like an overview of all the faces in org-mode, you can
1143 type =C-u M-x list-faces-display [RET] org= and you will be shown all
1144 the faces defined by org-mode along with an illustration of their
1145 current settings.
1147 If you would like to customize org-faces and other aspects of
1148 org-appearance, type =M-x customize-group org-font-lock [RET]=.
1150 Finally, if you would like verbose information about the properties of
1151 the text under the cursor, you can type =C-u C-x ==.
1153 See the Worg page on [[file:org-tutorials/org-appearance.org][customizing Org appearance]] for further information.
1154 ** Why do I get a tiny font in column view when using emacs daemon?
1155    :PROPERTIES:
1156    :CUSTOM_ID: column-view-tiny-font
1157    :END:
1159 When using emacs in daemon mode (=emacs --daemon=), client frames
1160 sometimes override the column view face settings, resulting in very
1161 small fonts. Here is a fix:
1163 #+begin_src emacs-lisp
1164   (defun org-column-view-uses-fixed-width-face ()
1165   ;; copy from org-faces.el
1166   (when (fboundp 'set-face-attribute)
1167       ;; Make sure that a fixed-width face is used when we have a column
1168       ;; table.
1169       (set-face-attribute 'org-column nil
1170                           :height (face-attribute 'default :height)
1171                           :family (face-attribute 'default :family))))
1173    (when (and (fboundp 'daemonp) (daemonp))
1174     (add-hook 'org-mode-hook 'org-column-view-uses-fixed-width-face))
1175 #+end_src
1177 This fix was provided in the following mailing list post:
1179 http://article.gmane.org/gmane.emacs.orgmode/27560
1180 ** How can I stop the mouse cursor from highlighting lines in the agenda?
1181    :PROPERTIES:
1182    :CUSTOM_ID: ratpoison-for-agenda-highlighting
1183    :END:
1185 You can add the following to your =.emacs=:
1187 #+begin_src emacs-lisp
1188 (add-hook 'org-finalize-agenda-hook
1189     (lambda () (remove-text-properties
1190                (point-min) (point-max) '(mouse-face t))))
1191 #+end_src
1193 * Outline
1194   :PROPERTIES:
1195   :CUSTOM_ID: Outline
1196   :END:
1197 ** Can I have two windows on the same Org-mode file, with different outline visibilities?
1198    :PROPERTIES:
1199    :CUSTOM_ID: indirect-buffers
1200    :END:
1202    You may use /indirect buffers/ which do exactly this.  See the
1203    documentation on the command =make-indirect-buffer=.
1205    Org-mode has built-in commands that allow you create an indirect
1206    buffer from a subtree of an outline. To open a subtree in new
1207    window, type =C-c C-x b=. Any changes you make in the new window
1208    will be saved to the original file, but the visibility of both
1209    buffers will remain independent of one another.
1211    For multiple indirect buffers from the same file, you must use the
1212    prefix =C-u= when creating the second (or third) buffer. Otherwise
1213    the new indirect buffer will replace the old.
1215    You can also create an independent view of an outline subtree by
1216    typing =b= on an item in the agenda.
1218 ** Emacs outlines are unreadable.  Can I get rid of all those stars?
1219    :PROPERTIES:
1220    :CUSTOM_ID: Emacs-outlines-are-unreadable
1221    :END:
1223    See the section [[http://orgmode.org/manual/Clean-view.html#Clean-view][Clean outline view]] in the manual.
1224 ** C-k is killing whole subtrees!  I lost my work!
1225    :PROPERTIES:
1226    :CUSTOM_ID: C-k-is-killing-subtrees
1227    :END:
1229   =(setq org-special-ctrl-k t)= before losing your work.
1231 ** Why aren't commands working on regions?
1232    :PROPERTIES:
1233    :CUSTOM_ID: transient-mark-mode
1234    :END:
1236 Some org-mode commands, such as M-right and M-left for demoting or
1237 promoting headlines (see [[demote-multiple-headlines][this FAQ]]), can be applied to entire regions.
1238 These commands, however, will only work on active regions set with
1239 [[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
1240 Emacs 23. To enable it in earlier versions of emacs, put the following
1241 in your =.emacs= file:
1243 : (transient-mark-mode 1)
1245 Alternatively, you may turn off transient mark mode and use [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Momentary-Mark.html][a
1246 momentary mark]] (=C-<SPC> C-<SPC>=).
1248 ** Why is a blank line inserted after headlines and list items?
1249    :PROPERTIES:
1250    :ID:       2463F4D8-F686-4CF3-AA07-08976F8A4972
1251    :END:
1252    :PROPERTIES:
1253    :CUSTOM_ID: blank-line-after-headlines-and-list-items
1254    :END:
1256 In org-mode, typing =M-RET= at the end of a headline will create a new
1257 headline of the same level on a new line. The same is true for plain
1258 lists. By default org-mode uses context to determine if a blank line
1259 should be inserted after each headline or plain list item when =M-RET=
1260 is pressed. For instance, if a there is a blank line before a
1261 headline, then typing =M-RET= at the end of the line will insert a
1262 blank line before the new headline. For instance, hitting =M-RET=
1263 at the end of "Headline Two" below inserts a new headline without a
1264 blank line:
1266 : ** Headline One
1267 : ** Headline Two
1268 : **
1270 If there is a blank line between Headline One and Headline Two,
1271 however, the results will be as follows:
1273 : ** Headline One
1275 : ** Headline Two
1277 : **
1279 If you do not like the default behavior you can change it with the
1280 variable =org-blank-before-new-entry=. You can set headings and/or
1281 plain lists to auto (the default setting), t (always), or nil (never).
1283 ** How can I promote or demote multiple headlines at once?
1284    :PROPERTIES:
1285    :CUSTOM_ID: demote-multiple-headlines
1286    :END:
1288 If you have a long list of first level headlines that you'd like to
1289 demote to second level headlines, you can select the headlines as a
1290 region and then hit =M-<right>= to demote all the headlines at once.
1292 Note: =M-S-<right>= will not work on a selected region. Its use is to
1293 demote a single subtree (i.e., a headline and all sub-headlines).
1295 If M-<right> doesn't seem to work, make sure transient mark mode is
1296 enabled. See [[transient-mark-mode][this FAQ]].
1298 ** What's the deal with all the ellipses in my org outlines?
1299    :PROPERTIES:
1300    :CUSTOM_ID: org-ellipses
1301    :END:
1303 Org-mode uses ellipses to indicate folded (and thus hidden) text. Most
1304 commonly, ellispes occur at the end of headings with folded content:
1306 : * Heading ...
1308 Or, for instance, they may indicate closed drawers:
1310 : :PROPERTIES: ...
1312 Sometimes, as a result of editing and cycling an outline, ellipses may
1313 appear in unexpected places. You should *never* delete these ellipses,
1314 as you may accidentally delete hidden text. Instead, you can type =C-c
1315 C-r= (org-reveal) to display all hidden text in the vicinity. Or you
1316 may type =M-x RET show-all= to reveal all text in the org file.
1318 If you would prefer a symbol or face for indicating hidden text, you
1319 can customize the variable org-ellipses.
1321 ** How do I yank a subtree so it's indented according to the point's location?
1322    :PROPERTIES:
1323    :CUSTOM_ID: yank-indent-subtree
1324    :END:
1326 You can either use =C-c C-w= with a working [[http://orgmode.org/manual/Refiling-notes.html#Refiling-notes][refile-targets]] setup.
1328 Or set =org-yank-adjusted-subtrees= to =t= which will adjust the
1329 yanked headline's level correctly.
1331 Just use =C-k= and =C-y= as you would everywhere else in Emacs.
1333 ** Can I read org-mode outlines in vim?
1334    :PROPERTIES:
1335    :CUSTOM_ID: org-outlines-in-vim
1336    :END:
1338 Yes, there is a script that enables one to view and navigate folded
1339 outline/org files in vim (though without most of org-mode's
1340 functionality, of course).
1342   - [[http://www.vim.org/scripts/script.php?script_id%3D1266][Emacs outline mode - Imitates Emacsen : vim online]]
1344 For instructions on how to set it up, please see [[http://mid.gmane.org/EA275862-B97A-4BAC-B879-177FD07A2D56@gaillourdet.net][this mailing list
1345 post]].
1347 Work is also underway on an org-mode clone for Vim. You can check it
1348 out on git hub:
1350 https://github.com/hsitz/VimOrganizer
1352 * Todos and Tags
1353   :PROPERTIES:
1354   :CUSTOM_ID: Todos-and-Tags
1355   :END:
1356 ** How can I cycle through the TODO keyword of an entry?
1357    :PROPERTIES:
1358    :CUSTOM_ID: cycle-TODO-keywords
1359    :END:
1361   =C-c C-t= or =S-<left/right>= is what you need.
1363 ** How do I track state changes for tasks in Org?
1364    :PROPERTIES:
1365    :CUSTOM_ID: track-state-changes-for-tasks
1366    :END:
1368   Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/6082][post by Bernt Hansen]] for setting up TODO keyword
1369   states and logging timestamps for task state changes.
1371 ** Can I select the TODO keywords with a tag-like interface?
1372    :PROPERTIES:
1373    :CUSTOM_ID: select-TODO-keywords-with-tag-like-interface
1374    :END:
1376   Yes.  Use =(setq org-use-fast-todo-selection t)=
1378   If you want to set both your todos and your tags using a single
1379   interface, then check out the variable
1380   =org-fast-tag-selection-include-todo=.
1382   See [[http://orgmode.org/manual/Fast-access-to-TODO-states.html][this section of the manual]] for more details.
1384 ** How can I quickly set the tag of an entry?
1385    :PROPERTIES:
1386    :CUSTOM_ID: quickly-set-tag-of-entry
1387    :END:
1389    Use =C-c C-c= or =C-c C-q= on the headline. =C-c C-q= is useful for
1390    setting tabs in a [[http://orgmode.org/manual/Remember.html#Remember][remember]] buffer, since =C-c C-c= is the default
1391    keybinding for filing a note from the remember buffer.
1393    You can set tags even more quickly by setting one of the character
1394    shortcuts for [[http://orgmode.org/manual/Setting-tags.html#Setting-tags][fast tag selection]].
1396    To set tag shortcuts for all org buffers, put something like the
1397    following in your =.emacs= file (or create the same settings by
1398    typing =M-x customize-variable RET org-tag-alist=):
1400 : (setq org-tag-alist '(("computer" . ?c) ("office" . ?o) ("home" . ?h)))
1402    To set tag shortcuts for a single buffer, put something like the
1403    following at the top of your org file:
1405 : #+TAGS: computer(c) office(o) home(h)
1407 ** How can I change the colors of TODO keywords?
1409 You can use the variable org-todo-keyword-faces. Here are some sample
1410 settings:
1412 #+begin_src emacs-lisp
1413 (setq org-todo-keyword-faces
1414       '(
1415         ("TODO"  . (:foreground "firebrick2" :weight bold))
1416         ("WAITING"  . (:foreground "olivedrab" :weight bold))
1417         ("LATER"  . (:foreground "sienna" :weight bold))
1418         ("PROJECT"  . (:foreground "steelblue" :weight bold))
1419         ("DONE"  . (:foreground "forestgreen" :weight bold))
1420         ("MAYBE"  . (:foreground "dimgrey" :weight bold))
1421         ("CANCELED"  . shadow)
1422         ))
1423 #+end_src
1425 If you want to change the color of all active todos or all inactive
1426 todos, type:
1428 : M-x customize-face RET org-todo
1429 : M-x customize-face RET org-done
1431 You can also set values for each of these in your =.emacs= file:
1433 : (set-face-foreground 'org-todo "firebrick2")
1434 : (set-face-foreground 'org-done "forestgreen")
1436 * Hyperlinks
1437   :PROPERTIES:
1438   :CUSTOM_ID: Hyperlinks
1439   :END:
1440 ** Why do I have to confirm the execution of each shell/elisp link?
1441    :PROPERTIES:
1442    :CUSTOM_ID: confirm-shell/elisp-link
1443    :END:
1445    The confirmation is there to protect you from unwantingly execute
1446    potentially dangerous commands.  For example, imagine a link
1448    : [[shell:rm -rf ~/*][Google Search]]
1450    In an Org-mode buffer, this command would look like /Google Search/,
1451    but really it would remove your home directory.  If you wish, you can
1452    make it easier to respond to the query by setting
1454    : (setq org-confirm-shell-link-function 'y-or-n-p
1455    :       org-confirm-elisp-link-function 'y-or-n-p).
1457    Then a single keypress will be enough to confirm those links.  It is
1458    also possible to turn off this check entirely, but I strongly
1459    recommend against this.  Be warned.
1461 ** Can I use RET or TAB to follow a link?
1462    :PROPERTIES:
1463    :CUSTOM_ID: RET-or-TAB-to-follow-link
1464    :END:
1466    Yes, this is how:
1468    : (setq org-return-follows-link t)
1469    : (setq org-tab-follows-link t)
1471 ** Can I keep mouse-1 clicks from following a link?
1472    :PROPERTIES:
1473    :CUSTOM_ID: mouse-1-following-link
1474    :END:
1476    Activating links with =mouse-1= is a new feature in Emacs 22, to make
1477    link behavior similar to other applications like web browsers.  If
1478    you hold the mouse button down a bit longer, the cursor will be set
1479    without following the link.  If you cannot get used to this behavior,
1480    you can (as in Emacs 21) use =mouse-2= to follow links and turn off
1481    link activation for =mouse-1= with
1483    : (setq org-mouse-1-follows-link nil)
1485 ** How can I get completion of file names when creating a link?
1486    :PROPERTIES:
1487    :CUSTOM_ID: completion-of-file-links
1488    :END:
1490 You can use org-insert-link with a prefix argument:
1492 : C-u C-c C-l
1494 You will be greeted with prompt in the minibuffer that allows for file
1495 completion using your preferred Emacs method for finding files.
1497 ** How can I use invisible targets within lists?
1498    :PROPERTIES:
1499    :CUSTOM_ID: invisible-targets-in-lists
1500    :END:
1502 The usual way of turning radio links invisible is to comment them, but
1503 Org comments need to be at the beginning of the line, which breaks list
1504 indentation.  
1506 The workaround here is to add (INVISIBLE) after your <<target>>
1508 For example:
1510 : 11. <<target>>(INVISIBLE)
1511 :     Some text
1512 : 12. More text [[target][go to]]
1514 ** Org-mode is not opening mailto links in my default mail client
1515    :PROPERTIES:
1516    :CUSTOM_ID: mailto-links
1517    :END:
1519 You can customize the function org-mode uses to open mailto links by
1520 setting the variable =org-link-mailto-program=:
1522 =M-x customize-variable org-link-mailto-program=
1524 The default function called is =browse-url=, which opens a mail
1525 composition buffer within Emacs. The type of buffer opened by
1526 browse-url depends on the setting of the variable =mail-user-agent=.
1527 Thus, if you want to ensure that mailto links use Gnus to open a
1528 message buffer, you could add the following to your =.emacs=:
1530 #+begin_src elisp
1531 (setq mail-user-agent 'gnus-user-agent)
1532 #+end_src
1534 ** Can I use CamelCase links?
1535    :PROPERTIES:
1536    :CUSTOM_ID: CamelCase-links
1537    :END:
1539 Yes, you can with the contributed package org-wikinodes.el. Please
1540 consult the [[http://orgmode.org/worg/org-contrib/org-wikinodes.html][documentation]].
1542 * Plain Lists
1543   :PROPERTIES:
1544   :CUSTOM_ID: Plain-Lists
1545   :END:
1546 ** How can I insert an empty line before each newly inserted headline, but not before each newly inserted plain-list item?
1547    :PROPERTIES:
1548    :CUSTOM_ID: empty-line-before-each-new-headline-but-not-item
1549    :END:
1551 : (setq org-blank-before-new-entry
1552 :       '((heading . t) (plain-list-item . nil))
1554 See also [[id:2463F4D8-F686-4CF3-AA07-08976F8A4972][Why is a blank line inserted after headlines and list items?]].
1556 ** How can I convert itemized lists to enumerated lists?
1557    :PROPERTIES:
1558    :CUSTOM_ID: convert-itemized-to-enumerated-lists
1559    :END:
1561    You can use =C-c -= or =S-<left>/<right>= to cycle through the various
1562    bullet headlines available for lists: =-, +, *, 1., 1)=.
1564    See [[http://orgmode.org/manual/Plain-lists.html#Plain-lists][this section of the manual]] for more information.
1566 ** How can I convert plain lists to headlines and vice versa?
1567    :PROPERTIES:
1568    :CUSTOM_ID: convert-plain-lists-to-headlines
1569    :END:
1571    To convert a plain list item or line to a headline, type =C-c *= on
1572    the headline. This will make the line a subheading of the current
1573    headline.
1575    To convert a headline to a plain list item, type =C-c -= while the
1576    cursor is on the headline.
1578    To convert a headline to an unadorned line of text, type =C-c *= on
1579    the headline.
1581    You can use query replace to accomplish the same things, as Bernt
1582    Hansen explains in [[http://article.gmane.org/gmane.emacs.orgmode/10148][this mailing list post]].
1584 ** Is there a good way to create a description list?
1585    :PROPERTIES:
1586    :CUSTOM_ID: description-lists
1587    :END:
1589   Yes, these are now built-in:
1591 #+BEGIN_EXAMPLE
1592 - item1 :: Description of this item 1
1593 - item2 :: Description of this item 2
1594 - item1 :: Description of this item 3
1595       also in multiple lines
1596 #+END_EXAMPLE
1598 * Tables
1599   :PROPERTIES:
1600   :CUSTOM_ID: Tables
1601   :END:
1602 ** Will there ever be support for multiple lines in a table field?
1603    :PROPERTIES:
1604    :CUSTOM_ID: table-multiline-fields
1605    :END:
1607    No.
1609    You can embed tables created with the table.el package in org-mode
1610    buffers, with mixed success when it comes to export and publishing.
1612 ** How can I make table alignment work with Asian character sets
1613    :PROPERTIES:
1614    :CUSTOM_ID: table-alignment-asian-characters
1615    :END:
1617 When table alignment fails, it usually has to do with character sets
1618 where some characters have non-integer width.  Org will deal correctly
1619 with characters that are one or two or three ASCII characters wide,
1620 but not with characters that are, for example, 1.5 ASCII characters
1621 wide.  To make table alignment work you need to switch to a different
1622 character set.
1624 ** Can I plot data from a table?
1625    :PROPERTIES:
1626    :CUSTOM_ID: plotting-table-data
1627    :END:
1629    Yes, you can, using org-plot.el written by Eric Schulte and now
1630    bundled with Org.  See [[http://orgmode.org/manual/Org_002dPlot.html#Org-Plot][the manual section about this]].
1632    See also [[file:org-tutorials/org-plot.org][this excellent tutorial]] by Eric Schulte.
1634 ** How can I fill a table column with incremental numbers?
1635    :PROPERTIES:
1636    :CUSTOM_ID: fill-table-column-with-incremental-numbers
1637    :END:
1639 Here is how: Use a field formula to set the first value in the column:
1641 #+begin_src org
1642 ,| N   |   |
1643 ,|-----+---|
1644 ,| :=1 |   |
1645 ,|     |   |
1646 ,|     |   |
1647 ,|     |   |
1648 ,#+TBLFM: @2$1=1
1649 #+end_src
1651 Then define a column formula in the second field:
1653 #+begin_src org
1654 ,| N        |   |
1655 ,|----------+---|
1656 ,| 1        |   |
1657 ,| =@-1 + 1 |   |
1658 ,|          |   |
1659 ,|          |   |
1660 ,#+TBLFM: @2$1=1
1661 #+end_src
1663 After recomputing the table, the column will be filled with
1664 incremental numbers:
1666 #+begin_src org
1667 ,| N |   |
1668 ,|---+---|
1669 ,| 1 |   |
1670 ,| 2 |   |
1671 ,| 3 |   |
1672 ,| 4 |   |
1673 ,#+TBLFM: $1=@-1 + 1::@2$1=1
1674 #+end_src
1676 Note that you could use arbitrary starting values and column formulas.
1678 ** Why does my table column get filled with #ERROR?
1679    :PROPERTIES:
1680    :CUSTOM_ID: table-column-filled-with-ERROR
1681    :END:
1683    Org-mode tried to compute the column from other fields using a
1684    formula stored in the =#+TBLFM:= line just below the table, and
1685    the evaluation of the formula fails.  Fix the fields used in the
1686    formula, or fix the formula, or remove it!
1688 ** How can I stop the table editor from creating new lines?
1689    :PROPERTIES:
1690    :CUSTOM_ID: table-editor-creates-new-lines
1691    :END:
1693    When I am in the last column of a table and just above a horizontal
1694    line in the table, pressing TAB creates a new table line before the
1695    horizontal line.  To move to the line below the
1696    horizontal line instead, do this:
1698    Press =down= (to get on the separator line) and then =TAB=.
1699    Or configure the variable
1701    : (setq org-table-tab-jumps-over-hlines t)
1703 ** How can I get table fields starting with "="?
1704    :PROPERTIES:
1705    :CUSTOM_ID: table-fields-starting-with-=
1706    :END:
1708    With the setting
1710    : (setq org-table-formula-evaluate-inline nil)
1712    this will no longer happen.  You can still use formulas using the
1713    commands @<tt>C-c =@</tt> and @<tt>C-u C-c =@</tt>
1715 ** How can I change the indentation of an entire table without fixing every line by hand?
1716    :PROPERTIES:
1717    :CUSTOM_ID: change-indentation-entire-table
1718    :END:
1720    The indentation of a table is set by the first line.  So just fix the
1721    indentation of the first line and realign with =TAB=.
1723 ** In my huge table the realigning after each TAB takes too long.  What can I do?
1724    :PROPERTIES:
1725    :CUSTOM_ID: table-realigning-after-TAB-takes-long
1726    :END:
1728    Either split the table into several by inserting an empty line every
1729    100 lines or so.  Or turn off the automatic re-align with
1731    : (setq org-table-automatic-realign nil)
1733    After this the only way to realign a table is to press =C-c C-c=.  It
1734    will no longer happen automatically, removing the corresponding delays
1735    during editing.
1737 ** Recalculation of my table takes too long.  What can I do?
1738    :PROPERTIES:
1739    :CUSTOM_ID: Recalculation-of-my-table-takes-too-long
1740    :END:
1742    Nothing, really.  The spreadsheet in org is mostly done to make
1743    calculations possible, not so much to make them fast.  Since Org-mode
1744    is firmly committed to the ASCII format, nothing is stopping you from
1745    editing the table by hand.  Therefore, there is no internal
1746    representation of the data.  Each time Org-mode starts a computation,
1747    it must scan the table for special lines, find the fields etc.  This
1748    is slow.  Furthermore, Calc is slow compared to hardware
1749    computations.  To make this work with normal editing, recalculation
1750    is not happening automatically, or only for the current line, so that
1751    the long wait for a full table iteration only happens when you ask
1752    for it.
1754    So for really complex tables, moving to a "real" spreadsheet may
1755    still be the best option.
1757    That said, there are some ways to optimize things in Org-mode, and I
1758    have been thinking about moving a bit further down this line.
1759    However, for my applications this has so far not been an issue at
1760    all.  If you have a good case, you could try to convince me.
1762 ** =S-RET= in a table keeps increasing the copied numbers.  How can I stop this?
1763    :PROPERTIES:
1764    :CUSTOM_ID: S-RET-in-a-table-increases-copied-numbers
1765    :END:
1767    Well, it is /supposed/ to be a feature, to make it easy to create a
1768    column with increasing numbers.  If this gets into your way, turn it
1769    off with
1771    : (setq org-org-table-copy-increment nil)
1773 ** When I export tables to html, they don't have borders.
1774    :PROPERTIES:
1775    :CUSTOM_ID: table-borders-in-html-export
1776    :END:
1778 By default, org mode exports tables without borders.
1780 You can changed this by placing an =#+ATTR_HTML= line before the
1781 table:
1783 :  #+ATTR_HTML: border="2" rules="all" frame="all"
1785 See [[http://orgmode.org/manual/Tables-in-HTML-export.html#Tables-in-HTML-export][the manual]] for more details.
1787 ** Why does the Calc high precision (e. g. =p20=) not work like expected?
1788    :PROPERTIES:
1789    :CUSTOM_ID: table-high-precision
1790    :END:
1792 - *Short answer*
1794   Avoid
1795   : | 1 / 2 * 3 | 0.16666667000000 |
1796   : #+TBLFM: $2 = $1; p20 %.14f
1798   and use
1799   : | 1 / 2 * 3 | 0.16666666666667 |
1800   : #+TBLFM: $2 = $1 +.0; p20 f-14
1802 - *Longer answer*
1804   It is important to distinguish between the precision of
1805   1) =p20=: Calc internal calculation (=calc-internal-prec=)
1806   2) =f-14=: Calc float formatting, unlimited in precision (=calc-float-format=)
1807   3) =%.14f=: the =printf= reformatting, limited in precision
1809   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.
1811   Use =C-h v org-calc-default-modes RET= to check the Org default settings
1812   which are used if no format specifiers are added to a table formula.
1813   The examples below have been made with the out_of_the_box Org defaults
1814   =calc-internal-prec = 12= and =calc-float-format = 8=.
1816   Remember the formula debugger, toggled with =C-c {=,
1817   to view the processing stages like:
1818   |   | formula debugger label | processing stage           |
1819   | / | <                      | <>                         |
1820   |---+------------------------+----------------------------|
1821   |   | Result:                | output of Calc             |
1822   |   | Format:                | reformatting with =printf= |
1824   Following are some examples to demonstrate
1825   the interaction of the three precisions.
1827   - *display precision limitations for Calc formulas*
1828     - limited by Calc internal calculation precision from Org default
1829       (here =p12=)
1830       : | 0.16666666666700 |
1831       : #+TBLFM: $1 = 1 / 2 * 3;     f-14
1833       : | 0.1666666666670000000 |
1834       : #+TBLFM: $1 = 1 / 2 * 3;     f-19
1836     - limited by Calc float format from Org default (here =f8=)
1837       : | 0.16666667 |
1838       : #+TBLFM: $1 = 1 / 2 * 3
1840       : | 0.16666667 |
1841       : #+TBLFM: $1 = 1 / 2 * 3; p20
1843       : | 0.16666667000000 |
1844       : #+TBLFM: $1 = 1 / 2 * 3;          %.14f
1846       : | 0.16666667000000 |
1847       : #+TBLFM: $1 = 1 / 2 * 3; p20      %.14f
1849     - limited by Calc float format specified
1850       : | 0.166667 |
1851       : #+TBLFM: $1 = 1 / 2 * 3;     f-6
1853       : | 0.16666666666667 |
1854       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-14
1856       : | 0.1666666666666666667 |
1857       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-19
1859     - limited by =printf= conversion to Emacs Lisp float
1860       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
1861       : #+TBLFM: $1 = 1 / 2 * 3;          %.19f
1863       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
1864       : #+TBLFM: $1 = 1 / 2 * 3; p20      %.19f
1866       : | 0.1666666666666666600 | the inaccuracy is platform dependent |
1867       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-20 %.19f
1869     - limited by =printf= format specified
1870       : | 0.166667 |
1871       : #+TBLFM: $1 = 1 / 2 * 3;         %.6f
1873   - *display precision limitations for Emacs Lisp formulas*
1874     - limited by Emacs Lisp float
1875       : | 0.16666666666666666 |
1876       : #+TBLFM: $1 = '(/ 1.0 (* 2 3))
1878       : | 0.1666666666666666574 | the inaccuracy is platform dependent |
1879       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.19f
1881     - limited by =printf= format specified
1882       : | 0.16666666666667 |
1883       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.14f
1885 This FAQ entry is based on this [[http://thread.gmane.org/gmane.emacs.orgmode/22642][mailing list thread]]
1886 and is continued in the [[#table-float-fraction][next FAQ entry]].
1888 ** Which float format shows the fraction part also when the latter is zero?
1889    :PROPERTIES:
1890    :CUSTOM_ID: table-float-fraction
1891    :END:
1893 - *Short answer*
1895   Avoid
1896    : | 1 | 1 |
1897    : #+TBLFM: $2 = $1; f-3
1898   and use
1899    : | 1 | 1.000 |
1900    : #+TBLFM: $2 = $1 +.0; f-3
1902 - *Longer answer*
1904   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]]
1905   in the section Mode Settings -> Display Modes -> Float Formats
1906   [[http://www.delorie.com/gnu/docs/calc/calc_163.html][found here as long as the section numbering is unchanged]].
1908   Remember the formula debugger, toggled with =C-c {=,
1909   to view the processing stages like:
1910   |   | formula debugger label | processing stage           |
1911   | / | <                      | <>                         |
1912   |---+------------------------+----------------------------|
1913   |   | Result:                | output of Calc             |
1914   |   | Format:                | reformatting with =printf= |
1916   Following are some examples to demonstrate different float formats.
1918   - normal precision
1919     : |-----------+---------+-------+---------+----------+-------|
1920     : |    number |      f3 |   f-3 | +.0; f3 | +.0; f-3 |  %.3f |
1921     : |-----------+---------+-------+---------+----------+-------|
1922     : |         1 |       1 |     1 |   1.000 |    1.000 | 1.000 |
1923     : |         0 |       0 |     0 |   0.000 |    0.000 | 0.000 |
1924     : |-----------+---------+-------+---------+----------+-------|
1925     : |       1.0 |   1.000 | 1.000 |   1.000 |    1.000 | 1.000 |
1926     : |       0.0 |   0.000 | 0.000 |   0.000 |    0.000 | 0.000 |
1927     : |-----------+---------+-------+---------+----------+-------|
1928     : | 1.0001666 |   1.000 | 1.000 |   1.000 |    1.000 | 1.000 |
1929     : | 0.0001666 | 1.67e-4 | 0.000 | 1.67e-4 |    0.000 | 0.000 |
1930     : |-----------+---------+-------+---------+----------+-------|
1931     : | 1.0016666 |   1.002 | 1.002 |   1.002 |    1.002 | 1.002 |
1932     : | 0.0016666 |   0.002 | 0.002 |   0.002 |    0.002 | 0.002 |
1933     : |-----------+---------+-------+---------+----------+-------|
1934     : #+TBLFM: $2 = $1; f3 :: $3 = $1; f-3 :: $4 = $1 +.0; f3 :: $5 = $1 +.0; f-3 :: $6 = $1; %.3f
1936   - high precision
1937     : |----------------------+--------------------------+-----------------------|
1938     : | number               |                      f19 |                  f-19 |
1939     : |----------------------+--------------------------+-----------------------|
1940     : | 1                    |                        1 |                     1 |
1941     : | 0                    |                        0 |                     0 |
1942     : |----------------------+--------------------------+-----------------------|
1943     : | 1.0                  |    1.0000000000000000000 | 1.0000000000000000000 |
1944     : | 0.0                  |    0.0000000000000000000 | 0.0000000000000000000 |
1945     : |----------------------+--------------------------+-----------------------|
1946     : | 1 + 1 / 2 * 3 * 1e19 |    1.0000000000000000000 | 1.0000000000000000000 |
1947     : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
1948     : |----------------------+--------------------------+-----------------------|
1949     : | 1 + 1 / 2 * 3 * 1e18 |    1.0000000000000000002 | 1.0000000000000000002 |
1950     : | 0 + 1 / 2 * 3 * 1e18 |    0.0000000000000000002 | 0.0000000000000000002 |
1951     : |----------------------+--------------------------+-----------------------|
1952     : #+TBLFM: $2 = $1; p20 f19 :: $3 = $1; p20 f-19
1954     : |----------------------+--------------------------+-----------------------|
1955     : | number               |                 +.0; f19 |             +.0; f-19 |
1956     : |----------------------+--------------------------+-----------------------|
1957     : | 1                    |    1.0000000000000000000 | 1.0000000000000000000 |
1958     : | 0                    |    0.0000000000000000000 | 0.0000000000000000000 |
1959     : |----------------------+--------------------------+-----------------------|
1960     : | 1.0                  |    1.0000000000000000000 | 1.0000000000000000000 |
1961     : | 0.0                  |    0.0000000000000000000 | 0.0000000000000000000 |
1962     : |----------------------+--------------------------+-----------------------|
1963     : | 1 + 1 / 2 * 3 * 1e19 |    1.0000000000000000000 | 1.0000000000000000000 |
1964     : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
1965     : |----------------------+--------------------------+-----------------------|
1966     : | 1 + 1 / 2 * 3 * 1e18 |    1.0000000000000000002 | 1.0000000000000000002 |
1967     : | 0 + 1 / 2 * 3 * 1e18 |    0.0000000000000000002 | 0.0000000000000000002 |
1968     : |----------------------+--------------------------+-----------------------|
1969     : #+TBLFM: $2 = $1 +.0; p20 f19 :: $3 = $1 +.0; p20 f-19
1971     The =printf= reformatting (=%.19f=) cannot be used with high precision,
1972     see the [[#table-high-precision][previous FAQ entry]].
1974 ** How can I center tables in LaTeX output?
1975    :PROPERTIES:
1976    :CATEGORY: centered-tables-in-latex
1977    :END:
1979 Set the `org-export-latex-tables-centered' to `t':
1981 : (defcustom org-export-latex-tables-centered t
1982 :   "When non-nil, tables are exported in a center environment."
1983 :   :group 'org-export-latex
1984 :   :type 'boolean)
1986 * Markup
1987   :PROPERTIES:
1988   :CUSTOM_ID: Footnotes
1989   :END:
1990 ** How can I get automatic renumbering of footnotes in org-mode?
1991    :PROPERTIES:
1992    :CUSTOM_ID:       footnote-auto-adjust
1993    :END:
1995 You can add the following line to your .emacs file:
1997 : (setq org-footnote-auto-adjust t)
1999 Or, if you prefer, you can turn this option on locally by placing the
2000 following line at the top of your org file:
2002 : #+STARTUP: fnadjust
2004 When auto-adjust is turned on, footnotes in the file with numerical
2005 labels will be renumbered whenever a new footnote is added. Meanwhile,
2006 all footnotes, including those with custom labels such
2007 =[fn:custom-label ]=, will be sorted in the order of their appearance
2008 in the text.
2010 This emulates the footnote behavior that many users may be familiar
2011 with from word-processing programs or from the footnote-mode included
2012 with emacs.
2014 If you do not turn on org-footnote-auto-adjust, you sort and/or
2015 renumber footnotes at any time by calling org-footnote-action with a
2016 prefix argument.
2018 ** Why isn't auto renumbering of footnotes turned on by default?
2019    :PROPERTIES:
2020    :CUSTOM_ID:       why-no-default-auto-adjust
2021    :END:
2023 Org mode has a very robust footnote mechanism allowing for a variety
2024 of types of footnotes. With some of the following footnote notations,
2025 auto-adjust may be either irrelevant or undesired:
2027  - Automatically numbered
2028  - Footnotes with custom labels
2029  - Inline footnotes
2031 In addition, org mode can be customized to place footnotes either at
2032 the end of a document or at the end of the outline heading in which
2033 they appear. Users who change this setting while editing a document
2034 may be disconcerted to find all of their footnotes rearranged
2035 automatically.
2037 ** I have auto-fill-mode set and org-mode is inserting unwanted comment markers!
2038    :PROPERTIES:
2039    :CUSTOM_ID: auto-fill-and-unwanted-comments
2040    :END:
2042 If the following occurs:
2044 #+begin_src org
2045   ,#+OPTIONS: toc:nil
2046   ,Some entered text.
2047   ,# More entered tex.
2048 #+end_src
2050 Make sure that the variable comment-start is nil.
2052 ** Are there any shortcuts for entering source blocks and comment lines?
2053    :PROPERTIES:
2054    :CUSTOM_ID: shortcuts-for-entering-source-blocks
2055    :END:
2057 Org mode has some [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][very convenient markup]] for including literal blocks
2058 and lines of code in a file. (This is especially useful when exporting
2059 documents or using the contributed package [[file:org-contrib/babel/index.org][org-babel]] for executing
2060 blocks of code.)
2062 #+begin_src org
2063   ,#+begin_src perl
2064   ,  print "Hello, world!\n";
2065   ,#+end_src
2066 #+end_src
2068 It can be tiresome to enter the block comment lines manually. There
2069 are several possible shortcuts you can use to enter them:
2071 1) Built-in expansion
2073    - Org mode has a "secret" method of expanding source code blocks
2074      and comment lines.
2076    - If you type "<s" followed by =TAB= or =M-TAB=, a source block will
2077      magically appear.
2079    - For a full list of expansions, type =M-x describe-variable
2080      [RET] org-structure-template-alist=.
2082 2) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Registers]]
2084    - Add the following line to your emacs file:
2086      =(set-register ?p "#+begin_src\n\n#+end_src perl")=
2088    - Then type =C-x r i p= to insert the source block. Please note: if
2089      you save another value to the register "p" with =C-x r s p=, it
2090      will overwrite the setting above for the current emacs session.
2092 3) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Abbrevs]]
2094    - Activate the abbrev minor-mode in org-mode:
2096      + M-x abbrev-mode
2098      + /Permanently/:
2100        + =(add-hook 'org-mode-hook (lambda () (abbrev-mode 1)))=
2102    - In org-mode, type "sbp" (a sample abbreviation for a perl source
2103      block).
2105    - Immediately after "sbp" type =C-x a i l=.
2107    - Enter the expansion:
2109      - =#+begin_src perl[C-q C-j][C-q C-j]#+end_src=
2111      - Note: =C-q C-j= creates a new line in the minibuffer
2113    - Now, whenever, you type sbp followed by =SPACE= or =RET= in an
2114      org-mode buffer, the src block will magically appear.
2116    - To review your list of abbrevs, type =M-x edit-abbrevs=.
2118 4) [[http://www.slashgear.com/nokia-n900-android-dual-boot-hack-video-2371099/][Skeletons]]
2120    - Skeletons offer a simple way of automatically entering text.
2121      Here's a skeleton that queries for the type of block and wraps
2122      the active region inside it:
2124      #+begin_src elisp
2125        (define-skeleton skel-org-block
2126          "Insert an org block, querying for type."
2127          "Type: "
2128          "#+begin_" str "\n"
2129          _ - \n
2130          "#+end_" str "\n")
2131      #+end_src
2133    - Simply type skel-org-block to insert the block.
2135      - You can bind this to a key.
2137      - You can also create an abbrev that invokes this function:
2139        : (define-abbrev org-mode-abbrev-table "blk" "" 'skel-org-block)
2141 5) [[http://code.google.com/p/yasnippet/][Yasnippet]]
2143    - Several org-mode users install yasnippet for convenient, complex
2144      expansion.
2146    - See Bernt Hansen's [[http://doc.norang.ca/org-mode.html#Yasnippets][org-mode setup]] for a good introduction to
2147      yasnippet.
2149 * Capture and remember
2150   :PROPERTIES:
2151   :CUSTOM_ID: Remember
2152   :END:
2153 ** Can I use a variable or a function inside the `org-capture-templates' variable?
2154    :PROPERTIES:
2155    :CUSTOM_ID: variable-inside-capture-templates
2156    :END:
2158 Yes.  Use [[http://www.gnu.org/s/emacs/manual/html_node/elisp/Backquote.html][backquotes]].
2160 E.g. if you have a variable called =org-test-file= and you want the
2161 variable =org-capture-templates= to "understand" (i.e. evaluate)
2162 =org-test-file= when Emacs evaluates the =(setq org-capture-templates
2163 [...])= expression, use backquotes like this:
2165 #+begin_src emacs-lisp
2166 (setq org-capture-templates
2167       `(("t" "Todo" entry (file+headline ,org-test-file "Tasks")
2168        "* TODO %?\n  %i\n  %a")
2169       ("b" "Buy" item (file+olp ,org-test-file "Stuff to Buy" "House")
2170        "")))
2171 #+end_src
2173 ** Can I use the remember buffer to clock a customer phone call?
2174    :PROPERTIES:
2175    :CUSTOM_ID: use-remember-buffer-to-clock-phone-call
2176    :END:
2178   Yes, you can.  Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/5482][setup described by Bernt Hansen]]
2179   and check out (in the same thread) what Nick Docos had to fix to
2180   make Bernt's set-up work for him.
2181 ** Can I automatically start the clock when opening a remember template?
2182    :PROPERTIES:
2183    :CUSTOM_ID: start-clock-when-opening-remember-template
2184    :END:
2186    Yes, this is possible.  Use the following code and make sure that
2187    after executing it, `my-start-clock-if-needed' is in
2188    `remember-mode-hook' /after/ `org-remember-apply-template'.
2190    : (add-hook 'remember-mode-hook 'my-start-clock-if-needed 'append)
2191    : (defun my-start-clock-if-needed ()
2192    :   (save-excursion
2193    :     (goto-char (point-min))
2194    :     (when (re-search-forward " *CLOCK-IN *" nil t)
2195    :       (replace-match "")
2196    :       (org-clock-in))))
2198    Then, when a template contains the key string CLOCK-IN, the clock
2199    will be started.  Starting with Org-mode version 5.20, the clock will
2200    automatically be stopped when storing the remember buffer.
2202 * Searches
2203   :PROPERTIES:
2204   :CUSTOM_ID: Searches
2205   :END:
2206 ** Isearch does not find string hidden in links.  What can I do?
2207    :PROPERTIES:
2208    :CUSTOM_ID: isearch-in-links
2209    :END:
2211   M-x =visible-mode= will display the full link, making them searchable.
2213 ** How can I reduce the amount of context shown in sparse trees?
2214    :PROPERTIES:
2215    :CUSTOM_ID: context-in-sparse-trees
2216    :END:
2218    Take a look at the following variables:
2220    - =org-show-hierarchy-above=
2221    - =org-show-following-headline=
2222    - =org-show-siblings=
2223    - =org-show-entry-blow=
2225    which give command-dependent control over how much context is shown
2226    by a particular operation.
2228 ** How can I combine the results of two calls to =org-occur=?
2229    :PROPERTIES:
2230    :CUSTOM_ID: two-calls-to-org-occur
2231    :END:
2233    You can construct a regular expression that matches all targets you
2234    want.  Alternatively, use a =C-u= prefix with the second and any
2235    further calls to =org-occur= to keep the current visibility and
2236    highlighting in addition to the new ones.
2238 * Agenda
2239   :PROPERTIES:
2240   :CUSTOM_ID: Agenda
2241   :END:
2242 ** How can I change the advanced warning time for deadlines?
2243    :PROPERTIES:
2244    :CUSTOM_ID: warning-period-for-deadlines
2245    :END:
2246 ##<<warning-period-for-deadlines>>
2248 Deadline warnings appear in the daily agenda view a specified number
2249 of days before the deadline is due. The default setting is 14 days.
2250 You can change this with the variable =org-deadline-warning-days=.
2251 (See [[http://orgmode.org/manual/Deadlines-and-scheduling.html#Deadlines-and-scheduling][this section]] of the manual.)
2253 For instance,
2255 : (setq org-deadline-warning-days 30)
2257 would cause warnings for each deadline to appear 30 days in advance.
2259 Naturally, you might not want warnings for all of your deadlines to
2260 appear so far in advance. Thus, you can change the lead time for
2261 individual items as follows:
2263 : * TODO Get a gift for the party
2264 :   DEADLINE: <2009-01-16 Fri -2d>
2266 The "-2d" above changes the lead time for this deadline warning to two
2267 days in advance. You can also use "w" for weeks and "m" for months.
2268 ** How can I postpone a task until a certain date?
2269    :PROPERTIES:
2270    :CUSTOM_ID: deferring-tasks
2271    :END:
2273 The easiest way to postpone a task is to schedule it in the future.
2274 For instance, typing =C-c C-s +2w= on a headline will push a task two
2275 weeks into the future, so that it won't show up on the daily agenda
2276 until two weeks from now.
2278 If you'd like to prevent the task from showing up on your global todo
2279 list, you have a couple of options.
2281 1. You can set the variable =org-agenda-todo-ignore-scheduled= to =t=.
2282    This will exclude any scheduled items from your global list of
2283    active todos (=C-c a t=). (The variable
2284    =org-agenda-todo-ignore-with-date= will exclude both scheduled and
2285    deadline items from your todo list).
2286 2. You can remove the todo keyword from the item (C-c C-t <SPC>). The
2287    item will still appear on your agenda two weeks from today, but it
2288    won't show up on your todo lists.
2289 ** Can I send myself an email containing tasks or other agenda info?
2290    :PROPERTIES:
2291    :CUSTOM_ID: email-containing-tasks-or-other-agenda-info
2292    :END:
2294    Yes.  See [[http://article.gmane.org/gmane.emacs.orgmode/6112][this thread]] on the list.
2296 ** How can I limit the agenda view to my "work" tasks?
2297    :PROPERTIES:
2298    :CUSTOM_ID: limit-agenda-with-tag-filtering
2299    :END:
2301    It is often convenient to group org files into separate categories,
2302    such as "home" and "work" (or "personal" and "professional"). One
2303    of the main reasons for such classification is to create agenda
2304    views that are limited by type of work or area of responsibility.
2305    For instance, while at work, one may want to see only professional
2306    tasks; while away from work, one may want to see only personal
2307    tasks.
2309    One way to categorize files and tasks is to use a "#+FILETAGS"
2310    declaration at the top of each file, such as:
2312    : #+FILETAGS: work
2314    As long as org-use-tag-inheritance is turned on, the filetags will
2315    be inherited by all tasks in the file. A file can have multiple
2316    filetags. And, of course, tags can be added to individual headings.
2318    Tasks can be quickly filtered by tag from within the agenda by
2319    typing "/" and the name of the tag. The full key sequence to filter
2320    for work items in an agenda view would be:
2322    : C-c a a / work [or a tag shortcut]
2324 ** How can I limit the agenda view to a particular category?
2325    :PROPERTIES:
2326    :CUSTOM_ID: limit-agenda-with-category-match
2327    :END:
2329    Another way to filter agenda views by type of work is to use a
2330    "#+CATEGORY" declaration at the top of each file, such as:
2332    : #+CATEGORY: work
2334    Categories can also be added to individual headings within a file:
2336    : * Big project
2337    :   :PROPERTIES:
2338    :   :CATEGORY: work
2339    :   :END:
2341    All todos belonging to the category "work" can be found a with a
2342    simple tags-todo search:
2344    : C-c a M
2346    At the prompt, type:
2348    : CATEGORY="work"
2350    The same results can be achieved with custom agenda commands, such as:
2352 #+BEGIN_SRC emacs-lisp
2353 (setq org-agenda-custom-commands
2354       '(("h" tags-todo "CATEGORY=\"home\"")
2355         ("w" tags-todo "CATEGORY=\"work\"")
2356         ;; other custom agenda commands here
2357         ))
2358 #+END_SRC
2360 ** How can include all org files in a directory in my agenda?
2361    :PROPERTIES:
2362    :CUSTOM_ID: set-agenda-files-using-wildcards
2363    :END:
2365 You can simply include the directory (as one of the items) in the
2366 value of the variable org-agenda-files:
2368 : (setq org-agenda-files '("/my/special/path/org/"))
2370 There is another way of accomplishing the same end:
2372 : (setq org-agenda-files (file-expand-wildcards "/my/special/path/org/*.org"))
2374 ** Why aren't items disappearing from my agenda once they are marked done?
2375    :PROPERTIES:
2376    :CUSTOM_ID: removing-done-items-from-agenda
2377    :END:
2379 If items remain on your daily/weekly agenda after they are marked
2380 done, check the configuration of the following variables:
2382 : org-agenda-skip-scheduled-if-done
2383 : org-agenda-skip-deadline-if-done
2384 : org-agenda-skip-timestamp-if-done
2386 For instance, type:
2388 : M-x customize-variable RET org-agenda-skip-scheduled-if-done
2390 If this variable is turned off (=nil=), then scheduled items will
2391 remain on the agenda even after they are marked done.
2393 If the variable is turned on (=t=), then scheduled items will
2394 disappear from the agenda after they are marked done.
2396 If these settings seem not to behave the way you expect, then make
2397 sure you understand [[scheduled-vs-deadline-vs-timestamp][the
2398 difference between SCHEDULED, DEADLINE, and timestamps]].
2400 ** How do I keep repeating timestamps from being displayed multiple times?
2401    :PROPERTIES:
2402    :CUSTOM_ID: repeating-timestamps-show-once
2403    :END:
2405 To show only the /current/ instance of a repeating timestamp, put the
2406 following in your .emacs:
2408 #+begin_src emacs-lisp
2409 (setq org-agenda-repeating-timestamp-show-all nil)
2410 #+end_src
2412 ** What is the difference between SCHEDULED, DEADLINE, and plain timestamps?
2413    :PROPERTIES:
2414    :CUSTOM_ID: scheduled-vs-deadline-vs-timestamp
2415    :END:
2417 1. SCHEDULED items (set with =C-c C-s=) will appear on your agenda on
2418    the day they are scheduled and on every day thereafter until they
2419    are done. Schedule a task if you want to be reminded to do
2420    something beginning on a certain day and until it is done.
2422    : ** TODO Scheduled item
2423    :    SCHEDULED: <2009-03-01 Sun>
2425 2. Items with a DEADLINE timestamp (set with =C-c C-d=) appear on your
2426    agenda in advance of the when they are due and remain on your
2427    agenda until they are done. Add a DEADLINE to an item if you want
2428    to make sure to complete it by a certain date. (The variable
2429    org-deadline-warning-days determines how far in advance items with
2430    deadlines will show up in the agenda. See [[warning-period-for-deadlines][this FAQ]] for more
2431    information.)
2433    : ** TODO Item with a deadline
2434    :    DEADLINE: <2009-01-20 Tue>
2436 3. An active timestamp (set with =C-c .=) will appear on your agenda
2437    only on the day it is scheduled. Use a timestamp for appointments
2438    or any reminders you want to show up only on a particular day.
2440    : ** TODO Item with an active timestamp
2441    : <2009-04-18 Sat>
2443 Note: items with inactive timestamps (set with C-c ! and marked by
2444 square brackets) will not show up in the agenda at all.
2446 ** Can I add files recursively to my list of agenda files?
2447    :PROPERTIES:
2448    :CUSTOM_ID: set-agenda-files-recursively
2449    :END:
2451 Yes, you can use the library "find-lisp."
2453 : (load-library "find-lisp")
2454 : (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$"))
2456 This will add all files ending in =org= in the directory "~/org"
2457 and all of its subdirectories to your list of agenda files.
2459 See [[http://thread.gmane.org/gmane.emacs.orgmode/8992][this thread]] on the mailing list for more information.
2461 ** Why does an item appearing at the wrong time of day in my agenda?
2462    :PROPERTIES:
2463    :CUSTOM_ID: agenda-wrong-time-of-day
2464    :END:
2466 When preparing the agenda view, org-mode scans each relevant headline
2467 for a time designation. This approach is very nice for adding
2468 free-form timestamps to an item for scheduling. Thus, either of the
2469 following work would work to schedule an item at 10:00am:
2471 #+begin_src org
2472 ,** 10:00am Get dried ice at the magic store
2473 ,   SCHEDULED: <2009-05-27 Wed>
2474 #+end_src
2476 #+begin_src org
2477 ,** Get dried ice at the magic store
2478 ,   SCHEDULED: <2009-05-27 Wed 10:00>
2479 #+end_src
2481 To enable this flexibility, org-mode scans the entire headline for
2482 time of day notation. A potential problem can arise if you use
2483 inactive timestamps in the headline to note when an item was created.
2484 For example,
2486 #+begin_src org
2487 ,** Get dried ice at the magic store [2009-05-26 Tue 12:58]
2488 ,   SCHEDULED: <2009-05-27 Wed>
2489 #+end_src
2491 Org mode would interpret the time in the inactive timestamp as a
2492 time-of-day indicator and the entry would appear in your agenda at
2493 12:58.
2495 If you would like to turn off the time-of-day search, you can
2496 configure the variable =org-agenda-search-headline-for-time= (requires
2497 org-mode >= 6.24).
2499 ** How can I change the visibility of an item from the agenda?
2500    :PROPERTIES:
2501    :CUSTOM_ID: cycling-visibility-from-agenda
2502    :END:
2504 You can add a keybinding as follows:
2506 #+begin_src emacs-lisp
2507 (add-hook 'org-agenda-mode-hook
2508    (lambda ()
2509      (define-key org-agenda-mode-map " " 'org-agenda-cycle-show)))
2510 #+end_src
2512 Then, as you press SPACE on an item on the agenda, it will cycle the
2513 visibility of its original location.
2515 ** Is there any way to set org-mode so that tags don't appear in the agenda view?
2517 See the =org-agenda-remove-tags= variable.
2519 ** I work late at night! How can I extend my current day past midnight?
2520    :PROPERTIES:
2521    :CUSTOM_ID: org-extend-today-until
2522    :END:
2524 If you work past midnight, you may not want your daily agenda view to
2525 switch to the next day at 12 a.m. (the default). To extend your day,
2526 simply set the value of org-extend-today-until to a positive number
2527 corresponding to the number of hours you work past midnight. For
2528 example, the following setting will cause the current day to extend
2529 until 6 a.m.
2531 : (setq org-extend-today-until 6)
2533 * Appointments/Diary
2534   :PROPERTIES:
2535   :CUSTOM_ID: Appointments/Diary
2536   :END:
2537 ** Is it possible to include entries from org-mode files into my emacs diary?
2538    :PROPERTIES:
2539    :CUSTOM_ID: include-entries-from-org-mode-files-into-emacs-diary
2540    :END:
2542    Since the org-mode agenda is much more powerful and can contain the
2543    diary, you should think twice before deciding to do this.  If you
2544    insist, however, integrating Org-mode information into the diary is
2545    possible.  You need to turn on /fancy diary display/ by setting in
2546    .emacs:
2548    : (add-hook 'diary-display-hook 'diary-fancy-display)
2550    Then include the following line into your ~/diary file, in
2551    order to get the entries from all files listed in the variable
2552    =org-agenda-files=
2554    : &%%(org-diary)
2556    You may also select specific files with
2558    : &%%(org-diary) ~/path/to/some/org-file.org
2559    : &%%(org-diary) ~/path/to/another/org-file.org
2561    If you now launch the calendar and press @<tt>d@</tt> to display a
2562    diary, the headlines of entries containing a timestamp, date range,
2563    schedule, or deadline referring to the selected date will be listed.
2564    Just like Org-mode's agenda view, the diary for /today/ contains
2565    additional entries for overdue deadlines and scheduled items.  See
2566    also the documentation of the =org-diary= function.  Under XEmacs, it
2567    is not possible to jump back from the diary to the org, this works
2568    only in the agenda buffer.
2569 ** I want to add my Org scheduled/deadlined entries in my diary!
2570    :PROPERTIES:
2571    :CUSTOM_ID: add-Org-scheduled/deadlined-entries-to-diary!
2572    :END:
2574   Put this in your ~/.diary:
2576   : &%%(org-diary :scheduled :timestamp :deadline)
2578 ** How can I set up automatic reminders based on Org information?
2579    :PROPERTIES:
2580    :CUSTOM_ID: automatic-reminders
2581    :END:
2583   See [[http://article.gmane.org/gmane.emacs.orgmode/5271][this post]] by N. Dokos on the list.
2584 ** How can I make =appt= notice my Org appointments?
2585    :PROPERTIES:
2586    :CUSTOM_ID: appt-notice-my-Org-appointments
2587    :END:
2589   : M-x org-agenda-to-appt RET
2591 ** How can I create more complex appointments in my org-files?
2592    :PROPERTIES:
2593    :CUSTOM_ID: diary-sexp-in-org-files
2594    :END:
2596 Org-mode's active timestamps work very well for scheduling individual
2597 or recurring appointments, such as:
2599 #+begin_src org
2600   ,* 8:00am Dentist appointment <2009-01-16 Fri>
2601 #+end_src
2604 #+begin_src org
2605   ,* Vacation
2606   ,  <2009-03-20 Fri>--<2009-04-01 Wed>
2607 #+end_src
2611 #+begin_src org
2612   ,* Weekly meeting with boss
2613   ,  <2009-01-20 Tue 14:00 +1w>
2614 #+end_src
2616 Sometimes, however, you need to set up more complicated recurring
2617 appointments. Org-mode has built-in support for many of
2618 [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Sexp-Diary-Entries.html][the
2619 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
2620 instance, that you teach a class that meets every Monday evening
2621 between February 16 and April 20, 2009. The way to enter this an
2622 org-mode file is:
2624 #+begin_src org
2625   ,** Class 7:00pm-9:00pm
2626   ,   <%%(and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009))>
2627 #+end_src
2629 The expression above designates all Mondays that fall between February
2630 16 and April 20. How exactly does it work?
2632  - (and... :: Indicates that *both* of the conditions that follow have
2633           to be true.
2635    - (= 1 (calendar-day-of-week date)) :: Is the day of the week a
2636         Monday?
2638        - Note: the function calendar-day-of-week converts the date to the day of week
2639          expressed in numeric form, where 0 = Sunday, 1 = Monday, and so on.
2641    - (diary-block 2 16 2009 4 20 2009) :: Does the date fall between
2642         these two dates?
2644 You can make a sexp as complex as you like. If you wanted to omit a
2645 week because of holidays, for instance, you could add another
2646 condition to the sexp:
2648 #+begin_src org
2649   ,** Class 7:00pm-9:00pm
2650   ,   <%%(unless (diary-block 3 9 2009 3 13 2009) (and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009)))>
2651 #+end_src
2653 The sexp above would omit Monday during the week of March 9, 2009. For
2654 another way to accomplish the same thing, see [[org-diary-class][this FAQ]].
2656 Another diary function commonly used for more complex scheduling is
2657 diary-float. For instance,
2659 #+begin_src org
2660   ,* Monthly meeting
2661   ,  <%%(diary-float t 3 3)>
2662 #+end_src
2664 ...would appear on the third Wednesday of every month.
2666 For more ideas on how to create diary special expressions, see [[http://www.emacswiki.org/cgi-bin/wiki/DiaryMode][this
2667 page on the Emacs wiki]].
2669 ** How can I schedule a weekly class that lasts for a limited period of time?
2670    :PROPERTIES:
2671    :CUSTOM_ID: org-diary-class
2672    :END:
2674 Org-mode offers a convenient diary sexp function for setting up a
2675 recurring appointment that lasts for a certain period of time, such as
2676 a class. It is called org-diary-class and it can be entered as
2677 follows:
2679 #+begin_src org
2680   ,** Class 7:00pm-9:00pm
2681   ,   <%%(org-diary-class 2 16 2009 4 20 2009 1 10)>
2682 #+end_src
2684 The function above schedules an appointment for every Monday (1)
2685 between February 16 and April 20, 2009, except for ISO week 10 (March
2686 1 to March 7).
2688 The function org-diary-class has the following format:
2690 : (org-diary-class M1 D1 Y1 M2 D2 Y2 DAYNAME &rest SKIP-WEEKS)
2692 M1/2, D1/2, and Y1/2 indicate the beginning and ending dates. Dayname
2693 takes the form of a number indicating the day of the week (0 = Sunday,
2694 1 = Monday, and so on...). In addition, one can add an optional
2695 argument SKIP-WEEKS to indicate weeks on the calendar that should be
2696 skipped. This argument should be expressed as an ISO week number. You
2697 can find the number by invoking emacs' built-in calendar (=M-x
2698 calendar=), navigating to the appropriate week, and typing =p c=
2699 (calendar-iso-print-date).
2701 Please note: the order of the month, day, and year arguments depends
2702 on the variables =calendar-date-style= and/or
2703 =european=calendar=style=. (See the documentation for these variables
2704 with C-h v or M-x describe variable.) For instance, the example above
2705 works if =calendar-date-style= is set to ='american=. If
2706 =calendar-date-style= is set to ='iso=, then the arguments to the
2707 org-diary-class sexp would have the following format:
2709 : (org-diary-class Y1 M1 D1 Y2 M2 D2 DAYNAME &rest SKIP-WEEKS)
2711 Here is an alternative method, shared by Paul Sexton on the org
2712 mailing list:
2714 Let's say you are taking night classes in Spanish. The class is every
2715 Wednesday evening at 7pm, starting on 18 August, and runs for 8 weeks.
2716 Org-mode's timestamps do not support limited occurrences of recurrent
2717 items -- you have to schedule the item with infinite recurrences, then
2718 delete it when it finishes.
2720 To schedule the Spanish classes, put the following in your =.emacs=:
2722 #+begin_src emacs-lisp
2723   (defun diary-limited-cyclic (recurrences interval m d y)
2724     "For use in emacs diary. Cyclic item with limited number of recurrences.
2725   Occurs every INTERVAL days, starting on YYYY-MM-DD, for a total of
2726   RECURRENCES occasions."
2727     (let ((startdate (calendar-absolute-from-gregorian (list m d y)))
2728           (today (calendar-absolute-from-gregorian date)))
2729       (and (not (minusp (- today startdate)))
2730            (zerop (% (- today startdate) interval))
2731            (< (floor (- today startdate) interval) recurrences))))
2732 #+end_src
2733 The item in the org file looks like this:
2735 #+begin_src org
2736   ,** 19:00-21:00 Spanish lessons
2737   ,   <%%(diary-limited-cyclic 8 7 8 18 2010)>
2738 #+end_src
2740 ** How can I set an event to occur every day except Saturday and Sunday?
2742 #+begin_src org
2743   ,** Daily meeting
2744   ,   <%%(memq (calendar-day-of-week date) '(1 2 3 4 5))>
2745 #+end_src
2747 ** How do I schedule events relative to Easter Sunday?
2749    Easter's date moves around from year to year according to a
2750    complicated set of criteria which I do not claim to understand.
2751    However the following code will allow you to schedule recurring
2752    events relative to Easter Sunday.
2754    Note: the function da-easter is from:
2755    http://github.com/soren/elisp/blob/master/da-kalender.el
2757    Put the following in your .emacs:
2759 #+begin_src emacs-lisp
2760   (defun da-easter (year)
2761     "Calculate the date for Easter Sunday in YEAR. Returns the date in the
2762   Gregorian calendar, ie (MM DD YY) format."
2763     (let* ((century (1+ (/ year 100)))
2764            (shifted-epact (% (+ 14 (* 11 (% year 19))
2765                                 (- (/ (* 3 century) 4))
2766                                 (/ (+ 5 (* 8 century)) 25)
2767                                 (* 30 century))
2768                              30))
2769            (adjusted-epact (if (or (= shifted-epact 0)
2770                                    (and (= shifted-epact 1)
2771                                         (< 10 (% year 19))))
2772                                (1+ shifted-epact)
2773                              shifted-epact))
2774            (paschal-moon (- (calendar-absolute-from-gregorian
2775                              (list 4 19 year))
2776                             adjusted-epact)))
2777       (calendar-dayname-on-or-before 0 (+ paschal-moon 7))))
2780   (defun da-easter-gregorian (year)
2781     (calendar-gregorian-from-absolute (da-easter year)))
2783   (defun calendar-days-from-easter ()
2784     "When used in a diary sexp, this function will calculate how many days
2785   are between the current date (DATE) and Easter Sunday."
2786     (- (calendar-absolute-from-gregorian date)
2787        (da-easter (calendar-extract-year date))))
2788 #+end_src
2790     Now we can schedule the public holidays associated with Easter as
2791     recurring events. Good Friday is 2 days before "Easter", Easter
2792     Monday is one day after.
2794 #+begin_src org
2795   ,* Good Friday
2796   ,  <%%(= -2 (calendar-days-from-easter))>
2798   ,* Easter Sunday
2799   ,  <%%(= 0 (calendar-days-from-easter))>
2801   ,* Easter Monday
2802   ,  <%%(= 1 (calendar-days-from-easter))>
2803 #+end_src
2804    [Source: Posted by Paul Sexton on Org-mode mailing list.]
2806 ** How to schedule public holiday that is "the nearest Monday to DATE"?
2808    In New Zealand each regional capital has an "Anniversary Day". The
2809    date of Auckland's anniversary day is "the nearest Monday to 29
2810    January".
2812    Put this in your =.emacs=:
2814 #+begin_src emacs-lisp
2815   (defun calendar-nearest-to (target-dayname target-day target-month)
2816     "Recurring event that occurs in the nearest TARGET-DAYNAME to
2817   the date TARGET-DAY, TARGET-MONTH each year."
2818     (interactive)
2819     (let* ((dayname (calendar-day-of-week date))
2820            (target-date (list target-month target-day (calendar-extract-year date)))
2821            (days-diff (abs (- (calendar-day-number date)
2822                               (calendar-day-number target-date)))))
2823       (and (= dayname target-dayname)
2824            (< days-diff 4))))
2825 #+end_src
2827    Now we can schedule Auckland Anniversary Day. The first argument,
2828    1, means Monday (days of the week are numbered starting with
2829    Sunday=0).
2831    [Source: Originally posted by Paul Sexton on Org-mode mailing list.]
2833 ** How to schedule public holiday on "the 4th Monday in October"?
2835    This does not require any additions to =.emacs=:
2837 #+begin_src org
2838   ,* Labour Day (NZ)
2839   ,  <%%(diary-float 10 1 4)>
2840 #+end_src
2842 ** Why isn't the agenda showing all the times I put under a single entry?
2843    :PROPERTIES:
2844    :CATEGORY: multiple-timestamps-same-entry
2845    :END:
2847 Probably because you have not set the following variable:
2849 : org-agenda-skip-additional-timestamps-same-entry
2851 The default value of this variable is t, which means that entries with
2852 multiple timestamps, such as the following...
2854 #+begin_src org
2855   ,* Work really, really hard
2856   ,  <2010-11-20 Sat 10:00>
2857   ,  <2010-11-20 Sat 14:00>
2858 #+end_src
2860 ...will only appear in the agenda at the time specified by the first
2861 timestamp. If you set org-agenda-skip-additional-timestamps-same-entry
2862 to nil, the item will appear will appear at all the times you specify.
2864 ** Can I import iCal events/appts from Gnus?
2866 Yes.  Vagn Johansen wrote [[http://ozymandias.dk/emacs/org-import-calendar.el][org-import-calendar.el]] which lets you do this.
2868 * Export
2869   :PROPERTIES:
2870   :CUSTOM_ID: Export
2871   :END:
2872 ** Can I get TODO items exported to HTML as lists, rather than as headlines?
2873    :PROPERTIES:
2874    :CUSTOM_ID: export-TODO-items-as-lists
2875    :END:
2877    If you plan to use ASCII or HTML export, make sure things you want to
2878    be exported as item lists are level 4 at least, even if that does
2879    mean there is a level jump.  For example:
2881    : * Todays top priorities
2882    : **** TODO write a letter to xyz
2883    : **** TODO Finish the paper
2884    : **** Pick up kids at the school
2886    Alternatively, if you need a specific value for the heading/item
2887    transition in a particular file, use the =#+OPTIONS= line to
2888    configure the H switch.
2890    : #+OPTIONS:   H:2; ...
2892 ** Can I export only a single subtree?
2893    :PROPERTIES:
2894    :CUSTOM_ID: export-single-subtree
2895    :END:
2897 If you want to export a subtree, mark the subtree as region and then
2898 export. Marking can be done with =C-c @ C-x C-x=, for example.
2900 Alternatively, you can select option =1= in the org export dispatcher
2901 (e.g.., =C-c C-e 1 h= to export the current subtree to html).
2903 By default, the title of the exported file will be set to the heading
2904 of the subtree. You can, however, [[#export-options-for-subtree][customize the title and other export
2905 options]].
2907 ** How can I customize export options for a single subtree?
2908    :PROPERTIES:
2909    :CUSTOM_ID: export-options-for-subtree
2910    :END:
2912 You can set unique export options for a [[#export-single-subtree][single subtree]] by using
2913 properties. Relevant properties include:
2915  - EXPORT_TITLE
2916  - EXPORT_AUTHOR
2917  - EXPORT_DATE
2918  - EXPORT_FILE_NAME
2919  - EXPORT_OPTIONS (corresponds to the =#+OPTIONS:= [[http://orgmode.org/manual/Export-options.html#Export-options][configuration line]])
2921 ** How can I tell my calendar web application about appointments in my agenda files?
2923 Here is what you need to do:
2925 1. a script that calls Emacs in batch mode and produce a .ics file
2926 2. a script that uploads this .ics file somewhere on the web
2927 3. tell your webapp to fetch this .ics file on the web
2929 Here is the script I use for the first step:
2931 #+begin_src shell-script-mode
2932 #!/bin/bash
2934 /usr/local/bin/emacs --batch --eval \
2935 "(progn (load-file \"~/install/git/org-mode/org.el\") \
2936         (load-file \"~/elisp/config/org-batch-config.el\") \
2937         (setq org-combined-agenda-icalendar-file \"~/org/cal/org.ics\")
2938         (setq org-agenda-files (quote (\"~/org/bzg.org\"))))" \
2939     -f org-export-icalendar-combine-agenda-files
2940 #+end_src
2942 Depending on your configuration, you might change the load sequence.
2944 Here is the script I use for the second step:
2946 #+begin_src shell-script-mode
2947 #!/bin/bash
2948 /usr/bin/rsync -rtv ~/org/org.ics -e ssh me@my_server:/home/me/public_html/
2949 #+end_src
2951 Note: if you want to cron this rsync script, you will need to let
2952 =my_server= to know about your SSH public key.  Check [[http://troy.jdmz.net/rsync/index.html][this page]] as a
2953 starter.
2955 Now you can cron the two scripts above and your webapp will always be
2956 up to date with your Org agendas.
2958 Also see [[http://orgmode.org/org.html#Exporting-Agenda-Views][Exporting agenda views]] from Org manual.
2960 ** How can I get Mac OSX 10.3 iCal to import my Org-exported .ics files?
2961    :PROPERTIES:
2962    :CUSTOM_ID: iCal-import-ics-files-old
2963    :END:
2965    When using iCal under Apple MacOS X Tiger, you can create a new
2966    calendar /OrgMode/ (the default name for the calendar created by =C-c
2967    C-e c=, see the variables =org-icalendar-combined-name= and
2968    =org-combined-agenda-icalendar-file=).  Then set Org-mode to
2969    overwrite the corresponding file /~/Library/Calendars/OrgMode.ics/.
2970    You may even use AppleScript to make iCal re-read the calendar files
2971    each time a new version of /OrgMode.ics/ is produced.  Here is the
2972    setup needed for this:
2974    : (setq org-combined-agenda-icalendar-file
2975    :     "~/Library/Calendars/OrgMode.ics")
2976    : (add-hook 'org-after-save-iCalendar-file-hook
2977    :  (lambda ()
2978    :   (shell-command
2979    :    "osascript -e 'tell application \"iCal\" to reload calendars'")))
2981 ** How can I get Mac OSX 10.4 or later iCal to import my Org-exported .ics files?
2982    :PROPERTIES:
2983    :CUSTOM_ID: iCal-import-ics-files-new
2984    :END:
2986    For Mac OS X 10.4, you need to write the ics file to
2987    =/Library/WebServer/Documents/= and then subscribe iCalendar to
2988    =http: //localhost/orgmode.ics=
2990 ** How can I remove timestamps and todo keywords from my exported file?
2991    :PROPERTIES:
2992    :CUSTOM_ID: export-options-remove-timestamps
2993    :END:
2995 You can place an options line at the top of your org file:
2997 : #+OPTIONS: <:nil todo:nil
2999 There is a whole host of export options you can set with an in-buffer
3000 options or via global variables. See [[http://orgmode.org/manual/Export-options.html#Export-options][this section]] of the manual for a
3001 full list.
3003 ** How can I preserve faces when I export an agenda from the command line?
3004    :PROPERTIES:
3005    :CUSTOM_ID: preserving-faces-during-batch-export
3006    :END:
3008 Normally, when you export an org file or an agenda view from within
3009 emacs, htmlize will convert your face definitions to direct color css
3010 styles inlined into each =<span>= object, resulting in an HTML output
3011 that preserves the general look of your Org buffers and agenda views.
3013 Let's say you generate an export from the command line, such as the
3014 following:
3016 : emacs -batch -l ~/.emacs -eval '(org-batch-agenda "e")'
3020 : emacs -batch -l ~/.emacs -eval '(org-publish-all)'
3022 In such an instance, the exported HTML will contain only very basic
3023 color styles. The reason is that when Emacs is run in batch mode, it
3024 does not have a display and therefore only rudimentary face
3025 definitions.  If you'd like to use more complex styles, you'll have to
3026 make sure that the export process only assigns classes instead of
3027 direct color values.  This can be done by binding the variable
3028 =org-export-htmlize-output-style= to =css= for the duration of the
3029 export, for example with
3031 : emacs -batch -l ~/.emacs
3032 :   -eval '(let ((org-export-htmlize-generate-css (quote css)))
3033 :            (org-batch-agenda "e"))'
3035 Then you can use a style file to make these classes look any way you
3036 like.  To generate face definitions for a CSS file based on any faces
3037 you are currently using in Emacs, you can use the following command:
3039 : M-x org-export-htmlize-generate-css RET
3041 This will generate a =<style>...</style>= section, the content of
3042 which you can add to your style file.
3044 ** How can I avoid dark color background when exporting agenda to ps format?
3045    :PROPERTIES:
3046    :CUSTOM_ID: avoiding-dark-background-when-exporting-agenda
3047    :END:
3049 Add this to your .emacs and evaluate it.
3051 #+BEGIN_SRC emacs-lisp
3052   (setq org-agenda-exporter-settings
3053         '((ps-print-color-p 'black-white)))
3054 #+END_SRC
3056 ** How can I include e.g. an abstract in export to Latex and HTML?
3057    :PROPERTIES:
3058    :CUSTOM_ID: include-abstract-in-export-to-latex-and-html
3059    :END:
3061 Org does not currently have special markup for abstracts, but for
3062 export purposes, you can extend the block-level structural and
3063 semantic markup in Org with the contributed package [[file:org-contrib/org-special-blocks.org][org-special-blocks]]
3064 (by Chris Gray). To turn it on, put this in your =.emacs=:
3066 : (require 'org-special-blocks)
3068 Now, you can mark up the abstract of your article like this:
3070 : #+BEGIN_ABSTRACT
3071 : Falling apples were observed and compared with pears. Newton's laws
3072 : were confirmed at the 95% confidence level.
3073 : #+END_ABSTRACT 
3075 Exporting to Latex wraps this in a
3076 =\begin{abstract}....\end{abstract}= environment, which just works.
3078 HTML export wraps it in a ~<div class="abstract">...</div>~
3079 element. The HTML result won't look like anything special until you
3080 style it. Here is some sample CSS to get you started; put these in
3081 your document header:
3083 : #+STYLE: <style>.abstract {margin: 1em; padding: 1em; border: 1px solid black}
3084 : #+STYLE: .abstract:before {content: "Abstract: "; font-weight: bold}</style>
3086 Generally, =#+begin_foo= will work for any simple Latex =foo=
3087 environment not supported by existing Org markup.
3089 If you need to pass parameters, process the block content in some way,
3090 or support other exporters, you may want to consider whether you can
3091 customize it using Eric Schulte's [[file:org-contrib/org-exp-blocks.org][org-exp-blocks]] instead.
3093 ** How can I get colored source code when exporting to LaTeX?
3094    :PROPERTIES:
3095    :CUSTOM_ID: fontified_source_code_w_latex
3096    :END:
3098 As of Sun Aug 9 2009 the "current" version of Org-mode (see
3099 [[keeping-current-with-Org-mode-development]]) supports exporting
3100 source code to LaTeX using the listings package.
3102 To turn on listing export add the following to your Org-mode
3103 customization.
3104 #+begin_src emacs-lisp
3105   ;; requite org-latex so that the following variables are defined
3106   (require 'org-latex)
3108   ;; tell org to use listings
3109   (setq org-export-latex-listings t)
3111   ;; you must include the listings package
3112   (add-to-list 'org-export-latex-packages-alist '("" "listings"))
3114   ;; if you want colored source code then you need to include the color package
3115   (add-to-list 'org-export-latex-packages-alist '("" "color"))
3116 #+end_src
3118 The listings package will now be used to fontify source code in your
3119 LaTeX documents.  By default listings will not color any of your
3120 source code.  If you would like to set colors for keywords and
3121 comments in your latex documents you can do so using LaTeX directives
3122 like the following.
3123 #+begin_src latex
3124   \lstset{keywordstyle=\color{blue},
3125     commentstyle=\color{red},
3126     stringstyle=\color{green}
3127   }
3128 #+end_src
3130 of if you want to get even fancier with your colors you can try
3131 something like the following
3132 #+begin_src latex
3133 \definecolor{keywords}{RGB}{255,0,90}
3134 \definecolor{comments}{RGB}{60,179,113}
3135 \definecolor{fore}{RGB}{249,242,215}
3136 \definecolor{back}{RGB}{51,51,51}
3137 \lstset{
3138   basicstyle=\color{fore},
3139   keywordstyle=\color{keywords},
3140   commentstyle=\color{comments},
3141   backgroundcolor=\color{back}
3143 #+end_src
3145 For more complex listings use cases consult the [[ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/listings/listings.pdf][listings manual]].
3147 ** How can I export to Latex Beamer
3148    :PROPERTIES:
3149    :CUSTOM_ID: beamer
3150    :END:
3151 The latex [[http://latex-beamer.sourceforge.net/][Beamer Class]] is a useful class for generating slide shows.
3152 The following can be used to export Org-mode documents to LaTeX
3153 beamer.
3155 Add the following to your Emacs initialization file.
3156 #+begin_src emacs-lisp
3157   (unless (boundp 'org-export-latex-classes)
3158     (setq org-export-latex-classes nil))
3159   (add-to-list 'org-export-latex-classes
3160                '("beamer"
3161                  "\\documentclass[11pt]{beamer}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{hyperref}\n\\usepackage{verbatim}\n"
3162                  ("\\section{%s}" . "\\section*{%s}")
3163                  ("\\begin{frame}\\frametitle{%s}" "\\end{frame}"
3164                   "\\begin{frame}\\frametitle{%s}" "\\end{frame}")))
3165 #+end_src
3167 Then by placing
3168 : #+LaTeX_CLASS: beamer
3169 in the header of your Org-mode document it will automatically export
3170 to the Beamer document class on LaTeX export.  With the above
3171 configuration top-level headers will be mapped to sections in the
3172 Beamer document, second-level headers will be mapped to frames, and
3173 lower level headlines will be mapped to itemize objects.
3175 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
3176 Thomas Dye]].  For a much more complex Beamer setup see the [[http://article.gmane.org/gmane.emacs.orgmode/17767/match=beamer+dokos][email by
3177 Thomas Dye]].
3179 ** How can I use RefTeX in Org-mode files for LaTeX export and in Org-babel LaTeX code blocks?
3180    :PROPERTIES:
3181    :CUSTOM_ID: using-reftex-in-org-mode
3182    :END:
3184 [[http://www.gnu.org/software/auctex/reftex.html][RefTeX]] is an indispensable tool for the author of LaTeX documents.  It
3185 aids in creation of bibliographies, cross-references, indexes, and
3186 glossaries.  RefTeX understands the structure of multi-file LaTeX
3187 documents and is able to collect from them information about the
3188 location(s) of external data stores used in creation of the final
3189 document.  RefTeX was written by Carsten Dominik and is currently
3190 being maintained by the [[http://www.gnu.org/software/auctex/index.html][AucTeX]] project.
3192 *** Using RefTeX In Org-mode Files for LaTeX Export
3193 In Org-mode files for LaTeX export, the trick is to find a way to tell
3194 RefTeX the locations of external data stores.  One way is to set the
3195 variable, =reftex-default-bibliography=.  Add lines like these to
3196 .emacs:
3198 #+begin_src emacs-lisp
3199   (setq reftex-default-bibliography
3200         (quote
3201          ("default.bib" "other-default.bib")))
3202 #+end_src
3204 In practice, this is a limited solution and the
3205 typical user will want to pass this information on a per-file basis.
3206 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
3207 Braindump]].
3209 The first solution, proposed by Mario, enables the RefTeX citation
3210 function in Org-mode.  Add these lines to .emacs:
3212 #+begin_src emacs-lisp
3213   (defun org-mode-reftex-setup ()
3214     (load-library "reftex")
3215     (and (buffer-file-name)
3216          (file-exists-p (buffer-file-name))
3217          (reftex-parse-all))
3218     (define-key org-mode-map (kbd "C-c )") 'reftex-citation))
3219   (add-hook 'org-mode-hook 'org-mode-reftex-setup)
3220 #+end_src
3222 Then add the following lines anywhere in the Org-mode file (Org-mode
3223 will recognize them as LaTeX commands):
3225 #+begin_src org
3226 \bibliographystyle{plain}
3227 \bibliography{BIB-NAME}
3228 #+end_src
3230 With this setup, =C-c )= will invoke =reftex-citation= which will
3231 insert a reference in the usual way:
3233 #+begin_src org
3234   ,* test reftex
3236   ,This is a citation \cite{tierney90}.
3238   ,\bibliographystyle{plain}
3239   ,\bibliography{tsd}
3240 #+end_src
3242 This Org-mode file will export the following LaTeX output:
3244 #+begin_src latex :exports code
3245   % Created 2010-03-22 Mon 14:34
3246   \documentclass[11pt,letter]{article}
3247   \usepackage[utf8]{inputenc}
3248   \usepackage[T1]{fontenc}
3249   \usepackage{hyperref}
3251   \title{test.org}
3252   \author{Tom Dye}
3253   \date{2010-03-22 Mon}
3255   \begin{document}
3257   \maketitle
3259   \setcounter{tocdepth}{3}
3260   \tableofcontents
3261   \vspace*{1cm}
3263   \section{test reftex}
3264   \label{sec-1}
3267   This is a citation \cite{tierney90}.
3269   \bibliographystyle{plain}
3270   \bibliography{tsd}
3272   \end{document}
3273 #+end_src
3276 A second solution, to activate the RefTeX minor mode on a per-file
3277 basis, was posted by Kevin Brubeck Unhammer in response to this idea.
3278 Add the following lines to .emacs:
3280 #+begin_src emacs-lisp
3281   (add-hook ‘org-mode-hook
3282              (lambda ()
3283                (if (member “WRITE” org-todo-keywords-1)
3284                    (org-mode-article-modes))))
3285 #+end_src
3287 where =org-mode-article-modes= is defined as follows:
3289 #+begin_src emacs-lisp
3290   (defun org-mode-article-modes ()
3291     (reftex-mode t)
3292     (bib-cite-minor-mode t)
3293     (and (buffer-file-name)
3294          (file-exists-p (buffer-file-name))
3295          (reftex-parse-all)))
3296 #+end_src
3298 Add the =\bibliographystyle{}= and =\bibliography{}= lines to the
3299 Org-mode file as before and define a TODO keyword, =WRITE=, perhaps
3300 like this:
3302 #+begin_src org
3303   ,#+TODO: TODO(t) STARTED(s) WRITE | DONE(d) DEFERRED(f)
3304 #+end_src
3306 With this setup, you insert a citation with =M-x reftex-citation RET=.
3308 *** Using RefTeX in Org-babel LaTeX Code Blocks
3310 In Org-babel LaTeX code blocks, the trick is to give RefTeX access to
3311 information in other Org-babel LaTeX code blocks.  If you use an Emacs
3312 starter kit where configuration information is held in Org-mode files,
3313 then the second solution is preferable because you won't be asked for
3314 a master file when Emacs is started.  For this reason, the second
3315 solution is modified for use with Org-babel latex code blocks.  No
3316 key-binding is needed here because Org-babel code blocks are edited
3317 within the usual AucTeX environment.
3319 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]])
3320 #+begin_src emacs-lisp
3321   (defun org-mode-article-modes ()
3322     (reftex-mode t)
3323     (and (buffer-file-name)
3324          (file-exists-p (buffer-file-name))
3325          (reftex-parse-all)))
3327   (add-hook 'org-mode-hook
3328             (lambda ()
3329               (if (member "REFTEX" org-todo-keywords-1)
3330                   (org-mode-article-modes))))
3331 #+end_src
3333 Then add a line like the following line to the top of your org-mode file:
3335 #+begin_src org
3336   ,#+TODO: TODO(t) STARTED(s) | DONE(d) DEFERRED(f) REFTEX
3337 #+end_src
3339 When you open an org-mode file with a line like this, RefTeX will
3340 prompt for the master .tex file, which will be parsed in the usual
3341 way.  This means that the .tex file should already exist, perhaps by
3342 tangling the LaTeX preamble and postamble, before
3343 =org-mode-article-modes= is activated for the Org-mode file.
3345 ** How can I use XeLaTeX for LaTeX export instead of pdfLaTeX?
3346    :PROPERTIES:
3347    :CUSTOM_ID: using-xelatex-for-pdf-export
3348    :END:
3349 [[http://en.wikipedia.org/wiki/XeTeX][ XeLaTeX]] is an alternative to pdfLaTeX for typesetting LaTeX
3350 documents. XeTeX can use any fonts installed in the operating system
3351 without configuring TeX font metrics, and can make direct use of
3352 advanced typographic features of OpenType and other font formats. By
3353 default, org-mode exports =org= files to =pdf= via pdfLaTeX. 
3355 Here is one way to smoothly incorporate XeLaTeX into org-mode's export
3356 process. This solution takes advantage of [[http://www.phys.psu.edu/~collins/software/latexmk-jcc][latexmk]], a perl script that
3357 intelligently and automatically manages latex compilation. It
3358 is included with TeXLive, but at present the version included is not
3359 quite up-to-date enough for our needs. Version 4.20 and higher
3360 includes an option allowing you to specify which program to use when
3361 "pdflatex" is called. Install a current version of latexmk as per the
3362 instructions on the [[http://www.phys.psu.edu/~collins/software/latexmk-jcc][latexmk]] site. If necessary, disable the older
3363 version that comes with TeXLive. This is likely in =/usr/texbin/=, and
3364 you should rename or remove it. Then you can put the following in your
3365 =~/.emacs.d/= or equivalent:
3367 #+begin_src emacs-lisp
3368   (require 'org-latex)
3369   (setq org-export-latex-listings t)
3370   
3371   ;; Originally taken from Bruno Tavernier: http://thread.gmane.org/gmane.emacs.orgmode/31150/focus=31432
3372   ;; but adapted to use latexmk 4.20 or higher.  
3373   (defun my-auto-tex-cmd ()
3374     "When exporting from .org with latex, automatically run latex,
3375        pdflatex, or xelatex as appropriate, using latexmk."
3376     (let ((texcmd)))
3377     ;; default command: oldstyle latex via dvi
3378     (setq texcmd "latexmk -dvi -pdfps -quiet %f")        
3379     ;; pdflatex -> .pdf
3380     (if (string-match "LATEX_CMD: pdflatex" (buffer-string))
3381         (setq texcmd "latexmk -pdf -quiet %f"))
3382     ;; xelatex -> .pdf
3383     (if (string-match "LATEX_CMD: xelatex" (buffer-string))
3384         (setq texcmd "latexmk -pdflatex=xelatex -pdf -quiet %f"))
3385     ;; LaTeX compilation command
3386     (setq org-latex-to-pdf-process (list texcmd)))
3387   
3388   (add-hook 'org-export-latex-after-initial-vars-hook 'my-auto-tex-cmd)
3389   
3390   
3391   ;; Specify default packages to be included in every tex file, whether pdflatex or xelatex
3392   (setq org-export-latex-packages-alist
3393         '(("" "graphicx" t)
3394               ("" "longtable" nil)
3395               ("" "float" nil)))
3396     
3397   (defun my-auto-tex-parameters ()
3398         "Automatically select the tex packages to include."
3399         ;; default packages for ordinary latex or pdflatex export
3400         (setq org-export-latex-default-packages-alist
3401               '(("AUTO" "inputenc" t)
3402                 ("T1"   "fontenc"   t)
3403                 (""     "fixltx2e"  nil)
3404                 (""     "wrapfig"   nil)
3405                 (""     "soul"      t)
3406                 (""     "textcomp"  t)
3407                 (""     "marvosym"  t)
3408                 (""     "wasysym"   t)
3409                 (""     "latexsym"  t)
3410                 (""     "amssymb"   t)
3411                 (""     "hyperref"  nil)))
3412     
3413         ;; Packages to include when xelatex is used
3414         (if (string-match "LATEX_CMD: xelatex" (buffer-string))
3415             (setq org-export-latex-default-packages-alist
3416                   '(("" "fontspec" t)
3417                     ("" "xunicode" t)
3418                     ("" "url" t)
3419                     ("" "rotating" t)
3420                     ("american" "babel" t)
3421                     ("babel" "csquotes" t)
3422                     ("" "soul" t)
3423                     ("xetex" "hyperref" nil)
3424                     )))
3425         
3426         (if (string-match "LATEX_CMD: xelatex" (buffer-string))
3427             (setq org-export-latex-classes
3428                   (cons '("article"
3429                           "\\documentclass[11pt,article,oneside]{memoir}"
3430                           ("\\section{%s}" . "\\section*{%s}")
3431                           ("\\subsection{%s}" . "\\subsection*{%s}")
3432                           ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
3433                           ("\\paragraph{%s}" . "\\paragraph*{%s}")
3434                           ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
3435                         org-export-latex-classes))))  
3436       
3437   (add-hook 'org-export-latex-after-initial-vars-hook 'my-auto-tex-parameters)  
3438 #+end_src
3440 The =my-auto-tex-cmd= function looks at your =.org= file and checks
3441 whether you've specified which latex to use. If there are no
3442 instructions, it just runs regular old latex. If it finds the string
3443 =LATEX_CMD: pdflatex= in your file, it runs pdflatex. If it finds
3444 =LATEX_CMD: xelatex=, it runs xelatex. Because control is handed off
3445 to latexmk, nothing else is needed: it takes care of figuring things
3446 out so that the references and citations are correct.
3448 The second half of the code above specifies the latex packages that
3449 will be included in the =.tex= file. The variable
3450 =org-export-latex-packages-alist= specifies a list of packages that
3451 are always included in the header of latex documents, regardless of
3452 how they are compiled. The variable
3453 =org-export-latex-default-packages-alist= adds additional packages
3454 depending on whether latex/pdflatex or xelatex is being used. You can
3455 change the content of these as needed. 
3457 Finally, the =org-export-latex-classes= variable redefines elements of
3458 the =.tex= file's preamble for the xelatex case. These can also be
3459 customized as needed. 
3461 By way of example, an =.org= file you want compiled with xelatex might
3462 contain the following header:
3464 : #+TITLE: My Paper
3465 : #+AUTHOR: Jane Doe
3466 : #+DATE: 
3467 : #+OPTIONS: toc:nil num:nil
3468 : #+LATEX_CMD: xelatex
3469 : #+LATEX_HEADER: \setsansfont[Mapping=tex-text]{Unit-Bold} 
3470 : #+LATEX_HEADER: \setmonofont[Mapping=tex-text,Scale=MatchLowercase]{PragmataPro} 
3471 : #+LATEX_HEADER: \setromanfont[Mapping=tex-text,Numbers=OldStyle]{Minion Pro}
3473 If you always want to have the same font setup in your xelatex
3474 documents, the =fontspec= commands setting the font choices can be
3475 put in the =org-export-latex-classes= setting instead.
3477 The upshot is that when you want to export an =.org= file using
3478 XeLaTeX, you can now simply make sure the line =LATEX_CMD: xelatex= is
3479 in your =.org= file, then do =C-c C-e d= as usual, and org-mode, with
3480 latexmk in the background, does the rest for you.
3482 ** Why is my exported PDF file almost unreadable?
3483    :PROPERTIES:
3484    :CUSTOM_ID: unreadable-pdfs
3485    :END:
3487 Some PDF viewers (earlier versions (< v6) of Acrobat Reader, Evince,
3488 possibly others) do not get along with Adobe Type3 fonts, producing
3489 almost unreadable screen output (printed output is OK). If you see
3490 this, first verify the fonts that your document uses: open it with
3491 Acrobat Reader or Evince, select "Properties" from the "File" menu and
3492 click on the "Fonts" tab; alternatively, you can use the pdffonts
3493 program (part of the xpdf-reader package) from the command line.  If
3494 that is indeed the problem, then either use a different viewer or
3495 install Type1 versions of the problematic fonts. For more details, see
3496 the "PDF export" section of [[./org-dependencies.org][org-dependencies]].
3498 ** Can I add attributes to a link or an image in HTML export?
3499    :PROPERTIES:
3500    :CUSTOM_ID: html-image-and-link-attributes
3501    :END:
3503 Yes.  Excerpt from [[http://orgmode.org/manual/Images-in-HTML-export.html#Images-in-HTML-export][Org's manual]]:
3505 If you need to add attributes to an inlined image, use a `#+ATTR_HTML'.
3506 In the example below we specify the `alt' and `title' attributes to
3507 support text viewers and accessibility, and align it to the right.
3509 :  #+CAPTION: A black cat stalking a spider
3510 :  #+ATTR_HTML: alt="cat/spider image" title="Action!" align="right"
3511 :  [[./img/a.jpg]]
3513 and you could use `http' addresses just as well.
3515 ** How can I export an org file to rtf, odt (Open Office), or doc (Word)?
3516    :PROPERTIES:
3517    :CUSTOM_ID: convert-to-open-office
3518    :END:
3520 There are two approaches:
3521 - Use the development version of Org->Odt exporter
3523   A native Org to OpenDocumentText exporter is in the works. The
3524   exporter is currently not part of Orgmode repository.  See the
3525   following [[http://lists.gnu.org/archive/html/emacs-orgmode/2011-01/msg01210.html][Announcement]] on the mailing list for further details.
3526   
3527   At the moment, the exporter supports the following most commonly
3528   used features of Org
3529   - Various Character Styles
3530   - Various Paragraph Styles (including Source Blocks)
3531   - Embedded ODT
3532   - Embedded MathML
3533   - Numbered, Bulleted and Description lists
3534   - Embedding and Resizing of Images including embedding of LaTeX
3535     fragments
3536   - Fuzzy, Dedicated and Radio Targets and Links
3537   - Tables
3538   - Footnotes
3539   - Special markups for elements like TODOs, Timestamps and Tags
3542 - Use existing exporters 
3544   Export to one of org-mode's supported export formats and then use an
3545   external tool or method to convert the exported file to doc or odt.
3547   With simple documents, these methods work well. However for complex
3548   documents containing footnotes, embedded images, math formuale etc
3549   the results may be less than satisfactory. (Note, the lists below
3550   are by no means comprehensive).
3551   1. html -> odt/doc/rtf
3552      - open html in Open Office and save as odt/doc ([[http://permalink.gmane.org/gmane.emacs.orgmode/31482][see this post by
3553         Eric Fraga]])
3554      - [[http://www.artofsolving.com/opensource/pyodconverter][PyODConverter]]
3555      - [[http://johnmacfarlane.net/pandoc/][Pandoc]] (this works for LaTeX and docbook as well)
3556      - (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
3557         from html to doc
3558   2. LaTeX -> odt/doc/rtf
3559       - [[http://latex2rtf.sourceforge.net/][LaTeX2rtf]] (works well with index, footnotes, and references)
3560       - [[http://www.tug.org/tex4ht/][TeX4ht]] (works with more complex latex elements, though can be
3561         difficult to install)
3562         - run =mk4ht oolatex file.tex=
3564 See [[http://permalink.gmane.org/gmane.emacs.orgmode/31168][this thread]] for further details.
3566 * Backup
3568 Since =org= files are so central to your life, you probably want to back
3569 them up in a safe place.
3571 If the =org= file you want to back up are in a single directory, the
3572 preferred method is to us a =RCS= (Revision Control System) -- pick up your
3573 favorite ([[http://git-scm.com/][git]], [[http://bazaar.canonical.com/en/][bazaar]], [[http://mercurial.selenic.com/][mercurial]], [[http://subversion.apache.org/][subversion]], [[http://www.nongnu.org/cvs/][cvs]], etc.).  Depending on the
3574 RCS you use and how you use it, you can have a /local/ backup or sync it on
3575 a remote place.
3577 If you want to store all your =org= files from your =$HOME= to a single
3578 =~/org/backup/= folder, you can use this shell script (as [[http://article.gmane.org/gmane.emacs.orgmode/37655][suggested by
3579 Suvayu Ali]]):
3581 #+begin_src sh
3582 mkdir -p ~/org/backup && \
3583 find $HOME -type f -name '*\.org' ! -path "$HOME/org/*" \
3584      -exec cp -t ~/org/backup/ \{\} \;
3585 #+end_src
3587 It will recursively search for =org= files in your =$HOME= directory
3588 (except those in =~/org/backup/=) and copy them to =~/org/backup/=.
3589 You can then use rsync to make sure =~/org/backup/= also lives on a 
3590 remote and safe place.
3592 * MobileOrg
3594 ** Which versions of MobileOrg do exist
3595    :PROPERTIES:
3596    :CUSTOM_ID: mobileorg_versions
3597    :END:
3599 - MobileOrg for the iPhone/iPod Touch/iPad series of devices, by
3600   Richard Moreland.  Check out
3601   [[http://mobileorg.ncogni.to/][Richard's page]]
3602 - Matt Jones is developing a feature-equivalent application for
3603   Android, see
3604   [[http://wiki.github.com/matburt/mobileorg-android/][his project page]].
3606 ** What can I do if I don't want to use Dropbox.com
3607    :PROPERTIES:
3608    :CUSTOM_ID: mobileorg_webdav
3609    :END:
3611 Dropbox.com is the easiest way to connect between Emacs and MobileOrg,
3612 you can get a free account there.  If for some reason you cannot or do
3613 not want to use this path, you can use any webdav server.  On this
3614 webdav server you need to create a dedicated directory for the
3615 communication between Emacs and MobileOrg.  If you can mount that
3616 directory locally so that Emacs can directly write to it, just point
3617 to that directory using the variable =org-mobile-directory=.  Using
3618 the /tramp/ method, =org-mobile-directory= may point to a remote
3619 directory accessible through, for example, /ssh/ and /scp/:
3621 #+begin_src emacs-lisp
3622 (setq org-mobile-directory "/scpc:user@@remote.host:org/webdav/")
3623 #+end_src
3625 If Emacs cannot access the WebDAV directory directly using a /tramp/
3626 method, you can use a local directory for staging.  Other means must
3627 then be used to keep this directory in sync with the WebDAV directory.
3628 In the following example, files are staged in =~/stage/=, and Org-mode
3629 hooks take care of moving files to and from the WebDAV directory using
3630 /scp/.
3632 #+begin_src emacs-lisp
3633 (setq org-mobile-directory "~/stage/")
3634 (add-hook 'org-mobile-post-push-hook
3635   (lambda () (shell-command "scp -r ~/stage/* user@@wdhost:mobile/")))
3636 (add-hook 'org-mobile-pre-pull-hook
3637   (lambda () (shell-command "scp user@@wdhost:mobile/mobileorg.org ~/stage/ ")))
3638 (add-hook 'org-mobile-post-pull-hook
3639   (lambda () (shell-command "scp ~/stage/mobileorg.org user@@wdhost:mobile/")))
3640 #+end_src
3642 * Mathjax
3644 ** How to install MathJax on my server?
3645    
3646 :PROPERTIES:
3647 :CUSTOM_ID: install_mathjax_on_server
3648 :END:
3650 Org uses MathJax as its default HTML display engine for equations.
3652 Org relies on the version of MathJax available from orgmode.org, but you
3653 might want to use another version and install MathJax on your own server.
3655 1. Download a [[http://sourceforge.net/projects/mathjax/files/][MathJax archive]].
3657 2. Upload it somewhere on your server (say http://me.org/mathjax/)
3659 3. Set the correct path in =org-export-html-mathjax-options= (i.e. replace
3660    http://orgmode.org/mathjax/MathJax.js by
3661    http://me.org/mathjax/MathJax.js)
3663 You can also get [[http://www.mathjax.org/resources/docs/?installation.html][MathJax from git or svn]] -- in this case, be careful not to
3664 forget to unzip the fonts.zip archive in the mathjax directory.
3666 * COMMENT Function to create =CUSTOM_ID=
3668 #+begin_src emacs-lisp
3669   (defun org-faq-make-target ()
3670     "Make hard target for current headline."
3671     (interactive)
3672     (if (not (org-on-heading-p))
3673         (error "Not on a headline"))
3674     (let ((h (org-trim (org-get-heading 'no-tags))))
3675       (if (string-match "[ \t]*\\?\\'" h)
3676           (setq h (replace-match "" t t h)))
3677       (while (string-match "[ \t]+" h)
3678         (setq h (replace-match "-" t t h)))
3679       (org-entry-put nil "CUSTOM_ID" h)))
3680 #+end_src