Merge branch 'master' of git+ssh://repo.or.cz/srv/git/Worg
[Worg.git] / org-faq.org
blob6af4945d1e35af98a24cf1c90533902ef10bd571
1 #+EMAIL:     carsten.dominik@gmail.com
2 #+AUTHOR:    Worg people
3 #+LANGUAGE:  en
4 #+TITLE:     Org-mode Frequently Asked Questions
5 #+OPTIONS:   toc:t H:2
7 #+begin_html
8   <style type="text/css">
9     <!--/*--><![CDATA[/*><!--*/
10       #table-of-contents {
11         font-size: inherit;
12         position: relative;
13         background: white;
14         -webkit-box-shadow: 0 0 0 0;
15         -moz-box-shadow: 0 0 0 0;
16         -webkit-border-bottom-left-radius: 0;
17         -moz-border-radius-bottomleft: 0;
18         text-align: left;
19         max-height: none;
20         overflow: none; }
21         #table-of-contents h2 {
22           font-size: inherit;
23           max-width: none;
24           font-weight: bold;
25           padding-left: 0;
26           padding-left: 0;
27           padding-top: 0;
28           padding-bottom: 0; }
29         #table-of-contents #text-table-of-contents {
30           display: block;
31           text-align: left; }
32         #table-of-contents:hover #text-table-of-contents {
33           display: block;
34           padding: 0;
35           margin-top: 0; }
36     /*]]>*/-->
37   </style>
38 #+end_html
41 [[file:index.org][{Back to Worg's index}]]
43 * What is org-mode?
44   :PROPERTIES:
45   :CUSTOM_ID: What-is-org-mode
46   :END:
47 ** Can I implement a GTD workflow with Org-mode?
48    :PROPERTIES:
49    :CUSTOM_ID: GTD-workflow-with-Org-mode
50    :END:
52    Yes, you can.  Check for discussions and pointers [[http://orgmode.org/worg/org-gtd-etc.html][here]].
54 ** What is the difference between Org and TaskPaper?
55    :PROPERTIES:
56    :CUSTOM_ID: Org-and-TaskPaper
57    :END:
59   There is really no difference.  Org is as /simple/ as [[http://hogbaysoftware.com/products/taskpaper][TaskPaper]].  It
60   is just that, when using Org within Emacs, it lets you do many things
61   that you wouldn't be able to do with TaskPaper.  Yes, TaskPaper is
62   fiddle-proof and people using Emacs tends to like fiddling (which is
63   orthogonal to the idea of using todo-list efficiently), but this is
64   just a matter of discipline and common sense, not one of Org's design.
66   Read [[http://article.gmane.org/gmane.emacs.orgmode/6224][Carsten's enlightening statement]] on this.
67 ** What is the meaning of the Unicorn on Org's website?
68    :PROPERTIES:
69    :CUSTOM_ID: unicorn
70    :END:
72 The Unicorn is the logo of Org-mode because:
74 - Org-mode is the UNICs of ORgaNizers.
76 - Org-mode is an Emacs mode, so it makes sense to use an animal
77   similar or related to the gnu used for GNU Emacs.
79 - Org-mode is meant to show you the way, and an animal with two horns
80   can not do this very well, can it?
82 - Unicorn tears are said to reverse petrification, and wasn't this how
83   we all felt before getting to some degree of time and task
84   management?
86 - It will take forever to learn everything there is to know about a
87   unicorn.
89 - A unicorn is a fabulous creature.  Org-mode wants to be a fabulous
90   creation.
92 Using a unicorn was originally /Bastien Guerry's/ idea.  His friend,
93 the french artist [[http://intemperies.over-blog.com/][Christophe Bataillon]], designed the logo for us, and
94 /Greg Newman/ gave it a refresh some time later.  Bastien writes why
95 he chose a unicorn:
97 #+BEGIN_QUOTE
98 The first reason is not linked to the animal, but to the sounding of the
99 word "Unicorn" - because Org gives you a /uni/que way of producing files
100 in several format (HTML, LaTeX, etc.)
102 The second reason is that a Unicorn doesn't really exist, it is just
103 something you can dream about, and make others believe it does exist.
104 Just like the perfect organizer.
105 #+END_QUOTE
107 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
108 Suckling]] posted a link showing how to make a simple foldable unicorn
109 (very appropriate for an outlining program!).
111 [[http://article.gmane.org/gmane.emacs.orgmode/11735][Tim Burt]] made a very complicated one which is now a treasured
112 possession of the Org-mode author.
114 - Official logo: [[http://orgmode.org/img/org-mode-unicorn.png]]
115   This logo is available in a number of different formats including
116   Photoshop /.psd/ and scaleable vector graphics /.svg/ [[http://orgmode.org/img/][here]].
118 - An [[http://orgmode.org/img/nrocinu4.jpg][alternative version]] from Christophe Bataillon (c):
120 - [[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]]:
122 - [[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
123   threshold technique".
125 - [[http://article.gmane.org/gmane.emacs.orgmode/11735/match%3D][Tim Burt]] made a folded Unicorn to match the spirit of Org - see the
126   whole set of pictures [[http://www.flickr.com/photos/tcburt/sets/72157614543357071/][on his flickr page]].
128 - Are unicorns real?  Answer [[http://article.gmane.org/gmane.emacs.orgmode/11687/match%3Drosslaird%2Bunicorn][here]] by Ross Laird.
130 ** Is Org's documentation written in Org?
132 No.  Org's documentation is written in TeXinfo, which is the standard
133 format for Emacs documentation.  There is no export mechanism from Org 
134 to TeXinfo (yet).
136 * Mailing list
137 ** Why hasn't my email to the mailing list shown up yet?
138    :PROPERTIES:
139    :CUSTOM_ID: ml-post-delay
140    :END:
142 The org-mode mailing list is moderated. Thus, if you are not
143 subscribed to the mailing list, your mail will only appear on the list
144 after it has been approved by a moderator. To ensure that your mail
145 appears quickly, please [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe to the list]].
147 ** I read the mailing list through gmane. Should I subscribe?
148    :PROPERTIES:
149    :CUSTOM_ID: ml-subscription-and-gmane
150    :END:
152 The org-mode mailing list is available via nntp at [[http://dir.gmane.org/gmane.emacs.orgmode][Gmane]]. Many
153 participants in the list prefer read the list in a newsreader, such as
154 Gnus, instead of receiving emails. If you choose to read the list via
155 nntp, you can still [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe]] to the list and then opt not to receive
156 any emails on the mailman settings page (see the "Mail Delivery"
157 setting).
159 This will ensure that your messages to the list get through quickly,
160 reduce the work load of the mailing list moderators (who need to clear
161 every mail from non-members), and provide more accurate information
162 about the number of list readers.
164 * Keeping current
165   :PROPERTIES:
166   :CUSTOM_ID: Keeping-current
167   :END:
168 ** My Emacs ships with an older version Org-mode! How do I upgrade?
169    :PROPERTIES:
170    :CUSTOM_ID: updating-org
171    :END:
173 Org-mode develops quickly, which means that versions of Org-mode
174 shipped with Emacs are more or less out-of-date. If you'd like to
175 upgrade to the most recent version of org-mode, you have a number of
176 options.
178  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
179     follow the [[http://orgmode.org/manual/Installation.html#Installation][installation instructions]] in the manual.
180  2. Clone and install the development git repository as [[#keeping-current-with-Org-mode-development][explained
181     here]]. If you don't want to run the bleeding edge, you can still
182     use git [[#using-stable-releases-only][to track the most recent stable releases]].
183  3. Install and updated org-mode automatically through the Emacs
184     Package Manager as [[#installing-via-elpa][explained in this FAQ]].
186 ** How do I keep current with bleeding edge development?
187    :PROPERTIES:
188    :CUSTOM_ID: keeping-current-with-Org-mode-development
189    :END:
191    Org mode is developed in [[http://en.wikipedia.org/wiki/Git_(software)][Git]]. You can keep up-to-date with Org-mode
192    developement by cloning Org mode repository and refreshing your
193    copy with latest changes whenever you wish. You only need to use
194    two Git commands (clone and pull.) Here are the steps in brief
195    (please customize locations to suit your setup):
197    1. Select a location to house the Org mode repository (approx. 40
198       MB; includes documentation, compiled elisp files and history
199       going all the way back to v4.12a)
201       : $ mkdir $HOME/elisp && cd $HOME/elisp
203    2. Clone the Org mode Git repository.
205       Recommended approach:
207       : $ git clone git://orgmode.org/org-mode.git
209       You can also clone from this mirror (lagging one hour behind
210       orgmode.org repo):
212       : $ git clone git://repo.or.cz/org-mode.git
214       For those of you behind a firewall that allows only HTTP, you can
215       clone like this (can be somewhat slow), either from orgmode.org or
216       from repo.or.cz:
218       : $ git clone http://orgmode.org/org-mode.git
219       : $ git clone http://repo.or.cz/r/org-mode.git
221    3. Compile and install Org mode and build documentation.
223       : $ cd org-mode && make && make doc && make install
225       Please note that you can choose to /not/ compile at all and run
226       using source =.el= files only.  Compiled files speed things up.
228       Also note that running =make install= is necessary only if you'd
229       like to install org-mode system-wide.
231    4. This is where you configure Org mode with Emacs.  Please refer
232       to [[./org-tutorials/index.org][Org tutorials]].
234    5. Keeping up-to-date.
236       Cloning the repository is a one time activity.  From this point
237       onwards you only need to /pull/ the latest changes.
239       : $ cd $HOME/elisp/org-mode
241       and then
243       : $ git pull && make clean && make && make doc && make install
245    6. You should restart org mode to have the changes take effect (if
246       you are not rebooting Emacs.)  Also since the intention is to
247       "keep up" with Org mode, you should visit updated sections of
248       documentation for latest updates (use =git log=.)
250    7. As you use your repository over time it will accumulate loose objects.
251       You can reduce the total size of your git repository with
253       : $ git gc
255       which will consolidate loose git objects into pack files.  This
256       reduces the size of the repository and speeds up data access to
257       the objects.
259 ** How can I keep local changes and still track Org mode development?
260    :PROPERTIES:
261    :CUSTOM_ID: keeping-local-changes-current-with-Org-mode-development
262    :END:
264   Say you want to make minor changes to the Makefile to reflect your
265   location for =emacs=.
267   Create a local branch for your changes on top of origin/master as
268   follows:
270   : $ git checkout -b local origin/master
271   : $ git config branch.local.rebase true
272   : # Make your changes to the Makefile and create a new commit
273   : $ git add Makefile
274   : $ git commit -m 'My local Makefile configurations'
275   : # Update git to a newer version
276   : $ git pull
278   Now each time you pull new commits from the distribution repository
279   your local commits will be rewound and replayed on top of the new
280   origin/master.
282 -----------
284   You would normally work on your =local= branch which includes your
285   custom commits; there's no need to switch back to the =master=
286   branch.
288 -----------
290 Here is an example of dealing with conflict resolution during git pull.
292 If you get a conflict during a =git pull= you will need to edit the
293 file with the conflict to fix up the conflicting lines and then tell
294 git that you have resolved the conflict.
296 Conflict resolution goes something like this:
298 1. =git pull= fails with a conflict
299 2. edit the file
300 3. =git add= the file to mark the conflict resolved
301 4. =git rebase --continue=
302 5. lather, rinse, and repeat 2-4 as needed
304 For this example we have the following Makefile:
306 : #
307 : # Example Makefile
308 : #
310 : EMACS=emacs
312 : VERSION=V1.0
314 and we need to change the =EMACS=emacs= line to =EMACS=myemacs= to
315 make it work well on our system.
317 To do this we
319   - create a local branch for our work
321     : $ git checkout -b local origin/master
322     : $ git config branch.local.rebase true
324     This marks the branch so that all local commits on it are rebased
325     on top of any new commits we get in origin/master during a =git
326     pull= operation.
328   - Make our custom changes
330     Edit the makefile so it looks like this:
332     : #
333     : # Example Makefile
334     : #
335     :
336     : EMACS=myemacs
337     :
338     : VERSION=V1.0
340   - Create a commit with our custom changes
341     : $ git add Makefile
342     : $ git commit -m 'My local Makefile configurations'
344   - Later we do a =git pull= but that fails with conflicts.
346     : $ git pull
347     : remote: Counting objects: 5, done.
348     : ...
349     : Patch failed at 0001.
350     :
351     : When you have resolved this problem run "git rebase --continue".
352     : If you would prefer to skip this patch, instead run "git rebase --skip".
353     : To restore the original branch and stop rebasing run "git rebase --abort".
355   - Fix the conflict in your favourite editor
357     Conflict markers look like this:
359     : <<<<<<< HEAD:Makefile
360     : EMACS=emacs22
361     : =======
362     : EMACS=myemacs
363     : >>>>>>> Change emacs location:Makefile
365     This attempted =git pull= caused a conflict.  Fire up your
366     favourite editor and fix the conflict in the Makefile.  The
367     conflict markers are <<<<<<<<<< , ======= , and >>>>>>>>>>.  Fix
368     the Makefile appropriately and delete the conflict markers.  You
369     already edited these lines earlier so fixing it should be trivial.
371     In this case we changed =EMACS=emacs= to =EMACS=myemacs= and
372     upstream changed =EMACS=emacs= to =EMACS=emacs22=.  Just fix the
373     file and save it by deleting the conflict markers and keeping the
374     code you need (in this case the =EMACS=myemacs= line which we
375     originally modified.)
377   - Mark the file's conflict resolved
379     : $ git add Makefile
381     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.
383   - Continue the rebase operation
385     : $ git rebase --continue
387     If any other conflicts arise you fix them the same way - edit the file, mark the conflict resolved, and continue.
389 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"
390 using
391 : $ git rebase --abort
393 ** How can I use a stable release version instead of the bleeding edge master?
394    :PROPERTIES:
395    :CUSTOM_ID: using-stable-releases-only
396    :END:
398 The master branch of the git repository always contains the bleeding
399 edge development code.  This is important for Org's fast development,
400 because code on master gets checked out by many people daily and we
401 quickly receive bug reports if something is wrong.  On rare occasions,
402 this code may not function perfectly for a limited time while we are
403 trying to fix things.
405 Not everyone like to use this bleeding-edge code and face the danger
406 to hit a surprising bug.
408 Therefore, from time to time, we make a release.  This typically
409 happens when the maintainers feel that
411 1. they have reached a good point in the development
412 2. the code has a feature set that should stay and be supported in the
413    future
415 Stable releases are used as the basis for [[http://orgmode.org/index.html#sec-3_3][alternative distributions]] of
416 Org, and they are also the code that gets merged into the Emacs
417 distribution. If you want to work only with stable releases, you can
418 always download [[http://orgmode.org/index.html#sec-3][them here]], but you can also also use the git
419 repository to keep automatically up-to-date with the most recent
420 stable releases (and save bandwidth!). Here's how to do so:
422 *** Run a specific stable release
424 In the repository, do
426 : $ git fetch --tags
427 : $ git tag
429 To see which release tags are available.  Let's say you decide to use
430 =release_7.01f=.
432 : $ git checkout release_7.01f
434 This set the working tree of the repository to the state of Org at the
435 moment of release 7.01f.  You can then run Org from the repository be
436 sure to use the stable release while development continues on the
437 master branch.
439 Later, when we release 7.02, you can switch to that using
441 : $ git fetch --tags                   # to get all the new stuff
442 : $ git tag
443 : $ git checkout release_7.02
445 *** Always run the most recent stable release
447 Alternatively, if you just want to always run whatever the latest
448 stable release is, you can do
450 : $ git checkout -b stable origin/maint
452 and then regularly update this branch by doing
454 : $ git pull
456 ** How can I install an up-to-date version of org-mode without "make" tools?
457    :PROPERTIES:
458    :CUSTOM_ID: installing-org-without-make-tools
459    :END:
461 If you are using org-mode on a computer that lacks developer tools for
462 compiling software, such as [[http://www.gnu.org/software/make/][GNU Make]], you will have to use a
463 *different* installation method than [[http://orgmode.org/manual/Installation.html#Installation][the one outlined in the manual]].
465 Please see [[http://article.gmane.org/gmane.emacs.orgmode/15264][this thread]] on the mailing list for several different ways
466 you can install a recent version of org-mode without using the
467 customary =make clean && make && make install=.
469 The result of that discussion is the file/function found in
470 [[http://orgmode.org/worg/org-hacks.html#compiling-org-without-make]].
472 ** I don't use git. Can I download bleeding edge .zip and .tar.gz archives?
474    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 --
475    these archives are udpated every day at midnight.
477    Alternatively, you can download a [[http://orgmode.org/w/org-mode.git/snapshot][tar.gz snapshot from orgmode.org]].
479 ** How can I install Org-mode through Emacs' Package Manager?
480    :PROPERTIES:
481    :CUSTOM_ID: installing-via-elpa
482    :END:
484    Emacs 24 includes an automated package management tool ([[http://tromey.com/elpa/][ELPA]]) that
485    can be used to install and upgrade elisp packages such as Org-mode.
486    If you are running an older version of Emacs (23 or earlier), you
487    will have to install the package manager before using it to install
488    Org-mode. See [[#installing-elpa][this FAQ]] for more details.
490    Org-mode is distributed as an ELPA package from [[http://elpa.gnu.org/packages/][GNU Emacs Lisp
491    Package Archive]] as well as from [[http://orgmode.org/pkg/daily/][Org-mode Emacs Lisp Archive]].
492    
493    Steps for adding Org-mode as a package archive:
494    1. Add Org-mode as a package archive. This can be done in two ways.
495       1. Use =M-x customize-variable RET package-archives=
496       2. Add the following line to your =.emacs= and reload Emacs.
498          #+begin_src emacs-lisp
499            (add-to-list 'package-archives '("Org-mode" . "http://orgmode.org/pkg/daily/"))
500          #+end_src
501                 
502    2. Use the Emacs package manager's =M-x list-packages= to browse
503       and install the latest version.
505    3. If you get the following error "*Failed to download `Org-mode'
506       archive.*" in step 2, you can manually download the tarball and
507       install it. Refer [[Installing from ELPA-tar][this FAQ entry]] for more information.
509 ** How do I install Emacs package manager?
510    :PROPERTIES:
511    :CUSTOM_ID: installing-elpa
512    :END:
513    
514    If you are running Emacs-24 or find the command =M-x list-packages=
515    available you already have the package manager installed.
516    
517    Steps for installing package manager:
518    1. Download the latest package manager -
519       [[http://repo.or.cz/w/emacs.git/blob_plain/HEAD:/lisp/emacs-lisp/package.el][package.el]].
520    2. Add the following to your =.emacs= and reload Emacs.
521       #+begin_src emacs-lisp
522         ;; change "~/elisp/" as appropiate
523         (setq load-path (cons "~/elisp" load-path))
524         (require 'package)
525         (package-initialize)
526       #+end_src
527    
528 ** I don't see Org-mode as an installation option in Package Manager Menu?
529    :PROPERTIES:
530    :CUSTOM_ID: why-no-org-in-elpa
531    :END:
532    
533    Emacs Package Manager is a very recent addition to Emacs. Work is
534    under way to have have Org-mode seamlessly integrate with Emacs'
535    Package Manager. As a result, it will be some time before the
536    Org-mode packages are available and usable from either GNU or
537    Org-mode package archives.
538    
539    In the meanwhile, you can install Org-mode via package manager
540    through ELPA-compatible tar. Refer [[Installing from ELPA-tar][this FAQ entry]] for more information.
541    
542 ** How do I install Org-mode from a ELPA-compatible tarball?
543    :PROPERTIES:
544    :CUSTOM_ID: installing-from-elpa-tarball
545    :END:
546 # <<Installing from ELPA-tar>>
547    
548    Org-mode is distributed as an ELPA-compatible tar which can be used
549    in conjunction with Emacs' package manager.
550    
551    1. If you are already running Org-mode, note the current version
552       reported by M-x org-version.
553    2. Download the latest tarball from [[http://orgmode.org/pkg/daily/][Org-mode repo]].
554    3. Do =M-x package-install-file=. When prompted for =Package file
555       name=, point it to .tar file downloaded in step 2.
556       
557       You will now see Package Manager compiling the files and
558       installing it.
559    4. Reload emacs. This step is very important.
560    5. Note the version of the new installation using M-x
561       org-version. If the new and old versions are different, the
562       installation is done and you are all set to enjoy the updated
563       Org-mode. Otherwise skip to step 6.
564    6. Review you load-path using =C-h v load-path=. Most likely that
565       your old installation path takes precedence over the path chosen
566       by package manager (which is typically
567       =~/.emacs.d/elpa/...=). Fix this anamoly by moving
568       =(package-initialize)= line in .emacs to a more appropriate
569       location.
570       
571    - Additional Note on =org-install.el= :: Functionality of Org-mode's
572      =org-install.el= is supplanted by Package Manager's
573      =org-autoloads.el=. Since Package Manager autoloads Org-mode for
574      you, the following line =(require 'org-install)= in your =.emacs=
575      is no longer required and can be safely removed.
576      
577 ** Why would I use ELPA tarballs instead of the snapshot tarballs?
578    :PROPERTIES:
579    :CUSTOM_ID: why-elpa
580    :END:
581    
582    ELPA-tarballs automate much the process of upgrading org-mode. Much
583    of the following grunt work is done automatically by the Package
584    Manager:
585    
586    1. Downloading, compiling, and activating of org-mode (including
587       setting org-mode's =load-path= and autoloads).
588    2. Updating info files.
590 * Setup
591   :PROPERTIES:
592   :CUSTOM_ID: Setup
593   :END:
594 ** How can I quickly browse all Org options?
596 =M-x org-customize RET=
598 See also [[file:org-tutorials/org-customize.org][Carsten's Org customize tutorial]] and [[file:org-configs/org-customization-guide.org][this customization guide]]
599 for details.
601 ** Can I use the editing features of org-mode in other modes?
602    :PROPERTIES:
603    :CUSTOM_ID: use-editing-features-in-other-modes
604    :END:
606    Not really---but there are a few editing features you can use in
607    other modes.
609    - For tables there is =orgtbl-mode= which implements the table
610      editor as a minor mode. (To enable, type =M-x orgtbl-mode=)
611    - For ordered lists there is =orgstuct-mode= which allows for easy
612      list editing as a minor mode. (To enable, type =M-x
613      orgstruct-mode=)
615    You can activate these modes automatically by using hooks:
617    : (add-hook 'mail-mode-hook 'turn-on-orgtbl)
618    : (add-hook 'mail-mode-hook 'turn-on-orgstruct)
620    For footnotes, there is the function =org-footnote-action=, which
621    works in non-org buffers. This function is a powerful tool for
622    creating and sorting footnotes. To use it globally, you can add the
623    following keybinding to your =.emacs= file (requires Org 6.17 or
624    greater):
626    : (global-set-key (kbd "C-c f") 'org-footnote-action)
628    For other features you need to switch to Org-mode temporarily, or
629    prepare text in a different buffer.
631 ** Why isn't feature "X" working the way it is described in the manual?
632    :PROPERTIES:
633    :CUSTOM_ID: making-sure-org-mode-is-up-to-date
634    :END:
636 Org-mode develops very quickly. If you are using a version of Org-mode
637 that shipped with emacs, there is a good chance that it is somewhat
638 out of date.
640 Many of the users on the Org-mode mailing list are using either a
641 recent release of Org-mode or the
642 [[http://orgmode.org/index.html#sec-3.2][development version of
643 org-mode from the git repository]].
645 If some settings and features aren't working the way you expect, make
646 sure that the version of the manual you are consulting matches the
647 version of Org-mode you are using.
649    - You can check which version of Org-mode you are using by
650      selection =Org --> Documentation --> Show Version= in the Emacs
651      menu.
653    - The [[http://orgmode.org/manual/index.html][online manual]] at [[http://orgmode.org][orgmode.org]] corresponds to the most recent
654      release.
656    - 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
657      released with the latest official Gnu Emacs release. Compared
658      with the manual at the orgmode.org, the manual at www.gnu.org is
659      somewhat out of date.
661 For instructions on how to stay current with Org-mode, consult [[keeping-current-with-Org-mode-development][this
662 FAQ]] or follow the instructions on [[http://orgmode.org][the official Org-mode site]].
664 ** Can I get the visibility-cycling features in outline-mode and outline-minor-mode?
665    :PROPERTIES:
666    :CUSTOM_ID: use-visibility-cycling-in-outline-mode
667    :END:
669    Yes, these functions are written in a way that they are independent of
670    the outline setup.  The following setup provides standard Org-mode
671    functionality in outline-mode on =TAB= and =S-TAB=.  For
672    outline-minor-mode, we use =C-TAB= instead of =TAB=,
673    because =TAB= usually has mode-specific tasks.
675 #+BEGIN_SRC emacs-lisp
676 (add-hook 'outline-minor-mode-hook
677   (lambda ()
678     (define-key outline-minor-mode-map [(control tab)] 'org-cycle)
679     (define-key outline-minor-mode-map [(shift tab)] 'org-global-cycle)))
680 (add-hook 'outline-mode-hook
681   (lambda ()
682     (define-key outline-mode-map [(tab)] 'org-cycle)
683     (define-key outline-mode-map [(shift tab)] 'org-global-cycle)))
684 #+END_SRC
686 Or check out /outline-magic.el/, which does this and also provides
687 promotion and demotion functionality.  /outline-magic.el/ is
688 available at [[http://www.astro.uva.nl/~dominik/Tools/outline-magic.el][Outline Magic]].
690 ** Can I save/restore the visibility state of an org-mode buffer?
691    :PROPERTIES:
692    :CUSTOM_ID: saving-visibility-state
693    :END:
695 Well, no---at least not automatically. You can, however, control the
696 visibility of an org-file or of individual trees by adding
697 instructions to your org file. See [[http://orgmode.org/manual/Visibility-cycling.html#Visibility-cycling][this section of the manual]] for more
698 information.
700 ** How can I keep track of changes in my Org files?
701    :PROPERTIES:
702    :CUSTOM_ID: track-of-changes-in-Org-files
703    :END:
705   Use git to track the history of the files, use a cronjob to check in
706   changes regularly.  Such a setup is described by Bernt Hansen
707   in [[http://article.gmane.org/gmane.emacs.orgmode/6233][this message]] on [[http://dir.gmane.org/gmane.emacs.orgmode][emacs-orgmode]].
709 ** Can I use Org-mode as the default mode for all README files?
710    :PROPERTIES:
711    :CUSTOM_ID: Org-mode-as-default-mode
712    :END:
714 Add the following to your .emacs file:
716 : (add-to-list 'auto-mode-alist '("README$" . org-mode))
718 You can even make it the default mode for any files with unspecified
719 mode using
721 : (setq default-major-mode 'org-mode)
723 ** Can I use ido.el for completing stuff in Org?
724    :PROPERTIES:
725    :CUSTOM_ID: ido-complete
726    :END:
728    Yes, you can.  If you are an ido user and ido-mode is active, the
729    following setting will make Org use =ido-completing-read= for most
730    of its completing prompts.
732 : (setq org-completion-use-ido t)
734 ** Should I use one big org file or multiple files?
735    :PROPERTIES:
736    :CUSTOM_ID: how-to-organize-org-mode-files
737    :END:
739 Org-mode is flexible enough to accomodate a variety of organizational
740 and time management schemes. Org's [[http://orgmode.org/manual/Document-Structure.html#Document-Structure][outline cycling and convenient
741 editing and navigation commands]] make it possible to maintain all of
742 your projects and notes in a single file. But org-mode's [[http://orgmode.org/manual/Hyperlinks.html#Hyperlinks][quick and
743 easy hyperlinks]], along with [[http://orgmode.org/manual/Refiling-notes.html#Refiling-notes][easy refiling of notes and todos]], also
744 make it a delight to maintain a private "wiki" consisting of multiple
745 files.
747 No matter how you organize your org files, org-mode's agenda commands
748 make it easy to search all your notes and gather together crucial data
749 in a single view.
751 Moreover, several org-mode settings can be configured either globally
752 in your =.emacs= file or locally (per file or per outline tree). See
753 the [[http://orgmode.org/manual/index.html#Top][manual]] for more details. For an example of local customizations
754 see [[limit-agenda-with-category-match][this FAQ]].
756 Here are a few ideas for organizing org-mode files:
758 - A single file for all your projects and notes.
759 - One file per project.
760 - One file per client.
761 - One file per area of responsibility or type of work (e.g.,
762   household, health, work, etc.).
763 - One file for projects, one for appointments, one for reference
764   material, one for someday/maybe items, etc.
765 - A wiki of hyperlinked files that grows and adapts to meet your
766   needs.
768 For more ideas, see some of the links on the [[file:org-tutorials/index.org][org-tutorial index]] or
769 [[file:org-gtd-etc.org][this page on org-mode and GTD]].
771 ** Why doesn't C-c a call the agenda? Why don't some org keybindings work?
772    :PROPERTIES:
773    :CUSTOM_ID: setting-global-keybindings
774    :END:
776 Org-mode has a few global keybindings that the user must set
777 explicitly in an =.emacs= file. These keybindings include the
778 customary shortcut for calling the agenda (=C-c a=). If nothing
779 happens when you type =C-c a=, then make sure that the following lines
780 are in your =.emacs= file:
782 #+BEGIN_SRC emacs-lisp
783 ;; The following lines are always needed.  Choose your own keys.
784 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
785 (global-set-key "\C-cl" 'org-store-link)
786 (global-set-key "\C-ca" 'org-agenda)
787 (global-set-key "\C-cb" 'org-iswitchb)
788 #+END_SRC emacs-lisp
790 You may, of course, choose whatever keybindings work best for you
791 and do not conflict with other modes.
793 Please see [[http://orgmode.org/manual/Activation.html][this section of the manual]] if you have additional
794 questions.
796 ** Why aren't some of the variables I've customized having an effect?
797    :PROPERTIES:
798    :CUSTOM_ID: load-org-after-setting-variables
799    :END:
801 Some org variables have to be set before org.el is loaded or else they
802 will not work. (An example is the new variable
803 =org-enforce-todo-dependencies=.)
805 To make sure all your variables work you should not use =(require
806 'org)=. Instead use the following setting:
808 : (require 'org-install)
810 You should also make sure that you do not require any other =org-...=
811 files in your =.emacs= file before you have set your org variables,
812 since these will also cause org.el to be loaded. To be safe, load org
813 files *after* you have set your variables.
815 ** How can I make sure that timestamps appear in English?
816    :PROPERTIES:
817    :CUSTOM_ID: timestamps-and-system-time-locale
818    :END:
820 If your system's locale is not set to English, but you would like the
821 timestamps in your org-mode files to appear in English, you can set
822 the following variable:
824 #+begin_src emacs-lisp
825   (setq system-time-locale "C")
826 #+end_src
828 ** What does a minimal .emacs look like?
829    :PROPERTIES:
830    :CUSTOM_ID: minimal-emacs
831    :END:
833 Using a stripped down minimal .emacs files removes broken custom
834 settings as the cause of an issue and makes it easy to reproduce for
835 other people.  The example below has system-specific paths that you'll
836 need to change for your own use.
837 #+begin_src emacs-lisp
838   (add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
839   (add-to-list 'auto-mode-alist '("\\.\\(org\\  |org_archive\\|txt\\)$" . org-mode))
840   (setq org-agenda-files '("/tmp/test.org"))
841   (require 'org-install)
842   (require 'org-habit)
844   (global-set-key "\C-cl" 'org-store-link)
845   (global-set-key "\C-ca" 'org-agenda)
846   (global-set-key "\C-cb" 'org-iswitchb)
847 #+end_src
849 You can save the minimal .emacs file to ~/minimal.emacs, add suspect
850 configuration code to it, then start emacs something like this:
851 #+begin_src sh
852   emacs -Q -l ~/minimal.emacs
853 #+end_src
855 On OS X, starting emacs with minimal configuration might look
856 something like this:
857 #+begin_src sh
858   /Applications/emacs.app/Contents/MacOS/Emacs -Q -l ~/minimal.emacs
859 #+end_src sh
861 ** Can I migrate from Planner?
863    Yes.  This [[http://www.c0t0d0s0.de/plan2org/plan2org.pl][perl script]] or [[http://gitorious.org/bkuhn-small-hacks/org-mode/blobs/master/planner2org.plx
864 ][this Perl script]] can help.
866 * Errors and general problems
867   :PROPERTIES:
868   :CUSTOM_ID: Errors
869   :END:
870 ** Opening Org files in Emacs leads to a crash
871    :PROPERTIES:
872    :CUSTOM_ID: Emacs-crashes-with-org-indent-mode
873    :END:
874    The only known case where Org-mode can crash Emacs is when you are
875    using =org-indent-mode= with Emacs 23.1 (in fact, any version of
876    Emacs before version 23.1.50.3).  Upgrade to Emacs 23.2 and the
877    problem should go away.
879 ** When I try to use Org-mode, I always get the error message =(wrong-type-argument keymapp nil)=
880    :PROPERTIES:
881    :CUSTOM_ID: wrong-type-argument-keymapp
882    :END:
884    This is a conflict with an outdated version of the /allout.el/, see
885    the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section in the manual
887 ** How can I control the application launched by Org-mode to open a certain file type like pdf, html....
888    :PROPERTIES:
889    :CUSTOM_ID: external-application-launched-to-open-file-link
890    :END:
892 If you want special control about how Org-mode opens files, see the
893 variables =org-file-apps=, =org-file-apps-defaults-gnu=,
894 =org-file-apps-defaults-macosx=, =org-file-apps-defaults-windowsnt=.
896 *However*, normally it is best to just use the mechanism the
897 operating-system provides:
899 *** GNU/Linux systems
900     You you have to check your mailcap settings, find the files:
902     : /etc/mailcap
903     :
904     : or
905     :
906     : $HOME/.mailcap
908 and modify them accordingly. Please read their manual entry.
910 *** Windows systems
911     + for html pages you may configure the =browse-url-= variables through
912       the Customize interface,
913     + the pdf files are automatically opened with Acrobat Reader (if it is
914       installed)
916 *** Mac OSX
917     Change the application responsible for this file type by selecting
918     such a file in the Finder, select =File->Get Info= from the menu
919     and select the application to open this file with.  Then, to
920     propagate the change to all files with the same extension, select
921     the =Change all= button.
923 ** Org-mode takes over the TAB key.  I also want to use YASnippet, is there a way to fix this conflict?
924    :PROPERTIES:
925    :CUSTOM_ID: YASnippet
926    :END:
928 [[http://code.google.com/p/yasnippet/][yasnippet]] is yet another snippet expansion system for Emacs.  It is
929 inspired by TextMate's templating syntax.
930 - watch the [[http://www.youtube.com/watch?v=vOj7btx3ATg][video on YouTube]]
931 - see the [[http://yasnippet.googlecode.com/svn/trunk/doc/index.html][intro and tutorial]]
933 *Note*: yasnippet is not compatible with =org-indent-mode= currently
934 there is no known way to use both successfully with =yas/trigger-key=
935 set to =TAB= (or =[tab]= etc...)
937 The way Org-mode binds the =TAB= key (binding to =[tab]= instead of
938 =\t=) overrules yasnippets' access to this key.  The following code
939 fixes this problem:
941 #+begin_src emacs-lisp
942 (add-hook 'org-mode-hook
943           (lambda ()
944             (org-set-local 'yas/trigger-key [tab])
945             (define-key yas/keymap [tab] 'yas/next-field-group)))
946 #+end_src
948 If the above code doesn't work (which it may not with later versions
949 of yasnippet).  Then try the following
951 #+begin_src emacs-lisp
952   (defun yas/org-very-safe-expand ()
953     (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
955   (add-hook 'org-mode-hook
956             (lambda ()
957               ;; yasnippet (using the new org-cycle hooks)
958               (make-variable-buffer-local 'yas/trigger-key)
959               (setq yas/trigger-key [tab])
960               (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
961               (define-key yas/keymap [tab] 'yas/next-field)))
962 #+end_src
964 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]])
965 with YASnippets for Org-mode.
967 ** Org-mode takes over the S-cursor keys.  I also want to use CUA-mode, is there a way to fix this conflict?
968    :PROPERTIES:
969    :CUSTOM_ID: CUA-mode
970    :END:
972 Yes, see the  [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
974 ** Org-mode takes over the S-cursor keys.  I also want to use windmove.el, is there a way to fix this conflict?
975    :PROPERTIES:
976    :CUSTOM_ID: windmove.el
977    :END:
979 Yes, see the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
981 ** Org behaves strangely: some keys don't work, some features are missing, my settings have no effect, ...
982    :PROPERTIES:
983    :CUSTOM_ID: loaded-old-org
984    :END:
986 When this sort of things happen, it probably is because Emacs is
987 loading an old version of Org-mode instead of the one you expected.
988 Check it with =M-x org-version=.
990 This happens because Emacs loads first the system org-mode (the one
991 included with Emacs) before the one in your directory. Check the
992 =load-path= variable; you might see that your org-mode appears /after/
993 the system-wide path; this is bad.
995 You should add your directories to the =load-path= at the beginning:
997 :  (add-to-list 'load-path "~/.emacs.d/org-mode/lisp") (require 'org-install)
999 Function =add-to-list= adds at the beginning. Don't use =append=
1000 because it appends at the end. Also be sure to use =(require
1001 'org-install)= and not =(require 'org)=.
1003 This wrong version loading may also happen if you have a byte-compiled
1004 =org.elc= from an old version together with a new =org.el=. Since
1005 Emacs prefers loading byte-compiled files (even if the =.el= is
1006 newer), it will load the old Org-mode.
1008 ** Why doesn't org-batch-agenda work under Win32?
1009    :PROPERTIES:
1010    :CUSTOM_ID: org-batch-agenda-under-win32
1011    :END:
1013 When I run the example batch files to print my agenda to the console
1014 under Win32 I get the failure:
1016 : End of file during parsing
1018 and no agenda is printed.
1020 The problem is the use of single quotes surrounding the eval in the
1021 emacs command-line. This gets confused under Win32. All string
1022 parameters with spaces must be surrounded in double quotes. This means
1023 that double quotes being passed to the eval must be escaped.
1025 Therefore, instead of the following:
1027 : <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
1028 :     -eval '(org-batch-agenda "a")'
1030 you need to use the following:
1032 :  <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
1033 :     -eval "(org-batch-agenda \"a\")"
1035 (all on one line, of course).
1037 ** Org agenda seems very slow
1038    :PROPERTIES:
1039    :CUSTOM_ID: slow-agenda
1040    :END:
1042 If it takes a long time to generate or refresh the agenda, you might
1043 want first check which version of org-mode you are using. There have
1044 been major optimizations of org-agenda since 6.21b, which was the
1045 version of org-mode released with Emacs 23. If you are using 6.21b or
1046 earlier (you can check with =M-x org-version=), then you might want to
1047 consider upgrading to a more recent version of org-mode.
1049 Here are some other ideas for speeding up the agenda:
1051 1. Use a one day agenda view (rather than a seven day view).
1053    =(setq org-agenda-ndays 1)=
1055 2. Archive inactive items to separate files.
1057    =C-c C-x C-s= (org-archive-subtree)
1059 3. Do not include the global todo list in your agenda view.
1061    (setq org-agenda-include-all-todo nil)
1063 4. Make sure that your org files are byte-compiled.
1065    I.e., make sure there are files ending in =.elc= in your org
1066    installation directory.
1068 5. Limit your agenda files (=org-agenda-files=) to files that have
1069    active todos and or projects. 
1071    If you have a number of older reference files---i.e., files you
1072    search only occasionally---in your agenda files list, consider
1073    removing them from your agenda files and adding them to
1074    =org-agenda-text-search-extra-files= instead. Similarly, you might
1075    consider searching some of your older reference files with =M-x
1076    grep= so that Org-mode does not have to load them into memory when
1077    the agenda is called.
1079 ** Visual-line-mode doesn't work well with org-mode
1080    :PROPERTIES:
1081    :CUSTOM_ID: visual-line-mode
1082    :END:
1084 Visual-line-mode "soft wraps" lines so that the visual edge of the
1085 buffer is considered a line break for purposes of navigation, even
1086 though there is no line break in reality.
1088 In older versions of org-mode, org-beginning-of-line and
1089 org-end-of-line do not work well with visual line mode. (The two
1090 commands disregard soft line breaks and move to the beginning and end
1091 of the hard line break.) A patch was introduces to fix this behavior
1092 in July of 2009. n
1094 If you are using an older version of org mode, you can:
1096 1. Add a hook to turn off visual line mode.
1098 2. Add the following to your =.emacs=:
1100 #+begin_src emacs-lisp
1102 (add-hook 'org-mode-hook
1103   (lambda ()
1104     (define-key org-mode-map "\C-a" 'move-beginning-of-line)
1105     (define-key org-mode-map "\C-e" 'move-end-of-line)))
1107 #+end_src
1108 ** Can I hide blocks at startup?
1110 Yes:
1112 #+begin_src emacs-lisp
1113 (setq org-hide-block-startup t)
1114 #+end_src
1116 Or use
1118 #+begin_src org
1119 ,#+STARTUP: hideblocks
1120 #+end_src
1122 on a per-file basis.
1124 * Faces and highlighting
1125   :PROPERTIES:
1126   :CUSTOM_ID: Faces
1127   :END:
1128 ** Org-mode has a lot of colors?  How can I change them?
1129    :PROPERTIES:
1130    :CUSTOM_ID: customizing-org-faces
1131    :END:
1133 This is a question that applies to Emacs as a whole, but it comes up
1134 quite frequently on the org-mode mailing list, so it is appropriate to
1135 discuss it here.
1137 If you would like to change the style of a face in org-mode (or any
1138 other Emacs mode), simply type =M-x customize-face [RET]= while the
1139 cursor is on the color/style you are interested in modifying. You will
1140 be given the opportunity to customize all the faces located at that
1141 point.
1143 If you would like an overview of all the faces in org-mode, you can
1144 type =C-u M-x list-faces-display [RET] org= and you will be shown all
1145 the faces defined by org-mode along with an illustration of their
1146 current settings.
1148 If you would like to customize org-faces and other aspects of
1149 org-appearance, type =M-x customize-group org-font-lock [RET]=.
1151 Finally, if you would like verbose information about the properties of
1152 the text under the cursor, you can type =C-u C-x ==.
1154 See the Worg page on [[file:org-tutorials/org-appearance.org][customizing Org appearance]] for further information.
1155 ** Why do I get a tiny font in column view when using emacs daemon?
1156    :PROPERTIES:
1157    :CUSTOM_ID: column-view-tiny-font
1158    :END:
1160 When using emacs in daemon mode (=emacs --daemon=), client frames
1161 sometimes override the column view face settings, resulting in very
1162 small fonts. Here is a fix:
1164 #+begin_src emacs-lisp
1165   (defun org-column-view-uses-fixed-width-face ()
1166   ;; copy from org-faces.el
1167   (when (fboundp 'set-face-attribute)
1168       ;; Make sure that a fixed-width face is used when we have a column
1169       ;; table.
1170       (set-face-attribute 'org-column nil
1171                           :height (face-attribute 'default :height)
1172                           :family (face-attribute 'default :family))))
1174    (when (and (fboundp 'daemonp) (daemonp))
1175     (add-hook 'org-mode-hook 'org-column-view-uses-fixed-width-face))
1176 #+end_src
1178 This fix was provided in the following mailing list post:
1180 http://article.gmane.org/gmane.emacs.orgmode/27560
1181 ** How can I stop the mouse cursor from highlighting lines in the agenda?
1182    :PROPERTIES:
1183    :CUSTOM_ID: ratpoison-for-agenda-highlighting
1184    :END:
1186 You can add the following to your =.emacs=:
1188 #+begin_src emacs-lisp
1189 (add-hook 'org-finalize-agenda-hook
1190     (lambda () (remove-text-properties
1191                (point-min) (point-max) '(mouse-face t))))
1192 #+end_src
1194 * Outline
1195   :PROPERTIES:
1196   :CUSTOM_ID: Outline
1197   :END:
1198 ** Can I have two windows on the same Org-mode file, with different outline visibilities?
1199    :PROPERTIES:
1200    :CUSTOM_ID: indirect-buffers
1201    :END:
1203    You may use /indirect buffers/ which do exactly this.  See the
1204    documentation on the command =make-indirect-buffer=.
1206    Org-mode has built-in commands that allow you create an indirect
1207    buffer from a subtree of an outline. To open a subtree in new
1208    window, type =C-c C-x b=. Any changes you make in the new window
1209    will be saved to the original file, but the visibility of both
1210    buffers will remain independent of one another.
1212    For multiple indirect buffers from the same file, you must use the
1213    prefix =C-u= when creating the second (or third) buffer. Otherwise
1214    the new indirect buffer will replace the old.
1216    You can also create an independent view of an outline subtree by
1217    typing =b= on an item in the agenda.
1219 ** Emacs outlines are unreadable.  Can I get rid of all those stars?
1220    :PROPERTIES:
1221    :CUSTOM_ID: Emacs-outlines-are-unreadable
1222    :END:
1224    See the section [[http://orgmode.org/manual/Clean-view.html#Clean-view][Clean outline view]] in the manual.
1225 ** C-k is killing whole subtrees!  I lost my work!
1226    :PROPERTIES:
1227    :CUSTOM_ID: C-k-is-killing-subtrees
1228    :END:
1230   =(setq org-special-ctrl-k t)= before losing your work.
1232 ** Why aren't commands working on regions?
1233    :PROPERTIES:
1234    :CUSTOM_ID: transient-mark-mode
1235    :END:
1237 Some org-mode commands, such as M-right and M-left for demoting or
1238 promoting headlines (see [[demote-multiple-headlines][this FAQ]]), can be applied to entire regions.
1239 These commands, however, will only work on active regions set with
1240 [[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
1241 Emacs 23. To enable it in earlier versions of emacs, put the following
1242 in your =.emacs= file:
1244 : (transient-mark-mode 1)
1246 Alternatively, you may turn off transient mark mode and use [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Momentary-Mark.html][a
1247 momentary mark]] (=C-<SPC> C-<SPC>=).
1249 ** Why is a blank line inserted after headlines and list items?
1250    :PROPERTIES:
1251    :ID:       2463F4D8-F686-4CF3-AA07-08976F8A4972
1252    :END:
1253    :PROPERTIES:
1254    :CUSTOM_ID: blank-line-after-headlines-and-list-items
1255    :END:
1257 In org-mode, typing =M-RET= at the end of a headline will create a new
1258 headline of the same level on a new line. The same is true for plain
1259 lists. By default org-mode uses context to determine if a blank line
1260 should be inserted after each headline or plain list item when =M-RET=
1261 is pressed. For instance, if a there is a blank line before a
1262 headline, then typing =M-RET= at the end of the line will insert a
1263 blank line before the new headline. For instance, hitting =M-RET=
1264 at the end of "Headline Two" below inserts a new headline without a
1265 blank line:
1267 : ** Headline One
1268 : ** Headline Two
1269 : **
1271 If there is a blank line between Headline One and Headline Two,
1272 however, the results will be as follows:
1274 : ** Headline One
1276 : ** Headline Two
1278 : **
1280 If you do not like the default behavior you can change it with the
1281 variable =org-blank-before-new-entry=. You can set headings and/or
1282 plain lists to auto (the default setting), t (always), or nil (never).
1284 ** How can I promote or demote multiple headlines at once?
1285    :PROPERTIES:
1286    :CUSTOM_ID: demote-multiple-headlines
1287    :END:
1289 If you have a long list of first level headlines that you'd like to
1290 demote to second level headlines, you can select the headlines as a
1291 region and then hit =M-<right>= to demote all the headlines at once.
1293 Note: =M-S-<right>= will not work on a selected region. Its use is to
1294 demote a single subtree (i.e., a headline and all sub-headlines).
1296 If M-<right> doesn't seem to work, make sure transient mark mode is
1297 enabled. See [[transient-mark-mode][this FAQ]].
1299 ** What's the deal with all the ellipses in my org outlines?
1300    :PROPERTIES:
1301    :CUSTOM_ID: org-ellipses
1302    :END:
1304 Org-mode uses ellipses to indicate folded (and thus hidden) text. Most
1305 commonly, ellispes occur at the end of headings with folded content:
1307 : * Heading ...
1309 Or, for instance, they may indicate closed drawers:
1311 : :PROPERTIES: ...
1313 Sometimes, as a result of editing and cycling an outline, ellipses may
1314 appear in unexpected places. You should *never* delete these ellipses,
1315 as you may accidentally delete hidden text. Instead, you can type =C-c
1316 C-r= (org-reveal) to display all hidden text in the vicinity. Or you
1317 may type =M-x RET show-all= to reveal all text in the org file.
1319 If you would prefer a symbol or face for indicating hidden text, you
1320 can customize the variable org-ellipses.
1322 ** How do I yank a subtree so it's indented according to the point's location?
1323    :PROPERTIES:
1324    :CUSTOM_ID: yank-indent-subtree
1325    :END:
1327 You can either use =C-c C-w= with a working [[http://orgmode.org/manual/Refiling-notes.html#Refiling-notes][refile-targets]] setup.
1329 Or set =org-yank-adjusted-subtrees= to =t= which will adjust the
1330 yanked headline's level correctly.
1332 Just use =C-k= and =C-y= as you would everywhere else in Emacs.
1334 ** Can I read org-mode outlines in vim?
1335    :PROPERTIES:
1336    :CUSTOM_ID: org-outlines-in-vim
1337    :END:
1339 Yes, there is a script that enables one to view and navigate folded
1340 outline/org files in vim (though without most of org-mode's
1341 functionality, of course).
1343   - [[http://www.vim.org/scripts/script.php?script_id%3D1266][Emacs outline mode - Imitates Emacsen : vim online]]
1345 For instructions on how to set it up, please see [[http://mid.gmane.org/EA275862-B97A-4BAC-B879-177FD07A2D56@gaillourdet.net][this mailing list
1346 post]].
1348 Work is also underway on an org-mode clone for Vim. You can check it
1349 out on git hub:
1351 https://github.com/hsitz/VimOrganizer
1353 * Todos and Tags
1354   :PROPERTIES:
1355   :CUSTOM_ID: Todos-and-Tags
1356   :END:
1357 ** How can I cycle through the TODO keyword of an entry?
1358    :PROPERTIES:
1359    :CUSTOM_ID: cycle-TODO-keywords
1360    :END:
1362   =C-c C-t= or =S-<left/right>= is what you need.
1364 ** How do I track state changes for tasks in Org?
1365    :PROPERTIES:
1366    :CUSTOM_ID: track-state-changes-for-tasks
1367    :END:
1369   Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/6082][post by Bernt Hansen]] for setting up TODO keyword
1370   states and logging timestamps for task state changes.
1372 ** Can I select the TODO keywords with a tag-like interface?
1373    :PROPERTIES:
1374    :CUSTOM_ID: select-TODO-keywords-with-tag-like-interface
1375    :END:
1377   Yes.  Use =(setq org-use-fast-todo-selection t)=
1379   If you want to set both your todos and your tags using a single
1380   interface, then check out the variable
1381   =org-fast-tag-selection-include-todo=.
1383   See [[http://orgmode.org/manual/Fast-access-to-TODO-states.html][this section of the manual]] for more details.
1385 ** How can I quickly set the tag of an entry?
1386    :PROPERTIES:
1387    :CUSTOM_ID: quickly-set-tag-of-entry
1388    :END:
1390    Use =C-c C-c= or =C-c C-q= on the headline. =C-c C-q= is useful for
1391    setting tabs in a [[http://orgmode.org/manual/Remember.html#Remember][remember]] buffer, since =C-c C-c= is the default
1392    keybinding for filing a note from the remember buffer.
1394    You can set tags even more quickly by setting one of the character
1395    shortcuts for [[http://orgmode.org/manual/Setting-tags.html#Setting-tags][fast tag selection]].
1397    To set tag shortcuts for all org buffers, put something like the
1398    following in your =.emacs= file (or create the same settings by
1399    typing =M-x customize-variable RET org-tag-alist=):
1401 : (setq org-tag-alist '(("computer" . ?c) ("office" . ?o) ("home" . ?h)))
1403    To set tag shortcuts for a single buffer, put something like the
1404    following at the top of your org file:
1406 : #+TAGS: computer(c) office(o) home(h)
1408 ** How can I change the colors of TODO keywords?
1410 You can use the variable org-todo-keyword-faces. Here are some sample
1411 settings:
1413 #+begin_src emacs-lisp
1414 (setq org-todo-keyword-faces
1415       '(
1416         ("TODO"  . (:foreground "firebrick2" :weight bold))
1417         ("WAITING"  . (:foreground "olivedrab" :weight bold))
1418         ("LATER"  . (:foreground "sienna" :weight bold))
1419         ("PROJECT"  . (:foreground "steelblue" :weight bold))
1420         ("DONE"  . (:foreground "forestgreen" :weight bold))
1421         ("MAYBE"  . (:foreground "dimgrey" :weight bold))
1422         ("CANCELED"  . shadow)
1423         ))
1424 #+end_src
1426 If you want to change the color of all active todos or all inactive
1427 todos, type:
1429 : M-x customize-face RET org-todo
1430 : M-x customize-face RET org-done
1432 You can also set values for each of these in your =.emacs= file:
1434 : (set-face-foreground 'org-todo "firebrick2")
1435 : (set-face-foreground 'org-done "forestgreen")
1437 * Hyperlinks
1438   :PROPERTIES:
1439   :CUSTOM_ID: Hyperlinks
1440   :END:
1441 ** Why do I have to confirm the execution of each shell/elisp link?
1442    :PROPERTIES:
1443    :CUSTOM_ID: confirm-shell/elisp-link
1444    :END:
1446    The confirmation is there to protect you from unwantingly execute
1447    potentially dangerous commands.  For example, imagine a link
1449    : [[shell:rm -rf ~/*][Google Search]]
1451    In an Org-mode buffer, this command would look like /Google Search/,
1452    but really it would remove your home directory.  If you wish, you can
1453    make it easier to respond to the query by setting
1455    : (setq org-confirm-shell-link-function 'y-or-n-p
1456    :       org-confirm-elisp-link-function 'y-or-n-p).
1458    Then a single keypress will be enough to confirm those links.  It is
1459    also possible to turn off this check entirely, but I strongly
1460    recommend against this.  Be warned.
1462 ** Can I use RET or TAB to follow a link?
1463    :PROPERTIES:
1464    :CUSTOM_ID: RET-or-TAB-to-follow-link
1465    :END:
1467    Yes, this is how:
1469    : (setq org-return-follows-link t)
1470    : (setq org-tab-follows-link t)
1472 ** Can I keep mouse-1 clicks from following a link?
1473    :PROPERTIES:
1474    :CUSTOM_ID: mouse-1-following-link
1475    :END:
1477    Activating links with =mouse-1= is a new feature in Emacs 22, to make
1478    link behavior similar to other applications like web browsers.  If
1479    you hold the mouse button down a bit longer, the cursor will be set
1480    without following the link.  If you cannot get used to this behavior,
1481    you can (as in Emacs 21) use =mouse-2= to follow links and turn off
1482    link activation for =mouse-1= with
1484    : (setq org-mouse-1-follows-link nil)
1486 ** How can I get completion of file names when creating a link?
1487    :PROPERTIES:
1488    :CUSTOM_ID: completion-of-file-links
1489    :END:
1491 You can use org-insert-link with a prefix argument:
1493 : C-u C-c C-l
1495 You will be greeted with prompt in the minibuffer that allows for file
1496 completion using your preferred Emacs method for finding files.
1498 ** How can I use invisible targets within lists?
1499    :PROPERTIES:
1500    :CUSTOM_ID: invisible-targets-in-lists
1501    :END:
1503 The usual way of turning radio links invisible is to comment them, but
1504 Org comments need to be at the beginning of the line, which breaks list
1505 indentation.  
1507 The workaround here is to add (INVISIBLE) after your <<target>>
1509 For example:
1511 : 11. <<target>>(INVISIBLE)
1512 :     Some text
1513 : 12. More text [[target][go to]]
1515 ** Org-mode is not opening mailto links in my default mail client
1516    :PROPERTIES:
1517    :CUSTOM_ID: mailto-links
1518    :END:
1520 You can customize the function org-mode uses to open mailto links by
1521 setting the variable =org-link-mailto-program=:
1523 =M-x customize-variable org-link-mailto-program=
1525 The default function called is =browse-url=, which opens a mail
1526 composition buffer within Emacs. The type of buffer opened by
1527 browse-url depends on the setting of the variable =mail-user-agent=.
1528 Thus, if you want to ensure that mailto links use Gnus to open a
1529 message buffer, you could add the following to your =.emacs=:
1531 #+begin_src elisp
1532 (setq mail-user-agent 'gnus-user-agent)
1533 #+end_src
1535 ** Can I use CamelCase links?
1536    :PROPERTIES:
1537    :CUSTOM_ID: CamelCase-links
1538    :END:
1540 Yes, you can with the contributed package org-wikinodes.el. Please
1541 consult the [[http://orgmode.org/worg/org-contrib/org-wikinodes.html][documentation]].
1543 * Plain Lists
1544   :PROPERTIES:
1545   :CUSTOM_ID: Plain-Lists
1546   :END:
1547 ** How can I insert an empty line before each newly inserted headline, but not before each newly inserted plain-list item?
1548    :PROPERTIES:
1549    :CUSTOM_ID: empty-line-before-each-new-headline-but-not-item
1550    :END:
1552 : (setq org-blank-before-new-entry
1553 :       '((heading . t) (plain-list-item . nil))
1555 See also [[id:2463F4D8-F686-4CF3-AA07-08976F8A4972][Why is a blank line inserted after headlines and list items?]].
1557 ** How can I convert itemized lists to enumerated lists?
1558    :PROPERTIES:
1559    :CUSTOM_ID: convert-itemized-to-enumerated-lists
1560    :END:
1562    You can use =C-c -= or =S-<left>/<right>= to cycle through the various
1563    bullet headlines available for lists: =-, +, *, 1., 1)=.
1565    See [[http://orgmode.org/manual/Plain-lists.html#Plain-lists][this section of the manual]] for more information.
1567 ** How can I convert plain lists to headlines and vice versa?
1568    :PROPERTIES:
1569    :CUSTOM_ID: convert-plain-lists-to-headlines
1570    :END:
1572    To convert a plain list item or line to a headline, type =C-c *= on
1573    the headline. This will make the line a subheading of the current
1574    headline.
1576    To convert a headline to a plain list item, type =C-c -= while the
1577    cursor is on the headline.
1579    To convert a headline to an unadorned line of text, type =C-c *= on
1580    the headline.
1582    You can use query replace to accomplish the same things, as Bernt
1583    Hansen explains in [[http://article.gmane.org/gmane.emacs.orgmode/10148][this mailing list post]].
1585 ** Is there a good way to create a description list?
1586    :PROPERTIES:
1587    :CUSTOM_ID: description-lists
1588    :END:
1590   Yes, these are now built-in:
1592 #+BEGIN_EXAMPLE
1593 - item1 :: Description of this item 1
1594 - item2 :: Description of this item 2
1595 - item1 :: Description of this item 3
1596       also in multiple lines
1597 #+END_EXAMPLE
1599 * Tables
1600   :PROPERTIES:
1601   :CUSTOM_ID: Tables
1602   :END:
1603 ** Will there ever be support for multiple lines in a table field?
1604    :PROPERTIES:
1605    :CUSTOM_ID: table-multiline-fields
1606    :END:
1608    No.
1610    You can embed tables created with the table.el package in org-mode
1611    buffers, with mixed success when it comes to export and publishing.
1613 ** How can I make table alignment work with Asian character sets
1614    :PROPERTIES:
1615    :CUSTOM_ID: table-alignment-asian-characters
1616    :END:
1618 When table alignment fails, it usually has to do with character sets
1619 where some characters have non-integer width.  Org will deal correctly
1620 with characters that are one or two or three ASCII characters wide,
1621 but not with characters that are, for example, 1.5 ASCII characters
1622 wide.  To make table alignment work you need to switch to a different
1623 character set.
1625 ** Can I plot data from a table?
1626    :PROPERTIES:
1627    :CUSTOM_ID: plotting-table-data
1628    :END:
1630    Yes, you can, using org-plot.el written by Eric Schulte and now
1631    bundled with Org.  See [[http://orgmode.org/manual/Org_002dPlot.html#Org-Plot][the manual section about this]].
1633    See also [[file:org-tutorials/org-plot.org][this excellent tutorial]] by Eric Schulte.
1635 ** How can I fill a table column with incremental numbers?
1636    :PROPERTIES:
1637    :CUSTOM_ID: fill-table-column-with-incremental-numbers
1638    :END:
1640 Here is how: Use a field formula to set the first value in the column:
1642 #+begin_src org
1643 ,| N   |   |
1644 ,|-----+---|
1645 ,| :=1 |   |
1646 ,|     |   |
1647 ,|     |   |
1648 ,|     |   |
1649 ,#+TBLFM: @2$1=1
1650 #+end_src
1652 Then define a column formula in the second field:
1654 #+begin_src org
1655 ,| N        |   |
1656 ,|----------+---|
1657 ,| 1        |   |
1658 ,| =@-1 + 1 |   |
1659 ,|          |   |
1660 ,|          |   |
1661 ,#+TBLFM: @2$1=1
1662 #+end_src
1664 After recomputing the table, the column will be filled with
1665 incremental numbers:
1667 #+begin_src org
1668 ,| N |   |
1669 ,|---+---|
1670 ,| 1 |   |
1671 ,| 2 |   |
1672 ,| 3 |   |
1673 ,| 4 |   |
1674 ,#+TBLFM: $1=@-1 + 1::@2$1=1
1675 #+end_src
1677 Note that you could use arbitrary starting values and column formulas.
1679 ** Why does my table column get filled with #ERROR?
1680    :PROPERTIES:
1681    :CUSTOM_ID: table-column-filled-with-ERROR
1682    :END:
1684    Org-mode tried to compute the column from other fields using a
1685    formula stored in the =#+TBLFM:= line just below the table, and
1686    the evaluation of the formula fails.  Fix the fields used in the
1687    formula, or fix the formula, or remove it!
1689 ** How can I stop the table editor from creating new lines?
1690    :PROPERTIES:
1691    :CUSTOM_ID: table-editor-creates-new-lines
1692    :END:
1694    When I am in the last column of a table and just above a horizontal
1695    line in the table, pressing TAB creates a new table line before the
1696    horizontal line.  To move to the line below the
1697    horizontal line instead, do this:
1699    Press =down= (to get on the separator line) and then =TAB=.
1700    Or configure the variable
1702    : (setq org-table-tab-jumps-over-hlines t)
1704 ** How can I get table fields starting with "="?
1705    :PROPERTIES:
1706    :CUSTOM_ID: table-fields-starting-with-=
1707    :END:
1709    With the setting
1711    : (setq org-table-formula-evaluate-inline nil)
1713    this will no longer happen.  You can still use formulas using the
1714    commands @<tt>C-c =@</tt> and @<tt>C-u C-c =@</tt>
1716 ** How can I change the indentation of an entire table without fixing every line by hand?
1717    :PROPERTIES:
1718    :CUSTOM_ID: change-indentation-entire-table
1719    :END:
1721    The indentation of a table is set by the first line.  So just fix the
1722    indentation of the first line and realign with =TAB=.
1724 ** In my huge table the realigning after each TAB takes too long.  What can I do?
1725    :PROPERTIES:
1726    :CUSTOM_ID: table-realigning-after-TAB-takes-long
1727    :END:
1729    Either split the table into several by inserting an empty line every
1730    100 lines or so.  Or turn off the automatic re-align with
1732    : (setq org-table-automatic-realign nil)
1734    After this the only way to realign a table is to press =C-c C-c=.  It
1735    will no longer happen automatically, removing the corresponding delays
1736    during editing.
1738 ** Recalculation of my table takes too long.  What can I do?
1739    :PROPERTIES:
1740    :CUSTOM_ID: Recalculation-of-my-table-takes-too-long
1741    :END:
1743    Nothing, really.  The spreadsheet in org is mostly done to make
1744    calculations possible, not so much to make them fast.  Since Org-mode
1745    is firmly committed to the ASCII format, nothing is stopping you from
1746    editing the table by hand.  Therefore, there is no internal
1747    representation of the data.  Each time Org-mode starts a computation,
1748    it must scan the table for special lines, find the fields etc.  This
1749    is slow.  Furthermore, Calc is slow compared to hardware
1750    computations.  To make this work with normal editing, recalculation
1751    is not happening automatically, or only for the current line, so that
1752    the long wait for a full table iteration only happens when you ask
1753    for it.
1755    So for really complex tables, moving to a "real" spreadsheet may
1756    still be the best option.
1758    That said, there are some ways to optimize things in Org-mode, and I
1759    have been thinking about moving a bit further down this line.
1760    However, for my applications this has so far not been an issue at
1761    all.  If you have a good case, you could try to convince me.
1763 ** =S-RET= in a table keeps increasing the copied numbers.  How can I stop this?
1764    :PROPERTIES:
1765    :CUSTOM_ID: S-RET-in-a-table-increases-copied-numbers
1766    :END:
1768    Well, it is /supposed/ to be a feature, to make it easy to create a
1769    column with increasing numbers.  If this gets into your way, turn it
1770    off with
1772    : (setq org-org-table-copy-increment nil)
1774 ** When I export tables to html, they don't have borders.
1775    :PROPERTIES:
1776    :CUSTOM_ID: table-borders-in-html-export
1777    :END:
1779 By default, org mode exports tables without borders.
1781 You can changed this by placing an =#+ATTR_HTML= line before the
1782 table:
1784 :  #+ATTR_HTML: border="2" rules="all" frame="all"
1786 See [[http://orgmode.org/manual/Tables-in-HTML-export.html#Tables-in-HTML-export][the manual]] for more details.
1788 ** Why does the Calc high precision (e. g. =p20=) not work like expected?
1789    :PROPERTIES:
1790    :CUSTOM_ID: table-high-precision
1791    :END:
1793 - *Short answer*
1795   Avoid
1796   : | 1 / 2 * 3 | 0.16666667000000 |
1797   : #+TBLFM: $2 = $1; p20 %.14f
1799   and use
1800   : | 1 / 2 * 3 | 0.16666666666667 |
1801   : #+TBLFM: $2 = $1 +.0; p20 f-14
1803 - *Longer answer*
1805   It is important to distinguish between the precision of
1806   1) =p20=: Calc internal calculation (=calc-internal-prec=)
1807   2) =f-14=: Calc float formatting, unlimited in precision (=calc-float-format=)
1808   3) =%.14f=: the =printf= reformatting, limited in precision
1810   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.
1812   Use =C-h v org-calc-default-modes RET= to check the Org default settings
1813   which are used if no format specifiers are added to a table formula.
1814   The examples below have been made with the out_of_the_box Org defaults
1815   =calc-internal-prec = 12= and =calc-float-format = 8=.
1817   Remember the formula debugger, toggled with =C-c {=,
1818   to view the processing stages like:
1819   |   | formula debugger label | processing stage           |
1820   | / | <                      | <>                         |
1821   |---+------------------------+----------------------------|
1822   |   | Result:                | output of Calc             |
1823   |   | Format:                | reformatting with =printf= |
1825   Following are some examples to demonstrate
1826   the interaction of the three precisions.
1828   - *display precision limitations for Calc formulas*
1829     - limited by Calc internal calculation precision from Org default
1830       (here =p12=)
1831       : | 0.16666666666700 |
1832       : #+TBLFM: $1 = 1 / 2 * 3;     f-14
1834       : | 0.1666666666670000000 |
1835       : #+TBLFM: $1 = 1 / 2 * 3;     f-19
1837     - limited by Calc float format from Org default (here =f8=)
1838       : | 0.16666667 |
1839       : #+TBLFM: $1 = 1 / 2 * 3
1841       : | 0.16666667 |
1842       : #+TBLFM: $1 = 1 / 2 * 3; p20
1844       : | 0.16666667000000 |
1845       : #+TBLFM: $1 = 1 / 2 * 3;          %.14f
1847       : | 0.16666667000000 |
1848       : #+TBLFM: $1 = 1 / 2 * 3; p20      %.14f
1850     - limited by Calc float format specified
1851       : | 0.166667 |
1852       : #+TBLFM: $1 = 1 / 2 * 3;     f-6
1854       : | 0.16666666666667 |
1855       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-14
1857       : | 0.1666666666666666667 |
1858       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-19
1860     - limited by =printf= conversion to Emacs Lisp float
1861       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
1862       : #+TBLFM: $1 = 1 / 2 * 3;          %.19f
1864       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
1865       : #+TBLFM: $1 = 1 / 2 * 3; p20      %.19f
1867       : | 0.1666666666666666600 | the inaccuracy is platform dependent |
1868       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-20 %.19f
1870     - limited by =printf= format specified
1871       : | 0.166667 |
1872       : #+TBLFM: $1 = 1 / 2 * 3;         %.6f
1874   - *display precision limitations for Emacs Lisp formulas*
1875     - limited by Emacs Lisp float
1876       : | 0.16666666666666666 |
1877       : #+TBLFM: $1 = '(/ 1.0 (* 2 3))
1879       : | 0.1666666666666666574 | the inaccuracy is platform dependent |
1880       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.19f
1882     - limited by =printf= format specified
1883       : | 0.16666666666667 |
1884       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.14f
1886 This FAQ entry is based on this [[http://thread.gmane.org/gmane.emacs.orgmode/22642][mailing list thread]]
1887 and is continued in the [[#table-float-fraction][next FAQ entry]].
1889 ** Which float format shows the fraction part also when the latter is zero?
1890    :PROPERTIES:
1891    :CUSTOM_ID: table-float-fraction
1892    :END:
1894 - *Short answer*
1896   Avoid
1897    : | 1 | 1 |
1898    : #+TBLFM: $2 = $1; f-3
1899   and use
1900    : | 1 | 1.000 |
1901    : #+TBLFM: $2 = $1 +.0; f-3
1903 - *Longer answer*
1905   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]]
1906   in the section Mode Settings -> Display Modes -> Float Formats
1907   [[http://www.delorie.com/gnu/docs/calc/calc_163.html][found here as long as the section numbering is unchanged]].
1909   Remember the formula debugger, toggled with =C-c {=,
1910   to view the processing stages like:
1911   |   | formula debugger label | processing stage           |
1912   | / | <                      | <>                         |
1913   |---+------------------------+----------------------------|
1914   |   | Result:                | output of Calc             |
1915   |   | Format:                | reformatting with =printf= |
1917   Following are some examples to demonstrate different float formats.
1919   - normal precision
1920     : |-----------+---------+-------+---------+----------+-------|
1921     : |    number |      f3 |   f-3 | +.0; f3 | +.0; f-3 |  %.3f |
1922     : |-----------+---------+-------+---------+----------+-------|
1923     : |         1 |       1 |     1 |   1.000 |    1.000 | 1.000 |
1924     : |         0 |       0 |     0 |   0.000 |    0.000 | 0.000 |
1925     : |-----------+---------+-------+---------+----------+-------|
1926     : |       1.0 |   1.000 | 1.000 |   1.000 |    1.000 | 1.000 |
1927     : |       0.0 |   0.000 | 0.000 |   0.000 |    0.000 | 0.000 |
1928     : |-----------+---------+-------+---------+----------+-------|
1929     : | 1.0001666 |   1.000 | 1.000 |   1.000 |    1.000 | 1.000 |
1930     : | 0.0001666 | 1.67e-4 | 0.000 | 1.67e-4 |    0.000 | 0.000 |
1931     : |-----------+---------+-------+---------+----------+-------|
1932     : | 1.0016666 |   1.002 | 1.002 |   1.002 |    1.002 | 1.002 |
1933     : | 0.0016666 |   0.002 | 0.002 |   0.002 |    0.002 | 0.002 |
1934     : |-----------+---------+-------+---------+----------+-------|
1935     : #+TBLFM: $2 = $1; f3 :: $3 = $1; f-3 :: $4 = $1 +.0; f3 :: $5 = $1 +.0; f-3 :: $6 = $1; %.3f
1937   - high precision
1938     : |----------------------+--------------------------+-----------------------|
1939     : | number               |                      f19 |                  f-19 |
1940     : |----------------------+--------------------------+-----------------------|
1941     : | 1                    |                        1 |                     1 |
1942     : | 0                    |                        0 |                     0 |
1943     : |----------------------+--------------------------+-----------------------|
1944     : | 1.0                  |    1.0000000000000000000 | 1.0000000000000000000 |
1945     : | 0.0                  |    0.0000000000000000000 | 0.0000000000000000000 |
1946     : |----------------------+--------------------------+-----------------------|
1947     : | 1 + 1 / 2 * 3 * 1e19 |    1.0000000000000000000 | 1.0000000000000000000 |
1948     : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
1949     : |----------------------+--------------------------+-----------------------|
1950     : | 1 + 1 / 2 * 3 * 1e18 |    1.0000000000000000002 | 1.0000000000000000002 |
1951     : | 0 + 1 / 2 * 3 * 1e18 |    0.0000000000000000002 | 0.0000000000000000002 |
1952     : |----------------------+--------------------------+-----------------------|
1953     : #+TBLFM: $2 = $1; p20 f19 :: $3 = $1; p20 f-19
1955     : |----------------------+--------------------------+-----------------------|
1956     : | number               |                 +.0; f19 |             +.0; f-19 |
1957     : |----------------------+--------------------------+-----------------------|
1958     : | 1                    |    1.0000000000000000000 | 1.0000000000000000000 |
1959     : | 0                    |    0.0000000000000000000 | 0.0000000000000000000 |
1960     : |----------------------+--------------------------+-----------------------|
1961     : | 1.0                  |    1.0000000000000000000 | 1.0000000000000000000 |
1962     : | 0.0                  |    0.0000000000000000000 | 0.0000000000000000000 |
1963     : |----------------------+--------------------------+-----------------------|
1964     : | 1 + 1 / 2 * 3 * 1e19 |    1.0000000000000000000 | 1.0000000000000000000 |
1965     : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
1966     : |----------------------+--------------------------+-----------------------|
1967     : | 1 + 1 / 2 * 3 * 1e18 |    1.0000000000000000002 | 1.0000000000000000002 |
1968     : | 0 + 1 / 2 * 3 * 1e18 |    0.0000000000000000002 | 0.0000000000000000002 |
1969     : |----------------------+--------------------------+-----------------------|
1970     : #+TBLFM: $2 = $1 +.0; p20 f19 :: $3 = $1 +.0; p20 f-19
1972     The =printf= reformatting (=%.19f=) cannot be used with high precision,
1973     see the [[#table-high-precision][previous FAQ entry]].
1975 ** How can I center tables in LaTeX output?
1976    :PROPERTIES:
1977    :CATEGORY: centered-tables-in-latex
1978    :END:
1980 Set the `org-export-latex-tables-centered' to `t':
1982 : (defcustom org-export-latex-tables-centered t
1983 :   "When non-nil, tables are exported in a center environment."
1984 :   :group 'org-export-latex
1985 :   :type 'boolean)
1987 * Markup
1988   :PROPERTIES:
1989   :CUSTOM_ID: Footnotes
1990   :END:
1991 ** How can I get automatic renumbering of footnotes in org-mode?
1992    :PROPERTIES:
1993    :CUSTOM_ID:       footnote-auto-adjust
1994    :END:
1996 You can add the following line to your .emacs file:
1998 : (setq org-footnote-auto-adjust t)
2000 Or, if you prefer, you can turn this option on locally by placing the
2001 following line at the top of your org file:
2003 : #+STARTUP: fnadjust
2005 When auto-adjust is turned on, footnotes in the file with numerical
2006 labels will be renumbered whenever a new footnote is added. Meanwhile,
2007 all footnotes, including those with custom labels such
2008 =[fn:custom-label ]=, will be sorted in the order of their appearance
2009 in the text.
2011 This emulates the footnote behavior that many users may be familiar
2012 with from word-processing programs or from the footnote-mode included
2013 with emacs.
2015 If you do not turn on org-footnote-auto-adjust, you sort and/or
2016 renumber footnotes at any time by calling org-footnote-action with a
2017 prefix argument.
2019 ** Why isn't auto renumbering of footnotes turned on by default?
2020    :PROPERTIES:
2021    :CUSTOM_ID:       why-no-default-auto-adjust
2022    :END:
2024 Org mode has a very robust footnote mechanism allowing for a variety
2025 of types of footnotes. With some of the following footnote notations,
2026 auto-adjust may be either irrelevant or undesired:
2028  - Automatically numbered
2029  - Footnotes with custom labels
2030  - Inline footnotes
2032 In addition, org mode can be customized to place footnotes either at
2033 the end of a document or at the end of the outline heading in which
2034 they appear. Users who change this setting while editing a document
2035 may be disconcerted to find all of their footnotes rearranged
2036 automatically.
2038 ** I have auto-fill-mode set and org-mode is inserting unwanted comment markers!
2039    :PROPERTIES:
2040    :CUSTOM_ID: auto-fill-and-unwanted-comments
2041    :END:
2043 If the following occurs:
2045 #+begin_src org
2046   ,#+OPTIONS: toc:nil
2047   ,Some entered text.
2048   ,# More entered tex.
2049 #+end_src
2051 Make sure that the variable comment-start is nil.
2053 ** Are there any shortcuts for entering source blocks and comment lines?
2054    :PROPERTIES:
2055    :CUSTOM_ID: shortcuts-for-entering-source-blocks
2056    :END:
2058 Org mode has some [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][very convenient markup]] for including literal blocks
2059 and lines of code in a file. (This is especially useful when exporting
2060 documents or using the contributed package [[file:org-contrib/babel/index.org][org-babel]] for executing
2061 blocks of code.)
2063 #+begin_src org
2064   ,#+begin_src perl
2065   ,  print "Hello, world!\n";
2066   ,#+end_src
2067 #+end_src
2069 It can be tiresome to enter the block comment lines manually. There
2070 are several possible shortcuts you can use to enter them:
2072 1) Built-in expansion
2074    - Org mode has a "secret" method of expanding source code blocks
2075      and comment lines.
2077    - If you type "<s" followed by =TAB= or =M-TAB=, a source block will
2078      magically appear.
2080    - For a full list of expansions, type =M-x describe-variable
2081      [RET] org-structure-template-alist=.
2083 2) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Registers]]
2085    - Add the following line to your emacs file:
2087      =(set-register ?p "#+begin_src\n\n#+end_src perl")=
2089    - Then type =C-x r i p= to insert the source block. Please note: if
2090      you save another value to the register "p" with =C-x r s p=, it
2091      will overwrite the setting above for the current emacs session.
2093 3) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Abbrevs]]
2095    - Activate the abbrev minor-mode in org-mode:
2097      + M-x abbrev-mode
2099      + /Permanently/:
2101        + =(add-hook 'org-mode-hook (lambda () (abbrev-mode 1)))=
2103    - In org-mode, type "sbp" (a sample abbreviation for a perl source
2104      block).
2106    - Immediately after "sbp" type =C-x a i l=.
2108    - Enter the expansion:
2110      - =#+begin_src perl[C-q C-j][C-q C-j]#+end_src=
2112      - Note: =C-q C-j= creates a new line in the minibuffer
2114    - Now, whenever, you type sbp followed by =SPACE= or =RET= in an
2115      org-mode buffer, the src block will magically appear.
2117    - To review your list of abbrevs, type =M-x edit-abbrevs=.
2119 4) [[http://www.slashgear.com/nokia-n900-android-dual-boot-hack-video-2371099/][Skeletons]]
2121    - Skeletons offer a simple way of automatically entering text.
2122      Here's a skeleton that queries for the type of block and wraps
2123      the active region inside it:
2125      #+begin_src elisp
2126        (define-skeleton skel-org-block
2127          "Insert an org block, querying for type."
2128          "Type: "
2129          "#+begin_" str "\n"
2130          _ - \n
2131          "#+end_" str "\n")
2132      #+end_src
2134    - Simply type skel-org-block to insert the block.
2136      - You can bind this to a key.
2138      - You can also create an abbrev that invokes this function:
2140        : (define-abbrev org-mode-abbrev-table "blk" "" 'skel-org-block)
2142 5) [[http://code.google.com/p/yasnippet/][Yasnippet]]
2144    - Several org-mode users install yasnippet for convenient, complex
2145      expansion.
2147    - See Bernt Hansen's [[http://doc.norang.ca/org-mode.html#Yasnippets][org-mode setup]] for a good introduction to
2148      yasnippet.
2150 * Capture and remember
2151   :PROPERTIES:
2152   :CUSTOM_ID: Remember
2153   :END:
2154 ** Can I use a variable or a function inside the `org-capture-templates' variable?
2155    :PROPERTIES:
2156    :CUSTOM_ID: variable-inside-capture-templates
2157    :END:
2159 Yes.  Use [[http://www.gnu.org/s/emacs/manual/html_node/elisp/Backquote.html][backquotes]].
2161 E.g. if you have a variable called =org-test-file= and you want the
2162 variable =org-capture-templates= to "understand" (i.e. evaluate)
2163 =org-test-file= when Emacs evaluates the =(setq org-capture-templates
2164 [...])= expression, use backquotes like this:
2166 #+begin_src emacs-lisp
2167 (setq org-capture-templates
2168       `(("t" "Todo" entry (file+headline ,org-test-file "Tasks")
2169        "* TODO %?\n  %i\n  %a")
2170       ("b" "Buy" item (file+olp ,org-test-file "Stuff to Buy" "House")
2171        "")))
2172 #+end_src
2174 ** Can I use the remember buffer to clock a customer phone call?
2175    :PROPERTIES:
2176    :CUSTOM_ID: use-remember-buffer-to-clock-phone-call
2177    :END:
2179   Yes, you can.  Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/5482][setup described by Bernt Hansen]]
2180   and check out (in the same thread) what Nick Docos had to fix to
2181   make Bernt's set-up work for him.
2182 ** Can I automatically start the clock when opening a remember template?
2183    :PROPERTIES:
2184    :CUSTOM_ID: start-clock-when-opening-remember-template
2185    :END:
2187    Yes, this is possible.  Use the following code and make sure that
2188    after executing it, `my-start-clock-if-needed' is in
2189    `remember-mode-hook' /after/ `org-remember-apply-template'.
2191    : (add-hook 'remember-mode-hook 'my-start-clock-if-needed 'append)
2192    : (defun my-start-clock-if-needed ()
2193    :   (save-excursion
2194    :     (goto-char (point-min))
2195    :     (when (re-search-forward " *CLOCK-IN *" nil t)
2196    :       (replace-match "")
2197    :       (org-clock-in))))
2199    Then, when a template contains the key string CLOCK-IN, the clock
2200    will be started.  Starting with Org-mode version 5.20, the clock will
2201    automatically be stopped when storing the remember buffer.
2203 * Searches
2204   :PROPERTIES:
2205   :CUSTOM_ID: Searches
2206   :END:
2207 ** Isearch does not find string hidden in links.  What can I do?
2208    :PROPERTIES:
2209    :CUSTOM_ID: isearch-in-links
2210    :END:
2212   M-x =visible-mode= will display the full link, making them searchable.
2214 ** How can I reduce the amount of context shown in sparse trees?
2215    :PROPERTIES:
2216    :CUSTOM_ID: context-in-sparse-trees
2217    :END:
2219    Take a look at the following variables:
2221    - =org-show-hierarchy-above=
2222    - =org-show-following-headline=
2223    - =org-show-siblings=
2224    - =org-show-entry-blow=
2226    which give command-dependent control over how much context is shown
2227    by a particular operation.
2229 ** How can I combine the results of two calls to =org-occur=?
2230    :PROPERTIES:
2231    :CUSTOM_ID: two-calls-to-org-occur
2232    :END:
2234    You can construct a regular expression that matches all targets you
2235    want.  Alternatively, use a =C-u= prefix with the second and any
2236    further calls to =org-occur= to keep the current visibility and
2237    highlighting in addition to the new ones.
2239 * Agenda
2240   :PROPERTIES:
2241   :CUSTOM_ID: Agenda
2242   :END:
2243 ** How can I change the advanced warning time for deadlines?
2244    :PROPERTIES:
2245    :CUSTOM_ID: warning-period-for-deadlines
2246    :END:
2247 ##<<warning-period-for-deadlines>>
2249 Deadline warnings appear in the daily agenda view a specified number
2250 of days before the deadline is due. The default setting is 14 days.
2251 You can change this with the variable =org-deadline-warning-days=.
2252 (See [[http://orgmode.org/manual/Deadlines-and-scheduling.html#Deadlines-and-scheduling][this section]] of the manual.)
2254 For instance,
2256 : (setq org-deadline-warning-days 30)
2258 would cause warnings for each deadline to appear 30 days in advance.
2260 Naturally, you might not want warnings for all of your deadlines to
2261 appear so far in advance. Thus, you can change the lead time for
2262 individual items as follows:
2264 : * TODO Get a gift for the party
2265 :   DEADLINE: <2009-01-16 Fri -2d>
2267 The "-2d" above changes the lead time for this deadline warning to two
2268 days in advance. You can also use "w" for weeks and "m" for months.
2269 ** How can I postpone a task until a certain date?
2270    :PROPERTIES:
2271    :CUSTOM_ID: deferring-tasks
2272    :END:
2274 The easiest way to postpone a task is to schedule it in the future.
2275 For instance, typing =C-c C-s +2w= on a headline will push a task two
2276 weeks into the future, so that it won't show up on the daily agenda
2277 until two weeks from now.
2279 If you'd like to prevent the task from showing up on your global todo
2280 list, you have a couple of options.
2282 1. You can set the variable =org-agenda-todo-ignore-scheduled= to =t=.
2283    This will exclude any scheduled items from your global list of
2284    active todos (=C-c a t=). (The variable
2285    =org-agenda-todo-ignore-with-date= will exclude both scheduled and
2286    deadline items from your todo list).
2287 2. You can remove the todo keyword from the item (C-c C-t <SPC>). The
2288    item will still appear on your agenda two weeks from today, but it
2289    won't show up on your todo lists.
2290 ** Can I send myself an email containing tasks or other agenda info?
2291    :PROPERTIES:
2292    :CUSTOM_ID: email-containing-tasks-or-other-agenda-info
2293    :END:
2295    Yes.  See [[http://article.gmane.org/gmane.emacs.orgmode/6112][this thread]] on the list.
2297 ** How can I limit the agenda view to my "work" tasks?
2298    :PROPERTIES:
2299    :CUSTOM_ID: limit-agenda-with-tag-filtering
2300    :END:
2302    It is often convenient to group org files into separate categories,
2303    such as "home" and "work" (or "personal" and "professional"). One
2304    of the main reasons for such classification is to create agenda
2305    views that are limited by type of work or area of responsibility.
2306    For instance, while at work, one may want to see only professional
2307    tasks; while away from work, one may want to see only personal
2308    tasks.
2310    One way to categorize files and tasks is to use a "#+FILETAGS"
2311    declaration at the top of each file, such as:
2313    : #+FILETAGS: work
2315    As long as org-use-tag-inheritance is turned on, the filetags will
2316    be inherited by all tasks in the file. A file can have multiple
2317    filetags. And, of course, tags can be added to individual headings.
2319    Tasks can be quickly filtered by tag from within the agenda by
2320    typing "/" and the name of the tag. The full key sequence to filter
2321    for work items in an agenda view would be:
2323    : C-c a a / work [or a tag shortcut]
2325 ** How can I limit the agenda view to a particular category?
2326    :PROPERTIES:
2327    :CUSTOM_ID: limit-agenda-with-category-match
2328    :END:
2330    Another way to filter agenda views by type of work is to use a
2331    "#+CATEGORY" declaration at the top of each file, such as:
2333    : #+CATEGORY: work
2335    Categories can also be added to individual headings within a file:
2337    : * Big project
2338    :   :PROPERTIES:
2339    :   :CATEGORY: work
2340    :   :END:
2342    All todos belonging to the category "work" can be found a with a
2343    simple tags-todo search:
2345    : C-c a M
2347    At the prompt, type:
2349    : CATEGORY="work"
2351    The same results can be achieved with custom agenda commands, such as:
2353 #+BEGIN_SRC emacs-lisp
2354 (setq org-agenda-custom-commands
2355       '(("h" tags-todo "CATEGORY=\"home\"")
2356         ("w" tags-todo "CATEGORY=\"work\"")
2357         ;; other custom agenda commands here
2358         ))
2359 #+END_SRC
2361 ** How can include all org files in a directory in my agenda?
2362    :PROPERTIES:
2363    :CUSTOM_ID: set-agenda-files-using-wildcards
2364    :END:
2366 You can simply include the directory (as one of the items) in the
2367 value of the variable org-agenda-files:
2369 : (setq org-agenda-files '("/my/special/path/org/"))
2371 There is another way of accomplishing the same end:
2373 : (setq org-agenda-files (file-expand-wildcards "/my/special/path/org/*.org"))
2375 ** Why aren't items disappearing from my agenda once they are marked done?
2376    :PROPERTIES:
2377    :CUSTOM_ID: removing-done-items-from-agenda
2378    :END:
2380 If items remain on your daily/weekly agenda after they are marked
2381 done, check the configuration of the following variables:
2383 : org-agenda-skip-scheduled-if-done
2384 : org-agenda-skip-deadline-if-done
2385 : org-agenda-skip-timestamp-if-done
2387 For instance, type:
2389 : M-x customize-variable RET org-agenda-skip-scheduled-if-done
2391 If this variable is turned off (=nil=), then scheduled items will
2392 remain on the agenda even after they are marked done.
2394 If the variable is turned on (=t=), then scheduled items will
2395 disappear from the agenda after they are marked done.
2397 If these settings seem not to behave the way you expect, then make
2398 sure you understand [[scheduled-vs-deadline-vs-timestamp][the
2399 difference between SCHEDULED, DEADLINE, and timestamps]].
2401 ** How do I keep repeating timestamps from being displayed multiple times?
2402    :PROPERTIES:
2403    :CUSTOM_ID: repeating-timestamps-show-once
2404    :END:
2406 To show only the /current/ instance of a repeating timestamp, put the
2407 following in your .emacs:
2409 #+begin_src emacs-lisp
2410 (setq org-agenda-repeating-timestamp-show-all nil)
2411 #+end_src
2413 ** What is the difference between SCHEDULED, DEADLINE, and plain timestamps?
2414    :PROPERTIES:
2415    :CUSTOM_ID: scheduled-vs-deadline-vs-timestamp
2416    :END:
2418 1. SCHEDULED items (set with =C-c C-s=) will appear on your agenda on
2419    the day they are scheduled and on every day thereafter until they
2420    are done. Schedule a task if you want to be reminded to do
2421    something beginning on a certain day and until it is done.
2423    : ** TODO Scheduled item
2424    :    SCHEDULED: <2009-03-01 Sun>
2426 2. Items with a DEADLINE timestamp (set with =C-c C-d=) appear on your
2427    agenda in advance of the when they are due and remain on your
2428    agenda until they are done. Add a DEADLINE to an item if you want
2429    to make sure to complete it by a certain date. (The variable
2430    org-deadline-warning-days determines how far in advance items with
2431    deadlines will show up in the agenda. See [[warning-period-for-deadlines][this FAQ]] for more
2432    information.)
2434    : ** TODO Item with a deadline
2435    :    DEADLINE: <2009-01-20 Tue>
2437 3. An active timestamp (set with =C-c .=) will appear on your agenda
2438    only on the day it is scheduled. Use a timestamp for appointments
2439    or any reminders you want to show up only on a particular day.
2441    : ** TODO Item with an active timestamp
2442    : <2009-04-18 Sat>
2444 Note: items with inactive timestamps (set with C-c ! and marked by
2445 square brackets) will not show up in the agenda at all.
2447 ** Can I add files recursively to my list of agenda files?
2448    :PROPERTIES:
2449    :CUSTOM_ID: set-agenda-files-recursively
2450    :END:
2452 Yes, you can use the library "find-lisp."
2454 : (load-library "find-lisp")
2455 : (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$"))
2457 This will add all files ending in =org= in the directory "~/org"
2458 and all of its subdirectories to your list of agenda files.
2460 See [[http://thread.gmane.org/gmane.emacs.orgmode/8992][this thread]] on the mailing list for more information.
2462 ** Why does an item appearing at the wrong time of day in my agenda?
2463    :PROPERTIES:
2464    :CUSTOM_ID: agenda-wrong-time-of-day
2465    :END:
2467 When preparing the agenda view, org-mode scans each relevant headline
2468 for a time designation. This approach is very nice for adding
2469 free-form timestamps to an item for scheduling. Thus, either of the
2470 following work would work to schedule an item at 10:00am:
2472 #+begin_src org
2473 ,** 10:00am Get dried ice at the magic store
2474 ,   SCHEDULED: <2009-05-27 Wed>
2475 #+end_src
2477 #+begin_src org
2478 ,** Get dried ice at the magic store
2479 ,   SCHEDULED: <2009-05-27 Wed 10:00>
2480 #+end_src
2482 To enable this flexibility, org-mode scans the entire headline for
2483 time of day notation. A potential problem can arise if you use
2484 inactive timestamps in the headline to note when an item was created.
2485 For example,
2487 #+begin_src org
2488 ,** Get dried ice at the magic store [2009-05-26 Tue 12:58]
2489 ,   SCHEDULED: <2009-05-27 Wed>
2490 #+end_src
2492 Org mode would interpret the time in the inactive timestamp as a
2493 time-of-day indicator and the entry would appear in your agenda at
2494 12:58.
2496 If you would like to turn off the time-of-day search, you can
2497 configure the variable =org-agenda-search-headline-for-time= (requires
2498 org-mode >= 6.24).
2500 ** How can I change the visibility of an item from the agenda?
2501    :PROPERTIES:
2502    :CUSTOM_ID: cycling-visibility-from-agenda
2503    :END:
2505 You can add a keybinding as follows:
2507 #+begin_src emacs-lisp
2508 (add-hook 'org-agenda-mode-hook
2509    (lambda ()
2510      (define-key org-agenda-mode-map " " 'org-agenda-cycle-show)))
2511 #+end_src
2513 Then, as you press SPACE on an item on the agenda, it will cycle the
2514 visibility of its original location.
2516 ** Is there any way to set org-mode so that tags don't appear in the agenda view?
2518 See the =org-agenda-remove-tags= variable.
2520 ** I work late at night! How can I extend my current day past midnight?
2521    :PROPERTIES:
2522    :CUSTOM_ID: org-extend-today-until
2523    :END:
2525 If you work past midnight, you may not want your daily agenda view to
2526 switch to the next day at 12 a.m. (the default). To extend your day,
2527 simply set the value of org-extend-today-until to a positive number
2528 corresponding to the number of hours you work past midnight. For
2529 example, the following setting will cause the current day to extend
2530 until 6 a.m.
2532 : (setq org-extend-today-until 6)
2534 * Appointments/Diary
2535   :PROPERTIES:
2536   :CUSTOM_ID: Appointments/Diary
2537   :END:
2538 ** Is it possible to include entries from org-mode files into my emacs diary?
2539    :PROPERTIES:
2540    :CUSTOM_ID: include-entries-from-org-mode-files-into-emacs-diary
2541    :END:
2543    Since the org-mode agenda is much more powerful and can contain the
2544    diary, you should think twice before deciding to do this.  If you
2545    insist, however, integrating Org-mode information into the diary is
2546    possible.  You need to turn on /fancy diary display/ by setting in
2547    .emacs:
2549    : (add-hook 'diary-display-hook 'diary-fancy-display)
2551    Then include the following line into your ~/diary file, in
2552    order to get the entries from all files listed in the variable
2553    =org-agenda-files=
2555    : &%%(org-diary)
2557    You may also select specific files with
2559    : &%%(org-diary) ~/path/to/some/org-file.org
2560    : &%%(org-diary) ~/path/to/another/org-file.org
2562    If you now launch the calendar and press @<tt>d@</tt> to display a
2563    diary, the headlines of entries containing a timestamp, date range,
2564    schedule, or deadline referring to the selected date will be listed.
2565    Just like Org-mode's agenda view, the diary for /today/ contains
2566    additional entries for overdue deadlines and scheduled items.  See
2567    also the documentation of the =org-diary= function.  Under XEmacs, it
2568    is not possible to jump back from the diary to the org, this works
2569    only in the agenda buffer.
2570 ** I want to add my Org scheduled/deadlined entries in my diary!
2571    :PROPERTIES:
2572    :CUSTOM_ID: add-Org-scheduled/deadlined-entries-to-diary!
2573    :END:
2575   Put this in your ~/.diary:
2577   : &%%(org-diary :scheduled :timestamp :deadline)
2579 ** How can I set up automatic reminders based on Org information?
2580    :PROPERTIES:
2581    :CUSTOM_ID: automatic-reminders
2582    :END:
2584   See [[http://article.gmane.org/gmane.emacs.orgmode/5271][this post]] by N. Dokos on the list. See also Russell Adams's hack in [[file:org-hacks.org::*Org%20Agenda%20%2B%20Appt%20%2B%20Zenity][org-hacks]].
2585 ** How can I make =appt= notice my Org appointments?
2586    :PROPERTIES:
2587    :CUSTOM_ID: appt-notice-my-Org-appointments
2588    :END:
2590   : M-x org-agenda-to-appt RET
2592 ** How can I create more complex appointments in my org-files?
2593    :PROPERTIES:
2594    :CUSTOM_ID: diary-sexp-in-org-files
2595    :END:
2597 Org-mode's active timestamps work very well for scheduling individual
2598 or recurring appointments, such as:
2600 #+begin_src org
2601   ,* 8:00am Dentist appointment <2009-01-16 Fri>
2602 #+end_src
2605 #+begin_src org
2606   ,* Vacation
2607   ,  <2009-03-20 Fri>--<2009-04-01 Wed>
2608 #+end_src
2612 #+begin_src org
2613   ,* Weekly meeting with boss
2614   ,  <2009-01-20 Tue 14:00 +1w>
2615 #+end_src
2617 Sometimes, however, you need to set up more complicated recurring
2618 appointments. Org-mode has built-in support for many of
2619 [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Sexp-Diary-Entries.html][the
2620 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
2621 instance, that you teach a class that meets every Monday evening
2622 between February 16 and April 20, 2009. The way to enter this an
2623 org-mode file is:
2625 #+begin_src org
2626   ,** Class 7:00pm-9:00pm
2627   ,   <%%(and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009))>
2628 #+end_src
2630 The expression above designates all Mondays that fall between February
2631 16 and April 20. How exactly does it work?
2633  - (and... :: Indicates that *both* of the conditions that follow have
2634           to be true.
2636    - (= 1 (calendar-day-of-week date)) :: Is the day of the week a
2637         Monday?
2639        - Note: the function calendar-day-of-week converts the date to the day of week
2640          expressed in numeric form, where 0 = Sunday, 1 = Monday, and so on.
2642    - (diary-block 2 16 2009 4 20 2009) :: Does the date fall between
2643         these two dates?
2645 You can make a sexp as complex as you like. If you wanted to omit a
2646 week because of holidays, for instance, you could add another
2647 condition to the sexp:
2649 #+begin_src org
2650   ,** Class 7:00pm-9:00pm
2651   ,   <%%(unless (diary-block 3 9 2009 3 13 2009) (and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009)))>
2652 #+end_src
2654 The sexp above would omit Monday during the week of March 9, 2009. For
2655 another way to accomplish the same thing, see [[org-diary-class][this FAQ]].
2657 Another diary function commonly used for more complex scheduling is
2658 diary-float. For instance,
2660 #+begin_src org
2661   ,* Monthly meeting
2662   ,  <%%(diary-float t 3 3)>
2663 #+end_src
2665 ...would appear on the third Wednesday of every month.
2667 For more ideas on how to create diary special expressions, see [[http://www.emacswiki.org/cgi-bin/wiki/DiaryMode][this
2668 page on the Emacs wiki]].
2670 ** How can I schedule a weekly class that lasts for a limited period of time?
2671    :PROPERTIES:
2672    :CUSTOM_ID: org-diary-class
2673    :END:
2675 Org-mode offers a convenient diary sexp function for setting up a
2676 recurring appointment that lasts for a certain period of time, such as
2677 a class. It is called org-diary-class and it can be entered as
2678 follows:
2680 #+begin_src org
2681   ,** Class 7:00pm-9:00pm
2682   ,   <%%(org-diary-class 2 16 2009 4 20 2009 1 10)>
2683 #+end_src
2685 The function above schedules an appointment for every Monday (1)
2686 between February 16 and April 20, 2009, except for ISO week 10 (March
2687 1 to March 7).
2689 The function org-diary-class has the following format:
2691 : (org-diary-class M1 D1 Y1 M2 D2 Y2 DAYNAME &rest SKIP-WEEKS)
2693 M1/2, D1/2, and Y1/2 indicate the beginning and ending dates. Dayname
2694 takes the form of a number indicating the day of the week (0 = Sunday,
2695 1 = Monday, and so on...). In addition, one can add an optional
2696 argument SKIP-WEEKS to indicate weeks on the calendar that should be
2697 skipped. This argument should be expressed as an ISO week number. You
2698 can find the number by invoking emacs' built-in calendar (=M-x
2699 calendar=), navigating to the appropriate week, and typing =p c=
2700 (calendar-iso-print-date).
2702 Please note: the order of the month, day, and year arguments depends
2703 on the variables =calendar-date-style= and/or
2704 =european=calendar=style=. (See the documentation for these variables
2705 with C-h v or M-x describe variable.) For instance, the example above
2706 works if =calendar-date-style= is set to ='american=. If
2707 =calendar-date-style= is set to ='iso=, then the arguments to the
2708 org-diary-class sexp would have the following format:
2710 : (org-diary-class Y1 M1 D1 Y2 M2 D2 DAYNAME &rest SKIP-WEEKS)
2712 Here is an alternative method, shared by Paul Sexton on the org
2713 mailing list:
2715 Let's say you are taking night classes in Spanish. The class is every
2716 Wednesday evening at 7pm, starting on 18 August, and runs for 8 weeks.
2717 Org-mode's timestamps do not support limited occurrences of recurrent
2718 items -- you have to schedule the item with infinite recurrences, then
2719 delete it when it finishes.
2721 To schedule the Spanish classes, put the following in your =.emacs=:
2723 #+begin_src emacs-lisp
2724   (defun diary-limited-cyclic (recurrences interval m d y)
2725     "For use in emacs diary. Cyclic item with limited number of recurrences.
2726   Occurs every INTERVAL days, starting on YYYY-MM-DD, for a total of
2727   RECURRENCES occasions."
2728     (let ((startdate (calendar-absolute-from-gregorian (list m d y)))
2729           (today (calendar-absolute-from-gregorian date)))
2730       (and (not (minusp (- today startdate)))
2731            (zerop (% (- today startdate) interval))
2732            (< (floor (- today startdate) interval) recurrences))))
2733 #+end_src
2734 The item in the org file looks like this:
2736 #+begin_src org
2737   ,** 19:00-21:00 Spanish lessons
2738   ,   <%%(diary-limited-cyclic 8 7 8 18 2010)>
2739 #+end_src
2741 ** How can I set an event to occur every day except Saturday and Sunday?
2743 #+begin_src org
2744   ,** Daily meeting
2745   ,   <%%(memq (calendar-day-of-week date) '(1 2 3 4 5))>
2746 #+end_src
2748 ** How do I schedule events relative to Easter Sunday?
2750    Easter's date moves around from year to year according to a
2751    complicated set of criteria which I do not claim to understand.
2752    However the following code will allow you to schedule recurring
2753    events relative to Easter Sunday.
2755    Note: the function da-easter is from:
2756    http://github.com/soren/elisp/blob/master/da-kalender.el
2758    Put the following in your .emacs:
2760 #+begin_src emacs-lisp
2761   (defun da-easter (year)
2762     "Calculate the date for Easter Sunday in YEAR. Returns the date in the
2763   Gregorian calendar, ie (MM DD YY) format."
2764     (let* ((century (1+ (/ year 100)))
2765            (shifted-epact (% (+ 14 (* 11 (% year 19))
2766                                 (- (/ (* 3 century) 4))
2767                                 (/ (+ 5 (* 8 century)) 25)
2768                                 (* 30 century))
2769                              30))
2770            (adjusted-epact (if (or (= shifted-epact 0)
2771                                    (and (= shifted-epact 1)
2772                                         (< 10 (% year 19))))
2773                                (1+ shifted-epact)
2774                              shifted-epact))
2775            (paschal-moon (- (calendar-absolute-from-gregorian
2776                              (list 4 19 year))
2777                             adjusted-epact)))
2778       (calendar-dayname-on-or-before 0 (+ paschal-moon 7))))
2781   (defun da-easter-gregorian (year)
2782     (calendar-gregorian-from-absolute (da-easter year)))
2784   (defun calendar-days-from-easter ()
2785     "When used in a diary sexp, this function will calculate how many days
2786   are between the current date (DATE) and Easter Sunday."
2787     (- (calendar-absolute-from-gregorian date)
2788        (da-easter (calendar-extract-year date))))
2789 #+end_src
2791     Now we can schedule the public holidays associated with Easter as
2792     recurring events. Good Friday is 2 days before "Easter", Easter
2793     Monday is one day after.
2795 #+begin_src org
2796   ,* Good Friday
2797   ,  <%%(= -2 (calendar-days-from-easter))>
2799   ,* Easter Sunday
2800   ,  <%%(= 0 (calendar-days-from-easter))>
2802   ,* Easter Monday
2803   ,  <%%(= 1 (calendar-days-from-easter))>
2804 #+end_src
2805    [Source: Posted by Paul Sexton on Org-mode mailing list.]
2807 ** How to schedule public holiday that is "the nearest Monday to DATE"?
2809    In New Zealand each regional capital has an "Anniversary Day". The
2810    date of Auckland's anniversary day is "the nearest Monday to 29
2811    January".
2813    Put this in your =.emacs=:
2815 #+begin_src emacs-lisp
2816   (defun calendar-nearest-to (target-dayname target-day target-month)
2817     "Recurring event that occurs in the nearest TARGET-DAYNAME to
2818   the date TARGET-DAY, TARGET-MONTH each year."
2819     (interactive)
2820     (let* ((dayname (calendar-day-of-week date))
2821            (target-date (list target-month target-day (calendar-extract-year date)))
2822            (days-diff (abs (- (calendar-day-number date)
2823                               (calendar-day-number target-date)))))
2824       (and (= dayname target-dayname)
2825            (< days-diff 4))))
2826 #+end_src
2828    Now we can schedule Auckland Anniversary Day. The first argument,
2829    1, means Monday (days of the week are numbered starting with
2830    Sunday=0).
2832    [Source: Originally posted by Paul Sexton on Org-mode mailing list.]
2834 ** How to schedule public holiday on "the 4th Monday in October"?
2836    This does not require any additions to =.emacs=:
2838 #+begin_src org
2839   ,* Labour Day (NZ)
2840   ,  <%%(diary-float 10 1 4)>
2841 #+end_src
2843 ** Why isn't the agenda showing all the times I put under a single entry?
2844    :PROPERTIES:
2845    :CATEGORY: multiple-timestamps-same-entry
2846    :END:
2848 Probably because you have not set the following variable:
2850 : org-agenda-skip-additional-timestamps-same-entry
2852 The default value of this variable is t, which means that entries with
2853 multiple timestamps, such as the following...
2855 #+begin_src org
2856   ,* Work really, really hard
2857   ,  <2010-11-20 Sat 10:00>
2858   ,  <2010-11-20 Sat 14:00>
2859 #+end_src
2861 ...will only appear in the agenda at the time specified by the first
2862 timestamp. If you set org-agenda-skip-additional-timestamps-same-entry
2863 to nil, the item will appear will appear at all the times you specify.
2865 ** Can I import iCal events/appts from Gnus?
2867 Yes.  Vagn Johansen wrote [[http://ozymandias.dk/emacs/org-import-calendar.el][org-import-calendar.el]] which lets you do this.
2869 * Export
2870   :PROPERTIES:
2871   :CUSTOM_ID: Export
2872   :END:
2873 ** Can I get TODO items exported to HTML as lists, rather than as headlines?
2874    :PROPERTIES:
2875    :CUSTOM_ID: export-TODO-items-as-lists
2876    :END:
2878    If you plan to use ASCII or HTML export, make sure things you want to
2879    be exported as item lists are level 4 at least, even if that does
2880    mean there is a level jump.  For example:
2882    : * Todays top priorities
2883    : **** TODO write a letter to xyz
2884    : **** TODO Finish the paper
2885    : **** Pick up kids at the school
2887    Alternatively, if you need a specific value for the heading/item
2888    transition in a particular file, use the =#+OPTIONS= line to
2889    configure the H switch.
2891    : #+OPTIONS:   H:2; ...
2893 ** Can I export only a single subtree?
2894    :PROPERTIES:
2895    :CUSTOM_ID: export-single-subtree
2896    :END:
2898 If you want to export a subtree, mark the subtree as region and then
2899 export. Marking can be done with =C-c @ C-x C-x=, for example.
2901 Alternatively, you can select option =1= in the org export dispatcher
2902 (e.g.., =C-c C-e 1 h= to export the current subtree to html).
2904 By default, the title of the exported file will be set to the heading
2905 of the subtree. You can, however, [[#export-options-for-subtree][customize the title and other export
2906 options]].
2908 ** How can I customize export options for a single subtree?
2909    :PROPERTIES:
2910    :CUSTOM_ID: export-options-for-subtree
2911    :END:
2913 You can set unique export options for a [[#export-single-subtree][single subtree]] by using
2914 properties. Relevant properties include:
2916  - EXPORT_TITLE
2917  - EXPORT_AUTHOR
2918  - EXPORT_DATE
2919  - EXPORT_FILE_NAME
2920  - EXPORT_OPTIONS (corresponds to the =#+OPTIONS:= [[http://orgmode.org/manual/Export-options.html#Export-options][configuration line]])
2922 ** How can I tell my calendar web application about appointments in my agenda files?
2924 Here is what you need to do:
2926 1. a script that calls Emacs in batch mode and produce a .ics file
2927 2. a script that uploads this .ics file somewhere on the web
2928 3. tell your webapp to fetch this .ics file on the web
2930 Here is the script I use for the first step:
2932 #+begin_src shell-script-mode
2933 #!/bin/bash
2935 /usr/local/bin/emacs --batch --eval \
2936 "(progn (load-file \"~/install/git/org-mode/org.el\") \
2937         (load-file \"~/elisp/config/org-batch-config.el\") \
2938         (setq org-combined-agenda-icalendar-file \"~/org/cal/org.ics\")
2939         (setq org-agenda-files (quote (\"~/org/bzg.org\"))))" \
2940     -f org-export-icalendar-combine-agenda-files
2941 #+end_src
2943 Depending on your configuration, you might change the load sequence.
2945 Here is the script I use for the second step:
2947 #+begin_src shell-script-mode
2948 #!/bin/bash
2949 /usr/bin/rsync -rtv ~/org/org.ics -e ssh me@my_server:/home/me/public_html/
2950 #+end_src
2952 Note: if you want to cron this rsync script, you will need to let
2953 =my_server= to know about your SSH public key.  Check [[http://troy.jdmz.net/rsync/index.html][this page]] as a
2954 starter.
2956 Now you can cron the two scripts above and your webapp will always be
2957 up to date with your Org agendas.
2959 Also see [[http://orgmode.org/org.html#Exporting-Agenda-Views][Exporting agenda views]] from Org manual.
2961 ** How can I get Mac OSX 10.3 iCal to import my Org-exported .ics files?
2962    :PROPERTIES:
2963    :CUSTOM_ID: iCal-import-ics-files-old
2964    :END:
2966    When using iCal under Apple MacOS X Tiger, you can create a new
2967    calendar /OrgMode/ (the default name for the calendar created by =C-c
2968    C-e c=, see the variables =org-icalendar-combined-name= and
2969    =org-combined-agenda-icalendar-file=).  Then set Org-mode to
2970    overwrite the corresponding file /~/Library/Calendars/OrgMode.ics/.
2971    You may even use AppleScript to make iCal re-read the calendar files
2972    each time a new version of /OrgMode.ics/ is produced.  Here is the
2973    setup needed for this:
2975    : (setq org-combined-agenda-icalendar-file
2976    :     "~/Library/Calendars/OrgMode.ics")
2977    : (add-hook 'org-after-save-iCalendar-file-hook
2978    :  (lambda ()
2979    :   (shell-command
2980    :    "osascript -e 'tell application \"iCal\" to reload calendars'")))
2982 ** How can I get Mac OSX 10.4 or later iCal to import my Org-exported .ics files?
2983    :PROPERTIES:
2984    :CUSTOM_ID: iCal-import-ics-files-new
2985    :END:
2987    For Mac OS X 10.4, you need to write the ics file to
2988    =/Library/WebServer/Documents/= and then subscribe iCalendar to
2989    =http: //localhost/orgmode.ics=
2991 ** How can I remove timestamps and todo keywords from my exported file?
2992    :PROPERTIES:
2993    :CUSTOM_ID: export-options-remove-timestamps
2994    :END:
2996 You can place an options line at the top of your org file:
2998 : #+OPTIONS: <:nil todo:nil
3000 There is a whole host of export options you can set with an in-buffer
3001 options or via global variables. See [[http://orgmode.org/manual/Export-options.html#Export-options][this section]] of the manual for a
3002 full list.
3004 ** How can I preserve faces when I export an agenda from the command line?
3005    :PROPERTIES:
3006    :CUSTOM_ID: preserving-faces-during-batch-export
3007    :END:
3009 Normally, when you export an org file or an agenda view from within
3010 emacs, htmlize will convert your face definitions to direct color css
3011 styles inlined into each =<span>= object, resulting in an HTML output
3012 that preserves the general look of your Org buffers and agenda views.
3014 Let's say you generate an export from the command line, such as the
3015 following:
3017 : emacs -batch -l ~/.emacs -eval '(org-batch-agenda "e")'
3021 : emacs -batch -l ~/.emacs -eval '(org-publish-all)'
3023 In such an instance, the exported HTML will contain only very basic
3024 color styles. The reason is that when Emacs is run in batch mode, it
3025 does not have a display and therefore only rudimentary face
3026 definitions.  If you'd like to use more complex styles, you'll have to
3027 make sure that the export process only assigns classes instead of
3028 direct color values.  This can be done by binding the variable
3029 =org-export-htmlize-output-style= to =css= for the duration of the
3030 export, for example with
3032 : emacs -batch -l ~/.emacs
3033 :   -eval '(let ((org-export-htmlize-generate-css (quote css)))
3034 :            (org-batch-agenda "e"))'
3036 Then you can use a style file to make these classes look any way you
3037 like.  To generate face definitions for a CSS file based on any faces
3038 you are currently using in Emacs, you can use the following command:
3040 : M-x org-export-htmlize-generate-css RET
3042 This will generate a =<style>...</style>= section, the content of
3043 which you can add to your style file.
3045 ** How can I avoid dark color background when exporting agenda to ps format?
3046    :PROPERTIES:
3047    :CUSTOM_ID: avoiding-dark-background-when-exporting-agenda
3048    :END:
3050 Add this to your .emacs and evaluate it.
3052 #+BEGIN_SRC emacs-lisp
3053   (setq org-agenda-exporter-settings
3054         '((ps-print-color-p 'black-white)))
3055 #+END_SRC
3057 ** How can I include e.g. an abstract in export to Latex and HTML?
3058    :PROPERTIES:
3059    :CUSTOM_ID: include-abstract-in-export-to-latex-and-html
3060    :END:
3062 Org does not currently have special markup for abstracts, but for
3063 export purposes, you can extend the block-level structural and
3064 semantic markup in Org with the contributed package [[file:org-contrib/org-special-blocks.org][org-special-blocks]]
3065 (by Chris Gray). To turn it on, put this in your =.emacs=:
3067 : (require 'org-special-blocks)
3069 Now, you can mark up the abstract of your article like this:
3071 : #+BEGIN_ABSTRACT
3072 : Falling apples were observed and compared with pears. Newton's laws
3073 : were confirmed at the 95% confidence level.
3074 : #+END_ABSTRACT 
3076 Exporting to Latex wraps this in a
3077 =\begin{abstract}....\end{abstract}= environment, which just works.
3079 HTML export wraps it in a ~<div class="abstract">...</div>~
3080 element. The HTML result won't look like anything special until you
3081 style it. Here is some sample CSS to get you started; put these in
3082 your document header:
3084 : #+STYLE: <style>.abstract {margin: 1em; padding: 1em; border: 1px solid black}
3085 : #+STYLE: .abstract:before {content: "Abstract: "; font-weight: bold}</style>
3087 Generally, =#+begin_foo= will work for any simple Latex =foo=
3088 environment not supported by existing Org markup.
3090 If you need to pass parameters, process the block content in some way,
3091 or support other exporters, you may want to consider whether you can
3092 customize it using Eric Schulte's [[file:org-contrib/org-exp-blocks.org][org-exp-blocks]] instead.
3094 ** How can I get colored source code when exporting to LaTeX?
3095    :PROPERTIES:
3096    :CUSTOM_ID: fontified_source_code_w_latex
3097    :END:
3099 As of Sun Aug 9 2009 the "current" version of Org-mode (see
3100 [[keeping-current-with-Org-mode-development]]) supports exporting
3101 source code to LaTeX using the listings package.
3103 To turn on listing export add the following to your Org-mode
3104 customization.
3105 #+begin_src emacs-lisp
3106   ;; requite org-latex so that the following variables are defined
3107   (require 'org-latex)
3109   ;; tell org to use listings
3110   (setq org-export-latex-listings t)
3112   ;; you must include the listings package
3113   (add-to-list 'org-export-latex-packages-alist '("" "listings"))
3115   ;; if you want colored source code then you need to include the color package
3116   (add-to-list 'org-export-latex-packages-alist '("" "color"))
3117 #+end_src
3119 The listings package will now be used to fontify source code in your
3120 LaTeX documents.  By default listings will not color any of your
3121 source code.  If you would like to set colors for keywords and
3122 comments in your latex documents you can do so using LaTeX directives
3123 like the following.
3124 #+begin_src latex
3125   \lstset{keywordstyle=\color{blue},
3126     commentstyle=\color{red},
3127     stringstyle=\color{green}
3128   }
3129 #+end_src
3131 of if you want to get even fancier with your colors you can try
3132 something like the following
3133 #+begin_src latex
3134 \definecolor{keywords}{RGB}{255,0,90}
3135 \definecolor{comments}{RGB}{60,179,113}
3136 \definecolor{fore}{RGB}{249,242,215}
3137 \definecolor{back}{RGB}{51,51,51}
3138 \lstset{
3139   basicstyle=\color{fore},
3140   keywordstyle=\color{keywords},
3141   commentstyle=\color{comments},
3142   backgroundcolor=\color{back}
3144 #+end_src
3146 For more complex listings use cases consult the [[ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/listings/listings.pdf][listings manual]].
3148 ** How can I export to Latex Beamer
3149    :PROPERTIES:
3150    :CUSTOM_ID: beamer
3151    :END:
3152 The latex [[http://latex-beamer.sourceforge.net/][Beamer Class]] is a useful class for generating slide shows.
3153 The following can be used to export Org-mode documents to LaTeX
3154 beamer.
3156 Add the following to your Emacs initialization file.
3157 #+begin_src emacs-lisp
3158   (unless (boundp 'org-export-latex-classes)
3159     (setq org-export-latex-classes nil))
3160   (add-to-list 'org-export-latex-classes
3161                '("beamer"
3162                  "\\documentclass[11pt]{beamer}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{hyperref}\n\\usepackage{verbatim}\n"
3163                  ("\\section{%s}" . "\\section*{%s}")
3164                  ("\\begin{frame}\\frametitle{%s}" "\\end{frame}"
3165                   "\\begin{frame}\\frametitle{%s}" "\\end{frame}")))
3166 #+end_src
3168 Then by placing
3169 : #+LaTeX_CLASS: beamer
3170 in the header of your Org-mode document it will automatically export
3171 to the Beamer document class on LaTeX export.  With the above
3172 configuration top-level headers will be mapped to sections in the
3173 Beamer document, second-level headers will be mapped to frames, and
3174 lower level headlines will be mapped to itemize objects.
3176 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
3177 Thomas Dye]].  For a much more complex Beamer setup see the [[http://article.gmane.org/gmane.emacs.orgmode/17767/match=beamer+dokos][email by
3178 Thomas Dye]].
3180 ** How can I use RefTeX in Org-mode files for LaTeX export and in Org-babel LaTeX code blocks?
3181    :PROPERTIES:
3182    :CUSTOM_ID: using-reftex-in-org-mode
3183    :END:
3185 [[http://www.gnu.org/software/auctex/reftex.html][RefTeX]] is an indispensable tool for the author of LaTeX documents.  It
3186 aids in creation of bibliographies, cross-references, indexes, and
3187 glossaries.  RefTeX understands the structure of multi-file LaTeX
3188 documents and is able to collect from them information about the
3189 location(s) of external data stores used in creation of the final
3190 document.  RefTeX was written by Carsten Dominik and is currently
3191 being maintained by the [[http://www.gnu.org/software/auctex/index.html][AucTeX]] project.
3193 *** Using RefTeX In Org-mode Files for LaTeX Export
3194 In Org-mode files for LaTeX export, the trick is to find a way to tell
3195 RefTeX the locations of external data stores.  One way is to set the
3196 variable, =reftex-default-bibliography=.  Add lines like these to
3197 .emacs:
3199 #+begin_src emacs-lisp
3200   (setq reftex-default-bibliography
3201         (quote
3202          ("default.bib" "other-default.bib")))
3203 #+end_src
3205 In practice, this is a limited solution and the
3206 typical user will want to pass this information on a per-file basis.
3207 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
3208 Braindump]].
3210 The first solution, proposed by Mario, enables the RefTeX citation
3211 function in Org-mode.  Add these lines to .emacs:
3213 #+begin_src emacs-lisp
3214   (defun org-mode-reftex-setup ()
3215     (load-library "reftex")
3216     (and (buffer-file-name)
3217          (file-exists-p (buffer-file-name))
3218          (reftex-parse-all))
3219     (define-key org-mode-map (kbd "C-c )") 'reftex-citation))
3220   (add-hook 'org-mode-hook 'org-mode-reftex-setup)
3221 #+end_src
3223 Then add the following lines anywhere in the Org-mode file (Org-mode
3224 will recognize them as LaTeX commands):
3226 #+begin_src org
3227 \bibliographystyle{plain}
3228 \bibliography{BIB-NAME}
3229 #+end_src
3231 With this setup, =C-c )= will invoke =reftex-citation= which will
3232 insert a reference in the usual way:
3234 #+begin_src org
3235   ,* test reftex
3237   ,This is a citation \cite{tierney90}.
3239   ,\bibliographystyle{plain}
3240   ,\bibliography{tsd}
3241 #+end_src
3243 This Org-mode file will export the following LaTeX output:
3245 #+begin_src latex :exports code
3246   % Created 2010-03-22 Mon 14:34
3247   \documentclass[11pt,letter]{article}
3248   \usepackage[utf8]{inputenc}
3249   \usepackage[T1]{fontenc}
3250   \usepackage{hyperref}
3252   \title{test.org}
3253   \author{Tom Dye}
3254   \date{2010-03-22 Mon}
3256   \begin{document}
3258   \maketitle
3260   \setcounter{tocdepth}{3}
3261   \tableofcontents
3262   \vspace*{1cm}
3264   \section{test reftex}
3265   \label{sec-1}
3268   This is a citation \cite{tierney90}.
3270   \bibliographystyle{plain}
3271   \bibliography{tsd}
3273   \end{document}
3274 #+end_src
3277 A second solution, to activate the RefTeX minor mode on a per-file
3278 basis, was posted by Kevin Brubeck Unhammer in response to this idea.
3279 Add the following lines to .emacs:
3281 #+begin_src emacs-lisp
3282   (add-hook ‘org-mode-hook
3283              (lambda ()
3284                (if (member “WRITE” org-todo-keywords-1)
3285                    (org-mode-article-modes))))
3286 #+end_src
3288 where =org-mode-article-modes= is defined as follows:
3290 #+begin_src emacs-lisp
3291   (defun org-mode-article-modes ()
3292     (reftex-mode t)
3293     (bib-cite-minor-mode t)
3294     (and (buffer-file-name)
3295          (file-exists-p (buffer-file-name))
3296          (reftex-parse-all)))
3297 #+end_src
3299 Add the =\bibliographystyle{}= and =\bibliography{}= lines to the
3300 Org-mode file as before and define a TODO keyword, =WRITE=, perhaps
3301 like this:
3303 #+begin_src org
3304   ,#+TODO: TODO(t) STARTED(s) WRITE | DONE(d) DEFERRED(f)
3305 #+end_src
3307 With this setup, you insert a citation with =M-x reftex-citation RET=.
3309 *** Using RefTeX in Org-babel LaTeX Code Blocks
3311 In Org-babel LaTeX code blocks, the trick is to give RefTeX access to
3312 information in other Org-babel LaTeX code blocks.  If you use an Emacs
3313 starter kit where configuration information is held in Org-mode files,
3314 then the second solution is preferable because you won't be asked for
3315 a master file when Emacs is started.  For this reason, the second
3316 solution is modified for use with Org-babel latex code blocks.  No
3317 key-binding is needed here because Org-babel code blocks are edited
3318 within the usual AucTeX environment.
3320 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]])
3321 #+begin_src emacs-lisp
3322   (defun org-mode-article-modes ()
3323     (reftex-mode t)
3324     (and (buffer-file-name)
3325          (file-exists-p (buffer-file-name))
3326          (reftex-parse-all)))
3328   (add-hook 'org-mode-hook
3329             (lambda ()
3330               (if (member "REFTEX" org-todo-keywords-1)
3331                   (org-mode-article-modes))))
3332 #+end_src
3334 Then add a line like the following line to the top of your org-mode file:
3336 #+begin_src org
3337   ,#+TODO: TODO(t) STARTED(s) | DONE(d) DEFERRED(f) REFTEX
3338 #+end_src
3340 When you open an org-mode file with a line like this, RefTeX will
3341 prompt for the master .tex file, which will be parsed in the usual
3342 way.  This means that the .tex file should already exist, perhaps by
3343 tangling the LaTeX preamble and postamble, before
3344 =org-mode-article-modes= is activated for the Org-mode file.
3346 ** How can I use XeLaTeX for LaTeX export instead of pdfLaTeX?
3347    :PROPERTIES:
3348    :CUSTOM_ID: using-xelatex-for-pdf-export
3349    :END:
3350 [[http://en.wikipedia.org/wiki/XeTeX][ XeLaTeX]] is an alternative to pdfLaTeX for typesetting LaTeX
3351 documents. XeTeX can use any fonts installed in the operating system
3352 without configuring TeX font metrics, and can make direct use of
3353 advanced typographic features of OpenType and other font formats. By
3354 default, org-mode exports =org= files to =pdf= via pdfLaTeX. 
3356 Here is one way to smoothly incorporate XeLaTeX into org-mode's export
3357 process. This solution takes advantage of [[http://www.phys.psu.edu/~collins/software/latexmk-jcc][latexmk]], a perl script that
3358 intelligently and automatically manages latex compilation. It
3359 is included with TeXLive, but at present the version included is not
3360 quite up-to-date enough for our needs. Version 4.20 and higher
3361 includes an option allowing you to specify which program to use when
3362 "pdflatex" is called. Install a current version of latexmk as per the
3363 instructions on the [[http://www.phys.psu.edu/~collins/software/latexmk-jcc][latexmk]] site. If necessary, disable the older
3364 version that comes with TeXLive. This is likely in =/usr/texbin/=, and
3365 you should rename or remove it. Then you can put the following in your
3366 =~/.emacs.d/= or equivalent:
3368 #+begin_src emacs-lisp
3369   (require 'org-latex)
3370   (setq org-export-latex-listings t)
3371   
3372   ;; Originally taken from Bruno Tavernier: http://thread.gmane.org/gmane.emacs.orgmode/31150/focus=31432
3373   ;; but adapted to use latexmk 4.20 or higher.  
3374   (defun my-auto-tex-cmd ()
3375     "When exporting from .org with latex, automatically run latex,
3376        pdflatex, or xelatex as appropriate, using latexmk."
3377     (let ((texcmd)))
3378     ;; default command: oldstyle latex via dvi
3379     (setq texcmd "latexmk -dvi -pdfps -quiet %f")        
3380     ;; pdflatex -> .pdf
3381     (if (string-match "LATEX_CMD: pdflatex" (buffer-string))
3382         (setq texcmd "latexmk -pdf -quiet %f"))
3383     ;; xelatex -> .pdf
3384     (if (string-match "LATEX_CMD: xelatex" (buffer-string))
3385         (setq texcmd "latexmk -pdflatex=xelatex -pdf -quiet %f"))
3386     ;; LaTeX compilation command
3387     (setq org-latex-to-pdf-process (list texcmd)))
3388   
3389   (add-hook 'org-export-latex-after-initial-vars-hook 'my-auto-tex-cmd)
3390   
3391   
3392   ;; Specify default packages to be included in every tex file, whether pdflatex or xelatex
3393   (setq org-export-latex-packages-alist
3394         '(("" "graphicx" t)
3395               ("" "longtable" nil)
3396               ("" "float" nil)))
3397     
3398   (defun my-auto-tex-parameters ()
3399         "Automatically select the tex packages to include."
3400         ;; default packages for ordinary latex or pdflatex export
3401         (setq org-export-latex-default-packages-alist
3402               '(("AUTO" "inputenc" t)
3403                 ("T1"   "fontenc"   t)
3404                 (""     "fixltx2e"  nil)
3405                 (""     "wrapfig"   nil)
3406                 (""     "soul"      t)
3407                 (""     "textcomp"  t)
3408                 (""     "marvosym"  t)
3409                 (""     "wasysym"   t)
3410                 (""     "latexsym"  t)
3411                 (""     "amssymb"   t)
3412                 (""     "hyperref"  nil)))
3413     
3414         ;; Packages to include when xelatex is used
3415         (if (string-match "LATEX_CMD: xelatex" (buffer-string))
3416             (setq org-export-latex-default-packages-alist
3417                   '(("" "fontspec" t)
3418                     ("" "xunicode" t)
3419                     ("" "url" t)
3420                     ("" "rotating" t)
3421                     ("american" "babel" t)
3422                     ("babel" "csquotes" t)
3423                     ("" "soul" t)
3424                     ("xetex" "hyperref" nil)
3425                     )))
3426         
3427         (if (string-match "LATEX_CMD: xelatex" (buffer-string))
3428             (setq org-export-latex-classes
3429                   (cons '("article"
3430                           "\\documentclass[11pt,article,oneside]{memoir}"
3431                           ("\\section{%s}" . "\\section*{%s}")
3432                           ("\\subsection{%s}" . "\\subsection*{%s}")
3433                           ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
3434                           ("\\paragraph{%s}" . "\\paragraph*{%s}")
3435                           ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
3436                         org-export-latex-classes))))  
3437       
3438   (add-hook 'org-export-latex-after-initial-vars-hook 'my-auto-tex-parameters)  
3439 #+end_src
3441 The =my-auto-tex-cmd= function looks at your =.org= file and checks
3442 whether you've specified which latex to use. If there are no
3443 instructions, it just runs regular old latex. If it finds the string
3444 =LATEX_CMD: pdflatex= in your file, it runs pdflatex. If it finds
3445 =LATEX_CMD: xelatex=, it runs xelatex. Because control is handed off
3446 to latexmk, nothing else is needed: it takes care of figuring things
3447 out so that the references and citations are correct.
3449 The second half of the code above specifies the latex packages that
3450 will be included in the =.tex= file. The variable
3451 =org-export-latex-packages-alist= specifies a list of packages that
3452 are always included in the header of latex documents, regardless of
3453 how they are compiled. The variable
3454 =org-export-latex-default-packages-alist= adds additional packages
3455 depending on whether latex/pdflatex or xelatex is being used. You can
3456 change the content of these as needed. 
3458 Finally, the =org-export-latex-classes= variable redefines elements of
3459 the =.tex= file's preamble for the xelatex case. These can also be
3460 customized as needed. 
3462 By way of example, an =.org= file you want compiled with xelatex might
3463 contain the following header:
3465 : #+TITLE: My Paper
3466 : #+AUTHOR: Jane Doe
3467 : #+DATE: 
3468 : #+OPTIONS: toc:nil num:nil
3469 : #+LATEX_CMD: xelatex
3470 : #+LATEX_HEADER: \setsansfont[Mapping=tex-text]{Unit-Bold} 
3471 : #+LATEX_HEADER: \setmonofont[Mapping=tex-text,Scale=MatchLowercase]{PragmataPro} 
3472 : #+LATEX_HEADER: \setromanfont[Mapping=tex-text,Numbers=OldStyle]{Minion Pro}
3474 If you always want to have the same font setup in your xelatex
3475 documents, the =fontspec= commands setting the font choices can be
3476 put in the =org-export-latex-classes= setting instead.
3478 The upshot is that when you want to export an =.org= file using
3479 XeLaTeX, you can now simply make sure the line =LATEX_CMD: xelatex= is
3480 in your =.org= file, then do =C-c C-e d= as usual, and org-mode, with
3481 latexmk in the background, does the rest for you.
3483 ** Why is my exported PDF file almost unreadable?
3484    :PROPERTIES:
3485    :CUSTOM_ID: unreadable-pdfs
3486    :END:
3488 Some PDF viewers (earlier versions (< v6) of Acrobat Reader, Evince,
3489 possibly others) do not get along with Adobe Type3 fonts, producing
3490 almost unreadable screen output (printed output is OK). If you see
3491 this, first verify the fonts that your document uses: open it with
3492 Acrobat Reader or Evince, select "Properties" from the "File" menu and
3493 click on the "Fonts" tab; alternatively, you can use the pdffonts
3494 program (part of the xpdf-reader package) from the command line.  If
3495 that is indeed the problem, then either use a different viewer or
3496 install Type1 versions of the problematic fonts. For more details, see
3497 the "PDF export" section of [[./org-dependencies.org][org-dependencies]].
3499 ** Can I add attributes to a link or an image in HTML export?
3500    :PROPERTIES:
3501    :CUSTOM_ID: html-image-and-link-attributes
3502    :END:
3504 Yes.  Excerpt from [[http://orgmode.org/manual/Images-in-HTML-export.html#Images-in-HTML-export][Org's manual]]:
3506 If you need to add attributes to an inlined image, use a `#+ATTR_HTML'.
3507 In the example below we specify the `alt' and `title' attributes to
3508 support text viewers and accessibility, and align it to the right.
3510 :  #+CAPTION: A black cat stalking a spider
3511 :  #+ATTR_HTML: alt="cat/spider image" title="Action!" align="right"
3512 :  [[./img/a.jpg]]
3514 and you could use `http' addresses just as well.
3516 ** How can I export an org file to rtf, odt (Open Office), or doc (Word)?
3517    :PROPERTIES:
3518    :CUSTOM_ID: convert-to-open-office
3519    :END:
3521 There are two approaches:
3522 - Use the development version of Org->Odt exporter
3524   A native Org to OpenDocumentText exporter is in the works. The
3525   exporter is currently not part of Orgmode repository.  See the
3526   following [[http://lists.gnu.org/archive/html/emacs-orgmode/2011-01/msg01210.html][Announcement]] on the mailing list for further details.
3527   
3528   At the moment, the exporter supports the following most commonly
3529   used features of Org
3530   - Various Character Styles
3531   - Various Paragraph Styles (including Source Blocks)
3532   - Embedded ODT
3533   - Embedded MathML
3534   - Numbered, Bulleted and Description lists
3535   - Embedding and Resizing of Images including embedding of LaTeX
3536     fragments
3537   - Fuzzy, Dedicated and Radio Targets and Links
3538   - Tables
3539   - Footnotes
3540   - Special markups for elements like TODOs, Timestamps and Tags
3543 - Use existing exporters 
3545   Export to one of org-mode's supported export formats and then use an
3546   external tool or method to convert the exported file to doc or odt.
3548   With simple documents, these methods work well. However for complex
3549   documents containing footnotes, embedded images, math formuale etc
3550   the results may be less than satisfactory. (Note, the lists below
3551   are by no means comprehensive).
3552   1. html -> odt/doc/rtf
3553      - open html in Open Office and save as odt/doc ([[http://permalink.gmane.org/gmane.emacs.orgmode/31482][see this post by
3554         Eric Fraga]])
3555      - [[http://www.artofsolving.com/opensource/pyodconverter][PyODConverter]]
3556      - [[http://johnmacfarlane.net/pandoc/][Pandoc]] (this works for LaTeX and docbook as well)
3557      - (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
3558         from html to doc
3559   2. LaTeX -> odt/doc/rtf
3560       - [[http://latex2rtf.sourceforge.net/][LaTeX2rtf]] (works well with index, footnotes, and references)
3561       - [[http://www.tug.org/tex4ht/][TeX4ht]] (works with more complex latex elements, though can be
3562         difficult to install)
3563         - run =mk4ht oolatex file.tex=
3565 See [[http://permalink.gmane.org/gmane.emacs.orgmode/31168][this thread]] for further details.
3567 * Backup
3569 Since =org= files are so central to your life, you probably want to back
3570 them up in a safe place.
3572 If the =org= file you want to back up are in a single directory, the
3573 preferred method is to us a =RCS= (Revision Control System) -- pick up your
3574 favorite ([[http://git-scm.com/][git]], [[http://bazaar.canonical.com/en/][bazaar]], [[http://mercurial.selenic.com/][mercurial]], [[http://subversion.apache.org/][subversion]], [[http://www.nongnu.org/cvs/][cvs]], etc.).  Depending on the
3575 RCS you use and how you use it, you can have a /local/ backup or sync it on
3576 a remote place.
3578 If you want to store all your =org= files from your =$HOME= to a single
3579 =~/org/backup/= folder, you can use this shell script (as [[http://article.gmane.org/gmane.emacs.orgmode/37655][suggested by
3580 Suvayu Ali]]):
3582 #+begin_src sh
3583 mkdir -p ~/org/backup && \
3584 find $HOME -type f -name '*\.org' ! -path "$HOME/org/*" \
3585      -exec cp -t ~/org/backup/ \{\} \;
3586 #+end_src
3588 It will recursively search for =org= files in your =$HOME= directory
3589 (except those in =~/org/backup/=) and copy them to =~/org/backup/=.
3590 You can then use rsync to make sure =~/org/backup/= also lives on a 
3591 remote and safe place.
3593 * MobileOrg
3595 ** Which versions of MobileOrg do exist
3596    :PROPERTIES:
3597    :CUSTOM_ID: mobileorg_versions
3598    :END:
3600 - MobileOrg for the iPhone/iPod Touch/iPad series of devices, by
3601   Richard Moreland.  Check out
3602   [[http://mobileorg.ncogni.to/][Richard's page]]
3603 - Matt Jones is developing a feature-equivalent application for
3604   Android, see
3605   [[http://wiki.github.com/matburt/mobileorg-android/][his project page]].
3607 ** What can I do if I don't want to use Dropbox.com
3608    :PROPERTIES:
3609    :CUSTOM_ID: mobileorg_webdav
3610    :END:
3612 Dropbox.com is the easiest way to connect between Emacs and MobileOrg,
3613 you can get a free account there.  If for some reason you cannot or do
3614 not want to use this path, you can use any webdav server.  On this
3615 webdav server you need to create a dedicated directory for the
3616 communication between Emacs and MobileOrg.  If you can mount that
3617 directory locally so that Emacs can directly write to it, just point
3618 to that directory using the variable =org-mobile-directory=.  Using
3619 the /tramp/ method, =org-mobile-directory= may point to a remote
3620 directory accessible through, for example, /ssh/ and /scp/:
3622 #+begin_src emacs-lisp
3623 (setq org-mobile-directory "/scpc:user@@remote.host:org/webdav/")
3624 #+end_src
3626 If Emacs cannot access the WebDAV directory directly using a /tramp/
3627 method, you can use a local directory for staging.  Other means must
3628 then be used to keep this directory in sync with the WebDAV directory.
3629 In the following example, files are staged in =~/stage/=, and Org-mode
3630 hooks take care of moving files to and from the WebDAV directory using
3631 /scp/.
3633 #+begin_src emacs-lisp
3634 (setq org-mobile-directory "~/stage/")
3635 (add-hook 'org-mobile-post-push-hook
3636   (lambda () (shell-command "scp -r ~/stage/* user@@wdhost:mobile/")))
3637 (add-hook 'org-mobile-pre-pull-hook
3638   (lambda () (shell-command "scp user@@wdhost:mobile/mobileorg.org ~/stage/ ")))
3639 (add-hook 'org-mobile-post-pull-hook
3640   (lambda () (shell-command "scp ~/stage/mobileorg.org user@@wdhost:mobile/")))
3641 #+end_src
3643 * Mathjax
3645 ** How to install MathJax on my server?
3646    
3647 :PROPERTIES:
3648 :CUSTOM_ID: install_mathjax_on_server
3649 :END:
3651 Org uses MathJax as its default HTML display engine for equations.
3653 Org relies on the version of MathJax available from orgmode.org, but you
3654 might want to use another version and install MathJax on your own server.
3656 1. Download a [[http://sourceforge.net/projects/mathjax/files/][MathJax archive]].
3658 2. Upload it somewhere on your server (say http://me.org/mathjax/)
3660 3. Set the correct path in =org-export-html-mathjax-options= (i.e. replace
3661    http://orgmode.org/mathjax/MathJax.js by
3662    http://me.org/mathjax/MathJax.js)
3664 You can also get [[http://www.mathjax.org/resources/docs/?installation.html][MathJax from git or svn]] -- in this case, be careful not to
3665 forget to unzip the fonts.zip archive in the mathjax directory.
3667 * COMMENT Function to create =CUSTOM_ID=
3669 #+begin_src emacs-lisp
3670   (defun org-faq-make-target ()
3671     "Make hard target for current headline."
3672     (interactive)
3673     (if (not (org-on-heading-p))
3674         (error "Not on a headline"))
3675     (let ((h (org-trim (org-get-heading 'no-tags))))
3676       (if (string-match "[ \t]*\\?\\'" h)
3677           (setq h (replace-match "" t t h)))
3678       (while (string-match "[ \t]+" h)
3679         (setq h (replace-match "-" t t h)))
3680       (org-entry-put nil "CUSTOM_ID" h)))
3681 #+end_src