worg.css: use Jason style.
[Worg.git] / org-faq-nojs.org
blobc48508f32c52a9c15fcdb37c33f67cec7d500ecb
1 #+EMAIL:     carsten.dominik@gmail.com
2 #+AUTHOR:    Worg people
3 #+LANGUAGE:  en
4 #+TITLE:     Org-mode Frequently Asked Questions
5 #+OPTIONS:   toc:t H:2
7 * Welcome
8   :PROPERTIES:
9   :CUSTOM_ID: Welcome
10   :END:
12 Welcome to the Org-mode FAQ.
14 * What is org-mode?
15   :PROPERTIES:
16   :CUSTOM_ID: What-is-org-mode
17   :END:
18 ** Can I implement a GTD workflow with Org-mode?
19    :PROPERTIES:
20    :CUSTOM_ID: GTD-workflow-with-Org-mode
21    :END:
23    Yes, you can.  Check for discussions and pointers [[http://orgmode.org/worg/org-gtd-etc.html][here]].
25 ** What is the difference between Org and TaskPaper?
26    :PROPERTIES:
27    :CUSTOM_ID: Org-and-TaskPaper
28    :END:
30   There is really no difference.  Org is as /simple/ as [[http://hogbaysoftware.com/products/taskpaper][TaskPaper]].  It
31   is just that, when using Org within Emacs, it lets you do many things
32   that you wouldn't be able to do with TaskPaper.  Yes, TaskPaper is
33   fiddle-proof and people using Emacs tends to like fiddling (which is
34   orthogonal to the idea of using todo-list efficiently), but this is
35   just a matter of discipline and common sense, not one of Org's design.
37   Read [[http://article.gmane.org/gmane.emacs.orgmode/6224][Carsten's enlightening statement]] on this.
38 ** What is the meaning of the Unicorn on Org's website?
39    :PROPERTIES:
40    :CUSTOM_ID: unicorn
41    :END:
43 The Unicorn is the logo of Org-mode because:
45 - Org-mode is the UNICs of ORgaNizers.
47 - Org-mode is an Emacs mode, so it makes sense to use an animal
48   similar or related to the gnu used for GNU Emacs.
50 - Org-mode is meant to show you the way, and an animal with two horns
51   can not do this very well, can it?
53 - Unicorn tears are said to reverse petrification, and wasn't this how
54   we all felt before getting to some degree of time and task
55   management?
57 - It will take forever to learn everything there is to know about a
58   unicorn.
60 - A unicorn is a fabulous creature.  Org-mode wants to be a fabulous
61   creation.
63 Using a unicorn was originally /Bastien Guerry's/ idea, his friend
64 /Christophe Bataillon/ designed the logo for us, and /Greg Newman/
65 gave it a refresh some time later.  Bastien writes why he chose a
66 unicorn:
68 #+BEGIN_QUOTE
69 The first reason is not linked to the animal, but to the sounding of the
70 word "Unicorn" - because Org gives you a /uni/que way of producing files
71 in several format (HTML, LaTeX, etc.)
73 The second reason is that a Unicorn doesn't really exist, it is just
74 something you can dream about, and make others believe it does exist.
75 Just like the perfect organizer.
76 #+END_QUOTE
78 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
79 Suckling]] posted a link showing how to make a simple foldable unicorn
80 (very appropriate for an outlining program!).
82 [[http://article.gmane.org/gmane.emacs.orgmode/11735][Tim Burt]] made a very complicated one which is now a treasured
83 possession of the Org-mode author.
85 - Official logo: [[http://orgmode.org/img/org-mode-unicorn.png]]
86   This logo is available in a number of different formats including
87   Photoshop /.psd/ and scaleable vector graphics /.svg/ [[http://orgmode.org/img/][here]].
89 - An [[http://orgmode.org/img/nrocinu4.jpg][alternative version]] from Christophe Bataillon (c):
91 - [[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]]:
93 - [[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
94   threshold technique".
96 - [[http://article.gmane.org/gmane.emacs.orgmode/11735/match%3D][Tim Burt]] made a folded Unicorn to match the spirit of Org - see the
97   whole set of pictures [[http://www.flickr.com/photos/tcburt/sets/72157614543357071/][on his flickr page]].
99 - Are unicorns real?  Answer [[http://article.gmane.org/gmane.emacs.orgmode/11687/match%3Drosslaird%2Bunicorn][here]] by Ross Laird.
101 * Mailing list
102 ** Why hasn't my email to the mailing list shown up yet?
103    :PROPERTIES:
104    :CUSTOM_ID: ml-post-delay
105    :END:
107 The org-mode mailing list is moderated. Thus, if you are not
108 subscribed to the mailing list, your mail will only appear on the list
109 after it has been approved by a moderator. To ensure that your mail
110 appears quickly, please [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe to the list]].
112 ** I read the mailing list through gmane. Should I subscribe?
113    :PROPERTIES:
114    :CUSTOM_ID: ml-subscription-and-gmane
115    :END:
117 The org-mode mailing list is available via nntp at [[http://dir.gmane.org/gmane.emacs.orgmode][Gmane]]. Many
118 participants in the list prefer read the list in a newsreader, such as
119 Gnus, instead of receiving emails. If you choose to read the list via
120 nntp, you can still [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe]] to the list and then opt not to receive
121 any emails on the mailman settings page (see the "Mail Delivery"
122 setting).
124 This will ensure that your messages to the list get through quickly,
125 reduce the work load of the mailing list moderators (who need to clear
126 every mail from non-members), and provide more accurate information
127 about the number of list readers.
129 * Keeping current
130   :PROPERTIES:
131   :CUSTOM_ID: Keeping-current
132   :END:
133 ** My Emacs ships with an older version Org-mode! How do I upgrade?
134    :PROPERTIES:
135    :CUSTOM_ID: updating-org
136    :END:
138 Org-mode develops quickly, which means that versions of Org-mode
139 shipped with Emacs are more or less out-of-date. If you'd like to
140 upgrade to the most recent version of org-mode, you have a number of
141 options.
143  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
144     follow the [[http://orgmode.org/manual/Installation.html#Installation][installation instructions]] in the manual.
145  2. Clone and install the development git repository as [[#keeping-current-with-Org-mode-development][explained
146     here]]. If you don't want to run the bleeding edge, you can still
147     use git [[#using-stable-releases-only][to track the most recent stable releases]].
148  3. Install and updated org-mode automatically through the Emacs
149     Package Manager as [[#installing-via-elpa][explained in this FAQ]].
151 ** How do I keep current with bleeding edge development?
152    :PROPERTIES:
153    :CUSTOM_ID: keeping-current-with-Org-mode-development
154    :END:
156    Org mode is developed in [[http://en.wikipedia.org/wiki/Git_(software)][Git]]. You can keep up-to-date with Org-mode
157    developement by cloning Org mode repository and refreshing your
158    copy with latest changes whenever you wish. You only need to use
159    two Git commands (clone and pull.) Here are the steps in brief
160    (please customize locations to suit your setup):
162    1. Select a location to house the Org mode repository (approx. 40
163       MB; includes documentation, compiled elisp files and history
164       going all the way back to v4.12a)
166       : $ mkdir $HOME/elisp && cd $HOME/elisp
168    2. Clone the Org mode Git repository.
170       Recommended approach:
172       : $ git clone git://orgmode.org/org-mode.git
174       You can also clone from this mirror (lagging one hour behind
175       orgmode.org repo):
177       : $ git clone git://repo.or.cz/org-mode.git
179       For those of you behind a firewall that allows only HTTP, you can
180       clone like this (can be somewhat slow), either from orgmode.org or
181       from repo.or.cz:
183       : $ git clone http://orgmode.org/org-mode.git
184       : $ git clone http://repo.or.cz/r/org-mode.git
186    3. Compile and install Org mode and build documentation.
188       : $ cd org-mode && make && make doc && make install
190       Please note that you can choose to /not/ compile at all and run
191       using source =.el= files only.  Compiled files speed things up.
193       Also note that running =make install= is necessary only if you'd
194       like to install org-mode system-wide.
196    4. This is where you configure Org mode with Emacs.  Please refer
197       to [[./org-tutorials/index.org][Org tutorials]].
199    5. Keeping up-to-date.
201       Cloning the repository is a one time activity.  From this point
202       onwards you only need to /pull/ the latest changes.
204       : $ cd $HOME/elisp/org-mode
206       and then
208       : $ git pull && make clean && make && make doc && make install
210    6. You should restart org mode to have the changes take effect (if
211       you are not rebooting Emacs.)  Also since the intention is to
212       "keep up" with Org mode, you should visit updated sections of
213       documentation for latest updates (use =git log=.)
215    7. As you use your repository over time it will accumulate loose objects.
216       You can reduce the total size of your git repository with
218       : $ git gc
220       which will consolidate loose git objects into pack files.  This
221       reduces the size of the repository and speeds up data access to
222       the objects.
224 ** How can I keep local changes and still track Org mode development?
225    :PROPERTIES:
226    :CUSTOM_ID: keeping-local-changes-current-with-Org-mode-development
227    :END:
229   Say you want to make minor changes to the Makefile to reflect your
230   location for =emacs=.
232   Create a local branch for your changes on top of origin/master as
233   follows:
235   : $ git checkout -b local origin/master
236   : $ git config branch.local.rebase true
237   : # Make your changes to the Makefile and create a new commit
238   : $ git add Makefile
239   : $ git commit -m 'My local Makefile configurations'
240   : # Update git to a newer version
241   : $ git pull
243   Now each time you pull new commits from the distribution repository
244   your local commits will be rewound and replayed on top of the new
245   origin/master.
247 -----------
249   You would normally work on your =local= branch which includes your
250   custom commits; there's no need to switch back to the =master=
251   branch.
253 -----------
255 Here is an example of dealing with conflict resolution during git pull.
257 If you get a conflict during a =git pull= you will need to edit the
258 file with the conflict to fix up the conflicting lines and then tell
259 git that you have resolved the conflict.
261 Conflict resolution goes something like this:
263 1. =git pull= fails with a conflict
264 2. edit the file
265 3. =git add= the file to mark the conflict resolved
266 4. =git rebase --continue=
267 5. lather, rinse, and repeat 2-4 as needed
269 For this example we have the following Makefile:
271 : #
272 : # Example Makefile
273 : #
275 : EMACS=emacs
277 : VERSION=V1.0
279 and we need to change the =EMACS=emacs= line to =EMACS=myemacs= to
280 make it work well on our system.
282 To do this we
284   - create a local branch for our work
286     : $ git checkout -b local origin/master
287     : $ git config branch.local.rebase true
289     This marks the branch so that all local commits on it are rebased
290     on top of any new commits we get in origin/master during a =git
291     pull= operation.
293   - Make our custom changes
295     Edit the makefile so it looks like this:
297     : #
298     : # Example Makefile
299     : #
300     :
301     : EMACS=myemacs
302     :
303     : VERSION=V1.0
305   - Create a commit with our custom changes
306     : $ git add Makefile
307     : $ git commit -m 'My local Makefile configurations'
309   - Later we do a =git pull= but that fails with conflicts.
311     : $ git pull
312     : remote: Counting objects: 5, done.
313     : ...
314     : Patch failed at 0001.
315     :
316     : When you have resolved this problem run "git rebase --continue".
317     : If you would prefer to skip this patch, instead run "git rebase --skip".
318     : To restore the original branch and stop rebasing run "git rebase --abort".
320   - Fix the conflict in your favourite editor
322     Conflict markers look like this:
324     : <<<<<<< HEAD:Makefile
325     : EMACS=emacs22
326     : =======
327     : EMACS=myemacs
328     : >>>>>>> Change emacs location:Makefile
330     This attempted =git pull= caused a conflict.  Fire up your
331     favourite editor and fix the conflict in the Makefile.  The
332     conflict markers are <<<<<<<<<< , ======= , and >>>>>>>>>>.  Fix
333     the Makefile appropriately and delete the conflict markers.  You
334     already edited these lines earlier so fixing it should be trivial.
336     In this case we changed =EMACS=emacs= to =EMACS=myemacs= and
337     upstream changed =EMACS=emacs= to =EMACS=emacs22=.  Just fix the
338     file and save it by deleting the conflict markers and keeping the
339     code you need (in this case the =EMACS=myemacs= line which we
340     originally modified.)
342   - Mark the file's conflict resolved
344     : $ git add Makefile
346     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.
348   - Continue the rebase operation
350     : $ git rebase --continue
352     If any other conflicts arise you fix them the same way - edit the file, mark the conflict resolved, and continue.
354 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"
355 using
356 : $ git rebase --abort
358 ** How can I use a stable release version instead of the bleeding edge master?
359    :PROPERTIES:
360    :CUSTOM_ID: using-stable-releases-only
361    :END:
363 The master branch of the git repository always contains the bleeding
364 edge development code.  This is important for Org's fast development,
365 because code on master gets checked out by many people daily and we
366 quickly receive bug reports if something is wrong.  On rare occasions,
367 this code may not function perfectly for a limited time while we are
368 trying to fix things.
370 Not everyone like to use this bleeding-edge code and face the danger
371 to hit a surprising bug.
373 Therefore, from time to time, we make a release.  This typically
374 happens when the maintainers feel that
376 1. they have reached a good point in the development
377 2. the code has a feature set that should stay and be supported in the
378    future
380 Stable releases are used as the basis for [[http://orgmode.org/index.html#sec-3_3][alternative distributions]] of
381 Org, and they are also the code that gets merged into the Emacs
382 distribution. If you want to work only with stable releases, you can
383 always download [[http://orgmode.org/index.html#sec-3][them here]], but you can also also use the git
384 repository to keep automatically up-to-date with the most recent
385 stable releases (and save bandwidth!). Here's how to do so:
387 *** Run a specific stable release
389 In the repository, do
391 : $ git fetch --tags
392 : $ git tag
394 To see which release tags are available.  Let's say you decide to use
395 =release_7.01f=.
397 : $ git checkout release_7.01f
399 This set the working tree of the repository to the state of Org at the
400 moment of release 7.01f.  You can then run Org from the repository be
401 sure to use the stable release while development continues on the
402 master branch.
404 Later, when we release 7.02, you can switch to that using
406 : $ git fetch --tags                   # to get all the new stuff
407 : $ git tag
408 : $ git checkout release_7.02
410 *** Always run the most recent stable release
412 Alternatively, if you just want to always run whatever the latest
413 stable release is, you can do
415 : $ git checkout -b stable origin/maint
417 and then regularly update this branch by doing
419 : $ git pull
421 ** How can I install an up-to-date version of org-mode without "make" tools?
422    :PROPERTIES:
423    :CUSTOM_ID: installing-org-without-make-tools
424    :END:
426 If you are using org-mode on a computer that lacks developer tools for
427 compiling software, such as [[http://www.gnu.org/software/make/][GNU Make]], you will have to use a
428 *different* installation method than [[http://orgmode.org/manual/Installation.html#Installation][the one outlined in the manual]].
430 Please see [[http://article.gmane.org/gmane.emacs.orgmode/15264][this thread]] on the mailing list for several different ways
431 you can install a recent version of org-mode without using the
432 customary =make clean && make && make install=.
434 The result of that discussion is the file/function found in
435 [[http://orgmode.org/worg/org-hacks.html#compiling-org-without-make]].
437 ** I don't use git. Can I download bleeding edge .zip and .tar.gz archives?
439    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 --
440    these archives are udpated every day at midnight.
442    Alternatively, you can download a [[http://orgmode.org/w/org-mode.git/snapshot][tar.gz snapshot from orgmode.org]].
444 ** How can I install Org-mode through Emacs' Package Manager?
445    :PROPERTIES:
446    :CUSTOM_ID: installing-via-elpa
447    :END:
449    Emacs 24 includes an automated package management tool ([[http://tromey.com/elpa/][ELPA]]) that
450    can be used to install and upgrade elisp packages such as Org-mode.
451    If you are running an older version of Emacs (23 or earlier), you
452    will have to install the package manager before using it to install
453    Org-mode. See [[#installing-elpa][this FAQ]] for more details.
455    Org-mode is distributed as an ELPA package from [[http://elpa.gnu.org/packages/][GNU Emacs Lisp
456    Package Archive]] as well as from [[http://orgmode.org/pkg/daily/][Org-mode Emacs Lisp Archive]].
457    
458    Steps for adding Org-mode as a package archive:
459    1. Add Org-mode as a package archive. This can be done in two ways.
460       1. Use =M-x customize-variable RET package-archives=
461       2. Add the following line to your =.emacs= and reload Emacs.
463          #+begin_src emacs-lisp
464            (add-to-list 'package-archives '("Org-mode" . "http://orgmode.org/pkg/daily/"))
465          #+end_src
466                 
467    2. Use the Emacs package manager's =M-x list-packages= to browse
468       and install the latest version.
470    3. If you get the following error "*Failed to download `Org-mode'
471       archive.*" in step 2, you can manually download the tarball and
472       install it. Refer [[Installing from ELPA-tar][this FAQ entry]] for more information.
474 ** How do I install Emacs package manager?
475    :PROPERTIES:
476    :CUSTOM_ID: installing-elpa
477    :END:
478    
479    If you are running Emacs-24 or find the command =M-x list-packages=
480    available you already have the package manager installed.
481    
482    Steps for installing package manager:
483    1. Download the latest package manager -
484       [[http://repo.or.cz/w/emacs.git/blob_plain/HEAD:/lisp/emacs-lisp/package.el][package.el]].
485    2. Add the following to your =.emacs= and reload Emacs.
486       #+begin_src emacs-lisp
487         ;; change "~/elisp/" as appropiate
488         (setq load-path (cons "~/elisp" load-path))
489         (require 'package)
490         (package-initialize)
491       #+end_src
492    
493 ** I don't see Org-mode as an installation option in Package Manager Menu?
494    :PROPERTIES:
495    :CUSTOM_ID: why-no-org-in-elpa
496    :END:
497    
498    Emacs Package Manager is a very recent addition to Emacs. Work is
499    under way to have have Org-mode seamlessly integrate with Emacs'
500    Package Manager. As a result, it will be some time before the
501    Org-mode packages are available and usable from either GNU or
502    Org-mode package archives.
503    
504    In the meanwhile, you can install Org-mode via package manager
505    through ELPA-compatible tar. Refer [[Installing from ELPA-tar][this FAQ entry]] for more information.
506    
507 ** How do I install Org-mode from a ELPA-compatible tarball?
508    :PROPERTIES:
509    :CUSTOM_ID: installing-from-elpa-tarball
510    :END:
511 # <<Installing from ELPA-tar>>
512    
513    Org-mode is distributed as an ELPA-compatible tar which can be used
514    in conjunction with Emacs' package manager.
515    
516    1. If you are already running Org-mode, note the current version
517       reported by M-x org-version.
518    2. Download the latest tarball from [[http://orgmode.org/pkg/daily/][Org-mode repo]].
519    3. Do =M-x package-install-file=. When prompted for =Package file
520       name=, point it to .tar file downloaded in step 2.
521       
522       You will now see Package Manager compiling the files and
523       installing it.
524    4. Reload emacs. This step is very important.
525    5. Note the version of the new installation using M-x
526       org-version. If the new and old versions are different, the
527       installation is done and you are all set to enjoy the updated
528       Org-mode. Otherwise skip to step 6.
529    6. Review you load-path using =C-h v load-path=. Most likely that
530       your old installation path takes precedence over the path chosen
531       by package manager (which is typically
532       =~/.emacs.d/elpa/...=). Fix this anamoly by moving
533       =(package-initialize)= line in .emacs to a more appropriate
534       location.
535       
536    - Additional Note on =org-install.el= :: Functionality of Org-mode's
537      =org-install.el= is supplanted by Package Manager's
538      =org-autoloads.el=. Since Package Manager autoloads Org-mode for
539      you, the following line =(require 'org-install)= in your =.emacs=
540      is no longer required and can be safely removed.
541      
542 ** Why would I use ELPA tarballs instead of the snapshot tarballs?
543    :PROPERTIES:
544    :CUSTOM_ID: why-elpa
545    :END:
546    
547    ELPA-tarballs automate much the process of upgrading org-mode. Much
548    of the following grunt work is done automatically by the Package
549    Manager:
550    
551    1. Downloading, compiling, and activating of org-mode (including
552       setting org-mode's =load-path= and autoloads).
553    2. Updating info files.
555 * Setup
556   :PROPERTIES:
557   :CUSTOM_ID: Setup
558   :END:
559 ** How can I quickly browse all Org options?
561 =M-x org-customize RET=
563 See also [[file:org-tutorials/org-customize.org][Carsten's Org customize tutorial]] and [[file:org-configs/org-customization-guide.org][this customization guide]]
564 for details.
566 ** Can I use the editing features of org-mode in other modes?
567    :PROPERTIES:
568    :CUSTOM_ID: use-editing-features-in-other-modes
569    :END:
571    Not really---but there are a few editing features you can use in
572    other modes.
574    - For tables there is =orgtbl-mode= which implements the table
575      editor as a minor mode. (To enable, type =M-x orgtbl-mode=)
576    - For ordered lists there is =orgstuct-mode= which allows for easy
577      list editing as a minor mode. (To enable, type =M-x
578      orgstruct-mode=)
580    You can activate these modes automatically by using hooks:
582    : (add-hook 'mail-mode-hook 'turn-on-orgtbl)
583    : (add-hook 'mail-mode-hook 'turn-on-orgstruct)
585    For footnotes, there is the function =org-footnote-action=, which
586    works in non-org buffers. This function is a powerful tool for
587    creating and sorting footnotes. To use it globally, you can add the
588    following keybinding to your =.emacs= file (requires Org 6.17 or
589    greater):
591    : (global-set-key (kbd "C-c f") 'org-footnote-action)
593    For other features you need to switch to Org-mode temporarily, or
594    prepare text in a different buffer.
596 ** Why isn't feature "X" working the way it is described in the manual?
597    :PROPERTIES:
598    :CUSTOM_ID: making-sure-org-mode-is-up-to-date
599    :END:
601 Org-mode develops very quickly. If you are using a version of Org-mode
602 that shipped with emacs, there is a good chance that it is somewhat
603 out of date.
605 Many of the users on the Org-mode mailing list are using either a
606 recent release of Org-mode or the
607 [[http://orgmode.org/index.html#sec-3.2][development version of
608 org-mode from the git repository]].
610 If some settings and features aren't working the way you expect, make
611 sure that the version of the manual you are consulting matches the
612 version of Org-mode you are using.
614    - You can check which version of Org-mode you are using by
615      selection =Org --> Documentation --> Show Version= in the Emacs
616      menu.
618    - The [[http://orgmode.org/manual/index.html][online manual]] at [[http://orgmode.org][orgmode.org]] corresponds to the most recent
619      release.
621    - 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
622      released with the latest official Gnu Emacs release. Compared
623      with the manual at the orgmode.org, the manual at www.gnu.org is
624      somewhat out of date.
626 For instructions on how to stay current with Org-mode, consult [[keeping-current-with-Org-mode-development][this
627 FAQ]] or follow the instructions on [[http://orgmode.org][the official Org-mode site]].
629 ** Can I get the visibility-cycling features in outline-mode and outline-minor-mode?
630    :PROPERTIES:
631    :CUSTOM_ID: use-visibility-cycling-in-outline-mode
632    :END:
634    Yes, these functions are written in a way that they are independent of
635    the outline setup.  The following setup provides standard Org-mode
636    functionality in outline-mode on =TAB= and =S-TAB=.  For
637    outline-minor-mode, we use =C-TAB= instead of =TAB=,
638    because =TAB= usually has mode-specific tasks.
640 #+BEGIN_SRC emacs-lisp
641 (add-hook 'outline-minor-mode-hook
642   (lambda ()
643     (define-key outline-minor-mode-map [(control tab)] 'org-cycle)
644     (define-key outline-minor-mode-map [(shift tab)] 'org-global-cycle)))
645 (add-hook 'outline-mode-hook
646   (lambda ()
647     (define-key outline-mode-map [(tab)] 'org-cycle)
648     (define-key outline-mode-map [(shift tab)] 'org-global-cycle)))
649 #+END_SRC
651 Or check out /outline-magic.el/, which does this and also provides
652 promotion and demotion functionality.  /outline-magic.el/ is
653 available at [[http://www.astro.uva.nl/~dominik/Tools/outline-magic.el][Outline Magic]].
655 ** Can I save/restore the visibility state of an org-mode buffer?
656    :PROPERTIES:
657    :CUSTOM_ID: saving-visibility-state
658    :END:
660 Well, no---at least not automatically. You can, however, control the
661 visibility of an org-file or of individual trees by adding
662 instructions to your org file. See [[http://orgmode.org/manual/Visibility-cycling.html#Visibility-cycling][this section of the manual]] for more
663 information.
665 ** How can I keep track of changes in my Org files?
666    :PROPERTIES:
667    :CUSTOM_ID: track-of-changes-in-Org-files
668    :END:
670   Use git to track the history of the files, use a cronjob to check in
671   changes regularly.  Such a setup is described by Bernt Hansen
672   in [[http://article.gmane.org/gmane.emacs.orgmode/6233][this message]] on [[http://dir.gmane.org/gmane.emacs.orgmode][emacs-orgmode]].
674 ** Can I use Org-mode as the default mode for all README files?
675    :PROPERTIES:
676    :CUSTOM_ID: Org-mode-as-default-mode
677    :END:
679 Add the following to your .emacs file:
681 : (add-to-list 'auto-mode-alist '("README$" . org-mode))
683 You can even make it the default mode for any files with unspecified
684 mode using
686 : (setq default-major-mode 'org-mode)
688 ** Can I use ido.el for completing stuff in Org?
689    :PROPERTIES:
690    :CUSTOM_ID: ido-complete
691    :END:
693    Yes, you can.  If you are an ido user and ido-mode is active, the
694    following setting will make Org use =ido-completing-read= for most
695    of its completing prompts.
697 : (setq org-completion-use-ido t)
699 ** Should I use one big org file or multiple files?
700    :PROPERTIES:
701    :CUSTOM_ID: how-to-organize-org-mode-files
702    :END:
704 Org-mode is flexible enough to accomodate a variety of organizational
705 and time management schemes. Org's [[http://orgmode.org/manual/Document-Structure.html#Document-Structure][outline cycling and convenient
706 editing and navigation commands]] make it possible to maintain all of
707 your projects and notes in a single file. But org-mode's [[http://orgmode.org/manual/Hyperlinks.html#Hyperlinks][quick and
708 easy hyperlinks]], along with [[http://orgmode.org/manual/Refiling-notes.html#Refiling-notes][easy refiling of notes and todos]], also
709 make it a delight to maintain a private "wiki" consisting of multiple
710 files.
712 No matter how you organize your org files, org-mode's agenda commands
713 make it easy to search all your notes and gather together crucial data
714 in a single view.
716 Moreover, several org-mode settings can be configured either globally
717 in your =.emacs= file or locally (per file or per outline tree). See
718 the [[http://orgmode.org/manual/index.html#Top][manual]] for more details. For an example of local customizations
719 see [[limit-agenda-with-category-match][this FAQ]].
721 Here are a few ideas for organizing org-mode files:
723 - A single file for all your projects and notes.
724 - One file per project.
725 - One file per client.
726 - One file per area of responsibility or type of work (e.g.,
727   household, health, work, etc.).
728 - One file for projects, one for appointments, one for reference
729   material, one for someday/maybe items, etc.
730 - A wiki of hyperlinked files that grows and adapts to meet your
731   needs.
733 For more ideas, see some of the links on the [[file:org-tutorials/index.org][org-tutorial index]] or
734 [[file:org-gtd-etc.org][this page on org-mode and GTD]].
736 ** Why doesn't C-c a call the agenda? Why don't some org keybindings work?
737    :PROPERTIES:
738    :CUSTOM_ID: setting-global-keybindings
739    :END:
741 Org-mode has a few global keybindings that the user must set
742 explicitly in an =.emacs= file. These keybindings include the
743 customary shortcut for calling the agenda (=C-c a=). If nothing
744 happens when you type =C-c a=, then make sure that the following lines
745 are in your =.emacs= file:
747 #+BEGIN_SRC emacs-lisp
748 ;; The following lines are always needed.  Choose your own keys.
749 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
750 (global-set-key "\C-cl" 'org-store-link)
751 (global-set-key "\C-ca" 'org-agenda)
752 (global-set-key "\C-cb" 'org-iswitchb)
753 #+END_SRC emacs-lisp
755 You may, of course, choose whatever keybindings work best for you
756 and do not conflict with other modes.
758 Please see [[http://orgmode.org/manual/Activation.html][this section of the manual]] if you have additional
759 questions.
761 ** Why aren't some of the variables I've customized having an effect?
762    :PROPERTIES:
763    :CUSTOM_ID: load-org-after-setting-variables
764    :END:
766 Some org variables have to be set before org.el is loaded or else they
767 will not work. (An example is the new variable
768 =org-enforce-todo-dependencies=.)
770 To make sure all your variables work you should not use =(require
771 'org)=. Instead use the following setting:
773 : (require 'org-install)
775 You should also make sure that you do not require any other =org-...=
776 files in your =.emacs= file before you have set your org variables,
777 since these will also cause org.el to be loaded. To be safe, load org
778 files *after* you have set your variables.
780 ** How can I make sure that timestamps appear in English?
781    :PROPERTIES:
782    :CUSTOM_ID: timestamps-and-system-time-locale
783    :END:
785 If your system's locale is not set to English, but you would like the
786 timestamps in your org-mode files to appear in English, you can set
787 the following variable:
789 #+begin_src emacs-lisp
790   (setq system-time-locale "C")
791 #+end_src
793 ** What does a minimal .emacs look like?
794    :PROPERTIES:
795    :CUSTOM_ID: minimal-emacs
796    :END:
798 Using a stripped down minimal .emacs files removes broken custom
799 settings as the cause of an issue and makes it easy to reproduce for
800 other people.  The example below has system-specific paths that you'll
801 need to change for your own use.
802 #+begin_src emacs-lisp
803   (add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
804   (add-to-list 'auto-mode-alist '("\\.\\(org\\  |org_archive\\|txt\\)$" . org-mode))
805   (setq org-agenda-files '("/tmp/test.org"))
806   (require 'org-install)
807   (require 'org-habit)
809   (global-set-key "\C-cl" 'org-store-link)
810   (global-set-key "\C-ca" 'org-agenda)
811   (global-set-key "\C-cb" 'org-iswitchb)
812 #+end_src
814 You can save the minimal .emacs file to ~/minimal.emacs, add suspect
815 configuration code to it, then start emacs something like this:
816 #+begin_src sh
817   emacs -Q -l ~/minimal.emacs
818 #+end_src
820 On OS X, starting emacs with minimal configuration might look
821 something like this:
822 #+begin_src sh
823   /Applications/emacs.app/Contents/MacOS/Emacs -Q -l ~/minimal.emacs
824 #+end_src sh
826 ** Can I migrate from Planner?
828    Yes.  This [[http://www.c0t0d0s0.de/plan2org/plan2org.pl][perl script]] can help.
830 * Errors and general problems
831   :PROPERTIES:
832   :CUSTOM_ID: Errors
833   :END:
834 ** Opening Org files in Emacs leads to a crash
835    :PROPERTIES:
836    :CUSTOM_ID: Emacs-crashes-with-org-indent-mode
837    :END:
838    The only known case where Org-mode can crash Emacs is when you are
839    using =org-indent-mode= with Emacs 23.1 (in fact, any version of
840    Emacs before version 23.1.50.3).  Upgrade to Emacs 23.2 and the
841    problem should go away.
843 ** When I try to use Org-mode, I always get the error message =(wrong-type-argument keymapp nil)=
844    :PROPERTIES:
845    :CUSTOM_ID: wrong-type-argument-keymapp
846    :END:
848    This is a conflict with an outdated version of the /allout.el/, see
849    the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section in the manual
851 ** How can I control the application launched by Org-mode to open a certain file type like pdf, html....
852    :PROPERTIES:
853    :CUSTOM_ID: external-application-launched-to-open-file-link
854    :END:
856 If you want special control about how Org-mode opens files, see the
857 variables =org-file-apps=, =org-file-apps-defaults-gnu=,
858 =org-file-apps-defaults-macosx=, =org-file-apps-defaults-windowsnt=.
860 *However*, normally it is best to just use the mechanism the
861 operating-system provides:
863 *** GNU/Linux systems
864     You you have to check your mailcap settings, find the files:
866     : /etc/mailcap
867     :
868     : or
869     :
870     : $HOME/.mailcap
872 and modify them accordingly. Please read their manual entry.
874 *** Windows systems
875     + for html pages you may configure the =browse-url-= variables through
876       the Customize interface,
877     + the pdf files are automatically opened with Acrobat Reader (if it is
878       installed)
880 *** Mac OSX
881     Change the application responsible for this file type by selecting
882     such a file in the Finder, select =File->Get Info= from the menu
883     and select the application to open this file with.  Then, to
884     propagate the change to all files with the same extension, select
885     the =Change all= button.
887 ** Org-mode takes over the TAB key.  I also want to use YASnippet, is there a way to fix this conflict?
888    :PROPERTIES:
889    :CUSTOM_ID: YASnippet
890    :END:
892 [[http://code.google.com/p/yasnippet/][yasnippet]] is yet another snippet expansion system for Emacs.  It is
893 inspired by TextMate's templating syntax.
894 - watch the [[http://www.youtube.com/watch?v=vOj7btx3ATg][video on YouTube]]
895 - see the [[http://yasnippet.googlecode.com/svn/trunk/doc/index.html][intro and tutorial]]
897 *Note*: yasnippet is not compatible with =org-indent-mode= currently
898 there is no known way to use both successfully with =yas/trigger-key=
899 set to =TAB= (or =[tab]= etc...)
901 The way Org-mode binds the =TAB= key (binding to =[tab]= instead of
902 =\t=) overrules yasnippets' access to this key.  The following code
903 fixes this problem:
905 #+begin_src emacs-lisp
906 (add-hook 'org-mode-hook
907           (lambda ()
908             (org-set-local 'yas/trigger-key [tab])
909             (define-key yas/keymap [tab] 'yas/next-field-group)))
910 #+end_src
912 If the above code doesn't work (which it may not with later versions
913 of yasnippet).  Then try the following
915 #+begin_src emacs-lisp
916   (defun yas/org-very-safe-expand ()
917     (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
919   (add-hook 'org-mode-hook
920             (lambda ()
921               ;; yasnippet (using the new org-cycle hooks)
922               (make-variable-buffer-local 'yas/trigger-key)
923               (setq yas/trigger-key [tab])
924               (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
925               (define-key yas/keymap [tab] 'yas/next-field)))
926 #+end_src
928 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]])
929 with YASnippets for Org-mode.
931 ** Org-mode takes over the S-cursor keys.  I also want to use CUA-mode, is there a way to fix this conflict?
932    :PROPERTIES:
933    :CUSTOM_ID: CUA-mode
934    :END:
936 Yes, see the  [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
938 ** Org-mode takes over the S-cursor keys.  I also want to use windmove.el, is there a way to fix this conflict?
939    :PROPERTIES:
940    :CUSTOM_ID: windmove.el
941    :END:
943 Yes, see the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
945 ** Org behaves strangely: some keys don't work, some features are missing, my settings have no effect, ...
946    :PROPERTIES:
947    :CUSTOM_ID: loaded-old-org
948    :END:
950 When this sort of things happen, it probably is because Emacs is
951 loading an old version of Org-mode instead of the one you expected.
952 Check it with =M-x org-version=.
954 This happens because Emacs loads first the system org-mode (the one
955 included with Emacs) before the one in your directory. Check the
956 =load-path= variable; you might see that your org-mode appears /after/
957 the system-wide path; this is bad.
959 You should add your directories to the =load-path= at the beginning:
961 :  (add-to-list 'load-path "~/.emacs.d/org-mode/lisp") (require 'org-install)
963 Function =add-to-list= adds at the beginning. Don't use =append=
964 because it appends at the end. Also be sure to use =(require
965 'org-install)= and not =(require 'org)=.
967 This wrong version loading may also happen if you have a byte-compiled
968 =org.elc= from an old version together with a new =org.el=. Since
969 Emacs prefers loading byte-compiled files (even if the =.el= is
970 newer), it will load the old Org-mode.
972 ** Why doesn't org-batch-agenda work under Win32?
973    :PROPERTIES:
974    :CUSTOM_ID: org-batch-agenda-under-win32
975    :END:
977 When I run the example batch files to print my agenda to the console
978 under Win32 I get the failure:
980 : End of file during parsing
982 and no agenda is printed.
984 The problem is the use of single quotes surrounding the eval in the
985 emacs command-line. This gets confused under Win32. All string
986 parameters with spaces must be surrounded in double quotes. This means
987 that double quotes being passed to the eval must be escaped.
989 Therefore, instead of the following:
991 : <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
992 :     -eval '(org-batch-agenda "a")'
994 you need to use the following:
996 :  <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
997 :     -eval "(org-batch-agenda \"a\")"
999 (all on one line, of course).
1001 ** Org agenda seems very slow
1002    :PROPERTIES:
1003    :CUSTOM_ID: slow-agenda
1004    :END:
1006 If it takes a long time to generate or refresh the agenda, you might
1007 want first check which version of org-mode you are using. There have
1008 been major optimizations of org-agenda since 6.21b, which was the
1009 version of org-mode released with Emacs 23. If you are using 6.21b or
1010 earlier (you can check with =M-x org-version=), then you might want to
1011 consider upgrading to a more recent version of org-mode.
1013 Here are some other ideas for speeding up the agenda:
1015 1. Use a one day agenda view (rather than a seven day view).
1017    =(setq org-agenda-ndays 1)=
1019 2. Archive inactive items to separate files.
1021    =C-c C-x C-s= (org-archive-subtree)
1023 3. Do not include the global todo list in your agenda view.
1025    (setq org-agenda-include-all-todo nil)
1027 4. Make sure that your org files are byte-compiled.
1029    I.e., make sure there are files ending in =.elc= in your org
1030    installation directory.
1032 5. Limit your agenda files (=org-agenda-files=) to files that have
1033    active todos and or projects. 
1035    If you have a number of older reference files---i.e., files you
1036    search only occasionally---in your agenda files list, consider
1037    removing them from your agenda files and adding them to
1038    =org-agenda-text-search-extra-files= instead. Similarly, you might
1039    consider searching some of your older reference files with =M-x
1040    grep= so that Org-mode does not have to load them into memory when
1041    the agenda is called.
1043 ** Visual-line-mode doesn't work well with org-mode
1044    :PROPERTIES:
1045    :CUSTOM_ID: visual-line-mode
1046    :END:
1048 Visual-line-mode "soft wraps" lines so that the visual edge of the
1049 buffer is considered a line break for purposes of navigation, even
1050 though there is no line break in reality.
1052 In older versions of org-mode, org-beginning-of-line and
1053 org-end-of-line do not work well with visual line mode. (The two
1054 commands disregard soft line breaks and move to the beginning and end
1055 of the hard line break.) A patch was introduces to fix this behavior
1056 in July of 2009. n
1058 If you are using an older version of org mode, you can:
1060 1. Add a hook to turn off visual line mode.
1062 2. Add the following to your =.emacs=:
1064 #+begin_src emacs-lisp
1066 (add-hook 'org-mode-hook
1067   (lambda ()
1068     (define-key org-mode-map "\C-a" 'move-beginning-of-line)
1069     (define-key org-mode-map "\C-e" 'move-end-of-line)))
1071 #+end_src
1072 * Faces and highlighting
1073   :PROPERTIES:
1074   :CUSTOM_ID: Faces
1075   :END:
1076 ** Org-mode has a lot of colors?  How can I change them?
1077    :PROPERTIES:
1078    :CUSTOM_ID: customizing-org-faces
1079    :END:
1081 This is a question that applies to Emacs as a whole, but it comes up
1082 quite frequently on the org-mode mailing list, so it is appropriate to
1083 discuss it here.
1085 If you would like to change the style of a face in org-mode (or any
1086 other Emacs mode), simply type =M-x customize-face [RET]= while the
1087 cursor is on the color/style you are interested in modifying. You will
1088 be given the opportunity to customize all the faces located at that
1089 point.
1091 If you would like an overview of all the faces in org-mode, you can
1092 type =C-u M-x list-faces-display [RET] org= and you will be shown all
1093 the faces defined by org-mode along with an illustration of their
1094 current settings.
1096 If you would like to customize org-faces and other aspects of
1097 org-appearance, type =M-x customize-group org-font-lock [RET]=.
1099 Finally, if you would like verbose information about the properties of
1100 the text under the cursor, you can type =C-u C-x ==.
1102 See the Worg page on [[file:org-tutorials/org-appearance.org][customizing Org appearance]] for further information.
1103 ** Why do I get a tiny font in column view when using emacs daemon?
1104    :PROPERTIES:
1105    :CUSTOM_ID: column-view-tiny-font
1106    :END:
1108 When using emacs in daemon mode (=emacs --daemon=), client frames
1109 sometimes override the column view face settings, resulting in very
1110 small fonts. Here is a fix:
1112 #+begin_src emacs-lisp
1113   (defun org-column-view-uses-fixed-width-face ()
1114   ;; copy from org-faces.el
1115   (when (fboundp 'set-face-attribute)
1116       ;; Make sure that a fixed-width face is used when we have a column
1117       ;; table.
1118       (set-face-attribute 'org-column nil
1119                           :height (face-attribute 'default :height)
1120                           :family (face-attribute 'default :family))))
1122    (when (and (fboundp 'daemonp) (daemonp))
1123     (add-hook 'org-mode-hook 'org-column-view-uses-fixed-width-face))
1124 #+end_src
1126 This fix was provided in the following mailing list post:
1128 http://article.gmane.org/gmane.emacs.orgmode/27560
1129 ** How can I stop the mouse cursor from highlighting lines in the agenda?
1130    :PROPERTIES:
1131    :CUSTOM_ID: ratpoison-for-agenda-highlighting
1132    :END:
1134 You can add the following to your =.emacs=:
1136 #+begin_src emacs-lisp
1137 (add-hook 'org-finalize-agenda-hook
1138     (lambda () (remove-text-properties
1139                (point-min) (point-max) '(mouse-face t))))
1140 #+end_src
1142 * Outline
1143   :PROPERTIES:
1144   :CUSTOM_ID: Outline
1145   :END:
1146 ** Can I have two windows on the same Org-mode file, with different outline visibilities?
1147    :PROPERTIES:
1148    :CUSTOM_ID: indirect-buffers
1149    :END:
1151    You may use /indirect buffers/ which do exactly this.  See the
1152    documentation on the command =make-indirect-buffer=.
1154    Org-mode has built-in commands that allow you create an indirect
1155    buffer from a subtree of an outline. To open a subtree in new
1156    window, type =C-c C-x b=. Any changes you make in the new window
1157    will be saved to the original file, but the visibility of both
1158    buffers will remain independent of one another.
1160    For multiple indirect buffers from the same file, you must use the
1161    prefix =C-u= when creating the second (or third) buffer. Otherwise
1162    the new indirect buffer will replace the old.
1164    You can also create an independent view of an outline subtree by
1165    typing =b= on an item in the agenda.
1167 ** Emacs outlines are unreadable.  Can I get rid of all those stars?
1168    :PROPERTIES:
1169    :CUSTOM_ID: Emacs-outlines-are-unreadable
1170    :END:
1172    See the section [[http://orgmode.org/manual/Clean-view.html#Clean-view][Clean outline view]] in the manual.
1173 ** C-k is killing whole subtrees!  I lost my work!
1174    :PROPERTIES:
1175    :CUSTOM_ID: C-k-is-killing-subtrees
1176    :END:
1178   =(setq org-special-ctrl-k t)= before losing your work.
1180 ** Why aren't commands working on regions?
1181    :PROPERTIES:
1182    :CUSTOM_ID: transient-mark-mode
1183    :END:
1185 Some org-mode commands, such as M-right and M-left for demoting or
1186 promoting headlines (see [[demote-multiple-headlines][this FAQ]]), can be applied to entire regions.
1187 These commands, however, will only work on active regions set with
1188 [[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
1189 Emacs 23. To enable it in earlier versions of emacs, put the following
1190 in your =.emacs= file:
1192 : (transient-mark-mode 1)
1194 Alternatively, you may turn off transient mark mode and use [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Momentary-Mark.html][a
1195 momentary mark]] (=C-<SPC> C-<SPC>=).
1197 ** Why is a blank line inserted after headlines and list items?
1198    :PROPERTIES:
1199    :ID:       2463F4D8-F686-4CF3-AA07-08976F8A4972
1200    :END:
1201    :PROPERTIES:
1202    :CUSTOM_ID: blank-line-after-headlines-and-list-items
1203    :END:
1205 In org-mode, typing =M-RET= at the end of a headline will create a new
1206 headline of the same level on a new line. The same is true for plain
1207 lists. By default org-mode uses context to determine if a blank line
1208 should be inserted after each headline or plain list item when =M-RET=
1209 is pressed. For instance, if a there is a blank line before a
1210 headline, then typing =M-RET= at the end of the line will insert a
1211 blank line before the new headline. For instance, hitting =M-RET=
1212 at the end of "Headline Two" below inserts a new headline without a
1213 blank line:
1215 : ** Headline One
1216 : ** Headline Two
1217 : **
1219 If there is a blank line between Headline One and Headline Two,
1220 however, the results will be as follows:
1222 : ** Headline One
1224 : ** Headline Two
1226 : **
1228 If you do not like the default behavior you can change it with the
1229 variable =org-blank-before-new-entry=. You can set headings and/or
1230 plain lists to auto (the default setting), t (always), or nil (never).
1232 ** How can I promote or demote multiple headlines at once?
1233    :PROPERTIES:
1234    :CUSTOM_ID: demote-multiple-headlines
1235    :END:
1237 If you have a long list of first level headlines that you'd like to
1238 demote to second level headlines, you can select the headlines as a
1239 region and then hit =M-<right>= to demote all the headlines at once.
1241 Note: =M-S-<right>= will not work on a selected region. Its use is to
1242 demote a single subtree (i.e., a headline and all sub-headlines).
1244 If M-<right> doesn't seem to work, make sure transient mark mode is
1245 enabled. See [[transient-mark-mode][this FAQ]].
1247 ** What's the deal with all the ellipses in my org outlines?
1248    :PROPERTIES:
1249    :CUSTOM_ID: org-ellipses
1250    :END:
1252 Org-mode uses ellipses to indicate folded (and thus hidden) text. Most
1253 commonly, ellispes occur at the end of headings with folded content:
1255 : * Heading ...
1257 Or, for instance, they may indicate closed drawers:
1259 : :PROPERTIES: ...
1261 Sometimes, as a result of editing and cycling an outline, ellipses may
1262 appear in unexpected places. You should *never* delete these ellipses,
1263 as you may accidentally delete hidden text. Instead, you can type =C-c
1264 C-r= (org-reveal) to display all hidden text in the vicinity. Or you
1265 may type =M-x RET show-all= to reveal all text in the org file.
1267 If you would prefer a symbol or face for indicating hidden text, you
1268 can customize the variable org-ellipses.
1270 ** How do I yank a subtree so it's indented according to the point's location?
1271    :PROPERTIES:
1272    :CUSTOM_ID: yank-indent-subtree
1273    :END:
1275 You can either use =C-c C-w= with a working [[http://orgmode.org/manual/Refiling-notes.html#Refiling-notes][refile-targets]] setup.
1277 Or set =org-yank-adjusted-subtrees= to =t= which will adjust the
1278 yanked headline's level correctly.
1280 Just use =C-k= and =C-y= as you would everywhere else in Emacs.
1282 ** Can I read org-mode outlines in vim?
1283    :PROPERTIES:
1284    :CUSTOM_ID: org-outlines-in-vim
1285    :END:
1287 Yes, there is a script that enables one to view and navigate folded
1288 outline/org files in vim (though without most of org-mode's
1289 functionality, of course).
1291   - [[http://www.vim.org/scripts/script.php?script_id%3D1266][Emacs outline mode - Imitates Emacsen : vim online]]
1293 For instructions on how to set it up, please see [[http://mid.gmane.org/EA275862-B97A-4BAC-B879-177FD07A2D56@gaillourdet.net][this mailing list
1294 post]].
1296 Work is also underway on an org-mode clone for Vim. You can check it
1297 out on git hub:
1299 https://github.com/hsitz/VimOrganizer
1301 * Todos and Tags
1302   :PROPERTIES:
1303   :CUSTOM_ID: Todos-and-Tags
1304   :END:
1305 ** How can I cycle through the TODO keyword of an entry?
1306    :PROPERTIES:
1307    :CUSTOM_ID: cycle-TODO-keywords
1308    :END:
1310   =C-c C-t= or =S-<left/right>= is what you need.
1312 ** How do I track state changes for tasks in Org?
1313    :PROPERTIES:
1314    :CUSTOM_ID: track-state-changes-for-tasks
1315    :END:
1317   Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/6082][post by Bernt Hansen]] for setting up TODO keyword
1318   states and logging timestamps for task state changes.
1320 ** Can I select the TODO keywords with a tag-like interface?
1321    :PROPERTIES:
1322    :CUSTOM_ID: select-TODO-keywords-with-tag-like-interface
1323    :END:
1325   Yes.  Use =(setq org-use-fast-todo-selection t)=
1327   If you want to set both your todos and your tags using a single
1328   interface, then check out the variable
1329   =org-fast-tag-selection-include-todo=.
1331   See [[http://orgmode.org/manual/Fast-access-to-TODO-states.html][this section of the manual]] for more details.
1333 ** How can I quickly set the tag of an entry?
1334    :PROPERTIES:
1335    :CUSTOM_ID: quickly-set-tag-of-entry
1336    :END:
1338    Use =C-c C-c= or =C-c C-q= on the headline. =C-c C-q= is useful for
1339    setting tabs in a [[http://orgmode.org/manual/Remember.html#Remember][remember]] buffer, since =C-c C-c= is the default
1340    keybinding for filing a note from the remember buffer.
1342    You can set tags even more quickly by setting one of the character
1343    shortcuts for [[http://orgmode.org/manual/Setting-tags.html#Setting-tags][fast tag selection]].
1345    To set tag shortcuts for all org buffers, put something like the
1346    following in your =.emacs= file (or create the same settings by
1347    typing =M-x customize-variable RET org-tag-alist=):
1349 : (setq org-tag-alist '(("computer" . ?c) ("office" . ?o) ("home" . ?h)))
1351    To set tag shortcuts for a single buffer, put something like the
1352    following at the top of your org file:
1354 : #+TAGS: computer(c) office(o) home(h)
1356 ** How can I change the colors of TODO keywords?
1358 You can use the variable org-todo-keyword-faces. Here are some sample
1359 settings:
1361 #+begin_src emacs-lisp
1362 (setq org-todo-keyword-faces
1363       '(
1364         ("TODO"  . (:foreground "firebrick2" :weight bold))
1365         ("WAITING"  . (:foreground "olivedrab" :weight bold))
1366         ("LATER"  . (:foreground "sienna" :weight bold))
1367         ("PROJECT"  . (:foreground "steelblue" :weight bold))
1368         ("DONE"  . (:foreground "forestgreen" :weight bold))
1369         ("MAYBE"  . (:foreground "dimgrey" :weight bold))
1370         ("CANCELED"  . shadow)
1371         ))
1372 #+end_src
1374 If you want to change the color of all active todos or all inactive
1375 todos, type:
1377 : M-x customize-face RET org-todo
1378 : M-x customize-face RET org-done
1380 You can also set values for each of these in your =.emacs= file:
1382 : (set-face-foreground 'org-todo "firebrick2")
1383 : (set-face-foreground 'org-done "forestgreen")
1385 * Hyperlinks
1386   :PROPERTIES:
1387   :CUSTOM_ID: Hyperlinks
1388   :END:
1389 ** Why do I have to confirm the execution of each shell/elisp link?
1390    :PROPERTIES:
1391    :CUSTOM_ID: confirm-shell/elisp-link
1392    :END:
1394    The confirmation is there to protect you from unwantingly execute
1395    potentially dangerous commands.  For example, imagine a link
1397    : [[shell:rm -rf ~/*][Google Search]]
1399    In an Org-mode buffer, this command would look like /Google Search/,
1400    but really it would remove your home directory.  If you wish, you can
1401    make it easier to respond to the query by setting
1403    : (setq org-confirm-shell-link-function 'y-or-n-p
1404    :       org-confirm-elisp-link-function 'y-or-n-p).
1406    Then a single keypress will be enough to confirm those links.  It is
1407    also possible to turn off this check entirely, but I strongly
1408    recommend against this.  Be warned.
1410 ** Can I use RET or TAB to follow a link?
1411    :PROPERTIES:
1412    :CUSTOM_ID: RET-or-TAB-to-follow-link
1413    :END:
1415    Yes, this is how:
1417    : (setq org-return-follows-link t)
1418    : (setq org-tab-follows-link t)
1420 ** Can I keep mouse-1 clicks from following a link?
1421    :PROPERTIES:
1422    :CUSTOM_ID: mouse-1-following-link
1423    :END:
1425    Activating links with =mouse-1= is a new feature in Emacs 22, to make
1426    link behavior similar to other applications like web browsers.  If
1427    you hold the mouse button down a bit longer, the cursor will be set
1428    without following the link.  If you cannot get used to this behavior,
1429    you can (as in Emacs 21) use =mouse-2= to follow links and turn off
1430    link activation for =mouse-1= with
1432    : (setq org-mouse-1-follows-link nil)
1434 ** How can I get completion of file names when creating a link?
1435    :PROPERTIES:
1436    :CUSTOM_ID: completion-of-file-links
1437    :END:
1439 You can use org-insert-link with a prefix argument:
1441 : C-u C-c C-l
1443 You will be greeted with prompt in the minibuffer that allows for file
1444 completion using your preferred Emacs method for finding files.
1446 ** How can I use invisible targets within lists?
1447    :PROPERTIES:
1448    :CUSTOM_ID: invisible-targets-in-lists
1449    :END:
1451 The usual way of turning radio links invisible is to comment them, but
1452 Org comments need to be at the beginning of the line, which breaks list
1453 indentation.  
1455 The workaround here is to add (INVISIBLE) after your <<target>>
1457 For example:
1459 : 11. <<target>>(INVISIBLE)
1460 :     Some text
1461 : 12. More text [[target][go to]]
1463 ** Org-mode is not opening mailto links in my default mail client
1464    :PROPERTIES:
1465    :CUSTOM_ID: mailto-links
1466    :END:
1468 You can customize the function org-mode uses to open mailto links by
1469 setting the variable =org-link-mailto-program=:
1471 =M-x customize-variable org-link-mailto-program=
1473 The default function called is =browse-url=, which opens a mail
1474 composition buffer within Emacs. The type of buffer opened by
1475 browse-url depends on the setting of the variable =mail-user-agent=.
1476 Thus, if you want to ensure that mailto links use Gnus to open a
1477 message buffer, you could add the following to your =.emacs=:
1479 #+begin_src elisp
1480 (setq mail-user-agent 'gnus-user-agent)
1481 #+end_src
1483 ** Can I use CamelCase links?
1484    :PROPERTIES:
1485    :CUSTOM_ID: CamelCase-links
1486    :END:
1488 Yes, you can with the contributed package org-wikinodes.el. Please
1489 consult the [[http://orgmode.org/worg/org-contrib/org-wikinodes.html][documentation]].
1491 * Plain Lists
1492   :PROPERTIES:
1493   :CUSTOM_ID: Plain-Lists
1494   :END:
1495 ** How can I insert an empty line before each newly inserted headline, but not before each newly inserted plain-list item?
1496    :PROPERTIES:
1497    :CUSTOM_ID: empty-line-before-each-new-headline-but-not-item
1498    :END:
1500 : (setq org-blank-before-new-entry
1501 :       '((heading . t) (plain-list-item . nil))
1503 See also [[id:2463F4D8-F686-4CF3-AA07-08976F8A4972][Why is a blank line inserted after headlines and list items?]].
1505 ** How can I convert itemized lists to enumerated lists?
1506    :PROPERTIES:
1507    :CUSTOM_ID: convert-itemized-to-enumerated-lists
1508    :END:
1510    You can use =C-c -= or =S-<left>/<right>= to cycle through the various
1511    bullet headlines available for lists: =-, +, *, 1., 1)=.
1513    See [[http://orgmode.org/manual/Plain-lists.html#Plain-lists][this section of the manual]] for more information.
1515 ** How can I convert plain lists to headlines and vice versa?
1516    :PROPERTIES:
1517    :CUSTOM_ID: convert-plain-lists-to-headlines
1518    :END:
1520    To convert a plain list item or line to a headline, type =C-c *= on
1521    the headline. This will make the line a subheading of the current
1522    headline.
1524    To convert a headline to a plain list item, type =C-c -= while the
1525    cursor is on the headline.
1527    To convert a headline to an unadorned line of text, type =C-c *= on
1528    the headline.
1530    You can use query replace to accomplish the same things, as Bernt
1531    Hansen explains in [[http://article.gmane.org/gmane.emacs.orgmode/10148][this mailing list post]].
1533 ** Is there a good way to create a description list?
1534    :PROPERTIES:
1535    :CUSTOM_ID: description-lists
1536    :END:
1538   Yes, these are now built-in:
1540 #+BEGIN_EXAMPLE
1541 - item1 :: Description of this item 1
1542 - item2 :: Description of this item 2
1543 - item1 :: Description of this item 3
1544       also in multiple lines
1545 #+END_EXAMPLE
1547 * Tables
1548   :PROPERTIES:
1549   :CUSTOM_ID: Tables
1550   :END:
1551 ** How can I make table alignment work with Asian character sets
1552    :PROPERTIES:
1553    :CUSTOM_ID: table-alignment-asian-characters
1554    :END:
1556 When table alignment fails, it usually has to do with character sets
1557 where some characters have non-integer width.  Org will deal correctly
1558 with characters that are one or two or three ASCII characters wide,
1559 but not with characters that are, for example, 1.5 ASCII characters
1560 wide.  To make table alignment work you need to switch to a different
1561 character set.
1563 ** Can I plot data from a table?
1564    :PROPERTIES:
1565    :CUSTOM_ID: plotting-table-data
1566    :END:
1568    Yes, you can, using org-plot.el written by Eric Schulte and now
1569    bundled with Org.  See [[http://orgmode.org/manual/Org_002dPlot.html#Org-Plot][the manual section about this]].
1571    See also [[file:org-tutorials/org-plot.org][this excellent tutorial]] by Eric Schulte.
1573 ** How can I fill a table column with incremental numbers?
1574    :PROPERTIES:
1575    :CUSTOM_ID: fill-table-column-with-incremental-numbers
1576    :END:
1578 Here is how: Use a field formula to set the first value in the column:
1580 #+begin_src org
1581 ,| N   |   |
1582 ,|-----+---|
1583 ,| :=1 |   |
1584 ,|     |   |
1585 ,|     |   |
1586 ,|     |   |
1587 ,#+TBLFM: @2$1=1
1588 #+end_src
1590 Then define a column formula in the second field:
1592 #+begin_src org
1593 ,| N        |   |
1594 ,|----------+---|
1595 ,| 1        |   |
1596 ,| =@-1 + 1 |   |
1597 ,|          |   |
1598 ,|          |   |
1599 ,#+TBLFM: @2$1=1
1600 #+end_src
1602 After recomputing the table, the column will be filled with
1603 incremental numbers:
1605 #+begin_src org
1606 ,| N |   |
1607 ,|---+---|
1608 ,| 1 |   |
1609 ,| 2 |   |
1610 ,| 3 |   |
1611 ,| 4 |   |
1612 ,#+TBLFM: $1=@-1 + 1::@2$1=1
1613 #+end_src
1615 Note that you could use arbitrary starting values and column formulas.
1617 ** Why does my table column get filled with #ERROR?
1618    :PROPERTIES:
1619    :CUSTOM_ID: table-column-filled-with-ERROR
1620    :END:
1622    Org-mode tried to compute the column from other fields using a
1623    formula stored in the =#+TBLFM:= line just below the table, and
1624    the evaluation of the formula fails.  Fix the fields used in the
1625    formula, or fix the formula, or remove it!
1627 ** How can I stop the table editor from creating new lines?
1628    :PROPERTIES:
1629    :CUSTOM_ID: table-editor-creates-new-lines
1630    :END:
1632    When I am in the last column of a table and just above a horizontal
1633    line in the table, pressing TAB creates a new table line before the
1634    horizontal line.  To move to the line below the
1635    horizontal line instead, do this:
1637    Press =down= (to get on the separator line) and then =TAB=.
1638    Or configure the variable
1640    : (setq org-table-tab-jumps-over-hlines t)
1642 ** How can I get table fields starting with "="?
1643    :PROPERTIES:
1644    :CUSTOM_ID: table-fields-starting-with-=
1645    :END:
1647    With the setting
1649    : (setq org-table-formula-evaluate-inline nil)
1651    this will no longer happen.  You can still use formulas using the
1652    commands @<tt>C-c =@</tt> and @<tt>C-u C-c =@</tt>
1654 ** How can I change the indentation of an entire table without fixing every line by hand?
1655    :PROPERTIES:
1656    :CUSTOM_ID: change-indentation-entire-table
1657    :END:
1659    The indentation of a table is set by the first line.  So just fix the
1660    indentation of the first line and realign with =TAB=.
1662 ** In my huge table the realigning after each TAB takes too long.  What can I do?
1663    :PROPERTIES:
1664    :CUSTOM_ID: table-realigning-after-TAB-takes-long
1665    :END:
1667    Either split the table into several by inserting an empty line every
1668    100 lines or so.  Or turn off the automatic re-align with
1670    : (setq org-table-automatic-realign nil)
1672    After this the only way to realign a table is to press =C-c C-c=.  It
1673    will no longer happen automatically, removing the corresponding delays
1674    during editing.
1676 ** Recalculation of my table takes too long.  What can I do?
1677    :PROPERTIES:
1678    :CUSTOM_ID: Recalculation-of-my-table-takes-too-long
1679    :END:
1681    Nothing, really.  The spreadsheet in org is mostly done to make
1682    calculations possible, not so much to make them fast.  Since Org-mode
1683    is firmly committed to the ASCII format, nothing is stopping you from
1684    editing the table by hand.  Therefore, there is no internal
1685    representation of the data.  Each time Org-mode starts a computation,
1686    it must scan the table for special lines, find the fields etc.  This
1687    is slow.  Furthermore, Calc is slow compared to hardware
1688    computations.  To make this work with normal editing, recalculation
1689    is not happening automatically, or only for the current line, so that
1690    the long wait for a full table iteration only happens when you ask
1691    for it.
1693    So for really complex tables, moving to a "real" spreadsheet may
1694    still be the best option.
1696    That said, there are some ways to optimize things in Org-mode, and I
1697    have been thinking about moving a bit further down this line.
1698    However, for my applications this has so far not been an issue at
1699    all.  If you have a good case, you could try to convince me.
1701 ** =S-RET= in a table keeps increasing the copied numbers.  How can I stop this?
1702    :PROPERTIES:
1703    :CUSTOM_ID: S-RET-in-a-table-increases-copied-numbers
1704    :END:
1706    Well, it is /supposed/ to be a feature, to make it easy to create a
1707    column with increasing numbers.  If this gets into your way, turn it
1708    off with
1710    : (setq org-org-table-copy-increment nil)
1712 ** When I export tables to html, they don't have borders.
1713    :PROPERTIES:
1714    :CUSTOM_ID: table-borders-in-html-export
1715    :END:
1717 By default, org mode exports tables without borders.
1719 You can changed this by placing an =#+ATTR_HTML= line before the
1720 table:
1722 :  #+ATTR_HTML: border="2" rules="all" frame="all"
1724 See [[http://orgmode.org/manual/Tables-in-HTML-export.html#Tables-in-HTML-export][the manual]] for more details.
1726 ** Why does the Calc high precision (e. g. =p20=) not work like expected?
1727    :PROPERTIES:
1728    :CUSTOM_ID: table-high-precision
1729    :END:
1731 - *Short answer*
1733   Avoid
1734   : | 1 / 2 * 3 | 0.16666667000000 |
1735   : #+TBLFM: $2 = $1; p20 %.14f
1737   and use
1738   : | 1 / 2 * 3 | 0.16666666666667 |
1739   : #+TBLFM: $2 = $1 +.0; p20 f-14
1741 - *Longer answer*
1743   It is important to distinguish between the precision of
1744   1) =p20=: Calc internal calculation (=calc-internal-prec=)
1745   2) =f-14=: Calc float formatting, unlimited in precision (=calc-float-format=)
1746   3) =%.14f=: the =printf= reformatting, limited in precision
1748   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.
1750   Use =C-h v org-calc-default-modes RET= to check the Org default settings
1751   which are used if no format specifiers are added to a table formula.
1752   The examples below have been made with the out_of_the_box Org defaults
1753   =calc-internal-prec = 12= and =calc-float-format = 8=.
1755   Remember the formula debugger, toggled with =C-c {=,
1756   to view the processing stages like:
1757   |   | formula debugger label | processing stage           |
1758   | / | <                      | <>                         |
1759   |---+------------------------+----------------------------|
1760   |   | Result:                | output of Calc             |
1761   |   | Format:                | reformatting with =printf= |
1763   Following are some examples to demonstrate
1764   the interaction of the three precisions.
1766   - *display precision limitations for Calc formulas*
1767     - limited by Calc internal calculation precision from Org default
1768       (here =p12=)
1769       : | 0.16666666666700 |
1770       : #+TBLFM: $1 = 1 / 2 * 3;     f-14
1772       : | 0.1666666666670000000 |
1773       : #+TBLFM: $1 = 1 / 2 * 3;     f-19
1775     - limited by Calc float format from Org default (here =f8=)
1776       : | 0.16666667 |
1777       : #+TBLFM: $1 = 1 / 2 * 3
1779       : | 0.16666667 |
1780       : #+TBLFM: $1 = 1 / 2 * 3; p20
1782       : | 0.16666667000000 |
1783       : #+TBLFM: $1 = 1 / 2 * 3;          %.14f
1785       : | 0.16666667000000 |
1786       : #+TBLFM: $1 = 1 / 2 * 3; p20      %.14f
1788     - limited by Calc float format specified
1789       : | 0.166667 |
1790       : #+TBLFM: $1 = 1 / 2 * 3;     f-6
1792       : | 0.16666666666667 |
1793       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-14
1795       : | 0.1666666666666666667 |
1796       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-19
1798     - limited by =printf= conversion to Emacs Lisp float
1799       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
1800       : #+TBLFM: $1 = 1 / 2 * 3;          %.19f
1802       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
1803       : #+TBLFM: $1 = 1 / 2 * 3; p20      %.19f
1805       : | 0.1666666666666666600 | the inaccuracy is platform dependent |
1806       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-20 %.19f
1808     - limited by =printf= format specified
1809       : | 0.166667 |
1810       : #+TBLFM: $1 = 1 / 2 * 3;         %.6f
1812   - *display precision limitations for Emacs Lisp formulas*
1813     - limited by Emacs Lisp float
1814       : | 0.16666666666666666 |
1815       : #+TBLFM: $1 = '(/ 1.0 (* 2 3))
1817       : | 0.1666666666666666574 | the inaccuracy is platform dependent |
1818       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.19f
1820     - limited by =printf= format specified
1821       : | 0.16666666666667 |
1822       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.14f
1824 This FAQ entry is based on this [[http://thread.gmane.org/gmane.emacs.orgmode/22642][mailing list thread]]
1825 and is continued in the [[#table-float-fraction][next FAQ entry]].
1827 ** Which float format shows the fraction part also when the latter is zero?
1828    :PROPERTIES:
1829    :CUSTOM_ID: table-float-fraction
1830    :END:
1832 - *Short answer*
1834   Avoid
1835    : | 1 | 1 |
1836    : #+TBLFM: $2 = $1; f-3
1837   and use
1838    : | 1 | 1.000 |
1839    : #+TBLFM: $2 = $1 +.0; f-3
1841 - *Longer answer*
1843   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]]
1844   in the section Mode Settings -> Display Modes -> Float Formats
1845   [[http://www.delorie.com/gnu/docs/calc/calc_163.html][found here as long as the section numbering is unchanged]].
1847   Remember the formula debugger, toggled with =C-c {=,
1848   to view the processing stages like:
1849   |   | formula debugger label | processing stage           |
1850   | / | <                      | <>                         |
1851   |---+------------------------+----------------------------|
1852   |   | Result:                | output of Calc             |
1853   |   | Format:                | reformatting with =printf= |
1855   Following are some examples to demonstrate different float formats.
1857   - normal precision
1858     : |-----------+---------+-------+---------+----------+-------|
1859     : |    number |      f3 |   f-3 | +.0; f3 | +.0; f-3 |  %.3f |
1860     : |-----------+---------+-------+---------+----------+-------|
1861     : |         1 |       1 |     1 |   1.000 |    1.000 | 1.000 |
1862     : |         0 |       0 |     0 |   0.000 |    0.000 | 0.000 |
1863     : |-----------+---------+-------+---------+----------+-------|
1864     : |       1.0 |   1.000 | 1.000 |   1.000 |    1.000 | 1.000 |
1865     : |       0.0 |   0.000 | 0.000 |   0.000 |    0.000 | 0.000 |
1866     : |-----------+---------+-------+---------+----------+-------|
1867     : | 1.0001666 |   1.000 | 1.000 |   1.000 |    1.000 | 1.000 |
1868     : | 0.0001666 | 1.67e-4 | 0.000 | 1.67e-4 |    0.000 | 0.000 |
1869     : |-----------+---------+-------+---------+----------+-------|
1870     : | 1.0016666 |   1.002 | 1.002 |   1.002 |    1.002 | 1.002 |
1871     : | 0.0016666 |   0.002 | 0.002 |   0.002 |    0.002 | 0.002 |
1872     : |-----------+---------+-------+---------+----------+-------|
1873     : #+TBLFM: $2 = $1; f3 :: $3 = $1; f-3 :: $4 = $1 +.0; f3 :: $5 = $1 +.0; f-3 :: $6 = $1; %.3f
1875   - high precision
1876     : |----------------------+--------------------------+-----------------------|
1877     : | number               |                      f19 |                  f-19 |
1878     : |----------------------+--------------------------+-----------------------|
1879     : | 1                    |                        1 |                     1 |
1880     : | 0                    |                        0 |                     0 |
1881     : |----------------------+--------------------------+-----------------------|
1882     : | 1.0                  |    1.0000000000000000000 | 1.0000000000000000000 |
1883     : | 0.0                  |    0.0000000000000000000 | 0.0000000000000000000 |
1884     : |----------------------+--------------------------+-----------------------|
1885     : | 1 + 1 / 2 * 3 * 1e19 |    1.0000000000000000000 | 1.0000000000000000000 |
1886     : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
1887     : |----------------------+--------------------------+-----------------------|
1888     : | 1 + 1 / 2 * 3 * 1e18 |    1.0000000000000000002 | 1.0000000000000000002 |
1889     : | 0 + 1 / 2 * 3 * 1e18 |    0.0000000000000000002 | 0.0000000000000000002 |
1890     : |----------------------+--------------------------+-----------------------|
1891     : #+TBLFM: $2 = $1; p20 f19 :: $3 = $1; p20 f-19
1893     : |----------------------+--------------------------+-----------------------|
1894     : | number               |                 +.0; f19 |             +.0; f-19 |
1895     : |----------------------+--------------------------+-----------------------|
1896     : | 1                    |    1.0000000000000000000 | 1.0000000000000000000 |
1897     : | 0                    |    0.0000000000000000000 | 0.0000000000000000000 |
1898     : |----------------------+--------------------------+-----------------------|
1899     : | 1.0                  |    1.0000000000000000000 | 1.0000000000000000000 |
1900     : | 0.0                  |    0.0000000000000000000 | 0.0000000000000000000 |
1901     : |----------------------+--------------------------+-----------------------|
1902     : | 1 + 1 / 2 * 3 * 1e19 |    1.0000000000000000000 | 1.0000000000000000000 |
1903     : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
1904     : |----------------------+--------------------------+-----------------------|
1905     : | 1 + 1 / 2 * 3 * 1e18 |    1.0000000000000000002 | 1.0000000000000000002 |
1906     : | 0 + 1 / 2 * 3 * 1e18 |    0.0000000000000000002 | 0.0000000000000000002 |
1907     : |----------------------+--------------------------+-----------------------|
1908     : #+TBLFM: $2 = $1 +.0; p20 f19 :: $3 = $1 +.0; p20 f-19
1910     The =printf= reformatting (=%.19f=) cannot be used with high precision,
1911     see the [[#table-high-precision][previous FAQ entry]].
1913 ** How can I center tables in LaTeX output?
1914    :PROPERTIES:
1915    :CATEGORY: centered-tables-in-latex
1916    :END:
1918 Set the `org-export-latex-tables-centered' to `t':
1920 : (defcustom org-export-latex-tables-centered t
1921 :   "When non-nil, tables are exported in a center environment."
1922 :   :group 'org-export-latex
1923 :   :type 'boolean)
1925 * Markup
1926   :PROPERTIES:
1927   :CUSTOM_ID: Footnotes
1928   :END:
1929 ** How can I get automatic renumbering of footnotes in org-mode?
1930    :PROPERTIES:
1931    :CUSTOM_ID:       footnote-auto-adjust
1932    :END:
1934 You can add the following line to your .emacs file:
1936 : (setq org-footnote-auto-adjust t)
1938 Or, if you prefer, you can turn this option on locally by placing the
1939 following line at the top of your org file:
1941 : #+STARTUP: fnadjust
1943 When auto-adjust is turned on, footnotes in the file with numerical
1944 labels will be renumbered whenever a new footnote is added. Meanwhile,
1945 all footnotes, including those with custom labels such
1946 =[fn:custom-label ]=, will be sorted in the order of their appearance
1947 in the text.
1949 This emulates the footnote behavior that many users may be familiar
1950 with from word-processing programs or from the footnote-mode included
1951 with emacs.
1953 If you do not turn on org-footnote-auto-adjust, you sort and/or
1954 renumber footnotes at any time by calling org-footnote-action with a
1955 prefix argument.
1957 ** Why isn't auto renumbering of footnotes turned on by default?
1958    :PROPERTIES:
1959    :CUSTOM_ID:       why-no-default-auto-adjust
1960    :END:
1962 Org mode has a very robust footnote mechanism allowing for a variety
1963 of types of footnotes. With some of the following footnote notations,
1964 auto-adjust may be either irrelevant or undesired:
1966  - Automatically numbered
1967  - Footnotes with custom labels
1968  - Inline footnotes
1970 In addition, org mode can be customized to place footnotes either at
1971 the end of a document or at the end of the outline heading in which
1972 they appear. Users who change this setting while editing a document
1973 may be disconcerted to find all of their footnotes rearranged
1974 automatically.
1976 ** I have auto-fill-mode set and org-mode is inserting unwanted comment markers!
1977    :PROPERTIES:
1978    :CUSTOM_ID: auto-fill-and-unwanted-comments
1979    :END:
1981 If the following occurs:
1983 #+begin_src org
1984   ,#+OPTIONS: toc:nil
1985   ,Some entered text.
1986   ,# More entered tex.
1987 #+end_src
1989 Make sure that the variable comment-start is nil.
1991 ** Are there any shortcuts for entering source blocks and comment lines?
1992    :PROPERTIES:
1993    :CUSTOM_ID: shortcuts-for-entering-source-blocks
1994    :END:
1996 Org mode has some [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][very convenient markup]] for including literal blocks
1997 and lines of code in a file. (This is especially useful when exporting
1998 documents or using the contributed package [[file:org-contrib/babel/index.org][org-babel]] for executing
1999 blocks of code.)
2001 #+begin_src org
2002   ,#+begin_src perl
2003   ,  print "Hello, world!\n";
2004   ,#+end_src
2005 #+end_src
2007 It can be tiresome to enter the block comment lines manually. There
2008 are several possible shortcuts you can use to enter them:
2010 1) Built-in expansion
2012    - Org mode has a "secret" method of expanding source code blocks
2013      and comment lines.
2015    - If you type "<s" followed by =TAB= or =M-TAB=, a source block will
2016      magically appear.
2018    - For a full list of expansions, type =M-x describe-variable
2019      [RET] org-structure-template-alist=.
2021 2) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Registers]]
2023    - Add the following line to your emacs file:
2025      =(set-register ?p "#+begin_src\n\n#+end_src perl")=
2027    - Then type =C-x r i p= to insert the source block. Please note: if
2028      you save another value to the register "p" with =C-x r s p=, it
2029      will overwrite the setting above for the current emacs session.
2031 3) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Abbrevs]]
2033    - Activate the abbrev minor-mode in org-mode:
2035      + M-x abbrev-mode
2037      + /Permanently/:
2039        + =(add-hook 'org-mode-hook (lambda () (abbrev-mode 1)))=
2041    - In org-mode, type "sbp" (a sample abbreviation for a perl source
2042      block).
2044    - Immediately after "sbp" type =C-x a i l=.
2046    - Enter the expansion:
2048      - =#+begin_src perl[C-q C-j][C-q C-j]#+end_src=
2050      - Note: =C-q C-j= creates a new line in the minibuffer
2052    - Now, whenever, you type sbp followed by =SPACE= or =RET= in an
2053      org-mode buffer, the src block will magically appear.
2055    - To review your list of abbrevs, type =M-x edit-abbrevs=.
2057 4) [[http://www.slashgear.com/nokia-n900-android-dual-boot-hack-video-2371099/][Skeletons]]
2059    - Skeletons offer a simple way of automatically entering text.
2060      Here's a skeleton that queries for the type of block and wraps
2061      the active region inside it:
2063      #+begin_src elisp
2064        (define-skeleton skel-org-block
2065          "Insert an org block, querying for type."
2066          "Type: "
2067          "#+begin_" str "\n"
2068          _ - \n
2069          "#+end_" str "\n")
2070      #+end_src
2072    - Simply type skel-org-block to insert the block.
2074      - You can bind this to a key.
2076      - You can also create an abbrev that invokes this function:
2078        : (define-abbrev org-mode-abbrev-table "blk" "" 'skel-org-block)
2080 5) [[http://code.google.com/p/yasnippet/][Yasnippet]]
2082    - Several org-mode users install yasnippet for convenient, complex
2083      expansion.
2085    - See Bernt Hansen's [[http://doc.norang.ca/org-mode.html#Yasnippets][org-mode setup]] for a good introduction to
2086      yasnippet.
2088 * Capture and remember
2089   :PROPERTIES:
2090   :CUSTOM_ID: Remember
2091   :END:
2092 ** Can I use a variable or a function inside the `org-capture-templates' variable?
2093    :PROPERTIES:
2094    :CUSTOM_ID: variable-inside-capture-templates
2095    :END:
2097 Yes.  Use [[http://www.gnu.org/s/emacs/manual/html_node/elisp/Backquote.html][backquotes]].
2099 E.g. if you have a variable called =org-test-file= and you want the
2100 variable =org-capture-templates= to "understand" (i.e. evaluate)
2101 =org-test-file= when Emacs evaluates the =(setq org-capture-templates
2102 [...])= expression, use backquotes like this:
2104 #+begin_src emacs-lisp
2105 (setq org-capture-templates
2106       `(("t" "Todo" entry (file+headline ,org-test-file "Tasks")
2107        "* TODO %?\n  %i\n  %a")
2108       ("b" "Buy" item (file+olp ,org-test-file "Stuff to Buy" "House")
2109        "")))
2110 #+end_src
2112 ** Can I use the remember buffer to clock a customer phone call?
2113    :PROPERTIES:
2114    :CUSTOM_ID: use-remember-buffer-to-clock-phone-call
2115    :END:
2117   Yes, you can.  Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/5482][setup described by Bernt Hansen]]
2118   and check out (in the same thread) what Nick Docos had to fix to
2119   make Bernt's set-up work for him.
2120 ** Can I automatically start the clock when opening a remember template?
2121    :PROPERTIES:
2122    :CUSTOM_ID: start-clock-when-opening-remember-template
2123    :END:
2125    Yes, this is possible.  Use the following code and make sure that
2126    after executing it, `my-start-clock-if-needed' is in
2127    `remember-mode-hook' /after/ `org-remember-apply-template'.
2129    : (add-hook 'remember-mode-hook 'my-start-clock-if-needed 'append)
2130    : (defun my-start-clock-if-needed ()
2131    :   (save-excursion
2132    :     (goto-char (point-min))
2133    :     (when (re-search-forward " *CLOCK-IN *" nil t)
2134    :       (replace-match "")
2135    :       (org-clock-in))))
2137    Then, when a template contains the key string CLOCK-IN, the clock
2138    will be started.  Starting with Org-mode version 5.20, the clock will
2139    automatically be stopped when storing the remember buffer.
2141 * Searches
2142   :PROPERTIES:
2143   :CUSTOM_ID: Searches
2144   :END:
2145 ** Isearch does not find string hidden in links.  What can I do?
2146    :PROPERTIES:
2147    :CUSTOM_ID: isearch-in-links
2148    :END:
2150   M-x =visible-mode= will display the full link, making them searchable.
2152 ** How can I reduce the amount of context shown in sparse trees?
2153    :PROPERTIES:
2154    :CUSTOM_ID: context-in-sparse-trees
2155    :END:
2157    Take a look at the following variables:
2159    - =org-show-hierarchy-above=
2160    - =org-show-following-headline=
2161    - =org-show-siblings=
2162    - =org-show-entry-blow=
2164    which give command-dependent control over how much context is shown
2165    by a particular operation.
2167 ** How can I combine the results of two calls to =org-occur=?
2168    :PROPERTIES:
2169    :CUSTOM_ID: two-calls-to-org-occur
2170    :END:
2172    You can construct a regular expression that matches all targets you
2173    want.  Alternatively, use a =C-u= prefix with the second and any
2174    further calls to =org-occur= to keep the current visibility and
2175    highlighting in addition to the new ones.
2177 * Agenda
2178   :PROPERTIES:
2179   :CUSTOM_ID: Agenda
2180   :END:
2181 ** How can I change the advanced warning time for deadlines?
2182    :PROPERTIES:
2183    :CUSTOM_ID: warning-period-for-deadlines
2184    :END:
2185 ##<<warning-period-for-deadlines>>
2187 Deadline warnings appear in the daily agenda view a specified number
2188 of days before the deadline is due. The default setting is 14 days.
2189 You can change this with the variable =org-deadline-warning-days=.
2190 (See [[http://orgmode.org/manual/Deadlines-and-scheduling.html#Deadlines-and-scheduling][this section]] of the manual.)
2192 For instance,
2194 : (setq org-deadline-warning-days 30)
2196 would cause warnings for each deadline to appear 30 days in advance.
2198 Naturally, you might not want warnings for all of your deadlines to
2199 appear so far in advance. Thus, you can change the lead time for
2200 individual items as follows:
2202 : * TODO Get a gift for the party
2203 :   DEADLINE: <2009-01-16 Fri -2d>
2205 The "-2d" above changes the lead time for this deadline warning to two
2206 days in advance. You can also use "w" for weeks and "m" for months.
2207 ** How can I postpone a task until a certain date?
2208    :PROPERTIES:
2209    :CUSTOM_ID: deferring-tasks
2210    :END:
2212 The easiest way to postpone a task is to schedule it in the future.
2213 For instance, typing =C-c C-s +2w= on a headline will push a task two
2214 weeks into the future, so that it won't show up on the daily agenda
2215 until two weeks from now.
2217 If you'd like to prevent the task from showing up on your global todo
2218 list, you have a couple of options.
2220 1. You can set the variable =org-agenda-todo-ignore-scheduled= to =t=.
2221    This will exclude any scheduled items from your global list of
2222    active todos (=C-c a t=). (The variable
2223    =org-agenda-todo-ignore-with-date= will exclude both scheduled and
2224    deadline items from your todo list).
2225 2. You can remove the todo keyword from the item (C-c C-t <SPC>). The
2226    item will still appear on your agenda two weeks from today, but it
2227    won't show up on your todo lists.
2228 ** Can I send myself an email containing tasks or other agenda info?
2229    :PROPERTIES:
2230    :CUSTOM_ID: email-containing-tasks-or-other-agenda-info
2231    :END:
2233    Yes.  See [[http://article.gmane.org/gmane.emacs.orgmode/6112][this thread]] on the list.
2235 ** How can I limit the agenda view to my "work" tasks?
2236    :PROPERTIES:
2237    :CUSTOM_ID: limit-agenda-with-tag-filtering
2238    :END:
2240    It is often convenient to group org files into separate categories,
2241    such as "home" and "work" (or "personal" and "professional"). One
2242    of the main reasons for such classification is to create agenda
2243    views that are limited by type of work or area of responsibility.
2244    For instance, while at work, one may want to see only professional
2245    tasks; while away from work, one may want to see only personal
2246    tasks.
2248    One way to categorize files and tasks is to use a "#+FILETAGS"
2249    declaration at the top of each file, such as:
2251    : #+FILETAGS: work
2253    As long as org-use-tag-inheritance is turned on, the filetags will
2254    be inherited by all tasks in the file. A file can have multiple
2255    filetags. And, of course, tags can be added to individual headings.
2257    Tasks can be quickly filtered by tag from within the agenda by
2258    typing "/" and the name of the tag. The full key sequence to filter
2259    for work items in an agenda view would be:
2261    : C-c a a / work [or a tag shortcut]
2263 ** How can I limit the agenda view to a particular category?
2264    :PROPERTIES:
2265    :CUSTOM_ID: limit-agenda-with-category-match
2266    :END:
2268    Another way to filter agenda views by type of work is to use a
2269    "#+CATEGORY" declaration at the top of each file, such as:
2271    : #+CATEGORY: work
2273    Categories can also be added to individual headings within a file:
2275    : * Big project
2276    :   :PROPERTIES:
2277    :   :CATEGORY: work
2278    :   :END:
2280    All todos belonging to the category "work" can be found a with a
2281    simple tags-todo search:
2283    : C-c a M
2285    At the prompt, type:
2287    : CATEGORY="work"
2289    The same results can be achieved with custom agenda commands, such as:
2291 #+BEGIN_SRC emacs-lisp
2292 (setq org-agenda-custom-commands
2293       '(("h" tags-todo "CATEGORY=\"home\"")
2294         ("w" tags-todo "CATEGORY=\"work\"")
2295         ;; other custom agenda commands here
2296         ))
2297 #+END_SRC
2299 ** How can include all org files in a directory in my agenda?
2300    :PROPERTIES:
2301    :CUSTOM_ID: set-agenda-files-using-wildcards
2302    :END:
2304 You can simply include the directory (as one of the items) in the
2305 value of the variable org-agenda-files:
2307 : (setq org-agenda-files '("/my/special/path/org/"))
2309 There is another way of accomplishing the same end:
2311 : (setq org-agenda-files (file-expand-wildcards "/my/special/path/org/*.org"))
2313 ** Why aren't items disappearing from my agenda once they are marked done?
2314    :PROPERTIES:
2315    :CUSTOM_ID: removing-done-items-from-agenda
2316    :END:
2318 If items remain on your daily/weekly agenda after they are marked
2319 done, check the configuration of the following variables:
2321 : org-agenda-skip-scheduled-if-done
2322 : org-agenda-skip-deadline-if-done
2323 : org-agenda-skip-timestamp-if-done
2325 For instance, type:
2327 : M-x customize-variable RET org-agenda-skip-scheduled-if-done
2329 If this variable is turned off (=nil=), then scheduled items will
2330 remain on the agenda even after they are marked done.
2332 If the variable is turned on (=t=), then scheduled items will
2333 disappear from the agenda after they are marked done.
2335 If these settings seem not to behave the way you expect, then make
2336 sure you understand [[scheduled-vs-deadline-vs-timestamp][the
2337 difference between SCHEDULED, DEADLINE, and timestamps]].
2339 ** What is the difference between SCHEDULED, DEADLINE, and plain timestamps?
2340    :PROPERTIES:
2341    :CUSTOM_ID: scheduled-vs-deadline-vs-timestamp
2342    :END:
2344 1. SCHEDULED items (set with =C-c C-s=) will appear on your agenda on
2345    the day they are scheduled and on every day thereafter until they
2346    are done. Schedule a task if you want to be reminded to do
2347    something beginning on a certain day and until it is done.
2349    : ** TODO Scheduled item
2350    :    SCHEDULED: <2009-03-01 Sun>
2352 2. Items with a DEADLINE timestamp (set with =C-c C-d=) appear on your
2353    agenda in advance of the when they are due and remain on your
2354    agenda until they are done. Add a DEADLINE to an item if you want
2355    to make sure to complete it by a certain date. (The variable
2356    org-deadline-warning-days determines how far in advance items with
2357    deadlines will show up in the agenda. See [[warning-period-for-deadlines][this FAQ]] for more
2358    information.)
2360    : ** TODO Item with a deadline
2361    :    DEADLINE: <2009-01-20 Tue>
2363 3. An active timestamp (set with =C-c .=) will appear on your agenda
2364    only on the day it is scheduled. Use a timestamp for appointments
2365    or any reminders you want to show up only on a particular day.
2367    : ** TODO Item with an active timestamp
2368    : <2009-04-18 Sat>
2370 Note: items with inactive timestamps (set with C-c ! and marked by
2371 square brackets) will not show up in the agenda at all.
2373 ** Can I add files recursively to my list of agenda files?
2374    :PROPERTIES:
2375    :CUSTOM_ID: set-agenda-files-recursively
2376    :END:
2378 Yes, you can use the library "find-lisp."
2380 : (load-library "find-lisp")
2381 : (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$"))
2383 This will add all files ending in =org= in the directory "~/org"
2384 and all of its subdirectories to your list of agenda files.
2386 See [[http://thread.gmane.org/gmane.emacs.orgmode/8992][this thread]] on the mailing list for more information.
2388 ** Why does an item appearing at the wrong time of day in my agenda?
2389    :PROPERTIES:
2390    :CUSTOM_ID: agenda-wrong-time-of-day
2391    :END:
2393 When preparing the agenda view, org-mode scans each relevant headline
2394 for a time designation. This approach is very nice for adding
2395 free-form timestamps to an item for scheduling. Thus, either of the
2396 following work would work to schedule an item at 10:00am:
2398 #+begin_src org
2399 ,** 10:00am Get dried ice at the magic store
2400 ,   SCHEDULED: <2009-05-27 Wed>
2401 #+end_src
2403 #+begin_src org
2404 ,** Get dried ice at the magic store
2405 ,   SCHEDULED: <2009-05-27 Wed 10:00>
2406 #+end_src
2408 To enable this flexibility, org-mode scans the entire headline for
2409 time of day notation. A potential problem can arise if you use
2410 inactive timestamps in the headline to note when an item was created.
2411 For example,
2413 #+begin_src org
2414 ,** Get dried ice at the magic store [2009-05-26 Tue 12:58]
2415 ,   SCHEDULED: <2009-05-27 Wed>
2416 #+end_src
2418 Org mode would interpret the time in the inactive timestamp as a
2419 time-of-day indicator and the entry would appear in your agenda at
2420 12:58.
2422 If you would like to turn off the time-of-day search, you can
2423 configure the variable =org-agenda-search-headline-for-time= (requires
2424 org-mode >= 6.24).
2426 ** How can I change the visibility of an item from the agenda?
2427    :PROPERTIES:
2428    :CUSTOM_ID: cycling-visibility-from-agenda
2429    :END:
2431 You can add a keybinding as follows:
2433 #+begin_src emacs-lisp
2434 (add-hook 'org-agenda-mode-hook
2435    (lambda ()
2436      (define-key org-agenda-mode-map " " 'org-agenda-cycle-show)))
2437 #+end_src
2439 Then, as you press SPACE on an item on the agenda, it will cycle the
2440 visibility of its original location.
2442 ** Is there any way to set org-mode so that tags don't appear in the agenda view?
2444 See the =org-agenda-remove-tags= variable.
2446 ** I work late at night! How can I extend my current day past midnight?
2447    :PROPERTIES:
2448    :CUSTOM_ID: org-extend-today-until
2449    :END:
2451 If you work past midnight, you may not want your daily agenda view to
2452 switch to the next day at 12 a.m. (the default). To extend your day,
2453 simply set the value of org-extend-today-until to a positive number
2454 corresponding to the number of hours you work past midnight. For
2455 example, the following setting will cause the current day to extend
2456 until 6 a.m.
2458 : (setq org-extend-today-until 6)
2460 * Appointments/Diary
2461   :PROPERTIES:
2462   :CUSTOM_ID: Appointments/Diary
2463   :END:
2464 ** Is it possible to include entries from org-mode files into my emacs diary?
2465    :PROPERTIES:
2466    :CUSTOM_ID: include-entries-from-org-mode-files-into-emacs-diary
2467    :END:
2469    Since the org-mode agenda is much more powerful and can contain the
2470    diary, you should think twice before deciding to do this.  If you
2471    insist, however, integrating Org-mode information into the diary is
2472    possible.  You need to turn on /fancy diary display/ by setting in
2473    .emacs:
2475    : (add-hook 'diary-display-hook 'diary-fancy-display)
2477    Then include the following line into your ~/diary file, in
2478    order to get the entries from all files listed in the variable
2479    =org-agenda-files=
2481    : &%%(org-diary)
2483    You may also select specific files with
2485    : &%%(org-diary) ~/path/to/some/org-file.org
2486    : &%%(org-diary) ~/path/to/another/org-file.org
2488    If you now launch the calendar and press @<tt>d@</tt> to display a
2489    diary, the headlines of entries containing a timestamp, date range,
2490    schedule, or deadline referring to the selected date will be listed.
2491    Just like Org-mode's agenda view, the diary for /today/ contains
2492    additional entries for overdue deadlines and scheduled items.  See
2493    also the documentation of the =org-diary= function.  Under XEmacs, it
2494    is not possible to jump back from the diary to the org, this works
2495    only in the agenda buffer.
2496 ** I want to add my Org scheduled/deadlined entries in my diary!
2497    :PROPERTIES:
2498    :CUSTOM_ID: add-Org-scheduled/deadlined-entries-to-diary!
2499    :END:
2501   Put this in your ~/.diary:
2503   : &%%(org-diary :scheduled :timestamp :deadline)
2505 ** How can I set up automatic reminders based on Org information?
2506    :PROPERTIES:
2507    :CUSTOM_ID: automatic-reminders
2508    :END:
2510   See [[http://article.gmane.org/gmane.emacs.orgmode/5271][this post]] by N. Dokos on the list.
2511 ** How can I make =appt= notice my Org appointments?
2512    :PROPERTIES:
2513    :CUSTOM_ID: appt-notice-my-Org-appointments
2514    :END:
2516   : M-x org-agenda-to-appt RET
2518 ** How can I create more complex appointments in my org-files?
2519    :PROPERTIES:
2520    :CUSTOM_ID: diary-sexp-in-org-files
2521    :END:
2523 Org-mode's active timestamps work very well for scheduling individual
2524 or recurring appointments, such as:
2526 #+begin_src org
2527   ,* 8:00am Dentist appointment <2009-01-16 Fri>
2528 #+end_src
2531 #+begin_src org
2532   ,* Vacation
2533   ,  <2009-03-20 Fri>--<2009-04-01 Wed>
2534 #+end_src
2538 #+begin_src org
2539   ,* Weekly meeting with boss
2540   ,  <2009-01-20 Tue 14:00 +1w>
2541 #+end_src
2543 Sometimes, however, you need to set up more complicated recurring
2544 appointments. Org-mode has built-in support for many of
2545 [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Sexp-Diary-Entries.html][the
2546 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
2547 instance, that you teach a class that meets every Monday evening
2548 between February 16 and April 20, 2009. The way to enter this an
2549 org-mode file is:
2551 #+begin_src org
2552   ,** Class 7:00pm-9:00pm
2553   ,   <%%(and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009))>
2554 #+end_src
2556 The expression above designates all Mondays that fall between February
2557 16 and April 20. How exactly does it work?
2559  - (and... :: Indicates that *both* of the conditions that follow have
2560           to be true.
2562    - (= 1 (calendar-day-of-week date)) :: Is the day of the week a
2563         Monday?
2565        - Note: the function calendar-day-of-week converts the date to the day of week
2566          expressed in numeric form, where 0 = Sunday, 1 = Monday, and so on.
2568    - (diary-block 2 16 2009 4 20 2009) :: Does the date fall between
2569         these two dates?
2571 You can make a sexp as complex as you like. If you wanted to omit a
2572 week because of holidays, for instance, you could add another
2573 condition to the sexp:
2575 #+begin_src org
2576   ,** Class 7:00pm-9:00pm
2577   ,   <%%(unless (diary-block 3 9 2009 3 13 2009) (and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009)))>
2578 #+end_src
2580 The sexp above would omit Monday during the week of March 9, 2009. For
2581 another way to accomplish the same thing, see [[org-diary-class][this FAQ]].
2583 Another diary function commonly used for more complex scheduling is
2584 diary-float. For instance,
2586 #+begin_src org
2587   ,* Monthly meeting
2588   ,  <%%(diary-float t 3 3)>
2589 #+end_src
2591 ...would appear on the third Wednesday of every month.
2593 For more ideas on how to create diary special expressions, see [[http://www.emacswiki.org/cgi-bin/wiki/DiaryMode][this
2594 page on the Emacs wiki]].
2596 ** How can I schedule a weekly class that lasts for a limited period of time?
2597    :PROPERTIES:
2598    :CUSTOM_ID: org-diary-class
2599    :END:
2601 Org-mode offers a convenient diary sexp function for setting up a
2602 recurring appointment that lasts for a certain period of time, such as
2603 a class. It is called org-diary-class and it can be entered as
2604 follows:
2606 #+begin_src org
2607   ,** Class 7:00pm-9:00pm
2608   ,   <%%(org-diary-class 2 16 2009 4 20 2009 1 10)>
2609 #+end_src
2611 The function above schedules an appointment for every Monday (1)
2612 between February 16 and April 20, 2009, except for ISO week 10 (March
2613 1 to March 7).
2615 The function org-diary-class has the following format:
2617 : (org-diary-class M1 D1 Y1 M2 D2 Y2 DAYNAME &rest SKIP-WEEKS)
2619 M1/2, D1/2, and Y1/2 indicate the beginning and ending dates. Dayname
2620 takes the form of a number indicating the day of the week (0 = Sunday,
2621 1 = Monday, and so on...). In addition, one can add an optional
2622 argument SKIP-WEEKS to indicate weeks on the calendar that should be
2623 skipped. This argument should be expressed as an ISO week number. You
2624 can find the number by invoking emacs' built-in calendar (=M-x
2625 calendar=), navigating to the appropriate week, and typing =p c=
2626 (calendar-iso-print-date).
2628 Please note: the order of the month, day, and year arguments depends
2629 on the variables =calendar-date-style= and/or
2630 =european=calendar=style=. (See the documentation for these variables
2631 with C-h v or M-x describe variable.) For instance, the example above
2632 works if =calendar-date-style= is set to ='american=. If
2633 =calendar-date-style= is set to ='iso=, then the arguments to the
2634 org-diary-class sexp would have the following format:
2636 : (org-diary-class Y1 M1 D1 Y2 M2 D2 DAYNAME &rest SKIP-WEEKS)
2638 Here is an alternative method, shared by Paul Sexton on the org
2639 mailing list:
2641 Let's say you are taking night classes in Spanish. The class is every
2642 Wednesday evening at 7pm, starting on 18 August, and runs for 8 weeks.
2643 Org-mode's timestamps do not support limited occurrences of recurrent
2644 items -- you have to schedule the item with infinite recurrences, then
2645 delete it when it finishes.
2647 To schedule the Spanish classes, put the following in your =.emacs=:
2649 #+begin_src emacs-lisp
2650   (defun diary-limited-cyclic (recurrences interval m d y)
2651     "For use in emacs diary. Cyclic item with limited number of recurrences.
2652   Occurs every INTERVAL days, starting on YYYY-MM-DD, for a total of
2653   RECURRENCES occasions."
2654     (let ((startdate (calendar-absolute-from-gregorian (list m d y)))
2655           (today (calendar-absolute-from-gregorian date)))
2656       (and (not (minusp (- today startdate)))
2657            (zerop (% (- today startdate) interval))
2658            (< (floor (- today startdate) interval) recurrences))))
2659 #+end_src
2660 The item in the org file looks like this:
2662 #+begin_src org
2663   ,** 19:00-21:00 Spanish lessons
2664   ,   <%%(diary-limited-cyclic 8 7 8 18 2010)>
2665 #+end_src
2667 ** How can I set an event to occur every day except Saturday and Sunday?
2669 #+begin_src org
2670   ,** Daily meeting
2671   ,   <%%(memq (calendar-day-of-week date) '(1 2 3 4 5))>
2672 #+end_src
2674 ** How do I schedule events relative to Easter Sunday?
2676    Easter's date moves around from year to year according to a
2677    complicated set of criteria which I do not claim to understand.
2678    However the following code will allow you to schedule recurring
2679    events relative to Easter Sunday.
2681    Note: the function da-easter is from:
2682    http://github.com/soren/elisp/blob/master/da-kalender.el
2684    Put the following in your .emacs:
2686 #+begin_src emacs-lisp
2687   (defun da-easter (year)
2688     "Calculate the date for Easter Sunday in YEAR. Returns the date in the
2689   Gregorian calendar, ie (MM DD YY) format."
2690     (let* ((century (1+ (/ year 100)))
2691            (shifted-epact (% (+ 14 (* 11 (% year 19))
2692                                 (- (/ (* 3 century) 4))
2693                                 (/ (+ 5 (* 8 century)) 25)
2694                                 (* 30 century))
2695                              30))
2696            (adjusted-epact (if (or (= shifted-epact 0)
2697                                    (and (= shifted-epact 1)
2698                                         (< 10 (% year 19))))
2699                                (1+ shifted-epact)
2700                              shifted-epact))
2701            (paschal-moon (- (calendar-absolute-from-gregorian
2702                              (list 4 19 year))
2703                             adjusted-epact)))
2704       (calendar-dayname-on-or-before 0 (+ paschal-moon 7))))
2707   (defun da-easter-gregorian (year)
2708     (calendar-gregorian-from-absolute (da-easter year)))
2710   (defun calendar-days-from-easter ()
2711     "When used in a diary sexp, this function will calculate how many days
2712   are between the current date (DATE) and Easter Sunday."
2713     (- (calendar-absolute-from-gregorian date)
2714        (da-easter (calendar-extract-year date))))
2715 #+end_src
2717     Now we can schedule the public holidays associated with Easter as
2718     recurring events. Good Friday is 2 days before "Easter", Easter
2719     Monday is one day after.
2721 #+begin_src org
2722   ,* Good Friday
2723   ,  <%%(= -2 (calendar-days-from-easter))>
2725   ,* Easter Sunday
2726   ,  <%%(= 0 (calendar-days-from-easter))>
2728   ,* Easter Monday
2729   ,  <%%(= 1 (calendar-days-from-easter))>
2730 #+end_src
2731    [Source: Posted by Paul Sexton on Org-mode mailing list.]
2733 ** How to schedule public holiday that is "the nearest Monday to DATE"?
2735    In New Zealand each regional capital has an "Anniversary Day". The
2736    date of Auckland's anniversary day is "the nearest Monday to 29
2737    January".
2739    Put this in your =.emacs=:
2741 #+begin_src emacs-lisp
2742   (defun calendar-nearest-to (target-dayname target-day target-month)
2743     "Recurring event that occurs in the nearest TARGET-DAYNAME to
2744   the date TARGET-DAY, TARGET-MONTH each year."
2745     (interactive)
2746     (let* ((dayname (calendar-day-of-week date))
2747            (target-date (list target-month target-day (calendar-extract-year date)))
2748            (days-diff (abs (- (calendar-day-number date)
2749                               (calendar-day-number target-date)))))
2750       (and (= dayname target-dayname)
2751            (< days-diff 4))))
2752 #+end_src
2754    Now we can schedule Auckland Anniversary Day. The first argument,
2755    1, means Monday (days of the week are numbered starting with
2756    Sunday=0).
2758    [Source: Originally posted by Paul Sexton on Org-mode mailing list.]
2760 ** How to schedule public holiday on "the 4th Monday in October"?
2762    This does not require any additions to =.emacs=:
2764 #+begin_src org
2765   ,* Labour Day (NZ)
2766   ,  <%%(diary-float 10 1 4)>
2767 #+end_src
2769 ** Why isn't the agenda showing all the times I put under a single entry?
2770    :PROPERTIES:
2771    :CATEGORY: multiple-timestamps-same-entry
2772    :END:
2774 Probably because you have not set the following variable:
2776 : org-agenda-skip-additional-timestamps-same-entry
2778 The default value of this variable is t, which means that entries with
2779 multiple timestamps, such as the following...
2781 #+begin_src org
2782   ,* Work really, really hard
2783   ,  <2010-11-20 Sat 10:00>
2784   ,  <2010-11-20 Sat 14:00>
2785 #+end_src
2787 ...will only appear in the agenda at the time specified by the first
2788 timestamp. If you set org-agenda-skip-additional-timestamps-same-entry
2789 to nil, the item will appear will appear at all the times you specify.
2791 * Export
2792   :PROPERTIES:
2793   :CUSTOM_ID: Export
2794   :END:
2795 ** Can I get TODO items exported to HTML as lists, rather than as headlines?
2796    :PROPERTIES:
2797    :CUSTOM_ID: export-TODO-items-as-lists
2798    :END:
2800    If you plan to use ASCII or HTML export, make sure things you want to
2801    be exported as item lists are level 4 at least, even if that does
2802    mean there is a level jump.  For example:
2804    : * Todays top priorities
2805    : **** TODO write a letter to xyz
2806    : **** TODO Finish the paper
2807    : **** Pick up kids at the school
2809    Alternatively, if you need a specific value for the heading/item
2810    transition in a particular file, use the =#+OPTIONS= line to
2811    configure the H switch.
2813    : #+OPTIONS:   H:2; ...
2815 ** Can I export only a single subtree?
2816    :PROPERTIES:
2817    :CUSTOM_ID: export-single-subtree
2818    :END:
2820 If you want to export a subtree, mark the subtree as region and then
2821 export. Marking can be done with =C-c @ C-x C-x=, for example.
2823 Alternatively, you can select option =1= in the org export dispatcher
2824 (e.g.., =C-c C-e 1 h= to export the current subtree to html).
2826 By default, the title of the exported file will be set to the heading
2827 of the subtree. You can, however, [[#export-options-for-subtree][customize the title and other export
2828 options]].
2830 ** How can I customize export options for a single subtree?
2831    :PROPERTIES:
2832    :CUSTOM_ID: export-options-for-subtree
2833    :END:
2835 You can set unique export options for a [[#export-single-subtree][single subtree]] by using
2836 properties. Relevant properties include:
2838  - EXPORT_TITLE
2839  - EXPORT_AUTHOR
2840  - EXPORT_DATE
2841  - EXPORT_FILE_NAME
2842  - EXPORT_OPTIONS (corresponds to the =#+OPTIONS:= [[http://orgmode.org/manual/Export-options.html#Export-options][configuration line]])
2844 ** How can I tell my calendar web application about appointments in my agenda files?
2846 Here is what you need to do:
2848 1. a script that calls Emacs in batch mode and produce a .ics file
2849 2. a script that uploads this .ics file somewhere on the web
2850 3. tell your webapp to fetch this .ics file on the web
2852 Here is the script I use for the first step:
2854 #+begin_src shell-script-mode
2855 #!/bin/bash
2857 /usr/local/bin/emacs --batch --eval \
2858 "(progn (load-file \"~/install/git/org-mode/org.el\") \
2859         (load-file \"~/elisp/config/org-batch-config.el\") \
2860         (setq org-combined-agenda-icalendar-file \"~/org/cal/org.ics\")
2861         (setq org-agenda-files (quote (\"~/org/bzg.org\"))))" \
2862     -f org-export-icalendar-combine-agenda-files
2863 #+end_src
2865 Depending on your configuration, you might change the load sequence.
2867 Here is the script I use for the second step:
2869 #+begin_src shell-script-mode
2870 #!/bin/bash
2871 /usr/bin/rsync -rtv ~/org/org.ics -e ssh me@my_server:/home/me/public_html/
2872 #+end_src
2874 Note: if you want to cron this rsync script, you will need to let
2875 =my_server= to know about your SSH public key.  Check [[http://troy.jdmz.net/rsync/index.html][this page]] as a
2876 starter.
2878 Now you can cron the two scripts above and your webapp will always be
2879 up to date with your Org agendas.
2881 Also see [[http://orgmode.org/org.html#Exporting-Agenda-Views][Exporting agenda views]] from Org manual.
2883 ** How can I get Mac OSX 10.3 iCal to import my Org-exported .ics files?
2884    :PROPERTIES:
2885    :CUSTOM_ID: iCal-import-ics-files-old
2886    :END:
2888    When using iCal under Apple MacOS X Tiger, you can create a new
2889    calendar /OrgMode/ (the default name for the calendar created by =C-c
2890    C-e c=, see the variables =org-icalendar-combined-name= and
2891    =org-combined-agenda-icalendar-file=).  Then set Org-mode to
2892    overwrite the corresponding file /~/Library/Calendars/OrgMode.ics/.
2893    You may even use AppleScript to make iCal re-read the calendar files
2894    each time a new version of /OrgMode.ics/ is produced.  Here is the
2895    setup needed for this:
2897    : (setq org-combined-agenda-icalendar-file
2898    :     "~/Library/Calendars/OrgMode.ics")
2899    : (add-hook 'org-after-save-iCalendar-file-hook
2900    :  (lambda ()
2901    :   (shell-command
2902    :    "osascript -e 'tell application \"iCal\" to reload calendars'")))
2904 ** How can I get Mac OSX 10.4 or later iCal to import my Org-exported .ics files?
2905    :PROPERTIES:
2906    :CUSTOM_ID: iCal-import-ics-files-new
2907    :END:
2909    For Mac OS X 10.4, you need to write the ics file to
2910    =/Library/WebServer/Documents/= and then subscribe iCalendar to
2911    =http: //localhost/orgmode.ics=
2913 ** How can I remove timestamps and todo keywords from my exported file?
2914    :PROPERTIES:
2915    :CUSTOM_ID: export-options-remove-timestamps
2916    :END:
2918 You can place an options line at the top of your org file:
2920 : #+OPTIONS: <:nil todo:nil
2922 There is a whole host of export options you can set with an in-buffer
2923 options or via global variables. See [[http://orgmode.org/manual/Export-options.html#Export-options][this section]] of the manual for a
2924 full list.
2926 ** How can I preserve faces when I export an agenda from the command line?
2927    :PROPERTIES:
2928    :CUSTOM_ID: preserving-faces-during-batch-export
2929    :END:
2931 Normally, when you export an org file or an agenda view from within
2932 emacs, htmlize will convert your face definitions to direct color css
2933 styles inlined into each =<span>= object, resulting in an HTML output
2934 that preserves the general look of your Org buffers and agenda views.
2936 Let's say you generate an export from the command line, such as the
2937 following:
2939 : emacs -batch -l ~/.emacs -eval '(org-batch-agenda "e")'
2943 : emacs -batch -l ~/.emacs -eval '(org-publish-all)'
2945 In such an instance, the exported HTML will contain only very basic
2946 color styles. The reason is that when Emacs is run in batch mode, it
2947 does not have a display and therefore only rudimentary face
2948 definitions.  If you'd like to use more complex styles, you'll have to
2949 make sure that the export process only assigns classes instead of
2950 direct color values.  This can be done by binding the variable
2951 =org-export-htmlize-output-style= to =css= for the duration of the
2952 export, for example with
2954 : emacs -batch -l ~/.emacs
2955 :   -eval '(let ((org-export-htmlize-generate-css (quote css)))
2956 :            (org-batch-agenda "e"))'
2958 Then you can use a style file to make these classes look any way you
2959 like.  To generate face definitions for a CSS file based on any faces
2960 you are currently using in Emacs, you can use the following command:
2962 : M-x org-export-htmlize-generate-css RET
2964 This will generate a =<style>...</style>= section, the content of
2965 which you can add to your style file.
2967 ** How can I avoid dark color background when exporting agenda to ps format?
2968    :PROPERTIES:
2969    :CUSTOM_ID: avoiding-dark-background-when-exporting-agenda
2970    :END:
2972 Add this to your .emacs and evaluate it.
2974 #+BEGIN_SRC emacs-lisp
2975   (setq org-agenda-exporter-settings
2976         '((ps-print-color-p 'black-white)))
2977 #+END_SRC
2979 ** How can I include e.g. an abstract in export to Latex and HTML?
2980    :PROPERTIES:
2981    :CUSTOM_ID: include-abstract-in-export-to-latex-and-html
2982    :END:
2984 Org does not currently have special markup for abstracts, but for
2985 export purposes, you can extend the block-level structural and
2986 semantic markup in Org with the contributed package [[file:org-contrib/org-special-blocks.org][org-special-blocks]]
2987 (by Chris Gray). To turn it on, put this in your =.emacs=:
2989 : (require 'org-special-blocks)
2991 Now, you can mark up the abstract of your article like this:
2993 : #+BEGIN_ABSTRACT
2994 : Falling apples were observed and compared with pears. Newton's laws
2995 : were confirmed at the 95% confidence level.
2996 : #+END_ABSTRACT 
2998 Exporting to Latex wraps this in a
2999 =\begin{abstract}....\end{abstract}= environment, which just works.
3001 HTML export wraps it in a ~<div class="abstract">...</div>~
3002 element. The HTML result won't look like anything special until you
3003 style it. Here is some sample CSS to get you started; put these in
3004 your document header:
3006 : #+STYLE: <style>.abstract {margin: 1em; padding: 1em; border: 1px solid black}
3007 : #+STYLE: .abstract:before {content: "Abstract: "; font-weight: bold}</style>
3009 Generally, =#+begin_foo= will work for any simple Latex =foo=
3010 environment not supported by existing Org markup.
3012 If you need to pass parameters, process the block content in some way,
3013 or support other exporters, you may want to consider whether you can
3014 customize it using Eric Schulte's [[file:org-contrib/org-exp-blocks.org][org-exp-blocks]] instead.
3016 ** How can I get colored source code when exporting to LaTeX?
3017    :PROPERTIES:
3018    :CUSTOM_ID: fontified_source_code_w_latex
3019    :END:
3021 As of Sun Aug 9 2009 the "current" version of Org-mode (see
3022 [[keeping-current-with-Org-mode-development]]) supports exporting
3023 source code to LaTeX using the listings package.
3025 To turn on listing export add the following to your Org-mode
3026 customization.
3027 #+begin_src emacs-lisp
3028   ;; requite org-latex so that the following variables are defined
3029   (require 'org-latex)
3031   ;; tell org to use listings
3032   (setq org-export-latex-listings t)
3034   ;; you must include the listings package
3035   (add-to-list 'org-export-latex-packages-alist '("" "listings"))
3037   ;; if you want colored source code then you need to include the color package
3038   (add-to-list 'org-export-latex-packages-alist '("" "color"))
3039 #+end_src
3041 The listings package will now be used to fontify source code in your
3042 LaTeX documents.  By default listings will not color any of your
3043 source code.  If you would like to set colors for keywords and
3044 comments in your latex documents you can do so using LaTeX directives
3045 like the following.
3046 #+begin_src latex
3047   \lstset{keywordstyle=\color{blue},
3048     commentstyle=\color{red},
3049     stringstyle=\color{green}
3050   }
3051 #+end_src
3053 of if you want to get even fancier with your colors you can try
3054 something like the following
3055 #+begin_src latex
3056 \definecolor{keywords}{RGB}{255,0,90}
3057 \definecolor{comments}{RGB}{60,179,113}
3058 \definecolor{fore}{RGB}{249,242,215}
3059 \definecolor{back}{RGB}{51,51,51}
3060 \lstset{
3061   basicstyle=\color{fore},
3062   keywordstyle=\color{keywords},
3063   commentstyle=\color{comments},
3064   backgroundcolor=\color{back}
3066 #+end_src
3068 For more complex listings use cases consult the [[ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/listings/listings.pdf][listings manual]].
3070 ** How can I export to Latex Beamer
3071    :PROPERTIES:
3072    :CUSTOM_ID: beamer
3073    :END:
3074 The latex [[http://latex-beamer.sourceforge.net/][Beamer Class]] is a useful class for generating slide shows.
3075 The following can be used to export Org-mode documents to LaTeX
3076 beamer.
3078 Add the following to your Emacs initialization file.
3079 #+begin_src emacs-lisp
3080   (unless (boundp 'org-export-latex-classes)
3081     (setq org-export-latex-classes nil))
3082   (add-to-list 'org-export-latex-classes
3083                '("beamer"
3084                  "\\documentclass[11pt]{beamer}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{hyperref}\n\\usepackage{verbatim}\n"
3085                  ("\\section{%s}" . "\\section*{%s}")
3086                  ("\\begin{frame}\\frametitle{%s}" "\\end{frame}"
3087                   "\\begin{frame}\\frametitle{%s}" "\\end{frame}")))
3088 #+end_src
3090 Then by placing
3091 : #+LaTeX_CLASS: beamer
3092 in the header of your Org-mode document it will automatically export
3093 to the Beamer document class on LaTeX export.  With the above
3094 configuration top-level headers will be mapped to sections in the
3095 Beamer document, second-level headers will be mapped to frames, and
3096 lower level headlines will be mapped to itemize objects.
3098 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
3099 Thomas Dye]].  For a much more complex Beamer setup see the [[http://article.gmane.org/gmane.emacs.orgmode/17767/match=beamer+dokos][email by
3100 Thomas Dye]].
3102 ** How can I use RefTeX in Org-mode files for LaTeX export and in Org-babel LaTeX code blocks?
3103    :PROPERTIES:
3104    :CUSTOM_ID: using-reftex-in-org-mode
3105    :END:
3107 [[http://www.gnu.org/software/auctex/reftex.html][RefTeX]] is an indispensable tool for the author of LaTeX documents.  It
3108 aids in creation of bibliographies, cross-references, indexes, and
3109 glossaries.  RefTeX understands the structure of multi-file LaTeX
3110 documents and is able to collect from them information about the
3111 location(s) of external data stores used in creation of the final
3112 document.  RefTeX was written by Carsten Dominik and is currently
3113 being maintained by the [[http://www.gnu.org/software/auctex/index.html][AucTeX]] project.
3115 *** Using RefTeX In Org-mode Files for LaTeX Export
3116 In Org-mode files for LaTeX export, the trick is to find a way to tell
3117 RefTeX the locations of external data stores.  One way is to set the
3118 variable, =reftex-default-bibliography=.  Add lines like these to
3119 .emacs:
3121 #+begin_src emacs-lisp
3122   (setq reftex-default-bibliography
3123         (quote
3124          ("default.bib" "other-default.bib")))
3125 #+end_src
3127 In practice, this is a limited solution and the
3128 typical user will want to pass this information on a per-file basis.
3129 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
3130 Braindump]].
3132 The first solution, proposed by Mario, enables the RefTeX citation
3133 function in Org-mode.  Add these lines to .emacs:
3135 #+begin_src emacs-lisp
3136   (defun org-mode-reftex-setup ()
3137     (load-library "reftex")
3138     (and (buffer-file-name)
3139          (file-exists-p (buffer-file-name))
3140          (reftex-parse-all))
3141     (define-key org-mode-map (kbd "C-c )") 'reftex-citation))
3142   (add-hook 'org-mode-hook 'org-mode-reftex-setup)
3143 #+end_src
3145 Then add the following lines anywhere in the Org-mode file (Org-mode
3146 will recognize them as LaTeX commands):
3148 #+begin_src org
3149 \bibliographystyle{plain}
3150 \bibliography{BIB-NAME}
3151 #+end_src
3153 With this setup, =C-c )= will invoke =reftex-citation= which will
3154 insert a reference in the usual way:
3156 #+begin_src org
3157   ,* test reftex
3159   ,This is a citation \cite{tierney90}.
3161   ,\bibliographystyle{plain}
3162   ,\bibliography{tsd}
3163 #+end_src
3165 This Org-mode file will export the following LaTeX output:
3167 #+begin_src latex :exports code
3168   % Created 2010-03-22 Mon 14:34
3169   \documentclass[11pt,letter]{article}
3170   \usepackage[utf8]{inputenc}
3171   \usepackage[T1]{fontenc}
3172   \usepackage{hyperref}
3174   \title{test.org}
3175   \author{Tom Dye}
3176   \date{2010-03-22 Mon}
3178   \begin{document}
3180   \maketitle
3182   \setcounter{tocdepth}{3}
3183   \tableofcontents
3184   \vspace*{1cm}
3186   \section{test reftex}
3187   \label{sec-1}
3190   This is a citation \cite{tierney90}.
3192   \bibliographystyle{plain}
3193   \bibliography{tsd}
3195   \end{document}
3196 #+end_src
3199 A second solution, to activate the RefTeX minor mode on a per-file
3200 basis, was posted by Kevin Brubeck Unhammer in response to this idea.
3201 Add the following lines to .emacs:
3203 #+begin_src emacs-lisp
3204   (add-hook ‘org-mode-hook
3205              (lambda ()
3206                (if (member “WRITE” org-todo-keywords-1)
3207                    (org-mode-article-modes))))
3208 #+end_src
3210 where =org-mode-article-modes= is defined as follows:
3212 #+begin_src emacs-lisp
3213   (defun org-mode-article-modes ()
3214     (reftex-mode t)
3215     (bib-cite-minor-mode t)
3216     (and (buffer-file-name)
3217          (file-exists-p (buffer-file-name))
3218          (reftex-parse-all)))
3219 #+end_src
3221 Add the =\bibliographystyle{}= and =\bibliography{}= lines to the
3222 Org-mode file as before and define a TODO keyword, =WRITE=, perhaps
3223 like this:
3225 #+begin_src org
3226   ,#+TODO: TODO(t) STARTED(s) WRITE | DONE(d) DEFERRED(f)
3227 #+end_src
3229 With this setup, you insert a citation with =M-x reftex-citation RET=.
3231 *** Using RefTeX in Org-babel LaTeX Code Blocks
3233 In Org-babel LaTeX code blocks, the trick is to give RefTeX access to
3234 information in other Org-babel LaTeX code blocks.  If you use an Emacs
3235 starter kit where configuration information is held in Org-mode files,
3236 then the second solution is preferable because you won't be asked for
3237 a master file when Emacs is started.  For this reason, the second
3238 solution is modified for use with Org-babel latex code blocks.  No
3239 key-binding is needed here because Org-babel code blocks are edited
3240 within the usual AucTeX environment.
3242 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]])
3243 #+begin_src emacs-lisp
3244   (defun org-mode-article-modes ()
3245     (reftex-mode t)
3246     (and (buffer-file-name)
3247          (file-exists-p (buffer-file-name))
3248          (reftex-parse-all)))
3250   (add-hook 'org-mode-hook
3251             (lambda ()
3252               (if (member "REFTEX" org-todo-keywords-1)
3253                   (org-mode-article-modes))))
3254 #+end_src
3256 Then add a line like the following line to the top of your org-mode file:
3258 #+begin_src org
3259   ,#+TODO: TODO(t) STARTED(s) | DONE(d) DEFERRED(f) REFTEX
3260 #+end_src
3262 When you open an org-mode file with a line like this, RefTeX will
3263 prompt for the master .tex file, which will be parsed in the usual
3264 way.  This means that the .tex file should already exist, perhaps by
3265 tangling the LaTeX preamble and postamble, before
3266 =org-mode-article-modes= is activated for the Org-mode file.
3268 ** Why is my exported PDF file almost unreadable?
3269    :PROPERTIES:
3270    :CUSTOM_ID: unreadable-pdfs
3271    :END:
3273 Some PDF viewers (earlier versions (< v6) of Acrobat Reader, Evince,
3274 possibly others) do not get along with Adobe Type3 fonts, producing
3275 almost unreadable screen output (printed output is OK). If you see
3276 this, first verify the fonts that your document uses: open it with
3277 Acrobat Reader or Evince, select "Properties" from the "File" menu and
3278 click on the "Fonts" tab; alternatively, you can use the pdffonts
3279 program (part of the xpdf-reader package) from the command line.  If
3280 that is indeed the problem, then either use a different viewer or
3281 install Type1 versions of the problematic fonts. For more details, see
3282 the "PDF export" section of [[./org-dependencies.org][org-dependencies]].
3284 ** Can I add attributes to a link or an image in HTML export?
3285    :PROPERTIES:
3286    :CUSTOM_ID: html-image-and-link-attributes
3287    :END:
3289 Yes.  Excerpt from [[http://orgmode.org/manual/Images-in-HTML-export.html#Images-in-HTML-export][Org's manual]]:
3291 If you need to add attributes to an inlined image, use a `#+ATTR_HTML'.
3292 In the example below we specify the `alt' and `title' attributes to
3293 support text viewers and accessibility, and align it to the right.
3295 :  #+CAPTION: A black cat stalking a spider
3296 :  #+ATTR_HTML: alt="cat/spider image" title="Action!" align="right"
3297 :  [[./img/a.jpg]]
3299 and you could use `http' addresses just as well.
3301 ** How can I export an org file to rtf, odt (Open Office), or doc (Word)?
3302    :PROPERTIES:
3303    :CUSTOM_ID: convert-to-open-office
3304    :END:
3306 While you cannot export directly from org to doc or odt, you can
3307 export to one of org-mode's supported export formats and then use an
3308 external tool or method to convert the exported file to doc or odt.
3309 While most of these methods work with simple documents, they may work
3310 more or less well when the document contains complex elements, such as
3311 footnotes, embedded images, math formulas, and so on. (Note, the lists
3312 below are by no means comprehensive).
3314 1. html -> odt/doc/rtf
3315    - open html in Open Office and save as odt/doc ([[http://permalink.gmane.org/gmane.emacs.orgmode/31482][see this post by
3316      Eric Fraga]])
3317    - [[http://www.artofsolving.com/opensource/pyodconverter][PyODConverter]]
3318    - [[http://johnmacfarlane.net/pandoc/][Pandoc]] (this works for LaTeX and docbook as well)
3319    - (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
3320      from html to doc
3322 2. LaTeX -> odt/doc/rtf
3323    - [[http://latex2rtf.sourceforge.net/][LaTeX2rtf]] (works well with index, footnotes, and references)
3324    - [[http://www.tug.org/tex4ht/][TeX4ht]] (works with more complex latex elements, though can be
3325      difficult to install)
3326      - run =mk4ht oolatex file.tex=
3328 See [[http://permalink.gmane.org/gmane.emacs.orgmode/31168][this thread]] for further details.
3330 * MobileOrg
3332 ** Which versions of MobileOrg do exist
3333    :PROPERTIES:
3334    :CUSTOM_ID: mobileorg_versions
3335    :END:
3337 - MobileOrg for the iPhone/iPod Touch/iPad series of devices, by
3338   Richard Moreland.  Check out
3339   [[http://mobileorg.ncogni.to/][Richard's page]]
3340 - Matt Jones is developing a feature-equivalent application for
3341   Android, see
3342   [[http://wiki.github.com/matburt/mobileorg-android/][his project page]].
3344 ** What can I do if I don't want to use Dropbox.com
3345    :PROPERTIES:
3346    :CUSTOM_ID: mobileorg_webdav
3347    :END:
3349 Dropbox.com is the easiest way to connect between Emacs and MobileOrg,
3350 you can get a free account there.  If for some reason you cannot or do
3351 not want to use this path, you can use any webdav server.  On this
3352 webdav server you need to create a dedicated directory for the
3353 communication between Emacs and MobileOrg.  If you can mount that
3354 directory locally so that Emacs can directly write to it, just point
3355 to that directory using the variable =org-mobile-directory=.  Using
3356 the /tramp/ method, =org-mobile-directory= may point to a remote
3357 directory accessible through, for example, /ssh/ and /scp/:
3359 #+begin_src emacs-lisp
3360 (setq org-mobile-directory "/scpc:user@@remote.host:org/webdav/")
3361 #+end_src
3363 If Emacs cannot access the WebDAV directory directly using a /tramp/
3364 method, you can use a local directory for staging.  Other means must
3365 then be used to keep this directory in sync with the WebDAV directory.
3366 In the following example, files are staged in =~/stage/=, and Org-mode
3367 hooks take care of moving files to and from the WebDAV directory using
3368 /scp/.
3370 #+begin_src emacs-lisp
3371 (setq org-mobile-directory "~/stage/")
3372 (add-hook 'org-mobile-post-push-hook
3373   (lambda () (shell-command "scp -r ~/stage/* user@@wdhost:mobile/")))
3374 (add-hook 'org-mobile-pre-pull-hook
3375   (lambda () (shell-command "scp user@@wdhost:mobile/mobileorg.org ~/stage/ ")))
3376 (add-hook 'org-mobile-post-pull-hook
3377   (lambda () (shell-command "scp ~/stage/mobileorg.org user@@wdhost:mobile/")))
3378 #+end_src
3380 * Mathjax
3382 ** How to install MathJax on my server?
3383    
3384 :PROPERTIES:
3385 :CUSTOM_ID: install_mathjax_on_server
3386 :END:
3388 Org uses MathJax as its default HTML display engine for equations.
3390 Org relies on the version of MathJax available from orgmode.org, but you
3391 might want to use another version and install MathJax on your own server.
3393 1. Download a [[http://sourceforge.net/projects/mathjax/files/][MathJax archive]].
3395 2. Upload it somewhere on your server (say http://me.org/mathjax/)
3397 3. Set the correct path in =org-export-html-mathjax-options= (i.e. replace
3398    http://orgmode.org/mathjax/MathJax.js by
3399    http://me.org/mathjax/MathJax.js)
3401 You can also get [[http://www.mathjax.org/resources/docs/?installation.html][MathJax from git or svn]] -- in this case, be careful not to
3402 forget to unzip the fonts.zip archive in the mathjax directory.