Merge branch 'master' of git+ssh://repo.or.cz/srv/git/Worg
[Worg.git] / org-faq.org
blob422efc248431d64e616d0b3c4c42e0d362729df0
1 #+STARTUP:   overview
2 #+OPTIONS:   H:2 num:t toc:t \n:nil @:t ::t |:t ^:t *:t TeX:t
3 #+EMAIL:     carsten.dominik@gmail.com
4 #+AUTHOR:    Worg people
5 #+LANGUAGE:  en
6 #+TITLE:     Org-mode Frequently Asked Questions
7 #+INFOJS_OPT: view:content toc:1 path:http://orgmode.org/worg/code/org-info-js/org-info.js tdepth:1 ftoc:t buttons:0 mouse:underline
8 #+OPTIONS:   H:3 num:nil toc:t \n:nil @:t ::t |:t ^:{} -:t f:t *:t TeX:t LaTeX:t skip:nil d:(HIDE) tags:not-in-toc
10 #+begin_html
11 <a href="/"><img src="http://orgmode.org/img/org-mode-unicorn.png" class="logo-link" /></a>
12 #+end_html
14 [[file:index.org][{Back to Worg's index}]]
16 * Welcome
17   :PROPERTIES:
18   :CUSTOM_ID: Welcome
19   :END:
21 Welcome to the Org-mode FAQ.
23 You can navigate the FAQ by clicking on any of the topics in the Table of
24 Contents.
26 If your browser supports JavaScript, you can...
28 - move through the topics by typing "=n=" (next) and "=p=" (previous).
30 - see an outline view of the FAQ by typing "=m=" or clicking "=toggle
31   view=" (above).
33 - search the FAQ by typing "=s=" (basic search) or "=o=" (occur tree).
35 - see a full list of navigation commands by typing "=?=" or clicking
36   "=Help=" (above).
38 * What is org-mode?
39   :PROPERTIES:
40   :CUSTOM_ID: What-is-org-mode
41   :END:
42 ** Can I implement a GTD workflow with Org-mode?
43    :PROPERTIES:
44    :CUSTOM_ID: GTD-workflow-with-Org-mode
45    :END:
47    Yes, you can.  Check for discussions and pointers [[http://orgmode.org/worg/org-gtd-etc.html][here]].
49 ** What is the difference between Org and TaskPaper?
50    :PROPERTIES:
51    :CUSTOM_ID: Org-and-TaskPaper
52    :END:
54   There is really no difference.  Org is as /simple/ as [[http://hogbaysoftware.com/products/taskpaper][TaskPaper]].  It
55   is just that, when using Org within Emacs, it lets you do many things
56   that you wouldn't be able to do with TaskPaper.  Yes, TaskPaper is
57   fiddle-proof and people using Emacs tends to like fiddling (which is
58   orthogonal to the idea of using todo-list efficiently), but this is
59   just a matter of discipline and common sense, not one of Org's design.
61   Read [[http://article.gmane.org/gmane.emacs.orgmode/6224][Carsten's enlightening statement]] on this.
62 ** What is the meaning of the Unicorn on Org's website?
63    :PROPERTIES:
64    :CUSTOM_ID: unicorn
65    :END:
67 The Unicorn is the logo of Org-mode because:
69 - Org-mode is the UNICs of ORgaNizers.
71 - Org-mode is an Emacs mode, so it makes sense to use an animal
72   similar or related to the gnu used for GNU Emacs.
74 - Org-mode is meant to show you the way, and an animal with two horns
75   can not do this very well, can it?
77 - Unicorn tears are said to reverse petrification, and wasn't this how
78   we all felt before getting to some degree of time and task
79   management?
81 - It will take forever to learn everything there is to know about a
82   unicorn.
84 - A unicorn is a fabulous creature.  Org-mode wants to be a fabulous
85   creation.
87 Using a unicorn was originally /Bastien Guerry's/ idea, his friend
88 /Christophe Bataillon/ designed the logo for us, and /Greg Newman/
89 gave it a refresh some time later.  Bastien writes why he chose a
90 unicorn:
92 #+BEGIN_QUOTE
93 The first reason is not linked to the animal, but to the sounding of the
94 word "Unicorn" - because Org gives you a /uni/que way of producing files
95 in several format (HTML, LaTeX, etc.)
97 The second reason is that a Unicorn doesn't really exist, it is just
98 something you can dream about, and make others believe it does exist.
99 Just like the perfect organizer.
100 #+END_QUOTE
102 There was a [[http://thread.gmane.org/gmane.emacs.orgmode/11641/focus%3D11641][thread about unicorns]] on the mailing list.  [[http://thread.gmane.org/gmane.emacs.orgmode/11641/focus%3D11641][Christopher
103 Suckling]] posted a link showing how to make a simple foldable unicorn
104 (very appropriate for an outlining program!).
106 [[http://article.gmane.org/gmane.emacs.orgmode/11735][Tim Burt]] made a very complicated one which is now a treasured
107 possession of the Org-mode author.
109 - Official logo: [[http://orgmode.org/img/org-mode-unicorn.png]]
110   This logo is available in a number of different formats including
111   Photoshop /.psd/ and scaleable vector graphics /.svg/ [[http://orgmode.org/img/][here]].
113 - An [[http://orgmode.org/img/nrocinu4.jpg][alternative version]] from Christophe Bataillon (c):
115 - [[http://article.gmane.org/gmane.emacs.orgmode/14293][Chris Randle]] made a [[http://orgmode.org/img/nrocinu.txt][text version]] using the logo and [[http://glassgiant.com][glassgiant.com]]:
117 - [[http://article.gmane.org/gmane.emacs.orgmode/14362][Stefan Vollmar]] made a [[http://orgmode.org/img/nrocinu.pdf][pdf version]] (here in [[http://orgmode.org/img/nrocinu_pdf.png][png]]) using "a simple
118   threshold technique".
120 - [[http://article.gmane.org/gmane.emacs.orgmode/11735/match%3D][Tim Burt]] made a folded Unicorn to match the spirit of Org - see the
121   whole set of pictures [[http://www.flickr.com/photos/tcburt/sets/72157614543357071/][on his flickr page]].
123 - Are unicorns real?  Answer [[http://article.gmane.org/gmane.emacs.orgmode/11687/match%3Drosslaird%2Bunicorn][here]] by Ross Laird.
125 * Mailing list
126 ** Why hasn't my email to the mailing list shown up yet?
127    :PROPERTIES:
128    :CUSTOM_ID: ml-post-delay
129    :END:
131 The org-mode mailing list is moderated. Thus, if you are not
132 subscribed to the mailing list, your mail will only appear on the list
133 after it has been approved by a moderator. To ensure that your mail
134 appears quickly, please [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe to the list]].
136 ** I read the mailing list through gmane. Should I subscribe?
137    :PROPERTIES:
138    :CUSTOM_ID: ml-subscription-and-gmane
139    :END:
141 The org-mode mailing list is available via nntp at [[http://dir.gmane.org/gmane.emacs.orgmode][Gmane]]. Many
142 participants in the list prefer read the list in a newsreader, such as
143 Gnus, instead of receiving emails. If you choose to read the list via
144 nntp, you can still [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe]] to the list and then opt not to receive
145 any emails on the mailman settings page (see the "Mail Delivery"
146 setting).
148 This will ensure that your messages to the list get through quickly,
149 reduce the work load of the mailing list moderators (who need to clear
150 every mail from non-members), and provide more accurate information
151 about the number of list readers.
153 * Keeping current
154   :PROPERTIES:
155   :CUSTOM_ID: Keeping-current
156   :END:
157 ** My Emacs ships with an older version Org-mode! How do I upgrade?
158    :PROPERTIES:
159    :CUSTOM_ID: updating-org
160    :END:
162 Org-mode develops quickly, which means that versions of Org-mode
163 shipped with Emacs are more or less out-of-date. If you'd like to
164 upgrade to the most recent version of org-mode, you have a number of
165 options.
167  1. Download the most recent release of org-mode ([[http://orgmode.org/org-7.3.zip][zip]] or [[http://orgmode.org/org-7.3.tar.gz][tarball]]) and
168     follow the [[http://orgmode.org/manual/Installation.html#Installation][installation instructions]] in the manual.
169  2. Clone and install the development git repository as [[#keeping-current-with-Org-mode-development][explained
170     here]]. If you don't want to run the bleeding edge, you can still
171     use git [[#using-stable-releases-only][to track the most recent stable releases]].
172  3. Install and updated org-mode automatically through the Emacs
173     Package Manager as [[#installing-via-elpa][explained in this FAQ]].
175 ** How do I keep current with bleeding edge development?
176    :PROPERTIES:
177    :CUSTOM_ID: keeping-current-with-Org-mode-development
178    :END:
180    Org mode is developed in [[http://en.wikipedia.org/wiki/Git_(software)][Git]]. You can keep up-to-date with Org-mode
181    developement by cloning Org mode repository and refreshing your
182    copy with latest changes whenever you wish. You only need to use
183    two Git commands (clone and pull.) Here are the steps in brief
184    (please customize locations to suit your setup):
186    1. Select a location to house the Org mode repository (approx. 40
187       MB; includes documentation, compiled elisp files and history
188       going all the way back to v4.12a)
190       : $ mkdir $HOME/elisp && cd $HOME/elisp
192    2. Clone the Org mode Git repository.
194       Recommended approach:
196       : $ git clone git://orgmode.org/org-mode.git
198       You can also clone from this mirror (lagging one hour behind
199       orgmode.org repo):
201       : $ git clone git://repo.or.cz/org-mode.git
203       For those of you behind a firewall that allows only HTTP, you can
204       clone like this (can be somewhat slow), either from orgmode.org or
205       from repo.or.cz:
207       : $ git clone http://orgmode.org/org-mode.git
208       : $ git clone http://repo.or.cz/r/org-mode.git
210    3. Compile and install Org mode and build documentation.
212       : $ cd org-mode && make && make doc && make install
214       Please note that you can choose to /not/ compile at all and run
215       using source =.el= files only.  Compiled files speed things up.
217       Also note that running =make install= is necessary only if you'd
218       like to install org-mode system-wide.
220    4. This is where you configure Org mode with Emacs.  Please refer
221       to [[./org-tutorials/index.org][Org tutorials]].
223    5. Keeping up-to-date.
225       Cloning the repository is a one time activity.  From this point
226       onwards you only need to /pull/ the latest changes.
228       : $ cd $HOME/elisp/org-mode
230       and then
232       : $ git pull && make clean && make && make doc && make install
234    6. You should restart org mode to have the changes take effect (if
235       you are not rebooting Emacs.)  Also since the intention is to
236       "keep up" with Org mode, you should visit updated sections of
237       documentation for latest updates (use =git log=.)
239    7. As you use your repository over time it will accumulate loose objects.
240       You can reduce the total size of your git repository with
242       : $ git gc
244       which will consolidate loose git objects into pack files.  This
245       reduces the size of the repository and speeds up data access to
246       the objects.
248 ** How can I keep local changes and still track Org mode development?
249    :PROPERTIES:
250    :CUSTOM_ID: keeping-local-changes-current-with-Org-mode-development
251    :END:
253   Say you want to make minor changes to the Makefile to reflect your
254   location for =emacs=.
256   Create a local branch for your changes on top of origin/master as
257   follows:
259   : $ git checkout -b local origin/master
260   : $ git config branch.local.rebase true
261   : # Make your changes to the Makefile and create a new commit
262   : $ git add Makefile
263   : $ git commit -m 'My local Makefile configurations'
264   : # Update git to a newer version
265   : $ git pull
267   Now each time you pull new commits from the distribution repository
268   your local commits will be rewound and replayed on top of the new
269   origin/master.
271 -----------
273   You would normally work on your =local= branch which includes your
274   custom commits; there's no need to switch back to the =master=
275   branch.
277 -----------
279 Here is an example of dealing with conflict resolution during git pull.
281 If you get a conflict during a =git pull= you will need to edit the
282 file with the conflict to fix up the conflicting lines and then tell
283 git that you have resolved the conflict.
285 Conflict resolution goes something like this:
287 1. =git pull= fails with a conflict
288 2. edit the file
289 3. =git add= the file to mark the conflict resolved
290 4. =git rebase --continue=
291 5. lather, rinse, and repeat 2-4 as needed
293 For this example we have the following Makefile:
295 : #
296 : # Example Makefile
297 : #
299 : EMACS=emacs
301 : VERSION=V1.0
303 and we need to change the =EMACS=emacs= line to =EMACS=myemacs= to
304 make it work well on our system.
306 To do this we
308   - create a local branch for our work
310     : $ git checkout -b local origin/master
311     : $ git config branch.local.rebase true
313     This marks the branch so that all local commits on it are rebased
314     on top of any new commits we get in origin/master during a =git
315     pull= operation.
317   - Make our custom changes
319     Edit the makefile so it looks like this:
321     : #
322     : # Example Makefile
323     : #
324     :
325     : EMACS=myemacs
326     :
327     : VERSION=V1.0
329   - Create a commit with our custom changes
330     : $ git add Makefile
331     : $ git commit -m 'My local Makefile configurations'
333   - Later we do a =git pull= but that fails with conflicts.
335     : $ git pull
336     : remote: Counting objects: 5, done.
337     : ...
338     : Patch failed at 0001.
339     :
340     : When you have resolved this problem run "git rebase --continue".
341     : If you would prefer to skip this patch, instead run "git rebase --skip".
342     : To restore the original branch and stop rebasing run "git rebase --abort".
344   - Fix the conflict in your favourite editor
346     Conflict markers look like this:
348     : <<<<<<< HEAD:Makefile
349     : EMACS=emacs22
350     : =======
351     : EMACS=myemacs
352     : >>>>>>> Change emacs location:Makefile
354     This attempted =git pull= caused a conflict.  Fire up your
355     favourite editor and fix the conflict in the Makefile.  The
356     conflict markers are <<<<<<<<<< , ======= , and >>>>>>>>>>.  Fix
357     the Makefile appropriately and delete the conflict markers.  You
358     already edited these lines earlier so fixing it should be trivial.
360     In this case we changed =EMACS=emacs= to =EMACS=myemacs= and
361     upstream changed =EMACS=emacs= to =EMACS=emacs22=.  Just fix the
362     file and save it by deleting the conflict markers and keeping the
363     code you need (in this case the =EMACS=myemacs= line which we
364     originally modified.)
366   - Mark the file's conflict resolved
368     : $ git add Makefile
370     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.
372   - Continue the rebase operation
374     : $ git rebase --continue
376     If any other conflicts arise you fix them the same way - edit the file, mark the conflict resolved, and continue.
378 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"
379 using
380 : $ git rebase --abort
382 ** How can I use a stable release version instead of the bleeding edge master?
383    :PROPERTIES:
384    :CUSTOM_ID: using-stable-releases-only
385    :END:
387 The master branch of the git repository always contains the bleeding
388 edge development code.  This is important for Org's fast development,
389 because code on master gets checked out by many people daily and we
390 quickly receive bug reports if something is wrong.  On rare occasions,
391 this code may not function perfectly for a limited time while we are
392 trying to fix things.
394 Not everyone like to use this bleeding-edge code and face the danger
395 to hit a surprising bug.
397 Therefore, from time to time, we make a release.  This typically
398 happens when the maintainers feel that
400 1. they have reached a good point in the development
401 2. the code has a feature set that should stay and be supported in the
402    future
404 Stable releases are used as the basis for [[http://orgmode.org/index.html#sec-3_3][alternative distributions]] of
405 Org, and they are also the code that gets merged into the Emacs
406 distribution. If you want to work only with stable releases, you can
407 always download [[http://orgmode.org/index.html#sec-3][them here]], but you can also also use the git
408 repository to keep automatically up-to-date with the most recent
409 stable releases (and save bandwidth!). Here's how to do so:
411 *** Run a specific stable release
413 In the repository, do
415 : $ git fetch --tags
416 : $ git tag
418 To see which release tags are available.  Let's say you decide to use
419 =release_7.01f=.
421 : $ git checkout release_7.01f
423 This set the working tree of the repository to the state of Org at the
424 moment of release 7.01f.  You can then run Org from the repository be
425 sure to use the stable release while development continues on the
426 master branch.
428 Later, when we release 7.02, you can switch to that using
430 : $ git fetch --tags                   # to get all the new stuff
431 : $ git tag
432 : $ git checkout release_7.02
434 *** Always run the most recent stable release
436 Alternatively, if you just want to always run whatever the latest
437 stable release is, you can do
439 : $ git checkout -b stable origin/maint
441 and then regularly update this branch by doing
443 : $ git pull
445 ** How can I install an up-to-date version of org-mode without "make" tools?
446    :PROPERTIES:
447    :CUSTOM_ID: installing-org-without-make-tools
448    :END:
450 If you are using org-mode on a computer that lacks developer tools for
451 compiling software, such as [[http://www.gnu.org/software/make/][GNU Make]], you will have to use a
452 *different* installation method than [[http://orgmode.org/manual/Installation.html#Installation][the one outlined in the manual]].
454 Please see [[http://article.gmane.org/gmane.emacs.orgmode/15264][this thread]] on the mailing list for several different ways
455 you can install a recent version of org-mode without using the
456 customary =make clean && make && make install=.
458 The result of that discussion is the file/function found in
459 [[http://orgmode.org/worg/org-hacks.html#compiling-org-without-make]].
461 ** I don't use git. Can I download bleeding edge .zip and .tar.gz archives?
463    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 --
464    these archives are udpated every day at midnight.
466    Alternatively, you can download a [[http://orgmode.org/w/org-mode.git/snapshot][tar.gz snapshot from orgmode.org]].
468 ** How can I install Org-mode through Emacs' Package Manager?
469    :PROPERTIES:
470    :CUSTOM_ID: installing-via-elpa
471    :END:
473    Emacs 24 includes an automated package management tool ([[http://tromey.com/elpa/][ELPA]]) that
474    can be used to install and upgrade elisp packages such as Org-mode.
475    If you are running an older version of Emacs (23 or earlier), you
476    will have to install the package manager before using it to install
477    Org-mode. See [[#installing-elpa][this FAQ]] for more details.
479    Org-mode is distributed as an ELPA package from [[http://elpa.gnu.org/packages/][GNU Emacs Lisp
480    Package Archive]] as well as from [[http://orgmode.org/pkg/daily/][Org-mode Emacs Lisp Archive]].
481    
482    Steps for adding Org-mode as a package archive:
483    1. Add Org-mode as a package archive. This can be done in two ways.
484       1. Use =M-x customize-variable RET package-archives=
485       2. Add the following line to your =.emacs= and reload Emacs.
487          #+begin_src emacs-lisp
488            (add-to-list 'package-archives '("Org-mode" . "http://orgmode.org/pkg/daily/"))
489          #+end_src
490                 
491    2. Use the Emacs package manager's =M-x list-packages= to browse
492       and install the latest version.
494    3. If you get the following error "*Failed to download `Org-mode'
495       archive.*" in step 2, you can manually download the tarball and
496       install it. Refer [[Installing from ELPA-tar][this FAQ entry]] for more information.
498 ** How do I install Emacs package manager?
499    :PROPERTIES:
500    :CUSTOM_ID: installing-elpa
501    :END:
502    
503    If you are running Emacs-24 or find the command =M-x list-packages=
504    available you already have the package manager installed.
505    
506    Steps for installing package manager:
507    1. Download the latest package manager -
508       [[http://repo.or.cz/w/emacs.git/blob_plain/HEAD:/lisp/emacs-lisp/package.el][package.el]].
509    2. Add the following to your =.emacs= and reload Emacs.
510       #+begin_src emacs-lisp
511         ;; change "~/elisp/" as appropiate
512         (setq load-path (cons "~/elisp" load-path))
513         (require 'package)
514         (package-initialize)
515       #+end_src
516    
517 ** I don't see Org-mode as an installation option in Package Manager Menu?
518    :PROPERTIES:
519    :CUSTOM_ID: why-no-org-in-elpa
520    :END:
521    
522    Emacs Package Manager is a very recent addition to Emacs. Work is
523    under way to have have Org-mode seamlessly integrate with Emacs'
524    Package Manager. As a result, it will be some time before the
525    Org-mode packages are available and usable from either GNU or
526    Org-mode package archives.
527    
528    In the meanwhile, you can install Org-mode via package manager
529    through ELPA-compatible tar. Refer [[Installing from ELPA-tar][this FAQ entry]] for more information.
530    
531 ** How do I install Org-mode from a ELPA-compatible tarball?
532    :PROPERTIES:
533    :CUSTOM_ID: installing-from-elpa-tarball
534    :END:
535 # <<Installing from ELPA-tar>>
536    
537    Org-mode is distributed as an ELPA-compatible tar which can be used
538    in conjunction with Emacs' package manager.
539    
540    1. If you are already running Org-mode, note the current version
541       reported by M-x org-version.
542    2. Download the latest tarball from [[http://orgmode.org/pkg/daily/][Org-mode repo]].
543    3. Do =M-x package-install-file=. When prompted for =Package file
544       name=, point it to .tar file downloaded in step 2.
545       
546       You will now see Package Manager compiling the files and
547       installing it.
548    4. Reload emacs. This step is very important.
549    5. Note the version of the new installation using M-x
550       org-version. If the new and old versions are different, the
551       installation is done and you are all set to enjoy the updated
552       Org-mode. Otherwise skip to step 6.
553    6. Review you load-path using =C-h v load-path=. Most likely that
554       your old installation path takes precedence over the path chosen
555       by package manager (which is typically
556       =~/.emacs.d/elpa/...=). Fix this anamoly by moving
557       =(package-initialize)= line in .emacs to a more appropriate
558       location.
559       
560    - Additional Note on =org-install.el= :: Functionality of Org-mode's
561      =org-install.el= is supplanted by Package Manager's
562      =org-autoloads.el=. Since Package Manager autoloads Org-mode for
563      you, the following line =(require 'org-install)= in your =.emacs=
564      is no longer required and can be safely removed.
565      
566 ** Why would I use ELPA tarballs instead of the snapshot tarballs?
567    :PROPERTIES:
568    :CUSTOM_ID: why-elpa
569    :END:
570    
571    ELPA-tarballs automate much the process of upgrading org-mode. Much
572    of the following grunt work is done automatically by the Package
573    Manager:
574    
575    1. Downloading, compiling, and activating of org-mode (including
576       setting org-mode's =load-path= and autoloads).
577    2. Updating info files.
579 * Setup
580   :PROPERTIES:
581   :CUSTOM_ID: Setup
582   :END:
583 ** How can I quickly browse all Org options?
585 =M-x org-customize RET=
587 See also [[file:org-tutorials/org-customize.org][Carsten's Org customize tutorial]] and [[file:org-configs/org-customization-guide.org][this customization guide]]
588 for details.
590 ** Can I use the editing features of org-mode in other modes?
591    :PROPERTIES:
592    :CUSTOM_ID: use-editing-features-in-other-modes
593    :END:
595    Not really---but there are a few editing features you can use in
596    other modes.
598    - For tables there is =orgtbl-mode= which implements the table
599      editor as a minor mode. (To enable, type =M-x orgtbl-mode=)
600    - For ordered lists there is =orgstuct-mode= which allows for easy
601      list editing as a minor mode. (To enable, type =M-x
602      orgstruct-mode=)
604    You can activate these modes automatically by using hooks:
606    : (add-hook 'mail-mode-hook 'turn-on-orgtbl)
607    : (add-hook 'mail-mode-hook 'turn-on-orgstruct)
609    For footnotes, there is the function =org-footnote-action=, which
610    works in non-org buffers. This function is a powerful tool for
611    creating and sorting footnotes. To use it globally, you can add the
612    following keybinding to your =.emacs= file (requires Org 6.17 or
613    greater):
615    : (global-set-key (kbd "C-c f") 'org-footnote-action)
617    For other features you need to switch to Org-mode temporarily, or
618    prepare text in a different buffer.
620 ** Why isn't feature "X" working the way it is described in the manual?
621    :PROPERTIES:
622    :CUSTOM_ID: making-sure-org-mode-is-up-to-date
623    :END:
625 Org-mode develops very quickly. If you are using a version of Org-mode
626 that shipped with emacs, there is a good chance that it is somewhat
627 out of date.
629 Many of the users on the Org-mode mailing list are using either a
630 recent release of Org-mode or the
631 [[http://orgmode.org/index.html#sec-3.2][development version of
632 org-mode from the git repository]].
634 If some settings and features aren't working the way you expect, make
635 sure that the version of the manual you are consulting matches the
636 version of Org-mode you are using.
638    - You can check which version of Org-mode you are using by
639      selection =Org --> Documentation --> Show Version= in the Emacs
640      menu.
642    - The [[http://orgmode.org/manual/index.html][online manual]] at [[http://orgmode.org][orgmode.org]] corresponds to the most recent
643      release.
645    - 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
646      released with the latest official Gnu Emacs release. Compared
647      with the manual at the orgmode.org, the manual at www.gnu.org is
648      somewhat out of date.
650 For instructions on how to stay current with Org-mode, consult [[keeping-current-with-Org-mode-development][this
651 FAQ]] or follow the instructions on [[http://orgmode.org][the official Org-mode site]].
653 ** Can I get the visibility-cycling features in outline-mode and outline-minor-mode?
654    :PROPERTIES:
655    :CUSTOM_ID: use-visibility-cycling-in-outline-mode
656    :END:
658    Yes, these functions are written in a way that they are independent of
659    the outline setup.  The following setup provides standard Org-mode
660    functionality in outline-mode on =TAB= and =S-TAB=.  For
661    outline-minor-mode, we use =C-TAB= instead of =TAB=,
662    because =TAB= usually has mode-specific tasks.
664 #+BEGIN_SRC emacs-lisp
665 (add-hook 'outline-minor-mode-hook
666   (lambda ()
667     (define-key outline-minor-mode-map [(control tab)] 'org-cycle)
668     (define-key outline-minor-mode-map [(shift tab)] 'org-global-cycle)))
669 (add-hook 'outline-mode-hook
670   (lambda ()
671     (define-key outline-mode-map [(tab)] 'org-cycle)
672     (define-key outline-mode-map [(shift tab)] 'org-global-cycle)))
673 #+END_SRC
675 Or check out /outline-magic.el/, which does this and also provides
676 promotion and demotion functionality.  /outline-magic.el/ is
677 available at [[http://www.astro.uva.nl/~dominik/Tools/outline-magic.el][Outline Magic]].
679 ** Can I save/restore the visibility state of an org-mode buffer?
680    :PROPERTIES:
681    :CUSTOM_ID: saving-visibility-state
682    :END:
684 Well, no---at least not automatically. You can, however, control the
685 visibility of an org-file or of individual trees by adding
686 instructions to your org file. See [[http://orgmode.org/manual/Visibility-cycling.html#Visibility-cycling][this section of the manual]] for more
687 information.
689 ** How can I keep track of changes in my Org files?
690    :PROPERTIES:
691    :CUSTOM_ID: track-of-changes-in-Org-files
692    :END:
694   Use git to track the history of the files, use a cronjob to check in
695   changes regularly.  Such a setup is described by Bernt Hansen
696   in [[http://article.gmane.org/gmane.emacs.orgmode/6233][this message]] on [[http://dir.gmane.org/gmane.emacs.orgmode][emacs-orgmode]].
698 ** Can I use Org-mode as the default mode for all README files?
699    :PROPERTIES:
700    :CUSTOM_ID: Org-mode-as-default-mode
701    :END:
703 Add the following to your .emacs file:
705 : (add-to-list 'auto-mode-alist '("README$" . org-mode))
707 You can even make it the default mode for any files with unspecified
708 mode using
710 : (setq default-major-mode 'org-mode)
712 ** Can I use ido.el for completing stuff in Org?
713    :PROPERTIES:
714    :CUSTOM_ID: ido-complete
715    :END:
717    Yes, you can.  If you are an ido user and ido-mode is active, the
718    following setting will make Org use =ido-completing-read= for most
719    of its completing prompts.
721 : (setq org-completion-use-ido t)
723 ** Should I use one big org file or multiple files?
724    :PROPERTIES:
725    :CUSTOM_ID: how-to-organize-org-mode-files
726    :END:
728 Org-mode is flexible enough to accomodate a variety of organizational
729 and time management schemes. Org's [[http://orgmode.org/manual/Document-Structure.html#Document-Structure][outline cycling and convenient
730 editing and navigation commands]] make it possible to maintain all of
731 your projects and notes in a single file. But org-mode's [[http://orgmode.org/manual/Hyperlinks.html#Hyperlinks][quick and
732 easy hyperlinks]], along with [[http://orgmode.org/manual/Refiling-notes.html#Refiling-notes][easy refiling of notes and todos]], also
733 make it a delight to maintain a private "wiki" consisting of multiple
734 files.
736 No matter how you organize your org files, org-mode's agenda commands
737 make it easy to search all your notes and gather together crucial data
738 in a single view.
740 Moreover, several org-mode settings can be configured either globally
741 in your =.emacs= file or locally (per file or per outline tree). See
742 the [[http://orgmode.org/manual/index.html#Top][manual]] for more details. For an example of local customizations
743 see [[limit-agenda-with-category-match][this FAQ]].
745 Here are a few ideas for organizing org-mode files:
747 - A single file for all your projects and notes.
748 - One file per project.
749 - One file per client.
750 - One file per area of responsibility or type of work (e.g.,
751   household, health, work, etc.).
752 - One file for projects, one for appointments, one for reference
753   material, one for someday/maybe items, etc.
754 - A wiki of hyperlinked files that grows and adapts to meet your
755   needs.
757 For more ideas, see some of the links on the [[file:org-tutorials/index.org][org-tutorial index]] or
758 [[file:org-gtd-etc.org][this page on org-mode and GTD]].
760 ** Why doesn't C-c a call the agenda? Why don't some org keybindings work?
761    :PROPERTIES:
762    :CUSTOM_ID: setting-global-keybindings
763    :END:
765 Org-mode has a few global keybindings that the user must set
766 explicitly in an =.emacs= file. These keybindings include the
767 customary shortcut for calling the agenda (=C-c a=). If nothing
768 happens when you type =C-c a=, then make sure that the following lines
769 are in your =.emacs= file:
771 #+BEGIN_SRC emacs-lisp
772 ;; The following lines are always needed.  Choose your own keys.
773 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
774 (global-set-key "\C-cl" 'org-store-link)
775 (global-set-key "\C-ca" 'org-agenda)
776 (global-set-key "\C-cb" 'org-iswitchb)
777 #+END_SRC emacs-lisp
779 You may, of course, choose whatever keybindings work best for you
780 and do not conflict with other modes.
782 Please see [[http://orgmode.org/manual/Activation.html][this section of the manual]] if you have additional
783 questions.
785 ** Why aren't some of the variables I've customized having an effect?
786    :PROPERTIES:
787    :CUSTOM_ID: load-org-after-setting-variables
788    :END:
790 Some org variables have to be set before org.el is loaded or else they
791 will not work. (An example is the new variable
792 =org-enforce-todo-dependencies=.)
794 To make sure all your variables work you should not use =(require
795 'org)=. Instead use the following setting:
797 : (require 'org-install)
799 You should also make sure that you do not require any other =org-...=
800 files in your =.emacs= file before you have set your org variables,
801 since these will also cause org.el to be loaded. To be safe, load org
802 files *after* you have set your variables.
804 ** How can I make sure that timestamps appear in English?
805    :PROPERTIES:
806    :CUSTOM_ID: timestamps-and-system-time-locale
807    :END:
809 If your system's locale is not set to English, but you would like the
810 timestamps in your org-mode files to appear in English, you can set
811 the following variable:
813 #+begin_src emacs-lisp
814   (setq system-time-locale "C")
815 #+end_src
817 ** What does a minimal .emacs look like?
818    :PROPERTIES:
819    :CUSTOM_ID: minimal-emacs
820    :END:
822 Using a stripped down minimal .emacs files removes broken custom
823 settings as the cause of an issue and makes it easy to reproduce for
824 other people.  The example below has system-specific paths that you'll
825 need to change for your own use.
826 #+begin_src emacs-lisp
827   (add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
828   (add-to-list 'auto-mode-alist '("\\.\\(org\\  |org_archive\\|txt\\)$" . org-mode))
829   (setq org-agenda-files '("/tmp/test.org"))
830   (require 'org-install)
831   (require 'org-habit)
833   (global-set-key "\C-cl" 'org-store-link)
834   (global-set-key "\C-ca" 'org-agenda)
835   (global-set-key "\C-cb" 'org-iswitchb)
836 #+end_src
838 You can save the minimal .emacs file to ~/minimal.emacs, add suspect
839 configuration code to it, then start emacs something like this:
840 #+begin_src sh
841   emacs -Q -l ~/minimal.emacs
842 #+end_src
844 On OS X, starting emacs with minimal configuration might look
845 something like this:
846 #+begin_src sh
847   /Applications/emacs.app/Contents/MacOS/Emacs -Q -l ~/minimal.emacs
848 #+end_src sh
850 ** Can I migrate from Planner?
852    Yes.  This [[http://www.c0t0d0s0.de/plan2org/plan2org.pl][perl script]] can help.
854 * Errors and general problems
855   :PROPERTIES:
856   :CUSTOM_ID: Errors
857   :END:
858 ** Opening Org files in Emacs leads to a crash
859    :PROPERTIES:
860    :CUSTOM_ID: Emacs-crashes-with-org-indent-mode
861    :END:
862    The only known case where Org-mode can crash Emacs is when you are
863    using =org-indent-mode= with Emacs 23.1 (in fact, any version of
864    Emacs before version 23.1.50.3).  Upgrade to Emacs 23.2 and the
865    problem should go away.
867 ** When I try to use Org-mode, I always get the error message =(wrong-type-argument keymapp nil)=
868    :PROPERTIES:
869    :CUSTOM_ID: wrong-type-argument-keymapp
870    :END:
872    This is a conflict with an outdated version of the /allout.el/, see
873    the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section in the manual
875 ** How can I control the application launched by Org-mode to open a certain file type like pdf, html....
876    :PROPERTIES:
877    :CUSTOM_ID: external-application-launched-to-open-file-link
878    :END:
880 If you want special control about how Org-mode opens files, see the
881 variables =org-file-apps=, =org-file-apps-defaults-gnu=,
882 =org-file-apps-defaults-macosx=, =org-file-apps-defaults-windowsnt=.
884 *However*, normally it is best to just use the mechanism the
885 operating-system provides:
887 *** GNU/Linux systems
888     You you have to check your mailcap settings, find the files:
890     : /etc/mailcap
891     :
892     : or
893     :
894     : $HOME/.mailcap
896 and modify them accordingly. Please read their manual entry.
898 *** Windows systems
899     + for html pages you may configure the =browse-url-= variables through
900       the Customize interface,
901     + the pdf files are automatically opened with Acrobat Reader (if it is
902       installed)
904 *** Mac OSX
905     Change the application responsible for this file type by selecting
906     such a file in the Finder, select =File->Get Info= from the menu
907     and select the application to open this file with.  Then, to
908     propagate the change to all files with the same extension, select
909     the =Change all= button.
911 ** Org-mode takes over the TAB key.  I also want to use YASnippet, is there a way to fix this conflict?
912    :PROPERTIES:
913    :CUSTOM_ID: YASnippet
914    :END:
916 [[http://code.google.com/p/yasnippet/][yasnippet]] is yet another snippet expansion system for Emacs.  It is
917 inspired by TextMate's templating syntax.
918 - watch the [[http://www.youtube.com/watch?v=vOj7btx3ATg][video on YouTube]]
919 - see the [[http://yasnippet.googlecode.com/svn/trunk/doc/index.html][intro and tutorial]]
921 *Note*: yasnippet is not compatible with =org-indent-mode= currently
922 there is no known way to use both successfully with =yas/trigger-key=
923 set to =TAB= (or =[tab]= etc...)
925 The way Org-mode binds the =TAB= key (binding to =[tab]= instead of
926 =\t=) overrules yasnippets' access to this key.  The following code
927 fixes this problem:
929 #+begin_src emacs-lisp
930 (add-hook 'org-mode-hook
931           (lambda ()
932             (org-set-local 'yas/trigger-key [tab])
933             (define-key yas/keymap [tab] 'yas/next-field-group)))
934 #+end_src
936 If the above code doesn't work (which it may not with later versions
937 of yasnippet).  Then try the following
939 #+begin_src emacs-lisp
940   (defun yas/org-very-safe-expand ()
941     (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
943   (add-hook 'org-mode-hook
944             (lambda ()
945               ;; yasnippet (using the new org-cycle hooks)
946               (make-variable-buffer-local 'yas/trigger-key)
947               (setq yas/trigger-key [tab])
948               (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
949               (define-key yas/keymap [tab] 'yas/next-field)))
950 #+end_src
952 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]])
953 with YASnippets for Org-mode.
955 ** Org-mode takes over the S-cursor keys.  I also want to use CUA-mode, is there a way to fix this conflict?
956    :PROPERTIES:
957    :CUSTOM_ID: CUA-mode
958    :END:
960 Yes, see the  [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
962 ** Org-mode takes over the S-cursor keys.  I also want to use windmove.el, is there a way to fix this conflict?
963    :PROPERTIES:
964    :CUSTOM_ID: windmove.el
965    :END:
967 Yes, see the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
969 ** Org behaves strangely: some keys don't work, some features are missing, my settings have no effect, ...
970    :PROPERTIES:
971    :CUSTOM_ID: loaded-old-org
972    :END:
974 When this sort of things happen, it probably is because Emacs is
975 loading an old version of Org-mode instead of the one you expected.
976 Check it with =M-x org-version=.
978 This happens because Emacs loads first the system org-mode (the one
979 included with Emacs) before the one in your directory. Check the
980 =load-path= variable; you might see that your org-mode appears /after/
981 the system-wide path; this is bad.
983 You should add your directories to the =load-path= at the beginning:
985 :  (add-to-list 'load-path "~/.emacs.d/org-mode/lisp") (require 'org-install)
987 Function =add-to-list= adds at the beginning. Don't use =append=
988 because it appends at the end. Also be sure to use =(require
989 'org-install)= and not =(require 'org)=.
991 This wrong version loading may also happen if you have a byte-compiled
992 =org.elc= from an old version together with a new =org.el=. Since
993 Emacs prefers loading byte-compiled files (even if the =.el= is
994 newer), it will load the old Org-mode.
996 ** Why doesn't org-batch-agenda work under Win32?
997    :PROPERTIES:
998    :CUSTOM_ID: org-batch-agenda-under-win32
999    :END:
1001 When I run the example batch files to print my agenda to the console
1002 under Win32 I get the failure:
1004 : End of file during parsing
1006 and no agenda is printed.
1008 The problem is the use of single quotes surrounding the eval in the
1009 emacs command-line. This gets confused under Win32. All string
1010 parameters with spaces must be surrounded in double quotes. This means
1011 that double quotes being passed to the eval must be escaped.
1013 Therefore, instead of the following:
1015 : <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
1016 :     -eval '(org-batch-agenda "a")'
1018 you need to use the following:
1020 :  <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
1021 :     -eval "(org-batch-agenda \"a\")"
1023 (all on one line, of course).
1025 ** Org agenda seems very slow
1026    :PROPERTIES:
1027    :CUSTOM_ID: slow-agenda
1028    :END:
1030 If it takes a long time to generate or refresh the agenda, you might
1031 want first check which version of org-mode you are using. There have
1032 been major optimizations of org-agenda since 6.21b, which was the
1033 version of org-mode released with Emacs 23. If you are using 6.21b or
1034 earlier (you can check with =M-x org-version=), then you might want to
1035 consider upgrading to a more recent version of org-mode.
1037 Here are some other ideas for speeding up the agenda:
1039 1. Use a one day agenda view (rather than a seven day view).
1041    =(setq org-agenda-ndays 1)=
1043 2. Archive inactive items to separate files.
1045    =C-c C-x C-s= (org-archive-subtree)
1047 3. Do not include the global todo list in your agenda view.
1049    (setq org-agenda-include-all-todo nil)
1051 4. Make sure that your org files are byte-compiled.
1053    I.e., make sure there are files ending in =.elc= in your org
1054    installation directory.
1056 5. Limit your agenda files (=org-agenda-files=) to files that have
1057    active todos and or projects. 
1059    If you have a number of older reference files---i.e., files you
1060    search only occasionally---in your agenda files list, consider
1061    removing them from your agenda files and adding them to
1062    =org-agenda-text-search-extra-files= instead. Similarly, you might
1063    consider searching some of your older reference files with =M-x
1064    grep= so that Org-mode does not have to load them into memory when
1065    the agenda is called.
1067 ** Visual-line-mode doesn't work well with org-mode
1068    :PROPERTIES:
1069    :CUSTOM_ID: visual-line-mode
1070    :END:
1072 Visual-line-mode "soft wraps" lines so that the visual edge of the
1073 buffer is considered a line break for purposes of navigation, even
1074 though there is no line break in reality.
1076 In older versions of org-mode, org-beginning-of-line and
1077 org-end-of-line do not work well with visual line mode. (The two
1078 commands disregard soft line breaks and move to the beginning and end
1079 of the hard line break.) A patch was introduces to fix this behavior
1080 in July of 2009. n
1082 If you are using an older version of org mode, you can:
1084 1. Add a hook to turn off visual line mode.
1086 2. Add the following to your =.emacs=:
1088 #+begin_src emacs-lisp
1090 (add-hook 'org-mode-hook
1091   (lambda ()
1092     (define-key org-mode-map "\C-a" 'move-beginning-of-line)
1093     (define-key org-mode-map "\C-e" 'move-end-of-line)))
1095 #+end_src
1096 * Faces and highlighting
1097   :PROPERTIES:
1098   :CUSTOM_ID: Faces
1099   :END:
1100 ** Org-mode has a lot of colors?  How can I change them?
1101    :PROPERTIES:
1102    :CUSTOM_ID: customizing-org-faces
1103    :END:
1105 This is a question that applies to Emacs as a whole, but it comes up
1106 quite frequently on the org-mode mailing list, so it is appropriate to
1107 discuss it here.
1109 If you would like to change the style of a face in org-mode (or any
1110 other Emacs mode), simply type =M-x customize-face [RET]= while the
1111 cursor is on the color/style you are interested in modifying. You will
1112 be given the opportunity to customize all the faces located at that
1113 point.
1115 If you would like an overview of all the faces in org-mode, you can
1116 type =C-u M-x list-faces-display [RET] org= and you will be shown all
1117 the faces defined by org-mode along with an illustration of their
1118 current settings.
1120 If you would like to customize org-faces and other aspects of
1121 org-appearance, type =M-x customize-group org-font-lock [RET]=.
1123 Finally, if you would like verbose information about the properties of
1124 the text under the cursor, you can type =C-u C-x ==.
1126 See the Worg page on [[file:org-tutorials/org-appearance.org][customizing Org appearance]] for further information.
1127 ** Why do I get a tiny font in column view when using emacs daemon?
1128    :PROPERTIES:
1129    :CUSTOM_ID: column-view-tiny-font
1130    :END:
1132 When using emacs in daemon mode (=emacs --daemon=), client frames
1133 sometimes override the column view face settings, resulting in very
1134 small fonts. Here is a fix:
1136 #+begin_src emacs-lisp
1137   (defun org-column-view-uses-fixed-width-face ()
1138   ;; copy from org-faces.el
1139   (when (fboundp 'set-face-attribute)
1140       ;; Make sure that a fixed-width face is used when we have a column
1141       ;; table.
1142       (set-face-attribute 'org-column nil
1143                           :height (face-attribute 'default :height)
1144                           :family (face-attribute 'default :family))))
1146    (when (and (fboundp 'daemonp) (daemonp))
1147     (add-hook 'org-mode-hook 'org-column-view-uses-fixed-width-face))
1148 #+end_src
1150 This fix was provided in the following mailing list post:
1152 http://article.gmane.org/gmane.emacs.orgmode/27560
1153 ** How can I stop the mouse cursor from highlighting lines in the agenda?
1154    :PROPERTIES:
1155    :CUSTOM_ID: ratpoison-for-agenda-highlighting
1156    :END:
1158 You can add the following to your =.emacs=:
1160 #+begin_src emacs-lisp
1161 (add-hook 'org-finalize-agenda-hook
1162     (lambda () (remove-text-properties
1163                (point-min) (point-max) '(mouse-face t))))
1164 #+end_src
1166 * Outline
1167   :PROPERTIES:
1168   :CUSTOM_ID: Outline
1169   :END:
1170 ** Can I have two windows on the same Org-mode file, with different outline visibilities?
1171    :PROPERTIES:
1172    :CUSTOM_ID: indirect-buffers
1173    :END:
1175    You may use /indirect buffers/ which do exactly this.  See the
1176    documentation on the command =make-indirect-buffer=.
1178    Org-mode has built-in commands that allow you create an indirect
1179    buffer from a subtree of an outline. To open a subtree in new
1180    window, type =C-c C-x b=. Any changes you make in the new window
1181    will be saved to the original file, but the visibility of both
1182    buffers will remain independent of one another.
1184    For multiple indirect buffers from the same file, you must use the
1185    prefix =C-u= when creating the second (or third) buffer. Otherwise
1186    the new indirect buffer will replace the old.
1188    You can also create an independent view of an outline subtree by
1189    typing =b= on an item in the agenda.
1191 ** Emacs outlines are unreadable.  Can I get rid of all those stars?
1192    :PROPERTIES:
1193    :CUSTOM_ID: Emacs-outlines-are-unreadable
1194    :END:
1196    See the section [[http://orgmode.org/manual/Clean-view.html#Clean-view][Clean outline view]] in the manual.
1197 ** C-k is killing whole subtrees!  I lost my work!
1198    :PROPERTIES:
1199    :CUSTOM_ID: C-k-is-killing-subtrees
1200    :END:
1202   =(setq org-special-ctrl-k t)= before losing your work.
1204 ** Why aren't commands working on regions?
1205    :PROPERTIES:
1206    :CUSTOM_ID: transient-mark-mode
1207    :END:
1209 Some org-mode commands, such as M-right and M-left for demoting or
1210 promoting headlines (see [[demote-multiple-headlines][this FAQ]]), can be applied to entire regions.
1211 These commands, however, will only work on active regions set with
1212 [[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
1213 Emacs 23. To enable it in earlier versions of emacs, put the following
1214 in your =.emacs= file:
1216 : (transient-mark-mode 1)
1218 Alternatively, you may turn off transient mark mode and use [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Momentary-Mark.html][a
1219 momentary mark]] (=C-<SPC> C-<SPC>=).
1221 ** Why is a blank line inserted after headlines and list items?
1222    :PROPERTIES:
1223    :ID:       2463F4D8-F686-4CF3-AA07-08976F8A4972
1224    :END:
1225    :PROPERTIES:
1226    :CUSTOM_ID: blank-line-after-headlines-and-list-items
1227    :END:
1229 In org-mode, typing =M-RET= at the end of a headline will create a new
1230 headline of the same level on a new line. The same is true for plain
1231 lists. By default org-mode uses context to determine if a blank line
1232 should be inserted after each headline or plain list item when =M-RET=
1233 is pressed. For instance, if a there is a blank line before a
1234 headline, then typing =M-RET= at the end of the line will insert a
1235 blank line before the new headline. For instance, hitting =M-RET=
1236 at the end of "Headline Two" below inserts a new headline without a
1237 blank line:
1239 : ** Headline One
1240 : ** Headline Two
1241 : **
1243 If there is a blank line between Headline One and Headline Two,
1244 however, the results will be as follows:
1246 : ** Headline One
1248 : ** Headline Two
1250 : **
1252 If you do not like the default behavior you can change it with the
1253 variable =org-blank-before-new-entry=. You can set headings and/or
1254 plain lists to auto (the default setting), t (always), or nil (never).
1256 ** How can I promote or demote multiple headlines at once?
1257    :PROPERTIES:
1258    :CUSTOM_ID: demote-multiple-headlines
1259    :END:
1261 If you have a long list of first level headlines that you'd like to
1262 demote to second level headlines, you can select the headlines as a
1263 region and then hit =M-<right>= to demote all the headlines at once.
1265 Note: =M-S-<right>= will not work on a selected region. Its use is to
1266 demote a single subtree (i.e., a headline and all sub-headlines).
1268 If M-<right> doesn't seem to work, make sure transient mark mode is
1269 enabled. See [[transient-mark-mode][this FAQ]].
1271 ** What's the deal with all the ellipses in my org outlines?
1272    :PROPERTIES:
1273    :CUSTOM_ID: org-ellipses
1274    :END:
1276 Org-mode uses ellipses to indicate folded (and thus hidden) text. Most
1277 commonly, ellispes occur at the end of headings with folded content:
1279 : * Heading ...
1281 Or, for instance, they may indicate closed drawers:
1283 : :PROPERTIES: ...
1285 Sometimes, as a result of editing and cycling an outline, ellipses may
1286 appear in unexpected places. You should *never* delete these ellipses,
1287 as you may accidentally delete hidden text. Instead, you can type =C-c
1288 C-r= (org-reveal) to display all hidden text in the vicinity. Or you
1289 may type =M-x RET show-all= to reveal all text in the org file.
1291 If you would prefer a symbol or face for indicating hidden text, you
1292 can customize the variable org-ellipses.
1294 ** How do I yank a subtree so it's indented according to the point's location?
1295    :PROPERTIES:
1296    :CUSTOM_ID: yank-indent-subtree
1297    :END:
1299 You can either use =C-c C-w= with a working [[http://orgmode.org/manual/Refiling-notes.html#Refiling-notes][refile-targets]] setup.
1301 Or set =org-yank-adjusted-subtrees= to =t= which will adjust the
1302 yanked headline's level correctly.
1304 Just use =C-k= and =C-y= as you would everywhere else in Emacs.
1306 ** Can I read org-mode outlines in vim?
1307    :PROPERTIES:
1308    :CUSTOM_ID: org-outlines-in-vim
1309    :END:
1311 Yes, there is a script that enables one to view and navigate folded
1312 outline/org files in vim (though without most of org-mode's
1313 functionality, of course).
1315   - [[http://www.vim.org/scripts/script.php?script_id%3D1266][Emacs outline mode - Imitates Emacsen : vim online]]
1317 For instructions on how to set it up, please see [[http://mid.gmane.org/EA275862-B97A-4BAC-B879-177FD07A2D56@gaillourdet.net][this mailing list
1318 post]].
1320 Work is also underway on an org-mode clone for Vim. You can check it
1321 out on git hub:
1323 https://github.com/hsitz/VimOrganizer
1325 * Todos and Tags
1326   :PROPERTIES:
1327   :CUSTOM_ID: Todos-and-Tags
1328   :END:
1329 ** How can I cycle through the TODO keyword of an entry?
1330    :PROPERTIES:
1331    :CUSTOM_ID: cycle-TODO-keywords
1332    :END:
1334   =C-c C-t= or =S-<left/right>= is what you need.
1336 ** How do I track state changes for tasks in Org?
1337    :PROPERTIES:
1338    :CUSTOM_ID: track-state-changes-for-tasks
1339    :END:
1341   Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/6082][post by Bernt Hansen]] for setting up TODO keyword
1342   states and logging timestamps for task state changes.
1344 ** Can I select the TODO keywords with a tag-like interface?
1345    :PROPERTIES:
1346    :CUSTOM_ID: select-TODO-keywords-with-tag-like-interface
1347    :END:
1349   Yes.  Use =(setq org-use-fast-todo-selection t)=
1351   If you want to set both your todos and your tags using a single
1352   interface, then check out the variable
1353   =org-fast-tag-selection-include-todo=.
1355   See [[http://orgmode.org/manual/Fast-access-to-TODO-states.html][this section of the manual]] for more details.
1357 ** How can I quickly set the tag of an entry?
1358    :PROPERTIES:
1359    :CUSTOM_ID: quickly-set-tag-of-entry
1360    :END:
1362    Use =C-c C-c= or =C-c C-q= on the headline. =C-c C-q= is useful for
1363    setting tabs in a [[http://orgmode.org/manual/Remember.html#Remember][remember]] buffer, since =C-c C-c= is the default
1364    keybinding for filing a note from the remember buffer.
1366    You can set tags even more quickly by setting one of the character
1367    shortcuts for [[http://orgmode.org/manual/Setting-tags.html#Setting-tags][fast tag selection]].
1369    To set tag shortcuts for all org buffers, put something like the
1370    following in your =.emacs= file (or create the same settings by
1371    typing =M-x customize-variable RET org-tag-alist=):
1373 : (setq org-tag-alist '(("computer" . ?c) ("office" . ?o) ("home" . ?h)))
1375    To set tag shortcuts for a single buffer, put something like the
1376    following at the top of your org file:
1378 : #+TAGS: computer(c) office(o) home(h)
1380 ** How can I change the colors of TODO keywords?
1382 You can use the variable org-todo-keyword-faces. Here are some sample
1383 settings:
1385 #+begin_src emacs-lisp
1386 (setq org-todo-keyword-faces
1387       '(
1388         ("TODO"  . (:foreground "firebrick2" :weight bold))
1389         ("WAITING"  . (:foreground "olivedrab" :weight bold))
1390         ("LATER"  . (:foreground "sienna" :weight bold))
1391         ("PROJECT"  . (:foreground "steelblue" :weight bold))
1392         ("DONE"  . (:foreground "forestgreen" :weight bold))
1393         ("MAYBE"  . (:foreground "dimgrey" :weight bold))
1394         ("CANCELED"  . shadow)
1395         ))
1396 #+end_src
1398 If you want to change the color of all active todos or all inactive
1399 todos, type:
1401 : M-x customize-face RET org-todo
1402 : M-x customize-face RET org-done
1404 You can also set values for each of these in your =.emacs= file:
1406 : (set-face-foreground 'org-todo "firebrick2")
1407 : (set-face-foreground 'org-done "forestgreen")
1409 * Hyperlinks
1410   :PROPERTIES:
1411   :CUSTOM_ID: Hyperlinks
1412   :END:
1413 ** Why do I have to confirm the execution of each shell/elisp link?
1414    :PROPERTIES:
1415    :CUSTOM_ID: confirm-shell/elisp-link
1416    :END:
1418    The confirmation is there to protect you from unwantingly execute
1419    potentially dangerous commands.  For example, imagine a link
1421    : [[shell:rm -rf ~/*][Google Search]]
1423    In an Org-mode buffer, this command would look like /Google Search/,
1424    but really it would remove your home directory.  If you wish, you can
1425    make it easier to respond to the query by setting
1427    : (setq org-confirm-shell-link-function 'y-or-n-p
1428    :       org-confirm-elisp-link-function 'y-or-n-p).
1430    Then a single keypress will be enough to confirm those links.  It is
1431    also possible to turn off this check entirely, but I strongly
1432    recommend against this.  Be warned.
1434 ** Can I use RET or TAB to follow a link?
1435    :PROPERTIES:
1436    :CUSTOM_ID: RET-or-TAB-to-follow-link
1437    :END:
1439    Yes, this is how:
1441    : (setq org-return-follows-link t)
1442    : (setq org-tab-follows-link t)
1444 ** Can I keep mouse-1 clicks from following a link?
1445    :PROPERTIES:
1446    :CUSTOM_ID: mouse-1-following-link
1447    :END:
1449    Activating links with =mouse-1= is a new feature in Emacs 22, to make
1450    link behavior similar to other applications like web browsers.  If
1451    you hold the mouse button down a bit longer, the cursor will be set
1452    without following the link.  If you cannot get used to this behavior,
1453    you can (as in Emacs 21) use =mouse-2= to follow links and turn off
1454    link activation for =mouse-1= with
1456    : (setq org-mouse-1-follows-link nil)
1458 ** How can I get completion of file names when creating a link?
1459    :PROPERTIES:
1460    :CUSTOM_ID: completion-of-file-links
1461    :END:
1463 You can use org-insert-link with a prefix argument:
1465 : C-u C-c C-l
1467 You will be greeted with prompt in the minibuffer that allows for file
1468 completion using your preferred Emacs method for finding files.
1470 ** How can I use invisible targets within lists?
1471    :PROPERTIES:
1472    :CUSTOM_ID: invisible-targets-in-lists
1473    :END:
1475 The usual way of turning radio links invisible is to comment them, but
1476 Org comments need to be at the beginning of the line, which breaks list
1477 indentation.  
1479 The workaround here is to add (INVISIBLE) after your <<target>>
1481 For example:
1483 : 11. <<target>>(INVISIBLE)
1484 :     Some text
1485 : 12. More text [[target][go to]]
1487 ** Org-mode is not opening mailto links in my default mail client
1488    :PROPERTIES:
1489    :CUSTOM_ID: mailto-links
1490    :END:
1492 You can customize the function org-mode uses to open mailto links by
1493 setting the variable =org-link-mailto-program=:
1495 =M-x customize-variable org-link-mailto-program=
1497 The default function called is =browse-url=, which opens a mail
1498 composition buffer within Emacs. The type of buffer opened by
1499 browse-url depends on the setting of the variable =mail-user-agent=.
1500 Thus, if you want to ensure that mailto links use Gnus to open a
1501 message buffer, you could add the following to your =.emacs=:
1503 #+begin_src elisp
1504 (setq mail-user-agent 'gnus-user-agent)
1505 #+end_src
1507 ** Can I use CamelCase links?
1508    :PROPERTIES:
1509    :CUSTOM_ID: CamelCase-links
1510    :END:
1512 Yes, you can with the contributed package org-wikinodes.el. Please
1513 consult the [[http://orgmode.org/worg/org-contrib/org-wikinodes.html][documentation]].
1515 * Plain Lists
1516   :PROPERTIES:
1517   :CUSTOM_ID: Plain-Lists
1518   :END:
1519 ** How can I insert an empty line before each newly inserted headline, but not before each newly inserted plain-list item?
1520    :PROPERTIES:
1521    :CUSTOM_ID: empty-line-before-each-new-headline-but-not-item
1522    :END:
1524 : (setq org-blank-before-new-entry
1525 :       '((heading . t) (plain-list-item . nil))
1527 See also [[id:2463F4D8-F686-4CF3-AA07-08976F8A4972][Why is a blank line inserted after headlines and list items?]].
1529 ** How can I convert itemized lists to enumerated lists?
1530    :PROPERTIES:
1531    :CUSTOM_ID: convert-itemized-to-enumerated-lists
1532    :END:
1534    You can use =C-c -= or =S-<left>/<right>= to cycle through the various
1535    bullet headlines available for lists: =-, +, *, 1., 1)=.
1537    See [[http://orgmode.org/manual/Plain-lists.html#Plain-lists][this section of the manual]] for more information.
1539 ** How can I convert plain lists to headlines and vice versa?
1540    :PROPERTIES:
1541    :CUSTOM_ID: convert-plain-lists-to-headlines
1542    :END:
1544    To convert a plain list item or line to a headline, type =C-c *= on
1545    the headline. This will make the line a subheading of the current
1546    headline.
1548    To convert a headline to a plain list item, type =C-c -= while the
1549    cursor is on the headline.
1551    To convert a headline to an unadorned line of text, type =C-c *= on
1552    the headline.
1554    You can use query replace to accomplish the same things, as Bernt
1555    Hansen explains in [[http://article.gmane.org/gmane.emacs.orgmode/10148][this mailing list post]].
1557 ** Is there a good way to create a description list?
1558    :PROPERTIES:
1559    :CUSTOM_ID: description-lists
1560    :END:
1562   Yes, these are now built-in:
1564 #+BEGIN_EXAMPLE
1565 - item1 :: Description of this item 1
1566 - item2 :: Description of this item 2
1567 - item1 :: Description of this item 3
1568       also in multiple lines
1569 #+END_EXAMPLE
1571 * Tables
1572   :PROPERTIES:
1573   :CUSTOM_ID: Tables
1574   :END:
1575 ** How can I make table alignment work with Asian character sets
1576    :PROPERTIES:
1577    :CUSTOM_ID: table-alignment-asian-characters
1578    :END:
1580 When table alignment fails, it usually has to do with character sets
1581 where some characters have non-integer width.  Org will deal correctly
1582 with characters that are one or two or three ASCII characters wide,
1583 but not with characters that are, for example, 1.5 ASCII characters
1584 wide.  To make table alignment work you need to switch to a different
1585 character set.
1587 ** Can I plot data from a table?
1588    :PROPERTIES:
1589    :CUSTOM_ID: plotting-table-data
1590    :END:
1592    Yes, you can, using org-plot.el written by Eric Schulte and now
1593    bundled with Org.  See [[http://orgmode.org/manual/Org_002dPlot.html#Org-Plot][the manual section about this]].
1595    See also [[file:org-tutorials/org-plot.org][this excellent tutorial]] by Eric Schulte.
1597 ** How can I fill a table column with incremental numbers?
1598    :PROPERTIES:
1599    :CUSTOM_ID: fill-table-column-with-incremental-numbers
1600    :END:
1602 Here is how: Use a field formula to set the first value in the column:
1604 #+begin_src org
1605 ,| N   |   |
1606 ,|-----+---|
1607 ,| :=1 |   |
1608 ,|     |   |
1609 ,|     |   |
1610 ,|     |   |
1611 ,#+TBLFM: @2$1=1
1612 #+end_src
1614 Then define a column formula in the second field:
1616 #+begin_src org
1617 ,| N        |   |
1618 ,|----------+---|
1619 ,| 1        |   |
1620 ,| =@-1 + 1 |   |
1621 ,|          |   |
1622 ,|          |   |
1623 ,#+TBLFM: @2$1=1
1624 #+end_src
1626 After recomputing the table, the column will be filled with
1627 incremental numbers:
1629 #+begin_src org
1630 ,| N |   |
1631 ,|---+---|
1632 ,| 1 |   |
1633 ,| 2 |   |
1634 ,| 3 |   |
1635 ,| 4 |   |
1636 ,#+TBLFM: $1=@-1 + 1::@2$1=1
1637 #+end_src
1639 Note that you could use arbitrary starting values and column formulas.
1641 ** Why does my table column get filled with #ERROR?
1642    :PROPERTIES:
1643    :CUSTOM_ID: table-column-filled-with-ERROR
1644    :END:
1646    Org-mode tried to compute the column from other fields using a
1647    formula stored in the =#+TBLFM:= line just below the table, and
1648    the evaluation of the formula fails.  Fix the fields used in the
1649    formula, or fix the formula, or remove it!
1651 ** How can I stop the table editor from creating new lines?
1652    :PROPERTIES:
1653    :CUSTOM_ID: table-editor-creates-new-lines
1654    :END:
1656    When I am in the last column of a table and just above a horizontal
1657    line in the table, pressing TAB creates a new table line before the
1658    horizontal line.  To move to the line below the
1659    horizontal line instead, do this:
1661    Press =down= (to get on the separator line) and then =TAB=.
1662    Or configure the variable
1664    : (setq org-table-tab-jumps-over-hlines t)
1666 ** How can I get table fields starting with "="?
1667    :PROPERTIES:
1668    :CUSTOM_ID: table-fields-starting-with-=
1669    :END:
1671    With the setting
1673    : (setq org-table-formula-evaluate-inline nil)
1675    this will no longer happen.  You can still use formulas using the
1676    commands @<tt>C-c =@</tt> and @<tt>C-u C-c =@</tt>
1678 ** How can I change the indentation of an entire table without fixing every line by hand?
1679    :PROPERTIES:
1680    :CUSTOM_ID: change-indentation-entire-table
1681    :END:
1683    The indentation of a table is set by the first line.  So just fix the
1684    indentation of the first line and realign with =TAB=.
1686 ** In my huge table the realigning after each TAB takes too long.  What can I do?
1687    :PROPERTIES:
1688    :CUSTOM_ID: table-realigning-after-TAB-takes-long
1689    :END:
1691    Either split the table into several by inserting an empty line every
1692    100 lines or so.  Or turn off the automatic re-align with
1694    : (setq org-table-automatic-realign nil)
1696    After this the only way to realign a table is to press =C-c C-c=.  It
1697    will no longer happen automatically, removing the corresponding delays
1698    during editing.
1700 ** Recalculation of my table takes too long.  What can I do?
1701    :PROPERTIES:
1702    :CUSTOM_ID: Recalculation-of-my-table-takes-too-long
1703    :END:
1705    Nothing, really.  The spreadsheet in org is mostly done to make
1706    calculations possible, not so much to make them fast.  Since Org-mode
1707    is firmly committed to the ASCII format, nothing is stopping you from
1708    editing the table by hand.  Therefore, there is no internal
1709    representation of the data.  Each time Org-mode starts a computation,
1710    it must scan the table for special lines, find the fields etc.  This
1711    is slow.  Furthermore, Calc is slow compared to hardware
1712    computations.  To make this work with normal editing, recalculation
1713    is not happening automatically, or only for the current line, so that
1714    the long wait for a full table iteration only happens when you ask
1715    for it.
1717    So for really complex tables, moving to a "real" spreadsheet may
1718    still be the best option.
1720    That said, there are some ways to optimize things in Org-mode, and I
1721    have been thinking about moving a bit further down this line.
1722    However, for my applications this has so far not been an issue at
1723    all.  If you have a good case, you could try to convince me.
1725 ** =S-RET= in a table keeps increasing the copied numbers.  How can I stop this?
1726    :PROPERTIES:
1727    :CUSTOM_ID: S-RET-in-a-table-increases-copied-numbers
1728    :END:
1730    Well, it is /supposed/ to be a feature, to make it easy to create a
1731    column with increasing numbers.  If this gets into your way, turn it
1732    off with
1734    : (setq org-org-table-copy-increment nil)
1736 ** When I export tables to html, they don't have borders.
1737    :PROPERTIES:
1738    :CUSTOM_ID: table-borders-in-html-export
1739    :END:
1741 By default, org mode exports tables without borders.
1743 You can changed this by placing an =#+ATTR_HTML= line before the
1744 table:
1746 :  #+ATTR_HTML: border="2" rules="all" frame="all"
1748 See [[http://orgmode.org/manual/Tables-in-HTML-export.html#Tables-in-HTML-export][the manual]] for more details.
1750 ** Why does the Calc high precision (e. g. =p20=) not work like expected?
1751    :PROPERTIES:
1752    :CUSTOM_ID: table-high-precision
1753    :END:
1755 - *Short answer*
1757   Avoid
1758   : | 1 / 2 * 3 | 0.16666667000000 |
1759   : #+TBLFM: $2 = $1; p20 %.14f
1761   and use
1762   : | 1 / 2 * 3 | 0.16666666666667 |
1763   : #+TBLFM: $2 = $1 +.0; p20 f-14
1765 - *Longer answer*
1767   It is important to distinguish between the precision of
1768   1) =p20=: Calc internal calculation (=calc-internal-prec=)
1769   2) =f-14=: Calc float formatting, unlimited in precision (=calc-float-format=)
1770   3) =%.14f=: the =printf= reformatting, limited in precision
1772   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.
1774   Use =C-h v org-calc-default-modes RET= to check the Org default settings
1775   which are used if no format specifiers are added to a table formula.
1776   The examples below have been made with the out_of_the_box Org defaults
1777   =calc-internal-prec = 12= and =calc-float-format = 8=.
1779   Remember the formula debugger, toggled with =C-c {=,
1780   to view the processing stages like:
1781   |   | formula debugger label | processing stage           |
1782   | / | <                      | <>                         |
1783   |---+------------------------+----------------------------|
1784   |   | Result:                | output of Calc             |
1785   |   | Format:                | reformatting with =printf= |
1787   Following are some examples to demonstrate
1788   the interaction of the three precisions.
1790   - *display precision limitations for Calc formulas*
1791     - limited by Calc internal calculation precision from Org default
1792       (here =p12=)
1793       : | 0.16666666666700 |
1794       : #+TBLFM: $1 = 1 / 2 * 3;     f-14
1796       : | 0.1666666666670000000 |
1797       : #+TBLFM: $1 = 1 / 2 * 3;     f-19
1799     - limited by Calc float format from Org default (here =f8=)
1800       : | 0.16666667 |
1801       : #+TBLFM: $1 = 1 / 2 * 3
1803       : | 0.16666667 |
1804       : #+TBLFM: $1 = 1 / 2 * 3; p20
1806       : | 0.16666667000000 |
1807       : #+TBLFM: $1 = 1 / 2 * 3;          %.14f
1809       : | 0.16666667000000 |
1810       : #+TBLFM: $1 = 1 / 2 * 3; p20      %.14f
1812     - limited by Calc float format specified
1813       : | 0.166667 |
1814       : #+TBLFM: $1 = 1 / 2 * 3;     f-6
1816       : | 0.16666666666667 |
1817       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-14
1819       : | 0.1666666666666666667 |
1820       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-19
1822     - limited by =printf= conversion to Emacs Lisp float
1823       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
1824       : #+TBLFM: $1 = 1 / 2 * 3;          %.19f
1826       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
1827       : #+TBLFM: $1 = 1 / 2 * 3; p20      %.19f
1829       : | 0.1666666666666666600 | the inaccuracy is platform dependent |
1830       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-20 %.19f
1832     - limited by =printf= format specified
1833       : | 0.166667 |
1834       : #+TBLFM: $1 = 1 / 2 * 3;         %.6f
1836   - *display precision limitations for Emacs Lisp formulas*
1837     - limited by Emacs Lisp float
1838       : | 0.16666666666666666 |
1839       : #+TBLFM: $1 = '(/ 1.0 (* 2 3))
1841       : | 0.1666666666666666574 | the inaccuracy is platform dependent |
1842       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.19f
1844     - limited by =printf= format specified
1845       : | 0.16666666666667 |
1846       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.14f
1848 This FAQ entry is based on this [[http://thread.gmane.org/gmane.emacs.orgmode/22642][mailing list thread]]
1849 and is continued in the [[#table-float-fraction][next FAQ entry]].
1851 ** Which float format shows the fraction part also when the latter is zero?
1852    :PROPERTIES:
1853    :CUSTOM_ID: table-float-fraction
1854    :END:
1856 - *Short answer*
1858   Avoid
1859    : | 1 | 1 |
1860    : #+TBLFM: $2 = $1; f-3
1861   and use
1862    : | 1 | 1.000 |
1863    : #+TBLFM: $2 = $1 +.0; f-3
1865 - *Longer answer*
1867   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]]
1868   in the section Mode Settings -> Display Modes -> Float Formats
1869   [[http://www.delorie.com/gnu/docs/calc/calc_163.html][found here as long as the section numbering is unchanged]].
1871   Remember the formula debugger, toggled with =C-c {=,
1872   to view the processing stages like:
1873   |   | formula debugger label | processing stage           |
1874   | / | <                      | <>                         |
1875   |---+------------------------+----------------------------|
1876   |   | Result:                | output of Calc             |
1877   |   | Format:                | reformatting with =printf= |
1879   Following are some examples to demonstrate different float formats.
1881   - normal precision
1882     : |-----------+---------+-------+---------+----------+-------|
1883     : |    number |      f3 |   f-3 | +.0; f3 | +.0; f-3 |  %.3f |
1884     : |-----------+---------+-------+---------+----------+-------|
1885     : |         1 |       1 |     1 |   1.000 |    1.000 | 1.000 |
1886     : |         0 |       0 |     0 |   0.000 |    0.000 | 0.000 |
1887     : |-----------+---------+-------+---------+----------+-------|
1888     : |       1.0 |   1.000 | 1.000 |   1.000 |    1.000 | 1.000 |
1889     : |       0.0 |   0.000 | 0.000 |   0.000 |    0.000 | 0.000 |
1890     : |-----------+---------+-------+---------+----------+-------|
1891     : | 1.0001666 |   1.000 | 1.000 |   1.000 |    1.000 | 1.000 |
1892     : | 0.0001666 | 1.67e-4 | 0.000 | 1.67e-4 |    0.000 | 0.000 |
1893     : |-----------+---------+-------+---------+----------+-------|
1894     : | 1.0016666 |   1.002 | 1.002 |   1.002 |    1.002 | 1.002 |
1895     : | 0.0016666 |   0.002 | 0.002 |   0.002 |    0.002 | 0.002 |
1896     : |-----------+---------+-------+---------+----------+-------|
1897     : #+TBLFM: $2 = $1; f3 :: $3 = $1; f-3 :: $4 = $1 +.0; f3 :: $5 = $1 +.0; f-3 :: $6 = $1; %.3f
1899   - high precision
1900     : |----------------------+--------------------------+-----------------------|
1901     : | number               |                      f19 |                  f-19 |
1902     : |----------------------+--------------------------+-----------------------|
1903     : | 1                    |                        1 |                     1 |
1904     : | 0                    |                        0 |                     0 |
1905     : |----------------------+--------------------------+-----------------------|
1906     : | 1.0                  |    1.0000000000000000000 | 1.0000000000000000000 |
1907     : | 0.0                  |    0.0000000000000000000 | 0.0000000000000000000 |
1908     : |----------------------+--------------------------+-----------------------|
1909     : | 1 + 1 / 2 * 3 * 1e19 |    1.0000000000000000000 | 1.0000000000000000000 |
1910     : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
1911     : |----------------------+--------------------------+-----------------------|
1912     : | 1 + 1 / 2 * 3 * 1e18 |    1.0000000000000000002 | 1.0000000000000000002 |
1913     : | 0 + 1 / 2 * 3 * 1e18 |    0.0000000000000000002 | 0.0000000000000000002 |
1914     : |----------------------+--------------------------+-----------------------|
1915     : #+TBLFM: $2 = $1; p20 f19 :: $3 = $1; p20 f-19
1917     : |----------------------+--------------------------+-----------------------|
1918     : | number               |                 +.0; f19 |             +.0; f-19 |
1919     : |----------------------+--------------------------+-----------------------|
1920     : | 1                    |    1.0000000000000000000 | 1.0000000000000000000 |
1921     : | 0                    |    0.0000000000000000000 | 0.0000000000000000000 |
1922     : |----------------------+--------------------------+-----------------------|
1923     : | 1.0                  |    1.0000000000000000000 | 1.0000000000000000000 |
1924     : | 0.0                  |    0.0000000000000000000 | 0.0000000000000000000 |
1925     : |----------------------+--------------------------+-----------------------|
1926     : | 1 + 1 / 2 * 3 * 1e19 |    1.0000000000000000000 | 1.0000000000000000000 |
1927     : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
1928     : |----------------------+--------------------------+-----------------------|
1929     : | 1 + 1 / 2 * 3 * 1e18 |    1.0000000000000000002 | 1.0000000000000000002 |
1930     : | 0 + 1 / 2 * 3 * 1e18 |    0.0000000000000000002 | 0.0000000000000000002 |
1931     : |----------------------+--------------------------+-----------------------|
1932     : #+TBLFM: $2 = $1 +.0; p20 f19 :: $3 = $1 +.0; p20 f-19
1934     The =printf= reformatting (=%.19f=) cannot be used with high precision,
1935     see the [[#table-high-precision][previous FAQ entry]].
1937 ** How can I center tables in LaTeX output?
1938    :PROPERTIES:
1939    :CATEGORY: centered-tables-in-latex
1940    :END:
1942 Set the `org-export-latex-tables-centered' to `t':
1944 : (defcustom org-export-latex-tables-centered t
1945 :   "When non-nil, tables are exported in a center environment."
1946 :   :group 'org-export-latex
1947 :   :type 'boolean)
1949 * Markup
1950   :PROPERTIES:
1951   :CUSTOM_ID: Footnotes
1952   :END:
1953 ** How can I get automatic renumbering of footnotes in org-mode?
1954    :PROPERTIES:
1955    :CUSTOM_ID:       footnote-auto-adjust
1956    :END:
1958 You can add the following line to your .emacs file:
1960 : (setq org-footnote-auto-adjust t)
1962 Or, if you prefer, you can turn this option on locally by placing the
1963 following line at the top of your org file:
1965 : #+STARTUP: fnadjust
1967 When auto-adjust is turned on, footnotes in the file with numerical
1968 labels will be renumbered whenever a new footnote is added. Meanwhile,
1969 all footnotes, including those with custom labels such
1970 =[fn:custom-label ]=, will be sorted in the order of their appearance
1971 in the text.
1973 This emulates the footnote behavior that many users may be familiar
1974 with from word-processing programs or from the footnote-mode included
1975 with emacs.
1977 If you do not turn on org-footnote-auto-adjust, you sort and/or
1978 renumber footnotes at any time by calling org-footnote-action with a
1979 prefix argument.
1981 ** Why isn't auto renumbering of footnotes turned on by default?
1982    :PROPERTIES:
1983    :CUSTOM_ID:       why-no-default-auto-adjust
1984    :END:
1986 Org mode has a very robust footnote mechanism allowing for a variety
1987 of types of footnotes. With some of the following footnote notations,
1988 auto-adjust may be either irrelevant or undesired:
1990  - Automatically numbered
1991  - Footnotes with custom labels
1992  - Inline footnotes
1994 In addition, org mode can be customized to place footnotes either at
1995 the end of a document or at the end of the outline heading in which
1996 they appear. Users who change this setting while editing a document
1997 may be disconcerted to find all of their footnotes rearranged
1998 automatically.
2000 ** I have auto-fill-mode set and org-mode is inserting unwanted comment markers!
2001    :PROPERTIES:
2002    :CUSTOM_ID: auto-fill-and-unwanted-comments
2003    :END:
2005 If the following occurs:
2007 #+begin_src org
2009 #+OPTIONS: toc:nil
2010 Some entered text.
2011 # More entered tex.
2013 #+end_src
2015 Make sure that the variable comment-start is nil.
2017 ** Are there any shortcuts for entering source blocks and comment lines?
2018    :PROPERTIES:
2019    :CUSTOM_ID: shortcuts-for-entering-source-blocks
2020    :END:
2022 Org mode has some [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][very convenient markup]] for including literal blocks
2023 and lines of code in a file. (This is especially useful when exporting
2024 documents or using the contributed package [[file:org-contrib/babel/index.org][org-babel]] for executing
2025 blocks of code.)
2027 #+begin_src org
2028   ,#+begin_src perl
2029   ,  print "Hello, world!\n";
2030   ,#+end_src
2031 #+end_src
2033 It can be tiresome to enter the block comment lines manually. There
2034 are several possible shortcuts you can use to enter them:
2036 1) Built-in expansion
2038    - Org mode has a "secret" method of expanding source code blocks
2039      and comment lines.
2041    - If you type "<s" followed by =TAB= or =M-TAB=, a source block will
2042      magically appear.
2044    - For a full list of expansions, type =M-x describe-variable
2045      [RET] org-structure-template-alist=.
2047 2) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Registers]]
2049    - Add the following line to your emacs file:
2051      =(set-register ?p "#+begin_src\n\n#+end_src perl")=
2053    - Then type =C-x r i p= to insert the source block. Please note: if
2054      you save another value to the register "p" with =C-x r s p=, it
2055      will overwrite the setting above for the current emacs session.
2057 3) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Abbrevs]]
2059    - Activate the abbrev minor-mode in org-mode:
2061      + M-x abbrev-mode
2063      + /Permanently/:
2065        + =(add-hook 'org-mode-hook (lambda () (abbrev-mode 1)))=
2067    - In org-mode, type "sbp" (a sample abbreviation for a perl source
2068      block).
2070    - Immediately after "sbp" type =C-x a i l=.
2072    - Enter the expansion:
2074      - =#+begin_src perl[C-q C-j][C-q C-j]#+end_src=
2076      - Note: =C-q C-j= creates a new line in the minibuffer
2078    - Now, whenever, you type sbp followed by =SPACE= or =RET= in an
2079      org-mode buffer, the src block will magically appear.
2081    - To review your list of abbrevs, type =M-x edit-abbrevs=.
2083 4) [[http://www.slashgear.com/nokia-n900-android-dual-boot-hack-video-2371099/][Skeletons]]
2085    - Skeletons offer a simple way of automatically entering text.
2086      Here's a skeleton that queries for the type of block and wraps
2087      the active region inside it:
2089      #+begin_src elisp
2090        (define-skeleton skel-org-block
2091          "Insert an org block, querying for type."
2092          "Type: "
2093          "#+begin_" str "\n"
2094          _ - \n
2095          "#+end_" str "\n")
2096      #+end_src
2098    - Simply type skel-org-block to insert the block.
2100      - You can bind this to a key.
2102      - You can also create an abbrev that invokes this function:
2104        : (define-abbrev org-mode-abbrev-table "blk" "" 'skel-org-block)
2106 5) [[http://code.google.com/p/yasnippet/][Yasnippet]]
2108    - Several org-mode users install yasnippet for convenient, complex
2109      expansion.
2111    - See Bernt Hansen's [[http://doc.norang.ca/org-mode.html#Yasnippets][org-mode setup]] for a good introduction to
2112      yasnippet.
2114 * Capture and remember
2115   :PROPERTIES:
2116   :CUSTOM_ID: Remember
2117   :END:
2118 ** Can I use a variable or a function inside the `org-capture-templates' variable?
2119    :PROPERTIES:
2120    :CUSTOM_ID: variable-inside-capture-templates
2121    :END:
2123 Yes.  Use [[http://www.gnu.org/s/emacs/manual/html_node/elisp/Backquote.html][backquotes]].
2125 E.g. if you have a variable called =org-test-file= and you want the
2126 variable =org-capture-templates= to "understand" (i.e. evaluate)
2127 =org-test-file= when Emacs evaluates the =(setq org-capture-templates
2128 [...])= expression, use backquotes like this:
2130 #+begin_src emacs-lisp
2131 (setq org-capture-templates
2132       `(("t" "Todo" entry (file+headline ,org-test-file "Tasks")
2133        "* TODO %?\n  %i\n  %a")
2134       ("b" "Buy" item (file+olp ,org-test-file "Stuff to Buy" "House")
2135        "")))
2136 #+end_src
2138 ** Can I use the remember buffer to clock a customer phone call?
2139    :PROPERTIES:
2140    :CUSTOM_ID: use-remember-buffer-to-clock-phone-call
2141    :END:
2143   Yes, you can.  Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/5482][setup described by Bernt Hansen]]
2144   and check out (in the same thread) what Nick Docos had to fix to
2145   make Bernt's set-up work for him.
2146 ** Can I automatically start the clock when opening a remember template?
2147    :PROPERTIES:
2148    :CUSTOM_ID: start-clock-when-opening-remember-template
2149    :END:
2151    Yes, this is possible.  Use the following code and make sure that
2152    after executing it, `my-start-clock-if-needed' is in
2153    `remember-mode-hook' /after/ `org-remember-apply-template'.
2155    : (add-hook 'remember-mode-hook 'my-start-clock-if-needed 'append)
2156    : (defun my-start-clock-if-needed ()
2157    :   (save-excursion
2158    :     (goto-char (point-min))
2159    :     (when (re-search-forward " *CLOCK-IN *" nil t)
2160    :       (replace-match "")
2161    :       (org-clock-in))))
2163    Then, when a template contains the key string CLOCK-IN, the clock
2164    will be started.  Starting with Org-mode version 5.20, the clock will
2165    automatically be stopped when storing the remember buffer.
2167 * Searches
2168   :PROPERTIES:
2169   :CUSTOM_ID: Searches
2170   :END:
2171 ** Isearch does not find string hidden in links.  What can I do?
2172    :PROPERTIES:
2173    :CUSTOM_ID: isearch-in-links
2174    :END:
2176   M-x =visible-mode= will display the full link, making them searchable.
2178 ** How can I reduce the amount of context shown in sparse trees?
2179    :PROPERTIES:
2180    :CUSTOM_ID: context-in-sparse-trees
2181    :END:
2183    Take a look at the following variables:
2185    - =org-show-hierarchy-above=
2186    - =org-show-following-headline=
2187    - =org-show-siblings=
2188    - =org-show-entry-blow=
2190    which give command-dependent control over how much context is shown
2191    by a particular operation.
2193 ** How can I combine the results of two calls to =org-occur=?
2194    :PROPERTIES:
2195    :CUSTOM_ID: two-calls-to-org-occur
2196    :END:
2198    You can construct a regular expression that matches all targets you
2199    want.  Alternatively, use a =C-u= prefix with the second and any
2200    further calls to =org-occur= to keep the current visibility and
2201    highlighting in addition to the new ones.
2203 * Agenda
2204   :PROPERTIES:
2205   :CUSTOM_ID: Agenda
2206   :END:
2207 ** How can I change the advanced warning time for deadlines?
2208    :PROPERTIES:
2209    :CUSTOM_ID: warning-period-for-deadlines
2210    :END:
2211 ##<<warning-period-for-deadlines>>
2213 Deadline warnings appear in the daily agenda view a specified number
2214 of days before the deadline is due. The default setting is 14 days.
2215 You can change this with the variable =org-deadline-warning-days=.
2216 (See [[http://orgmode.org/manual/Deadlines-and-scheduling.html#Deadlines-and-scheduling][this section]] of the manual.)
2218 For instance,
2220 : (setq org-deadline-warning-days 30)
2222 would cause warnings for each deadline to appear 30 days in advance.
2224 Naturally, you might not want warnings for all of your deadlines to
2225 appear so far in advance. Thus, you can change the lead time for
2226 individual items as follows:
2228 : * TODO Get a gift for the party
2229 :   DEADLINE: <2009-01-16 Fri -2d>
2231 The "-2d" above changes the lead time for this deadline warning to two
2232 days in advance. You can also use "w" for weeks and "m" for months.
2233 ** How can I postpone a task until a certain date?
2234    :PROPERTIES:
2235    :CUSTOM_ID: deferring-tasks
2236    :END:
2238 The easiest way to postpone a task is to schedule it in the future.
2239 For instance, typing =C-c C-s +2w= on a headline will push a task two
2240 weeks into the future, so that it won't show up on the daily agenda
2241 until two weeks from now.
2243 If you'd like to prevent the task from showing up on your global todo
2244 list, you have a couple of options.
2246 1. You can set the variable =org-agenda-todo-ignore-scheduled= to =t=.
2247    This will exclude any scheduled items from your global list of
2248    active todos (=C-c a t=). (The variable
2249    =org-agenda-todo-ignore-with-date= will exclude both scheduled and
2250    deadline items from your todo list).
2251 2. You can remove the todo keyword from the item (C-c C-t <SPC>). The
2252    item will still appear on your agenda two weeks from today, but it
2253    won't show up on your todo lists.
2254 ** Can I send myself an email containing tasks or other agenda info?
2255    :PROPERTIES:
2256    :CUSTOM_ID: email-containing-tasks-or-other-agenda-info
2257    :END:
2259    Yes.  See [[http://article.gmane.org/gmane.emacs.orgmode/6112][this thread]] on the list.
2261 ** How can I limit the agenda view to my "work" tasks?
2262    :PROPERTIES:
2263    :CUSTOM_ID: limit-agenda-with-tag-filtering
2264    :END:
2266    It is often convenient to group org files into separate categories,
2267    such as "home" and "work" (or "personal" and "professional"). One
2268    of the main reasons for such classification is to create agenda
2269    views that are limited by type of work or area of responsibility.
2270    For instance, while at work, one may want to see only professional
2271    tasks; while away from work, one may want to see only personal
2272    tasks.
2274    One way to categorize files and tasks is to use a "#+FILETAGS"
2275    declaration at the top of each file, such as:
2277    : #+FILETAGS: work
2279    As long as org-use-tag-inheritance is turned on, the filetags will
2280    be inherited by all tasks in the file. A file can have multiple
2281    filetags. And, of course, tags can be added to individual headings.
2283    Tasks can be quickly filtered by tag from within the agenda by
2284    typing "/" and the name of the tag. The full key sequence to filter
2285    for work items in an agenda view would be:
2287    : C-c a a / work [or a tag shortcut]
2289 ** How can I limit the agenda view to a particular category?
2290    :PROPERTIES:
2291    :CUSTOM_ID: limit-agenda-with-category-match
2292    :END:
2294    Another way to filter agenda views by type of work is to use a
2295    "#+CATEGORY" declaration at the top of each file, such as:
2297    : #+CATEGORY: work
2299    Categories can also be added to individual headings within a file:
2301    : * Big project
2302    :   :PROPERTIES:
2303    :   :CATEGORY: work
2304    :   :END:
2306    All todos belonging to the category "work" can be found a with a
2307    simple tags-todo search:
2309    : C-c a M
2311    At the prompt, type:
2313    : CATEGORY="work"
2315    The same results can be achieved with custom agenda commands, such as:
2317 #+BEGIN_SRC emacs-lisp
2318 (setq org-agenda-custom-commands
2319       '(("h" tags-todo "CATEGORY=\"home\"")
2320         ("w" tags-todo "CATEGORY=\"work\"")
2321         ;; other custom agenda commands here
2322         ))
2323 #+END_SRC
2325 ** How can include all org files in a directory in my agenda?
2326    :PROPERTIES:
2327    :CUSTOM_ID: set-agenda-files-using-wildcards
2328    :END:
2330 You can simply include the directory (as one of the items) in the
2331 value of the variable org-agenda-files:
2333 : (setq org-agenda-files '("/my/special/path/org/"))
2335 There is another way of accomplishing the same end:
2337 : (setq org-agenda-files (file-expand-wildcards "/my/special/path/org/*.org"))
2339 ** Why aren't items disappearing from my agenda once they are marked done?
2340    :PROPERTIES:
2341    :CUSTOM_ID: removing-done-items-from-agenda
2342    :END:
2344 If items remain on your daily/weekly agenda after they are marked
2345 done, check the configuration of the following variables:
2347 : org-agenda-skip-scheduled-if-done
2348 : org-agenda-skip-deadline-if-done
2349 : org-agenda-skip-timestamp-if-done
2351 For instance, type:
2353 : M-x customize-variable RET org-agenda-skip-scheduled-if-done
2355 If this variable is turned off (=nil=), then scheduled items will
2356 remain on the agenda even after they are marked done.
2358 If the variable is turned on (=t=), then scheduled items will
2359 disappear from the agenda after they are marked done.
2361 If these settings seem not to behave the way you expect, then make
2362 sure you understand [[scheduled-vs-deadline-vs-timestamp][the
2363 difference between SCHEDULED, DEADLINE, and timestamps]].
2365 ** What is the difference between SCHEDULED, DEADLINE, and plain timestamps?
2366    :PROPERTIES:
2367    :CUSTOM_ID: scheduled-vs-deadline-vs-timestamp
2368    :END:
2370 1. SCHEDULED items (set with =C-c C-s=) will appear on your agenda on
2371    the day they are scheduled and on every day thereafter until they
2372    are done. Schedule a task if you want to be reminded to do
2373    something beginning on a certain day and until it is done.
2375    : ** TODO Scheduled item
2376    :    SCHEDULED: <2009-03-01 Sun>
2378 2. Items with a DEADLINE timestamp (set with =C-c C-d=) appear on your
2379    agenda in advance of the when they are due and remain on your
2380    agenda until they are done. Add a DEADLINE to an item if you want
2381    to make sure to complete it by a certain date. (The variable
2382    org-deadline-warning-days determines how far in advance items with
2383    deadlines will show up in the agenda. See [[warning-period-for-deadlines][this FAQ]] for more
2384    information.)
2386    : ** TODO Item with a deadline
2387    :    DEADLINE: <2009-01-20 Tue>
2389 3. An active timestamp (set with =C-c .=) will appear on your agenda
2390    only on the day it is scheduled. Use a timestamp for appointments
2391    or any reminders you want to show up only on a particular day.
2393    : ** TODO Item with an active timestamp
2394    : <2009-04-18 Sat>
2396 Note: items with inactive timestamps (set with C-c ! and marked by
2397 square brackets) will not show up in the agenda at all.
2399 ** Can I add files recursively to my list of agenda files?
2400    :PROPERTIES:
2401    :CUSTOM_ID: set-agenda-files-recursively
2402    :END:
2404 Yes, you can use the library "find-lisp."
2406 : (load-library "find-lisp")
2407 : (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$"))
2409 This will add all files ending in =org= in the directory "~/org"
2410 and all of its subdirectories to your list of agenda files.
2412 See [[http://thread.gmane.org/gmane.emacs.orgmode/8992][this thread]] on the mailing list for more information.
2414 ** Why does an item appearing at the wrong time of day in my agenda?
2415    :PROPERTIES:
2416    :CUSTOM_ID: agenda-wrong-time-of-day
2417    :END:
2419 When preparing the agenda view, org-mode scans each relevant headline
2420 for a time designation. This approach is very nice for adding
2421 free-form timestamps to an item for scheduling. Thus, either of the
2422 following work would work to schedule an item at 10:00am:
2424 #+begin_src org
2425 ,** 10:00am Get dried ice at the magic store
2426 ,   SCHEDULED: <2009-05-27 Wed>
2427 #+end_src
2429 #+begin_src org
2430 ,** Get dried ice at the magic store
2431 ,   SCHEDULED: <2009-05-27 Wed 10:00>
2432 #+end_src
2434 To enable this flexibility, org-mode scans the entire headline for
2435 time of day notation. A potential problem can arise if you use
2436 inactive timestamps in the headline to note when an item was created.
2437 For example,
2439 #+begin_src org
2440 ,** Get dried ice at the magic store [2009-05-26 Tue 12:58]
2441 ,   SCHEDULED: <2009-05-27 Wed>
2442 #+end_src
2444 Org mode would interpret the time in the inactive timestamp as a
2445 time-of-day indicator and the entry would appear in your agenda at
2446 12:58.
2448 If you would like to turn off the time-of-day search, you can
2449 configure the variable =org-agenda-search-headline-for-time= (requires
2450 org-mode >= 6.24).
2452 ** How can I change the visibility of an item from the agenda?
2453    :PROPERTIES:
2454    :CUSTOM_ID: cycling-visibility-from-agenda
2455    :END:
2457 You can add a keybinding as follows:
2459 #+begin_src emacs-lisp
2460 (add-hook 'org-agenda-mode-hook
2461    (lambda ()
2462      (define-key org-agenda-mode-map " " 'org-agenda-cycle-show)))
2463 #+end_src
2465 Then, as you press SPACE on an item on the agenda, it will cycle the
2466 visibility of its original location.
2468 ** Is there any way to set org-mode so that tags don't appear in the agenda view?
2470 See the =org-agenda-remove-tags= variable.
2472 ** I work late at night! How can I extend my current day past midnight?
2473    :PROPERTIES:
2474    :CUSTOM_ID: org-extend-today-until
2475    :END:
2477 If you work past midnight, you may not want your daily agenda view to
2478 switch to the next day at 12 a.m. (the default). To extend your day,
2479 simply set the value of org-extend-today-until to a positive number
2480 corresponding to the number of hours you work past midnight. For
2481 example, the following setting will cause the current day to extend
2482 until 6 a.m.
2484 : (setq org-extend-today-until 6)
2486 * Appointments/Diary
2487   :PROPERTIES:
2488   :CUSTOM_ID: Appointments/Diary
2489   :END:
2490 ** Is it possible to include entries from org-mode files into my emacs diary?
2491    :PROPERTIES:
2492    :CUSTOM_ID: include-entries-from-org-mode-files-into-emacs-diary
2493    :END:
2495    Since the org-mode agenda is much more powerful and can contain the
2496    diary, you should think twice before deciding to do this.  If you
2497    insist, however, integrating Org-mode information into the diary is
2498    possible.  You need to turn on /fancy diary display/ by setting in
2499    .emacs:
2501    : (add-hook 'diary-display-hook 'diary-fancy-display)
2503    Then include the following line into your ~/diary file, in
2504    order to get the entries from all files listed in the variable
2505    =org-agenda-files=
2507    : &%%(org-diary)
2509    You may also select specific files with
2511    : &%%(org-diary) ~/path/to/some/org-file.org
2512    : &%%(org-diary) ~/path/to/another/org-file.org
2514    If you now launch the calendar and press @<tt>d@</tt> to display a
2515    diary, the headlines of entries containing a timestamp, date range,
2516    schedule, or deadline referring to the selected date will be listed.
2517    Just like Org-mode's agenda view, the diary for /today/ contains
2518    additional entries for overdue deadlines and scheduled items.  See
2519    also the documentation of the =org-diary= function.  Under XEmacs, it
2520    is not possible to jump back from the diary to the org, this works
2521    only in the agenda buffer.
2522 ** I want to add my Org scheduled/deadlined entries in my diary!
2523    :PROPERTIES:
2524    :CUSTOM_ID: add-Org-scheduled/deadlined-entries-to-diary!
2525    :END:
2527   Put this in your ~/.diary:
2529   : &%%(org-diary :scheduled :timestamp :deadline)
2531 ** How can I set up automatic reminders based on Org information?
2532    :PROPERTIES:
2533    :CUSTOM_ID: automatic-reminders
2534    :END:
2536   See [[http://article.gmane.org/gmane.emacs.orgmode/5271][this post]] by N. Dokos on the list.
2537 ** How can I make =appt= notice my Org appointments?
2538    :PROPERTIES:
2539    :CUSTOM_ID: appt-notice-my-Org-appointments
2540    :END:
2542   : M-x org-agenda-to-appt RET
2544 ** How can I create more complex appointments in my org-files?
2545    :PROPERTIES:
2546    :CUSTOM_ID: diary-sexp-in-org-files
2547    :END:
2549 Org-mode's active timestamps work very well for scheduling individual
2550 or recurring appointments, such as:
2552 #+begin_src org
2553   ,* 8:00am Dentist appointment <2009-01-16 Fri>
2554 #+end_src
2557 #+begin_src org
2558   ,* Vacation
2559   ,  <2009-03-20 Fri>--<2009-04-01 Wed>
2560 #+end_src
2564 #+begin_src org
2565   ,* Weekly meeting with boss
2566   ,  <2009-01-20 Tue 14:00 +1w>
2567 #+end_src
2569 Sometimes, however, you need to set up more complicated recurring
2570 appointments. Org-mode has built-in support for many of
2571 [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Sexp-Diary-Entries.html][the
2572 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
2573 instance, that you teach a class that meets every Monday evening
2574 between February 16 and April 20, 2009. The way to enter this an
2575 org-mode file is:
2577 #+begin_src org
2578   ,** Class 7:00pm-9:00pm
2579   ,   <%%(and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009))>
2580 #+end_src
2582 The expression above designates all Mondays that fall between February
2583 16 and April 20. How exactly does it work?
2585  - (and... :: Indicates that *both* of the conditions that follow have
2586           to be true.
2588    - (= 1 (calendar-day-of-week date)) :: Is the day of the week a
2589         Monday?
2591        - Note: the function calendar-day-of-week converts the date to the day of week
2592          expressed in numeric form, where 0 = Sunday, 1 = Monday, and so on.
2594    - (diary-block 2 16 2009 4 20 2009) :: Does the date fall between
2595         these two dates?
2597 You can make a sexp as complex as you like. If you wanted to omit a
2598 week because of holidays, for instance, you could add another
2599 condition to the sexp:
2601 #+begin_src org
2602   ,** Class 7:00pm-9:00pm
2603   ,   <%%(unless (diary-block 3 9 2009 3 13 2009) (and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009)))>
2604 #+end_src
2606 The sexp above would omit Monday during the week of March 9, 2009. For
2607 another way to accomplish the same thing, see [[org-diary-class][this FAQ]].
2609 Another diary function commonly used for more complex scheduling is
2610 diary-float. For instance,
2612 #+begin_src org
2613   ,* Monthly meeting
2614   ,  <%%(diary-float t 3 3)>
2615 #+end_src
2617 ...would appear on the third Wednesday of every month.
2619 For more ideas on how to create diary special expressions, see [[http://www.emacswiki.org/cgi-bin/wiki/DiaryMode][this
2620 page on the Emacs wiki]].
2622 ** How can I schedule a weekly class that lasts for a limited period of time?
2623    :PROPERTIES:
2624    :CUSTOM_ID: org-diary-class
2625    :END:
2627 Org-mode offers a convenient diary sexp function for setting up a
2628 recurring appointment that lasts for a certain period of time, such as
2629 a class. It is called org-diary-class and it can be entered as
2630 follows:
2632 #+begin_src org
2633   ,** Class 7:00pm-9:00pm
2634   ,   <%%(org-diary-class 2 16 2009 4 20 2009 1 10)>
2635 #+end_src
2637 The function above schedules an appointment for every Monday (1)
2638 between February 16 and April 20, 2009, except for ISO week 10 (March
2639 1 to March 7).
2641 The function org-diary-class has the following format:
2643 : (org-diary-class M1 D1 Y1 M2 D2 Y2 DAYNAME &rest SKIP-WEEKS)
2645 M1/2, D1/2, and Y1/2 indicate the beginning and ending dates. Dayname
2646 takes the form of a number indicating the day of the week (0 = Sunday,
2647 1 = Monday, and so on...). In addition, one can add an optional
2648 argument SKIP-WEEKS to indicate weeks on the calendar that should be
2649 skipped. This argument should be expressed as an ISO week number. You
2650 can find the number by invoking emacs' built-in calendar (=M-x
2651 calendar=), navigating to the appropriate week, and typing =p c=
2652 (calendar-iso-print-date).
2654 Please note: the order of the month, day, and year arguments depends
2655 on the variables =calendar-date-style= and/or
2656 =european=calendar=style=. (See the documentation for these variables
2657 with C-h v or M-x describe variable.) For instance, the example above
2658 works if =calendar-date-style= is set to ='american=. If
2659 =calendar-date-style= is set to ='iso=, then the arguments to the
2660 org-diary-class sexp would have the following format:
2662 : (org-diary-class Y1 M1 D1 Y2 M2 D2 DAYNAME &rest SKIP-WEEKS)
2664 Here is an alternative method, shared by Paul Sexton on the org
2665 mailing list:
2667 Let's say you are taking night classes in Spanish. The class is every
2668 Wednesday evening at 7pm, starting on 18 August, and runs for 8 weeks.
2669 Org-mode's timestamps do not support limited occurrences of recurrent
2670 items -- you have to schedule the item with infinite recurrences, then
2671 delete it when it finishes.
2673 To schedule the Spanish classes, put the following in your =.emacs=:
2675 #+begin_src emacs-lisp
2676   (defun diary-limited-cyclic (recurrences interval m d y)
2677     "For use in emacs diary. Cyclic item with limited number of recurrences.
2678   Occurs every INTERVAL days, starting on YYYY-MM-DD, for a total of
2679   RECURRENCES occasions."
2680     (let ((startdate (calendar-absolute-from-gregorian (list m d y)))
2681           (today (calendar-absolute-from-gregorian date)))
2682       (and (not (minusp (- today startdate)))
2683            (zerop (% (- today startdate) interval))
2684            (< (floor (- today startdate) interval) recurrences))))
2685 #+end_src
2686 The item in the org file looks like this:
2688 #+begin_src org
2689   ,** 19:00-21:00 Spanish lessons
2690   ,   <%%(diary-limited-cyclic 8 7 8 18 2010)>
2691 #+end_src
2693 ** How can I set an event to occur every day except Saturday and Sunday?
2695 #+begin_src org
2696   ,** Daily meeting
2697   ,   <%%(memq (calendar-day-of-week date) '(1 2 3 4 5))>
2698 #+end_src
2700 ** How do I schedule events relative to Easter Sunday?
2702    Easter's date moves around from year to year according to a
2703    complicated set of criteria which I do not claim to understand.
2704    However the following code will allow you to schedule recurring
2705    events relative to Easter Sunday.
2707    Note: the function da-easter is from:
2708    http://github.com/soren/elisp/blob/master/da-kalender.el
2710    Put the following in your .emacs:
2712 #+begin_src emacs-lisp
2713   (defun da-easter (year)
2714     "Calculate the date for Easter Sunday in YEAR. Returns the date in the
2715   Gregorian calendar, ie (MM DD YY) format."
2716     (let* ((century (1+ (/ year 100)))
2717            (shifted-epact (% (+ 14 (* 11 (% year 19))
2718                                 (- (/ (* 3 century) 4))
2719                                 (/ (+ 5 (* 8 century)) 25)
2720                                 (* 30 century))
2721                              30))
2722            (adjusted-epact (if (or (= shifted-epact 0)
2723                                    (and (= shifted-epact 1)
2724                                         (< 10 (% year 19))))
2725                                (1+ shifted-epact)
2726                              shifted-epact))
2727            (paschal-moon (- (calendar-absolute-from-gregorian
2728                              (list 4 19 year))
2729                             adjusted-epact)))
2730       (calendar-dayname-on-or-before 0 (+ paschal-moon 7))))
2733   (defun da-easter-gregorian (year)
2734     (calendar-gregorian-from-absolute (da-easter year)))
2736   (defun calendar-days-from-easter ()
2737     "When used in a diary sexp, this function will calculate how many days
2738   are between the current date (DATE) and Easter Sunday."
2739     (- (calendar-absolute-from-gregorian date)
2740        (da-easter (calendar-extract-year date))))
2741 #+end_src
2743     Now we can schedule the public holidays associated with Easter as
2744     recurring events. Good Friday is 2 days before "Easter", Easter
2745     Monday is one day after.
2747 #+begin_src org
2748   ,* Good Friday
2749   ,  <%%(= -2 (calendar-days-from-easter))>
2751   ,* Easter Sunday
2752   ,  <%%(= 0 (calendar-days-from-easter))>
2754   ,* Easter Monday
2755   ,  <%%(= 1 (calendar-days-from-easter))>
2756 #+end_src
2757    [Source: Posted by Paul Sexton on Org-mode mailing list.]
2759 ** How to schedule public holiday that is "the nearest Monday to DATE"?
2761    In New Zealand each regional capital has an "Anniversary Day". The
2762    date of Auckland's anniversary day is "the nearest Monday to 29
2763    January".
2765    Put this in your =.emacs=:
2767 #+begin_src emacs-lisp
2768   (defun calendar-nearest-to (target-dayname target-day target-month)
2769     "Recurring event that occurs in the nearest TARGET-DAYNAME to
2770   the date TARGET-DAY, TARGET-MONTH each year."
2771     (interactive)
2772     (let* ((dayname (calendar-day-of-week date))
2773            (target-date (list target-month target-day (calendar-extract-year date)))
2774            (days-diff (abs (- (calendar-day-number date)
2775                               (calendar-day-number target-date)))))
2776       (and (= dayname target-dayname)
2777            (< days-diff 4))))
2778 #+end_src
2780    Now we can schedule Auckland Anniversary Day. The first argument,
2781    1, means Monday (days of the week are numbered starting with
2782    Sunday=0).
2784    [Source: Originally posted by Paul Sexton on Org-mode mailing list.]
2786 ** How to schedule public holiday on "the 4th Monday in October"?
2788    This does not require any additions to =.emacs=:
2790 #+begin_src org
2791   ,* Labour Day (NZ)
2792   ,  <%%(diary-float 10 1 4)>
2793 #+end_src
2795 ** Why isn't the agenda showing all the times I put under a single entry?
2796    :PROPERTIES:
2797    :CATEGORY: multiple-timestamps-same-entry
2798    :END:
2800 Probably because you have not set the following variable:
2802 : org-agenda-skip-additional-timestamps-same-entry
2804 The default value of this variable is t, which means that entries with
2805 multiple timestamps, such as the following...
2807 #+begin_src org
2808   ,* Work really, really hard
2809   ,  <2010-11-20 Sat 10:00>
2810   ,  <2010-11-20 Sat 14:00>
2811 #+end_src
2813 ...will only appear in the agenda at the time specified by the first
2814 timestamp. If you set org-agenda-skip-additional-timestamps-same-entry
2815 to nil, the item will appear will appear at all the times you specify.
2817 * Export
2818   :PROPERTIES:
2819   :CUSTOM_ID: Export
2820   :END:
2821 ** Can I get TODO items exported to HTML as lists, rather than as headlines?
2822    :PROPERTIES:
2823    :CUSTOM_ID: export-TODO-items-as-lists
2824    :END:
2826    If you plan to use ASCII or HTML export, make sure things you want to
2827    be exported as item lists are level 4 at least, even if that does
2828    mean there is a level jump.  For example:
2830    : * Todays top priorities
2831    : **** TODO write a letter to xyz
2832    : **** TODO Finish the paper
2833    : **** Pick up kids at the school
2835    Alternatively, if you need a specific value for the heading/item
2836    transition in a particular file, use the =#+OPTIONS= line to
2837    configure the H switch.
2839    : #+OPTIONS:   H:2; ...
2841 ** Can I export only a single subtree?
2842    :PROPERTIES:
2843    :CUSTOM_ID: export-single-subtree
2844    :END:
2846 If you want to export a subtree, mark the subtree as region and then
2847 export. Marking can be done with =C-c @ C-x C-x=, for example.
2849 Alternatively, you can select option =1= in the org export dispatcher
2850 (e.g.., =C-c C-e 1 h= to export the current subtree to html).
2852 By default, the title of the exported file will be set to the heading
2853 of the subtree. You can, however, [[#export-options-for-subtree][customize the title and other export
2854 options]].
2856 ** How can I customize export options for a single subtree?
2857    :PROPERTIES:
2858    :CUSTOM_ID: export-options-for-subtree
2859    :END:
2861 You can set unique export options for a [[#export-single-subtree][single subtree]] by using
2862 properties. Relevant properties include:
2864  - EXPORT_TITLE
2865  - EXPORT_AUTHOR
2866  - EXPORT_DATE
2867  - EXPORT_FILE_NAME
2868  - EXPORT_OPTIONS (corresponds to the =#+OPTIONS:= [[http://orgmode.org/manual/Export-options.html#Export-options][configuration line]])
2870 ** How can I tell my calendar web application about appointments in my agenda files?
2872 Here is what you need to do:
2874 1. a script that calls Emacs in batch mode and produce a .ics file
2875 2. a script that uploads this .ics file somewhere on the web
2876 3. tell your webapp to fetch this .ics file on the web
2878 Here is the script I use for the first step:
2880 #+begin_src shell-script-mode
2881 #!/bin/bash
2883 /usr/local/bin/emacs --batch --eval \
2884 "(progn (load-file \"~/install/git/org-mode/org.el\") \
2885         (load-file \"~/elisp/config/org-batch-config.el\") \
2886         (setq org-combined-agenda-icalendar-file \"~/org/cal/org.ics\")
2887         (setq org-agenda-files (quote (\"~/org/bzg.org\"))))" \
2888     -f org-export-icalendar-combine-agenda-files
2889 #+end_src
2891 Depending on your configuration, you might change the load sequence.
2893 Here is the script I use for the second step:
2895 #+begin_src shell-script-mode
2896 #!/bin/bash
2897 /usr/bin/rsync -rtv ~/org/org.ics -e ssh me@my_server:/home/me/public_html/
2898 #+end_src
2900 Note: if you want to cron this rsync script, you will need to let
2901 =my_server= to know about your SSH public key.  Check [[http://troy.jdmz.net/rsync/index.html][this page]] as a
2902 starter.
2904 Now you can cron the two scripts above and your webapp will always be
2905 up to date with your Org agendas.
2907 Also see [[http://orgmode.org/org.html#Exporting-Agenda-Views][Exporting agenda views]] from Org manual.
2909 ** How can I get Mac OSX 10.3 iCal to import my Org-exported .ics files?
2910    :PROPERTIES:
2911    :CUSTOM_ID: iCal-import-ics-files-old
2912    :END:
2914    When using iCal under Apple MacOS X Tiger, you can create a new
2915    calendar /OrgMode/ (the default name for the calendar created by =C-c
2916    C-e c=, see the variables =org-icalendar-combined-name= and
2917    =org-combined-agenda-icalendar-file=).  Then set Org-mode to
2918    overwrite the corresponding file /~/Library/Calendars/OrgMode.ics/.
2919    You may even use AppleScript to make iCal re-read the calendar files
2920    each time a new version of /OrgMode.ics/ is produced.  Here is the
2921    setup needed for this:
2923    : (setq org-combined-agenda-icalendar-file
2924    :     "~/Library/Calendars/OrgMode.ics")
2925    : (add-hook 'org-after-save-iCalendar-file-hook
2926    :  (lambda ()
2927    :   (shell-command
2928    :    "osascript -e 'tell application \"iCal\" to reload calendars'")))
2930 ** How can I get Mac OSX 10.4 or later iCal to import my Org-exported .ics files?
2931    :PROPERTIES:
2932    :CUSTOM_ID: iCal-import-ics-files-new
2933    :END:
2935    For Mac OS X 10.4, you need to write the ics file to
2936    =/Library/WebServer/Documents/= and then subscribe iCalendar to
2937    =http: //localhost/orgmode.ics=
2939 ** How can I remove timestamps and todo keywords from my exported file?
2940    :PROPERTIES:
2941    :CUSTOM_ID: export-options-remove-timestamps
2942    :END:
2944 You can place an options line at the top of your org file:
2946 : #+OPTIONS: <:nil todo:nil
2948 There is a whole host of export options you can set with an in-buffer
2949 options or via global variables. See [[http://orgmode.org/manual/Export-options.html#Export-options][this section]] of the manual for a
2950 full list.
2952 ** How can I preserve faces when I export an agenda from the command line?
2953    :PROPERTIES:
2954    :CUSTOM_ID: preserving-faces-during-batch-export
2955    :END:
2957 Normally, when you export an org file or an agenda view from within
2958 emacs, htmlize will convert your face definitions to direct color css
2959 styles inlined into each =<span>= object, resulting in an HTML output
2960 that preserves the general look of your Org buffers and agenda views.
2962 Let's say you generate an export from the command line, such as the
2963 following:
2965 : emacs -batch -l ~/.emacs -eval '(org-batch-agenda "e")'
2969 : emacs -batch -l ~/.emacs -eval '(org-publish-all)'
2971 In such an instance, the exported HTML will contain only very basic
2972 color styles. The reason is that when Emacs is run in batch mode, it
2973 does not have a display and therefore only rudimentary face
2974 definitions.  If you'd like to use more complex styles, you'll have to
2975 make sure that the export process only assigns classes instead of
2976 direct color values.  This can be done by binding the variable
2977 =org-export-htmlize-output-style= to =css= for the duration of the
2978 export, for example with
2980 : emacs -batch -l ~/.emacs
2981 :   -eval '(let ((org-export-htmlize-generate-css (quote css)))
2982 :            (org-batch-agenda "e"))'
2984 Then you can use a style file to make these classes look any way you
2985 like.  To generate face definitions for a CSS file based on any faces
2986 you are currently using in Emacs, you can use the following command:
2988 : M-x org-export-htmlize-generate-css RET
2990 This will generate a =<style>...</style>= section, the content of
2991 which you can add to your style file.
2993 ** How can I avoid dark color background when exporting agenda to ps format?
2994    :PROPERTIES:
2995    :CUSTOM_ID: avoiding-dark-background-when-exporting-agenda
2996    :END:
2998 Add this to your .emacs and evaluate it.
3000 #+BEGIN_SRC emacs-lisp
3001   (setq org-agenda-exporter-settings
3002         '((ps-print-color-p 'black-white)))
3003 #+END_SRC
3005 ** How can I include e.g. an abstract in export to Latex and HTML?
3006    :PROPERTIES:
3007    :CUSTOM_ID: include-abstract-in-export-to-latex-and-html
3008    :END:
3010 Org does not currently have special markup for abstracts, but for
3011 export purposes, you can extend the block-level structural and
3012 semantic markup in Org with the contributed package [[file:org-contrib/org-special-blocks.org][org-special-blocks]]
3013 (by Chris Gray). To turn it on, put this in your =.emacs=:
3015 : (require 'org-special-blocks)
3017 Now, you can mark up the abstract of your article like this:
3019 : #+BEGIN_ABSTRACT
3020 : Falling apples were observed and compared with pears. Newton's laws
3021 : were confirmed at the 95% confidence level.
3022 : #+END_ABSTRACT 
3024 Exporting to Latex wraps this in a
3025 =\begin{abstract}....\end{abstract}= environment, which just works.
3027 HTML export wraps it in a ~<div class="abstract">...</div>~
3028 element. The HTML result won't look like anything special until you
3029 style it. Here is some sample CSS to get you started; put these in
3030 your document header:
3032 : #+STYLE: <style>.abstract {margin: 1em; padding: 1em; border: 1px solid black}
3033 : #+STYLE: .abstract:before {content: "Abstract: "; font-weight: bold}</style>
3035 Generally, =#+begin_foo= will work for any simple Latex =foo=
3036 environment not supported by existing Org markup.
3038 If you need to pass parameters, process the block content in some way,
3039 or support other exporters, you may want to consider whether you can
3040 customize it using Eric Schulte's [[file:org-contrib/org-exp-blocks.org][org-exp-blocks]] instead.
3042 ** How can I get colored source code when exporting to LaTeX?
3043    :PROPERTIES:
3044    :CUSTOM_ID: fontified_source_code_w_latex
3045    :END:
3047 As of Sun Aug 9 2009 the "current" version of Org-mode (see
3048 [[keeping-current-with-Org-mode-development]]) supports exporting
3049 source code to LaTeX using the listings package.
3051 To turn on listing export add the following to your Org-mode
3052 customization.
3053 #+begin_src emacs-lisp
3054   ;; requite org-latex so that the following variables are defined
3055   (require 'org-latex)
3057   ;; tell org to use listings
3058   (setq org-export-latex-listings t)
3060   ;; you must include the listings package
3061   (add-to-list 'org-export-latex-packages-alist '("" "listings"))
3063   ;; if you want colored source code then you need to include the color package
3064   (add-to-list 'org-export-latex-packages-alist '("" "color"))
3065 #+end_src
3067 The listings package will now be used to fontify source code in your
3068 LaTeX documents.  By default listings will not color any of your
3069 source code.  If you would like to set colors for keywords and
3070 comments in your latex documents you can do so using LaTeX directives
3071 like the following.
3072 #+begin_src latex
3073   \lstset{keywordstyle=\color{blue},
3074     commentstyle=\color{red},
3075     stringstyle=\color{green}
3076   }
3077 #+end_src
3079 of if you want to get even fancier with your colors you can try
3080 something like the following
3081 #+begin_src latex
3082 \definecolor{keywords}{RGB}{255,0,90}
3083 \definecolor{comments}{RGB}{60,179,113}
3084 \definecolor{fore}{RGB}{249,242,215}
3085 \definecolor{back}{RGB}{51,51,51}
3086 \lstset{
3087   basicstyle=\color{fore},
3088   keywordstyle=\color{keywords},
3089   commentstyle=\color{comments},
3090   backgroundcolor=\color{back}
3092 #+end_src
3094 For more complex listings use cases consult the [[ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/listings/listings.pdf][listings manual]].
3096 ** How can I export to Latex Beamer
3097    :PROPERTIES:
3098    :CUSTOM_ID: beamer
3099    :END:
3100 The latex [[http://latex-beamer.sourceforge.net/][Beamer Class]] is a useful class for generating slide shows.
3101 The following can be used to export Org-mode documents to LaTeX
3102 beamer.
3104 Add the following to your Emacs initialization file.
3105 #+begin_src emacs-lisp
3106   (unless (boundp 'org-export-latex-classes)
3107     (setq org-export-latex-classes nil))
3108   (add-to-list 'org-export-latex-classes
3109                '("beamer"
3110                  "\\documentclass[11pt]{beamer}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{hyperref}\n\\usepackage{verbatim}\n"
3111                  ("\\section{%s}" . "\\section*{%s}")
3112                  ("\\begin{frame}\\frametitle{%s}" "\\end{frame}"
3113                   "\\begin{frame}\\frametitle{%s}" "\\end{frame}")))
3114 #+end_src
3116 Then by placing
3117 : #+LaTeX_CLASS: beamer
3118 in the header of your Org-mode document it will automatically export
3119 to the Beamer document class on LaTeX export.  With the above
3120 configuration top-level headers will be mapped to sections in the
3121 Beamer document, second-level headers will be mapped to frames, and
3122 lower level headlines will be mapped to itemize objects.
3124 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
3125 Thomas Dye]].  For a much more complex Beamer setup see the [[http://article.gmane.org/gmane.emacs.orgmode/17767/match=beamer+dokos][email by
3126 Thomas Dye]].
3128 ** How can I use RefTeX in Org-mode files for LaTeX export and in Org-babel LaTeX code blocks?
3129    :PROPERTIES:
3130    :CUSTOM_ID: using-reftex-in-org-mode
3131    :END:
3133 [[http://www.gnu.org/software/auctex/reftex.html][RefTeX]] is an indispensable tool for the author of LaTeX documents.  It
3134 aids in creation of bibliographies, cross-references, indexes, and
3135 glossaries.  RefTeX understands the structure of multi-file LaTeX
3136 documents and is able to collect from them information about the
3137 location(s) of external data stores used in creation of the final
3138 document.  RefTeX was written by Carsten Dominik and is currently
3139 being maintained by the [[http://www.gnu.org/software/auctex/index.html][AucTeX]] project.
3141 *** Using RefTeX In Org-mode Files for LaTeX Export
3142 In Org-mode files for LaTeX export, the trick is to find a way to tell
3143 RefTeX the locations of external data stores.  One way is to set the
3144 variable, =reftex-default-bibliography=.  Add lines like these to
3145 .emacs:
3147 #+begin_src emacs-lisp
3148   (setq reftex-default-bibliography
3149         (quote
3150          ("default.bib" "other-default.bib")))
3151 #+end_src
3153 In practice, this is a limited solution and the
3154 typical user will want to pass this information on a per-file basis.
3155 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
3156 Braindump]].
3158 The first solution, proposed by Mario, enables the RefTeX citation
3159 function in Org-mode.  Add these lines to .emacs:
3161 #+begin_src emacs-lisp
3162   (defun org-mode-reftex-setup ()
3163     (load-library "reftex")
3164     (and (buffer-file-name)
3165          (file-exists-p (buffer-file-name))
3166          (reftex-parse-all))
3167     (define-key org-mode-map (kbd "C-c )") 'reftex-citation))
3168   (add-hook 'org-mode-hook 'org-mode-reftex-setup)
3169 #+end_src
3171 Then add the following lines anywhere in the Org-mode file (Org-mode
3172 will recognize them as LaTeX commands):
3174 #+begin_src org
3175 \bibliographystyle{plain}
3176 \bibliography{BIB-NAME}
3177 #+end_src
3179 With this setup, =C-c )= will invoke =reftex-citation= which will
3180 insert a reference in the usual way:
3182 #+begin_src org
3183   ,* test reftex
3185   ,This is a citation \cite{tierney90}.
3187   ,\bibliographystyle{plain}
3188   ,\bibliography{tsd}
3189 #+end_src
3191 This Org-mode file will export the following LaTeX output:
3193 #+begin_src latex :exports code
3194   % Created 2010-03-22 Mon 14:34
3195   \documentclass[11pt,letter]{article}
3196   \usepackage[utf8]{inputenc}
3197   \usepackage[T1]{fontenc}
3198   \usepackage{hyperref}
3200   \title{test.org}
3201   \author{Tom Dye}
3202   \date{2010-03-22 Mon}
3204   \begin{document}
3206   \maketitle
3208   \setcounter{tocdepth}{3}
3209   \tableofcontents
3210   \vspace*{1cm}
3212   \section{test reftex}
3213   \label{sec-1}
3216   This is a citation \cite{tierney90}.
3218   \bibliographystyle{plain}
3219   \bibliography{tsd}
3221   \end{document}
3222 #+end_src
3225 A second solution, to activate the RefTeX minor mode on a per-file
3226 basis, was posted by Kevin Brubeck Unhammer in response to this idea.
3227 Add the following lines to .emacs:
3229 #+begin_src emacs-lisp
3230   (add-hook ‘org-mode-hook
3231              (lambda ()
3232                (if (member “WRITE” org-todo-keywords-1)
3233                    (org-mode-article-modes))))
3234 #+end_src
3236 where =org-mode-article-modes= is defined as follows:
3238 #+begin_src emacs-lisp
3239   (defun org-mode-article-modes ()
3240     (reftex-mode t)
3241     (bib-cite-minor-mode t)
3242     (and (buffer-file-name)
3243          (file-exists-p (buffer-file-name))
3244          (reftex-parse-all)))
3245 #+end_src
3247 Add the =\bibliographystyle{}= and =\bibliography{}= lines to the
3248 Org-mode file as before and define a TODO keyword, =WRITE=, perhaps
3249 like this:
3251 #+begin_src org
3252   ,#+TODO: TODO(t) STARTED(s) WRITE | DONE(d) DEFERRED(f)
3253 #+end_src
3255 With this setup, you insert a citation with =M-x reftex-citation RET=.
3257 *** Using RefTeX in Org-babel LaTeX Code Blocks
3259 In Org-babel LaTeX code blocks, the trick is to give RefTeX access to
3260 information in other Org-babel LaTeX code blocks.  If you use an Emacs
3261 starter kit where configuration information is held in Org-mode files,
3262 then the second solution is preferable because you won't be asked for
3263 a master file when Emacs is started.  For this reason, the second
3264 solution is modified for use with Org-babel latex code blocks.  No
3265 key-binding is needed here because Org-babel code blocks are edited
3266 within the usual AucTeX environment.
3268 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]])
3269 #+begin_src emacs-lisp
3270   (defun org-mode-article-modes ()
3271     (reftex-mode t)
3272     (and (buffer-file-name)
3273          (file-exists-p (buffer-file-name))
3274          (reftex-parse-all)))
3276   (add-hook 'org-mode-hook
3277             (lambda ()
3278               (if (member "REFTEX" org-todo-keywords-1)
3279                   (org-mode-article-modes))))
3280 #+end_src
3282 Then add a line like the following line to the top of your org-mode file:
3284 #+begin_src org
3285   ,#+TODO: TODO(t) STARTED(s) | DONE(d) DEFERRED(f) REFTEX
3286 #+end_src
3288 When you open an org-mode file with a line like this, RefTeX will
3289 prompt for the master .tex file, which will be parsed in the usual
3290 way.  This means that the .tex file should already exist, perhaps by
3291 tangling the LaTeX preamble and postamble, before
3292 =org-mode-article-modes= is activated for the Org-mode file.
3294 ** Why is my exported PDF file almost unreadable?
3295    :PROPERTIES:
3296    :CUSTOM_ID: unreadable-pdfs
3297    :END:
3299 Some PDF viewers (earlier versions (< v6) of Acrobat Reader, Evince,
3300 possibly others) do not get along with Adobe Type3 fonts, producing
3301 almost unreadable screen output (printed output is OK). If you see
3302 this, first verify the fonts that your document uses: open it with
3303 Acrobat Reader or Evince, select "Properties" from the "File" menu and
3304 click on the "Fonts" tab; alternatively, you can use the pdffonts
3305 program (part of the xpdf-reader package) from the command line.  If
3306 that is indeed the problem, then either use a different viewer or
3307 install Type1 versions of the problematic fonts. For more details, see
3308 the "PDF export" section of [[./org-dependencies.org][org-dependencies]].
3310 ** Can I add attributes to a link or an image in HTML export?
3311    :PROPERTIES:
3312    :CUSTOM_ID: html-image-and-link-attributes
3313    :END:
3315 Yes.  Excerpt from [[http://orgmode.org/manual/Images-in-HTML-export.html#Images-in-HTML-export][Org's manual]]:
3317 If you need to add attributes to an inlined image, use a `#+ATTR_HTML'.
3318 In the example below we specify the `alt' and `title' attributes to
3319 support text viewers and accessibility, and align it to the right.
3321 :  #+CAPTION: A black cat stalking a spider
3322 :  #+ATTR_HTML: alt="cat/spider image" title="Action!" align="right"
3323 :  [[./img/a.jpg]]
3325 and you could use `http' addresses just as well.
3327 ** How can I export an org file to rtf, odt (Open Office), or doc (Word)?
3328    :PROPERTIES:
3329    :CUSTOM_ID: convert-to-open-office
3330    :END:
3332 While you cannot export directly from org to doc or odt, you can
3333 export to one of org-mode's supported export formats and then use an
3334 external tool or method to convert the exported file to doc or odt.
3335 While most of these methods work with simple documents, they may work
3336 more or less well when the document contains complex elements, such as
3337 footnotes, embedded images, math formulas, and so on. (Note, the lists
3338 below are by no means comprehensive).
3340 1. html -> odt/doc/rtf
3341    - open html in Open Office and save as odt/doc ([[http://permalink.gmane.org/gmane.emacs.orgmode/31482][see this post by
3342      Eric Fraga]])
3343    - [[http://www.artofsolving.com/opensource/pyodconverter][PyODConverter]]
3344    - [[http://johnmacfarlane.net/pandoc/][Pandoc]] (this works for LaTeX and docbook as well)
3345    - (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
3346      from html to doc
3348 2. LaTeX -> odt/doc/rtf
3349    - [[http://latex2rtf.sourceforge.net/][LaTeX2rtf]] (works well with index, footnotes, and references)
3350    - [[http://www.tug.org/tex4ht/][TeX4ht]] (works with more complex latex elements, though can be
3351      difficult to install)
3352      - run =mk4ht oolatex file.tex=
3354 See [[http://permalink.gmane.org/gmane.emacs.orgmode/31168][this thread]] for further details.
3356 * MobileOrg
3358 ** Which versions of MobileOrg do exist
3359    :PROPERTIES:
3360    :CUSTOM_ID: mobileorg_versions
3361    :END:
3363 - MobileOrg for the iPhone/iPod Touch/iPad series of devices, by
3364   Richard Moreland.  Check out
3365   [[http://mobileorg.ncogni.to/][Richard's page]]
3366 - Matt Jones is developing a feature-equivalent application for
3367   Android, see
3368   [[http://wiki.github.com/matburt/mobileorg-android/][his project page]].
3370 ** What can I do if I don't want to use Dropbox.com
3371    :PROPERTIES:
3372    :CUSTOM_ID: mobileorg_webdav
3373    :END:
3375 Dropbox.com is the easiest way to connect between Emacs and MobileOrg,
3376 you can get a free account there.  If for some reason you cannot or do
3377 not want to use this path, you can use any webdav server.  On this
3378 webdav server you need to create a dedicated directory for the
3379 communication between Emacs and MobileOrg.  If you can mount that
3380 directory locally so that Emacs can directly write to it, just point
3381 to that directory using the variable =org-mobile-directory=.  Using
3382 the /tramp/ method, =org-mobile-directory= may point to a remote
3383 directory accessible through, for example, /ssh/ and /scp/:
3385 #+begin_src emacs-lisp
3386 (setq org-mobile-directory "/scpc:user@@remote.host:org/webdav/")
3387 #+end_src
3389 If Emacs cannot access the WebDAV directory directly using a /tramp/
3390 method, you can use a local directory for staging.  Other means must
3391 then be used to keep this directory in sync with the WebDAV directory.
3392 In the following example, files are staged in =~/stage/=, and Org-mode
3393 hooks take care of moving files to and from the WebDAV directory using
3394 /scp/.
3396 #+begin_src emacs-lisp
3397 (setq org-mobile-directory "~/stage/")
3398 (add-hook 'org-mobile-post-push-hook
3399   (lambda () (shell-command "scp -r ~/stage/* user@@wdhost:mobile/")))
3400 (add-hook 'org-mobile-pre-pull-hook
3401   (lambda () (shell-command "scp user@@wdhost:mobile/mobileorg.org ~/stage/ ")))
3402 (add-hook 'org-mobile-post-pull-hook
3403   (lambda () (shell-command "scp ~/stage/mobileorg.org user@@wdhost:mobile/")))
3404 #+end_src
3406 * Mathjax
3408 ** How to install MathJax on my server?
3409    
3410 :PROPERTIES:
3411 :CUSTOM_ID: install_mathjax_on_server
3412 :END:
3414 Org uses MathJax as its default HTML display engine for equations.
3416 Org relies on the version of MathJax available from orgmode.org, but you
3417 might want to use another version and install MathJax on your own server.
3419 1. Download a [[http://sourceforge.net/projects/mathjax/files/][MathJax archive]].
3421 2. Upload it somewhere on your server (say http://me.org/mathjax/)
3423 3. Set the correct path in =org-export-html-mathjax-options= (i.e. replace
3424    http://orgmode.org/mathjax/MathJax.js by
3425    http://me.org/mathjax/MathJax.js)
3427 You can also get [[http://www.mathjax.org/resources/docs/?installation.html][MathJax from git or svn]] -- in this case, be careful not to
3428 forget to unzip the fonts.zip archive in the mathjax directory.
3430 * COMMENT HTML style specifications
3432 #+begin_src emacs-lisp
3433   (defun org-faq-make-target ()
3434     "Make hard target for current headline."
3435     (interactive)
3436     (if (not (org-on-heading-p))
3437         (error "Not on a headline"))
3438     (let ((h (org-trim (org-get-heading 'no-tags))))
3439       (if (string-match "[ \t]*\\?\\'" h)
3440           (setq h (replace-match "" t t h)))
3441       (while (string-match "[ \t]+" h)
3442         (setq h (replace-match "-" t t h)))
3443       (org-entry-put nil "CUSTOM_ID" h)))
3444 #+end_src