org-hacks: add section about Static MathJax
[Worg.git] / org-faq.org
blobb7e896019dcf7af69bc2a10b835ae9bf8ae15d6d
1 #+STARTUP:   overview
2 #+OPTIONS:   H:2 num:t toc:t \n:nil @:t ::t |:t ^:t *:t TeX:t
3 #+EMAIL:     carsten.dominik@gmail.com
4 #+AUTHOR:    Worg people
5 #+LANGUAGE:  en
6 #+TITLE:     Org-mode Frequently Asked Questions
7 #+INFOJS_OPT: view:content toc:1 path:http://orgmode.org/worg/code/org-info-js/org-info.js tdepth:1 ftoc:t buttons:0 mouse:underline
8 #+OPTIONS:   H:3 num:nil toc:t \n:nil @:t ::t |:t ^:{} -:t f:t *:t TeX:t LaTeX:t skip:nil d:(HIDE) tags:not-in-toc
10 #+begin_html
11 <a href="/"><img src="http://orgmode.org/img/org-mode-unicorn.png" class="logo-link" /></a>
12 #+end_html
14 [[file:index.org][{Back to Worg's index}]]
16 * Welcome
17   :PROPERTIES:
18   :CUSTOM_ID: Welcome
19   :END:
21 Welcome to the Org-mode FAQ.
23 You can navigate the FAQ by clicking on any of the topics in the Table
24 of Contents.
26 If your browser supports JavaScript, you can...
28 - move through the topics by typing "=n=" (next) and "=p=" (previous).
30 - see an outline view of the FAQ by typing "=m=" or clicking "=toggle
31   view=" (above).
33 - search the FAQ by typing "=s=" (basic search) or "=o=" (occur tree).
35 - see a full list of navigation commands by typing "=?=" or clicking
36   "=Help=" (above).
38 * What is org-mode?
39   :PROPERTIES:
40   :CUSTOM_ID: What-is-org-mode
41   :END:
42 ** Can I implement a GTD workflow with Org-mode?
43    :PROPERTIES:
44    :CUSTOM_ID: GTD-workflow-with-Org-mode
45    :END:
47    Yes, you can.  Check for discussions and pointers [[http://orgmode.org/worg/org-gtd-etc.php][here]].
49 ** What is the difference between Org and TaskPaper?
50    :PROPERTIES:
51    :CUSTOM_ID: Org-and-TaskPaper
52    :END:
54   There is really no difference.  Org is as /simple/ as [[http://hogbaysoftware.com/products/taskpaper][TaskPaper]].  It
55   is just that, when using Org within Emacs, it lets you do many things
56   that you wouldn't be able to do with TaskPaper.  Yes, TaskPaper is
57   fiddle-proof and people using Emacs tends to like fiddling (which is
58   orthogonal to the idea of using todo-list efficiently), but this is
59   just a matter of discipline and common sense, not one of Org's design.
61   Read [[http://article.gmane.org/gmane.emacs.orgmode/6224][Carsten's enlightening statement]] on this.
62 ** What is the meaning of the Unicorn on Org's website?
63    :PROPERTIES:
64    :CUSTOM_ID: unicorn
65    :END:
67 The Unicorn is the logo of Org-mode because:
69 - Org-mode is the UNICs of ORgaNizers.
71 - Org-mode is an Emacs mode, so it makes sense to use an animal
72   similar or related to the gnu used for GNU Emacs.
74 - Org-mode is meant to show you the way, and an animal with two horns
75   can not do this very well, can it?
77 - Unicorn tears are said to reverse petrification, and wasn't this how
78   we all felt before getting to some degree of time and task
79   management?
81 - It will take forever to learn everything there is to know about a
82   unicorn.
84 - A unicorn is a fabulous creature.  Org-mode wants to be a fabulous
85   creation.
87 Using a unicorn was originally /Bastien Guerry's/ idea, his friend
88 /Christophe Bataillon/ designed the logo for us, and /Greg Newman/
89 gave it a refresh some time later.  Bastien writes why he chose a
90 unicorn:
92 #+BEGIN_QUOTE
93 The first reason is not linked to the animal, but to the sounding of the
94 word "Unicorn" - because Org gives you a /uni/que way of producing files
95 in several format (HTML, LaTeX, etc.)
97 The second reason is that a Unicorn doesn't really exist, it is just
98 something you can dream about, and make others believe it does exist.
99 Just like the perfect organizer.
100 #+END_QUOTE
102 There was a [[http://thread.gmane.org/gmane.emacs.orgmode/11641/focus%3D11641][thread about unicorns]] on the mailing list.  [[http://thread.gmane.org/gmane.emacs.orgmode/11641/focus%3D11641][Christopher
103 Suckling]] posted a link showing how to make a simple foldable unicorn
104 (very appropriate for an outlining program!).
106 [[http://article.gmane.org/gmane.emacs.orgmode/11735][Tim Burt]] made a very complicated one which is now a treasured
107 possession of the Org-mode author.
109 - Official logo: [[http://orgmode.org/img/org-mode-unicorn.png]]
110   This logo is available in a number of different formats including
111   Photoshop /.psd/ and scaleable vector graphics /.svg/ [[http://orgmode.org/img/][here]].
113 - An [[http://orgmode.org/img/nrocinu4.jpg][alternative version]] from Christophe Bataillon (c):
115 - [[http://article.gmane.org/gmane.emacs.orgmode/14293][Chris Randle]] made a [[http://orgmode.org/img/nrocinu.txt][text version]] using the logo and [[http://glassgiant.com][glassgiant.com]]:
117 - [[http://article.gmane.org/gmane.emacs.orgmode/14362][Stefan Vollmar]] made a [[http://orgmode.org/img/nrocinu.pdf][pdf version]] (here in [[http://orgmode.org/img/nrocinu_pdf.png][png]]) using "a simple
118   threshold technique".
120 - [[http://article.gmane.org/gmane.emacs.orgmode/11735/match%3D][Tim Burt]] made a folded Unicorn to match the spirit of Org - see the
121   whole set of pictures [[http://www.flickr.com/photos/tcburt/sets/72157614543357071/][on his flickr page]].
123 - Are unicorns real?  Answer [[http://article.gmane.org/gmane.emacs.orgmode/11687/match%3Drosslaird%2Bunicorn][here]] by Ross Laird.
125 * Mailing list
126 ** Why hasn't my email to the mailing list shown up yet?
127    :PROPERTIES:
128    :CUSTOM_ID: ml-post-delay
129    :END:
131 The org-mode mailing list is moderated. Thus, if you are not
132 subscribed to the mailing list, your mail will only appear on the list
133 after it has been approved by a moderator. To ensure that your mail
134 appears quickly, please [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe to the list]].
136 ** I read the mailing list through gmane. Should I subscribe?
137    :PROPERTIES:
138    :CUSTOM_ID: ml-subscription-and-gmane
139    :END:
141 The org-mode mailing list is available via nntp at [[http://dir.gmane.org/gmane.emacs.orgmode][Gmane]]. Many
142 participants in the list prefer read the list in a newsreader, such as
143 Gnus, instead of receiving emails. If you choose to read the list via
144 nntp, you can still [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe]] to the list and then opt not to receive
145 any emails on the mailman settings page (see the "Mail Delivery"
146 setting).
148 This will ensure that your messages to the list get through quickly,
149 reduce the work load of the mailing list moderators (who need to clear
150 every mail from non-members), and provide more accurate information
151 about the number of list readers.
153 * Keeping current
154   :PROPERTIES:
155   :CUSTOM_ID: Keeping-current
156   :END:
157 ** How do I keep current with Org mode development?
158    :PROPERTIES:
159    :CUSTOM_ID: keeping-current-with-Org-mode-development
160    :END:
162    Org mode is developed in [[http://en.wikipedia.org/wiki/Git_(software)][Git]].  You can keep up-to-date with Org
163    mode developement by cloning Org mode repository and refreshing
164    your copy with latest changes whenever you wish.  You only need to
165    use two Git commands (clone and pull.)  Here are the steps in
166    brief (please customize locations to suit your setup):
168    1. Select a location to house the Org mode repository (approx. 40
169       MB; includes documentation, compiled elisp files and history
170       going all the way back to v4.12a)
172       : $ mkdir $HOME/elisp && cd $HOME/elisp
174    2. Clone the Org mode Git repository.
176       Recommended approach:
178       : $ git clone git://repo.or.cz/org-mode.git
180       Alternate approach if you are behind a firewall that allows only
181       HTTP (can be quite slow):
183       : $ git clone http://repo.or.cz/r/org-mode.git
185    3. Compile and install Org mode and build documentation.
187       : $ cd org-mode && make && make doc && make install
189       Please note that you can choose to /not/ compile at all and run
190       using source =.el= files only.  Compiled files speed things up.
192    4. This is where you configure Org mode with Emacs.  Please refer
193       to [[./org-tutorials/index.org][Org tutorials]].
195    5. Keeping up-to-date.
197       Cloning the repository is a one time activity.  From this point
198       onwards you only need to /pull/ the latest changes.
200       : $ cd $HOME/elisp/org-mode
202       and then
204       : $ git pull && make clean && make && make doc && make install
206    6. You should restart org mode to have the changes take effect (if
207       you are not rebooting Emacs.)  Also since the intention is to
208       "keep up" with Org mode, you should visit updated sections of
209       documentation for latest updates (use =git log=.)
211    7. As you use your repository over time it will accumulate loose objects.
212       You can reduce the total size of your git repository with
214       : $ git gc
216       which will consolidate loose git objects into pack files.  This
217       reduces the size of the repository and speeds up data access to
218       the objects.
220 ** How can I keep local changes and still track Org mode development?
221    :PROPERTIES:
222    :CUSTOM_ID: keeping-local-changes-current-with-Org-mode-development
223    :END:
225   Say you want to make minor changes to the Makefile to reflect your
226   location for =emacs=.
228   Create a local branch for your changes on top of origin/master as
229   follows:
231   : $ git checkout -b local origin/master
232   : $ git config branch.local.rebase true
233   : # Make your changes to the Makefile and create a new commit
234   : $ git add Makefile
235   : $ git commit -m 'My local Makefile configurations'
236   : # Update git to a newer version
237   : $ git pull
239   Now each time you pull new commits from the distribution repository
240   your local commits will be rewound and replayed on top of the new
241   origin/master.
243 -----------
245   You would normally work on your =local= branch which includes your
246   custom commits; there's no need to switch back to the =master=
247   branch.
249 -----------
251 Here is an example of dealing with conflict resolution during git pull.
253 If you get a conflict during a =git pull= you will need to edit the
254 file with the conflict to fix up the conflicting lines and then tell
255 git that you have resolved the conflict.
257 Conflict resolution goes something like this:
259 1. =git pull= fails with a conflict
260 2. edit the file
261 3. =git add= the file to mark the conflict resolved
262 4. =git rebase --continue=
263 5. lather, rinse, and repeat 2-4 as needed
265 For this example we have the following Makefile:
267 : #
268 : # Example Makefile
269 : #
271 : EMACS=emacs
273 : VERSION=V1.0
275 and we need to change the =EMACS=emacs= line to =EMACS=myemacs= to
276 make it work well on our system.
278 To do this we
280   - create a local branch for our work
282     : $ git checkout -b local origin/master
283     : $ git config branch.local.rebase true
285     This marks the branch so that all local commits on it are rebased
286     on top of any new commits we get in origin/master during a =git
287     pull= operation.
289   - Make our custom changes
291     Edit the makefile so it looks like this:
293     : #
294     : # Example Makefile
295     : #
296     :
297     : EMACS=myemacs
298     :
299     : VERSION=V1.0
301   - Create a commit with our custom changes
302     : $ git add Makefile
303     : $ git commit -m 'My local Makefile configurations'
305   - Later we do a =git pull= but that fails with conflicts.
307     : $ git pull
308     : remote: Counting objects: 5, done.
309     : ...
310     : Patch failed at 0001.
311     :
312     : When you have resolved this problem run "git rebase --continue".
313     : If you would prefer to skip this patch, instead run "git rebase --skip".
314     : To restore the original branch and stop rebasing run "git rebase --abort".
316   - Fix the conflict in your favourite editor
318     Conflict markers look like this:
320     : <<<<<<< HEAD:Makefile
321     : EMACS=emacs22
322     : =======
323     : EMACS=myemacs
324     : >>>>>>> Change emacs location:Makefile
326     This attempted =git pull= caused a conflict.  Fire up your
327     favourite editor and fix the conflict in the Makefile.  The
328     conflict markers are <<<<<<<<<< , ======= , and >>>>>>>>>>.  Fix
329     the Makefile appropriately and delete the conflict markers.  You
330     already edited these lines earlier so fixing it should be trivial.
332     In this case we changed =EMACS=emacs= to =EMACS=myemacs= and
333     upstream changed =EMACS=emacs= to =EMACS=emacs22=.  Just fix the
334     file and save it by deleting the conflict markers and keeping the
335     code you need (in this case the =EMACS=myemacs= line which we
336     originally modified.)
338   - Mark the file's conflict resolved
340     : $ git add Makefile
342     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.
344   - Continue the rebase operation
346     : $ git rebase --continue
348     If any other conflicts arise you fix them the same way - edit the file, mark the conflict resolved, and continue.
350 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"
351 using
352 : $ git rebase --abort
355 ** How can I use a stable release version instead of the bleeding edge master?
356    :PROPERTIES:
357    :CUSTOM_ID: using-stable-releases-only
358    :END:
360 The master branch of the git repository always contains the bleeding
361 edge development code.  This is important for Org's fast development,
362 because code on master gets checked out by many people daily and we
363 quickly receive bug reports if something is wrong.  On rare occasions,
364 this code may not function perfectly for a limited time while we are
365 trying to fix things.
367 Not everyone like to use this bleeding-edge code and face the danger
368 to hit a surprising bug.
370 Therefore, from time to time, we make a release.  This typically
371 happens when the maintainers feel that 
373 1. they have reached a good point in the development
374 2. the code has a feature set that should stay and be supported in the
375    future
377 Stable releases are used as the basis for [[http://orgmode.org/index.html#sec-3_3][alternative distributions]] of
378 Org, and they are also the code that gets merged into the Emacs
379 distribution.  If you want to work only with stable releases, you can
380 still use the git repository to do so.
382 *** Run a specific stable release
384 In the repository, do
386 : $ git fetch --tags
387 : $ git tag
389 To see which release tags are available.  Let's say you decide to use
390 =release_7.01f=.
392 : $ git checkout release_7.01f
394 This set the working tree of the repository to the state of Org at the
395 moment of release 7.01f.  You can then run Org from the repository be
396 sure to use the stable release while development continues on the
397 master branch.
399 Later, when we release 7.02, you can switch to that using
401 : $ git fetch --tags                   # to get all the new stuff
402 : $ git tag
403 : $ git checkout release_7.02
405 *** Always run the most recent stable release
407 Alternatively, if you just want to always run whatever the latest
408 stable release is, you can do
410 : $ git checkout -b stable origin/maint
412 and then regularly update this branch by doing
414 : $ git pull
416 ** How can I install an up-to-date version of org-mode without "make" tools?
417    :PROPERTIES:
418    :CUSTOM_ID: installing-org-without-make-tools
419    :END:
421 If you are using org-mode on a computer that lacks developer tools for
422 compiling software, such as [[http://www.gnu.org/software/make/][GNU Make]], you will have to use a
423 *different* installation method than [[http://orgmode.org/manual/Installation.html#Installation][the one outlined in the manual]].
425 Please see [[http://article.gmane.org/gmane.emacs.orgmode/15264][this thread]] on the mailing list for several different ways
426 you can install a recent version of org-mode without using the
427 customary =make clean && make && make install=.
429 The result of that discussion is the file/function found in
430 [[http://orgmode.org/worg/org-hacks.php#compiling-org-without-make]].
432 ** How do I download fresh .zip and .tar.gz archives of Org?
434    You can download [[http://orgmode.org][org-latest.zip]] or [[http://orgmode.org/org-latest.tar.gz][org-latest.tar.gz]] -- these
435    archives are udpated every hour.
437 * Setup
438   :PROPERTIES:
439   :CUSTOM_ID: Setup
440   :END:
441 ** How can I quickly browse all Org options?
443 =M-x org-customize RET=
445 See also [[file:org-tutorials/org-customize.org][Carsten's Org customize tutorial]] and [[file:org-configs/org-customization-guide.org][this customization guide]]
446 for details.
448 ** Can I use the editing features of org-mode in other modes?
449    :PROPERTIES:
450    :CUSTOM_ID: use-editing-features-in-other-modes
451    :END:
453    Not really---but there are a few editing features you can use in
454    other modes.
456    - For tables there is =orgtbl-mode= which implements the table
457      editor as a minor mode. (To enable, type =M-x orgtbl-mode=)
458    - For ordered lists there is =orgstuct-mode= which allows for easy
459      list editing as a minor mode. (To enable, type =M-x
460      orgstruct-mode=)
462    You can activate these modes automatically by using hooks:
464    : (add-hook 'mail-mode-hook 'turn-on-orgtbl)
465    : (add-hook 'mail-mode-hook 'turn-on-orgstruct)
467    For footnotes, there is the function =org-footnote-action=, which
468    works in non-org buffers. This function is a powerful tool for
469    creating and sorting footnotes. To use it globally, you can add the
470    following keybinding to your =.emacs= file (requires Org 6.17 or
471    greater):
473    : (global-set-key (kbd "C-c f") 'org-footnote-action)
475    For other features you need to switch to Org-mode temporarily, or
476    prepare text in a different buffer.
478 ** Why isn't feature "X" working the way it is described in the manual?
479    :PROPERTIES:
480    :CUSTOM_ID: making-sure-org-mode-is-up-to-date
481    :END:
483 Org-mode develops very quickly. If you are using a version of org-mode
484 that shipped with emacs, there is a good chance that it is somewhat
485 out of date.
487 Many of the users on the org-mode mailing list are using either a
488 recent release of org-mode or the
489 [[http://orgmode.org/index.html#sec-3.2][development version of
490 org-mode from the git repository]].
492 If some settings and features aren't working the way you expect, make
493 sure that the version of the manual you are consulting matches the
494 version of org-mode you are using.
496    - You can check which version of org-mode you are using by
497      selection =Org --> Documentation --> Show Version= in the Emacs
498      menu.
500    - The [[http://orgmode.org/manual/index.html][online manual]] at [[http://orgmode.org][orgmode.org]] corresponds to the most recent
501      release.
503    - 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
504      released with the latest official Gnu Emacs release. Compared
505      with the manual at the orgmode.org, the manual at www.gnu.org is
506      somewhat out of date.
508 For instructions on how to stay current with org-mode, consult
509 [[keeping-current-with-Org-mode-development][this FAQ]] or follow the
510 instructions on [[http://orgmode.org][the official org-mode site]].
512 ** Can I get the visibility-cycling features in outline-mode and outline-minor-mode?
513    :PROPERTIES:
514    :CUSTOM_ID: use-visibility-cycling-in-outline-mode
515    :END:
517    Yes, these functions are written in a way that they are independent of
518    the outline setup.  The following setup provides standard Org-mode
519    functionality in outline-mode on =TAB= and =S-TAB=.  For
520    outline-minor-mode, we use =C-TAB= instead of =TAB=,
521    because =TAB= usually has mode-specific tasks.
523 #+BEGIN_SRC emacs-lisp
524 (add-hook 'outline-minor-mode-hook
525   (lambda ()
526     (define-key outline-minor-mode-map [(control tab)] 'org-cycle)
527     (define-key outline-minor-mode-map [(shift tab)] 'org-global-cycle)))
528 (add-hook 'outline-mode-hook
529   (lambda ()
530     (define-key outline-mode-map [(tab)] 'org-cycle)
531     (define-key outline-mode-map [(shift tab)] 'org-global-cycle)))
532 #+END_SRC
534 Or check out /outline-magic.el/, which does this and also provides
535 promotion and demotion functionality.  /outline-magic.el/ is
536 available at [[http://www.astro.uva.nl/~dominik/Tools/outline-magic.el][Outline Magic]].
538 ** Can I save/restore the visibility state of an org-mode buffer?
540 Well, no.
542 ** How can I keep track of changes in my Org files?
543    :PROPERTIES:
544    :CUSTOM_ID: track-of-changes-in-Org-files
545    :END:
547   Use git to track the history of the files, use a cronjob to check in
548   changes regularly.  Such a setup is described by Bernt Hansen
549   in [[http://article.gmane.org/gmane.emacs.orgmode/6233][this message]] on [[http://dir.gmane.org/gmane.emacs.orgmode][emacs-orgmode]].
551 ** Can I use Org-mode as the default mode for all README files?
552    :PROPERTIES:
553    :CUSTOM_ID: Org-mode-as-default-mode
554    :END:
556 Add the following to your .emacs file:
558 : (add-to-list 'auto-mode-alist '("README$" . org-mode))
560 You can even make it the default mode for any files with unspecified
561 mode using
563 : (setq default-major-mode 'org-mode)
565 ** Can I use ido.el for completing stuff in Org?
566    :PROPERTIES:
567    :CUSTOM_ID: ido-complete
568    :END:
570    Yes, you can.  If you are an ido user and ido-mode is active, the
571    following setting will make Org use =ido-completing-read= for most
572    of its completing prompts.
574 : (setq org-completion-use-ido t)
576 ** Should I use one big org file or multiple files?
577    :PROPERTIES:
578    :CUSTOM_ID: how-to-organize-org-mode-files
579    :END:
581 Org-mode is flexible enough to accomodate a variety of organizational
582 and time management schemes. Org's
583 [[http://orgmode.org/manual/Document-Structure.html#Document-Structure][outline
584 cycling and convenient editing and navigation commands]] make it
585 possible to maintain all of your projects and notes in a single file.
586 But org-mode's [[http://orgmode.org/manual/Hyperlinks.html#Hyperlinks][quick and easy hyperlinks]], along with [[http://orgmode.org/manual/Refiling-notes.html#Refiling-notes][easy refiling of
587 notes and todos]], also make it a delight to maintain a private "wiki"
588 consisting of multiple files.
590 No matter how you organize your org files, org-mode's agenda commands
591 make it easy to search all your notes and gather together crucial data
592 in a single view.
594 Moreover, several org-mode settings can be configured either globally
595 in your =.emacs= file or locally (per file or per outline tree). See
596 the [[http://orgmode.org/manual/index.html#Top][manual]] for more details. For an example of local customizations
597 see [[limit-agenda-with-category-match][this FAQ]].
599 Here are a few ideas for organizing org-mode files:
601 - A single file for all your projects and notes.
602 - One file per project.
603 - One file per client.
604 - One file per area of responsibility or type of work (e.g.,
605   household, health, work, etc.).
606 - One file for projects, one for appointments, one for reference
607   material, one for someday/maybe items, etc.
608 - A wiki of hyperlinked files that grows and adapts to meet your
609   needs.
611 For more ideas, see some of the links on the [[file:org-tutorials/index.org][org-tutorial index]] or
612 [[file:org-gtd-etc.org][this page on org-mode and GTD]].
614 ** Why doesn't C-c a call the agenda? Why don't some org keybindings work?
615    :PROPERTIES:
616    :CUSTOM_ID: setting-global-keybindings
617    :END:
619 Org-mode has a few global keybindings that the user must set
620 explicitly in an =.emacs= file. These keybindings include the
621 customary shortcut for calling the agenda (=C-c a=). If nothing
622 happens when you type =C-c a=, then make sure that the following lines
623 are in your =.emacs= file:
625 #+BEGIN_SRC emacs-lisp
626 ;; The following lines are always needed.  Choose your own keys.
627 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
628 (global-set-key "\C-cl" 'org-store-link)
629 (global-set-key "\C-ca" 'org-agenda)
630 (global-set-key "\C-cb" 'org-iswitchb)
631 #+END_SRC emacs-lisp
633 You may, of course, choose whatever keybindings work best for you
634 and do not conflict with other modes.
636 Please see [[http://orgmode.org/manual/Activation.html][this section of the manual]] if you have additional
637 questions.
639 ** Why aren't some of the variables I've customized having an effect?
640    :PROPERTIES:
641    :CUSTOM_ID: load-org-after-setting-variables
642    :END:
644 Some org variables have to be set before org.el is loaded or else they
645 will not work. (An example is the new variable
646 =org-enforce-todo-dependencies=.)
648 To make sure all your variables work you should not use =(require
649 'org)=. Instead use the following setting:
651 : (require 'org-install)
653 You should also make sure that you do not require any other =org-...=
654 files in your =.emacs= file before you have set your org variables,
655 since these will also cause org.el to be loaded. To be safe, load org
656 files *after* you have set your variables.
658 ** How can I make sure that timestamps appear in English?
659    :PROPERTIES:
660    :CUSTOM_ID: timestamps-and-system-time-locale
661    :END:
663 If your system's locale is not set to English, but you would like the
664 timestamps in your org-mode files to appear in English, you can set
665 the following variable:
667 #+begin_src emacs-lisp
668   (setq system-time-locale "C")
669 #+end_src
671 ** What does a minimal .emacs look like?
672 Using a stripped down minimal .emacs files removes broken custom
673 settings as the cause of an issue and makes it easy to reproduce for
674 other people.  The example below has system-specific paths that you'll
675 need to change for your own use.
676 #+begin_src emacs-lisp
677   (add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
678   (add-to-list 'auto-mode-alist '("\\.\\(org\\  |org_archive\\|txt\\)$" . org-mode))
679   (setq org-agenda-files '("/tmp/test.org"))
680   (require 'org-install)
681   (require 'org-habit)
682   
683   (global-set-key "\C-cl" 'org-store-link)
684   (global-set-key "\C-ca" 'org-agenda)
685   (global-set-key "\C-cb" 'org-iswitchb)
686 #+end_src
688 You can save the minimal .emacs file to ~/minimal.emacs, add suspect
689 configuration code to it, then start emacs something like this:
690 #+begin_src sh
691   emacs -Q -l ~/minimal.emacs
692 #+end_src
694 On OS X, starting emacs with minimal configuration might look
695 something like this:
696 #+begin_src sh 
697   /Applications/emacs.app/Contents/MacOS/Emacs -Q -l ~/minimal.emacs
698 #+end_src sh
699 * Errors and general problems
700   :PROPERTIES:
701   :CUSTOM_ID: Errors
702   :END:
703 ** Opening Org files in Emacs leads to a crash
704    :PROPERTIES:
705    :CUSTOM_ID: Emacs-crashes-with-org-indent-mode
706    :END:
707    The only known case where Org-mode can crash Emacs is when you are
708    using =org-indent-mode= with Emacs 23.1 (in fact, any version of
709    Emacs before version 23.1.50.3).  Upgrade to Emacs 23.2 and the
710    problem should go away.
712 ** When I try to use Org-mode, I always get the error message =(wrong-type-argument keymapp nil)=
713    :PROPERTIES:
714    :CUSTOM_ID: wrong-type-argument-keymapp
715    :END:
717    This is a conflict with an outdated version of the /allout.el/, see
718    the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section in the manual
720 ** How can I control the application launched by Org-mode to open a certain file type like pdf, html.... 
721    :PROPERTIES:
722    :CUSTOM_ID: external-application-launched-to-open-file-link
723    :END:
725 If you want special control about how Org-mode opens files, see the
726 variables =org-file-apps=, =org-file-apps-defaults-gnu=,
727 =org-file-apps-defaults-macosx=, =org-file-apps-defaults-windowsnt=.
729 *However*, normally it is best to just use the mechanism the
730 operating-system provides:
732 *** GNU/Linux systems
733     You you have to check your mailcap settings, find the files:
735     : /etc/mailcap
736     : 
737     : or  
738     : 
739     : $HOME/.mailcap
741 and modify them accordingly. Please read their manual entry.
743 *** Windows systems 
744     + for html pages you may configure the =browse-url-= variables through
745       the Customize interface,
746     + the pdf files are automatically opened with Acrobat Reader (if it is
747       installed)
749 *** Mac OSX
750     Change the application responsible for this file type by selecting
751     such a file in the Finder, select =File->Get Info= from the menu
752     and select the application to open this file with.  Then, to
753     propagate the change to all files with the same extension, select
754     the =Change all= button.
756 ** Org-mode takes over the TAB key.  I also want to use YASnippet, is there a way to fix this conflict?
757    :PROPERTIES:
758    :CUSTOM_ID: YASnippet
759    :END:
761 [[http://code.google.com/p/yasnippet/][yasnippet]] is yet another snippet expansion system for Emacs.  It is
762 inspired by TextMate's templating syntax.
763 - watch the [[http://www.youtube.com/watch?v=vOj7btx3ATg][video on YouTube]]
764 - see the [[http://yasnippet.googlecode.com/svn/trunk/doc/index.html][intro and tutorial]]
766 *Note*: yasnippet is not compatible with =org-indent-mode= currently
767 there is no known way to use both successfully with =yas/trigger-key=
768 set to =TAB= (or =[tab]= etc...)
770 The way Org-mode binds the =TAB= key (binding to =[tab]= instead of
771 =\t=) overrules yasnippets' access to this key.  The following code
772 fixes this problem:
774 #+begin_src emacs-lisp
775 (add-hook 'org-mode-hook
776           (lambda ()
777             (org-set-local 'yas/trigger-key [tab])
778             (define-key yas/keymap [tab] 'yas/next-field-group)))
779 #+end_src
781 If the above code doesn't work (which it may not with later versions
782 of yasnippet).  Then try the following
784 #+begin_src emacs-lisp
785   (defun yas/org-very-safe-expand ()
786     (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
787   
788   (add-hook 'org-mode-hook
789             (lambda ()
790               ;; yasnippet (using the new org-cycle hooks)
791               (make-variable-buffer-local 'yas/trigger-key)
792               (setq yas/trigger-key [tab])
793               (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
794               (define-key yas/keymap [tab] 'yas/next-field)))
795 #+end_src
797 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]])
798 with YASnippets for Org-mode.
800 ** Org-mode takes over the S-cursor keys.  I also want to use CUA-mode, is there a way to fix this conflict?
801    :PROPERTIES:
802    :CUSTOM_ID: CUA-mode
803    :END:
805 Yes, see the  [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
807 ** Org-mode takes over the S-cursor keys.  I also want to use windmove.el, is there a way to fix this conflict?
808    :PROPERTIES:
809    :CUSTOM_ID: windmove.el
810    :END:
812 Yes, see the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
814 ** Org behaves strangely: some keys don't work, some features are missing, my settings have no effect, ...
815    :PROPERTIES:
816    :CUSTOM_ID: loaded-old-org
817    :END:
819 When this sort of things happen, it probably is because Emacs is loading an old version of Org-mode instead of the one you expected. Check it with =M-x org-version=.
821 This happens because Emacs loads first the system org-mode (the one included with Emacs) before the one in your directory. Check the =load-path= variable; you might see that your org-mode appears /after/ the system-wide path; this is bad.
823 You should add your directories to the =load-path= at the beginning:
825 :  (add-to-list 'load-path "~/.emacs.d/org-mode/lisp") (require 'org-install)
827 Function =add-to-list= adds at the beginning. Don't use =append= because it appends at the end. Also be sure to use =(require 'org-install)= and not =(require 'org)=.
829 This wrong version loading may also happen if you have a byte-compiled =org.elc= from an old version together with a new =org.el=. Since Emacs prefers loading byte-compiled files (even if the =.el= is newer), it will load the old Org-mode.
831 ** Why doesn't org-batch-agenda work under Win32?
832    :PROPERTIES:
833    :CUSTOM_ID: org-batch-agenda-under-win32
834    :END:
836 When I run the example batch files to print my agenda to the console
837 under Win32 I get the failure:
839 : End of file during parsing
841 and no agenda is printed.
843 The problem is the use of single quotes surrounding the eval in the
844 emacs command-line. This gets confused under Win32. All string
845 parameters with spaces must be surrounded in double quotes. This means
846 that double quotes being passed to the eval must be escaped.
848 Therefore, instead of the following:
850 : <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
851 :     -eval '(org-batch-agenda "a")'
853 you need to use the following:
855 :  <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
856 :     -eval "(org-batch-agenda \"a\")"
858 (all on one line, of course).
860 ** Org agenda seems very slow
861    :PROPERTIES:
862    :CUSTOM_ID: slow-agenda
863    :END:
865 If it takes a long time to generate or refresh the agenda, you might
866 want first check which version of org-mode you are using. There have
867 been major optimizations of org-agenda since 6.21b, which was the
868 version of org-mode released with Emacs 23. If you are using 6.21b or
869 earlier (you can check with =M-x org-version=), then you might want to
870 consider upgrading to a more recent version of org-mode.
872 Here are some other ideas for speeding up the agenda:
874 1. Use a one day agenda view (rather than a seven day view).
876    =(setq org-agenda-ndays 1)=
878 2. Archive inactive items to separate files.
879    
880    =C-c C-x C-s= (org-archive-subtree)
882 3. Do not include the global todo list in your agenda view.
884    (setq org-agenda-include-all-todo nil)
886 4. Make sure that your org files are byte-compiled.
888    I.e., make sure there are files ending in .elc in your org
889    installation directory.
891 ** Visual-line-mode doesn't work well with org-mode
892    :PROPERTIES:
893    :CUSTOM_ID: visual-line-mode
894    :END:
896 Visual-line-mode "soft wraps" lines so that the visual edge of the
897 buffer is considered a line break for purposes of navigation, even
898 though there is no line break in reality. 
900 In older versions of org-mode, org-beginning-of-line and
901 org-end-of-line do not work well with visual line mode. (The two
902 commands disregard soft line breaks and move to the beginning and end
903 of the hard line break.) A patch was introduces to fix this behavior
904 in July of 2009. n
906 If you are using an older version of org mode, you can:
908 1. Add a hook to turn off visual line mode.
910 2. Add the following to your =.emacs=:
912 #+begin_src emacs-lisp
914 (add-hook 'org-mode-hook
915   (lambda ()
916     (define-key org-mode-map "\C-a" 'move-beginning-of-line)
917     (define-key org-mode-map "\C-e" 'move-end-of-line)))
919 #+end_src
920 * Faces and highlighting
921   :PROPERTIES:
922   :CUSTOM_ID: Faces
923   :END:
924 ** Org-mode has a lot of colors?  How can I change them?
925    :PROPERTIES:
926    :CUSTOM_ID: customizing-org-faces
927    :END:
929 This is a question that applies to Emacs as a whole, but it comes up
930 quite frequently on the org-mode mailing list, so it is appropriate to
931 discuss it here.
933 If you would like to change the style of a face in org-mode (or any
934 other Emacs mode), simply type =M-x customize-face [RET]= while the
935 cursor is on the color/style you are interested in modifying. You will
936 be given the opportunity to customize all the faces located at that
937 point.
939 If you would like an overview of all the faces in org-mode, you can
940 type =C-u M-x list-faces-display [RET] org= and you will be shown all
941 the faces defined by org-mode along with an illustration of their
942 current settings.
944 If you would like to customize org-faces and other aspects of
945 org-appearance, type =M-x customize-group org-font-lock [RET]=.
947 Finally, if you would like verbose information about the properties of
948 the text under the cursor, you can type =C-u C-x ==.
950 See the Worg page on [[file:org-tutorials/org-appearance.org][customizing Org appearance]] for further information.
951 ** Why do I get a tiny font in column view when using emacs daemon?
952    :PROPERTIES:
953    :CUSTOM_ID: column-view-tiny-font
954    :END:
956 When using emacs in daemon mode (=emacs --daemon=), client frames
957 sometimes override the column view face settings, resulting in very
958 small fonts. Here is a fix:
960 #+begin_src emacs-lisp
961   (defun org-column-view-uses-fixed-width-face ()
962   ;; copy from org-faces.el
963   (when (fboundp 'set-face-attribute)
964       ;; Make sure that a fixed-width face is used when we have a column
965       ;; table.
966       (set-face-attribute 'org-column nil
967                           :height (face-attribute 'default :height)
968                           :family (face-attribute 'default :family))))
969   
970    (when (and (fboundp 'daemonp) (daemonp))
971     (add-hook 'org-mode-hook 'org-column-view-uses-fixed-width-face))
972 #+end_src
974 This fix was provided in the following mailing list post:
976 http://article.gmane.org/gmane.emacs.orgmode/27560
977 ** How can I stop the mouse cursor from highlighting lines in the agenda?
978    :PROPERTIES:
979    :CUSTOM_ID: ratpoison-for-agenda-highlighting
980    :END:
982 You can add the following to your =.emacs=:
984 #+begin_src emacs-lisp
985 (add-hook 'org-finalize-agenda-hook
986     (lambda () (remove-text-properties
987                (point-min) (point-max) '(mouse-face t))))
988 #+end_src
990 * Outline
991   :PROPERTIES:
992   :CUSTOM_ID: Outline
993   :END:
994 ** Can I have two windows on the same Org-mode file, with different outline visibilities?
995    :PROPERTIES:
996    :CUSTOM_ID: indirect-buffers
997    :END:
999    You may use /indirect buffers/ which do exactly this.  See the
1000    documentation on the command =make-indirect-buffer=.
1002    Org-mode has built-in commands that allow you create an indirect
1003    buffer from a subtree of an outline. To open a subtree in new
1004    window, type =C-c C-x b=. Any changes you make in the new window
1005    will be saved to the original file, but the visibility of both
1006    buffers will remain independent of one another.
1008    For multiple indirect buffers from the same file, you must use the
1009    prefix =C-u= when creating the second (or third) buffer. Otherwise
1010    the new indirect buffer will replace the old.
1012    You can also create an independent view of an outline subtree by
1013    typing =b= on an item in the agenda.
1015 ** Emacs outlines are unreadable.  Can I get rid of all those stars?
1016    :PROPERTIES:
1017    :CUSTOM_ID: Emacs-outlines-are-unreadable
1018    :END:
1020    See the section [[http://orgmode.org/manual/Clean-view.html#Clean-view][Clean outline view]] in the manual.
1021 ** C-k is killing whole subtrees!  I lost my work!
1022    :PROPERTIES:
1023    :CUSTOM_ID: C-k-is-killing-subtrees
1024    :END:
1026   =(setq org-special-ctrl-k t)= before losing your work.
1028 ** Why aren't commands working on regions?
1029    :PROPERTIES:
1030    :CUSTOM_ID: transient-mark-mode
1031    :END:
1033 Some org-mode commands, such as M-right and M-left for demoting or
1034 promoting headlines (see [[demote-multiple-headlines][this FAQ]]), can be applied to entire regions.
1035 These commands, however, will only work on active regions set with
1036 [[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
1037 Emacs 23. To enable it in earlier versions of emacs, put the following
1038 in your =.emacs= file:
1040 : (transient-mark-mode 1)
1042 Alternatively, you may turn off transient mark mode and use [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Momentary-Mark.html][a
1043 momentary mark]] (=C-<SPC> C-<SPC>=).
1045 ** Why is a blank line inserted after headlines and list items?
1046    :PROPERTIES:
1047    :ID:       2463F4D8-F686-4CF3-AA07-08976F8A4972
1048    :END:
1049    :PROPERTIES:
1050    :CUSTOM_ID: blank-line-after-headlines-and-list-items
1051    :END:
1053 In org-mode, typing =M-RET= at the end of a headline will create a new
1054 headline of the same level on a new line. The same is true for plain
1055 lists. By default org-mode uses context to determine if a blank line
1056 should be inserted after each headline or plain list item when =M-RET=
1057 is pressed. For instance, if a there is a blank line before a
1058 headline, then typing =M-RET= at the end of the line will insert a
1059 blank line before the new headline. For instance, hitting =M-RET=
1060 at the end of "Headline Two" below inserts a new headline without a
1061 blank line:
1063 : ** Headline One
1064 : ** Headline Two
1065 : **
1067 If there is a blank line between Headline One and Headline Two,
1068 however, the results will be as follows:
1070 : ** Headline One
1072 : ** Headline Two
1074 : **
1076 If you do not like the default behavior you can change it with the
1077 variable =org-blank-before-new-entry=. You can set headings and/or
1078 plain lists to auto (the default setting), t (always), or nil (never).
1080 ** How can I promote or demote multiple headlines at once?
1081    :PROPERTIES:
1082    :CUSTOM_ID: demote-multiple-headlines
1083    :END:
1085 If you have a long list of first level headlines that you'd like to
1086 demote to second level headlines, you can select the headlines as a
1087 region and then hit =M-<right>= to demote all the headlines at once.
1089 Note: =M-S-<right>= will not work on a selected region. Its use is to
1090 demote a single subtree (i.e., a headline and all sub-headlines).
1092 If M-<right> doesn't seem to work, make sure transient mark mode is
1093 enabled. See [[transient-mark-mode][this FAQ]].
1095 ** What's the deal with all the ellipses in my org outlines?
1096    :PROPERTIES:
1097    :CUSTOM_ID: org-ellipses
1098    :END:
1100 Org-mode uses ellipses to indicate folded (and thus hidden) text. Most
1101 commonly, ellispes occur at the end of headings with folded content:
1103 : * Heading ...
1105 Or, for instance, they may indicate closed drawers:
1107 : :PROPERTIES: ...
1109 Sometimes, as a result of editing and cycling an outline, ellipses may
1110 appear in unexpected places. You should *never* delete these ellipses,
1111 as you may accidentally delete hidden text. Instead, you can type =C-c
1112 C-r= (org-reveal) to display all hidden text in the vicinity. Or you
1113 may type =M-x RET show-all= to reveal all text in the org file.
1115 If you would prefer a symbol or face for indicating hidden text, you
1116 can customize the variable org-ellipses.
1118 ** How do I yank a subtree so it's indented according to points' location?
1119    :PROPERTIES:
1120    :CUSTOM_ID: yank-indent-subtree
1121    :END:
1123 You can either use =C-c C-w= with a working [[http://orgmode.org/manual/Refiling-notes.html#Refiling-notes][refile-targets]] setup.
1125 Or set =org-yank-adjusted-subtrees= to =t= which will adjust the
1126 yanked headline's level correctly.
1128 Just use =C-k= and =C-y= as you would everywhere else in Emacs.
1130 ** Can I read org-mode outlines in vim?
1131    :PROPERTIES:
1132    :CUSTOM_ID: org-outlines-in-vim
1133    :END:
1135 Yes, there is a script that enables one to view and navigate folded
1136 outline/org files in vim (though without most of org-mode's
1137 functionality, of course).
1139   - [[http://www.vim.org/scripts/script.php?script_id%3D1266][Emacs outline mode - Imitates Emacsen : vim online]]
1141 For instructions on how to set it up, please see [[http://mid.gmane.org/EA275862-B97A-4BAC-B879-177FD07A2D56@gaillourdet.net][this mailing list
1142 post]].
1144 * Todos and Tags
1145   :PROPERTIES:
1146   :CUSTOM_ID: Todos-and-Tags
1147   :END:
1148 ** How can I cycle through the TODO keyword of an entry?
1149    :PROPERTIES:
1150    :CUSTOM_ID: cycle-TODO-keywords
1151    :END:
1153   =C-c C-t= or =S-<left/right>= is what you need.
1155 ** How do I track state changes for tasks in Org?
1156    :PROPERTIES:
1157    :CUSTOM_ID: track-state-changes-for-tasks
1158    :END:
1160   Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/6082][post by Bernt Hansen]] for setting up TODO keyword
1161   states and logging timestamps for task state changes.
1163 ** Can I select the TODO keywords with a tag-like interface?
1164    :PROPERTIES:
1165    :CUSTOM_ID: select-TODO-keywords-with-tag-like-interface
1166    :END:
1168   Yes.  Use =(setq org-use-fast-todo-selection t)=
1170   If you want to set both your todos and your tags using a single
1171   interface, then check out the variable
1172   =org-fast-tag-selection-include-todo=.
1174   See [[http://orgmode.org/manual/Fast-access-to-TODO-states.html][this section of the manual]] for more details.
1176 ** How can I quickly set the tag of an entry?
1177    :PROPERTIES:
1178    :CUSTOM_ID: quickly-set-tag-of-entry
1179    :END:
1181    Use =C-c C-c= or =C-c C-q= on the headline. =C-c C-q= is useful for
1182    setting tabs in a [[http://orgmode.org/manual/Remember.html#Remember][remember]] buffer, since =C-c C-c= is the default
1183    keybinding for filing a note from the remember buffer.
1185    You can set tags even more quickly by setting one of the character
1186    shortcuts for [[http://orgmode.org/manual/Setting-tags.html#Setting-tags][fast tag selection]].
1188    To set tag shortcuts for all org buffers, put something like the
1189    following in your =.emacs= file (or create the same settings by
1190    typing =M-x customize-variable RET org-tag-alist=):
1192 : (setq org-tag-alist '(("computer" . ?c) ("office" . ?o) ("home" . ?h)))
1194    To set tag shortcuts for a single buffer, put something like the
1195    following at the top of your org file:
1197 : #+TAGS: computer(c) office(o) home(h)
1199 ** How can I change the colors of TODO keywords?
1201 You can use the variable org-todo-keyword-faces. Here are some sample
1202 settings:
1204 #+begin_src emacs-lisp
1205 (setq org-todo-keyword-faces
1206       '(
1207         ("TODO"  . (:foreground "firebrick2" :weight bold))
1208         ("WAITING"  . (:foreground "olivedrab" :weight bold))
1209         ("LATER"  . (:foreground "sienna" :weight bold))
1210         ("PROJECT"  . (:foreground "steelblue" :weight bold))
1211         ("DONE"  . (:foreground "forestgreen" :weight bold))
1212         ("MAYBE"  . (:foreground "dimgrey" :weight bold))
1213         ("CANCELED"  . shadow)
1214         ))
1215 #+end_src
1217 If you want to change the color of all active todos or all inactive
1218 todos, type:
1220 : M-x customize-face RET org-todo
1221 : M-x customize-face RET org-done
1223 You can also set values for each of these in your =.emacs= file:
1225 : (set-face-foreground 'org-todo "firebrick2")
1226 : (set-face-foreground 'org-done "forestgreen")
1228 * Hyperlinks
1229   :PROPERTIES:
1230   :CUSTOM_ID: Hyperlinks
1231   :END:
1232 ** Why do I have to confirm the execution of each shell/elisp link?
1233    :PROPERTIES:
1234    :CUSTOM_ID: confirm-shell/elisp-link
1235    :END:
1237    The confirmation is there to protect you from unwantingly execute
1238    potentially dangerous commands.  For example, imagine a link
1240    : [[shell:rm -rf ~/*][Google Search]]
1242    In an Org-mode buffer, this command would look like /Google Search/,
1243    but really it would remove your home directory.  If you wish, you can
1244    make it easier to respond to the query by setting
1246    : (setq org-confirm-shell-link-function 'y-or-n-p
1247    :       org-confirm-elisp-link-function 'y-or-n-p).
1249    Then a single keypress will be enough to confirm those links.  It is
1250    also possible to turn off this check entirely, but I strongly
1251    recommend against this.  Be warned.
1253 ** Can I use RET or TAB to follow a link?
1254    :PROPERTIES:
1255    :CUSTOM_ID: RET-or-TAB-to-follow-link
1256    :END:
1258    Yes, this is how:
1260    : (setq org-return-follows-link t)
1261    : (setq org-tab-follows-link t)
1263 ** Can I keep mouse-1 clicks from following a link?
1264    :PROPERTIES:
1265    :CUSTOM_ID: mouse-1-following-link
1266    :END:
1268    Activating links with =mouse-1= is a new feature in Emacs 22, to make
1269    link behavior similar to other applications like web browsers.  If
1270    you hold the mouse button down a bit longer, the cursor will be set
1271    without following the link.  If you cannot get used to this behavior,
1272    you can (as in Emacs 21) use =mouse-2= to follow links and turn off
1273    link activation for =mouse-1= with
1275    : (setq org-mouse-1-follows-link nil)
1277 ** How can I get completion of file names when creating a link?
1278    :PROPERTIES:
1279    :CUSTOM_ID: completion-of-file-links
1280    :END:
1282 You can use org-insert-link with a prefix argument:
1284 : C-u C-c C-l
1286 You will be greeted with prompt in the minibuffer that allows for file
1287 completion using your preferred Emacs method for finding files.
1289 * Plain Lists
1290   :PROPERTIES:
1291   :CUSTOM_ID: Plain-Lists
1292   :END:
1293 ** How can I insert an empty line before each newly inserted headline, but not before each newly inserted plain-list item?
1294    :PROPERTIES:
1295    :CUSTOM_ID: empty-line-before-each-new-headline-but-not-item
1296    :END:
1298 : (setq org-blank-before-new-entry
1299 :       '((heading . t) (plain-list-item . nil))
1301 See also [[id:2463F4D8-F686-4CF3-AA07-08976F8A4972][Why is a blank line inserted after headlines and list items?]].
1303 ** How can I convert itemized lists to enumerated lists?
1304    :PROPERTIES:
1305    :CUSTOM_ID: convert-itemized-to-enumerated-lists
1306    :END:
1308    You can use =C-c -= or =S-<left>/<right>= to cycle through the various
1309    bullet headlines available for lists: =-, +, *, 1., 1)=.
1311    See [[http://orgmode.org/manual/Plain-lists.html#Plain-lists][this section of the manual]] for more information.
1313 ** How can I convert plain lists to headlines and vice versa?
1314    :PROPERTIES:
1315    :CUSTOM_ID: convert-plain-lists-to-headlines
1316    :END:
1318    To convert a plain list item or line to a headline, type =C-c *= on
1319    the headline. This will make the line a subheading of the current
1320    headline.
1322    To convert a headline to a plain list item, type =C-c -= while the
1323    cursor is on the headline.
1325    To convert a headline to an unadorned line of text, type =C-c *= on
1326    the headline.
1328    You can use query replace to accomplish the same things, as Bernt
1329    Hansen explains in [[http://article.gmane.org/gmane.emacs.orgmode/10148][this mailing list post]].
1331 ** Is there a good way to create a description list?
1332    :PROPERTIES:
1333    :CUSTOM_ID: description-lists
1334    :END:
1336   Yes, these are now built-in:
1338 #+BEGIN_EXAMPLE
1339 - item1 :: Description of this item 1
1340 - item2 :: Description of this item 2
1341 - item1 :: Description of this item 3
1342       also in multiple lines
1343 #+END_EXAMPLE
1345 * Tables
1346   :PROPERTIES:
1347   :CUSTOM_ID: Tables
1348   :END:
1349 ** Can I plot data from a table?
1350    :PROPERTIES:
1351    :CUSTOM_ID: plotting-table-data
1352    :END:
1354    Yes, you can, using org-plot.el written by James TD Smith and now
1355    bundled with Org.  See [[http://orgmode.org/manual/Org_002dPlot.html#Org-Plot][the manual section about this]].
1357    See also [[file:org-tutorials/org-plot.org][this excellent tutorial]] by Eric Schulte.
1359 ** How can I fill a table column with incremental numbers?
1360    :PROPERTIES:
1361    :CUSTOM_ID: fill-table-column-with-incremental-numbers
1362    :END:
1364 Here is how: Use a field formula to set the first value in the column:
1366 #+begin_src org
1367 ,| N   |   |
1368 ,|-----+---|
1369 ,| :=1 |   |
1370 ,|     |   |
1371 ,|     |   |
1372 ,|     |   |
1373 ,#+TBLFM: @2$1=1
1374 #+end_src
1376 Then define a column formula in the second field:
1378 #+begin_src org
1379 ,| N        |   |
1380 ,|----------+---|
1381 ,| 1        |   |
1382 ,| =@-1 + 1 |   |
1383 ,|          |   |
1384 ,|          |   |
1385 ,#+TBLFM: @2$1=1
1386 #+end_src
1388 After recomputing the table, the column will be filled with
1389 incremental numbers:
1391 #+begin_src org
1392 ,| N |   |
1393 ,|---+---|
1394 ,| 1 |   |
1395 ,| 2 |   |
1396 ,| 3 |   |
1397 ,| 4 |   |
1398 ,#+TBLFM: $1=@-1 + 1::@2$1=1
1399 #+end_src
1401 Note that you could use arbitrary starting values and column formulas.
1403 ** Why does my table column get filled with #ERROR?
1404    :PROPERTIES:
1405    :CUSTOM_ID: table-column-filled-with-ERROR
1406    :END:
1408    Org-mode tried to compute the column from other fields using a
1409    formula stored in the =#+TBLFM:= line just below the table, and
1410    the evaluation of the formula fails.  Fix the fields used in the
1411    formula, or fix the formula, or remove it!
1413 ** How can I stop the table editor from creating new lines?
1414    :PROPERTIES:
1415    :CUSTOM_ID: table-editor-creates-new-lines
1416    :END:
1418    When I am in the last column of a table and just above a horizontal
1419    line in the table, pressing TAB creates a new table line before the
1420    horizontal line.  To move to the line below the
1421    horizontal line instead, do this:
1423    Press =down= (to get on the separator line) and then =TAB=.
1424    Or configure the variable
1426    : (setq org-table-tab-jumps-over-hlines t)
1428 ** How can I get table fields starting with "="?
1429    :PROPERTIES:
1430    :CUSTOM_ID: table-fields-starting-with-=
1431    :END:
1433    With the setting
1435    : (setq org-table-formula-evaluate-inline nil)
1437    this will no longer happen.  You can still use formulas using the
1438    commands @<tt>C-c =@</tt> and @<tt>C-u C-c =@</tt>
1440 ** How can I change the indentation of an entire table without fixing every line by hand?
1441    :PROPERTIES:
1442    :CUSTOM_ID: change-indentation-entire-table
1443    :END:
1445    The indentation of a table is set by the first line.  So just fix the
1446    indentation of the first line and realign with =TAB=.
1448 ** In my huge table the realigning after each TAB takes too long.  What can I do?
1449    :PROPERTIES:
1450    :CUSTOM_ID: table-realigning-after-TAB-takes-long
1451    :END:
1453    Either split the table into several by inserting an empty line every
1454    100 lines or so.  Or turn off the automatic re-align with
1456    : (setq org-table-automatic-realign nil)
1458    After this the only way to realign a table is to press =C-c C-c=.  It
1459    will no longer happen automatically, removing the corresponding delays
1460    during editing.
1462 ** Recalculation of my table takes too long.  What can I do?
1463    :PROPERTIES:
1464    :CUSTOM_ID: Recalculation-of-my-table-takes-too-long
1465    :END:
1467    Nothing, really.  The spreadsheet in org is mostly done to make
1468    calculations possible, not so much to make them fast.  Since Org-mode
1469    is firmly committed to the ASCII format, nothing is stopping you from
1470    editing the table by hand.  Therefore, there is no internal
1471    representation of the data.  Each time Org-mode starts a computation,
1472    it must scan the table for special lines, find the fields etc.  This
1473    is slow.  Furthermore, Calc is slow compared to hardware
1474    computations.  To make this work with normal editing, recalculation
1475    is not happening automatically, or only for the current line, so that
1476    the long wait for a full table iteration only happens when you ask
1477    for it.
1479    So for really complex tables, moving to a "real" spreadsheet may
1480    still be the best option.
1482    That said, there are some ways to optimize things in Org-mode, and I
1483    have been thinking about moving a bit further down this line.
1484    However, for my applications this has so far not been an issue at
1485    all.  If you have a good case, you could try to convince me.
1487 ** =S-RET= in a table keeps increasing the copied numbers.  How can I stop this?
1488    :PROPERTIES:
1489    :CUSTOM_ID: S-RET-in-a-table-increases-copied-numbers
1490    :END:
1492    Well, it is /supposed/ to be a feature, to make it easy to create a
1493    column with increasing numbers.  If this gets into your way, turn it
1494    off with
1496    : (setq org-org-table-copy-increment nil)
1498 ** When I export tables to html, they don't have borders.
1499    :PROPERTIES:
1500    :CUSTOM_ID: table-borders-in-html-export
1501    :END:
1503 By default, org mode exports tables without borders.
1505 You can changed this by placing an =#+ATTR_HTML= line before the
1506 table:
1508 :  #+ATTR_HTML: border="2" rules="all" frame="all"
1510 See [[http://orgmode.org/manual/Tables-in-HTML-export.html#Tables-in-HTML-export][the manual]] for more details.
1512 ** Why does the Calc high precision (e. g. =p20=) not work like expected?
1513    :PROPERTIES:
1514    :CUSTOM_ID: table-high-precision
1515    :END:
1517 - *Short answer*
1519   Avoid
1520   : | 0.16666667000000 |
1521   : #+TBLFM: $1 = 1 / 2 * 3; p20 %.14f
1522   and use
1523   : | 0.16666666666667 |
1524   : #+TBLFM: $1 = 1 / 2 * 3; p20 f14
1526 - *Longer answer*
1528   It is important to distinguish between the precision of
1529   1) =p20=: Calc internal calculation (=calc-internal-prec=)
1530   2) =f14=: Calc float formatting, unlimited in precision (=calc-float-format=)
1531   3) =%.14f=: the =printf= reformatting, limited in precision
1533   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.
1535   Use =C-h v org-calc-default-modes RET= to check the Org default settings
1536   which are used if no format specifiers are added to a table formula.
1537   The examples below have been made with the out_of_the_box Org defaults
1538   =calc-internal-prec = 12= and =calc-float-format = 8=.
1540   Remember the formula debugger, toggled with =C-c {=,
1541   to view the processing stages like:
1542   |   | formula debugger label | processing stage           |
1543   | / | <                      | <>                         |
1544   |---+------------------------+----------------------------|
1545   |   | Result:                | output of Calc             |
1546   |   | Format:                | reformatting with =printf= |
1548   Following are some examples to demonstrate
1549   the interaction of the three precisions.
1551   - *display precision limitations for Calc formulas*
1552     - limited by Calc internal calculation precision from Org default
1553       (here =p12=)
1554       : | 0.16666666666700 |
1555       : #+TBLFM: $1 = 1 / 2 * 3;     f14
1557       : | 0.1666666666670000000 |
1558       : #+TBLFM: $1 = 1 / 2 * 3;     f19
1560     - limited by Calc float format from Org default (here =f8=)
1561       : | 0.16666667 |
1562       : #+TBLFM: $1 = 1 / 2 * 3
1564       : | 0.16666667 |
1565       : #+TBLFM: $1 = 1 / 2 * 3; p20
1567       : | 0.16666667000000 |
1568       : #+TBLFM: $1 = 1 / 2 * 3;         %.14f
1570       : | 0.16666667000000 |
1571       : #+TBLFM: $1 = 1 / 2 * 3; p20     %.14f
1573     - limited by Calc float format specified
1574       : | 0.166667 |
1575       : #+TBLFM: $1 = 1 / 2 * 3;     f6
1577       : | 0.16666666666667 |
1578       : #+TBLFM: $1 = 1 / 2 * 3; p20 f14
1580       : | 0.1666666666666666667 |
1581       : #+TBLFM: $1 = 1 / 2 * 3; p20 f19
1583     - limited by =printf= conversion to Emacs Lisp float
1584       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
1585       : #+TBLFM: $1 = 1 / 2 * 3;         %.19f
1587       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
1588       : #+TBLFM: $1 = 1 / 2 * 3; p20     %.19f
1590       : | 0.1666666666666666600 | the inaccuracy is platform dependent |
1591       : #+TBLFM: $1 = 1 / 2 * 3; p20 f20 %.19f
1593     - limited by =printf= format specified
1594       : | 0.166667 |
1595       : #+TBLFM: $1 = 1 / 2 * 3;         %.6f
1597   - *display precision limitations for Emacs Lisp formulas*
1598     - limited by Emacs Lisp float
1599       : | 0.16666666666666666 |
1600       : #+TBLFM: $1 = '(/ 1.0 (* 2 3))
1602       : | 0.1666666666666666574 | the inaccuracy is platform dependent |
1603       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.19f
1605     - limited by =printf= format specified
1606       : | 0.16666666666667 |
1607       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.14f
1609 This FAQ entry is based on this [[http://thread.gmane.org/gmane.emacs.orgmode/22642][mailing list thread]]
1610 and is continued in the [[#table-float-fraction][next FAQ entry]].
1612 ** Which float format shows the fraction part also when the latter is zero?
1613    :PROPERTIES:
1614    :CUSTOM_ID: table-float-fraction
1615    :END:
1617 - *Short answer*
1619   Avoid
1620   : | 1 |
1621   : #+TBLFM: $1 = 1 + 0; f3
1622   and use
1623   : | 1.000 |
1624   : #+TBLFM: $1 = 1 + 0; %.3f
1626 - *Longer answer*
1628   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]]
1629   in the section Mode Settings -> Display Modes -> Float Formats
1630   [[http://www.delorie.com/gnu/docs/calc/calc_163.html][found here as long as the section numbering is kept]].
1632   Remember the formula debugger, toggled with =C-c {=,
1633   to view the processing stages like:
1634   |   | formula debugger label | processing stage           |
1635   | / | <                      | <>                         |
1636   |---+------------------------+----------------------------|
1637   |   | Result:                | output of Calc             |
1638   |   | Format:                | reformatting with =printf= |
1640   Following are some examples to demonstrate different float formats.
1642   - normal precision
1643     : |----------------------+---------+-------+-------|
1644     : | number               |      f3 |   f-3 |  %.3f |
1645     : |----------------------+---------+-------+-------|
1646     : | 1 + 0                |       1 |     1 | 1.000 |
1647     : | 0 + 0                |       0 |     0 | 0.000 |
1648     : |----------------------+---------+-------+-------|
1649     : | 1 + 1 / 2 * 3 * 1000 |   1.000 | 1.000 | 1.000 |
1650     : | 0 + 1 / 2 * 3 * 1000 | 1.67e-4 | 0.000 | 0.000 |
1651     : |----------------------+---------+-------+-------|
1652     : | 1 + 1 / 2 * 3 *  100 |   1.002 | 1.002 | 1.002 |
1653     : | 0 + 1 / 2 * 3 *  100 |   0.002 | 0.002 | 0.002 |
1654     : |----------------------+---------+-------+-------|
1655     : #+TBLFM: $2 = $1; f3 :: $3 = $1; f-3 :: $4 = $1; %.3f
1657   - high precision
1658     : |----------------------+--------------------------+-----------------------|
1659     : | number               |                      f19 |                  f-19 |
1660     : |----------------------+--------------------------+-----------------------|
1661     : | 1 + 0                |                        1 |                     1 |
1662     : | 0 + 0                |                        0 |                     0 |
1663     : |----------------------+--------------------------+-----------------------|
1664     : | 1 + 1 / 2 * 3 * 1e19 |    1.0000000000000000000 | 1.0000000000000000000 |
1665     : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
1666     : |----------------------+--------------------------+-----------------------|
1667     : | 1 + 1 / 2 * 3 * 1e18 |    1.0000000000000000002 | 1.0000000000000000002 |
1668     : | 0 + 1 / 2 * 3 * 1e18 |    0.0000000000000000002 | 0.0000000000000000002 |
1669     : |----------------------+--------------------------+-----------------------|
1670     : #+TBLFM: $2 = $1; p20 f19 :: $3 = $1; p20 f-19
1672     The =printf= reformatting (=%.19f=) cannot be used with high precision,
1673     see the [[#table-high-precision][previous FAQ entry]].
1675 * Markup
1676   :PROPERTIES:
1677   :CUSTOM_ID: Footnotes
1678   :END:
1679 ** How can I get automatic renumbering of footnotes in org-mode?
1680    :PROPERTIES:
1681    :CUSTOM_ID:       footnote-auto-adjust
1682    :END:
1684 You can add the following line to your .emacs file:
1686 : (setq org-footnote-auto-adjust t)
1688 Or, if you prefer, you can turn this option on locally by placing the
1689 following line at the top of your org file:
1691 : #+STARTUP: fnadjust
1693 When auto-adjust is turned on, footnotes in the file with numerical
1694 labels will be renumbered whenever a new footnote is added. Meanwhile,
1695 all footnotes, including those with custom labels such
1696 =[fn:custom-label ]=, will be sorted in the order of their appearance
1697 in the text.
1699 This emulates the footnote behavior that many users may be familiar
1700 with from word-processing programs or from the footnote-mode included
1701 with emacs.
1703 If you do not turn on org-footnote-auto-adjust, you sort and/or
1704 renumber footnotes at any time by calling org-footnote-action with a
1705 prefix argument.
1707 ** Why isn't auto renumbering of footnotes turned on by default?
1708    :PROPERTIES:
1709    :CUSTOM_ID:       why-no-default-auto-adjust
1710    :END:
1712 Org mode has a very robust footnote mechanism allowing for a variety
1713 of types of footnotes. With some of the following footnote notations,
1714 auto-adjust may be either irrelevant or undesired:
1716  - Automatically numbered
1717  - Footnotes with custom labels
1718  - Inline footnotes
1720 In addition, org mode can be customized to place footnotes either at
1721 the end of a document or at the end of the outline heading in which
1722 they appear. Users who change this setting while editing a document
1723 may be disconcerted to find all of their footnotes rearranged
1724 automatically.
1726 ** I have auto-fill-mode set and org-mode is inserting unwanted comment markers!
1727    :PROPERTIES:
1728    :CUSTOM_ID: auto-fill-and-unwanted-comments
1729    :END:
1731 If the following occurs:
1733 #+begin_src org
1735 #+OPTIONS: toc:nil
1736 Some entered text.
1737 # More entered tex.
1739 #+end_src
1741 Make sure that the variable comment-start is nil.
1743 ** Are there any shortcuts for entering source blocks and comment lines?
1744    :PROPERTIES:
1745    :CUSTOM_ID: shortcuts-for-entering-source-blocks
1746    :END:
1748 Org mode has some [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][very convenient markup]] for including literal blocks
1749 and lines of code in a file. (This is especially useful when exporting
1750 documents or using the contributed package [[file:org-contrib/babel/index.org][org-babel]] for executing
1751 blocks of code.)
1753 #+begin_src org
1754   ,#+begin_src perl
1755   ,  print "Hello, world!\n";
1756   ,#+end_src
1757 #+end_src
1759 It can be tiresome to enter the block comment lines manually. There
1760 are several possible shortcuts you can use to enter them:
1762 1) Built-in expansion
1764    - Org mode has a "secret" method of expanding source code blocks
1765      and comment lines.
1767    - If you type "<s" followed by =TAB= or =M-TAB=, a source block will
1768      magically appear.
1770    - For a full list of expansions, type =M-x describe-variable
1771      [RET] org-structure-template-alist=.
1773 2) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Registers]]
1775    - Add the following line to your emacs file:
1777      =(set-register ?p "#+begin_src\n\n#+end_src perl")=
1779    - Then type =C-x r i p= to insert the source block. Please note: if
1780      you save another value to the register "p" with =C-x r s p=, it
1781      will overwrite the setting above for the current emacs session.
1783 3) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Abbrevs]]
1785  - Activate the abbrev minor-mode in org-mode:
1787    + M-x abbrev-mode
1789    + /Permanently/:
1791        + =(add-hook 'org-mode-hook (lambda () (abbrev-mode 1)))=
1793  - In org-mode, type "sbp" (a sample abbreviation for a perl source
1794    block).
1796  - Immediately after "sbp" type =C-x a i l=.
1798  - Enter the expansion: 
1800    - =#+begin_src perl[C-q C-j][C-q C-j]#+end_src=
1802    - Note: =C-q C-j= creates a new line in the minibuffer
1804  - Now, whenever, you type sbp followed by =SPACE= or =RET= in an
1805    org-mode buffer, the src block will magically appear.
1807  - To review your list of abbrevs, type =M-x edit-abbrevs=.
1809  - If you want more complex completion (like yasnippet) you can combine
1810    abbrev mode with [[http://www.emacswiki.org/emacs/SkeletonMode][skeletons]].
1812 4) [[http://code.google.com/p/yasnippet/][Yasnippet]]
1814  - Several org-mode users install yasnippet for convenient, complex
1815    expansion.
1817  - See Bernt Hansen's [[http://doc.norang.ca/org-mode.html#Yasnippets][org-mode setup]] for a good introduction to
1818    yasnippet.
1820 * Remember
1821   :PROPERTIES:
1822   :CUSTOM_ID: Remember
1823   :END:
1824 ** Can I use the remember buffer to clock a customer phone call?
1825    :PROPERTIES:
1826    :CUSTOM_ID: use-remember-buffer-to-clock-phone-call
1827    :END:
1829   Yes, you can.  Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/5482][setup described by Bernt Hansen]]
1830   and check out (in the same thread) what Nick Docos had to fix to
1831   make Bernt's set-up work for him.
1832 ** Can I automatically start the clock when opening a remember template?
1833    :PROPERTIES:
1834    :CUSTOM_ID: start-clock-when-opening-remember-template
1835    :END:
1837    Yes, this is possible.  Use the following code and make sure that
1838    after executing it, `my-start-clock-if-needed' is in
1839    `remember-mode-hook' /after/ `org-remember-apply-template'.
1841    : (add-hook 'remember-mode-hook 'my-start-clock-if-needed 'append)
1842    : (defun my-start-clock-if-needed ()
1843    :   (save-excursion
1844    :     (goto-char (point-min))
1845    :     (when (re-search-forward " *CLOCK-IN *" nil t)
1846    :       (replace-match "")
1847    :       (org-clock-in))))
1849    Then, when a template contains the key string CLOCK-IN, the clock
1850    will be started.  Starting with Org-mode version 5.20, the clock will
1851    automatically be stopped when storing the remember buffer.
1853 * Searches
1854   :PROPERTIES:
1855   :CUSTOM_ID: Searches
1856   :END:
1857 ** Isearch does not find string hidden in links.  What can I do?
1858    :PROPERTIES:
1859    :CUSTOM_ID: isearch-in-links
1860    :END:
1862   M-x =visible-mode= will display the full link, making them searchable.
1864 ** How can I reduce the amount of context shown in sparse trees?
1865    :PROPERTIES:
1866    :CUSTOM_ID: context-in-sparse-trees
1867    :END:
1869    Take a look at the following variables:
1871    - =org-show-hierarchy-above=
1872    - =org-show-following-headline=
1873    - =org-show-siblings=
1874    - =org-show-entry-blow=
1876    which give command-dependent control over how much context is shown
1877    by a particular operation.
1879 ** How can I combine the results of two calls to =org-occur=?
1880    :PROPERTIES:
1881    :CUSTOM_ID: two-calls-to-org-occur
1882    :END:
1884    You can construct a regular expression that matches all targets you
1885    want.  Alternatively, use a =C-u= prefix with the second and any
1886    further calls to =org-occur= to keep the current visibility and
1887    highlighting in addition to the new ones.
1889 * Agenda
1890   :PROPERTIES:
1891   :CUSTOM_ID: Agenda
1892   :END:
1893 ** How can I change the advanced warning time for deadlines?
1894 ##<<warning-period-for-deadlines>>
1896 Deadline warnings appear in the daily agenda view a specified number
1897 of days before the deadline is due. The default setting is 14 days.
1898 You can change this with the variable =org-deadline-warning-days=.
1899 (See [[http://orgmode.org/manual/Deadlines-and-scheduling.html#Deadlines-and-scheduling][this section]] of the manual.)
1901 For instance,
1903 : (setq org-deadline-warning-days 30)
1905 would cause warnings for each deadline to appear 30 days in advance.
1907 Naturally, you might not want warnings for all of your deadlines to
1908 appear so far in advance. Thus, you can change the lead time for
1909 individual items as follows:
1911 : * TODO Get a gift for the party
1912 :   DEADLINE: <2009-01-16 Fri -2d>
1914 The "-2d" above changes the lead time for this deadline warning to two
1915 days in advance. You can also use "w" for weeks and "m" for months.
1916 ** How can I postpone a task until a certain date?
1917    :PROPERTIES:
1918    :CUSTOM_ID: deferring-tasks
1919    :END:
1921 The easiest way to postpone a task is to schedule it in the future.
1922 For instance, typing =C-c C-s +2w= on a headline will push a task two
1923 weeks into the future, so that it won't show up on the daily agenda
1924 until two weeks from now.
1926 If you'd like to prevent the task from showing up on your global todo
1927 list, you have a couple of options.
1929 1. You can set the variable =org-agenda-todo-ignore-scheduled= to =t=.
1930    This will exclude any scheduled items from your global list of
1931    active todos (=C-c a t=). (The variable
1932    =org-agenda-todo-ignore-with-date= will exclude both scheduled and
1933    deadline items from your todo list).
1934 2. You can remove the todo keyword from the item (C-c C-t <SPC>). The
1935    item will still appear on your agenda two weeks from today, but it
1936    won't show up on your todo lists.
1937 ** Can I send myself an email containing tasks or other agenda info?
1938    :PROPERTIES:
1939    :CUSTOM_ID: email-containing-tasks-or-other-agenda-info
1940    :END:
1942    Yes.  See [[http://article.gmane.org/gmane.emacs.orgmode/6112][this thread]] on the list.
1944 ** How can I limit the agenda view to my "work" tasks?
1945    :PROPERTIES:
1946    :CUSTOM_ID: limit-agenda-with-tag-filtering
1947    :END:
1949    It is often convenient to group org files into separate categories,
1950    such as "home" and "work" (or "personal" and "professional"). One
1951    of the main reasons for such classification is to create agenda
1952    views that are limited by type of work or area of responsibility.
1953    For instance, while at work, one may want to see only professional
1954    tasks; while away from work, one may want to see only personal
1955    tasks.
1957    One way to categorize files and tasks is to use a "#+FILETAGS"
1958    declaration at the top of each file, such as:
1960    : #+FILETAGS: work
1962    As long as org-use-tag-inheritance is turned on, the filetags will
1963    be inherited by all tasks in the file. A file can have multiple
1964    filetags. And, of course, tags can be added to individual headings.
1966    Tasks can be quickly filtered by tag from within the agenda by
1967    typing "/" and the name of the tag. The full key sequence to filter
1968    for work items in an agenda view would be:
1970    : C-c a a / work [or a tag shortcut]
1972 ** How can I limit the agenda view to a particular category?
1973    :PROPERTIES:
1974    :CUSTOM_ID: limit-agenda-with-category-match
1975    :END:
1977    Another way to filter agenda views by type of work is to use a
1978    "#+CATEGORY" declaration at the top of each file, such as:
1980    : #+CATEGORY: work
1982    Categories can also be added to individual headings within a file:
1984    : * Big project
1985    :   :PROPERTIES:
1986    :   :CATEGORY: work
1987    :   :END:
1989    All todos belonging to the category "work" can be found a with a
1990    simple tags-todo search:
1992    : C-c a M
1994    At the prompt, type:
1996    : CATEGORY="work"
1998    The same results can be achieved with custom agenda commands, such as:
2000 #+BEGIN_SRC emacs-lisp
2001 (setq org-agenda-custom-commands
2002       '(("h" tags-todo "CATEGORY=\"home\"")
2003         ("w" tags-todo "CATEGORY=\"work\"")
2004         ;; other custom agenda commands here
2005         ))
2006 #+END_SRC
2008 ** How can include all org files in a directory in my agenda?
2009    :PROPERTIES:
2010    :CUSTOM_ID: set-agenda-files-using-wildcards
2011    :END:
2013 You can simply include the directory (as one of the items) in the
2014 value of the variable org-agenda-files:
2016 : (setq org-agenda-files '("/my/special/path/org/"))
2018 There is another way of accomplishing the same end:
2020 : (setq org-agenda-files (file-expand-wildcards "/my/special/path/org/*.org"))
2022 ** Why aren't items disappearing from my agenda once they are marked done?
2023    :PROPERTIES:
2024    :CUSTOM_ID: removing-done-items-from-agenda
2025    :END:
2027 If items remain on your daily/weekly agenda after they are marked
2028 done, check the configuration of the following variables:
2030 : org-agenda-skip-scheduled-if-done
2031 : org-agenda-skip-deadline-if-done
2032 : org-agenda-skip-timestamp-if-done
2034 For instance, type:
2036 : M-x customize-variable RET org-agenda-skip-scheduled-if-done
2038 If this variable is turned off (=nil=), then scheduled items will
2039 remain on the agenda even after they are marked done.
2041 If the variable is turned on (=t=), then scheduled items will
2042 disappear from the agenda after they are marked done.
2044 If these settings seem not to behave the way you expect, then make
2045 sure you understand [[scheduled-vs-deadline-vs-timestamp][the
2046 difference between SCHEDULED, DEADLINE, and timestamps]].
2048 ** What is the difference between SCHEDULED, DEADLINE, and plain timestamps?
2049    :PROPERTIES:
2050    :CUSTOM_ID: scheduled-vs-deadline-vs-timestamp
2051    :END:
2053 1. SCHEDULED items (set with =C-c C-s=) will appear on your agenda on
2054    the day they are scheduled and on every day thereafter until they
2055    are done. Schedule a task if you want to be reminded to do
2056    something beginning on a certain day and until it is done.
2058 : ** TODO Scheduled item
2059 :    SCHEDULED: <2009-03-01 Sun>
2061 2. Items with a DEADLINE timestamp (set with =C-c C-d=) appear on your
2062    agenda in advance of the when they are due and remain on your
2063    agenda until they are done. Add a DEADLINE to an item if you want
2064    to make sure to complete it by a certain date. (The variable
2065    org-deadline-warning-days determines how far in advance items with
2066    deadlines will show up in the agenda. See [[warning-period-for-deadlines][this FAQ]] for more
2067    information.)
2069 : ** TODO Item with a deadline
2070 :    DEADLINE: <2009-01-20 Tue>
2072 3. An active timestamp (set with =C-c .=) will appear on your agenda
2073    only on the day it is scheduled. Use a timestamp for appointments
2074    or any reminders you want to show up only on a particular day.
2076 : ** TODO Item with an active timestamp
2077 : <2009-04-18 Sat>
2079 Note: items with inactive timestamps (set with C-c ! and marked by
2080 square brackets) will not show up in the agenda at all.
2082 ** Can I add files recursively to my list of agenda files?
2083    :PROPERTIES:
2084    :CUSTOM_ID: set-agenda-files-recursively
2085    :END:
2087 Yes, you can use the library "find-lisp."
2089 : (load-library "find-lisp")
2090 : (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$"))
2092 This will add all files ending in =org= in the directory "~/org"
2093 and all of its subdirectories to your list of agenda files.
2095 See [[http://thread.gmane.org/gmane.emacs.orgmode/8992][this thread]] on the mailing list for more information.
2097 ** Why does an item appearing at the wrong time of day in my agenda?
2098    :PROPERTIES:
2099    :CUSTOM_ID: agenda-wrong-time-of-day
2100    :END:
2102 When preparing the agenda view, org-mode scans each relevant headline
2103 for a time designation. This approach is very nice for adding
2104 free-form timestamps to an item for scheduling. Thus, either of the
2105 following work would work to schedule an item at 10:00am:
2107 #+begin_src org
2108 ,** 10:00am Get dried ice at the magic store
2109 ,   SCHEDULED: <2009-05-27 Wed>
2110 #+end_src
2112 #+begin_src org
2113 ,** Get dried ice at the magic store
2114 ,   SCHEDULED: <2009-05-27 Wed 10:00>
2115 #+end_src
2117 To enable this flexibility, org-mode scans the entire headline for
2118 time of day notation. A potential problem can arise if you use
2119 inactive timestamps in the headline to note when an item was created.
2120 For example,
2122 #+begin_src org
2123 ,** Get dried ice at the magic store [2009-05-26 Tue 12:58]
2124 ,   SCHEDULED: <2009-05-27 Wed>
2125 #+end_src
2127 Org mode would interpret the time in the inactive timestamp as a
2128 time-of-day indicator and the entry would appear in your agenda at
2129 12:58.
2131 If you would like to turn off the time-of-day search, you can
2132 configure the variable =org-agenda-search-headline-for-time= (requires
2133 org-mode >= 6.24).
2135 ** How can I change the visibility of an item from the agenda?
2136    :PROPERTIES:
2137    :CUSTOM_ID: cycling-visibility-from-agenda
2138    :END:
2140 You can add a keybinding as follows:
2142 #+begin_src emacs-lisp
2143 (add-hook 'org-agenda-mode-hook
2144    (lambda ()
2145      (define-key org-agenda-mode-map " " 'org-agenda-cycle-show)))
2146 #+end_src
2148 Then, as you press SPACE on an item on the agenda, it will cycle the
2149 visibility of its original location.
2151 * Appointments/Diary
2152   :PROPERTIES:
2153   :CUSTOM_ID: Appointments/Diary
2154   :END:
2155 ** Is it possible to include entries from org-mode files into my emacs diary?
2156    :PROPERTIES:
2157    :CUSTOM_ID: include-entries-from-org-mode-files-into-emacs-diary
2158    :END:
2160    Since the org-mode agenda is much more powerful and can contain the
2161    diary, you should think twice before deciding to do this.  If you
2162    insist, however, integrating Org-mode information into the diary is
2163    possible.  You need to turn on /fancy diary display/ by setting in
2164    .emacs:
2166    : (add-hook 'diary-display-hook 'diary-fancy-display)
2168    Then include the following line into your ~/diary file, in
2169    order to get the entries from all files listed in the variable
2170    =org-agenda-files=
2172    : &%%(org-diary)
2174    You may also select specific files with
2176    : &%%(org-diary) ~/path/to/some/org-file.org
2177    : &%%(org-diary) ~/path/to/another/org-file.org
2179    If you now launch the calendar and press @<tt>d@</tt> to display a
2180    diary, the headlines of entries containing a timestamp, date range,
2181    schedule, or deadline referring to the selected date will be listed.
2182    Just like Org-mode's agenda view, the diary for /today/ contains
2183    additional entries for overdue deadlines and scheduled items.  See
2184    also the documentation of the =org-diary= function.  Under XEmacs, it
2185    is not possible to jump back from the diary to the org, this works
2186    only in the agenda buffer.
2187 ** I want to add my Org scheduled/deadlined entries in my diary!
2188    :PROPERTIES:
2189    :CUSTOM_ID: add-Org-scheduled/deadlined-entries-to-diary!
2190    :END:
2192   Put this in your ~/.diary:
2194   : &%%(org-diary :scheduled :timestamp :deadline)
2196 ** How can I set up automatic reminders based on Org information?
2197    :PROPERTIES:
2198    :CUSTOM_ID: automatic-reminders
2199    :END:
2201   See [[http://article.gmane.org/gmane.emacs.orgmode/5271][this post]] by N. Dokos on the list.
2202 ** How can I make =appt= notice my Org appointments?
2203    :PROPERTIES:
2204    :CUSTOM_ID: appt-notice-my-Org-appointments
2205    :END:
2207   : M-x org-agenda-to-appt RET
2209 ** How can I create more complex appointments in my org-files?
2210    :PROPERTIES:
2211    :CUSTOM_ID: diary-sexp-in-org-files
2212    :END:
2214 Org-mode's active timestamps work very well for scheduling individual
2215 or recurring appointments, such as:
2217 #+begin_src org
2218   ,* 8:00am Dentist appointment <2009-01-16 Fri>
2219 #+end_src
2222 #+begin_src org
2223   ,* Vacation
2224   ,  <2009-03-20 Fri>--<2009-04-01 Wed>
2225 #+end_src
2229 #+begin_src org
2230   ,* Weekly meeting with boss
2231   ,  <2009-01-20 Tue 14:00 +1w>
2232 #+end_src
2234 Sometimes, however, you need to set up more complicated recurring
2235 appointments. Org-mode has built-in support for many of
2236 [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Sexp-Diary-Entries.html][the
2237 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
2238 instance, that you teach a class that meets every Monday evening
2239 between February 16 and April 20, 2009. The way to enter this an
2240 org-mode file is:
2242 #+begin_src org
2243   ,** Class 7:00pm-9:00pm
2244   ,   <%%(and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009))>
2245 #+end_src
2247 The expression above designates all Mondays that fall between February
2248 16 and April 20. How exactly does it work?
2250  - (and... :: Indicates that *both* of the conditions that follow have
2251           to be true.
2253    - (= 1 (calendar-day-of-week date)) :: Is the day of the week a
2254         Monday?
2256        - Note: the function calendar-day-of-week converts the date to the day of week
2257          expressed in numeric form, where 0 = Sunday, 1 = Monday, and so on.
2259    - (diary-block 2 16 2009 4 20 2009) :: Does the date fall between
2260         these two dates?
2262 You can make a sexp as complex as you like. If you wanted to omit a
2263 week because of holidays, for instance, you could add another
2264 condition to the sexp:
2266 #+begin_src org
2267   ,** Class 7:00pm-9:00pm
2268   ,   <%%(unless (diary-block 3 9 2009 3 13 2009) (and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009)))>
2269 #+end_src
2271 The sexp above would omit Monday during the week of March 9, 2009. For
2272 another way to accomplish the same thing, see [[org-diary-class][this FAQ]].
2274 Another diary function commonly used for more complex scheduling is
2275 diary-float. For instance,
2277 #+begin_src org
2278   ,* Monthly meeting
2279   ,  <%%(diary-float t 3 3)>
2280 #+end_src
2282 ...would appear on the third Wednesday of every month.
2284 For more ideas on how to create diary special expressions, see [[http://www.emacswiki.org/cgi-bin/wiki/DiaryMode][this
2285 page on the Emacs wiki]].
2287 ** How can I schedule a weekly class that lasts for a limited period of time?
2288    :PROPERTIES:
2289    :CUSTOM_ID: org-diary-class
2290    :END:
2292 Org-mode offers a convenient diary sexp function for setting up a
2293 recurring appointment that lasts for a certain period of time, such as
2294 a class. It is called org-diary-class and it can be entered as
2295 follows:
2297 #+begin_src org
2298   ,** Class 7:00pm-9:00pm
2299   ,   <%%(org-diary-class 2 16 2009 4 20 2009 1 10)>
2300 #+end_src
2302 The function above schedules an appointment for every Monday (1)
2303 between February 16 and April 20, 2009, except for ISO week 10 (March
2304 1 to March 7).
2306 The function org-diary-class has the following format:
2308 : (org-diary-class M1 D1 Y1 M2 D2 Y2 DAYNAME &rest SKIP-WEEKS)
2310 M1/2, D1/2, and Y1/2 indicate the beginning and ending dates. Dayname
2311 takes the form of a number indicating the day of the week (0 = Sunday,
2312 1 = Monday, and so on...). In addition, one can add an optional
2313 argument SKIP-WEEKS to indicate weeks on the calendar that should be
2314 skipped. This argument should be expressed as an ISO week number. You
2315 can find the number by invoking emacs' built-in calendar (=M-x
2316 calendar=), navigating to the appropriate week, and typing =p c=
2317 (calendar-iso-print-date).
2319 ** How can I set an event to occur every day except Saturday and Sunday?
2321    #+begin_example
2322    ** Daily meeting
2323       <%%(memq (calendar-day-of-week date) '(1 2 3 4 5))>
2324    #+end_example
2326 * Export
2327   :PROPERTIES:
2328   :CUSTOM_ID: Export
2329   :END:
2330 ** Can I get TODO items exported to HTML as lists, rather than as headlines?
2331    :PROPERTIES:
2332    :CUSTOM_ID: export-TODO-items-as-lists
2333    :END:
2335    If you plan to use ASCII or HTML export, make sure things you want to
2336    be exported as item lists are level 4 at least, even if that does
2337    mean there is a level jump.  For example:
2339    : * Todays top priorities
2340    : **** TODO write a letter to xyz
2341    : **** TODO Finish the paper
2342    : **** Pick up kids at the school
2344    Alternatively, if you need a specific value for the heading/item
2345    transition in a particular file, use the =#+OPTIONS= line to
2346    configure the H switch.
2348    : #+OPTIONS:   H:2; ...
2350 ** Can I export only a single subtree?
2351    :PROPERTIES:
2352    :CUSTOM_ID: export-single-subtree
2353    :END:
2355    If you want to export a subtree, mark the subtree as region and then
2356    export.  Marking can be done with =C-c @ C-x C-x=, for example.
2358 ** How can I tell my calendar web application about appointments in my agenda files?
2360 Here is what you need to do:
2362 1. a script that calls Emacs in batch mode and produce a .ics file
2363 2. a script that uploads this .ics file somewhere on the web
2364 3. tell your webapp to fetch this .ics file on the web
2366 Here is the script I use for the first step:
2368 #+begin_src shell-script-mode
2369 #!/bin/bash
2371 /usr/local/bin/emacs --batch --eval \
2372 "(progn (load-file \"~/install/git/org-mode/org.el\") \
2373         (load-file \"~/elisp/config/org-batch-config.el\") \
2374         (setq org-combined-agenda-icalendar-file \"~/org/cal/org.ics\")
2375         (setq org-agenda-files (quote (\"~/org/bzg.org\"))))" \
2376     -f org-export-icalendar-combine-agenda-files
2377 #+end_src
2379 Depending on your configuration, you might change the load sequence.
2381 Here is the script I use for the second step:
2383 #+begin_src shell-script-mode
2384 #!/bin/bash
2385 /usr/bin/rsync -rtv ~/org/org.ics -e ssh me@my_server:/home/me/public_html/
2386 #+end_src
2388 Note: if you want to cron this rsync script, you will need to let
2389 =my_server= to know about your SSH public key.  Check [[http://troy.jdmz.net/rsync/index.html][this page]] as a
2390 starter.
2392 Now you can cron the two scripts above and your webapp will always be
2393 up to date with your Org agendas.
2395 Also see [[http://orgmode.org/org.html#Exporting-Agenda-Views][Exporting agenda views]] from Org manual.
2397 ** How can I get Mac OSX 10.3 iCal to import my Org-exported .ics files?
2398    :PROPERTIES:
2399    :CUSTOM_ID: iCal-import-ics-files-old
2400    :END:
2402    When using iCal under Apple MacOS X Tiger, you can create a new
2403    calendar /OrgMode/ (the default name for the calendar created by =C-c
2404    C-e c=, see the variables =org-icalendar-combined-name= and
2405    =org-combined-agenda-icalendar-file=).  Then set Org-mode to
2406    overwrite the corresponding file /~/Library/Calendars/OrgMode.ics/.
2407    You may even use AppleScript to make iCal re-read the calendar files
2408    each time a new version of /OrgMode.ics/ is produced.  Here is the
2409    setup needed for this:
2411    : (setq org-combined-agenda-icalendar-file
2412    :     "~/Library/Calendars/OrgMode.ics")
2413    : (add-hook 'org-after-save-iCalendar-file-hook
2414    :  (lambda ()
2415    :   (shell-command
2416    :    "osascript -e 'tell application \"iCal\" to reload calendars'")))
2418 ** How can I get Mac OSX 10.4 or later iCal to import my Org-exported .ics files?
2419    :PROPERTIES:
2420    :CUSTOM_ID: iCal-import-ics-files-new
2421    :END:
2423    For Mac OS X 10.4, you need to write the ics file to
2424    =/Library/WebServer/Documents/= and then subscribe iCalendar to
2425    =http: //localhost/orgmode.ics=
2427 ** How can I remove timestamps and todo keywords from my exported file?
2428    :PROPERTIES:
2429    :CUSTOM_ID: export-options-remove-timestamps
2430    :END:
2432 You can place an options line at the top of your org file:
2434 : #+OPTIONS: <:nil todo:nil
2436 There is a whole host of export options you can set with an in-buffer
2437 options or via global variables. See [[http://orgmode.org/manual/Export-options.html#Export-options][this section]] of the manual for a
2438 full list.
2440 ** How can I preserve faces when I export an agenda from the command line?
2441    :PROPERTIES:
2442    :CUSTOM_ID: preserving-faces-during-batch-export
2443    :END:
2445 Normally, when you export an org file or an agenda view from within
2446 emacs, htmlize will convert your face definitions to direct color css
2447 styles inlined into each =<span>= object, resulting in an HTML output
2448 that preserves the general look of your Org buffers and agenda views.
2450 Let's say you generate an export from the command line, such as the
2451 following:
2453 : emacs -batch -l ~/.emacs -eval '(org-batch-agenda "e")'
2457 : emacs -batch -l ~/.emacs -eval '(org-publish-all)'
2459 In such an instance, the exported HTML will contain only very basic
2460 color styles. The reason is that when Emacs is run in batch mode, it
2461 does not have a display and therefore only rudimentary face
2462 definitions.  If you'd like to use more complex styles, you'll have to
2463 make sure that the export process only assigns classes instead of
2464 direct color values.  This can be done by binding the variable
2465 =org-export-htmlize-output-style= to =css= for the duration of the
2466 export, for example with
2468 : emacs -batch -l ~/.emacs
2469 :   -eval '(let ((org-export-htmlize-generate-css (quote css)))
2470 :            (org-batch-agenda "e"))'
2472 Then you can use a style file to make these classes look any way you
2473 like.  To generate face definitions for a CSS file based on any faces
2474 you are currently using in Emacs, you can use the following command:
2476 : M-x org-export-htmlize-generate-css RET
2478 This will generate a =<style>...</style>= section, the content of
2479 which you can add to your style file.
2481 ** How can I avoid dark color background when exporting agenda to ps format?
2482    :PROPERTIES:
2483    :CUSTOM_ID: avoiding-dark-background-when-exporting-agenda
2484    :END:
2486 Add this to your .emacs and evaluate it.
2488 #+BEGIN_SRC emacs-lisp
2489   (setq org-agenda-exporter-settings
2490         '((ps-print-color-p 'black-white)))
2491 #+END_SRC
2493 ** How can I get colored source code when exporting to LaTeX?
2494    :PROPERTIES:
2495    :CUSTOM_ID: fontified_source_code_w_latex
2496    :END:
2498 As of Sun Aug 9 2009 the "current" version of Org-mode (see
2499 [[keeping-current-with-Org-mode-development]]) supports exporting source
2500 code to LaTeX using the listings package.
2502 To turn on listing export add the following to your Org-mode
2503 customization.
2504 #+begin_src emacs-lisp
2505   ;; requite org-latex so that the following variables are defined
2506   (require 'org-latex)
2507   
2508   ;; tell org to use listings
2509   (setq org-export-latex-listings t)
2510   
2511   ;; you must include the listings package
2512   (add-to-list 'org-export-latex-packages-alist '("" "listings"))
2513   
2514   ;; if you want colored source code then you need to include the color package
2515   (add-to-list 'org-export-latex-packages-alist '("" "color"))
2516 #+end_src
2518 The listings package will now be used to fontify source code in your
2519 LaTeX documents.  By default listings will not color any of your
2520 source code.  If you would like to set colors for keywords and
2521 comments in your latex documents you can do so using LaTeX directives
2522 like the following.
2523 #+begin_src latex
2524   \lstset{keywordstyle=\color{blue},
2525     commentstyle=\color{red},
2526     stringstyle=\color{green}
2527   }
2528 #+end_src
2530 of if you want to get even fancier with your colors you can try
2531 something like the following
2532 #+begin_src latex
2533 \definecolor{keywords}{RGB}{255,0,90}
2534 \definecolor{comments}{RGB}{60,179,113}
2535 \definecolor{fore}{RGB}{249,242,215}
2536 \definecolor{back}{RGB}{51,51,51}
2537 \lstset{
2538   basicstyle=\color{fore},
2539   keywordstyle=\color{keywords},  
2540   commentstyle=\color{comments},
2541   backgroundcolor=\color{back}
2543 #+end_src
2545 For more complex listings use cases consult the [[ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/listings/listings.pdf][listings manual]].
2547 ** How can I export to Latex Beamer
2548    :PROPERTIES:
2549    :CUSTOM_ID: beamer
2550    :END:
2551 The latex [[http://latex-beamer.sourceforge.net/][Beamer Class]] is a useful class for generating slide shows.
2552 The following can be used to export Org-mode documents to LaTeX
2553 beamer.
2555 Add the following to your Emacs initialization file.
2556 #+begin_src emacs-lisp
2557   (unless (boundp 'org-export-latex-classes)
2558     (setq org-export-latex-classes nil))
2559   (add-to-list 'org-export-latex-classes
2560                '("beamer"
2561                  "\\documentclass[11pt]{beamer}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{hyperref}\n\\usepackage{verbatim}\n"
2562                  ("\\section{%s}" . "\\section*{%s}")
2563                  ("\\begin{frame}\\frametitle{%s}" "\\end{frame}"
2564                   "\\begin{frame}\\frametitle{%s}" "\\end{frame}")))
2565 #+end_src
2567 Then by placing
2568 : #+LaTeX_CLASS: beamer
2569 in the header of your Org-mode document it will automatically export
2570 to the Beamer document class on LaTeX export.  With the above
2571 configuration top-level headers will be mapped to sections in the
2572 Beamer document, second-level headers will be mapped to frames, and
2573 lower level headlines will be mapped to itemize objects.
2575 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
2576 Thomas Dye]].  For a much more complex Beamer setup see the [[http://article.gmane.org/gmane.emacs.orgmode/17767/match=beamer+dokos][email by
2577 Thomas Dye]].
2579 ** How can I use RefTeX in Org-mode files for LaTeX export and in Org-babel LaTeX code blocks?
2581 [[http://www.gnu.org/software/auctex/reftex.html][RefTeX]] is an indispensable tool for the author of LaTeX documents.  It
2582 aids in creation of bibliographies, cross-references, indexes, and
2583 glossaries.  RefTeX understands the structure of multi-file LaTeX
2584 documents and is able to collect from them information about the
2585 location(s) of external data stores used in creation of the final
2586 document.  RefTeX was written by Carsten Dominik and is currently
2587 being maintained by the [[http://www.gnu.org/software/auctex/index.html][AucTeX]] project.
2589 *** Using RefTeX In Org-mode Files for LaTeX Export
2590 In Org-mode files for LaTeX export, the trick is to find a way to tell
2591 RefTeX the locations of external data stores.  One way is to set the
2592 variable, =reftex-default-bibliography=.  Add lines like these to
2593 .emacs:
2595 #+begin_src emacs-lisp 
2596   (setq reftex-default-bibliography
2597         (quote
2598          ("default.bib" "other-default.bib")))       
2599 #+end_src
2601 In practice, this is a limited solution and the
2602 typical user will want to pass this information on a per-file basis.
2603 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
2604 Braindump]].  
2606 The first solution, proposed by Mario, enables the RefTeX citation
2607 function in Org-mode.  Add these lines to .emacs:
2609 #+begin_src emacs-lisp
2610   (defun org-mode-reftex-setup ()
2611     (load-library "reftex")
2612     (and (buffer-file-name)
2613          (file-exists-p (buffer-file-name))
2614          (reftex-parse-all))
2615     (define-key org-mode-map (kbd "C-c )") 'reftex-citation))
2616   (add-hook 'org-mode-hook 'org-mode-reftex-setup)
2617 #+end_src
2619 Then add the following lines anywhere in the Org-mode file (Org-mode
2620 will recognize them as LaTeX commands):
2622 #+begin_src org
2623 \bibliographystyle{plain}
2624 \bibliography{BIB-NAME}
2625 #+end_src
2627 With this setup, =C-c )= will invoke =reftex-citation= which will
2628 insert a reference in the usual way:
2630 #+begin_src org
2631   ,* test reftex
2632   
2633   ,This is a citation \cite{tierney90}.
2634   
2635   ,\bibliographystyle{plain}
2636   ,\bibliography{tsd}
2637 #+end_src
2639 This Org-mode file will export the following LaTeX output:
2641 #+begin_src latex :exports code
2642   % Created 2010-03-22 Mon 14:34
2643   \documentclass[11pt,letter]{article}
2644   \usepackage[utf8]{inputenc}
2645   \usepackage[T1]{fontenc}
2646   \usepackage{hyperref}
2647   
2648   \title{test.org}
2649   \author{Tom Dye}
2650   \date{2010-03-22 Mon}
2651   
2652   \begin{document}
2653   
2654   \maketitle
2655   
2656   \setcounter{tocdepth}{3}
2657   \tableofcontents
2658   \vspace*{1cm}
2659   
2660   \section{test reftex}
2661   \label{sec-1}
2662   
2663   
2664   This is a citation \cite{tierney90}.
2665   
2666   \bibliographystyle{plain}
2667   \bibliography{tsd}
2668   
2669   \end{document}
2670 #+end_src
2673 A second solution, to activate the RefTeX minor mode on a per-file
2674 basis, was posted by Kevin Brubeck Unhammer in response to this idea.
2675 Add the following lines to .emacs:
2677 #+begin_src emacs-lisp
2678   (add-hook ‘org-mode-hook
2679              (lambda ()
2680                (if (member “WRITE” org-todo-keywords-1)
2681                    (org-mode-article-modes))))
2682 #+end_src
2684 where =org-mode-article-modes= is defined as follows:
2686 #+begin_src emacs-lisp
2687   (defun org-mode-article-modes ()
2688     (reftex-mode t)
2689     (bib-cite-minor-mode t)
2690     (and (buffer-file-name)
2691          (file-exists-p (buffer-file-name))
2692          (reftex-parse-all)))
2693 #+end_src
2695 Add the =\bibliographystyle{}= and =\bibliography{}= lines to the
2696 Org-mode file as before and define a TODO keyword, =WRITE=, perhaps
2697 like this:
2699 #+begin_src org
2700   ,#+TODO: TODO(t) STARTED(s) WRITE | DONE(d) DEFERRED(f)
2701 #+end_src
2703 With this setup, you insert a citation with =M-x reftex-citation RET=.
2705 *** Using RefTeX in Org-babel LaTeX Code Blocks
2707 In Org-babel LaTeX code blocks, the trick is to give RefTeX access to
2708 information in other Org-babel LaTeX code blocks.  If you use an Emacs
2709 starter kit where configuration information is held in Org-mode files,
2710 then the second solution is preferable because you won't be asked for
2711 a master file when Emacs is started.  For this reason, the second
2712 solution is modified for use with Org-babel latex code blocks.  No
2713 key-binding is needed here because Org-babel code blocks are edited
2714 within the usual AucTeX environment.
2716 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]])
2717 #+begin_src emacs-lisp
2718   (defun org-mode-article-modes ()
2719     (reftex-mode t)
2720     (and (buffer-file-name)
2721          (file-exists-p (buffer-file-name))
2722          (reftex-parse-all)))
2723   
2724   (add-hook 'org-mode-hook
2725             (lambda ()
2726               (if (member "REFTEX" org-todo-keywords-1)
2727                   (org-mode-article-modes))))
2728 #+end_src
2730 Then add a line like the following line to the top of your org-mode file:
2732 #+begin_src org
2733   ,#+TODO: TODO(t) STARTED(s) | DONE(d) DEFERRED(f) REFTEX
2734 #+end_src
2736 When you open an org-mode file with a line like this, RefTeX will
2737 prompt for the master .tex file, which will be parsed in the usual
2738 way.  This means that the .tex file should already exist, perhaps by
2739 tangling the LaTeX preamble and postamble, before
2740 =org-mode-article-modes= is activated for the Org-mode file.
2742 * MobileOrg
2744 ** Which versions of MobileOrg do exist
2745    :PROPERTIES:
2746    :CUSTOM_ID: mobileorg_versions
2747    :END:
2749 - MobileOrg for the iPhone/iPod Touch/iPad series of devices, by
2750   Richard Moreland.  Check out
2751   [[http://mobileorg.ncogni.to/][Richard's page]]
2752 - Matt Jones is developing a feature-equivalent application for
2753   Android, see
2754   [[http://wiki.github.com/matburt/mobileorg-android/][his project page]].
2756 ** What can I do if I don't want to use Dropbox.com
2757    :PROPERTIES:
2758    :CUSTOM_ID: mobileorg_webdav
2759    :END:
2761 Dropbox.com is the easiest way to connect between Emacs and MobileOrg,
2762 you can get a free account there.  If for some reason you cannot or do
2763 not want to use this path, you can use any webdav server.  On this
2764 webdav server you need to create a dedicated directory for the
2765 communication between Emacs and MobileOrg.  If you can mount that
2766 directory locally so that Emacs can directly write to it, just point
2767 to that directory using the variable =org-mobile-directory=.  Using
2768 the /tramp/ method, =org-mobile-directory= may point to a remote
2769 directory accessible through, for example, /ssh/ and /scp/:
2771 #+begin_src emacs-lisp
2772 (setq org-mobile-directory "/scpc:user@@remote.host:org/webdav/")
2773 #+end_src
2775 If Emacs cannot access the WebDAV directory directly using a /tramp/
2776 method, you can use a local directory for staging.  Other means must
2777 then be used to keep this directory in sync with the WebDAV directory.
2778 In the following example, files are staged in =~/stage/=, and Org-mode
2779 hooks take care of moving files to and from the WebDAV directory using
2780 /scp/.
2782 #+begin_src emacs-lisp
2783 (setq org-mobile-directory "~/stage/")
2784 (add-hook 'org-mobile-post-push-hook
2785   (lambda () (shell-command "scp -r ~/stage/* user@@wdhost:mobile/")))
2786 (add-hook 'org-mobile-pre-pull-hook
2787   (lambda () (shell-command "scp user@@wdhost:mobile/mobileorg.org ~/stage/ ")))
2788 (add-hook 'org-mobile-post-pull-hook
2789   (lambda () (shell-command "scp ~/stage/mobileorg.org user@@wdhost:mobile/")))
2790 #+end_src
2792 * COMMENT HTML style specifications
2794 #+begin_src emacs-lisp
2795   (defun org-faq-make-target ()
2796     "Make hard target for current headline."
2797     (interactive)
2798     (if (not (org-on-heading-p))
2799         (error "Not on a headline"))
2800     (let ((h (org-trim (org-get-heading 'no-tags))))
2801       (if (string-match "[ \t]*\\?\\'" h)
2802           (setq h (replace-match "" t t h)))
2803       (while (string-match "[ \t]+" h)
2804         (setq h (replace-match "-" t t h)))
2805       (org-entry-put nil "CUSTOM_ID" h)))
2806 #+end_src