Add Giovanni Ridolfi to the list of Org contributors.
[Worg.git] / org-faq.org
blob5c22f219cb1a85585f34a6ec9e42ce01d25646b5
1 #+EMAIL:     mdl AT imapmail DOT org
2 #+AUTHOR:    Worg people
3 #+LANGUAGE:  en
4 #+TITLE:     Org-mode Frequently Asked Questions
5 #+OPTIONS:   toc:t H:2
7 [[file:index.org][{Back to Worg's index}]]
9 * What is org-mode?
10   :PROPERTIES:
11   :CUSTOM_ID: What-is-org-mode
12   :END:
13 ** Can Org-mode do "x"? Does org have "x" feature?
14    :PROPERTIES:
15    :CUSTOM_ID: can-org-do-x
16    :END:
18 In its default setup, Org-mode offers a simple outlining and task
19 management environment. But it also has a huge number of features and
20 settings "under the hood." Advanced users have configured Org-mode for
21 almost every conceivable use scenario.
23 Org-mode has a very active community and rich and extensive
24 documentation. Before emailing the mailing list to ask whether
25 Org-mode has a particular feature or setting, please consult the
26 following:
28  - Read/search the manual.
30    - http://orgmode.org/manual/index.html
32      - Make sure to check out the following indexes:
34        - [[http://orgmode.org/manual/Main-Index.html#Main-Index][Main Index]]
35        - [[http://orgmode.org/manual/Key-Index.html#Key-Index][Key Index]]
36        - [[http://orgmode.org/manual/Variable-Index.html#Variable-Index][Variable Index]]
38    - The manual is also easily available from within emacs.
40      To read the manual within emacs, you can evaluate =(info
41      "(org)")= within emacs---i.e., type =C-x C-e= after the closing
42      paragraph of the info expression above.
44      You can also type =M-x info= and navigate to "Org Mode".
46      You can search the entire manual by typing ~C-s term~. Keep
47      pressing ~C-s~ to cycle through the results
49  - Search the [[http://dir.gmane.org/gmane.emacs.orgmode][mailing list archives]].
51    There is a good chance that the feature you are looking for has
52    already been discussed (most likely several times).
54  - Check for features from within emacs.
56    - Emacs has a wonderful built-in help system.
58    - You can browse (and change) most customization options by typing
59      =M-x org-customize=.
61    - You can check for a feature by typing =M-x apropos [RET] [word]= or
62      =C-h a word=. This will search for all functions and variables
63      matching the term (or regexp) you enter.
65    - You can browse (and search for) org functions, variables, and
66      faces by using =M-x describe-variable= (=C-h v=), =M-x
67      describe-function= (=C-h f=), or =M-x describe-face=.
69      After invoking one of these commands, simply type =org-[TAB]= to
70      see a full list of relevant functions or variables or faces. You
71      can then drill down further: e.g., =org-export-[TAB]= for export
72      features.
74  - Checkout the [[file:org-tutorials/index.org][tutorials on Worg]].
76    Several of these tutorials discuss advanced features (e.g.,
77    searching, custom agenda commands, tables, publishing) of Org-mode
78    in depth.
80    There are many other resources on Worg as well:
82    - [[http://orgmode.org/worg/org-configs/index.html][Org Customization]] :: Includes a guide for beginners.
84    - [[http://orgmode.org/worg/org-hacks.html][Org Hacks]] :: User-generated modifications and add-ons.
86    - [[http://orgmode.org/worg/org-glossary.html][Org Glossary]] :: An explanation of basic Org-mode terms and
87                      concepts.
89 ** Can I implement a GTD workflow with Org-mode?
90    :PROPERTIES:
91    :CUSTOM_ID: GTD-workflow-with-Org-mode
92    :END:
94    Yes, you can.  Check for discussions and pointers [[http://orgmode.org/worg/org-gtd-etc.html][here]].
96 ** What is the difference between Org and TaskPaper?
97    :PROPERTIES:
98    :CUSTOM_ID: Org-and-TaskPaper
99    :END:
101   There is really no difference.  Org is as /simple/ as [[http://hogbaysoftware.com/products/taskpaper][TaskPaper]].  It
102   is just that, when using Org within Emacs, it lets you do many things
103   that you wouldn't be able to do with TaskPaper.  Yes, TaskPaper is
104   fiddle-proof and people using Emacs tends to like fiddling (which is
105   orthogonal to the idea of using todo-list efficiently), but this is
106   just a matter of discipline and common sense, not one of Org's design.
108   Read [[http://article.gmane.org/gmane.emacs.orgmode/6224][Carsten's enlightening statement]] on this.
109 ** What is the meaning of the Unicorn on Org's website?
110    :PROPERTIES:
111    :CUSTOM_ID: unicorn
112    :END:
114 The Unicorn is the logo of Org-mode because:
116 - Org-mode is the UNICs of ORgaNizers.
118 - Org-mode is an Emacs mode, so it makes sense to use an animal
119   similar or related to the gnu used for GNU Emacs.
121 - Org-mode is meant to show you the way, and an animal with two horns
122   can not do this very well, can it?
124 - Unicorn tears are said to reverse petrification, and wasn't this how
125   we all felt before getting to some degree of time and task
126   management?
128 - It will take forever to learn everything there is to know about a
129   unicorn.
131 - A unicorn is a fabulous creature.  Org-mode wants to be a fabulous
132   creation.
134 Using a unicorn was originally /Bastien Guerry's/ idea.  His friend,
135 the french artist [[http://intemperies.over-blog.com/][Christophe Bataillon]], designed the logo for us, and
136 /Greg Newman/ gave it a refresh some time later.  Bastien writes why
137 he chose a unicorn:
139 #+BEGIN_QUOTE
140 The first reason is not linked to the animal, but to the sounding of the
141 word "Unicorn" - because Org gives you a /uni/que way of producing files
142 in several format (HTML, LaTeX, etc.)
144 The second reason is that a Unicorn doesn't really exist, it is just
145 something you can dream about, and make others believe it does exist.
146 Just like the perfect organizer.
147 #+END_QUOTE
149 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
150 Suckling]] posted a link showing how to make a simple foldable unicorn
151 (very appropriate for an outlining program!).
153 [[http://article.gmane.org/gmane.emacs.orgmode/11735][Tim Burt]] made a very complicated one which is now a treasured
154 possession of the Org-mode author.
156 - Official logo: [[http://orgmode.org/img/org-mode-unicorn.png]]
157   This logo is available in a number of different formats including
158   Photoshop /.psd/ and scaleable vector graphics /.svg/ [[http://orgmode.org/img/][here]].
160 - An [[http://orgmode.org/img/nrocinu4.jpg][alternative version]] from Christophe Bataillon (c):
162 - [[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]]:
164 - [[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
165   threshold technique".
167 - [[http://article.gmane.org/gmane.emacs.orgmode/11735/match%3D][Tim Burt]] made a folded Unicorn to match the spirit of Org - see the
168   whole set of pictures [[http://www.flickr.com/photos/tcburt/sets/72157614543357071/][on his flickr page]].
170 - Are unicorns real?  Answer [[http://article.gmane.org/gmane.emacs.orgmode/11687/match%3Drosslaird%2Bunicorn][here]] by Ross Laird.
172 ** Is Org's documentation written in Org?
174 No.  Org's documentation is written in TeXinfo, which is the standard
175 format for Emacs documentation.  There is no export mechanism from Org
176 to TeXinfo (yet).
177 * Mailing list
178 ** I think my Org-mode is broken! How do I report a bug?
179    :PROPERTIES:
180    :CUSTOM_ID: bug-reporting
181    :END:
183  1. Make sure you are running [[#updating-org][the latest version of Org-mode]].
185  2. Read [[http://orgmode.org/manual/Feedback.html][this section]] of the manual.
187  3. Provide a minimal example that duplicates the bug.
189     - Create a minimal .emacs file and start emacs with that file as
190       detailed in [[#minimal-emacs][these instructions]].
192     - Create a sample, minimal .org file that reliably reproduces the
193       problem and post it to the mailing list.
195       - Some users call this an "[[#ecm][ECM]]", a French acronym that means a
196         "complete minimal example".
198 ** What is an "ECM"?
199    :PROPERTIES:
200    :CUSTOM_ID: ecm
201    :END:
203 This is a French acronym used by some mailing list members; it stands
204 for "Exemple Complet Minimal", or "Complete Minimal Example". The term
205 refers to test files that can reliably reproduce a bug with the
206 minimal amount of code. When you report a bug to the mailing list, you
207 should provide a minimal .org file (with no more text than necessary)
208 that demonstrates the bug. See [[http://permalink.gmane.org/gmane.emacs.orgmode/41281][this post]] for more information.
210 ** What should I do before contacting the mailing list?
211    :PROPERTIES:
212    :CUSTOM_ID: when-to-contact-mailing-list
213    :END:
215    The Org-mode mailing list is a high volume list, in which community
216    members discuss use cases, configuration, bugs, and developments.
218    If you are new to Org-mode, please read/search the excellent [[http://orgmode.org/manual/index.html][manual]]
219    (and pay special attention to the indexes) before asking your
220    question.
222    You should also [[http://dir.gmane.org/gmane.emacs.orgmode][search the mailing list]] to see if your issue has
223    already been discussed.
225    See [[#can-org-do-x][this faq]] for more details.
227 ** Why hasn't my email to the mailing list shown up yet?
228    :PROPERTIES:
229    :CUSTOM_ID: ml-post-delay
230    :END:
232 The org-mode mailing list is moderated. Thus, if you are not
233 subscribed to the mailing list, your mail will only appear on the list
234 after it has been approved by a moderator. To ensure that your mail
235 appears quickly, please [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe to the list]].
237 ** I read the mailing list through gmane. Should I subscribe?
238    :PROPERTIES:
239    :CUSTOM_ID: ml-subscription-and-gmane
240    :END:
242 The org-mode mailing list is available via nntp at [[http://dir.gmane.org/gmane.emacs.orgmode][Gmane]]. Many
243 participants in the list prefer read the list in a newsreader, such as
244 Gnus, instead of receiving emails. If you choose to read the list via
245 nntp, you can still [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe]] to the list and then opt not to receive
246 any emails on the mailman settings page (see the "Mail Delivery"
247 setting).
249 This will ensure that your messages to the list get through quickly,
250 reduce the work load of the mailing list moderators (who need to clear
251 every mail from non-members), and provide more accurate information
252 about the number of list readers.
254 * Keeping current
255   :PROPERTIES:
256   :CUSTOM_ID: Keeping-current
257   :END:
258 ** My Emacs ships with an older version Org-mode! How do I upgrade?
259    :PROPERTIES:
260    :CUSTOM_ID: updating-org
261    :END:
263 Org-mode develops quickly, which means that versions of Org-mode
264 shipped with Emacs are more or less out-of-date. If you'd like to
265 upgrade to the most recent version of org-mode, you have a number of
266 options.
268  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
269     follow the [[http://orgmode.org/manual/Installation.html#Installation][installation instructions]] in the manual.
270  2. Clone and install the development git repository as [[#keeping-current-with-Org-mode-development][explained
271     here]]. If you don't want to run the bleeding edge, you can still
272     use git [[#using-stable-releases-only][to track the most recent stable releases]].
273  3. Install and updated org-mode automatically through the Emacs
274     Package Manager as [[#installing-via-elpa][explained in this FAQ]].
276 ** How do I keep current with bleeding edge development?
277    :PROPERTIES:
278    :CUSTOM_ID: keeping-current-with-Org-mode-development
279    :END:
281    Org mode is developed in [[http://en.wikipedia.org/wiki/Git_(software)][Git]]. You can keep up-to-date with Org-mode
282    developement by cloning Org mode repository and refreshing your
283    copy with latest changes whenever you wish. You only need to use
284    two Git commands (clone and pull.) Here are the steps in brief
285    (please customize locations to suit your setup):
287    1. Select a location to house the Org mode repository (approx. 40
288       MB; includes documentation, compiled elisp files and history
289       going all the way back to v4.12a)
291       : $ mkdir $HOME/elisp && cd $HOME/elisp
293    2. Clone the Org mode Git repository.
295       Recommended approach:
297       : $ git clone git://orgmode.org/org-mode.git
299       You can also clone from this mirror (lagging one hour behind
300       orgmode.org repo):
302       : $ git clone git://repo.or.cz/org-mode.git
304       For those of you behind a firewall that allows only HTTP, you can
305       clone like this (can be somewhat slow), either from orgmode.org or
306       from repo.or.cz:
308       : $ git clone http://orgmode.org/org-mode.git
309       : $ git clone http://repo.or.cz/r/org-mode.git
311    3. Compile and install Org mode and build documentation.
313       : $ cd org-mode && make && make doc && make install
315       Please note that you can choose to /not/ compile at all and run
316       using source =.el= files only.  Compiled files speed things up.
318       Also note that running =make install= is necessary only if you'd
319       like to install org-mode system-wide.
321    4. This is where you configure Org mode with Emacs.  Please refer
322       to [[./org-tutorials/index.org][Org tutorials]].
324    5. Keeping up-to-date.
326       Cloning the repository is a one time activity.  From this point
327       onwards you only need to /pull/ the latest changes.
329       : $ cd $HOME/elisp/org-mode
331       and then
333       : $ git pull && make clean && make && make doc && make install
335    6. You should restart org mode to have the changes take effect (if
336       you are not rebooting Emacs.)  Also since the intention is to
337       "keep up" with Org mode, you should visit updated sections of
338       documentation for latest updates (use =git log=.)
340    7. As you use your repository over time it will accumulate loose objects.
341       You can reduce the total size of your git repository with
343       : $ git gc
345       which will consolidate loose git objects into pack files.  This
346       reduces the size of the repository and speeds up data access to
347       the objects.
349 ** How can I keep local changes and still track Org mode development?
350    :PROPERTIES:
351    :CUSTOM_ID: keeping-local-changes-current-with-Org-mode-development
352    :END:
354   Say you want to make minor changes to the Makefile to reflect your
355   location for =emacs=.
357   Create a local branch for your changes on top of origin/master as
358   follows:
360   : $ git checkout -b local origin/master
361   : $ git config branch.local.rebase true
362   : # Make your changes to the Makefile and create a new commit
363   : $ git add Makefile
364   : $ git commit -m 'My local Makefile configurations'
365   : # Update git to a newer version
366   : $ git pull
368   Now each time you pull new commits from the distribution repository
369   your local commits will be rewound and replayed on top of the new
370   origin/master.
372 -----------
374   You would normally work on your =local= branch which includes your
375   custom commits; there's no need to switch back to the =master=
376   branch.
378 -----------
380 Here is an example of dealing with conflict resolution during git pull.
382 If you get a conflict during a =git pull= you will need to edit the
383 file with the conflict to fix up the conflicting lines and then tell
384 git that you have resolved the conflict.
386 Conflict resolution goes something like this:
388 1. =git pull= fails with a conflict
389 2. edit the file
390 3. =git add= the file to mark the conflict resolved
391 4. =git rebase --continue=
392 5. lather, rinse, and repeat 2-4 as needed
394 For this example we have the following Makefile:
396 : #
397 : # Example Makefile
398 : #
400 : EMACS=emacs
402 : VERSION=V1.0
404 and we need to change the =EMACS=emacs= line to =EMACS=myemacs= to
405 make it work well on our system.
407 To do this we
409   - create a local branch for our work
411     : $ git checkout -b local origin/master
412     : $ git config branch.local.rebase true
414     This marks the branch so that all local commits on it are rebased
415     on top of any new commits we get in origin/master during a =git
416     pull= operation.
418   - Make our custom changes
420     Edit the makefile so it looks like this:
422     : #
423     : # Example Makefile
424     : #
425     :
426     : EMACS=myemacs
427     :
428     : VERSION=V1.0
430   - Create a commit with our custom changes
431     : $ git add Makefile
432     : $ git commit -m 'My local Makefile configurations'
434   - Later we do a =git pull= but that fails with conflicts.
436     : $ git pull
437     : remote: Counting objects: 5, done.
438     : ...
439     : Patch failed at 0001.
440     :
441     : When you have resolved this problem run "git rebase --continue".
442     : If you would prefer to skip this patch, instead run "git rebase --skip".
443     : To restore the original branch and stop rebasing run "git rebase --abort".
445   - Fix the conflict in your favourite editor
447     Conflict markers look like this:
449     : <<<<<<< HEAD:Makefile
450     : EMACS=emacs22
451     : =======
452     : EMACS=myemacs
453     : >>>>>>> Change emacs location:Makefile
455     This attempted =git pull= caused a conflict.  Fire up your
456     favourite editor and fix the conflict in the Makefile.  The
457     conflict markers are <<<<<<<<<< , ======= , and >>>>>>>>>>.  Fix
458     the Makefile appropriately and delete the conflict markers.  You
459     already edited these lines earlier so fixing it should be trivial.
461     In this case we changed =EMACS=emacs= to =EMACS=myemacs= and
462     upstream changed =EMACS=emacs= to =EMACS=emacs22=.  Just fix the
463     file and save it by deleting the conflict markers and keeping the
464     code you need (in this case the =EMACS=myemacs= line which we
465     originally modified.)
467   - Mark the file's conflict resolved
469     : $ git add Makefile
471     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.
473   - Continue the rebase operation
475     : $ git rebase --continue
477     If any other conflicts arise you fix them the same way - edit the file, mark the conflict resolved, and continue.
479 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"
480 using
481 : $ git rebase --abort
483 ** How can I use a stable release version instead of the bleeding edge master?
484    :PROPERTIES:
485    :CUSTOM_ID: using-stable-releases-only
486    :END:
488 The master branch of the git repository always contains the bleeding
489 edge development code.  This is important for Org's fast development,
490 because code on master gets checked out by many people daily and we
491 quickly receive bug reports if something is wrong.  On rare occasions,
492 this code may not function perfectly for a limited time while we are
493 trying to fix things.
495 Not everyone like to use this bleeding-edge code and face the danger
496 to hit a surprising bug.
498 Therefore, from time to time, we make a release.  This typically
499 happens when the maintainers feel that
501 1. they have reached a good point in the development
502 2. the code has a feature set that should stay and be supported in the
503    future
505 Stable releases are used as the basis for [[http://orgmode.org/index.html#sec-3_3][alternative distributions]] of
506 Org, and they are also the code that gets merged into the Emacs
507 distribution. If you want to work only with stable releases, you can
508 always download [[http://orgmode.org/index.html#sec-3][them here]], but you can also also use the git
509 repository to keep automatically up-to-date with the most recent
510 stable releases (and save bandwidth!). Here's how to do so:
512 *** Run a specific stable release
514 In the repository, do
516 : $ git fetch --tags
517 : $ git tag
519 To see which release tags are available.  Let's say you decide to use
520 =release_7.01f=.
522 : $ git checkout release_7.01f
524 This set the working tree of the repository to the state of Org at the
525 moment of release 7.01f.  You can then run Org from the repository be
526 sure to use the stable release while development continues on the
527 master branch.
529 Later, when we release 7.02, you can switch to that using
531 : $ git fetch --tags                   # to get all the new stuff
532 : $ git tag
533 : $ git checkout release_7.02
535 *** Always run the most recent stable release
537 Alternatively, if you just want to always run whatever the latest
538 stable release is, you can do
540 : $ git checkout -b stable origin/maint
542 and then regularly update this branch by doing
544 : $ git pull
546 ** How can I install an up-to-date version of org-mode without "make" tools?
547    :PROPERTIES:
548    :CUSTOM_ID: installing-org-without-make-tools
549    :END:
551 If you are using org-mode on a computer that lacks developer tools for
552 compiling software, such as [[http://www.gnu.org/software/make/][GNU Make]], you will have to use a
553 *different* installation method than [[http://orgmode.org/manual/Installation.html#Installation][the one outlined in the manual]].
555 Please see [[http://article.gmane.org/gmane.emacs.orgmode/15264][this thread]] on the mailing list for several different ways
556 you can install a recent version of org-mode without using the
557 customary =make clean && make && make install=.
559 The result of that discussion is the file/function found in
560 [[http://orgmode.org/worg/org-hacks.html#compiling-org-without-make]].
562 ** I don't use git. Can I download bleeding edge .zip and .tar.gz archives?
564    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 --
565    these archives are udpated every day at midnight.
567    Alternatively, you can download a [[http://orgmode.org/w/org-mode.git/snapshot][tar.gz snapshot from orgmode.org]].
569 ** How do I install Org-mode through Emacs' Package Manager?
570    :PROPERTIES:
571    :CUSTOM_ID: installing-via-elpa
572    :END:
574    Daily builds of Org-mode is distributed as an ELPA package from
575    both [[http://elpa.gnu.org/packages/][GNU Emacs Lisp Package Archive]] as well as from [[http://orgmode.org/pkg/daily/][Org-mode Emacs
576    Lisp Archive]].
578    Steps for installing Org with package manager:
579    1) Do =M-x list-packages= to browse available packages
580    2) If the above command is unavailable you need to [[#installing-elpa][install package
581       manager]] before proceeding ahead.
582    3) If you see =org= as available package skip to step 5.
583    4) If you are here it means that org is unavailable in the GNU's
584       archives. Report this discrepancy to [[mailto:emacs-orgmode@gnu.org][Orgmode mailing list.]]
586       In the meanwhile, you can manually download the tarball and
587       install it. Refer [[Installing%20from%20ELPA-tar][this FAQ entry]] for further information.
588    5) Press =i= to mark the package for installation
589    6) Press =x= to install
590    7) Reload Emacs
591    8) Use =M-x locate-library RET org=. If your installation is
592       successful you would something like the following:
594       =Library is file ~/.emacs.d/elpa/org-20110403/org.elc=
596 #   7) If you get the following error "*Failed to download `Org-mode'
597 #      archive.*" in step 2, you can manually download the tarball and
598 #      install it. Refer [[Installing from ELPA-tar][this FAQ entry]] for more information.
600 #   8) Add Orgmode as a package archive. This can be done in two ways:
601 #   9) Use =M-x customize-variable RET package-archives=
602 #   10) Add the following line to your =.emacs= and reload Emacs.
603 #       #+begin_src emacs-lisp
604 #         (add-to-list 'package-archives '("Org-mode" . "http://orgmode.org/pkg/daily/"))
605 #       #+end_src
608 ** How do I install Emacs package manager?
609    :PROPERTIES:
610    :CUSTOM_ID: installing-elpa
611    :END:
613    If you are running Emacs 24 or find the command =M-x list-packages=
614    available you already have the package manager installed.
616    Steps for installing package manager on emacs-23:
617    1. Download the package manager [[http://repo.or.cz/w/emacs.git/blob_plain/1a0a666f941c99882093d7bd08ced15033bc3f0c:/lisp/emacs-lisp/package.el][package.el]]
619    2. Add the following to your =.emacs= and reload Emacs.
620       #+begin_src emacs-lisp
621         ;; change "~/elisp/" as appropiate
622         (setq load-path (cons "~/elisp" load-path))
624         ;; Add the below lines *at the end* of your .emacs. This
625         ;; ensures that packages installed with package manager
626         ;; overrides other local installation
627         (require 'package)
628         (package-initialize)
629       #+end_src
631 ** I don't see Org-mode as an installation option in Package Manager Menu?
632    :PROPERTIES:
633    :CUSTOM_ID: why-no-org-in-elpa
634    :END:
636    Emacs Package Manager is a very recent addition to Emacs. Work is
637    under way to have have Org-mode seamlessly integrate with Emacs'
638    Package Manager. As a result, it will be some time before the
639    Org-mode packages are available and usable from either GNU or
640    Org-mode package archives.
642    In the meanwhile, you can install Org-mode via package manager
643    through ELPA-compatible tar. Refer [[Installing from ELPA-tar][this FAQ entry]] for more information.
645 ** How do I install Org-mode from a ELPA-compatible tarball?
646    :PROPERTIES:
647    :CUSTOM_ID: installing-from-elpa-tarball
648    :END:
649 # <<Installing from ELPA-tar>>
651    Org-mode is distributed as an ELPA-compatible tar which can be used
652    in conjunction with Emacs' package manager.
654    1. If you are already running Org-mode, note the current version
655       reported by M-x org-version.
656    2. Download the latest tarball from [[http://orgmode.org/pkg/daily/][Org-mode repo]].
657    3. Do =M-x package-install-file=. When prompted for =Package file
658       name=, point it to .tar file downloaded in step 2.
660       You will now see Package Manager compiling the files and
661       installing it.
662    4. Reload emacs. This step is very important.
663    5. Note the version of the new installation using M-x
664       org-version. If the new and old versions are different, the
665       installation is done and you are all set to enjoy the updated
666       Org-mode. Otherwise skip to step 6.
667    6. Review you load-path using =C-h v load-path=. Most likely that
668       your old installation path takes precedence over the path chosen
669       by package manager (which is typically
670       =~/.emacs.d/elpa/...=). Fix this anamoly by moving
671       =(package-initialize)= line in .emacs to a more appropriate
672       location.
674    - Additional Note on =org-install.el= :: Functionality of Org-mode's
675      =org-install.el= is supplanted by Package Manager's
676      =org-autoloads.el=. Since Package Manager autoloads Org-mode for
677      you, the following line =(require 'org-install)= in your =.emacs=
678      is no longer required and can be safely removed.
680 ** Why would I use ELPA tarballs instead of the snapshot tarballs?
681    :PROPERTIES:
682    :CUSTOM_ID: why-elpa
683    :END:
685    ELPA-tarballs automate much the process of upgrading org-mode. Much
686    of the following grunt work is done automatically by the Package
687    Manager:
689    1. Downloading, compiling, and activating of org-mode (including
690       setting org-mode's =load-path= and autoloads).
691    2. Updating info files.
693 * Setup
694   :PROPERTIES:
695   :CUSTOM_ID: Setup
696   :END:
697 ** How can I quickly browse all Org options?
699 =M-x org-customize RET=
701 See also [[file:org-tutorials/org-customize.org][Carsten's Org customize tutorial]] and [[file:org-configs/org-customization-guide.org][this customization guide]]
702 for details.
704 ** Can I use the editing features of org-mode in other modes?
705    :PROPERTIES:
706    :CUSTOM_ID: use-editing-features-in-other-modes
707    :END:
709    Not really---but there are a few editing features you can use in
710    other modes.
712    - For tables there is =orgtbl-mode= which implements the table
713      editor as a minor mode. (To enable, type =M-x orgtbl-mode=)
714    - For ordered lists there is =orgstruct-mode= which allows for easy
715      list editing as a minor mode. (To enable, type =M-x
716      orgstruct-mode=)
718    You can activate these modes automatically by using hooks:
720    : (add-hook 'mail-mode-hook 'turn-on-orgtbl)
721    : (add-hook 'mail-mode-hook 'turn-on-orgstruct)
723    For footnotes, there is the function =org-footnote-action=, which
724    works in non-org buffers. This function is a powerful tool for
725    creating and sorting footnotes. To use it globally, you can add the
726    following keybinding to your =.emacs= file (requires Org 6.17 or
727    greater):
729    : (global-set-key (kbd "C-c f") 'org-footnote-action)
731    For other features you need to switch to Org-mode temporarily, or
732    prepare text in a different buffer.
734 ** Why isn't feature "X" working the way it is described in the manual?
735    :PROPERTIES:
736    :CUSTOM_ID: making-sure-org-mode-is-up-to-date
737    :END:
739 Org-mode develops very quickly. If you are using a version of Org-mode
740 that shipped with emacs, there is a good chance that it is somewhat
741 out of date.
743 Many of the users on the Org-mode mailing list are using either a
744 recent release of Org-mode or the
745 [[http://orgmode.org/index.html#sec-3.2][development version of
746 org-mode from the git repository]].
748 If some settings and features aren't working the way you expect, make
749 sure that the version of the manual you are consulting matches the
750 version of Org-mode you are using.
752    - You can check which version of Org-mode you are using by
753      selection =Org --> Documentation --> Show Version= in the Emacs
754      menu.
756    - The [[http://orgmode.org/manual/index.html][online manual]] at [[http://orgmode.org][orgmode.org]] corresponds to the most recent
757      release.
759    - 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
760      released with the latest official Gnu Emacs release. Compared
761      with the manual at the orgmode.org, the manual at www.gnu.org is
762      somewhat out of date.
764 For instructions on how to stay current with Org-mode, consult [[keeping-current-with-Org-mode-development][this
765 FAQ]] or follow the instructions on [[http://orgmode.org][the official Org-mode site]].
767 ** Can I get the visibility-cycling features in outline-mode and outline-minor-mode?
768    :PROPERTIES:
769    :CUSTOM_ID: use-visibility-cycling-in-outline-mode
770    :END:
772    Yes, these functions are written in a way that they are independent of
773    the outline setup.  The following setup provides standard Org-mode
774    functionality in outline-mode on =TAB= and =S-TAB=.  For
775    outline-minor-mode, we use =C-TAB= instead of =TAB=,
776    because =TAB= usually has mode-specific tasks.
778 #+BEGIN_SRC emacs-lisp
779 (add-hook 'outline-minor-mode-hook
780   (lambda ()
781     (define-key outline-minor-mode-map [(control tab)] 'org-cycle)
782     (define-key outline-minor-mode-map [(shift tab)] 'org-global-cycle)))
783 (add-hook 'outline-mode-hook
784   (lambda ()
785     (define-key outline-mode-map [(tab)] 'org-cycle)
786     (define-key outline-mode-map [(shift tab)] 'org-global-cycle)))
787 #+END_SRC
789 Or check out /outline-magic.el/, which does this and also provides
790 promotion and demotion functionality.  /outline-magic.el/ is
791 available at [[http://www.astro.uva.nl/~dominik/Tools/outline-magic.el][Outline Magic]].
793 ** Can I save/restore the visibility state of an org-mode buffer?
794    :PROPERTIES:
795    :CUSTOM_ID: saving-visibility-state
796    :END:
798 Well, no---at least not automatically. You can, however, control the
799 visibility of an org-file or of individual trees by adding
800 instructions to your org file. See [[http://orgmode.org/manual/Visibility-cycling.html#Visibility-cycling][this section of the manual]] for more
801 information.
803 ** How can I keep track of changes in my Org files?
804    :PROPERTIES:
805    :CUSTOM_ID: track-of-changes-in-Org-files
806    :END:
808   Use git to track the history of the files, use a cronjob to check in
809   changes regularly.  Such a setup is described by Bernt Hansen
810   in [[http://article.gmane.org/gmane.emacs.orgmode/6233][this message]] on [[http://dir.gmane.org/gmane.emacs.orgmode][emacs-orgmode]].
812 ** Can I use Org-mode as the default mode for all README files?
813    :PROPERTIES:
814    :CUSTOM_ID: Org-mode-as-default-mode
815    :END:
817 Add the following to your .emacs file:
819 : (add-to-list 'auto-mode-alist '("README$" . org-mode))
821 You can even make it the default mode for any files with unspecified
822 mode using
824 : (setq default-major-mode 'org-mode)
826 ** Can I use ido.el for completing stuff in Org?
827    :PROPERTIES:
828    :CUSTOM_ID: ido-complete
829    :END:
831    Yes, you can.  If you are an ido user and ido-mode is active, the
832    following setting will make Org use =ido-completing-read= for most
833    of its completing prompts.
835 : (setq org-completion-use-ido t)
837 ** Should I use one big org file or multiple files?
838    :PROPERTIES:
839    :CUSTOM_ID: how-to-organize-org-mode-files
840    :END:
842 Org-mode is flexible enough to accomodate a variety of organizational
843 and time management schemes. Org's [[http://orgmode.org/manual/Document-Structure.html#Document-Structure][outline cycling and convenient
844 editing and navigation commands]] make it possible to maintain all of
845 your projects and notes in a single file. But org-mode's [[http://orgmode.org/manual/Hyperlinks.html#Hyperlinks][quick and
846 easy hyperlinks]], along with [[http://orgmode.org/manual/Refiling-notes.html#Refiling-notes][easy refiling of notes and todos]], also
847 make it a delight to maintain a private "wiki" consisting of multiple
848 files.
850 No matter how you organize your org files, org-mode's agenda commands
851 make it easy to search all your notes and gather together crucial data
852 in a single view.
854 Moreover, several org-mode settings can be configured either globally
855 in your =.emacs= file or locally (per file or per outline tree). See
856 the [[http://orgmode.org/manual/index.html#Top][manual]] for more details. For an example of local customizations
857 see [[limit-agenda-with-category-match][this FAQ]].
859 Here are a few ideas for organizing org-mode files:
861 - A single file for all your projects and notes.
862 - One file per project.
863 - One file per client.
864 - One file per area of responsibility or type of work (e.g.,
865   household, health, work, etc.).
866 - One file for projects, one for appointments, one for reference
867   material, one for someday/maybe items, etc.
868 - A wiki of hyperlinked files that grows and adapts to meet your
869   needs.
871 For more ideas, see some of the links on the [[file:org-tutorials/index.org][org-tutorial index]] or
872 [[file:org-gtd-etc.org][this page on org-mode and GTD]].
874 ** Why doesn't C-c a call the agenda? Why don't some org keybindings work?
875    :PROPERTIES:
876    :CUSTOM_ID: setting-global-keybindings
877    :END:
879 Org-mode has a few global keybindings that the user must set
880 explicitly in an =.emacs= file. These keybindings include the
881 customary shortcut for calling the agenda (=C-c a=). If nothing
882 happens when you type =C-c a=, then make sure that the following lines
883 are in your =.emacs= file:
885 #+BEGIN_SRC emacs-lisp
886 ;; The following lines are always needed.  Choose your own keys.
887 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
888 (global-set-key "\C-cl" 'org-store-link)
889 (global-set-key "\C-ca" 'org-agenda)
890 (global-set-key "\C-cb" 'org-iswitchb)
891 #+END_SRC emacs-lisp
893 You may, of course, choose whatever keybindings work best for you
894 and do not conflict with other modes.
896 Please see [[http://orgmode.org/manual/Activation.html][this section of the manual]] if you have additional
897 questions.
899 ** Why aren't some of the variables I've customized having an effect?
900    :PROPERTIES:
901    :CUSTOM_ID: load-org-after-setting-variables
902    :END:
904 Some org variables have to be set before org.el is loaded or else they
905 will not work. (An example is the new variable
906 =org-enforce-todo-dependencies=.)
908 To make sure all your variables work you should not use =(require
909 'org)=. Instead use the following setting:
911 : (require 'org-install)
913 You should also make sure that you do not require any other =org-...=
914 files in your =.emacs= file before you have set your org variables,
915 since these will also cause org.el to be loaded. To be safe, load org
916 files *after* you have set your variables.
918 ** How can I make sure that timestamps appear in English?
919    :PROPERTIES:
920    :CUSTOM_ID: timestamps-and-system-time-locale
921    :END:
923 If your system's locale is not set to English, but you would like the
924 timestamps in your org-mode files to appear in English, you can set
925 the following variable:
927 #+begin_src emacs-lisp
928   (setq system-time-locale "C")
929 #+end_src
931 ** What does a minimal .emacs look like?
932    :PROPERTIES:
933    :CUSTOM_ID: minimal-emacs
934    :END:
936 Using a stripped down minimal .emacs files removes broken custom
937 settings as the cause of an issue and makes it easy to reproduce for
938 other people.  The example below has system-specific paths that you'll
939 need to change for your own use.
940 #+begin_src emacs-lisp
941   (add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
942   (add-to-list 'auto-mode-alist '("\\.\\(org\\  |org_archive\\|txt\\)$" . org-mode))
943   (setq org-agenda-files '("/tmp/test.org"))
944   (require 'org-install)
945   (require 'org-habit)
947   (global-set-key "\C-cl" 'org-store-link)
948   (global-set-key "\C-ca" 'org-agenda)
949   (global-set-key "\C-cb" 'org-iswitchb)
950 #+end_src
952 You can save the minimal .emacs file to ~/minimal.emacs, add suspect
953 configuration code to it, then start emacs something like this:
954 #+begin_src sh
955   emacs -Q -l ~/minimal.emacs
956 #+end_src
958 On OS X, starting emacs with minimal configuration might look
959 something like this:
960 #+begin_src sh
961   /Applications/emacs.app/Contents/MacOS/Emacs -Q -l ~/minimal.emacs
962 #+end_src sh
964 ** Can I migrate from Planner?
966    Yes.  This [[http://www.c0t0d0s0.de/plan2org/plan2org.pl][perl script]] or [[http://gitorious.org/bkuhn-small-hacks/org-mode/blobs/master/planner2org.plx
967 ][this Perl script]] can help.
969 * Errors and general problems
970   :PROPERTIES:
971   :CUSTOM_ID: Errors
972   :END:
973 ** Opening Org files in Emacs leads to a crash
974    :PROPERTIES:
975    :CUSTOM_ID: Emacs-crashes-with-org-indent-mode
976    :END:
977    The only known case where Org-mode can crash Emacs is when you are
978    using =org-indent-mode= with Emacs 23.1 (in fact, any version of
979    Emacs before version 23.1.50.3).  Upgrade to Emacs 23.2 and the
980    problem should go away.
982 ** When I try to use Org-mode, I always get the error message =(wrong-type-argument keymapp nil)=
983    :PROPERTIES:
984    :CUSTOM_ID: wrong-type-argument-keymapp
985    :END:
987    This is a conflict with an outdated version of the /allout.el/, see
988    the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section in the manual
990 ** How can I control the application launched by Org-mode to open a certain file type like pdf, html....
991    :PROPERTIES:
992    :CUSTOM_ID: external-application-launched-to-open-file-link
993    :END:
995 If you want special control about how Org-mode opens files, see the
996 variables =org-file-apps=, =org-file-apps-defaults-gnu=,
997 =org-file-apps-defaults-macosx=, =org-file-apps-defaults-windowsnt=.
999 *However*, normally it is best to just use the mechanism the
1000 operating-system provides:
1002 *** GNU/Linux systems
1003     You you have to check your mailcap settings, find the files:
1005     : /etc/mailcap
1006     :
1007     : or
1008     :
1009     : $HOME/.mailcap
1011 and modify them accordingly. Please read their manual entry.
1013 *** Windows systems
1014     + for html pages you may configure the =browse-url-= variables through
1015       the Customize interface,
1016     + the pdf files are automatically opened with Acrobat Reader (if it is
1017       installed)
1019 *** Mac OSX
1020     Change the application responsible for this file type by selecting
1021     such a file in the Finder, select =File->Get Info= from the menu
1022     and select the application to open this file with.  Then, to
1023     propagate the change to all files with the same extension, select
1024     the =Change all= button.
1026 ** Org-mode takes over the TAB key.  I also want to use YASnippet, is there a way to fix this conflict?
1027    :PROPERTIES:
1028    :CUSTOM_ID: YASnippet
1029    :END:
1031 [[http://code.google.com/p/yasnippet/][yasnippet]] is yet another snippet expansion system for Emacs.  It is
1032 inspired by TextMate's templating syntax.
1033 - watch the [[http://www.youtube.com/watch?v=vOj7btx3ATg][video on YouTube]]
1034 - see the [[http://yasnippet.googlecode.com/svn/trunk/doc/index.html][intro and tutorial]]
1036 *Note*: yasnippet is not compatible with =org-indent-mode= currently
1037 there is no known way to use both successfully with =yas/trigger-key=
1038 set to =TAB= (or =[tab]= etc...)
1040 The way Org-mode binds the =TAB= key (binding to =[tab]= instead of
1041 =\t=) overrules yasnippets' access to this key.  The following code
1042 fixes this problem:
1044 #+begin_src emacs-lisp
1045 (add-hook 'org-mode-hook
1046           (lambda ()
1047             (org-set-local 'yas/trigger-key [tab])
1048             (define-key yas/keymap [tab] 'yas/next-field-group)))
1049 #+end_src
1051 If the above code doesn't work (which it may not with later versions
1052 of yasnippet).  Then try the following
1054 #+begin_src emacs-lisp
1055   (defun yas/org-very-safe-expand ()
1056     (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
1058   (add-hook 'org-mode-hook
1059             (lambda ()
1060               ;; yasnippet (using the new org-cycle hooks)
1061               (make-variable-buffer-local 'yas/trigger-key)
1062               (setq yas/trigger-key [tab])
1063               (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
1064               (define-key yas/keymap [tab] 'yas/next-field)))
1065 #+end_src
1067 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]])
1068 with YASnippets for Org-mode.
1070 ** Org-mode takes over the S-cursor keys.  I also want to use CUA-mode, is there a way to fix this conflict?
1071    :PROPERTIES:
1072    :CUSTOM_ID: CUA-mode
1073    :END:
1075 Yes, see the  [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
1077 ** Org-mode takes over the S-cursor keys.  I also want to use windmove.el, is there a way to fix this conflict?
1078    :PROPERTIES:
1079    :CUSTOM_ID: windmove.el
1080    :END:
1082 Yes, see the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
1084 ** Org behaves strangely: some keys don't work, some features are missing, my settings have no effect, ...
1085    :PROPERTIES:
1086    :CUSTOM_ID: loaded-old-org
1087    :END:
1089 When this sort of things happen, it probably is because Emacs is
1090 loading an old version of Org-mode instead of the one you expected.
1091 Check it with =M-x org-version=.
1093 This happens because Emacs loads first the system org-mode (the one
1094 included with Emacs) before the one in your directory. Check the
1095 =load-path= variable; you might see that your org-mode appears /after/
1096 the system-wide path; this is bad.
1098 You should add your directories to the =load-path= at the beginning:
1100 :  (add-to-list 'load-path "~/.emacs.d/org-mode/lisp") (require 'org-install)
1102 Function =add-to-list= adds at the beginning. Don't use =append=
1103 because it appends at the end. Also be sure to use =(require
1104 'org-install)= and not =(require 'org)=.
1106 This wrong version loading may also happen if you have a byte-compiled
1107 =org.elc= from an old version together with a new =org.el=. Since
1108 Emacs prefers loading byte-compiled files (even if the =.el= is
1109 newer), it will load the old Org-mode.
1111 ** Why doesn't org-batch-agenda work under Win32?
1112    :PROPERTIES:
1113    :CUSTOM_ID: org-batch-agenda-under-win32
1114    :END:
1116 When I run the example batch files to print my agenda to the console
1117 under Win32 I get the failure:
1119 : End of file during parsing
1121 and no agenda is printed.
1123 The problem is the use of single quotes surrounding the eval in the
1124 emacs command-line. This gets confused under Win32. All string
1125 parameters with spaces must be surrounded in double quotes. This means
1126 that double quotes being passed to the eval must be escaped.
1128 Therefore, instead of the following:
1130 : <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
1131 :     -eval '(org-batch-agenda "a")'
1133 you need to use the following:
1135 :  <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
1136 :     -eval "(org-batch-agenda \"a\")"
1138 (all on one line, of course).
1140 ** Org agenda seems very slow
1141    :PROPERTIES:
1142    :CUSTOM_ID: slow-agenda
1143    :END:
1145 If it takes a long time to generate or refresh the agenda, you might
1146 want first check which version of org-mode you are using. There have
1147 been major optimizations of org-agenda since 6.21b, which was the
1148 version of org-mode released with Emacs 23. If you are using 6.21b or
1149 earlier (you can check with =M-x org-version=), then you might want to
1150 consider upgrading to a more recent version of org-mode.
1152 Here are some other ideas for speeding up the agenda:
1154 1. Use a one day agenda view (rather than a seven day view).
1156    =(setq org-agenda-ndays 1)=
1158 2. Archive inactive items to separate files.
1160    =C-c C-x C-s= (org-archive-subtree)
1162 3. Do not include the global todo list in your agenda view.
1164    (setq org-agenda-include-all-todo nil)
1166 4. Make sure that your org files are byte-compiled.
1168    I.e., make sure there are files ending in =.elc= in your org
1169    installation directory.
1171 5. Limit your agenda files (=org-agenda-files=) to files that have
1172    active todos and or projects.
1174    If you have a number of older reference files---i.e., files you
1175    search only occasionally---in your agenda files list, consider
1176    removing them from your agenda files and adding them to
1177    =org-agenda-text-search-extra-files= instead. Similarly, you might
1178    consider searching some of your older reference files with =M-x
1179    grep= so that Org-mode does not have to load them into memory when
1180    the agenda is called.
1182 ** Visual-line-mode doesn't work well with org-mode
1183    :PROPERTIES:
1184    :CUSTOM_ID: visual-line-mode
1185    :END:
1187 Visual-line-mode "soft wraps" lines so that the visual edge of the
1188 buffer is considered a line break for purposes of navigation, even
1189 though there is no line break in reality.
1191 In older versions of org-mode, org-beginning-of-line and
1192 org-end-of-line do not work well with visual line mode. (The two
1193 commands disregard soft line breaks and move to the beginning and end
1194 of the hard line break.) A patch was introduces to fix this behavior
1195 in July of 2009.
1197 If you are using an older version of org mode, you can:
1199 1. Add a hook to turn off visual line mode.
1201 2. Add the following to your =.emacs=:
1203 #+begin_src emacs-lisp
1205 (add-hook 'org-mode-hook
1206   (lambda ()
1207     (define-key org-mode-map "\C-a" 'move-beginning-of-line)
1208     (define-key org-mode-map "\C-e" 'move-end-of-line)))
1210 #+end_src
1211 ** Can I hide blocks at startup?
1213 Yes:
1215 #+begin_src emacs-lisp
1216 (setq org-hide-block-startup t)
1217 #+end_src
1219 Or use
1221 #+begin_src org
1222 ,#+STARTUP: hideblocks
1223 #+end_src
1225 on a per-file basis.
1227 * Faces and highlighting
1228   :PROPERTIES:
1229   :CUSTOM_ID: Faces
1230   :END:
1231 ** Org-mode has a lot of colors?  How can I change them?
1232    :PROPERTIES:
1233    :CUSTOM_ID: customizing-org-faces
1234    :END:
1236 This is a question that applies to Emacs as a whole, but it comes up
1237 quite frequently on the org-mode mailing list, so it is appropriate to
1238 discuss it here.
1240 If you would like to change the style of a face in org-mode (or any
1241 other Emacs mode), simply type =M-x customize-face [RET]= while the
1242 cursor is on the color/style you are interested in modifying. You will
1243 be given the opportunity to customize all the faces located at that
1244 point.
1246 If you would like an overview of all the faces in org-mode, you can
1247 type =C-u M-x list-faces-display [RET] org= and you will be shown all
1248 the faces defined by org-mode along with an illustration of their
1249 current settings.
1251 If you would like to customize org-faces and other aspects of
1252 org-appearance, type =M-x customize-group org-font-lock [RET]=.
1254 Finally, if you would like verbose information about the properties of
1255 the text under the cursor, you can type =C-u C-x ==.
1257 See the Worg page on [[file:org-tutorials/org-appearance.org][customizing Org appearance]] for further information.
1258 ** Why do I get a tiny font in column view when using emacs daemon?
1259    :PROPERTIES:
1260    :CUSTOM_ID: column-view-tiny-font
1261    :END:
1263 When using emacs in daemon mode (=emacs --daemon=), client frames
1264 sometimes override the column view face settings, resulting in very
1265 small fonts. Here is a fix:
1267 #+begin_src emacs-lisp
1268   (defun org-column-view-uses-fixed-width-face ()
1269   ;; copy from org-faces.el
1270   (when (fboundp 'set-face-attribute)
1271       ;; Make sure that a fixed-width face is used when we have a column
1272       ;; table.
1273       (set-face-attribute 'org-column nil
1274                           :height (face-attribute 'default :height)
1275                           :family (face-attribute 'default :family))))
1277    (when (and (fboundp 'daemonp) (daemonp))
1278     (add-hook 'org-mode-hook 'org-column-view-uses-fixed-width-face))
1279 #+end_src
1281 This fix was provided in the following mailing list post:
1283 http://article.gmane.org/gmane.emacs.orgmode/27560
1284 ** How can I stop the mouse cursor from highlighting lines in the agenda?
1285    :PROPERTIES:
1286    :CUSTOM_ID: ratpoison-for-agenda-highlighting
1287    :END:
1289 You can add the following to your =.emacs=:
1291 #+begin_src emacs-lisp
1292 (add-hook 'org-finalize-agenda-hook
1293     (lambda () (remove-text-properties
1294                (point-min) (point-max) '(mouse-face t))))
1295 #+end_src
1297 * Outline
1298   :PROPERTIES:
1299   :CUSTOM_ID: Outline
1300   :END:
1301 ** Can I close an outline section without starting a new section?
1302    :PROPERTIES:
1303    :CUSTOM_ID: closing-outline-sections
1304    :END:
1306 Can I have nested, closed outline sections, similar to xml? This
1307 question comes up quite frequently on the mailing list.
1309 See the following threads:
1311   - http://permalink.gmane.org/gmane.emacs.orgmode/40182
1312   - http://permalink.gmane.org/gmane.emacs.orgmode/36719
1313   - http://permalink.gmane.org/gmane.emacs.orgmode/24092
1314   - http://permalink.gmane.org/gmane.emacs.orgmode/12425
1316 The desired behavior looks something like this:
1318 #+begin_src org
1319   ,* Section one
1321   ,Some text
1323   ,** Subsection one
1325   ,Some text
1327   ,** Subsection two
1329   ,Some text
1331   ,# end Subsection Two
1333   ,Continue text in section one.
1334 #+end_src
1336 The short answer to the question is no. Org-mode adheres to the
1337 cascading logic of outlines, in which a section is closed only by
1338 another section that occupies an equal or greater level.
1340 Here are some workarounds:
1342 1. You can use inline tasks to create non-folding subsections. See the
1343    documentation in org-inlinetask.el, which is part of the org-mode
1344    distribution.
1345 2. You can create a temporary heading, such as "** Continue main
1346    section" and then remove it when you are ready to export.
1347 3. You can create a separate outline heading (e.g., * ACTIONS),
1348    creating TODOs there with links to the relevant sections of your
1349    main text.
1351 ** Can I add a TODO to a list item?
1352    :PROPERTIES:
1353    :CUSTOM_ID: list-item-as-todo
1354    :END:
1356 No. When generating agenda views, org-mode treats only headlines as
1357 TODO items.
1359 You can, however, use a status cookie together with checkboxes to
1360 monitor your progress on a series of subtasks:
1362 #+begin_src org
1363   ,** TODO Big task [1/3]
1365   ,   - [X] Subtask 1
1366   ,   - [ ] Subtask 2
1367   ,   - [ ] Subtask 3
1368 #+end_src
1370 If you would like to embed a TODO within text without treating it as
1371 an outline heading, you can use inline tasks. Simply add...
1373 : (require 'org-inlinetask)
1375 ...to your =.emacs= and then type C-c C-x C-t to insert an inline task.
1377 ** Can I have two windows on the same Org-mode file, with different outline visibilities?
1378    :PROPERTIES:
1379    :CUSTOM_ID: indirect-buffers
1380    :END:
1382    You may use /indirect buffers/ which do exactly this.  See the
1383    documentation on the command =make-indirect-buffer=.
1385    Org-mode has built-in commands that allow you create an indirect
1386    buffer from a subtree of an outline. To open a subtree in new
1387    window, type =C-c C-x b=. Any changes you make in the new window
1388    will be saved to the original file, but the visibility of both
1389    buffers will remain independent of one another.
1391    For multiple indirect buffers from the same file, you must use the
1392    prefix =C-u= when creating the second (or third) buffer. Otherwise
1393    the new indirect buffer will replace the old.
1395    You can also create an independent view of an outline subtree by
1396    typing =b= on an item in the agenda.
1398 ** Emacs outlines are unreadable.  Can I get rid of all those stars?
1399    :PROPERTIES:
1400    :CUSTOM_ID: Emacs-outlines-are-unreadable
1401    :END:
1403    See the section [[http://orgmode.org/manual/Clean-view.html#Clean-view][Clean outline view]] in the manual.
1404 ** C-k is killing whole subtrees!  I lost my work!
1405    :PROPERTIES:
1406    :CUSTOM_ID: C-k-is-killing-subtrees
1407    :END:
1409   =(setq org-ctrl-k-protect-subtree t)= before losing your work.
1411 ** Why aren't commands working on regions?
1412    :PROPERTIES:
1413    :CUSTOM_ID: transient-mark-mode
1414    :END:
1416 Some org-mode commands, such as M-right and M-left for demoting or
1417 promoting headlines (see [[demote-multiple-headlines][this FAQ]]), can be applied to entire regions.
1418 These commands, however, will only work on active regions set with
1419 [[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
1420 Emacs 23. To enable it in earlier versions of emacs, put the following
1421 in your =.emacs= file:
1423 : (transient-mark-mode 1)
1425 Alternatively, you may turn off transient mark mode and use [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Momentary-Mark.html][a
1426 momentary mark]] (=C-<SPC> C-<SPC>=).
1428 ** Why is a blank line inserted after headlines and list items?
1429    :PROPERTIES:
1430    :ID:       2463F4D8-F686-4CF3-AA07-08976F8A4972
1431    :END:
1432    :PROPERTIES:
1433    :CUSTOM_ID: blank-line-after-headlines-and-list-items
1434    :END:
1436 In org-mode, typing =M-RET= at the end of a headline will create a new
1437 headline of the same level on a new line. The same is true for plain
1438 lists. By default org-mode uses context to determine if a blank line
1439 should be inserted after each headline or plain list item when =M-RET=
1440 is pressed. For instance, if a there is a blank line before a
1441 headline, then typing =M-RET= at the end of the line will insert a
1442 blank line before the new headline. For instance, hitting =M-RET=
1443 at the end of "Headline Two" below inserts a new headline without a
1444 blank line:
1446 : ** Headline One
1447 : ** Headline Two
1448 : **
1450 If there is a blank line between Headline One and Headline Two,
1451 however, the results will be as follows:
1453 : ** Headline One
1455 : ** Headline Two
1457 : **
1459 If you do not like the default behavior you can change it with the
1460 variable =org-blank-before-new-entry=. You can set headings and/or
1461 plain lists to auto (the default setting), t (always), or nil (never).
1463 ** How can I promote or demote multiple headlines at once?
1464    :PROPERTIES:
1465    :CUSTOM_ID: demote-multiple-headlines
1466    :END:
1468 If you have a long list of first level headlines that you'd like to
1469 demote to second level headlines, you can select the headlines as a
1470 region and then hit =M-<right>= to demote all the headlines at once.
1472 Note: =M-S-<right>= will not work on a selected region. Its use is to
1473 demote a single subtree (i.e., a headline and all sub-headlines).
1475 If M-<right> doesn't seem to work, make sure transient mark mode is
1476 enabled. See [[transient-mark-mode][this FAQ]].
1478 ** What's the deal with all the ellipses in my org outlines?
1479    :PROPERTIES:
1480    :CUSTOM_ID: org-ellipses
1481    :END:
1483 Org-mode uses ellipses to indicate folded (and thus hidden) text. Most
1484 commonly, ellispes occur at the end of headings with folded content:
1486 : * Heading ...
1488 Or, for instance, they may indicate closed drawers:
1490 : :PROPERTIES: ...
1492 Sometimes, as a result of editing and cycling an outline, ellipses may
1493 appear in unexpected places. You should *never* delete these ellipses,
1494 as you may accidentally delete hidden text. Instead, you can type =C-c
1495 C-r= (org-reveal) to display all hidden text in the vicinity. Or you
1496 may type =M-x RET show-all= to reveal all text in the org file.
1498 If you would prefer a symbol or face for indicating hidden text, you
1499 can customize the variable org-ellipses.
1501 ** How do I yank a subtree so it's indented according to the point's location?
1502    :PROPERTIES:
1503    :CUSTOM_ID: yank-indent-subtree
1504    :END:
1506 You can either use =C-c C-w= with a working [[http://orgmode.org/manual/Refiling-notes.html#Refiling-notes][refile-targets]] setup.
1508 Or set =org-yank-adjusted-subtrees= to =t= which will adjust the
1509 yanked headline's level correctly.
1511 Just use =C-k= and =C-y= as you would everywhere else in Emacs.
1513 ** Can I read org-mode outlines in vim?
1514    :PROPERTIES:
1515    :CUSTOM_ID: org-outlines-in-vim
1516    :END:
1518 Yes, there is a script that enables one to view and navigate folded
1519 outline/org files in vim (though without most of org-mode's
1520 functionality, of course).
1522   - [[http://www.vim.org/scripts/script.php?script_id%3D1266][Emacs outline mode - Imitates Emacsen : vim online]]
1524 For instructions on how to set it up, please see [[http://mid.gmane.org/EA275862-B97A-4BAC-B879-177FD07A2D56@gaillourdet.net][this mailing list
1525 post]].
1527 Work is also underway on an org-mode clone for Vim. You can check it
1528 out on git hub:
1530 https://github.com/hsitz/VimOrganizer
1532 ** Can I use another character than "*" to start a headline?
1534 No.  The "*" character is used in =outline-mode=, and Org is derived from
1535 =outline-mode=.  
1537 * Todos and Tags
1538   :PROPERTIES:
1539   :CUSTOM_ID: Todos-and-Tags
1540   :END:
1541 ** How can I cycle through the TODO keyword of an entry?
1542    :PROPERTIES:
1543    :CUSTOM_ID: cycle-TODO-keywords
1544    :END:
1546   =C-c C-t= or =S-<left/right>= is what you need.
1548 ** How do I track state changes for tasks in Org?
1549    :PROPERTIES:
1550    :CUSTOM_ID: track-state-changes-for-tasks
1551    :END:
1553   Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/6082][post by Bernt Hansen]] for setting up TODO keyword
1554   states and logging timestamps for task state changes.
1556 ** Can I select the TODO keywords with a tag-like interface?
1557    :PROPERTIES:
1558    :CUSTOM_ID: select-TODO-keywords-with-tag-like-interface
1559    :END:
1561   Yes.  Use =(setq org-use-fast-todo-selection t)=
1563   If you want to set both your todos and your tags using a single
1564   interface, then check out the variable
1565   =org-fast-tag-selection-include-todo=.
1567   See [[http://orgmode.org/manual/Fast-access-to-TODO-states.html][this section of the manual]] for more details.
1569 ** How can I quickly set the tag of an entry?
1570    :PROPERTIES:
1571    :CUSTOM_ID: quickly-set-tag-of-entry
1572    :END:
1574    Use =C-c C-c= or =C-c C-q= on the headline. =C-c C-q= is useful for
1575    setting tabs in a [[http://orgmode.org/manual/Remember.html#Remember][remember]] buffer, since =C-c C-c= is the default
1576    keybinding for filing a note from the remember buffer.
1578    You can set tags even more quickly by setting one of the character
1579    shortcuts for [[http://orgmode.org/manual/Setting-tags.html#Setting-tags][fast tag selection]].
1581    To set tag shortcuts for all org buffers, put something like the
1582    following in your =.emacs= file (or create the same settings by
1583    typing =M-x customize-variable RET org-tag-alist=):
1585 : (setq org-tag-alist '(("computer" . ?c) ("office" . ?o) ("home" . ?h)))
1587    To set tag shortcuts for a single buffer, put something like the
1588    following at the top of your org file:
1590 : #+TAGS: computer(c) office(o) home(h)
1592 ** How can I change the colors of TODO keywords?
1594 You can use the variable org-todo-keyword-faces. Here are some sample
1595 settings:
1597 #+begin_src emacs-lisp
1598 (setq org-todo-keyword-faces
1599       '(
1600         ("TODO"  . (:foreground "firebrick2" :weight bold))
1601         ("WAITING"  . (:foreground "olivedrab" :weight bold))
1602         ("LATER"  . (:foreground "sienna" :weight bold))
1603         ("PROJECT"  . (:foreground "steelblue" :weight bold))
1604         ("DONE"  . (:foreground "forestgreen" :weight bold))
1605         ("MAYBE"  . (:foreground "dimgrey" :weight bold))
1606         ("CANCELED"  . shadow)
1607         ))
1608 #+end_src
1610 If you want to change the color of all active todos or all inactive
1611 todos, type:
1613 : M-x customize-face RET org-todo
1614 : M-x customize-face RET org-done
1616 You can also set values for each of these in your =.emacs= file:
1618 : (set-face-foreground 'org-todo "firebrick2")
1619 : (set-face-foreground 'org-done "forestgreen")
1621 ** Can I use a arbitrary character in a TODO keyword?
1623 Yes, provided you add it to the "word" syntax in Emacs.
1625 For example, to add the =\u25b6= and the =\u25b8= chars, just add this to
1626 your Emacs configuration:
1628 #+begin_src emacs-lisp
1629 (add-hook 'org-mode-hook
1630    (lambda ()
1631      (modify-syntax-entry (string-to-char "\u25b6") "w")
1632      (modify-syntax-entry (string-to-char "\u25b8") "w")))
1633 #+end_src
1635 * Hyperlinks
1636   :PROPERTIES:
1637   :CUSTOM_ID: Hyperlinks
1638   :END:
1639 ** Why do I have to confirm the execution of each shell/elisp link?
1640    :PROPERTIES:
1641    :CUSTOM_ID: confirm-shell/elisp-link
1642    :END:
1644    The confirmation is there to protect you from unwantingly execute
1645    potentially dangerous commands.  For example, imagine a link
1647    : [[shell:rm -rf ~/*][Google Search]]
1649    In an Org-mode buffer, this command would look like /Google Search/,
1650    but really it would remove your home directory.  If you wish, you can
1651    make it easier to respond to the query by setting
1653    : (setq org-confirm-shell-link-function 'y-or-n-p
1654    :       org-confirm-elisp-link-function 'y-or-n-p).
1656    Then a single keypress will be enough to confirm those links.  It is
1657    also possible to turn off this check entirely, but I strongly
1658    recommend against this.  Be warned.
1660 ** Can I use RET or TAB to follow a link?
1661    :PROPERTIES:
1662    :CUSTOM_ID: RET-or-TAB-to-follow-link
1663    :END:
1665    Yes, this is how:
1667    : (setq org-return-follows-link t)
1668    : (setq org-tab-follows-link t)
1670 ** Can I keep mouse-1 clicks from following a link?
1671    :PROPERTIES:
1672    :CUSTOM_ID: mouse-1-following-link
1673    :END:
1675    Activating links with =mouse-1= is a new feature in Emacs 22, to make
1676    link behavior similar to other applications like web browsers.  If
1677    you hold the mouse button down a bit longer, the cursor will be set
1678    without following the link.  If you cannot get used to this behavior,
1679    you can (as in Emacs 21) use =mouse-2= to follow links and turn off
1680    link activation for =mouse-1= with
1682    : (setq org-mouse-1-follows-link nil)
1684 ** How can I get completion of file names when creating a link?
1685    :PROPERTIES:
1686    :CUSTOM_ID: completion-of-file-links
1687    :END:
1689 You can use org-insert-link with a prefix argument:
1691 : C-u C-c C-l
1693 You will be greeted with prompt in the minibuffer that allows for file
1694 completion using your preferred Emacs method for finding files.
1696 ** How can I use invisible targets within lists?
1697    :PROPERTIES:
1698    :CUSTOM_ID: invisible-targets-in-lists
1699    :END:
1701 The usual way of turning radio links invisible is to comment them, but
1702 Org comments need to be at the beginning of the line, which breaks list
1703 indentation.
1705 The workaround here is to add (INVISIBLE) after your <<target>>
1707 For example:
1709 : 11. <<target>>(INVISIBLE)
1710 :     Some text
1711 : 12. More text [[target][go to]]
1713 ** Org-mode is not opening mailto links in my default mail client
1714    :PROPERTIES:
1715    :CUSTOM_ID: mailto-links
1716    :END:
1718 You can customize the function org-mode uses to open mailto links by
1719 setting the variable =org-link-mailto-program=:
1721 =M-x customize-variable org-link-mailto-program=
1723 The default function called is =browse-url=, which opens a mail
1724 composition buffer within Emacs. The type of buffer opened by
1725 browse-url depends on the setting of the variable =mail-user-agent=.
1726 Thus, if you want to ensure that mailto links use Gnus to open a
1727 message buffer, you could add the following to your =.emacs=:
1729 #+begin_src elisp
1730 (setq mail-user-agent 'gnus-user-agent)
1731 #+end_src
1733 ** Can I use CamelCase links?
1734    :PROPERTIES:
1735    :CUSTOM_ID: CamelCase-links
1736    :END:
1738 Yes, you can with the contributed package org-wikinodes.el. Please
1739 consult the [[http://orgmode.org/worg/org-contrib/org-wikinodes.html][documentation]].
1741 * Plain Lists
1742   :PROPERTIES:
1743   :CUSTOM_ID: Plain-Lists
1744   :END:
1745 ** How can I insert an empty line before each newly inserted headline, but not before each newly inserted plain-list item?
1746    :PROPERTIES:
1747    :CUSTOM_ID: empty-line-before-each-new-headline-but-not-item
1748    :END:
1750 : (setq org-blank-before-new-entry
1751 :       '((heading . t) (plain-list-item . nil))
1753 See also [[id:2463F4D8-F686-4CF3-AA07-08976F8A4972][Why is a blank line inserted after headlines and list items?]].
1755 ** How can I convert itemized lists to enumerated lists?
1756    :PROPERTIES:
1757    :CUSTOM_ID: convert-itemized-to-enumerated-lists
1758    :END:
1760    You can use =C-c -= or =S-<left>/<right>= to cycle through the various
1761    bullet headlines available for lists: =-, +, *, 1., 1)=.
1763    See [[http://orgmode.org/manual/Plain-lists.html#Plain-lists][this section of the manual]] for more information.
1765 ** How can I convert plain lists to headlines and vice versa?
1766    :PROPERTIES:
1767    :CUSTOM_ID: convert-plain-lists-to-headlines
1768    :END:
1770    To convert a plain list item or line to a headline, type =C-c *= on
1771    the headline. This will make the line a subheading of the current
1772    headline.
1774    To convert a headline to a plain list item, type =C-c -= while the
1775    cursor is on the headline.
1777    To convert a headline to an unadorned line of text, type =C-c *= on
1778    the headline.
1780    You can use query replace to accomplish the same things, as Bernt
1781    Hansen explains in [[http://article.gmane.org/gmane.emacs.orgmode/10148][this mailing list post]].
1783 ** Is there a good way to create a description list?
1784    :PROPERTIES:
1785    :CUSTOM_ID: description-lists
1786    :END:
1788   Yes, these are now built-in:
1790 #+BEGIN_EXAMPLE
1791 - item1 :: Description of this item 1
1792 - item2 :: Description of this item 2
1793 - item1 :: Description of this item 3
1794       also in multiple lines
1795 #+END_EXAMPLE
1797 * Tables
1798   :PROPERTIES:
1799   :CUSTOM_ID: Tables
1800   :END:
1801 ** Will there ever be support for multiple lines in a table field?
1802    :PROPERTIES:
1803    :CUSTOM_ID: table-multiline-fields
1804    :END:
1806    No.
1808    You can embed tables created with the table.el package in org-mode
1809    buffers, with mixed success when it comes to export and publishing.
1811 ** How can I make table alignment work with Asian character sets
1812    :PROPERTIES:
1813    :CUSTOM_ID: table-alignment-asian-characters
1814    :END:
1816 When table alignment fails, it usually has to do with character sets
1817 where some characters have non-integer width.  Org will deal correctly
1818 with characters that are one or two or three ASCII characters wide,
1819 but not with characters that are, for example, 1.5 ASCII characters
1820 wide.  To make table alignment work you need to switch to a different
1821 character set.
1823 ** Can I plot data from a table?
1824    :PROPERTIES:
1825    :CUSTOM_ID: plotting-table-data
1826    :END:
1828    Yes, you can, using org-plot.el written by Eric Schulte and now
1829    bundled with Org.  See [[http://orgmode.org/manual/Org_002dPlot.html#Org-Plot][the manual section about this]].
1831    See also [[file:org-tutorials/org-plot.org][this excellent tutorial]] by Eric Schulte.
1833 ** How can I fill a table column with incremental numbers?
1834    :PROPERTIES:
1835    :CUSTOM_ID: fill-table-column-with-incremental-numbers
1836    :END:
1838 Here is how: Use a field formula to set the first value in the column:
1840 #+begin_src org
1841 ,| N   |   |
1842 ,|-----+---|
1843 ,| :=1 |   |
1844 ,|     |   |
1845 ,|     |   |
1846 ,|     |   |
1847 ,#+TBLFM: @2$1=1
1848 #+end_src
1850 Then define a column formula in the second field:
1852 #+begin_src org
1853 ,| N        |   |
1854 ,|----------+---|
1855 ,| 1        |   |
1856 ,| =@-1 + 1 |   |
1857 ,|          |   |
1858 ,|          |   |
1859 ,#+TBLFM: @2$1=1
1860 #+end_src
1862 After recomputing the table, the column will be filled with
1863 incremental numbers:
1865 #+begin_src org
1866 ,| N |   |
1867 ,|---+---|
1868 ,| 1 |   |
1869 ,| 2 |   |
1870 ,| 3 |   |
1871 ,| 4 |   |
1872 ,#+TBLFM: $1=@-1 + 1::@2$1=1
1873 #+end_src
1875 Note that you could use arbitrary starting values and column formulas.
1877 ** Why does my table column get filled with #ERROR?
1878    :PROPERTIES:
1879    :CUSTOM_ID: table-column-filled-with-ERROR
1880    :END:
1882    Org-mode tried to compute the column from other fields using a
1883    formula stored in the =#+TBLFM:= line just below the table, and
1884    the evaluation of the formula fails.  Fix the fields used in the
1885    formula, or fix the formula, or remove it!
1887 ** How can I stop the table editor from creating new lines?
1888    :PROPERTIES:
1889    :CUSTOM_ID: table-editor-creates-new-lines
1890    :END:
1892    When I am in the last column of a table and just above a horizontal
1893    line in the table, pressing TAB creates a new table line before the
1894    horizontal line.  To move to the line below the
1895    horizontal line instead, do this:
1897    Press =down= (to get on the separator line) and then =TAB=.
1898    Or configure the variable
1900    : (setq org-table-tab-jumps-over-hlines t)
1902 ** How can I get table fields starting with "="?
1903    :PROPERTIES:
1904    :CUSTOM_ID: table-fields-starting-with-=
1905    :END:
1907    With the setting
1909    : (setq org-table-formula-evaluate-inline nil)
1911    this will no longer happen.  You can still use formulas using the
1912    commands ~C-c =~ and ~C-u C-c =~
1914 ** How can I get a vertical bar "|" inside a table field?
1915    :PROPERTIES:
1916    :CUSTOM_ID: table-fields-with-vertical-bar
1917    :END:
1919    You can use =\vert= to put a vertical bar inside a table field.
1920    This will be converted for export.  To use it inside a word use
1921    =abc\vert{}def=.  If you need something that looks like a bar in
1922    the Org mode buffer, you can use the unicode character brvbar which
1923    looks like this: \brvbar{}.
1926 ** How can I change the indentation of an entire table without fixing every line by hand?
1927    :PROPERTIES:
1928    :CUSTOM_ID: change-indentation-entire-table
1929    :END:
1931    The indentation of a table is set by the first line.  So just fix the
1932    indentation of the first line and realign with =TAB=.
1934 ** In my huge table the realigning after each TAB takes too long.  What can I do?
1935    :PROPERTIES:
1936    :CUSTOM_ID: table-realigning-after-TAB-takes-long
1937    :END:
1939    Either split the table into several by inserting an empty line every
1940    100 lines or so.  Or turn off the automatic re-align with
1942    : (setq org-table-automatic-realign nil)
1944    After this the only way to realign a table is to press =C-c C-c=.  It
1945    will no longer happen automatically, removing the corresponding delays
1946    during editing.
1948 ** Recalculation of my table takes too long.  What can I do?
1949    :PROPERTIES:
1950    :CUSTOM_ID: Recalculation-of-my-table-takes-too-long
1951    :END:
1953    Nothing, really.  The spreadsheet in org is mostly done to make
1954    calculations possible, not so much to make them fast.  Since Org-mode
1955    is firmly committed to the ASCII format, nothing is stopping you from
1956    editing the table by hand.  Therefore, there is no internal
1957    representation of the data.  Each time Org-mode starts a computation,
1958    it must scan the table for special lines, find the fields etc.  This
1959    is slow.  Furthermore, Calc is slow compared to hardware
1960    computations.  To make this work with normal editing, recalculation
1961    is not happening automatically, or only for the current line, so that
1962    the long wait for a full table iteration only happens when you ask
1963    for it.
1965    So for really complex tables, moving to a "real" spreadsheet may
1966    still be the best option.
1968    That said, there are some ways to optimize things in Org-mode, and I
1969    have been thinking about moving a bit further down this line.
1970    However, for my applications this has so far not been an issue at
1971    all.  If you have a good case, you could try to convince me.
1973 ** =S-RET= in a table keeps increasing the copied numbers.  How can I stop this?
1974    :PROPERTIES:
1975    :CUSTOM_ID: S-RET-in-a-table-increases-copied-numbers
1976    :END:
1978    Well, it is /supposed/ to be a feature, to make it easy to create a
1979    column with increasing numbers.  If this gets into your way, turn it
1980    off with
1982    : (setq org-org-table-copy-increment nil)
1984 ** When I export tables to html, they don't have borders.
1985    :PROPERTIES:
1986    :CUSTOM_ID: table-borders-in-html-export
1987    :END:
1989 By default, org mode exports tables without borders.
1991 You can changed this by placing an =#+ATTR_HTML= line before the
1992 table:
1994 :  #+ATTR_HTML: border="2" rules="all" frame="all"
1996 See [[http://orgmode.org/manual/Tables-in-HTML-export.html#Tables-in-HTML-export][the manual]] for more details.
1998 ** Why does the Calc high precision (e. g. =p20=) not work like expected?
1999    :PROPERTIES:
2000    :CUSTOM_ID: table-high-precision
2001    :END:
2003 - *Short answer*
2005   Avoid
2006   : | 1 / 2 * 3 | 0.16666667000000 |
2007   : #+TBLFM: $2 = $1; p20 %.14f
2009   and use
2010   : | 1 / 2 * 3 | 0.16666666666667 |
2011   : #+TBLFM: $2 = $1 +.0; p20 f-14
2013 - *Longer answer*
2015   It is important to distinguish between the precision of
2016   1) =p20=: Calc internal calculation (=calc-internal-prec=)
2017   2) =f-14=: Calc float formatting, unlimited in precision (=calc-float-format=)
2018   3) =%.14f=: the =printf= reformatting, limited in precision
2020   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.
2022   Use =C-h v org-calc-default-modes RET= to check the Org default settings
2023   which are used if no format specifiers are added to a table formula.
2024   The examples below have been made with the out_of_the_box Org defaults
2025   =calc-internal-prec = 12= and =calc-float-format = 8=.
2027   Remember the formula debugger, toggled with =C-c {=,
2028   to view the processing stages like:
2029   |   | formula debugger label | processing stage           |
2030   | / | <                      | <>                         |
2031   |---+------------------------+----------------------------|
2032   |   | Result:                | output of Calc             |
2033   |   | Format:                | reformatting with =printf= |
2035   Following are some examples to demonstrate
2036   the interaction of the three precisions.
2038   - *display precision limitations for Calc formulas*
2039     - limited by Calc internal calculation precision from Org default
2040       (here =p12=)
2041       : | 0.16666666666700 |
2042       : #+TBLFM: $1 = 1 / 2 * 3;     f-14
2044       : | 0.1666666666670000000 |
2045       : #+TBLFM: $1 = 1 / 2 * 3;     f-19
2047     - limited by Calc float format from Org default (here =f8=)
2048       : | 0.16666667 |
2049       : #+TBLFM: $1 = 1 / 2 * 3
2051       : | 0.16666667 |
2052       : #+TBLFM: $1 = 1 / 2 * 3; p20
2054       : | 0.16666667000000 |
2055       : #+TBLFM: $1 = 1 / 2 * 3;          %.14f
2057       : | 0.16666667000000 |
2058       : #+TBLFM: $1 = 1 / 2 * 3; p20      %.14f
2060     - limited by Calc float format specified
2061       : | 0.166667 |
2062       : #+TBLFM: $1 = 1 / 2 * 3;     f-6
2064       : | 0.16666666666667 |
2065       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-14
2067       : | 0.1666666666666666667 |
2068       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-19
2070     - limited by =printf= conversion to Emacs Lisp float
2071       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
2072       : #+TBLFM: $1 = 1 / 2 * 3;          %.19f
2074       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
2075       : #+TBLFM: $1 = 1 / 2 * 3; p20      %.19f
2077       : | 0.1666666666666666600 | the inaccuracy is platform dependent |
2078       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-20 %.19f
2080     - limited by =printf= format specified
2081       : | 0.166667 |
2082       : #+TBLFM: $1 = 1 / 2 * 3;         %.6f
2084   - *display precision limitations for Emacs Lisp formulas*
2085     - limited by Emacs Lisp float
2086       : | 0.16666666666666666 |
2087       : #+TBLFM: $1 = '(/ 1.0 (* 2 3))
2089       : | 0.1666666666666666574 | the inaccuracy is platform dependent |
2090       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.19f
2092     - limited by =printf= format specified
2093       : | 0.16666666666667 |
2094       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.14f
2096 This FAQ entry is based on this [[http://thread.gmane.org/gmane.emacs.orgmode/22642][mailing list thread]]
2097 and is continued in the [[#table-float-fraction][next FAQ entry]].
2099 ** Which float format shows the fraction part also when the latter is zero?
2100    :PROPERTIES:
2101    :CUSTOM_ID: table-float-fraction
2102    :END:
2104 - *Short answer*
2106   Avoid
2107    : | 1 | 1 |
2108    : #+TBLFM: $2 = $1; f-3
2109   and use
2110    : | 1 | 1.000 |
2111    : #+TBLFM: $2 = $1 +.0; f-3
2113 - *Longer answer*
2115   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]]
2116   in the section Mode Settings -> Display Modes -> Float Formats
2117   [[http://www.delorie.com/gnu/docs/calc/calc_163.html][found here as long as the section numbering is unchanged]].
2119   Remember the formula debugger, toggled with =C-c {=,
2120   to view the processing stages like:
2121   |   | formula debugger label | processing stage           |
2122   | / | <                      | <>                         |
2123   |---+------------------------+----------------------------|
2124   |   | Result:                | output of Calc             |
2125   |   | Format:                | reformatting with =printf= |
2127   Following are some examples to demonstrate different float formats.
2129   - normal precision
2130     : |-----------+---------+-------+---------+----------+-------|
2131     : |    number |      f3 |   f-3 | +.0; f3 | +.0; f-3 |  %.3f |
2132     : |-----------+---------+-------+---------+----------+-------|
2133     : |         1 |       1 |     1 |   1.000 |    1.000 | 1.000 |
2134     : |         0 |       0 |     0 |   0.000 |    0.000 | 0.000 |
2135     : |-----------+---------+-------+---------+----------+-------|
2136     : |       1.0 |   1.000 | 1.000 |   1.000 |    1.000 | 1.000 |
2137     : |       0.0 |   0.000 | 0.000 |   0.000 |    0.000 | 0.000 |
2138     : |-----------+---------+-------+---------+----------+-------|
2139     : | 1.0001666 |   1.000 | 1.000 |   1.000 |    1.000 | 1.000 |
2140     : | 0.0001666 | 1.67e-4 | 0.000 | 1.67e-4 |    0.000 | 0.000 |
2141     : |-----------+---------+-------+---------+----------+-------|
2142     : | 1.0016666 |   1.002 | 1.002 |   1.002 |    1.002 | 1.002 |
2143     : | 0.0016666 |   0.002 | 0.002 |   0.002 |    0.002 | 0.002 |
2144     : |-----------+---------+-------+---------+----------+-------|
2145     : #+TBLFM: $2 = $1; f3 :: $3 = $1; f-3 :: $4 = $1 +.0; f3 :: $5 = $1 +.0; f-3 :: $6 = $1; %.3f
2147   - high precision
2148     : |----------------------+--------------------------+-----------------------|
2149     : | number               |                      f19 |                  f-19 |
2150     : |----------------------+--------------------------+-----------------------|
2151     : | 1                    |                        1 |                     1 |
2152     : | 0                    |                        0 |                     0 |
2153     : |----------------------+--------------------------+-----------------------|
2154     : | 1.0                  |    1.0000000000000000000 | 1.0000000000000000000 |
2155     : | 0.0                  |    0.0000000000000000000 | 0.0000000000000000000 |
2156     : |----------------------+--------------------------+-----------------------|
2157     : | 1 + 1 / 2 * 3 * 1e19 |    1.0000000000000000000 | 1.0000000000000000000 |
2158     : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
2159     : |----------------------+--------------------------+-----------------------|
2160     : | 1 + 1 / 2 * 3 * 1e18 |    1.0000000000000000002 | 1.0000000000000000002 |
2161     : | 0 + 1 / 2 * 3 * 1e18 |    0.0000000000000000002 | 0.0000000000000000002 |
2162     : |----------------------+--------------------------+-----------------------|
2163     : #+TBLFM: $2 = $1; p20 f19 :: $3 = $1; p20 f-19
2165     : |----------------------+--------------------------+-----------------------|
2166     : | number               |                 +.0; f19 |             +.0; f-19 |
2167     : |----------------------+--------------------------+-----------------------|
2168     : | 1                    |    1.0000000000000000000 | 1.0000000000000000000 |
2169     : | 0                    |    0.0000000000000000000 | 0.0000000000000000000 |
2170     : |----------------------+--------------------------+-----------------------|
2171     : | 1.0                  |    1.0000000000000000000 | 1.0000000000000000000 |
2172     : | 0.0                  |    0.0000000000000000000 | 0.0000000000000000000 |
2173     : |----------------------+--------------------------+-----------------------|
2174     : | 1 + 1 / 2 * 3 * 1e19 |    1.0000000000000000000 | 1.0000000000000000000 |
2175     : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
2176     : |----------------------+--------------------------+-----------------------|
2177     : | 1 + 1 / 2 * 3 * 1e18 |    1.0000000000000000002 | 1.0000000000000000002 |
2178     : | 0 + 1 / 2 * 3 * 1e18 |    0.0000000000000000002 | 0.0000000000000000002 |
2179     : |----------------------+--------------------------+-----------------------|
2180     : #+TBLFM: $2 = $1 +.0; p20 f19 :: $3 = $1 +.0; p20 f-19
2182     The =printf= reformatting (=%.19f=) cannot be used with high precision,
2183     see the [[#table-high-precision][previous FAQ entry]].
2185 ** How can I center tables in LaTeX output?
2186    :PROPERTIES:
2187    :CATEGORY: centered-tables-in-latex
2188    :END:
2190 Set the `org-export-latex-tables-centered' to `t':
2192 : (defcustom org-export-latex-tables-centered t
2193 :   "When non-nil, tables are exported in a center environment."
2194 :   :group 'org-export-latex
2195 :   :type 'boolean)
2197 * Markup
2198   :PROPERTIES:
2199   :CUSTOM_ID: Footnotes
2200   :END:
2201 ** How can I get automatic renumbering of footnotes in org-mode?
2202    :PROPERTIES:
2203    :CUSTOM_ID:       footnote-auto-adjust
2204    :END:
2206 You can add the following line to your .emacs file:
2208 : (setq org-footnote-auto-adjust t)
2210 Or, if you prefer, you can turn this option on locally by placing the
2211 following line at the top of your org file:
2213 : #+STARTUP: fnadjust
2215 When auto-adjust is turned on, footnotes in the file with numerical
2216 labels will be renumbered whenever a new footnote is added. Meanwhile,
2217 all footnotes, including those with custom labels such
2218 =[fn:custom-label ]=, will be sorted in the order of their appearance
2219 in the text.
2221 This emulates the footnote behavior that many users may be familiar
2222 with from word-processing programs or from the footnote-mode included
2223 with emacs.
2225 If you do not turn on org-footnote-auto-adjust, you sort and/or
2226 renumber footnotes at any time by calling org-footnote-action with a
2227 prefix argument.
2229 ** Why isn't auto renumbering of footnotes turned on by default?
2230    :PROPERTIES:
2231    :CUSTOM_ID:       why-no-default-auto-adjust
2232    :END:
2234 Org mode has a very robust footnote mechanism allowing for a variety
2235 of types of footnotes. With some of the following footnote notations,
2236 auto-adjust may be either irrelevant or undesired:
2238  - Automatically numbered
2239  - Footnotes with custom labels
2240  - Inline footnotes
2242 In addition, org mode can be customized to place footnotes either at
2243 the end of a document or at the end of the outline heading in which
2244 they appear. Users who change this setting while editing a document
2245 may be disconcerted to find all of their footnotes rearranged
2246 automatically.
2248 ** I have auto-fill-mode set and org-mode is inserting unwanted comment markers!
2249    :PROPERTIES:
2250    :CUSTOM_ID: auto-fill-and-unwanted-comments
2251    :END:
2253 If the following occurs:
2255 #+begin_src org
2256   ,#+OPTIONS: toc:nil
2257   ,Some entered text.
2258   ,# More entered tex.
2259 #+end_src
2261 Make sure that the variable comment-start is nil.
2263 ** Are there any shortcuts for entering source blocks and comment lines?
2264    :PROPERTIES:
2265    :CUSTOM_ID: shortcuts-for-entering-source-blocks
2266    :END:
2268 Org mode has some [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][very convenient markup]] for including literal blocks
2269 and lines of code in a file. (This is especially useful when exporting
2270 documents or using the contributed package [[file:org-contrib/babel/index.org][org-babel]] for executing
2271 blocks of code.)
2273 #+begin_src org
2274   ,#+begin_src perl
2275   ,  print "Hello, world!\n";
2276   ,#+end_src
2277 #+end_src
2279 It can be tiresome to enter the block comment lines manually. There
2280 are several possible shortcuts you can use to enter them:
2282 1) Built-in expansion
2284    - Org mode has a "secret" method of expanding source code blocks
2285      and comment lines.
2287    - If you type "<s" followed by =TAB= or =M-TAB=, a source block will
2288      magically appear.
2290    - For a full list of expansions, type =M-x describe-variable
2291      [RET] org-structure-template-alist=.
2293 2) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Registers]]
2295    - Add the following line to your emacs file:
2297      =(set-register ?p "#+begin_src\n\n#+end_src perl")=
2299    - Then type =C-x r i p= to insert the source block. Please note: if
2300      you save another value to the register "p" with =C-x r s p=, it
2301      will overwrite the setting above for the current emacs session.
2303 3) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Abbrevs]]
2305    - Activate the abbrev minor-mode in org-mode:
2307      + M-x abbrev-mode
2309      + /Permanently/:
2311        + =(add-hook 'org-mode-hook (lambda () (abbrev-mode 1)))=
2313    - In org-mode, type "sbp" (a sample abbreviation for a perl source
2314      block).
2316    - Immediately after "sbp" type =C-x a i l=.
2318    - Enter the expansion:
2320      - =#+begin_src perl[C-q C-j][C-q C-j]#+end_src=
2322      - Note: =C-q C-j= creates a new line in the minibuffer
2324    - Now, whenever, you type sbp followed by =SPACE= or =RET= in an
2325      org-mode buffer, the src block will magically appear.
2327    - To review your list of abbrevs, type =M-x edit-abbrevs=.
2329 4) [[http://www.slashgear.com/nokia-n900-android-dual-boot-hack-video-2371099/][Skeletons]]
2331    - Skeletons offer a simple way of automatically entering text.
2332      Here's a skeleton that queries for the type of block and wraps
2333      the active region inside it:
2335      #+begin_src elisp
2336        (define-skeleton skel-org-block
2337          "Insert an org block, querying for type."
2338          "Type: "
2339          "#+begin_" str "\n"
2340          _ - \n
2341          "#+end_" str "\n")
2342      #+end_src
2344    - Simply type skel-org-block to insert the block.
2346      - You can bind this to a key.
2348      - You can also create an abbrev that invokes this function:
2350        : (define-abbrev org-mode-abbrev-table "blk" "" 'skel-org-block)
2352 5) [[http://code.google.com/p/yasnippet/][Yasnippet]]
2354    - Several org-mode users install yasnippet for convenient, complex
2355      expansion.
2357    - See Bernt Hansen's [[http://doc.norang.ca/org-mode.html#Yasnippets][org-mode setup]] for a good introduction to
2358      yasnippet.
2360 * Capture and remember
2361   :PROPERTIES:
2362   :CUSTOM_ID: Remember
2363   :END:
2364 ** Can I use a variable or a function inside the `org-capture-templates' variable?
2365    :PROPERTIES:
2366    :CUSTOM_ID: variable-inside-capture-templates
2367    :END:
2369 Yes.  Use [[http://www.gnu.org/s/emacs/manual/html_node/elisp/Backquote.html][backquotes]].
2371 E.g. if you have a variable called =org-test-file= and you want the
2372 variable =org-capture-templates= to "understand" (i.e. evaluate)
2373 =org-test-file= when Emacs evaluates the =(setq org-capture-templates
2374 [...])= expression, use backquotes like this:
2376 #+begin_src emacs-lisp
2377 (setq org-capture-templates
2378       `(("t" "Todo" entry (file+headline ,org-test-file "Tasks")
2379        "* TODO %?\n  %i\n  %a")
2380       ("b" "Buy" item (file+olp ,org-test-file "Stuff to Buy" "House")
2381        "")))
2382 #+end_src
2384 ** Can I use the remember buffer to clock a customer phone call?
2385    :PROPERTIES:
2386    :CUSTOM_ID: use-remember-buffer-to-clock-phone-call
2387    :END:
2389   Yes, you can.  Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/5482][setup described by Bernt Hansen]]
2390   and check out (in the same thread) what Nick Docos had to fix to
2391   make Bernt's set-up work for him.
2392 ** Can I automatically start the clock when opening a remember template?
2393    :PROPERTIES:
2394    :CUSTOM_ID: start-clock-when-opening-remember-template
2395    :END:
2397    Yes, this is possible.  Use the following code and make sure that
2398    after executing it, `my-start-clock-if-needed' is in
2399    `remember-mode-hook' /after/ `org-remember-apply-template'.
2401    : (add-hook 'remember-mode-hook 'my-start-clock-if-needed 'append)
2402    : (defun my-start-clock-if-needed ()
2403    :   (save-excursion
2404    :     (goto-char (point-min))
2405    :     (when (re-search-forward " *CLOCK-IN *" nil t)
2406    :       (replace-match "")
2407    :       (org-clock-in))))
2409    Then, when a template contains the key string CLOCK-IN, the clock
2410    will be started.  Starting with Org-mode version 5.20, the clock will
2411    automatically be stopped when storing the remember buffer.
2413 * Searches
2414   :PROPERTIES:
2415   :CUSTOM_ID: Searches
2416   :END:
2417 ** Isearch does not find string hidden in links.  What can I do?
2418    :PROPERTIES:
2419    :CUSTOM_ID: isearch-in-links
2420    :END:
2422   M-x =visible-mode= will display the full link, making them searchable.
2424 ** How can I reduce the amount of context shown in sparse trees?
2425    :PROPERTIES:
2426    :CUSTOM_ID: context-in-sparse-trees
2427    :END:
2429    Take a look at the following variables:
2431    - =org-show-hierarchy-above=
2432    - =org-show-following-headline=
2433    - =org-show-siblings=
2434    - =org-show-entry-blow=
2436    which give command-dependent control over how much context is shown
2437    by a particular operation.
2439 ** How can I combine the results of two calls to =org-occur=?
2440    :PROPERTIES:
2441    :CUSTOM_ID: two-calls-to-org-occur
2442    :END:
2444    You can construct a regular expression that matches all targets you
2445    want.  Alternatively, use a =C-u= prefix with the second and any
2446    further calls to =org-occur= to keep the current visibility and
2447    highlighting in addition to the new ones.
2449 * Agenda
2450   :PROPERTIES:
2451   :CUSTOM_ID: Agenda
2452   :END:
2453 ** How can I change the advanced warning time for deadlines?
2454    :PROPERTIES:
2455    :CUSTOM_ID: warning-period-for-deadlines
2456    :END:
2457 ##<<warning-period-for-deadlines>>
2459 Deadline warnings appear in the daily agenda view a specified number
2460 of days before the deadline is due. The default setting is 14 days.
2461 You can change this with the variable =org-deadline-warning-days=.
2462 (See [[http://orgmode.org/manual/Deadlines-and-scheduling.html#Deadlines-and-scheduling][this section]] of the manual.)
2464 For instance,
2466 : (setq org-deadline-warning-days 30)
2468 would cause warnings for each deadline to appear 30 days in advance.
2470 Naturally, you might not want warnings for all of your deadlines to
2471 appear so far in advance. Thus, you can change the lead time for
2472 individual items as follows:
2474 : * TODO Get a gift for the party
2475 :   DEADLINE: <2009-01-16 Fri -2d>
2477 The "-2d" above changes the lead time for this deadline warning to two
2478 days in advance. You can also use "w" for weeks and "m" for months.
2479 ** How can I postpone a task until a certain date?
2480    :PROPERTIES:
2481    :CUSTOM_ID: deferring-tasks
2482    :END:
2484 The easiest way to postpone a task is to schedule it in the future.
2485 For instance, typing =C-c C-s +2w= on a headline will push a task two
2486 weeks into the future, so that it won't show up on the daily agenda
2487 until two weeks from now.
2489 If you'd like to prevent the task from showing up on your global todo
2490 list, you have a couple of options.
2492 1. You can set the variable =org-agenda-todo-ignore-scheduled= to =t=.
2493    This will exclude any scheduled items from your global list of
2494    active todos (=C-c a t=). (The variable
2495    =org-agenda-todo-ignore-with-date= will exclude both scheduled and
2496    deadline items from your todo list).
2497 2. You can remove the todo keyword from the item (C-c C-t <SPC>). The
2498    item will still appear on your agenda two weeks from today, but it
2499    won't show up on your todo lists.
2500 ** Can I send myself an email containing tasks or other agenda info?
2501    :PROPERTIES:
2502    :CUSTOM_ID: email-containing-tasks-or-other-agenda-info
2503    :END:
2505    Yes.  See [[http://article.gmane.org/gmane.emacs.orgmode/6112][this thread]] on the list.
2507 ** How can I limit the agenda view to my "work" tasks?
2508    :PROPERTIES:
2509    :CUSTOM_ID: limit-agenda-with-tag-filtering
2510    :END:
2512    It is often convenient to group org files into separate categories,
2513    such as "home" and "work" (or "personal" and "professional"). One
2514    of the main reasons for such classification is to create agenda
2515    views that are limited by type of work or area of responsibility.
2516    For instance, while at work, one may want to see only professional
2517    tasks; while away from work, one may want to see only personal
2518    tasks.
2520    One way to categorize files and tasks is to use a "#+FILETAGS"
2521    declaration at the top of each file, such as:
2523    : #+FILETAGS: work
2525    As long as org-use-tag-inheritance is turned on, the filetags will
2526    be inherited by all tasks in the file. A file can have multiple
2527    filetags. And, of course, tags can be added to individual headings.
2529    Tasks can be quickly filtered by tag from within the agenda by
2530    typing "/" and the name of the tag. The full key sequence to filter
2531    for work items in an agenda view would be:
2533    : C-c a a / work [or a tag shortcut]
2535 ** How can I limit the agenda view to a particular category?
2536    :PROPERTIES:
2537    :CUSTOM_ID: limit-agenda-with-category-match
2538    :END:
2540    Another way to filter agenda views by type of work is to use a
2541    "#+CATEGORY" declaration at the top of each file, such as:
2543    : #+CATEGORY: work
2545    Categories can also be added to individual headings within a file:
2547    : * Big project
2548    :   :PROPERTIES:
2549    :   :CATEGORY: work
2550    :   :END:
2552    All todos belonging to the category "work" can be found a with a
2553    simple tags-todo search:
2555    : C-c a M
2557    At the prompt, type:
2559    : CATEGORY="work"
2561    The same results can be achieved with custom agenda commands, such as:
2563 #+BEGIN_SRC emacs-lisp
2564 (setq org-agenda-custom-commands
2565       '(("h" tags-todo "CATEGORY=\"home\"")
2566         ("w" tags-todo "CATEGORY=\"work\"")
2567         ;; other custom agenda commands here
2568         ))
2569 #+END_SRC
2571 ** How can include all org files in a directory in my agenda?
2572    :PROPERTIES:
2573    :CUSTOM_ID: set-agenda-files-using-wildcards
2574    :END:
2576 You can simply include the directory (as one of the items) in the
2577 value of the variable org-agenda-files:
2579 : (setq org-agenda-files '("/my/special/path/org/"))
2581 There is another way of accomplishing the same end:
2583 : (setq org-agenda-files (file-expand-wildcards "/my/special/path/org/*.org"))
2585 ** Why aren't items disappearing from my agenda once they are marked done?
2586    :PROPERTIES:
2587    :CUSTOM_ID: removing-done-items-from-agenda
2588    :END:
2590 If items remain on your daily/weekly agenda after they are marked
2591 done, check the configuration of the following variables:
2593 : org-agenda-skip-scheduled-if-done
2594 : org-agenda-skip-deadline-if-done
2595 : org-agenda-skip-timestamp-if-done
2597 For instance, type:
2599 : M-x customize-variable RET org-agenda-skip-scheduled-if-done
2601 If this variable is turned off (=nil=), then scheduled items will
2602 remain on the agenda even after they are marked done.
2604 If the variable is turned on (=t=), then scheduled items will
2605 disappear from the agenda after they are marked done.
2607 If these settings seem not to behave the way you expect, then make
2608 sure you understand [[scheduled-vs-deadline-vs-timestamp][the
2609 difference between SCHEDULED, DEADLINE, and timestamps]].
2611 ** How do I keep repeating timestamps from being displayed multiple times?
2612    :PROPERTIES:
2613    :CUSTOM_ID: repeating-timestamps-show-once
2614    :END:
2616 To show only the /current/ instance of a repeating timestamp, put the
2617 following in your .emacs:
2619 #+begin_src emacs-lisp
2620 (setq org-agenda-repeating-timestamp-show-all nil)
2621 #+end_src
2623 ** What is the difference between SCHEDULED, DEADLINE, and plain timestamps?
2624    :PROPERTIES:
2625    :CUSTOM_ID: scheduled-vs-deadline-vs-timestamp
2626    :END:
2628 1. SCHEDULED items (set with =C-c C-s=) will appear on your agenda on
2629    the day they are scheduled and on every day thereafter until they
2630    are done. Schedule a task if you want to be reminded to do
2631    something beginning on a certain day and until it is done.
2633    : ** TODO Scheduled item
2634    :    SCHEDULED: <2009-03-01 Sun>
2636 2. Items with a DEADLINE timestamp (set with =C-c C-d=) appear on your
2637    agenda in advance of the when they are due and remain on your
2638    agenda until they are done. Add a DEADLINE to an item if you want
2639    to make sure to complete it by a certain date. (The variable
2640    org-deadline-warning-days determines how far in advance items with
2641    deadlines will show up in the agenda. See [[warning-period-for-deadlines][this FAQ]] for more
2642    information.)
2644    : ** TODO Item with a deadline
2645    :    DEADLINE: <2009-01-20 Tue>
2647 3. An active timestamp (set with =C-c .=) will appear on your agenda
2648    only on the day it is scheduled. Use a timestamp for appointments
2649    or any reminders you want to show up only on a particular day.
2651    : ** TODO Item with an active timestamp
2652    : <2009-04-18 Sat>
2654 Note: items with inactive timestamps (set with C-c ! and marked by
2655 square brackets) will not show up in the agenda at all.
2657 ** Can I add files recursively to my list of agenda files?
2658    :PROPERTIES:
2659    :CUSTOM_ID: set-agenda-files-recursively
2660    :END:
2662 Yes, you can use the library "find-lisp."
2664 : (load-library "find-lisp")
2665 : (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$"))
2667 This will add all files ending in =org= in the directory "~/org"
2668 and all of its subdirectories to your list of agenda files.
2670 If on a *nix machine, you can also use the find utility, which can be
2671 faster than the find-lisp library:
2673 : (setq org-agenda-files
2674 :       (mapcar 'abbreviate-file-name
2675 :               (split-string
2676 :                (shell-command-to-string "find ~/org -name \"*.org\"") "\n")))
2679 See [[http://thread.gmane.org/gmane.emacs.orgmode/8992][this thread]] on the mailing list for more information.
2681 ** Why does an item appearing at the wrong time of day in my agenda?
2682    :PROPERTIES:
2683    :CUSTOM_ID: agenda-wrong-time-of-day
2684    :END:
2686 When preparing the agenda view, org-mode scans each relevant headline
2687 for a time designation. This approach is very nice for adding
2688 free-form timestamps to an item for scheduling. Thus, either of the
2689 following work would work to schedule an item at 10:00am:
2691 #+begin_src org
2692 ,** 10:00am Get dried ice at the magic store
2693 ,   SCHEDULED: <2009-05-27 Wed>
2694 #+end_src
2696 #+begin_src org
2697 ,** Get dried ice at the magic store
2698 ,   SCHEDULED: <2009-05-27 Wed 10:00>
2699 #+end_src
2701 To enable this flexibility, org-mode scans the entire headline for
2702 time of day notation. A potential problem can arise if you use
2703 inactive timestamps in the headline to note when an item was created.
2704 For example,
2706 #+begin_src org
2707 ,** Get dried ice at the magic store [2009-05-26 Tue 12:58]
2708 ,   SCHEDULED: <2009-05-27 Wed>
2709 #+end_src
2711 Org mode would interpret the time in the inactive timestamp as a
2712 time-of-day indicator and the entry would appear in your agenda at
2713 12:58.
2715 If you would like to turn off the time-of-day search, you can
2716 configure the variable =org-agenda-search-headline-for-time= (requires
2717 org-mode >= 6.24).
2719 ** How can I change the visibility of an item from the agenda?
2720    :PROPERTIES:
2721    :CUSTOM_ID: cycling-visibility-from-agenda
2722    :END:
2724 You can add a keybinding as follows:
2726 #+begin_src emacs-lisp
2727 (add-hook 'org-agenda-mode-hook
2728    (lambda ()
2729      (define-key org-agenda-mode-map " " 'org-agenda-cycle-show)))
2730 #+end_src
2732 Then, as you press SPACE on an item on the agenda, it will cycle the
2733 visibility of its original location.
2735 ** Is there any way to set org-mode so that tags don't appear in the agenda view?
2737 See the =org-agenda-remove-tags= variable.
2739 ** I work late at night! How can I extend my current day past midnight?
2740    :PROPERTIES:
2741    :CUSTOM_ID: org-extend-today-until
2742    :END:
2744 If you work past midnight, you may not want your daily agenda view to
2745 switch to the next day at 12 a.m. (the default). To extend your day,
2746 simply set the value of org-extend-today-until to a positive number
2747 corresponding to the number of hours you work past midnight. For
2748 example, the following setting will cause the current day to extend
2749 until 6 a.m.
2751 : (setq org-extend-today-until 6)
2753 * Appointments/Diary
2754   :PROPERTIES:
2755   :CUSTOM_ID: Appointments/Diary
2756   :END:
2757 ** Is it possible to include entries from org-mode files into my emacs diary?
2758    :PROPERTIES:
2759    :CUSTOM_ID: include-entries-from-org-mode-files-into-emacs-diary
2760    :END:
2762    Since the org-mode agenda is much more powerful and can contain the
2763    diary, you should think twice before deciding to do this.  If you
2764    insist, however, integrating Org-mode information into the diary is
2765    possible.  You need to turn on /fancy diary display/ by setting in
2766    .emacs:
2768    : (add-hook 'diary-display-hook 'diary-fancy-display)
2770    Then include the following line into your ~/diary file, in
2771    order to get the entries from all files listed in the variable
2772    =org-agenda-files=
2774    : &%%(org-diary)
2776    You may also select specific files with
2778    : &%%(org-diary) ~/path/to/some/org-file.org
2779    : &%%(org-diary) ~/path/to/another/org-file.org
2781    If you now launch the calendar and press ~d~ to display a
2782    diary, the headlines of entries containing a timestamp, date range,
2783    schedule, or deadline referring to the selected date will be listed.
2784    Just like Org-mode's agenda view, the diary for /today/ contains
2785    additional entries for overdue deadlines and scheduled items.  See
2786    also the documentation of the =org-diary= function.  Under XEmacs, it
2787    is not possible to jump back from the diary to the org, this works
2788    only in the agenda buffer.
2789 ** I want to add my Org scheduled/deadlined entries in my diary!
2790    :PROPERTIES:
2791    :CUSTOM_ID: add-Org-scheduled/deadlined-entries-to-diary!
2792    :END:
2794   Put this in your ~/.diary:
2796   : &%%(org-diary :scheduled :timestamp :deadline)
2798 ** How can I set up automatic reminders based on Org information?
2799    :PROPERTIES:
2800    :CUSTOM_ID: automatic-reminders
2801    :END:
2803   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::#agenda-appt-zenity][org-hacks]].
2804 ** How can I make =appt= notice my Org appointments?
2805    :PROPERTIES:
2806    :CUSTOM_ID: appt-notice-my-Org-appointments
2807    :END:
2809   : M-x org-agenda-to-appt RET
2811 ** How can I create more complex appointments in my org-files?
2812    :PROPERTIES:
2813    :CUSTOM_ID: diary-sexp-in-org-files
2814    :END:
2816 Org-mode's active timestamps work very well for scheduling individual
2817 or recurring appointments, such as:
2819 #+begin_src org
2820   ,* 8:00am Dentist appointment <2009-01-16 Fri>
2821 #+end_src
2824 #+begin_src org
2825   ,* Vacation
2826   ,  <2009-03-20 Fri>--<2009-04-01 Wed>
2827 #+end_src
2831 #+begin_src org
2832   ,* Weekly meeting with boss
2833   ,  <2009-01-20 Tue 14:00 +1w>
2834 #+end_src
2836 Sometimes, however, you need to set up more complicated recurring
2837 appointments. Org-mode has built-in support for many of
2838 [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Sexp-Diary-Entries.html][the
2839 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
2840 instance, that you teach a class that meets every Monday evening
2841 between February 16 and April 20, 2009. The way to enter this an
2842 org-mode file is:
2844 #+begin_src org
2845   ,** Class 7:00pm-9:00pm
2846   ,   <%%(and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009))>
2847 #+end_src
2849 The expression above designates all Mondays that fall between February
2850 16 and April 20. How exactly does it work?
2852  - (and... :: Indicates that *both* of the conditions that follow have
2853           to be true.
2855    - (= 1 (calendar-day-of-week date)) :: Is the day of the week a
2856         Monday?
2858        - Note: the function calendar-day-of-week converts the date to the day of week
2859          expressed in numeric form, where 0 = Sunday, 1 = Monday, and so on.
2861    - (diary-block 2 16 2009 4 20 2009) :: Does the date fall between
2862         these two dates?
2864 You can make a sexp as complex as you like. If you wanted to omit a
2865 week because of holidays, for instance, you could add another
2866 condition to the sexp:
2868 #+begin_src org
2869   ,** Class 7:00pm-9:00pm
2870   ,   <%%(unless (diary-block 3 9 2009 3 13 2009) (and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009)))>
2871 #+end_src
2873 The sexp above would omit Monday during the week of March 9, 2009. For
2874 another way to accomplish the same thing, see [[org-diary-class][this FAQ]].
2876 Another diary function commonly used for more complex scheduling is
2877 diary-float. For instance,
2879 #+begin_src org
2880   ,* Monthly meeting
2881   ,  <%%(diary-float t 3 3)>
2882 #+end_src
2884 ...would appear on the third Wednesday of every month.
2886 For more ideas on how to create diary special expressions, see [[http://www.emacswiki.org/cgi-bin/wiki/DiaryMode][this
2887 page on the Emacs wiki]].
2889 ** How can I schedule a weekly class that lasts for a limited period of time?
2890    :PROPERTIES:
2891    :CUSTOM_ID: org-diary-class
2892    :END:
2894 Org-mode offers a convenient diary sexp function for setting up a
2895 recurring appointment that lasts for a certain period of time, such as
2896 a class. It is called org-diary-class and it can be entered as
2897 follows:
2899 #+begin_src org
2900   ,** Class 7:00pm-9:00pm
2901   ,   <%%(org-diary-class 2 16 2009 4 20 2009 1 10)>
2902 #+end_src
2904 The function above schedules an appointment for every Monday (1)
2905 between February 16 and April 20, 2009, except for ISO week 10 (March
2906 1 to March 7).
2908 If you would prefer not to place the timestamp in the headline, you
2909 can use the following format:
2911 #+begin_src org
2912   ,** Class
2913   ,%%(org-diary-class 2 16 2009 4 20 2009 1 10) 7:00pm-9:00pm Class
2915 #+end_src
2917 In this case, the string following the sexp will be displayed in the
2918 agenda.
2920 The function org-diary-class has the following format:
2922 : (org-diary-class M1 D1 Y1 M2 D2 Y2 DAYNAME &rest SKIP-WEEKS)
2924 M1/2, D1/2, and Y1/2 indicate the beginning and ending dates. Dayname
2925 takes the form of a number indicating the day of the week (0 = Sunday,
2926 1 = Monday, and so on...). In addition, one can add an optional
2927 argument SKIP-WEEKS to indicate weeks on the calendar that should be
2928 skipped. This argument should be expressed as an ISO week number. You
2929 can find the number by invoking emacs' built-in calendar (=M-x
2930 calendar=), navigating to the appropriate week, and typing =p c=
2931 (calendar-iso-print-date).
2933 Please note: the order of the month, day, and year arguments depends
2934 on the variables =calendar-date-style= and/or
2935 =european=calendar=style=. (See the documentation for these variables
2936 with C-h v or M-x describe variable.) For instance, the example above
2937 works if =calendar-date-style= is set to ='american=. If
2938 =calendar-date-style= is set to ='iso=, then the arguments to the
2939 org-diary-class sexp would have the following format:
2941 : (org-diary-class Y1 M1 D1 Y2 M2 D2 DAYNAME &rest SKIP-WEEKS)
2943 Here is an alternative method, shared by Paul Sexton on the org
2944 mailing list:
2946 Let's say you are taking night classes in Spanish. The class is every
2947 Wednesday evening at 7pm, starting on 18 August, and runs for 8 weeks.
2948 Org-mode's timestamps do not support limited occurrences of recurrent
2949 items -- you have to schedule the item with infinite recurrences, then
2950 delete it when it finishes.
2952 To schedule the Spanish classes, put the following in your =.emacs=:
2954 #+begin_src emacs-lisp
2955   (defun diary-limited-cyclic (recurrences interval m d y)
2956     "For use in emacs diary. Cyclic item with limited number of recurrences.
2957   Occurs every INTERVAL days, starting on YYYY-MM-DD, for a total of
2958   RECURRENCES occasions."
2959     (let ((startdate (calendar-absolute-from-gregorian (list m d y)))
2960           (today (calendar-absolute-from-gregorian date)))
2961       (and (not (minusp (- today startdate)))
2962            (zerop (% (- today startdate) interval))
2963            (< (floor (- today startdate) interval) recurrences))))
2964 #+end_src
2965 The item in the org file looks like this:
2967 #+begin_src org
2968   ,** 19:00-21:00 Spanish lessons
2969   ,   <%%(diary-limited-cyclic 8 7 8 18 2010)>
2970 #+end_src
2972 ** How can I set an event to occur every day except Saturday and Sunday?
2974 #+begin_src org
2975   ,** Daily meeting
2976   ,   <%%(memq (calendar-day-of-week date) '(1 2 3 4 5))>
2977 #+end_src
2979 ** How do I schedule events relative to Easter Sunday?
2981    Easter's date moves around from year to year according to a
2982    complicated set of criteria which I do not claim to understand.
2983    However the following code will allow you to schedule recurring
2984    events relative to Easter Sunday.
2986    Note: the function da-easter is from:
2987    http://github.com/soren/elisp/blob/master/da-kalender.el
2989    Put the following in your .emacs:
2991 #+begin_src emacs-lisp
2992   (defun da-easter (year)
2993     "Calculate the date for Easter Sunday in YEAR. Returns the date in the
2994   Gregorian calendar, ie (MM DD YY) format."
2995     (let* ((century (1+ (/ year 100)))
2996            (shifted-epact (% (+ 14 (* 11 (% year 19))
2997                                 (- (/ (* 3 century) 4))
2998                                 (/ (+ 5 (* 8 century)) 25)
2999                                 (* 30 century))
3000                              30))
3001            (adjusted-epact (if (or (= shifted-epact 0)
3002                                    (and (= shifted-epact 1)
3003                                         (< 10 (% year 19))))
3004                                (1+ shifted-epact)
3005                              shifted-epact))
3006            (paschal-moon (- (calendar-absolute-from-gregorian
3007                              (list 4 19 year))
3008                             adjusted-epact)))
3009       (calendar-dayname-on-or-before 0 (+ paschal-moon 7))))
3012   (defun da-easter-gregorian (year)
3013     (calendar-gregorian-from-absolute (da-easter year)))
3015   (defun calendar-days-from-easter ()
3016     "When used in a diary sexp, this function will calculate how many days
3017   are between the current date (DATE) and Easter Sunday."
3018     (- (calendar-absolute-from-gregorian date)
3019        (da-easter (calendar-extract-year date))))
3020 #+end_src
3022     Now we can schedule the public holidays associated with Easter as
3023     recurring events. Good Friday is 2 days before "Easter", Easter
3024     Monday is one day after.
3026 #+begin_src org
3027   ,* Good Friday
3028   ,  <%%(= -2 (calendar-days-from-easter))>
3030   ,* Easter Sunday
3031   ,  <%%(= 0 (calendar-days-from-easter))>
3033   ,* Easter Monday
3034   ,  <%%(= 1 (calendar-days-from-easter))>
3035 #+end_src
3036    [Source: Posted by Paul Sexton on Org-mode mailing list.]
3038 ** How to schedule public holiday that is "the nearest Monday to DATE"?
3040    In New Zealand each regional capital has an "Anniversary Day". The
3041    date of Auckland's anniversary day is "the nearest Monday to 29
3042    January".
3044    Put this in your =.emacs=:
3046 #+begin_src emacs-lisp
3047   (defun calendar-nearest-to (target-dayname target-day target-month)
3048     "Recurring event that occurs in the nearest TARGET-DAYNAME to
3049   the date TARGET-DAY, TARGET-MONTH each year."
3050     (interactive)
3051     (let* ((dayname (calendar-day-of-week date))
3052            (target-date (list target-month target-day (calendar-extract-year date)))
3053            (days-diff (abs (- (calendar-day-number date)
3054                               (calendar-day-number target-date)))))
3055       (and (= dayname target-dayname)
3056            (< days-diff 4))))
3057 #+end_src
3059    Now we can schedule Auckland Anniversary Day. The first argument,
3060    1, means Monday (days of the week are numbered starting with
3061    Sunday=0).
3063    [Source: Originally posted by Paul Sexton on Org-mode mailing list.]
3065 ** How to schedule public holiday on "the 4th Monday in October"?
3067    This does not require any additions to =.emacs=:
3069 #+begin_src org
3070   ,* Labour Day (NZ)
3071   ,  <%%(diary-float 10 1 4)>
3072 #+end_src
3074 ** Why isn't the agenda showing all the times I put under a single entry?
3075    :PROPERTIES:
3076    :CATEGORY: multiple-timestamps-same-entry
3077    :END:
3079 Probably because you have not set the following variable:
3081 : org-agenda-skip-additional-timestamps-same-entry
3083 The default value of this variable is t, which means that entries with
3084 multiple timestamps, such as the following...
3086 #+begin_src org
3087   ,* Work really, really hard
3088   ,  <2010-11-20 Sat 10:00>
3089   ,  <2010-11-20 Sat 14:00>
3090 #+end_src
3092 ...will only appear in the agenda at the time specified by the first
3093 timestamp. If you set org-agenda-skip-additional-timestamps-same-entry
3094 to nil, the item will appear will appear at all the times you specify.
3096 ** Can I import iCal events/appts from Gnus?
3098 Yes.  Vagn Johansen wrote [[http://ozymandias.dk/emacs/org-import-calendar.el][org-import-calendar.el]] which lets you do this.
3100 * Export
3101   :PROPERTIES:
3102   :CUSTOM_ID: Export
3103   :END:
3104 ** Can I get TODO items exported to HTML as lists, rather than as headlines?
3105    :PROPERTIES:
3106    :CUSTOM_ID: export-TODO-items-as-lists
3107    :END:
3109    If you plan to use ASCII or HTML export, make sure things you want to
3110    be exported as item lists are level 4 at least, even if that does
3111    mean there is a level jump.  For example:
3113    : * Todays top priorities
3114    : **** TODO write a letter to xyz
3115    : **** TODO Finish the paper
3116    : **** Pick up kids at the school
3118    Alternatively, if you need a specific value for the heading/item
3119    transition in a particular file, use the =#+OPTIONS= line to
3120    configure the H switch.
3122    : #+OPTIONS:   H:2; ...
3124 ** Can I export only a single subtree?
3125    :PROPERTIES:
3126    :CUSTOM_ID: export-single-subtree
3127    :END:
3129 If you want to export a subtree, mark the subtree as region and then
3130 export. Marking can be done with =C-c @ C-x C-x=, for example.
3132 Alternatively, you can select option =1= in the org export dispatcher
3133 (e.g.., =C-c C-e 1 h= to export the current subtree to html).
3135 By default, the title of the exported file will be set to the heading
3136 of the subtree. You can, however, [[#export-options-for-subtree][customize the title and other export
3137 options]].
3139 ** How can I customize export options for a single subtree?
3140    :PROPERTIES:
3141    :CUSTOM_ID: export-options-for-subtree
3142    :END:
3144 You can set unique export options for a [[#export-single-subtree][single subtree]] by using
3145 properties. Relevant properties include:
3147  - EXPORT_TITLE
3148  - EXPORT_AUTHOR
3149  - EXPORT_DATE
3150  - EXPORT_FILE_NAME
3151  - EXPORT_OPTIONS (corresponds to the =#+OPTIONS:= [[http://orgmode.org/manual/Export-options.html#Export-options][configuration line]])
3153 ** How can I tell my calendar web application about appointments in my agenda files?
3155 Here is what you need to do:
3157 1. a script that calls Emacs in batch mode and produce a .ics file
3158 2. a script that uploads this .ics file somewhere on the web
3159 3. tell your webapp to fetch this .ics file on the web
3161 Here is the script I use for the first step:
3163 #+begin_src shell-script-mode
3164 #!/bin/bash
3166 /usr/local/bin/emacs --batch --eval \
3167 "(progn (load-file \"~/install/git/org-mode/org.el\") \
3168         (load-file \"~/elisp/config/org-batch-config.el\") \
3169         (setq org-combined-agenda-icalendar-file \"~/org/cal/org.ics\")
3170         (setq org-agenda-files (quote (\"~/org/bzg.org\"))))" \
3171     -f org-export-icalendar-combine-agenda-files
3172 #+end_src
3174 Depending on your configuration, you might change the load sequence.
3176 Here is the script I use for the second step:
3178 #+begin_src shell-script-mode
3179 #!/bin/bash
3180 /usr/bin/rsync -rtv ~/org/org.ics -e ssh me@my_server:/home/me/public_html/
3181 #+end_src
3183 Note: if you want to cron this rsync script, you will need to let
3184 =my_server= to know about your SSH public key.  Check [[http://troy.jdmz.net/rsync/index.html][this page]] as a
3185 starter.
3187 Now you can cron the two scripts above and your webapp will always be
3188 up to date with your Org agendas.
3190 Also see [[http://orgmode.org/org.html#Exporting-Agenda-Views][Exporting agenda views]] from Org manual.
3192 ** How can I get Mac OSX 10.3 iCal to import my Org-exported .ics files?
3193    :PROPERTIES:
3194    :CUSTOM_ID: iCal-import-ics-files-old
3195    :END:
3197    When using iCal under Apple MacOS X Tiger, you can create a new
3198    calendar /OrgMode/ (the default name for the calendar created by =C-c
3199    C-e c=, see the variables =org-icalendar-combined-name= and
3200    =org-combined-agenda-icalendar-file=).  Then set Org-mode to
3201    overwrite the corresponding file /~/Library/Calendars/OrgMode.ics/.
3202    You may even use AppleScript to make iCal re-read the calendar files
3203    each time a new version of /OrgMode.ics/ is produced.  Here is the
3204    setup needed for this:
3206    : (setq org-combined-agenda-icalendar-file
3207    :     "~/Library/Calendars/OrgMode.ics")
3208    : (add-hook 'org-after-save-iCalendar-file-hook
3209    :  (lambda ()
3210    :   (shell-command
3211    :    "osascript -e 'tell application \"iCal\" to reload calendars'")))
3213 ** How can I get Mac OSX 10.4 or later iCal to import my Org-exported .ics files?
3214    :PROPERTIES:
3215    :CUSTOM_ID: iCal-import-ics-files-new
3216    :END:
3218    For Mac OS X 10.4, you need to write the ics file to
3219    =/Library/WebServer/Documents/= and then subscribe iCalendar to
3220    =http: //localhost/orgmode.ics=
3222 ** How can I remove timestamps and todo keywords from my exported file?
3223    :PROPERTIES:
3224    :CUSTOM_ID: export-options-remove-timestamps
3225    :END:
3227 You can place an options line at the top of your org file:
3229 : #+OPTIONS: <:nil todo:nil
3231 There is a whole host of export options you can set with an in-buffer
3232 options or via global variables. See [[http://orgmode.org/manual/Export-options.html#Export-options][this section]] of the manual for a
3233 full list.
3235 ** How can I preserve faces when I export an agenda from the command line?
3236    :PROPERTIES:
3237    :CUSTOM_ID: preserving-faces-during-batch-export
3238    :END:
3240 Normally, when you export an org file or an agenda view from within
3241 emacs, htmlize will convert your face definitions to direct color css
3242 styles inlined into each =<span>= object, resulting in an HTML output
3243 that preserves the general look of your Org buffers and agenda views.
3245 Let's say you generate an export from the command line, such as the
3246 following:
3248 : emacs -batch -l ~/.emacs -eval '(org-batch-agenda "e")'
3252 : emacs -batch -l ~/.emacs -eval '(org-publish-all)'
3254 In such an instance, the exported HTML will contain only very basic
3255 color styles. The reason is that when Emacs is run in batch mode, it
3256 does not have a display and therefore only rudimentary face
3257 definitions.  If you'd like to use more complex styles, you'll have to
3258 make sure that the export process only assigns classes instead of
3259 direct color values.  This can be done by binding the variable
3260 =org-export-htmlize-output-style= to =css= for the duration of the
3261 export, for example with
3263 : emacs -batch -l ~/.emacs
3264 :   -eval '(let ((org-export-htmlize-generate-css (quote css)))
3265 :            (org-batch-agenda "e"))'
3267 Then you can use a style file to make these classes look any way you
3268 like.  To generate face definitions for a CSS file based on any faces
3269 you are currently using in Emacs, you can use the following command:
3271 : M-x org-export-htmlize-generate-css RET
3273 This will generate a =<style>...</style>= section, the content of
3274 which you can add to your style file.
3276 ** How can I avoid dark color background when exporting agenda to ps format?
3277    :PROPERTIES:
3278    :CUSTOM_ID: avoiding-dark-background-when-exporting-agenda
3279    :END:
3281 Add this to your .emacs and evaluate it.
3283 #+BEGIN_SRC emacs-lisp
3284   (setq org-agenda-exporter-settings
3285         '((ps-print-color-p 'black-white)))
3286 #+END_SRC
3288 ** How can I include e.g. an abstract in export to Latex and HTML?
3289    :PROPERTIES:
3290    :CUSTOM_ID: include-abstract-in-export-to-latex-and-html
3291    :END:
3293 Org does not currently have special markup for abstracts, but for
3294 export purposes, you can extend the block-level structural and
3295 semantic markup in Org with the contributed package [[file:org-contrib/org-special-blocks.org][org-special-blocks]]
3296 (by Chris Gray). To turn it on, put this in your =.emacs=:
3298 : (require 'org-special-blocks)
3300 Now, you can mark up the abstract of your article like this:
3302 : #+BEGIN_ABSTRACT
3303 : Falling apples were observed and compared with pears. Newton's laws
3304 : were confirmed at the 95% confidence level.
3305 : #+END_ABSTRACT
3307 Exporting to Latex wraps this in a
3308 =\begin{abstract}....\end{abstract}= environment, which just works.
3310 HTML export wraps it in a ~<div class="abstract">...</div>~
3311 element. The HTML result won't look like anything special until you
3312 style it. Here is some sample CSS to get you started; put these in
3313 your document header:
3315 : #+STYLE: <style>.abstract {margin: 1em; padding: 1em; border: 1px solid black}
3316 : #+STYLE: .abstract:before {content: "Abstract: "; font-weight: bold}</style>
3318 Generally, =#+begin_foo= will work for any simple Latex =foo=
3319 environment not supported by existing Org markup.
3321 If you need to pass parameters, process the block content in some way,
3322 or support other exporters, you may want to consider whether you can
3323 customize it using Eric Schulte's [[file:org-contrib/org-exp-blocks.org][org-exp-blocks]] instead.
3325 ** How can I get colored source code when exporting to LaTeX?
3326    :PROPERTIES:
3327    :CUSTOM_ID: fontified_source_code_w_latex
3328    :END:
3330 As of Sun Aug 9 2009 the "current" version of Org-mode (see
3331 [[keeping-current-with-Org-mode-development]]) supports exporting
3332 source code to LaTeX using the listings package.
3334 To turn on listing export add the following to your Org-mode
3335 customization.
3336 #+begin_src emacs-lisp
3337   ;; requite org-latex so that the following variables are defined
3338   (require 'org-latex)
3340   ;; tell org to use listings
3341   (setq org-export-latex-listings t)
3343   ;; you must include the listings package
3344   (add-to-list 'org-export-latex-packages-alist '("" "listings"))
3346   ;; if you want colored source code then you need to include the color package
3347   (add-to-list 'org-export-latex-packages-alist '("" "color"))
3348 #+end_src
3350 The listings package will now be used to fontify source code in your
3351 LaTeX documents.  By default listings will not color any of your
3352 source code.  If you would like to set colors for keywords and
3353 comments in your latex documents you can do so using LaTeX directives
3354 like the following.
3355 #+begin_src latex
3356   \lstset{keywordstyle=\color{blue},
3357     commentstyle=\color{red},
3358     stringstyle=\color{green}
3359   }
3360 #+end_src
3362 of if you want to get even fancier with your colors you can try
3363 something like the following
3364 #+begin_src latex
3365 \definecolor{keywords}{RGB}{255,0,90}
3366 \definecolor{comments}{RGB}{60,179,113}
3367 \definecolor{fore}{RGB}{249,242,215}
3368 \definecolor{back}{RGB}{51,51,51}
3369 \lstset{
3370   basicstyle=\color{fore},
3371   keywordstyle=\color{keywords},
3372   commentstyle=\color{comments},
3373   backgroundcolor=\color{back}
3375 #+end_src
3377 For more complex listings use cases consult the [[ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/listings/listings.pdf][listings manual]].
3379 ** How can I export to Latex Beamer
3380    :PROPERTIES:
3381    :CUSTOM_ID: beamer
3382    :END:
3383 The latex [[http://latex-beamer.sourceforge.net/][Beamer Class]] is a useful class for generating slide shows.
3384 The following can be used to export Org-mode documents to LaTeX
3385 beamer.
3387 Add the following to your Emacs initialization file.
3388 #+begin_src emacs-lisp
3389   (unless (boundp 'org-export-latex-classes)
3390     (setq org-export-latex-classes nil))
3391   (add-to-list 'org-export-latex-classes
3392                '("beamer"
3393                  "\\documentclass[11pt]{beamer}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{hyperref}\n\\usepackage{verbatim}\n"
3394                  ("\\section{%s}" . "\\section*{%s}")
3395                  ("\\begin{frame}\\frametitle{%s}" "\\end{frame}"
3396                   "\\begin{frame}\\frametitle{%s}" "\\end{frame}")))
3397 #+end_src
3399 Then by placing
3400 : #+LaTeX_CLASS: beamer
3401 in the header of your Org-mode document it will automatically export
3402 to the Beamer document class on LaTeX export.  With the above
3403 configuration top-level headers will be mapped to sections in the
3404 Beamer document, second-level headers will be mapped to frames, and
3405 lower level headlines will be mapped to itemize objects.
3407 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
3408 Thomas Dye]].  For a much more complex Beamer setup see the [[http://article.gmane.org/gmane.emacs.orgmode/17767/match=beamer+dokos][email by
3409 Thomas Dye]].
3411 ** How can I use RefTeX in Org-mode files for LaTeX export and in Org-babel LaTeX code blocks?
3412    :PROPERTIES:
3413    :CUSTOM_ID: using-reftex-in-org-mode
3414    :END:
3416 [[http://www.gnu.org/software/auctex/reftex.html][RefTeX]] is an indispensable tool for the author of LaTeX documents.  It
3417 aids in creation of bibliographies, cross-references, indexes, and
3418 glossaries.  RefTeX understands the structure of multi-file LaTeX
3419 documents and is able to collect from them information about the
3420 location(s) of external data stores used in creation of the final
3421 document.  RefTeX was written by Carsten Dominik and is currently
3422 being maintained by the [[http://www.gnu.org/software/auctex/index.html][AucTeX]] project.
3424 *** Using RefTeX In Org-mode Files for LaTeX Export
3425 In Org-mode files for LaTeX export, the trick is to find a way to tell
3426 RefTeX the locations of external data stores.  One way is to set the
3427 variable, =reftex-default-bibliography=.  Add lines like these to
3428 .emacs:
3430 #+begin_src emacs-lisp
3431   (setq reftex-default-bibliography
3432         (quote
3433          ("default.bib" "other-default.bib")))
3434 #+end_src
3436 In practice, this is a limited solution and the
3437 typical user will want to pass this information on a per-file basis.
3438 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
3439 Braindump]].
3441 The first solution, proposed by Mario, enables the RefTeX citation
3442 function in Org-mode.  Add these lines to .emacs:
3444 #+begin_src emacs-lisp
3445   (defun org-mode-reftex-setup ()
3446     (load-library "reftex")
3447     (and (buffer-file-name)
3448          (file-exists-p (buffer-file-name))
3449          (reftex-parse-all))
3450     (define-key org-mode-map (kbd "C-c )") 'reftex-citation))
3451   (add-hook 'org-mode-hook 'org-mode-reftex-setup)
3452 #+end_src
3454 Then add the following lines anywhere in the Org-mode file (Org-mode
3455 will recognize them as LaTeX commands):
3457 #+begin_src org
3458 \bibliographystyle{plain}
3459 \bibliography{BIB-NAME}
3460 #+end_src
3462 With this setup, =C-c )= will invoke =reftex-citation= which will
3463 insert a reference in the usual way:
3465 #+begin_src org
3466   ,* test reftex
3468   ,This is a citation \cite{tierney90}.
3470   ,\bibliographystyle{plain}
3471   ,\bibliography{tsd}
3472 #+end_src
3474 This Org-mode file will export the following LaTeX output:
3476 #+begin_src latex :exports code
3477   % Created 2010-03-22 Mon 14:34
3478   \documentclass[11pt,letter]{article}
3479   \usepackage[utf8]{inputenc}
3480   \usepackage[T1]{fontenc}
3481   \usepackage{hyperref}
3483   \title{test.org}
3484   \author{Tom Dye}
3485   \date{2010-03-22 Mon}
3487   \begin{document}
3489   \maketitle
3491   \setcounter{tocdepth}{3}
3492   \tableofcontents
3493   \vspace*{1cm}
3495   \section{test reftex}
3496   \label{sec-1}
3499   This is a citation \cite{tierney90}.
3501   \bibliographystyle{plain}
3502   \bibliography{tsd}
3504   \end{document}
3505 #+end_src
3508 A second solution, to activate the RefTeX minor mode on a per-file
3509 basis, was posted by Kevin Brubeck Unhammer in response to this idea.
3510 Add the following lines to .emacs:
3512 #+begin_src emacs-lisp
3513   (add-hook ‘org-mode-hook
3514              (lambda ()
3515                (if (member “WRITE” org-todo-keywords-1)
3516                    (org-mode-article-modes))))
3517 #+end_src
3519 where =org-mode-article-modes= is defined as follows:
3521 #+begin_src emacs-lisp
3522   (defun org-mode-article-modes ()
3523     (reftex-mode t)
3524     (bib-cite-minor-mode t)
3525     (and (buffer-file-name)
3526          (file-exists-p (buffer-file-name))
3527          (reftex-parse-all)))
3528 #+end_src
3530 Add the =\bibliographystyle{}= and =\bibliography{}= lines to the
3531 Org-mode file as before and define a TODO keyword, =WRITE=, perhaps
3532 like this:
3534 #+begin_src org
3535   ,#+TODO: TODO(t) STARTED(s) WRITE | DONE(d) DEFERRED(f)
3536 #+end_src
3538 With this setup, you insert a citation with =M-x reftex-citation RET=.
3540 *** Using RefTeX in Org-babel LaTeX Code Blocks
3542 In Org-babel LaTeX code blocks, the trick is to give RefTeX access to
3543 information in other Org-babel LaTeX code blocks.  If you use an Emacs
3544 starter kit where configuration information is held in Org-mode files,
3545 then the second solution is preferable because you won't be asked for
3546 a master file when Emacs is started.  For this reason, the second
3547 solution is modified for use with Org-babel latex code blocks.  No
3548 key-binding is needed here because Org-babel code blocks are edited
3549 within the usual AucTeX environment.
3551 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]])
3552 #+begin_src emacs-lisp
3553   (defun org-mode-article-modes ()
3554     (reftex-mode t)
3555     (and (buffer-file-name)
3556          (file-exists-p (buffer-file-name))
3557          (reftex-parse-all)))
3559   (add-hook 'org-mode-hook
3560             (lambda ()
3561               (if (member "REFTEX" org-todo-keywords-1)
3562                   (org-mode-article-modes))))
3563 #+end_src
3565 Then add a line like the following line to the top of your org-mode file:
3567 #+begin_src org
3568   ,#+TODO: TODO(t) STARTED(s) | DONE(d) DEFERRED(f) REFTEX
3569 #+end_src
3571 When you open an org-mode file with a line like this, RefTeX will
3572 prompt for the master .tex file, which will be parsed in the usual
3573 way.  This means that the .tex file should already exist, perhaps by
3574 tangling the LaTeX preamble and postamble, before
3575 =org-mode-article-modes= is activated for the Org-mode file.
3577 ** How can I use XeLaTeX for LaTeX export instead of pdfLaTeX?
3578    :PROPERTIES:
3579    :CUSTOM_ID: using-xelatex-for-pdf-export
3580    :END:
3581 [[http://en.wikipedia.org/wiki/XeTeX][ XeLaTeX]] is an alternative to pdfLaTeX for typesetting LaTeX
3582 documents. XeTeX can use any fonts installed in the operating system
3583 without configuring TeX font metrics, and can make direct use of
3584 advanced typographic features of OpenType and other font formats. By
3585 default, org-mode exports =org= files to =pdf= via pdfLaTeX.
3587 Here is one way to smoothly incorporate XeLaTeX into org-mode's export
3588 process. This solution takes advantage of [[http://www.phys.psu.edu/~collins/software/latexmk-jcc][latexmk]], a perl script that
3589 intelligently and automatically manages latex compilation. It
3590 is included with TeXLive, but at present the version included is not
3591 quite up-to-date enough for our needs. Version 4.20 and higher
3592 includes an option allowing you to specify which program to use when
3593 "pdflatex" is called. Install a current version of latexmk as per the
3594 instructions on the [[http://www.phys.psu.edu/~collins/software/latexmk-jcc][latexmk]] site. If necessary, disable the older
3595 version that comes with TeXLive. This is likely in =/usr/texbin/=, and
3596 you should rename or remove it. Then you can put the following in your
3597 =~/.emacs.d/= or equivalent:
3599 #+begin_src emacs-lisp
3600   (require 'org-latex)
3601   (setq org-export-latex-listings t)
3603   ;; Originally taken from Bruno Tavernier: http://thread.gmane.org/gmane.emacs.orgmode/31150/focus=31432
3604   ;; but adapted to use latexmk 4.20 or higher.
3605   (defun my-auto-tex-cmd ()
3606     "When exporting from .org with latex, automatically run latex,
3607        pdflatex, or xelatex as appropriate, using latexmk."
3608     (let ((texcmd)))
3609     ;; default command: oldstyle latex via dvi
3610     (setq texcmd "latexmk -dvi -pdfps -quiet %f")
3611     ;; pdflatex -> .pdf
3612     (if (string-match "LATEX_CMD: pdflatex" (buffer-string))
3613         (setq texcmd "latexmk -pdf -quiet %f"))
3614     ;; xelatex -> .pdf
3615     (if (string-match "LATEX_CMD: xelatex" (buffer-string))
3616         (setq texcmd "latexmk -pdflatex=xelatex -pdf -quiet %f"))
3617     ;; LaTeX compilation command
3618     (setq org-latex-to-pdf-process (list texcmd)))
3620   (add-hook 'org-export-latex-after-initial-vars-hook 'my-auto-tex-cmd)
3623   ;; Specify default packages to be included in every tex file, whether pdflatex or xelatex
3624   (setq org-export-latex-packages-alist
3625         '(("" "graphicx" t)
3626               ("" "longtable" nil)
3627               ("" "float" nil)))
3629   (defun my-auto-tex-parameters ()
3630         "Automatically select the tex packages to include."
3631         ;; default packages for ordinary latex or pdflatex export
3632         (setq org-export-latex-default-packages-alist
3633               '(("AUTO" "inputenc" t)
3634                 ("T1"   "fontenc"   t)
3635                 (""     "fixltx2e"  nil)
3636                 (""     "wrapfig"   nil)
3637                 (""     "soul"      t)
3638                 (""     "textcomp"  t)
3639                 (""     "marvosym"  t)
3640                 (""     "wasysym"   t)
3641                 (""     "latexsym"  t)
3642                 (""     "amssymb"   t)
3643                 (""     "hyperref"  nil)))
3645         ;; Packages to include when xelatex is used
3646         (if (string-match "LATEX_CMD: xelatex" (buffer-string))
3647             (setq org-export-latex-default-packages-alist
3648                   '(("" "fontspec" t)
3649                     ("" "xunicode" t)
3650                     ("" "url" t)
3651                     ("" "rotating" t)
3652                     ("american" "babel" t)
3653                     ("babel" "csquotes" t)
3654                     ("" "soul" t)
3655                     ("xetex" "hyperref" nil)
3656                     )))
3658         (if (string-match "LATEX_CMD: xelatex" (buffer-string))
3659             (setq org-export-latex-classes
3660                   (cons '("article"
3661                           "\\documentclass[11pt,article,oneside]{memoir}"
3662                           ("\\section{%s}" . "\\section*{%s}")
3663                           ("\\subsection{%s}" . "\\subsection*{%s}")
3664                           ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
3665                           ("\\paragraph{%s}" . "\\paragraph*{%s}")
3666                           ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
3667                         org-export-latex-classes))))
3669   (add-hook 'org-export-latex-after-initial-vars-hook 'my-auto-tex-parameters)
3670 #+end_src
3672 The =my-auto-tex-cmd= function looks at your =.org= file and checks
3673 whether you've specified which latex to use. If there are no
3674 instructions, it just runs regular old latex. If it finds the string
3675 =LATEX_CMD: pdflatex= in your file, it runs pdflatex. If it finds
3676 =LATEX_CMD: xelatex=, it runs xelatex. Because control is handed off
3677 to latexmk, nothing else is needed: it takes care of figuring things
3678 out so that the references and citations are correct.
3680 The second half of the code above specifies the latex packages that
3681 will be included in the =.tex= file. The variable
3682 =org-export-latex-packages-alist= specifies a list of packages that
3683 are always included in the header of latex documents, regardless of
3684 how they are compiled. The variable
3685 =org-export-latex-default-packages-alist= adds additional packages
3686 depending on whether latex/pdflatex or xelatex is being used. You can
3687 change the content of these as needed.
3689 Finally, the =org-export-latex-classes= variable redefines elements of
3690 the =.tex= file's preamble for the xelatex case. These can also be
3691 customized as needed.
3693 By way of example, an =.org= file you want compiled with xelatex might
3694 contain the following header:
3696 : #+TITLE: My Paper
3697 : #+AUTHOR: Jane Doe
3698 : #+DATE:
3699 : #+OPTIONS: toc:nil num:nil
3700 : #+LATEX_CMD: xelatex
3701 : #+LATEX_HEADER: \setsansfont[Mapping=tex-text]{Unit-Bold}
3702 : #+LATEX_HEADER: \setmonofont[Mapping=tex-text,Scale=MatchLowercase]{PragmataPro}
3703 : #+LATEX_HEADER: \setromanfont[Mapping=tex-text,Numbers=OldStyle]{Minion Pro}
3705 If you always want to have the same font setup in your xelatex
3706 documents, the =fontspec= commands setting the font choices can be
3707 put in the =org-export-latex-classes= setting instead.
3709 The upshot is that when you want to export an =.org= file using
3710 XeLaTeX, you can now simply make sure the line =LATEX_CMD: xelatex= is
3711 in your =.org= file, then do =C-c C-e d= as usual, and org-mode, with
3712 latexmk in the background, does the rest for you.
3714 ** Why is my exported PDF file almost unreadable?
3715    :PROPERTIES:
3716    :CUSTOM_ID: unreadable-pdfs
3717    :END:
3719 Some PDF viewers (earlier versions (< v6) of Acrobat Reader, Evince,
3720 possibly others) do not get along with Adobe Type3 fonts, producing
3721 almost unreadable screen output (printed output is OK). If you see
3722 this, first verify the fonts that your document uses: open it with
3723 Acrobat Reader or Evince, select "Properties" from the "File" menu and
3724 click on the "Fonts" tab; alternatively, you can use the pdffonts
3725 program (part of the xpdf-reader package) from the command line.  If
3726 that is indeed the problem, then either use a different viewer or
3727 install Type1 versions of the problematic fonts. For more details, see
3728 the "PDF export" section of [[./org-dependencies.org][org-dependencies]].
3730 ** Can I add attributes to a link or an image in HTML export?
3731    :PROPERTIES:
3732    :CUSTOM_ID: html-image-and-link-attributes
3733    :END:
3735 Yes.  Excerpt from [[http://orgmode.org/manual/Images-in-HTML-export.html#Images-in-HTML-export][Org's manual]]:
3737 If you need to add attributes to an inlined image, use a `#+ATTR_HTML'.
3738 In the example below we specify the `alt' and `title' attributes to
3739 support text viewers and accessibility, and align it to the right.
3741 :  #+CAPTION: A black cat stalking a spider
3742 :  #+ATTR_HTML: alt="cat/spider image" title="Action!" align="right"
3743 :  [[./img/a.jpg]]
3745 and you could use `http' addresses just as well.
3747 ** How can I export an org file to rtf, odt (Open Office), or doc (Word)?
3748    :PROPERTIES:
3749    :CUSTOM_ID: convert-to-open-office
3750    :END:
3752 There are two approaches:
3753 - Use the native Org->Odt exporter
3755   The OpenDocumentText exporter is distributed as =org-odt= package
3756   and can be installed using the Emacs package manager. The URL for
3757   the archive is as shown below.
3759   See [[http://repo.or.cz/w/org-mode/org-jambu.git/blob_plain/HEAD:/packages/README.html][Release Notes]] for more information on this package.
3761 #+begin_example
3762 ,----[ C-h v package-archives RET ]
3763 | package-archives is a variable defined in `package.el'.
3764 | Its value is
3765 | (("gnu" . "http://elpa.gnu.org/packages/")
3766 |  ("org-odt" . "http://repo.or.cz/w/org-mode/org-jambu.git/blob_plain/HEAD:/packages/"))
3768 | Original value was 
3769 | (("gnu" . "http://elpa.gnu.org/packages/"))
3771 `----
3772 #+end_example
3774 - Use existing exporters
3776   Export to one of org-mode's supported export formats and then use an
3777   external tool or method to convert the exported file to doc or odt.
3779   With simple documents, these methods work well. However for complex
3780   documents containing footnotes, embedded images, math formuale etc
3781   the results may be less than satisfactory. (Note, the lists below
3782   are by no means comprehensive).
3783   1. html -> odt/doc/rtf
3784      - open html in Open Office and save as odt/doc ([[http://permalink.gmane.org/gmane.emacs.orgmode/31482][see this post by
3785         Eric Fraga]])
3786      - [[http://www.artofsolving.com/opensource/pyodconverter][PyODConverter]]
3787      - [[http://johnmacfarlane.net/pandoc/][Pandoc]] (this works for LaTeX and docbook as well)
3788      - (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
3789         from html to doc
3790   2. LaTeX -> odt/doc/rtf
3791       - [[http://latex2rtf.sourceforge.net/][LaTeX2rtf]] (works well with index, footnotes, and references)
3792       - [[http://www.tug.org/tex4ht/][TeX4ht]] (works with more complex latex elements, though can be
3793         difficult to install)
3794         - run =mk4ht oolatex file.tex=
3796 See [[http://permalink.gmane.org/gmane.emacs.orgmode/31168][this thread]] for further details.
3798 * Backup
3800 Since =org= files are so central to your life, you probably want to back
3801 them up in a safe place.
3803 If the =org= file you want to back up are in a single directory, the
3804 preferred method is to us a =RCS= (Revision Control System) -- pick up your
3805 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
3806 RCS you use and how you use it, you can have a /local/ backup or sync it on
3807 a remote place.
3809 If you want to store all your =org= files from your =$HOME= to a single
3810 =~/org/backup/= folder, you can use this shell script (as [[http://article.gmane.org/gmane.emacs.orgmode/37655][suggested by
3811 Suvayu Ali]]):
3813 #+begin_src sh
3814 mkdir -p ~/org/backup && \
3815 find $HOME -type f -name '*\.org' ! -path "$HOME/org/*" \
3816      -exec cp -t ~/org/backup/ \{\} \;
3817 #+end_src
3819 It will recursively search for =org= files in your =$HOME= directory
3820 (except those in =~/org/backup/=) and copy them to =~/org/backup/=.
3821 You can then use rsync to make sure =~/org/backup/= also lives on a
3822 remote and safe place.
3824 * MobileOrg
3826 ** Which versions of MobileOrg do exist
3827    :PROPERTIES:
3828    :CUSTOM_ID: mobileorg_versions
3829    :END:
3831 - MobileOrg for the iPhone/iPod Touch/iPad series of devices, by
3832   Richard Moreland.  Check out
3833   [[http://mobileorg.ncogni.to/][Richard's page]]
3834 - Matt Jones is developing a feature-equivalent application for
3835   Android, see
3836   [[http://wiki.github.com/matburt/mobileorg-android/][his project page]].
3838 ** What can I do if I don't want to use Dropbox.com
3839    :PROPERTIES:
3840    :CUSTOM_ID: mobileorg_webdav
3841    :END:
3843 Dropbox.com is the easiest way to connect between Emacs and MobileOrg,
3844 you can get a free account there.  If for some reason you cannot or do
3845 not want to use this path, you can use any webdav server.  On this
3846 webdav server you need to create a dedicated directory for the
3847 communication between Emacs and MobileOrg.  If you can mount that
3848 directory locally so that Emacs can directly write to it, just point
3849 to that directory using the variable =org-mobile-directory=.  Using
3850 the /tramp/ method, =org-mobile-directory= may point to a remote
3851 directory accessible through, for example, /ssh/ and /scp/:
3853 #+begin_src emacs-lisp
3854 (setq org-mobile-directory "/scpc:user@@remote.host:org/webdav/")
3855 #+end_src
3857 If Emacs cannot access the WebDAV directory directly using a /tramp/
3858 method, you can use a local directory for staging.  Other means must
3859 then be used to keep this directory in sync with the WebDAV directory.
3860 In the following example, files are staged in =~/stage/=, and Org-mode
3861 hooks take care of moving files to and from the WebDAV directory using
3862 /scp/.
3864 #+begin_src emacs-lisp
3865 (setq org-mobile-directory "~/stage/")
3866 (add-hook 'org-mobile-post-push-hook
3867   (lambda () (shell-command "scp -r ~/stage/* user@@wdhost:mobile/")))
3868 (add-hook 'org-mobile-pre-pull-hook
3869   (lambda () (shell-command "scp user@@wdhost:mobile/mobileorg.org ~/stage/ ")))
3870 (add-hook 'org-mobile-post-pull-hook
3871   (lambda () (shell-command "scp ~/stage/mobileorg.org user@@wdhost:mobile/")))
3872 #+end_src
3874 * Mathjax
3876 ** How to install MathJax on my server?
3878 :PROPERTIES:
3879 :CUSTOM_ID: install_mathjax_on_server
3880 :END:
3882 Org uses MathJax as its default HTML display engine for equations.
3884 Org relies on the version of MathJax available from orgmode.org, but you
3885 might want to use another version and install MathJax on your own server.
3887 1. Download a [[http://sourceforge.net/projects/mathjax/files/][MathJax archive]].
3889 2. Upload it somewhere on your server (say http://me.org/mathjax/)
3891 3. Set the correct path in =org-export-html-mathjax-options= (i.e. replace
3892    http://orgmode.org/mathjax/MathJax.js by
3893    http://me.org/mathjax/MathJax.js)
3895 You can also get [[http://www.mathjax.org/resources/docs/?installation.html][MathJax from git or svn]] -- in this case, be careful not to
3896 forget to unzip the fonts.zip archive in the mathjax directory.
3898 * Tips and Tricks
3899 ** Problems with LaTeX macros with #+latex or #+begin_latex
3900   :PROPERTIES:
3901   :CUSTOM_ID: Problems-with-LaTeX-macros-with-#+latex-or-#+begin_latex
3902   :END:
3903 Org's LaTeX exporter has a difficult job on its hands and even though
3904 it does a great job most of the time, there are times when it falls
3905 short. One situation that has arisen a few times in the past is when a
3906 macro definition or use includes an opening brace, but the
3907 corresponding closing brace is on a different line. That has caused
3908 LaTeX compilation problems or mysterious excisions of content - see
3909 for example the following two threads in the mailing list:
3911  - http://thread.gmane.org/gmane.emacs.orgmode/39308
3912    
3913  - http://thread.gmane.org/gmane.emacs.orgmode/42196
3915 In both cases, the exporter was getting confused by the opening brace
3916 which did not have a corresponding closing brace on the same
3917 line. Although the first of these cases is fixed in current Org, there
3918 might be more such cases or there might be a regression which causes
3919 the incorrect behavior again. While waiting for a fix, it's worth
3920 trying out the simple workaround of including a fake closing brace on
3921 the same line as the opening brace but *commenting it out* so that
3922 LaTeX never sees it.  That is often enough to make the exporter behave
3923 properly. In other words, to take one of the examples above, instead
3924 of writing
3926 : #+latex: \custommacro {
3927 : ...
3928 : #+latex: }
3930 use the following idiom instead:
3932 : #+latex: \custommacro { % hide the closing brace in a LaTeX comment }
3933 : ...
3934 : #+latex: }
3936 I emphasize that this is a workaround, not a fix: if you do run into such
3937 a case and the workaround fixes it, at least you can continue working, but
3938 please submit a bug report so that it can be fixed properly.
3940 ** Inserting a Mairix type link when calling Orgmode capture in VM
3942 See the "rather crude solution" posted in [[http://robert-adesam.blogspot.com/2011/07/orgmode-capture-to-insert-mairix-link.html][this blog entry]] by Robert
3943 Adesam.  
3945 * COMMENT Function to create =CUSTOM_ID=
3947 #+begin_src emacs-lisp
3948   (defun org-faq-make-target ()
3949     "Make hard target for current headline."
3950     (interactive)
3951     (if (not (org-on-heading-p))
3952         (error "Not on a headline"))
3953     (let ((h (org-trim (org-get-heading 'no-tags))))
3954       (if (string-match "[ \t]*\\?\\'" h)
3955           (setq h (replace-match "" t t h)))
3956       (while (string-match "[ \t]+" h)
3957         (setq h (replace-match "-" t t h)))
3958       (org-entry-put nil "CUSTOM_ID" h)))
3959 #+end_src