Fix typos and improve layout
[Worg.git] / org-faq.org
blobbeda8f14954f03019c7d15a0a2c3cce484c85c62
1 #+EMAIL:     mdl AT imapmail DOT org
2 #+AUTHOR:    Worg people
3 #+LANGUAGE:  en
4 #+TITLE:     Org-mode Frequently Asked Questions
5 #+OPTIONS:   toc:t H:2
7 [[file:index.org][{Back to Worg's index}]]
9 * Latest questions on StackOverflow
11 #+begin_html
12 <script language="JavaScript" src="http://feed2js.org//feed2js.php?src=http%3A%2F%2Fstackoverflow.com%2Ffeeds%2Ftag%3Ftagnames%3Dorg-mode%26sort%3Dnewest&chan=title&num=5&utf=y"  charset="UTF-8" type="text/javascript"></script>
14 <noscript>
15 <a href="http://feed2js.org//feed2js.php?src=http%3A%2F%2Fstackoverflow.com%2Ffeeds%2Ftag%3Ftagnames%3Dorg-mode%26sort%3Dnewest&chan=title&num=5&utf=y&html=y">View RSS feed</a>
16 </noscript>
17 #+end_html
19 * What is org-mode?
20   :PROPERTIES:
21   :CUSTOM_ID: What-is-org-mode
22   :END:
23 ** Can Org-mode do "x"? Does org have "x" feature?
24    :PROPERTIES:
25    :CUSTOM_ID: can-org-do-x
26    :END:
28 In its default setup, Org-mode offers a simple outlining and task
29 management environment. But it also has a huge number of features and
30 settings "under the hood." Advanced users have configured Org-mode for
31 almost every conceivable use scenario.
33 Org-mode has a very active community and rich and extensive
34 documentation. Before emailing the mailing list to ask whether
35 Org-mode has a particular feature or setting, please consult the
36 following:
38  - Read/search the manual.
40    - http://orgmode.org/manual/index.html
42      - Make sure to check out the following indexes:
44        - [[http://orgmode.org/manual/Main-Index.html#Main-Index][Main Index]]
45        - [[http://orgmode.org/manual/Key-Index.html#Key-Index][Key Index]]
46        - [[http://orgmode.org/manual/Variable-Index.html#Variable-Index][Variable Index]]
48    - The manual is also easily available from within emacs.
50      To read the manual within emacs, you can evaluate =(info
51      "(org)")= within emacs---i.e., type =C-x C-e= after the closing
52      paragraph of the info expression above.
54      You can also type =M-x info= and navigate to "Org Mode".
56      You can search the entire manual by typing ~C-s term~. Keep
57      pressing ~C-s~ to cycle through the results
59  - Search the [[http://dir.gmane.org/gmane.emacs.orgmode][mailing list archives]].
61    There is a good chance that the feature you are looking for has
62    already been discussed (most likely several times).
64  - Check for features from within emacs.
66    - Emacs has a wonderful built-in help system.
68    - You can browse (and change) most customization options by typing
69      =M-x org-customize=.
71    - You can check for a feature by typing =M-x apropos [RET] [word]= or
72      =C-h a word=. This will search for all functions and variables
73      matching the term (or regexp) you enter.
75    - You can browse (and search for) org functions, variables, and
76      faces by using =M-x describe-variable= (=C-h v=), =M-x
77      describe-function= (=C-h f=), or =M-x describe-face=.
79      After invoking one of these commands, simply type =org-[TAB]= to
80      see a full list of relevant functions or variables or faces. You
81      can then drill down further: e.g., =org-export-[TAB]= for export
82      features.
84  - Checkout the [[file:org-tutorials/index.org][tutorials on Worg]].
86    Several of these tutorials discuss advanced features (e.g.,
87    searching, custom agenda commands, tables, publishing) of Org-mode
88    in depth.
90    There are many other resources on Worg as well:
92    - [[http://orgmode.org/worg/org-configs/index.html][Org Customization]] :: Includes a guide for beginners.
94    - [[http://orgmode.org/worg/org-hacks.html][Org Hacks]] :: User-generated modifications and add-ons.
96    - [[http://orgmode.org/worg/org-glossary.html][Org Glossary]] :: An explanation of basic Org-mode terms and
97                      concepts.
99 ** Can I implement a GTD workflow with Org-mode?
100    :PROPERTIES:
101    :CUSTOM_ID: GTD-workflow-with-Org-mode
102    :END:
104    Yes, you can.  Check for discussions and pointers [[http://orgmode.org/worg/org-gtd-etc.html][here]].
106 ** What is the difference between Org and TaskPaper?
107    :PROPERTIES:
108    :CUSTOM_ID: Org-and-TaskPaper
109    :END:
111   There is really no difference.  Org is as /simple/ as [[http://hogbaysoftware.com/products/taskpaper][TaskPaper]].  It
112   is just that, when using Org within Emacs, it lets you do many things
113   that you wouldn't be able to do with TaskPaper.  Yes, TaskPaper is
114   fiddle-proof and people using Emacs tends to like fiddling (which is
115   orthogonal to the idea of using todo-list efficiently), but this is
116   just a matter of discipline and common sense, not one of Org's design.
118   Read [[http://article.gmane.org/gmane.emacs.orgmode/6224][Carsten's enlightening statement]] on this.
119 ** What is the meaning of the Unicorn on Org's website?
120    :PROPERTIES:
121    :CUSTOM_ID: unicorn
122    :END:
124 The Unicorn is the logo of Org-mode because:
126 - Org-mode is the UNICs of ORgaNizers.
128 - Org-mode is an Emacs mode, so it makes sense to use an animal
129   similar or related to the gnu used for GNU Emacs.
131 - Org-mode is meant to show you the way, and an animal with two horns
132   can not do this very well, can it?
134 - Unicorn tears are said to reverse petrification, and wasn't this how
135   we all felt before getting to some degree of time and task
136   management?
138 - It will take forever to learn everything there is to know about a
139   unicorn.
141 - A unicorn is a fabulous creature.  Org-mode wants to be a fabulous
142   creation.
144 Using a unicorn was originally /Bastien Guerry's/ idea.  His friend,
145 the french artist [[http://intemperies.over-blog.com/][Christophe Bataillon]], designed the logo for us, and
146 /Greg Newman/ gave it a refresh some time later.  Bastien writes why
147 he chose a unicorn:
149 #+BEGIN_QUOTE
150 The first reason is not linked to the animal, but to the sounding of the
151 word "Unicorn" - because Org gives you a /uni/que way of producing files
152 in several format (HTML, LaTeX, etc.)
154 The second reason is that a Unicorn doesn't really exist, it is just
155 something you can dream about, and make others believe it does exist.
156 Just like the perfect organizer.
157 #+END_QUOTE
159 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
160 Suckling]] posted a link showing how to make a simple foldable unicorn
161 (very appropriate for an outlining program!).
163 [[http://article.gmane.org/gmane.emacs.orgmode/11735][Tim Burt]] made a very complicated one which is now a treasured
164 possession of the Org-mode author.
166 - Official logo: [[http://orgmode.org/img/org-mode-unicorn.png]]
167   This logo is available in a number of different formats including
168   Photoshop /.psd/ and scaleable vector graphics /.svg/ [[http://orgmode.org/img/][here]].
170 - An [[http://orgmode.org/img/nrocinu4.jpg][alternative version]] from Christophe Bataillon (c):
172 - [[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]]:
174 - [[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
175   threshold technique".
177 - [[http://article.gmane.org/gmane.emacs.orgmode/11735/match%3D][Tim Burt]] made a folded Unicorn to match the spirit of Org - see the
178   whole set of pictures [[http://www.flickr.com/photos/tcburt/sets/72157614543357071/][on his flickr page]].
180 - Are unicorns real?  Answer [[http://article.gmane.org/gmane.emacs.orgmode/11687/match%3Drosslaird%2Bunicorn][here]] by Ross Laird.
182 ** Is Org's documentation written in Org?
184 No.  Org's documentation is written in TeXinfo, which is the standard
185 format for Emacs documentation.  There is no export mechanism from Org
186 to TeXinfo (yet).
187 * Mailing list
188 ** I think my Org-mode is broken! How do I report a bug?
189    :PROPERTIES:
190    :CUSTOM_ID: bug-reporting
191    :END:
193  1. Make sure you are running [[#updating-org][the latest version of Org-mode]].
195  2. Read [[http://orgmode.org/manual/Feedback.html][this section]] of the manual.
197  3. Provide a minimal example that duplicates the bug.
199     - Create a minimal .emacs file and start emacs with that file as
200       detailed in [[#minimal-emacs][these instructions]].
202     - Create a sample, minimal .org file that reliably reproduces the
203       problem and post it to the mailing list.
205       - Some users call this an "[[#ecm][ECM]]", a French acronym that means a
206         "minimal complete example".
208 ** What is an "ECM"?
209    :PROPERTIES:
210    :CUSTOM_ID: ecm
211    :END:
213 This is a French acronym used by some mailing list members; it stands
214 for "Exemple Complet Minimal", or "Complete Minimal Example". The term
215 refers to test files that can reliably reproduce a bug with the
216 minimal amount of code. When you report a bug to the mailing list, you
217 should provide a minimal .org file (with no more text than necessary)
218 that demonstrates the bug. See [[http://permalink.gmane.org/gmane.emacs.orgmode/41281][this post]] for more information.
220 ** What should I do before contacting the mailing list?
221    :PROPERTIES:
222    :CUSTOM_ID: when-to-contact-mailing-list
223    :END:
225    The Org-mode mailing list is a high volume list, in which community
226    members discuss use cases, configuration, bugs, and developments.
228    If you are new to Org-mode, please read/search the excellent [[http://orgmode.org/manual/index.html][manual]]
229    (and pay special attention to the indexes) before asking your
230    question.
232    You should also [[http://dir.gmane.org/gmane.emacs.orgmode][search the mailing list]] to see if your issue has
233    already been discussed.
235    See [[#can-org-do-x][this faq]] for more details.
237 ** Why hasn't my email to the mailing list shown up yet?
238    :PROPERTIES:
239    :CUSTOM_ID: ml-post-delay
240    :END:
242 The org-mode mailing list is moderated. Thus, if you are not
243 subscribed to the mailing list, your mail will only appear on the list
244 after it has been approved by a moderator. To ensure that your mail
245 appears quickly, please [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe to the list]].
247 ** I read the mailing list through gmane. Should I subscribe?
248    :PROPERTIES:
249    :CUSTOM_ID: ml-subscription-and-gmane
250    :END:
252 The org-mode mailing list is available via nntp at [[http://dir.gmane.org/gmane.emacs.orgmode][Gmane]]. Many
253 participants in the list prefer read the list in a newsreader, such as
254 Gnus, instead of receiving emails. If you choose to read the list via
255 nntp, you can still [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe]] to the list and then opt not to receive
256 any emails on the mailman settings page (see the "Mail Delivery"
257 setting).
259 This will ensure that your messages to the list get through quickly,
260 reduce the work load of the mailing list moderators (who need to clear
261 every mail from non-members), and provide more accurate information
262 about the number of list readers.
264 * Keeping current
265   :PROPERTIES:
266   :CUSTOM_ID: Keeping-current
267   :END:
268 ** My Emacs ships with an older version Org-mode! How do I upgrade?
269    :PROPERTIES:
270    :CUSTOM_ID: updating-org
271    :END:
273 Org-mode develops quickly, which means that versions of Org-mode
274 shipped with Emacs are more or less out-of-date. If you'd like to
275 upgrade to the most recent version of org-mode, you have a number of
276 options.
278  1. Download the [[http://orgmode.org/index.html#sec-3][most recent release]] of org-mode as zip or tarball and
279     follow the [[http://orgmode.org/manual/Installation.html#Installation][installation instructions]] in the manual.
280  2. Clone and install the development git repository as [[#keeping-current-with-Org-mode-development][explained
281     here]]. If you don't want to run the bleeding edge, you can still
282     use git [[#using-stable-releases-only][to track the most recent stable releases]].
283  3. Install and updated org-mode automatically through the Emacs
284     Package Manager as [[#installing-via-elpa][explained in this FAQ]].
286 ** How do I keep current with bleeding edge development?
287    :PROPERTIES:
288    :CUSTOM_ID: keeping-current-with-Org-mode-development
289    :END:
291    Org mode is developed in [[http://en.wikipedia.org/wiki/Git_(software)][Git]]. You can keep up-to-date with Org-mode
292    developement by cloning Org mode repository and refreshing your
293    copy with latest changes whenever you wish. You only need to use
294    two Git commands (clone and pull.) Here are the steps in brief
295    (please customize locations to suit your setup):
297    1. Select a location to house the Org mode repository (approx. 40
298       MB; includes documentation, compiled elisp files and history
299       going all the way back to v4.12a)
301       : $ mkdir $HOME/elisp && cd $HOME/elisp
303    2. Clone the Org mode Git repository.
305       Recommended approach:
307       : $ git clone git://orgmode.org/org-mode.git
309       You can also clone from this mirror (lagging one hour behind
310       orgmode.org repo):
312       : $ git clone git://repo.or.cz/org-mode.git
314       For those of you behind a firewall that allows only HTTP, you can
315       clone like this (can be somewhat slow), either from orgmode.org or
316       from repo.or.cz:
318       : $ git clone http://orgmode.org/org-mode.git
319       : $ git clone http://repo.or.cz/r/org-mode.git
321    3. Compile and install Org mode and build documentation.
323       : $ cd org-mode && make && make doc && make install
325       Please note that you can choose to /not/ compile at all and run
326       using source =.el= files only.  Compiled files speed things up.
328       Also note that running =make install= is necessary only if you'd
329       like to install org-mode system-wide.
331    4. This is where you configure Org mode with Emacs.  Please refer
332       to [[./org-tutorials/index.org][Org tutorials]].
334    5. Keeping up-to-date.
336       Cloning the repository is a one time activity.  From this point
337       onwards you only need to /pull/ the latest changes.
339       : $ cd $HOME/elisp/org-mode
341       and then
343       : $ git pull && make clean && make && make doc && make install
345    6. You should restart org mode to have the changes take effect (if
346       you are not rebooting Emacs.)  Also since the intention is to
347       "keep up" with Org mode, you should visit updated sections of
348       documentation for latest updates (use =git log=.)
350    7. As you use your repository over time it will accumulate loose objects.
351       You can reduce the total size of your git repository with
353       : $ git gc
355       which will consolidate loose git objects into pack files.  This
356       reduces the size of the repository and speeds up data access to
357       the objects.
359 ** How do I update the info manual pages to the latest org-mode version?
360    :PROPERTIES:
361    :CUSTOM_ID: update-info-manual-to-latest
362    :END:
364    Since org-mode already ships with Emacs, a rather common problem
365    among users is "How do I update the info documentation to the
366    latest version of org-mode?". There are three ways to achieve this:
368    1. You can set the =INFOPATH= environment variable in your login
369       script like this:
371       #+begin_src shell-script :eval no
372         # ~/.bash_profile
373         export INFOPATH=/path/to/org-mode/info:$INFOPATH
374         ...
375       #+end_src
377       =/path/to/org-mode/info= is wherever you install org-mode.
379    2. You can achieve the same with elisp like this:
381       #+begin_src emacs-lisp :eval no
382         ;; Info directory
383         (add-to-list 'Info-default-directory-list
384                      (expand-file-name "/path/to/org-mode/info"))
385       #+end_src
387    3. You can also specify this in the Makefile while installing
388       org-mode like this:
390       #+begin_src makefile-gmake :eval no
391         # Where local software is found
392         prefix=/path/to/emacs-root
393         ...
394         # Where info files go.
395         infodir = $(prefix)/share/info
396       #+end_src
398       After you install org-mode with =make install=, you can now
399       install the new info files with =make install-info=. Note that
400       this method _overwrites_ the old org-mode info files that is
401       distributed with your version of GNU Emacs.
403 ** How can I keep local changes and still track Org mode development?
404    :PROPERTIES:
405    :CUSTOM_ID: keeping-local-changes-current-with-Org-mode-development
406    :END:
408   Say you want to make minor changes to the Makefile to reflect your
409   location for =emacs=.
411   Create a local branch for your changes on top of origin/master as
412   follows:
414   : $ git checkout -b local origin/master
415   : $ git config branch.local.rebase true
416   : # Make your changes to the Makefile and create a new commit
417   : $ git add Makefile
418   : $ git commit -m 'My local Makefile configurations'
419   : # Update git to a newer version
420   : $ git pull
422   Now each time you pull new commits from the distribution repository
423   your local commits will be rewound and replayed on top of the new
424   origin/master.
426 -----------
428   You would normally work on your =local= branch which includes your
429   custom commits; there's no need to switch back to the =master=
430   branch.
432 -----------
434 Here is an example of dealing with conflict resolution during git pull.
436 If you get a conflict during a =git pull= you will need to edit the
437 file with the conflict to fix up the conflicting lines and then tell
438 git that you have resolved the conflict.
440 Conflict resolution goes something like this:
442 1. =git pull= fails with a conflict
443 2. edit the file
444 3. =git add= the file to mark the conflict resolved
445 4. =git rebase --continue=
446 5. lather, rinse, and repeat 2-4 as needed
448 For this example we have the following Makefile:
450 : #
451 : # Example Makefile
452 : #
454 : EMACS=emacs
456 : VERSION=V1.0
458 and we need to change the =EMACS=emacs= line to =EMACS=myemacs= to
459 make it work well on our system.
461 To do this we
463   - create a local branch for our work
465     : $ git checkout -b local origin/master
466     : $ git config branch.local.rebase true
468     This marks the branch so that all local commits on it are rebased
469     on top of any new commits we get in origin/master during a =git
470     pull= operation.
472   - Make our custom changes
474     Edit the makefile so it looks like this:
476     : #
477     : # Example Makefile
478     : #
479     :
480     : EMACS=myemacs
481     :
482     : VERSION=V1.0
484   - Create a commit with our custom changes
485     : $ git add Makefile
486     : $ git commit -m 'My local Makefile configurations'
488   - Later we do a =git pull= but that fails with conflicts.
490     : $ git pull
491     : remote: Counting objects: 5, done.
492     : ...
493     : Patch failed at 0001.
494     :
495     : When you have resolved this problem run "git rebase --continue".
496     : If you would prefer to skip this patch, instead run "git rebase --skip".
497     : To restore the original branch and stop rebasing run "git rebase --abort".
499   - Fix the conflict in your favourite editor
501     Conflict markers look like this:
503     : <<<<<<< HEAD:Makefile
504     : EMACS=emacs22
505     : =======
506     : EMACS=myemacs
507     : >>>>>>> Change emacs location:Makefile
509     This attempted =git pull= caused a conflict.  Fire up your
510     favourite editor and fix the conflict in the Makefile.  The
511     conflict markers are <<<<<<<<<< , ======= , and >>>>>>>>>>.  Fix
512     the Makefile appropriately and delete the conflict markers.  You
513     already edited these lines earlier so fixing it should be trivial.
515     In this case we changed =EMACS=emacs= to =EMACS=myemacs= and
516     upstream changed =EMACS=emacs= to =EMACS=emacs22=.  Just fix the
517     file and save it by deleting the conflict markers and keeping the
518     code you need (in this case the =EMACS=myemacs= line which we
519     originally modified.)
521   - Mark the file's conflict resolved
523     : $ git add Makefile
525     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.
527   - Continue the rebase operation
529     : $ git rebase --continue
531     If any other conflicts arise you fix them the same way - edit the file, mark the conflict resolved, and continue.
533 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"
534 using
535 : $ git rebase --abort
537 ** How can I use a stable release version instead of the bleeding edge master?
538    :PROPERTIES:
539    :CUSTOM_ID: using-stable-releases-only
540    :END:
542 The master branch of the git repository always contains the bleeding
543 edge development code.  This is important for Org's fast development,
544 because code on master gets checked out by many people daily and we
545 quickly receive bug reports if something is wrong.  On rare occasions,
546 this code may not function perfectly for a limited time while we are
547 trying to fix things.
549 Not everyone like to use this bleeding-edge code and face the danger
550 to hit a surprising bug.
552 Therefore, from time to time, we make a release.  This typically
553 happens when the maintainers feel that
555 1. they have reached a good point in the development
556 2. the code has a feature set that should stay and be supported in the
557    future
559 Stable releases are used as the basis for [[http://orgmode.org/index.html#sec-3_3][alternative distributions]] of
560 Org, and they are also the code that gets merged into the Emacs
561 distribution. If you want to work only with stable releases, you can
562 always download [[http://orgmode.org/index.html#sec-3][them here]], but you can also also use the git
563 repository to keep automatically up-to-date with the most recent
564 stable releases (and save bandwidth!). Here's how to do so:
566 *** Run a specific stable release
568 In the repository, do
570 : $ git fetch --tags
571 : $ git tag
573 To see which release tags are available.  Let's say you decide to use
574 =release_7.01f=.
576 : $ git checkout release_7.01f
578 This set the working tree of the repository to the state of Org at the
579 moment of release 7.01f.  You can then run Org from the repository be
580 sure to use the stable release while development continues on the
581 master branch.
583 Later, when we release 7.02, you can switch to that using
585 : $ git fetch --tags                   # to get all the new stuff
586 : $ git tag
587 : $ git checkout release_7.02
589 *** Always run the most recent stable release
591 Alternatively, if you just want to always run whatever the latest
592 stable release is, you can do
594 : $ git checkout -b stable origin/maint
596 and then regularly update this branch by doing
598 : $ git pull
600 ** How can I install an up-to-date version of org-mode without "make" tools?
601    :PROPERTIES:
602    :CUSTOM_ID: installing-org-without-make-tools
603    :END:
605 If you are using org-mode on a computer that lacks developer tools for
606 compiling software, such as [[http://www.gnu.org/software/make/][GNU Make]], you will have to use a
607 *different* installation method than [[http://orgmode.org/manual/Installation.html#Installation][the one outlined in the manual]].
609 Please see [[http://article.gmane.org/gmane.emacs.orgmode/15264][this thread]] on the mailing list for several different ways
610 you can install a recent version of org-mode without using the
611 customary =make clean && make && make install=.
613 The result of that discussion is the file/function found in
614 [[http://orgmode.org/worg/org-hacks.html#compiling-org-without-make]].
616 ** I don't use git. Can I download bleeding edge .zip and .tar.gz archives?
618    Yes. You can download [[http://orgmode.org/org-latest.zip][org-latest.zip]] or [[http://orgmode.org/org-latest.tar.gz][org-latest.tar.gz]] of Org-mode --
619    these archives are udpated every day at midnight.
621    Alternatively, you can download a [[http://orgmode.org/w/org-mode.git/snapshot][tar.gz snapshot from orgmode.org]].
623 ** How do I install Org-mode through Emacs' Package Manager?
624    :PROPERTIES:
625    :CUSTOM_ID: installing-via-elpa
626    :END:
628    Daily builds of Org-mode is distributed as an ELPA package from
629    both [[http://elpa.gnu.org/packages/][GNU Emacs Lisp Package Archive]] as well as from [[http://orgmode.org/pkg/daily/][Org-mode Emacs
630    Lisp Archive]].
632    Steps for installing Org with package manager:
633    1) Do =M-x list-packages= to browse available packages.
634    2) If the above command is unavailable you need to [[#installing-elpa][install the package
635       manager]] before proceeding ahead.
636    3) If you see =org= as an available package, skip to step 5.
637    4) If you are here it means that org is unavailable in the GNU's
638       archives.  Report this discrepancy to [[mailto:emacs-orgmode@gnu.org][Orgmode mailing list.]]
640       In the meanwhile, you can manually download the tarball and
641       install it. Refer [[Installing%20from%20ELPA-tar][this FAQ entry]] for further information.
642    5) Press =i= to mark the package for installation
643    6) Press =x= to install
644    7) Reload Emacs
645    8) Use =M-x locate-library RET org=. If your installation is
646       successful you would something like the following:
648       =Library is file ~/.emacs.d/elpa/org-20110403/org.elc=
650 #   7) If you get the following error "*Failed to download `Org-mode'
651 #      archive.*" in step 2, you can manually download the tarball and
652 #      install it. Refer [[Installing from ELPA-tar][this FAQ entry]] for more information.
654 #   8) Add Orgmode as a package archive. This can be done in two ways:
655 #   9) Use =M-x customize-variable RET package-archives=
656 #   10) Add the following line to your =.emacs= and reload Emacs.
657 #       #+begin_src emacs-lisp
658 #         (add-to-list 'package-archives '("Org-mode" . "http://orgmode.org/pkg/daily/"))
659 #       #+end_src
662 ** How do I install Emacs package manager?
663    :PROPERTIES:
664    :CUSTOM_ID: installing-elpa
665    :END:
667    If you are running Emacs 24 or find the command =M-x list-packages=
668    available you already have the package manager installed.
670    Steps for installing package manager on emacs-23:
671    1. Download the package manager [[http://repo.or.cz/w/emacs.git/blob_plain/1a0a666f941c99882093d7bd08ced15033bc3f0c:/lisp/emacs-lisp/package.el][package.el]]
673    2. Add the following to your =.emacs= and reload Emacs.
674       #+begin_src emacs-lisp
675         ;; change "~/elisp/" as appropiate
676         (setq load-path (cons "~/elisp" load-path))
678         ;; Add the below lines *at the end* of your .emacs. This
679         ;; ensures that packages installed with package manager
680         ;; overrides other local installation
681         (require 'package)
682         (package-initialize)
683       #+end_src
685 ** I don't see Org-mode as an installation option in Package Manager Menu?
686    :PROPERTIES:
687    :CUSTOM_ID: why-no-org-in-elpa
688    :END:
690    Emacs Package Manager is a very recent addition to Emacs. Work is
691    under way to have have Org-mode seamlessly integrate with Emacs'
692    Package Manager. As a result, it will be some time before the
693    Org-mode packages are available and usable from either GNU or
694    Org-mode package archives.
696    In the meanwhile, you can install Org-mode via package manager
697    through ELPA-compatible tar. Refer [[Installing from ELPA-tar][this FAQ entry]] for more information.
699 ** How do I install Org-mode from a ELPA-compatible tarball?
700    :PROPERTIES:
701    :CUSTOM_ID: installing-from-elpa-tarball
702    :END:
703 # <<Installing from ELPA-tar>>
705    Org-mode is distributed as an ELPA-compatible tar which can be used
706    in conjunction with Emacs' package manager.
708    1. If you are already running Org-mode, note the current version
709       reported by M-x org-version.
710    2. Download the latest tarball from [[http://orgmode.org/pkg/daily/][Org-mode repo]].
711    3. Do =M-x package-install-file=. When prompted for =Package file
712       name=, point it to .tar file downloaded in step 2.
714       You will now see Package Manager compiling the files and
715       installing it.
716    4. Reload emacs. This step is very important.
717    5. Note the version of the new installation using M-x
718       org-version. If the new and old versions are different, the
719       installation is done and you are all set to enjoy the updated
720       Org-mode. Otherwise skip to step 6.
721    6. Review you load-path using =C-h v load-path=. Most likely that
722       your old installation path takes precedence over the path chosen
723       by package manager (which is typically
724       =~/.emacs.d/elpa/...=). Fix this anamoly by moving
725       =(package-initialize)= line in .emacs to a more appropriate
726       location.
728    - Additional Note on =org-install.el= :: Functionality of Org-mode's
729      =org-install.el= is supplanted by Package Manager's
730      =org-autoloads.el=. Since Package Manager autoloads Org-mode for
731      you, the following line =(require 'org-install)= in your =.emacs=
732      is no longer required and can be safely removed.
734 ** Why would I use ELPA tarballs instead of the snapshot tarballs?
735    :PROPERTIES:
736    :CUSTOM_ID: why-elpa
737    :END:
739    ELPA-tarballs automate much the process of upgrading org-mode. Much
740    of the following grunt work is done automatically by the Package
741    Manager:
743    1. Downloading, compiling, and activating of org-mode (including
744       setting org-mode's =load-path= and autoloads).
745    2. Updating info files.
747 * Setup
748   :PROPERTIES:
749   :CUSTOM_ID: Setup
750   :END:
751 ** How can I quickly browse all Org options?
753 =M-x org-customize RET=
755 See also [[file:org-tutorials/org-customize.org][Carsten's Org customize tutorial]] and [[file:org-configs/org-customization-guide.org][this customization guide]]
756 for details.
758 ** Can I use the editing features of org-mode in other modes?
759    :PROPERTIES:
760    :CUSTOM_ID: use-editing-features-in-other-modes
761    :END:
763    Not really---but there are a few editing features you can use in
764    other modes.
766    - For tables there is =orgtbl-mode= which implements the table
767      editor as a minor mode. (To enable, type =M-x orgtbl-mode=)
768    - For ordered lists there is =orgstruct-mode= which allows for easy
769      list editing as a minor mode. (To enable, type =M-x
770      orgstruct-mode=)
772    You can activate these modes automatically by using hooks:
774    : (add-hook 'mail-mode-hook 'turn-on-orgtbl)
775    : (add-hook 'mail-mode-hook 'turn-on-orgstruct)
777    For footnotes, there is the function =org-footnote-action=, which
778    works in non-org buffers. This function is a powerful tool for
779    creating and sorting footnotes. To use it globally, you can add the
780    following keybinding to your =.emacs= file (requires Org 6.17 or
781    greater):
783    : (global-set-key (kbd "C-c f") 'org-footnote-action)
785    For other features you need to switch to Org-mode temporarily, or
786    prepare text in a different buffer.
788 ** Why isn't feature "X" working the way it is described in the manual?
789    :PROPERTIES:
790    :CUSTOM_ID: making-sure-org-mode-is-up-to-date
791    :END:
793 Org-mode develops very quickly. If you are using a version of Org-mode
794 that shipped with emacs, there is a good chance that it is somewhat
795 out of date.
797 Many of the users on the Org-mode mailing list are using either a
798 recent release of Org-mode or the
799 [[http://orgmode.org/index.html#sec-3.2][development version of
800 org-mode from the git repository]].
802 If some settings and features aren't working the way you expect, make
803 sure that the version of the manual you are consulting matches the
804 version of Org-mode you are using.
806    - You can check which version of Org-mode you are using by
807      selection =Org --> Documentation --> Show Version= in the Emacs
808      menu.
810    - The [[http://orgmode.org/manual/index.html][online manual]] at [[http://orgmode.org][orgmode.org]] corresponds to the most recent
811      release.
813    - 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
814      released with the latest official Gnu Emacs release. Compared
815      with the manual at the orgmode.org, the manual at www.gnu.org is
816      somewhat out of date.
818 For instructions on how to stay current with Org-mode, consult [[keeping-current-with-Org-mode-development][this
819 FAQ]] or follow the instructions on [[http://orgmode.org][the official Org-mode site]].
821 ** Can I get the visibility-cycling features in outline-mode and outline-minor-mode?
822    :PROPERTIES:
823    :CUSTOM_ID: use-visibility-cycling-in-outline-mode
824    :END:
826    Yes, these functions are written in a way that they are independent of
827    the outline setup.  The following setup provides standard Org-mode
828    functionality in outline-mode on =TAB= and =S-TAB=.  For
829    outline-minor-mode, we use =C-TAB= instead of =TAB=,
830    because =TAB= usually has mode-specific tasks.
832 #+BEGIN_SRC emacs-lisp
833 (add-hook 'outline-minor-mode-hook
834   (lambda ()
835     (define-key outline-minor-mode-map [(control tab)] 'org-cycle)
836     (define-key outline-minor-mode-map [(shift tab)] 'org-global-cycle)))
837 (add-hook 'outline-mode-hook
838   (lambda ()
839     (define-key outline-mode-map [(tab)] 'org-cycle)
840     (define-key outline-mode-map [(shift tab)] 'org-global-cycle)))
841 #+END_SRC
843 Or check out /outline-magic.el/, which does this and also provides
844 promotion and demotion functionality.  /outline-magic.el/ is
845 available at [[http://www.astro.uva.nl/~dominik/Tools/outline-magic.el][Outline Magic]].
847 ** Can I save/restore the visibility state of an org-mode buffer?
848    :PROPERTIES:
849    :CUSTOM_ID: saving-visibility-state
850    :END:
852 Well, no---at least not automatically. You can, however, control the
853 visibility of an org-file or of individual trees by adding
854 instructions to your org file. See [[http://orgmode.org/manual/Visibility-cycling.html#Visibility-cycling][this section of the manual]] for more
855 information.
857 ** How can I keep track of changes in my Org files?
858    :PROPERTIES:
859    :CUSTOM_ID: track-of-changes-in-Org-files
860    :END:
862   Use git to track the history of the files, use a cronjob to check in
863   changes regularly.  Such a setup is described by Bernt Hansen
864   in [[http://article.gmane.org/gmane.emacs.orgmode/6233][this message]] on [[http://dir.gmane.org/gmane.emacs.orgmode][emacs-orgmode]].
866 ** Can I use Org-mode as the default mode for all README files?
867    :PROPERTIES:
868    :CUSTOM_ID: Org-mode-as-default-mode
869    :END:
871 Add the following to your .emacs file:
873 : (add-to-list 'auto-mode-alist '("README$" . org-mode))
875 You can even make it the default mode for any files with unspecified
876 mode using
878 : (setq default-major-mode 'org-mode)
880 ** Can I use ido.el for completing stuff in Org?
881    :PROPERTIES:
882    :CUSTOM_ID: ido-complete
883    :END:
885    Yes, you can.  If you are an ido user and ido-mode is active, the
886    following setting will make Org use =ido-completing-read= for most
887    of its completing prompts.
889 : (setq org-completion-use-ido t)
891 ** Should I use one big org file or multiple files?
892    :PROPERTIES:
893    :CUSTOM_ID: how-to-organize-org-mode-files
894    :END:
896 Org-mode is flexible enough to accomodate a variety of organizational
897 and time management schemes. Org's [[http://orgmode.org/manual/Document-Structure.html#Document-Structure][outline cycling and convenient
898 editing and navigation commands]] make it possible to maintain all of
899 your projects and notes in a single file. But org-mode's [[http://orgmode.org/manual/Hyperlinks.html#Hyperlinks][quick and
900 easy hyperlinks]], along with [[http://orgmode.org/manual/Refiling-notes.html#Refiling-notes][easy refiling of notes and todos]], also
901 make it a delight to maintain a private "wiki" consisting of multiple
902 files.
904 No matter how you organize your org files, org-mode's agenda commands
905 make it easy to search all your notes and gather together crucial data
906 in a single view.
908 Moreover, several org-mode settings can be configured either globally
909 in your =.emacs= file or locally (per file or per outline tree). See
910 the [[http://orgmode.org/manual/index.html#Top][manual]] for more details. For an example of local customizations
911 see [[limit-agenda-with-category-match][this FAQ]].
913 Here are a few ideas for organizing org-mode files:
915 - A single file for all your projects and notes.
916 - One file per project.
917 - One file per client.
918 - One file per area of responsibility or type of work (e.g.,
919   household, health, work, etc.).
920 - One file for projects, one for appointments, one for reference
921   material, one for someday/maybe items, etc.
922 - A wiki of hyperlinked files that grows and adapts to meet your
923   needs.
925 For more ideas, see some of the links on the [[file:org-tutorials/index.org][org-tutorial index]] or
926 [[file:org-gtd-etc.org][this page on org-mode and GTD]].
928 ** Why doesn't C-c a call the agenda? Why don't some org keybindings work?
929    :PROPERTIES:
930    :CUSTOM_ID: setting-global-keybindings
931    :END:
933 Org-mode has a few global keybindings that the user must set
934 explicitly in an =.emacs= file. These keybindings include the
935 customary shortcut for calling the agenda (=C-c a=). If nothing
936 happens when you type =C-c a=, then make sure that the following lines
937 are in your =.emacs= file:
939 #+BEGIN_SRC emacs-lisp
940 ;; The following lines are always needed.  Choose your own keys.
941 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
942 (global-set-key "\C-cl" 'org-store-link)
943 (global-set-key "\C-ca" 'org-agenda)
944 (global-set-key "\C-cb" 'org-iswitchb)
945 #+END_SRC emacs-lisp
947 You may, of course, choose whatever keybindings work best for you
948 and do not conflict with other modes.
950 Please see [[http://orgmode.org/manual/Activation.html][this section of the manual]] if you have additional
951 questions.
953 ** Why aren't some of the variables I've customized having an effect?
954    :PROPERTIES:
955    :CUSTOM_ID: load-org-after-setting-variables
956    :END:
958 Some org variables have to be set before org.el is loaded or else they
959 will not work. (An example is the new variable
960 =org-enforce-todo-dependencies=.)
962 To make sure all your variables work you should not use =(require
963 'org)=. Instead use the following setting:
965 : (require 'org-install)
967 You should also make sure that you do not require any other =org-...=
968 files in your =.emacs= file before you have set your org variables,
969 since these will also cause org.el to be loaded. To be safe, load org
970 files *after* you have set your variables.
972 ** How can I make sure that timestamps appear in English?
973    :PROPERTIES:
974    :CUSTOM_ID: timestamps-and-system-time-locale
975    :END:
977 If your system's locale is not set to English, but you would like the
978 timestamps in your org-mode files to appear in English, you can set
979 the following variable:
981 #+begin_src emacs-lisp
982   (setq system-time-locale "C")
983 #+end_src
985 ** What does a minimal .emacs look like?
986    :PROPERTIES:
987    :CUSTOM_ID: minimal-emacs
988    :END:
990 Using a stripped down minimal .emacs files removes broken custom
991 settings as the cause of an issue and makes it easy to reproduce for
992 other people.  The example below has system-specific paths that you'll
993 need to change for your own use.
994 #+begin_src emacs-lisp
995   (add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
996   (add-to-list 'auto-mode-alist '("\\.\\(org\\  |org_archive\\|txt\\)$" . org-mode))
997   (setq org-agenda-files '("/tmp/test.org"))
998   (require 'org-install)
999   (require 'org-habit)
1001   (global-set-key "\C-cl" 'org-store-link)
1002   (global-set-key "\C-ca" 'org-agenda)
1003   (global-set-key "\C-cb" 'org-iswitchb)
1004 #+end_src
1006 You can save the minimal .emacs file to ~/minimal.emacs, add suspect
1007 configuration code to it, then start emacs something like this:
1008 #+begin_src sh
1009   emacs -Q -l ~/minimal.emacs
1010 #+end_src
1012 On OS X, starting emacs with minimal configuration might look
1013 something like this:
1014 #+begin_src sh
1015   /Applications/emacs.app/Contents/MacOS/Emacs -Q -l ~/minimal.emacs
1016 #+end_src sh
1018 ** Can I migrate from Planner?
1020    Yes.  This [[http://www.c0t0d0s0.de/plan2org/plan2org.pl][perl script]] or [[http://gitorious.org/bkuhn-small-hacks/org-mode/blobs/master/planner2org.plx
1021 ][this Perl script]] can help.
1023 * Errors and general problems
1024   :PROPERTIES:
1025   :CUSTOM_ID: Errors
1026   :END:
1027 ** Opening Org files in Emacs leads to a crash
1028    :PROPERTIES:
1029    :CUSTOM_ID: Emacs-crashes-with-org-indent-mode
1030    :END:
1031    The only known case where Org-mode can crash Emacs is when you are
1032    using =org-indent-mode= with Emacs 23.1 (in fact, any version of
1033    Emacs before version 23.1.50.3).  Upgrade to Emacs 23.2 and the
1034    problem should go away.
1036 ** When I try to use Org-mode, I always get the error message =(wrong-type-argument keymapp nil)=
1037    :PROPERTIES:
1038    :CUSTOM_ID: wrong-type-argument-keymapp
1039    :END:
1041    This is a conflict with an outdated version of the /allout.el/, see
1042    the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section in the manual
1044 ** How can I control the application launched by Org-mode to open a certain file type like pdf, html....
1045    :PROPERTIES:
1046    :CUSTOM_ID: external-application-launched-to-open-file-link
1047    :END:
1049 If you want special control about how Org-mode opens files, see the
1050 variables =org-file-apps=, =org-file-apps-defaults-gnu=,
1051 =org-file-apps-defaults-macosx=, =org-file-apps-defaults-windowsnt=.
1053 *However*, normally it is best to just use the mechanism the
1054 operating-system provides:
1056 *** GNU/Linux systems
1057     You you have to check your mailcap settings, find the files:
1059     : /etc/mailcap
1060     :
1061     : or
1062     :
1063     : $HOME/.mailcap
1065 and modify them accordingly. Please read their manual entry.
1067 *** Windows systems
1068     + for html pages you may configure the =browse-url-= variables through
1069       the Customize interface,
1070     + the pdf files are automatically opened with Acrobat Reader (if it is
1071       installed)
1073 *** Mac OSX
1074     Change the application responsible for this file type by selecting
1075     such a file in the Finder, select =File->Get Info= from the menu
1076     and select the application to open this file with.  Then, to
1077     propagate the change to all files with the same extension, select
1078     the =Change all= button.
1080 ** Org-mode takes over the TAB key.  I also want to use YASnippet, is there a way to fix this conflict?
1081    :PROPERTIES:
1082    :CUSTOM_ID: YASnippet
1083    :END:
1085 [[http://code.google.com/p/yasnippet/][yasnippet]] is yet another snippet expansion system for Emacs.  It is
1086 inspired by TextMate's templating syntax.
1087 - watch the [[http://www.youtube.com/watch?v=vOj7btx3ATg][video on YouTube]]
1088 - see the [[http://yasnippet.googlecode.com/svn/trunk/doc/index.html][intro and tutorial]]
1090 *Note*: yasnippet is not compatible with =org-indent-mode= currently
1091 there is no known way to use both successfully with =yas/trigger-key=
1092 set to =TAB= (or =[tab]= etc...)
1094 The way Org-mode binds the =TAB= key (binding to =[tab]= instead of
1095 =\t=) overrules yasnippets' access to this key.  The following code
1096 fixes this problem:
1098 #+begin_src emacs-lisp
1099 (add-hook 'org-mode-hook
1100           (lambda ()
1101             (org-set-local 'yas/trigger-key [tab])
1102             (define-key yas/keymap [tab] 'yas/next-field-group)))
1103 #+end_src
1105 If the above code doesn't work (which it may not with later versions
1106 of yasnippet).  Then try the following
1108 #+begin_src emacs-lisp
1109   (defun yas/org-very-safe-expand ()
1110     (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
1112   (add-hook 'org-mode-hook
1113             (lambda ()
1114               ;; yasnippet (using the new org-cycle hooks)
1115               (make-variable-buffer-local 'yas/trigger-key)
1116               (setq yas/trigger-key [tab])
1117               (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
1118               (define-key yas/keymap [tab] 'yas/next-field)))
1119 #+end_src
1121 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]])
1122 with YASnippets for Org-mode.
1124 ** Org-mode takes over the S-cursor keys.  I also want to use CUA-mode, is there a way to fix this conflict?
1125    :PROPERTIES:
1126    :CUSTOM_ID: CUA-mode
1127    :END:
1129 Yes, see the  [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
1131 ** Org-mode takes over the S-cursor keys.  I also want to use windmove.el, is there a way to fix this conflict?
1132    :PROPERTIES:
1133    :CUSTOM_ID: windmove.el
1134    :END:
1136 Yes, see the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
1138 ** Org behaves strangely: some keys don't work, some features are missing, my settings have no effect, ...
1139    :PROPERTIES:
1140    :CUSTOM_ID: loaded-old-org
1141    :END:
1143 When this sort of things happen, it probably is because Emacs is
1144 loading an old version of Org-mode instead of the one you expected.
1145 Check it with =M-x org-version=.
1147 This happens because Emacs loads first the system org-mode (the one
1148 included with Emacs) before the one in your directory. Check the
1149 =load-path= variable; you might see that your org-mode appears /after/
1150 the system-wide path; this is bad.
1152 You should add your directories to the =load-path= at the beginning:
1154 :  (add-to-list 'load-path "~/.emacs.d/org-mode/lisp") (require 'org-install)
1156 Function =add-to-list= adds at the beginning. Don't use =append=
1157 because it appends at the end. Also be sure to use =(require
1158 'org-install)= and not =(require 'org)=.
1160 This wrong version loading may also happen if you have a byte-compiled
1161 =org.elc= from an old version together with a new =org.el=. Since
1162 Emacs prefers loading byte-compiled files (even if the =.el= is
1163 newer), it will load the old Org-mode.
1165 ** Why doesn't org-batch-agenda work under Win32?
1166    :PROPERTIES:
1167    :CUSTOM_ID: org-batch-agenda-under-win32
1168    :END:
1170 When I run the example batch files to print my agenda to the console
1171 under Win32 I get the failure:
1173 : End of file during parsing
1175 and no agenda is printed.
1177 The problem is the use of single quotes surrounding the eval in the
1178 emacs command-line. This gets confused under Win32. All string
1179 parameters with spaces must be surrounded in double quotes. This means
1180 that double quotes being passed to the eval must be escaped.
1182 Therefore, instead of the following:
1184 : <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
1185 :     -eval '(org-batch-agenda "a")'
1187 you need to use the following:
1189 :  <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
1190 :     -eval "(org-batch-agenda \"a\")"
1192 (all on one line, of course).
1194 ** Org agenda seems very slow
1195    :PROPERTIES:
1196    :CUSTOM_ID: slow-agenda
1197    :END:
1199 If it takes a long time to generate or refresh the agenda, you might
1200 want first check which version of org-mode you are using. There have
1201 been major optimizations of org-agenda since 6.21b, which was the
1202 version of org-mode released with Emacs 23. If you are using 6.21b or
1203 earlier (you can check with =M-x org-version=), then you might want to
1204 consider upgrading to a more recent version of org-mode.
1206 Here are some other ideas for speeding up the agenda:
1208 1. Use a one day agenda view (rather than a seven day view).
1210    =(setq org-agenda-ndays 1)=
1212 2. Archive inactive items to separate files.
1214    =C-c C-x C-s= (org-archive-subtree)
1216 3. Do not include the global todo list in your agenda view.
1218    (setq org-agenda-include-all-todo nil)
1220 4. Make sure that your org files are byte-compiled.
1222    I.e., make sure there are files ending in =.elc= in your org
1223    installation directory.
1225 5. Limit your agenda files (=org-agenda-files=) to files that have
1226    active todos and or projects.
1228    If you have a number of older reference files---i.e., files you
1229    search only occasionally---in your agenda files list, consider
1230    removing them from your agenda files and adding them to
1231    =org-agenda-text-search-extra-files= instead. Similarly, you might
1232    consider searching some of your older reference files with =M-x
1233    grep= so that Org-mode does not have to load them into memory when
1234    the agenda is called.
1236 ** Visual-line-mode doesn't work well with org-mode
1237    :PROPERTIES:
1238    :CUSTOM_ID: visual-line-mode
1239    :END:
1241 Visual-line-mode "soft wraps" lines so that the visual edge of the
1242 buffer is considered a line break for purposes of navigation, even
1243 though there is no line break in reality.
1245 In older versions of org-mode, org-beginning-of-line and
1246 org-end-of-line do not work well with visual line mode. (The two
1247 commands disregard soft line breaks and move to the beginning and end
1248 of the hard line break.) A patch was introduces to fix this behavior
1249 in July of 2009.
1251 If you are using an older version of org mode, you can:
1253 1. Add a hook to turn off visual line mode.
1255 2. Add the following to your =.emacs=:
1257 #+begin_src emacs-lisp
1259 (add-hook 'org-mode-hook
1260   (lambda ()
1261     (define-key org-mode-map "\C-a" 'move-beginning-of-line)
1262     (define-key org-mode-map "\C-e" 'move-end-of-line)))
1264 #+end_src
1265 ** Can I hide blocks at startup?
1267 Yes:
1269 #+begin_src emacs-lisp
1270 (setq org-hide-block-startup t)
1271 #+end_src
1273 Or use
1275 #+begin_src org
1276 ,#+STARTUP: hideblocks
1277 #+end_src
1279 on a per-file basis.
1281 ** After updating Org I get an error about an =invalid function=
1282    :PROPERTIES:
1283    :CUSTOM_ID: invalid-function-error
1284    :END:
1286 In almost all cases an =invalid function= error is caused by an
1287 unclean Org mode source directory. Cleaning it up and recompiling
1288 should fix the problem
1290 : cd /path/to/orgmode
1291 : make clean
1292 : make
1294 * Faces and highlighting
1295   :PROPERTIES:
1296   :CUSTOM_ID: Faces
1297   :END:
1298 ** Org-mode has a lot of colors?  How can I change them?
1299    :PROPERTIES:
1300    :CUSTOM_ID: customizing-org-faces
1301    :END:
1303 This is a question that applies to Emacs as a whole, but it comes up
1304 quite frequently on the org-mode mailing list, so it is appropriate to
1305 discuss it here.
1307 If you would like to change the style of a face in org-mode (or any
1308 other Emacs mode), simply type =M-x customize-face [RET]= while the
1309 cursor is on the color/style you are interested in modifying. You will
1310 be given the opportunity to customize all the faces located at that
1311 point.
1313 If you would like an overview of all the faces in org-mode, you can
1314 type =C-u M-x list-faces-display [RET] org= and you will be shown all
1315 the faces defined by org-mode along with an illustration of their
1316 current settings.
1318 If you would like to customize org-faces and other aspects of
1319 org-appearance, type =M-x customize-group org-font-lock [RET]=.
1321 Finally, if you would like verbose information about the properties of
1322 the text under the cursor, you can type =C-u C-x ==.
1324 See the Worg page on [[file:org-tutorials/org-appearance.org][customizing Org appearance]] for further information.
1325 ** Why do I get a tiny font in column view when using emacs daemon?
1326    :PROPERTIES:
1327    :CUSTOM_ID: column-view-tiny-font
1328    :END:
1330 When using emacs in daemon mode (=emacs --daemon=), client frames
1331 sometimes override the column view face settings, resulting in very
1332 small fonts. Here is a fix:
1334 #+begin_src emacs-lisp
1335   (defun org-column-view-uses-fixed-width-face ()
1336   ;; copy from org-faces.el
1337   (when (fboundp 'set-face-attribute)
1338       ;; Make sure that a fixed-width face is used when we have a column
1339       ;; table.
1340       (set-face-attribute 'org-column nil
1341                           :height (face-attribute 'default :height)
1342                           :family (face-attribute 'default :family))))
1344    (when (and (fboundp 'daemonp) (daemonp))
1345     (add-hook 'org-mode-hook 'org-column-view-uses-fixed-width-face))
1346 #+end_src
1348 This fix was provided in the following mailing list post:
1350 http://article.gmane.org/gmane.emacs.orgmode/27560
1351 ** How can I stop the mouse cursor from highlighting lines in the agenda?
1352    :PROPERTIES:
1353    :CUSTOM_ID: ratpoison-for-agenda-highlighting
1354    :END:
1356 You can add the following to your =.emacs=:
1358 #+begin_src emacs-lisp
1359 (add-hook 'org-finalize-agenda-hook
1360     (lambda () (remove-text-properties
1361                (point-min) (point-max) '(mouse-face t))))
1362 #+end_src
1364 * Outline
1365   :PROPERTIES:
1366   :CUSTOM_ID: Outline
1367   :END:
1368 ** Can I close an outline section without starting a new section?
1369    :PROPERTIES:
1370    :CUSTOM_ID: closing-outline-sections
1371    :END:
1373 Can I have nested, closed outline sections, similar to xml? This
1374 question comes up quite frequently on the mailing list.
1376 See the following threads:
1378   - http://permalink.gmane.org/gmane.emacs.orgmode/40182
1379   - http://permalink.gmane.org/gmane.emacs.orgmode/36719
1380   - http://permalink.gmane.org/gmane.emacs.orgmode/24092
1381   - http://permalink.gmane.org/gmane.emacs.orgmode/12425
1383 The desired behavior looks something like this:
1385 #+begin_src org
1386   ,* Section one
1388   ,Some text
1390   ,** Subsection one
1392   ,Some text
1394   ,** Subsection two
1396   ,Some text
1398   ,# end Subsection Two
1400   ,Continue text in section one.
1401 #+end_src
1403 The short answer to the question is no. Org-mode adheres to the
1404 cascading logic of outlines, in which a section is closed only by
1405 another section that occupies an equal or greater level.
1407 Here are some workarounds:
1409 1. You can use inline tasks to create non-folding subsections. See the
1410    documentation in org-inlinetask.el, which is part of the org-mode
1411    distribution.
1412 2. You can create a temporary heading, such as "** Continue main
1413    section" and then remove it when you are ready to export.
1414 3. You can create a separate outline heading (e.g., * ACTIONS),
1415    creating TODOs there with links to the relevant sections of your
1416    main text.
1418 ** Can I add a TODO to a list item?
1419    :PROPERTIES:
1420    :CUSTOM_ID: list-item-as-todo
1421    :END:
1423 No. When generating agenda views, org-mode treats only headlines as
1424 TODO items.
1426 You can, however, use a status cookie together with checkboxes to
1427 monitor your progress on a series of subtasks:
1429 #+begin_src org
1430   ,** TODO Big task [1/3]
1432   ,   - [X] Subtask 1
1433   ,   - [ ] Subtask 2
1434   ,   - [ ] Subtask 3
1435 #+end_src
1437 If you would like to embed a TODO within text without treating it as
1438 an outline heading, you can use inline tasks. Simply add...
1440 : (require 'org-inlinetask)
1442 ...to your =.emacs= and then type C-c C-x C-t to insert an inline task.
1444 ** Can I have two windows on the same Org-mode file, with different outline visibilities?
1445    :PROPERTIES:
1446    :CUSTOM_ID: indirect-buffers
1447    :END:
1449    You may use /indirect buffers/ which do exactly this.  See the
1450    documentation on the command =make-indirect-buffer=.
1452    Org-mode has built-in commands that allow you create an indirect
1453    buffer from a subtree of an outline. To open a subtree in new
1454    window, type =C-c C-x b=. Any changes you make in the new window
1455    will be saved to the original file, but the visibility of both
1456    buffers will remain independent of one another.
1458    For multiple indirect buffers from the same file, you must use the
1459    prefix =C-u= when creating the second (or third) buffer. Otherwise
1460    the new indirect buffer will replace the old.
1462    You can also create an independent view of an outline subtree by
1463    typing =b= on an item in the agenda.
1465 ** Emacs outlines are unreadable.  Can I get rid of all those stars?
1466    :PROPERTIES:
1467    :CUSTOM_ID: Emacs-outlines-are-unreadable
1468    :END:
1470    See the section [[http://orgmode.org/manual/Clean-view.html#Clean-view][Clean outline view]] in the manual.
1471 ** C-k is killing whole subtrees!  I lost my work!
1472    :PROPERTIES:
1473    :CUSTOM_ID: C-k-is-killing-subtrees
1474    :END:
1476   =(setq org-ctrl-k-protect-subtree t)= before losing your work.
1478 ** Why aren't commands working on regions?
1479    :PROPERTIES:
1480    :CUSTOM_ID: transient-mark-mode
1481    :END:
1483 Some org-mode commands, such as M-right and M-left for demoting or
1484 promoting headlines (see [[demote-multiple-headlines][this FAQ]]), can be applied to entire regions.
1485 These commands, however, will only work on active regions set with
1486 [[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
1487 Emacs 23. To enable it in earlier versions of emacs, put the following
1488 in your =.emacs= file:
1490 : (transient-mark-mode 1)
1492 Alternatively, you may turn off transient mark mode and use [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Momentary-Mark.html][a
1493 momentary mark]] (=C-<SPC> C-<SPC>=).
1495 ** Why is a blank line inserted after headlines and list items?
1496    :PROPERTIES:
1497    :ID:       2463F4D8-F686-4CF3-AA07-08976F8A4972
1498    :END:
1499    :PROPERTIES:
1500    :CUSTOM_ID: blank-line-after-headlines-and-list-items
1501    :END:
1503 In org-mode, typing =M-RET= at the end of a headline will create a new
1504 headline of the same level on a new line. The same is true for plain
1505 lists. By default org-mode uses context to determine if a blank line
1506 should be inserted after each headline or plain list item when =M-RET=
1507 is pressed. For instance, if a there is a blank line before a
1508 headline, then typing =M-RET= at the end of the line will insert a
1509 blank line before the new headline. For instance, hitting =M-RET=
1510 at the end of "Headline Two" below inserts a new headline without a
1511 blank line:
1513 : ** Headline One
1514 : ** Headline Two
1515 : **
1517 If there is a blank line between Headline One and Headline Two,
1518 however, the results will be as follows:
1520 : ** Headline One
1522 : ** Headline Two
1524 : **
1526 If you do not like the default behavior you can change it with the
1527 variable =org-blank-before-new-entry=. You can set headings and/or
1528 plain lists to auto (the default setting), t (always), or nil (never).
1530 ** How can I promote or demote multiple headlines at once?
1531    :PROPERTIES:
1532    :CUSTOM_ID: demote-multiple-headlines
1533    :END:
1535 If you have a long list of first level headlines that you'd like to
1536 demote to second level headlines, you can select the headlines as a
1537 region and then hit =M-<right>= to demote all the headlines at once.
1539 Note: =M-S-<right>= will not work on a selected region. Its use is to
1540 demote a single subtree (i.e., a headline and all sub-headlines).
1542 If M-<right> doesn't seem to work, make sure transient mark mode is
1543 enabled. See [[transient-mark-mode][this FAQ]].
1545 ** What's the deal with all the ellipses in my org outlines?
1546    :PROPERTIES:
1547    :CUSTOM_ID: org-ellipses
1548    :END:
1550 Org-mode uses ellipses to indicate folded (and thus hidden) text. Most
1551 commonly, ellispes occur at the end of headings with folded content:
1553 : * Heading ...
1555 Or, for instance, they may indicate closed drawers:
1557 : :PROPERTIES: ...
1559 Sometimes, as a result of editing and cycling an outline, ellipses may
1560 appear in unexpected places. You should *never* delete these ellipses,
1561 as you may accidentally delete hidden text. Instead, you can type =C-c
1562 C-r= (org-reveal) to display all hidden text in the vicinity. Or you
1563 may type =M-x RET show-all= to reveal all text in the org file.
1565 If you would prefer a symbol or face for indicating hidden text, you
1566 can customize the variable org-ellipses.
1568 ** How do I yank a subtree so it's indented according to the point's location?
1569    :PROPERTIES:
1570    :CUSTOM_ID: yank-indent-subtree
1571    :END:
1573 You can either use =C-c C-w= with a working [[http://orgmode.org/manual/Refiling-notes.html#Refiling-notes][refile-targets]] setup.
1575 Or set =org-yank-adjusted-subtrees= to =t= which will adjust the
1576 yanked headline's level correctly.
1578 Just use =C-k= and =C-y= as you would everywhere else in Emacs.
1580 ** Can I read org-mode outlines in vim?
1581    :PROPERTIES:
1582    :CUSTOM_ID: org-outlines-in-vim
1583    :END:
1585 Yes, there is a script that enables one to view and navigate folded
1586 outline/org files in vim (though without most of org-mode's
1587 functionality, of course).
1589   - [[http://www.vim.org/scripts/script.php?script_id%3D1266][Emacs outline mode - Imitates Emacsen : vim online]]
1591 For instructions on how to set it up, please see [[http://mid.gmane.org/EA275862-B97A-4BAC-B879-177FD07A2D56@gaillourdet.net][this mailing list
1592 post]].
1594 Work is also underway on an org-mode clone for Vim. You can check it
1595 out on git hub:
1597 https://github.com/hsitz/VimOrganizer
1599 ** Can I use another character than "*" to start a headline?
1601 No.  The "*" character is used in =outline-mode=, and Org is derived from
1602 =outline-mode=.  
1604 If you are curious as to what other rationales there are for "*", check out
1605 [[http://permalink.gmane.org/gmane.emacs.orgmode/44271][this]] mail and the thread it is in.
1607 * Todos and Tags
1608   :PROPERTIES:
1609   :CUSTOM_ID: Todos-and-Tags
1610   :END:
1611 ** How can I cycle through the TODO keyword of an entry?
1612    :PROPERTIES:
1613    :CUSTOM_ID: cycle-TODO-keywords
1614    :END:
1616   =C-c C-t= or =S-<left/right>= is what you need.
1618 ** How do I track state changes for tasks in Org?
1619    :PROPERTIES:
1620    :CUSTOM_ID: track-state-changes-for-tasks
1621    :END:
1623   Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/6082][post by Bernt Hansen]] for setting up TODO keyword
1624   states and logging timestamps for task state changes.
1626 ** Can I select the TODO keywords with a tag-like interface?
1627    :PROPERTIES:
1628    :CUSTOM_ID: select-TODO-keywords-with-tag-like-interface
1629    :END:
1631   Yes.  Use =(setq org-use-fast-todo-selection t)=
1633   If you want to set both your todos and your tags using a single
1634   interface, then check out the variable
1635   =org-fast-tag-selection-include-todo=.
1637   See [[http://orgmode.org/manual/Fast-access-to-TODO-states.html][this section of the manual]] for more details.
1639 ** How can I quickly set the tag of an entry?
1640    :PROPERTIES:
1641    :CUSTOM_ID: quickly-set-tag-of-entry
1642    :END:
1644    Use =C-c C-c= or =C-c C-q= on the headline. =C-c C-q= is useful for
1645    setting tabs in a [[http://orgmode.org/manual/Remember.html#Remember][remember]] buffer, since =C-c C-c= is the default
1646    keybinding for filing a note from the remember buffer.
1648    You can set tags even more quickly by setting one of the character
1649    shortcuts for [[http://orgmode.org/manual/Setting-tags.html#Setting-tags][fast tag selection]].
1651    To set tag shortcuts for all org buffers, put something like the
1652    following in your =.emacs= file (or create the same settings by
1653    typing =M-x customize-variable RET org-tag-alist=):
1655 : (setq org-tag-alist '(("computer" . ?c) ("office" . ?o) ("home" . ?h)))
1657    To set tag shortcuts for a single buffer, put something like the
1658    following at the top of your org file:
1660 : #+TAGS: computer(c) office(o) home(h)
1662 ** How can I change the colors of TODO keywords?
1664 You can use the variable org-todo-keyword-faces. Here are some sample
1665 settings:
1667 #+begin_src emacs-lisp
1668 (setq org-todo-keyword-faces
1669       '(
1670         ("TODO"  . (:foreground "firebrick2" :weight bold))
1671         ("WAITING"  . (:foreground "olivedrab" :weight bold))
1672         ("LATER"  . (:foreground "sienna" :weight bold))
1673         ("PROJECT"  . (:foreground "steelblue" :weight bold))
1674         ("DONE"  . (:foreground "forestgreen" :weight bold))
1675         ("MAYBE"  . (:foreground "dimgrey" :weight bold))
1676         ("CANCELED"  . shadow)
1677         ))
1678 #+end_src
1680 If you want to change the color of all active todos or all inactive
1681 todos, type:
1683 : M-x customize-face RET org-todo
1684 : M-x customize-face RET org-done
1686 You can also set values for each of these in your =.emacs= file:
1688 : (set-face-foreground 'org-todo "firebrick2")
1689 : (set-face-foreground 'org-done "forestgreen")
1691 ** Can I use a arbitrary character in a TODO keyword?
1693 Yes, provided you add it to the "word" syntax in Emacs.
1695 For example, to add the =\u25b6= and the =\u25b8= chars, just add this to
1696 your Emacs configuration:
1698 #+begin_src emacs-lisp
1699 (add-hook 'org-mode-hook
1700    (lambda ()
1701      (modify-syntax-entry (string-to-char "\u25b6") "w")
1702      (modify-syntax-entry (string-to-char "\u25b8") "w")))
1703 #+end_src
1704 ** How do I arrange for an item to be automatically marked DONE when all checkboxes are checked?
1706 This has arisen a couple of time
1707 (e.g. http://thread.gmane.org/gmane.emacs.orgmode/42715 and
1708 http://thread.gmane.org/gmane.emacs.orgmode/47363) in the mailing
1709 list.
1711 An item consists of a list with checkboxes.  When all of the
1712 checkboxes are checked, the item should be considered complete and its
1713 TODO state should be automatically changed to DONE. The code below
1714 does that. This version is slightly enhanced over the one in the
1715 mailing list to reset the state back to TODO if a checkbox is
1716 unchecked.
1718 Note that the code requires that a checkbox statistics cookie be
1719 present in order for it to work. Note also that it is too dumb to
1720 figure out whether the item has a TODO state in the first place: if
1721 there is a statistics cookie, a TODO/DONE state will be added
1722 willy-nilly any time that the statistics cookie is changed.
1724 #+begin_src emacs-lisp
1725   ;; see http://thread.gmane.org/gmane.emacs.orgmode/42715
1726   (add-to-list 'org-checkbox-statistics-hook (function ndk/checkbox-list-complete))
1727   
1728   (defun ndk/checkbox-list-complete ()
1729     (save-excursion
1730       (org-back-to-heading t)
1731       (let ((beg (point)) end)
1732         (end-of-line)
1733         (setq end (point))
1734         (goto-char beg)
1735         (if (re-search-forward "\\[\\([0-9]*%\\)\\]\\|\\[\\([0-9]*\\)/\\([0-9]*\\)\\]" end t)
1736               (if (match-end 1)
1737                   (if (equal (match-string 1) "100%")
1738                       ;; all done - do the state change
1739                       (org-todo 'done)
1740                     (org-todo 'todo))
1741                 (if (and (> (match-end 2) (match-beginning 2))
1742                          (equal (match-string 2) (match-string 3)))
1743                     (org-todo 'done)
1744                   (org-todo 'todo))))))))
1745 #+end_src
1748 * Hyperlinks
1749   :PROPERTIES:
1750   :CUSTOM_ID: Hyperlinks
1751   :END:
1752 ** Why do I have to confirm the execution of each shell/elisp link?
1753    :PROPERTIES:
1754    :CUSTOM_ID: confirm-shell/elisp-link
1755    :END:
1757    The confirmation is there to protect you from unwantingly execute
1758    potentially dangerous commands.  For example, imagine a link
1760    : [[shell:rm -rf ~/*][Google Search]]
1762    In an Org-mode buffer, this command would look like /Google Search/,
1763    but really it would remove your home directory.  If you wish, you can
1764    make it easier to respond to the query by setting
1766    : (setq org-confirm-shell-link-function 'y-or-n-p
1767    :       org-confirm-elisp-link-function 'y-or-n-p).
1769    Then a single keypress will be enough to confirm those links.  It is
1770    also possible to turn off this check entirely, but I strongly
1771    recommend against this.  Be warned.
1773 ** Can I use RET or TAB to follow a link?
1774    :PROPERTIES:
1775    :CUSTOM_ID: RET-or-TAB-to-follow-link
1776    :END:
1778    Yes, this is how:
1780    : (setq org-return-follows-link t)
1781    : (setq org-tab-follows-link t)
1783 ** Can I keep mouse-1 clicks from following a link?
1784    :PROPERTIES:
1785    :CUSTOM_ID: mouse-1-following-link
1786    :END:
1788    Activating links with =mouse-1= is a new feature in Emacs 22, to make
1789    link behavior similar to other applications like web browsers.  If
1790    you hold the mouse button down a bit longer, the cursor will be set
1791    without following the link.  If you cannot get used to this behavior,
1792    you can (as in Emacs 21) use =mouse-2= to follow links and turn off
1793    link activation for =mouse-1= with
1795    : (setq org-mouse-1-follows-link nil)
1797 ** How can I get completion of file names when creating a link?
1798    :PROPERTIES:
1799    :CUSTOM_ID: completion-of-file-links
1800    :END:
1802 You can use org-insert-link with a prefix argument:
1804 : C-u C-c C-l
1806 You will be greeted with prompt in the minibuffer that allows for file
1807 completion using your preferred Emacs method for finding files.
1809 ** How can I use invisible targets within lists?
1810    :PROPERTIES:
1811    :CUSTOM_ID: invisible-targets-in-lists
1812    :END:
1814 The usual way of turning radio links invisible is to comment them, but
1815 Org comments need to be at the beginning of the line, which breaks list
1816 indentation.
1818 The workaround here is to add (INVISIBLE) after your <<target>>
1820 For example:
1822 : 11. <<target>>(INVISIBLE)
1823 :     Some text
1824 : 12. More text [[target][go to]]
1826 ** Org-mode is not opening mailto links in my default mail client
1827    :PROPERTIES:
1828    :CUSTOM_ID: mailto-links
1829    :END:
1831 You can customize the function org-mode uses to open mailto links by
1832 setting the variable =org-link-mailto-program=:
1834 =M-x customize-variable org-link-mailto-program=
1836 The default function called is =browse-url=, which opens a mail
1837 composition buffer within Emacs. The type of buffer opened by
1838 browse-url depends on the setting of the variable =mail-user-agent=.
1839 Thus, if you want to ensure that mailto links use Gnus to open a
1840 message buffer, you could add the following to your =.emacs=:
1842 #+begin_src elisp
1843 (setq mail-user-agent 'gnus-user-agent)
1844 #+end_src
1846 ** Can I use CamelCase links?
1847    :PROPERTIES:
1848    :CUSTOM_ID: CamelCase-links
1849    :END:
1851 Yes, you can with the contributed package org-wikinodes.el. Please
1852 consult the [[http://orgmode.org/worg/org-contrib/org-wikinodes.html][documentation]].
1854 * Plain Lists
1855   :PROPERTIES:
1856   :CUSTOM_ID: Plain-Lists
1857   :END:
1858 ** How can I insert an empty line before each newly inserted headline, but not before each newly inserted plain-list item?
1859    :PROPERTIES:
1860    :CUSTOM_ID: empty-line-before-each-new-headline-but-not-item
1861    :END:
1863 : (setq org-blank-before-new-entry
1864 :       '((heading . t) (plain-list-item . nil))
1866 See also [[id:2463F4D8-F686-4CF3-AA07-08976F8A4972][Why is a blank line inserted after headlines and list items?]].
1868 ** How can I convert itemized lists to enumerated lists?
1869    :PROPERTIES:
1870    :CUSTOM_ID: convert-itemized-to-enumerated-lists
1871    :END:
1873    You can use =C-c -= or =S-<left>/<right>= to cycle through the various
1874    bullet headlines available for lists: =-, +, *, 1., 1)=.
1876    See [[http://orgmode.org/manual/Plain-lists.html#Plain-lists][this section of the manual]] for more information.
1878 ** How can I convert plain lists to headlines and vice versa?
1879    :PROPERTIES:
1880    :CUSTOM_ID: convert-plain-lists-to-headlines
1881    :END:
1883    To convert a plain list item or line to a headline, type =C-c *= on
1884    the headline. This will make the line a subheading of the current
1885    headline.
1887    To convert a headline to a plain list item, type =C-c -= while the
1888    cursor is on the headline.
1890    To convert a headline to an unadorned line of text, type =C-c *= on
1891    the headline.
1893    You can use query replace to accomplish the same things, as Bernt
1894    Hansen explains in [[http://article.gmane.org/gmane.emacs.orgmode/10148][this mailing list post]].
1896 ** Is there a good way to create a description list?
1897    :PROPERTIES:
1898    :CUSTOM_ID: description-lists
1899    :END:
1901   Yes, these are now built-in:
1903 #+BEGIN_EXAMPLE
1904 - item1 :: Description of this item 1
1905 - item2 :: Description of this item 2
1906 - item1 :: Description of this item 3
1907       also in multiple lines
1908 #+END_EXAMPLE
1910 * Tables
1911   :PROPERTIES:
1912   :CUSTOM_ID: Tables
1913   :END:
1914 ** Will there ever be support for multiple lines in a table field?
1915    :PROPERTIES:
1916    :CUSTOM_ID: table-multiline-fields
1917    :END:
1919    No.
1921    You can embed tables created with the table.el package in org-mode
1922    buffers, with mixed success when it comes to export and publishing.
1924 ** How can I make table alignment work with Asian character sets
1925    :PROPERTIES:
1926    :CUSTOM_ID: table-alignment-asian-characters
1927    :END:
1929 When table alignment fails, it usually has to do with character sets
1930 where some characters have non-integer width.  Org will deal correctly
1931 with characters that are one or two or three ASCII characters wide,
1932 but not with characters that are, for example, 1.5 ASCII characters
1933 wide.  To make table alignment work you need to switch to a different
1934 character set.
1936 ** Can I plot data from a table?
1937    :PROPERTIES:
1938    :CUSTOM_ID: plotting-table-data
1939    :END:
1941    Yes, you can, using org-plot.el written by Eric Schulte and now
1942    bundled with Org.  See [[http://orgmode.org/manual/Org_002dPlot.html#Org-Plot][the manual section about this]].
1944    See also [[file:org-tutorials/org-plot.org][this excellent tutorial]] by Eric Schulte.
1946 ** How can I fill a table column with incremental numbers?
1947    :PROPERTIES:
1948    :CUSTOM_ID: fill-table-column-with-incremental-numbers
1949    :END:
1951 Here is how: Use a field formula to set the first value in the column:
1953 #+begin_src org
1954 ,| N   |   |
1955 ,|-----+---|
1956 ,| :=1 |   |
1957 ,|     |   |
1958 ,|     |   |
1959 ,|     |   |
1960 ,#+TBLFM: @2$1=1
1961 #+end_src
1963 Then define a column formula in the second field:
1965 #+begin_src org
1966 ,| N        |   |
1967 ,|----------+---|
1968 ,| 1        |   |
1969 ,| =@-1 + 1 |   |
1970 ,|          |   |
1971 ,|          |   |
1972 ,#+TBLFM: @2$1=1
1973 #+end_src
1975 After recomputing the table, the column will be filled with
1976 incremental numbers:
1978 #+begin_src org
1979 ,| N |   |
1980 ,|---+---|
1981 ,| 1 |   |
1982 ,| 2 |   |
1983 ,| 3 |   |
1984 ,| 4 |   |
1985 ,#+TBLFM: $1=@-1 + 1::@2$1=1
1986 #+end_src
1988 Note that you could use arbitrary starting values and column formulas.
1990 ** Why does my table column get filled with #ERROR?
1991    :PROPERTIES:
1992    :CUSTOM_ID: table-column-filled-with-ERROR
1993    :END:
1995    Org-mode tried to compute the column from other fields using a
1996    formula stored in the =#+TBLFM:= line just below the table, and
1997    the evaluation of the formula fails.  Fix the fields used in the
1998    formula, or fix the formula, or remove it!
2000 ** How can I stop the table editor from creating new lines?
2001    :PROPERTIES:
2002    :CUSTOM_ID: table-editor-creates-new-lines
2003    :END:
2005    When I am in the last column of a table and just above a horizontal
2006    line in the table, pressing TAB creates a new table line before the
2007    horizontal line.  To move to the line below the
2008    horizontal line instead, do this:
2010    Press =down= (to get on the separator line) and then =TAB=.
2011    Or configure the variable
2013    : (setq org-table-tab-jumps-over-hlines t)
2015 ** How can I get table fields starting with "="?
2016    :PROPERTIES:
2017    :CUSTOM_ID: table-fields-starting-with-=
2018    :END:
2020    With the setting
2022    : (setq org-table-formula-evaluate-inline nil)
2024    this will no longer happen.  You can still use formulas using the
2025    commands ~C-c =~ and ~C-u C-c =~
2027 ** How can I get a vertical bar "|" inside a table field?
2028    :PROPERTIES:
2029    :CUSTOM_ID: table-fields-with-vertical-bar
2030    :END:
2032    You can use =\vert= to put a vertical bar inside a table field.
2033    This will be converted for export.  To use it inside a word use
2034    =abc\vert{}def=.  If you need something that looks like a bar in
2035    the Org mode buffer, you can use the unicode character brvbar which
2036    looks like this: \brvbar{}.
2039 ** How can I change the indentation of an entire table without fixing every line by hand?
2040    :PROPERTIES:
2041    :CUSTOM_ID: change-indentation-entire-table
2042    :END:
2044    The indentation of a table is set by the first line.  So just fix the
2045    indentation of the first line and realign with =TAB=.
2047 ** In my huge table the realigning after each TAB takes too long.  What can I do?
2048    :PROPERTIES:
2049    :CUSTOM_ID: table-realigning-after-TAB-takes-long
2050    :END:
2052    Either split the table into several by inserting an empty line every
2053    100 lines or so.  Or turn off the automatic re-align with
2055    : (setq org-table-automatic-realign nil)
2057    After this the only way to realign a table is to press =C-c C-c=.  It
2058    will no longer happen automatically, removing the corresponding delays
2059    during editing.
2061 ** Recalculation of my table takes too long.  What can I do?
2062    :PROPERTIES:
2063    :CUSTOM_ID: Recalculation-of-my-table-takes-too-long
2064    :END:
2066    Nothing, really.  The spreadsheet in org is mostly done to make
2067    calculations possible, not so much to make them fast.  Since Org-mode
2068    is firmly committed to the ASCII format, nothing is stopping you from
2069    editing the table by hand.  Therefore, there is no internal
2070    representation of the data.  Each time Org-mode starts a computation,
2071    it must scan the table for special lines, find the fields etc.  This
2072    is slow.  Furthermore, Calc is slow compared to hardware
2073    computations.  To make this work with normal editing, recalculation
2074    is not happening automatically, or only for the current line, so that
2075    the long wait for a full table iteration only happens when you ask
2076    for it.
2078    So for really complex tables, moving to a "real" spreadsheet may
2079    still be the best option.
2081    That said, there are some ways to optimize things in Org-mode, and I
2082    have been thinking about moving a bit further down this line.
2083    However, for my applications this has so far not been an issue at
2084    all.  If you have a good case, you could try to convince me.
2086 ** =S-RET= in a table keeps increasing the copied numbers.  How can I stop this?
2087    :PROPERTIES:
2088    :CUSTOM_ID: S-RET-in-a-table-increases-copied-numbers
2089    :END:
2091    Well, it is /supposed/ to be a feature, to make it easy to create a
2092    column with increasing numbers.  If this gets into your way, turn it
2093    off with
2095    : (setq org-org-table-copy-increment nil)
2097 ** When I export tables to html, they don't have borders.
2098    :PROPERTIES:
2099    :CUSTOM_ID: table-borders-in-html-export
2100    :END:
2102 By default, org mode exports tables without borders.
2104 You can changed this by placing an =#+ATTR_HTML= line before the
2105 table:
2107 :  #+ATTR_HTML: border="2" rules="all" frame="all"
2109 See [[http://orgmode.org/manual/Tables-in-HTML-export.html#Tables-in-HTML-export][the manual]] for more details.
2111 ** Why does the Calc high precision (e. g. =p20=) not work like expected?
2112    :PROPERTIES:
2113    :CUSTOM_ID: table-high-precision
2114    :END:
2116 - *Short answer*
2118   Avoid
2119   : | 1 / 2 * 3 | 0.16666667000000 |
2120   : #+TBLFM: $2 = $1; p20 %.14f
2122   and use
2123   : | 1 / 2 * 3 | 0.16666666666667 |
2124   : #+TBLFM: $2 = $1 +.0; p20 f-14
2126 - *Longer answer*
2128   It is important to distinguish between the precision of
2129   1) =p20=: Calc internal calculation (=calc-internal-prec=)
2130   2) =f-14=: Calc float formatting, unlimited in precision (=calc-float-format=)
2131   3) =%.14f=: the =printf= reformatting, limited in precision
2133   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.
2135   Use =C-h v org-calc-default-modes RET= to check the Org default settings
2136   which are used if no format specifiers are added to a table formula.
2137   The examples below have been made with the out_of_the_box Org defaults
2138   =calc-internal-prec = 12= and =calc-float-format = 8=.
2140   Remember the formula debugger, toggled with =C-c {=,
2141   to view the processing stages like:
2142   |   | formula debugger label | processing stage           |
2143   | / | <                      | <>                         |
2144   |---+------------------------+----------------------------|
2145   |   | Result:                | output of Calc             |
2146   |   | Format:                | reformatting with =printf= |
2148   Following are some examples to demonstrate
2149   the interaction of the three precisions.
2151   - *display precision limitations for Calc formulas*
2152     - limited by Calc internal calculation precision from Org default
2153       (here =p12=)
2154       : | 0.16666666666700 |
2155       : #+TBLFM: $1 = 1 / 2 * 3;     f-14
2157       : | 0.1666666666670000000 |
2158       : #+TBLFM: $1 = 1 / 2 * 3;     f-19
2160     - limited by Calc float format from Org default (here =f8=)
2161       : | 0.16666667 |
2162       : #+TBLFM: $1 = 1 / 2 * 3
2164       : | 0.16666667 |
2165       : #+TBLFM: $1 = 1 / 2 * 3; p20
2167       : | 0.16666667000000 |
2168       : #+TBLFM: $1 = 1 / 2 * 3;          %.14f
2170       : | 0.16666667000000 |
2171       : #+TBLFM: $1 = 1 / 2 * 3; p20      %.14f
2173     - limited by Calc float format specified
2174       : | 0.166667 |
2175       : #+TBLFM: $1 = 1 / 2 * 3;     f-6
2177       : | 0.16666666666667 |
2178       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-14
2180       : | 0.1666666666666666667 |
2181       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-19
2183     - limited by =printf= conversion to Emacs Lisp float
2184       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
2185       : #+TBLFM: $1 = 1 / 2 * 3;          %.19f
2187       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
2188       : #+TBLFM: $1 = 1 / 2 * 3; p20      %.19f
2190       : | 0.1666666666666666600 | the inaccuracy is platform dependent |
2191       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-20 %.19f
2193     - limited by =printf= format specified
2194       : | 0.166667 |
2195       : #+TBLFM: $1 = 1 / 2 * 3;         %.6f
2197   - *display precision limitations for Emacs Lisp formulas*
2198     - limited by Emacs Lisp float
2199       : | 0.16666666666666666 |
2200       : #+TBLFM: $1 = '(/ 1.0 (* 2 3))
2202       : | 0.1666666666666666574 | the inaccuracy is platform dependent |
2203       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.19f
2205     - limited by =printf= format specified
2206       : | 0.16666666666667 |
2207       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.14f
2209 This FAQ entry is based on this [[http://thread.gmane.org/gmane.emacs.orgmode/22642][mailing list thread]]
2210 and is continued in the [[#table-float-fraction][next FAQ entry]].
2212 ** Which float format shows the fraction part also when the latter is zero?
2213    :PROPERTIES:
2214    :CUSTOM_ID: table-float-fraction
2215    :END:
2217 - *Short answer*
2219   Avoid
2220    : | 1 | 1 |
2221    : #+TBLFM: $2 = $1; f-3
2222   and use
2223    : | 1 | 1.000 |
2224    : #+TBLFM: $2 = $1 +.0; f-3
2226 - *Longer answer*
2228   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]]
2229   in the section Mode Settings -> Display Modes -> Float Formats
2230   [[http://www.delorie.com/gnu/docs/calc/calc_163.html][found here as long as the section numbering is unchanged]].
2232   Remember the formula debugger, toggled with =C-c {=,
2233   to view the processing stages like:
2234   |   | formula debugger label | processing stage           |
2235   | / | <                      | <>                         |
2236   |---+------------------------+----------------------------|
2237   |   | Result:                | output of Calc             |
2238   |   | Format:                | reformatting with =printf= |
2240   Following are some examples to demonstrate different float formats.
2242   - normal precision
2243     : |-----------+---------+-------+---------+----------+-------|
2244     : |    number |      f3 |   f-3 | +.0; f3 | +.0; f-3 |  %.3f |
2245     : |-----------+---------+-------+---------+----------+-------|
2246     : |         1 |       1 |     1 |   1.000 |    1.000 | 1.000 |
2247     : |         0 |       0 |     0 |   0.000 |    0.000 | 0.000 |
2248     : |-----------+---------+-------+---------+----------+-------|
2249     : |       1.0 |   1.000 | 1.000 |   1.000 |    1.000 | 1.000 |
2250     : |       0.0 |   0.000 | 0.000 |   0.000 |    0.000 | 0.000 |
2251     : |-----------+---------+-------+---------+----------+-------|
2252     : | 1.0001666 |   1.000 | 1.000 |   1.000 |    1.000 | 1.000 |
2253     : | 0.0001666 | 1.67e-4 | 0.000 | 1.67e-4 |    0.000 | 0.000 |
2254     : |-----------+---------+-------+---------+----------+-------|
2255     : | 1.0016666 |   1.002 | 1.002 |   1.002 |    1.002 | 1.002 |
2256     : | 0.0016666 |   0.002 | 0.002 |   0.002 |    0.002 | 0.002 |
2257     : |-----------+---------+-------+---------+----------+-------|
2258     : #+TBLFM: $2 = $1; f3 :: $3 = $1; f-3 :: $4 = $1 +.0; f3 :: $5 = $1 +.0; f-3 :: $6 = $1; %.3f
2260   - high precision
2261     : |----------------------+--------------------------+-----------------------|
2262     : | number               |                      f19 |                  f-19 |
2263     : |----------------------+--------------------------+-----------------------|
2264     : | 1                    |                        1 |                     1 |
2265     : | 0                    |                        0 |                     0 |
2266     : |----------------------+--------------------------+-----------------------|
2267     : | 1.0                  |    1.0000000000000000000 | 1.0000000000000000000 |
2268     : | 0.0                  |    0.0000000000000000000 | 0.0000000000000000000 |
2269     : |----------------------+--------------------------+-----------------------|
2270     : | 1 + 1 / 2 * 3 * 1e19 |    1.0000000000000000000 | 1.0000000000000000000 |
2271     : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
2272     : |----------------------+--------------------------+-----------------------|
2273     : | 1 + 1 / 2 * 3 * 1e18 |    1.0000000000000000002 | 1.0000000000000000002 |
2274     : | 0 + 1 / 2 * 3 * 1e18 |    0.0000000000000000002 | 0.0000000000000000002 |
2275     : |----------------------+--------------------------+-----------------------|
2276     : #+TBLFM: $2 = $1; p20 f19 :: $3 = $1; p20 f-19
2278     : |----------------------+--------------------------+-----------------------|
2279     : | number               |                 +.0; f19 |             +.0; f-19 |
2280     : |----------------------+--------------------------+-----------------------|
2281     : | 1                    |    1.0000000000000000000 | 1.0000000000000000000 |
2282     : | 0                    |    0.0000000000000000000 | 0.0000000000000000000 |
2283     : |----------------------+--------------------------+-----------------------|
2284     : | 1.0                  |    1.0000000000000000000 | 1.0000000000000000000 |
2285     : | 0.0                  |    0.0000000000000000000 | 0.0000000000000000000 |
2286     : |----------------------+--------------------------+-----------------------|
2287     : | 1 + 1 / 2 * 3 * 1e19 |    1.0000000000000000000 | 1.0000000000000000000 |
2288     : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
2289     : |----------------------+--------------------------+-----------------------|
2290     : | 1 + 1 / 2 * 3 * 1e18 |    1.0000000000000000002 | 1.0000000000000000002 |
2291     : | 0 + 1 / 2 * 3 * 1e18 |    0.0000000000000000002 | 0.0000000000000000002 |
2292     : |----------------------+--------------------------+-----------------------|
2293     : #+TBLFM: $2 = $1 +.0; p20 f19 :: $3 = $1 +.0; p20 f-19
2295     The =printf= reformatting (=%.19f=) cannot be used with high precision,
2296     see the [[#table-high-precision][previous FAQ entry]].
2298 ** How can I center tables in LaTeX output?
2299    :PROPERTIES:
2300    :CATEGORY: centered-tables-in-latex
2301    :END:
2303 Set the `org-export-latex-tables-centered' to `t':
2305 : (defcustom org-export-latex-tables-centered t
2306 :   "When non-nil, tables are exported in a center environment."
2307 :   :group 'org-export-latex
2308 :   :type 'boolean)
2310 * Markup
2311   :PROPERTIES:
2312   :CUSTOM_ID: Footnotes
2313   :END:
2314 ** How can I get automatic renumbering of footnotes in org-mode?
2315    :PROPERTIES:
2316    :CUSTOM_ID:       footnote-auto-adjust
2317    :END:
2319 You can add the following line to your .emacs file:
2321 : (setq org-footnote-auto-adjust t)
2323 Or, if you prefer, you can turn this option on locally by placing the
2324 following line at the top of your org file:
2326 : #+STARTUP: fnadjust
2328 When auto-adjust is turned on, footnotes in the file with numerical
2329 labels will be renumbered whenever a new footnote is added. Meanwhile,
2330 all footnotes, including those with custom labels such
2331 =[fn:custom-label ]=, will be sorted in the order of their appearance
2332 in the text.
2334 This emulates the footnote behavior that many users may be familiar
2335 with from word-processing programs or from the footnote-mode included
2336 with emacs.
2338 If you do not turn on org-footnote-auto-adjust, you sort and/or
2339 renumber footnotes at any time by calling org-footnote-action with a
2340 prefix argument.
2342 ** Why isn't auto renumbering of footnotes turned on by default?
2343    :PROPERTIES:
2344    :CUSTOM_ID:       why-no-default-auto-adjust
2345    :END:
2347 Org mode has a very robust footnote mechanism allowing for a variety
2348 of types of footnotes. With some of the following footnote notations,
2349 auto-adjust may be either irrelevant or undesired:
2351  - Automatically numbered
2352  - Footnotes with custom labels
2353  - Inline footnotes
2355 In addition, org mode can be customized to place footnotes either at
2356 the end of a document or at the end of the outline heading in which
2357 they appear. Users who change this setting while editing a document
2358 may be disconcerted to find all of their footnotes rearranged
2359 automatically.
2361 ** I have auto-fill-mode set and org-mode is inserting unwanted comment markers!
2362    :PROPERTIES:
2363    :CUSTOM_ID: auto-fill-and-unwanted-comments
2364    :END:
2366 If the following occurs:
2368 #+begin_src org
2369   ,#+OPTIONS: toc:nil
2370   ,Some entered text.
2371   ,# More entered tex.
2372 #+end_src
2374 Make sure that the variable comment-start is nil.
2376 ** Are there any shortcuts for entering source blocks and comment lines?
2377    :PROPERTIES:
2378    :CUSTOM_ID: shortcuts-for-entering-source-blocks
2379    :END:
2381 Org mode has some [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][very convenient markup]] for including literal blocks
2382 and lines of code in a file. (This is especially useful when exporting
2383 documents or using the contributed package [[file:org-contrib/babel/index.org][org-babel]] for executing
2384 blocks of code.)
2386 #+begin_src org
2387   ,#+begin_src perl
2388   ,  print "Hello, world!\n";
2389   ,#+end_src
2390 #+end_src
2392 It can be tiresome to enter the block comment lines manually. There
2393 are several possible shortcuts you can use to enter them:
2395 1) Built-in expansion
2397    - Org mode has a "secret" method of expanding source code blocks
2398      and comment lines.
2400    - If you type "<s" followed by =TAB= or =M-TAB=, a source block will
2401      magically appear.
2403    - For a full list of expansions, type =M-x describe-variable
2404      [RET] org-structure-template-alist=.
2406 2) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Registers]]
2408    - Add the following line to your emacs file:
2410      =(set-register ?p "#+begin_src\n\n#+end_src perl")=
2412    - Then type =C-x r i p= to insert the source block. Please note: if
2413      you save another value to the register "p" with =C-x r s p=, it
2414      will overwrite the setting above for the current emacs session.
2416 3) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Abbrevs]]
2418    - Activate the abbrev minor-mode in org-mode:
2420      + M-x abbrev-mode
2422      + /Permanently/:
2424        + =(add-hook 'org-mode-hook (lambda () (abbrev-mode 1)))=
2426    - In org-mode, type "sbp" (a sample abbreviation for a perl source
2427      block).
2429    - Immediately after "sbp" type =C-x a i l=.
2431    - Enter the expansion:
2433      - =#+begin_src perl[C-q C-j][C-q C-j]#+end_src=
2435      - Note: =C-q C-j= creates a new line in the minibuffer
2437    - Now, whenever, you type sbp followed by =SPACE= or =RET= in an
2438      org-mode buffer, the src block will magically appear.
2440    - To review your list of abbrevs, type =M-x edit-abbrevs=.
2442 4) [[http://www.slashgear.com/nokia-n900-android-dual-boot-hack-video-2371099/][Skeletons]]
2444    - Skeletons offer a simple way of automatically entering text.
2445      Here's a skeleton that queries for the type of block and wraps
2446      the active region inside it:
2448      #+begin_src elisp
2449        (define-skeleton skel-org-block
2450          "Insert an org block, querying for type."
2451          "Type: "
2452          "#+begin_" str "\n"
2453          _ - \n
2454          "#+end_" str "\n")
2455      #+end_src
2457    - Simply type skel-org-block to insert the block.
2459      - You can bind this to a key.
2461      - You can also create an abbrev that invokes this function:
2463        : (define-abbrev org-mode-abbrev-table "blk" "" 'skel-org-block)
2465 5) [[http://code.google.com/p/yasnippet/][Yasnippet]]
2467    - Several org-mode users install yasnippet for convenient, complex
2468      expansion.
2470    - See Bernt Hansen's [[http://doc.norang.ca/org-mode.html#Yasnippets][org-mode setup]] for a good introduction to
2471      yasnippet.
2473 * Capture and remember
2474   :PROPERTIES:
2475   :CUSTOM_ID: Remember
2476   :END:
2477 ** Can I use a variable or a function inside the `org-capture-templates' variable?
2478    :PROPERTIES:
2479    :CUSTOM_ID: variable-inside-capture-templates
2480    :END:
2482 Yes.  Use [[http://www.gnu.org/s/emacs/manual/html_node/elisp/Backquote.html][backquotes]].
2484 E.g. if you have a variable called =org-test-file= and you want the
2485 variable =org-capture-templates= to "understand" (i.e. evaluate)
2486 =org-test-file= when Emacs evaluates the =(setq org-capture-templates
2487 [...])= expression, use backquotes like this:
2489 #+begin_src emacs-lisp
2490 (setq org-capture-templates
2491       `(("t" "Todo" entry (file+headline ,org-test-file "Tasks")
2492        "* TODO %?\n  %i\n  %a")
2493       ("b" "Buy" item (file+olp ,org-test-file "Stuff to Buy" "House")
2494        "")))
2495 #+end_src
2497 ** Can I use the remember buffer to clock a customer phone call?
2498    :PROPERTIES:
2499    :CUSTOM_ID: use-remember-buffer-to-clock-phone-call
2500    :END:
2502   Yes, you can.  Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/5482][setup described by Bernt Hansen]]
2503   and check out (in the same thread) what Nick Docos had to fix to
2504   make Bernt's set-up work for him.
2505 ** Can I automatically start the clock when opening a remember template?
2506    :PROPERTIES:
2507    :CUSTOM_ID: start-clock-when-opening-remember-template
2508    :END:
2510    Yes, this is possible.  Use the following code and make sure that
2511    after executing it, `my-start-clock-if-needed' is in
2512    `remember-mode-hook' /after/ `org-remember-apply-template'.
2514    : (add-hook 'remember-mode-hook 'my-start-clock-if-needed 'append)
2515    : (defun my-start-clock-if-needed ()
2516    :   (save-excursion
2517    :     (goto-char (point-min))
2518    :     (when (re-search-forward " *CLOCK-IN *" nil t)
2519    :       (replace-match "")
2520    :       (org-clock-in))))
2522    Then, when a template contains the key string CLOCK-IN, the clock
2523    will be started.  Starting with Org-mode version 5.20, the clock will
2524    automatically be stopped when storing the remember buffer.
2526 * Searches
2527   :PROPERTIES:
2528   :CUSTOM_ID: Searches
2529   :END:
2530 ** Isearch does not find string hidden in links.  What can I do?
2531    :PROPERTIES:
2532    :CUSTOM_ID: isearch-in-links
2533    :END:
2535   M-x =visible-mode= will display the full link, making them searchable.
2537 ** How can I reduce the amount of context shown in sparse trees?
2538    :PROPERTIES:
2539    :CUSTOM_ID: context-in-sparse-trees
2540    :END:
2542    Take a look at the following variables:
2544    - =org-show-hierarchy-above=
2545    - =org-show-following-headline=
2546    - =org-show-siblings=
2547    - =org-show-entry-blow=
2549    which give command-dependent control over how much context is shown
2550    by a particular operation.
2552 ** How can I combine the results of two calls to =org-occur=?
2553    :PROPERTIES:
2554    :CUSTOM_ID: two-calls-to-org-occur
2555    :END:
2557    You can construct a regular expression that matches all targets you
2558    want.  Alternatively, use a =C-u= prefix with the second and any
2559    further calls to =org-occur= to keep the current visibility and
2560    highlighting in addition to the new ones.
2562 * Agenda
2563   :PROPERTIES:
2564   :CUSTOM_ID: Agenda
2565   :END:
2566 ** How can I change the advanced warning time for deadlines?
2567    :PROPERTIES:
2568    :CUSTOM_ID: warning-period-for-deadlines
2569    :END:
2570 ##<<warning-period-for-deadlines>>
2572 Deadline warnings appear in the daily agenda view a specified number
2573 of days before the deadline is due. The default setting is 14 days.
2574 You can change this with the variable =org-deadline-warning-days=.
2575 (See [[http://orgmode.org/manual/Deadlines-and-scheduling.html#Deadlines-and-scheduling][this section]] of the manual.)
2577 For instance,
2579 : (setq org-deadline-warning-days 30)
2581 would cause warnings for each deadline to appear 30 days in advance.
2583 Naturally, you might not want warnings for all of your deadlines to
2584 appear so far in advance. Thus, you can change the lead time for
2585 individual items as follows:
2587 : * TODO Get a gift for the party
2588 :   DEADLINE: <2009-01-16 Fri -2d>
2590 The "-2d" above changes the lead time for this deadline warning to two
2591 days in advance. You can also use "w" for weeks and "m" for months.
2592 ** How can I postpone a task until a certain date?
2593    :PROPERTIES:
2594    :CUSTOM_ID: deferring-tasks
2595    :END:
2597 The easiest way to postpone a task is to schedule it in the future.
2598 For instance, typing =C-c C-s +2w= on a headline will push a task two
2599 weeks into the future, so that it won't show up on the daily agenda
2600 until two weeks from now.
2602 If you'd like to prevent the task from showing up on your global todo
2603 list, you have a couple of options.
2605 1. You can set the variable =org-agenda-todo-ignore-scheduled= to =t=.
2606    This will exclude any scheduled items from your global list of
2607    active todos (=C-c a t=). (The variable
2608    =org-agenda-todo-ignore-with-date= will exclude both scheduled and
2609    deadline items from your todo list).
2610 2. You can remove the todo keyword from the item (C-c C-t <SPC>). The
2611    item will still appear on your agenda two weeks from today, but it
2612    won't show up on your todo lists.
2613 ** Can I send myself an email containing tasks or other agenda info?
2614    :PROPERTIES:
2615    :CUSTOM_ID: email-containing-tasks-or-other-agenda-info
2616    :END:
2618    Yes.  See [[http://article.gmane.org/gmane.emacs.orgmode/6112][this thread]] on the list.
2620 ** How can I limit the agenda view to my "work" tasks?
2621    :PROPERTIES:
2622    :CUSTOM_ID: limit-agenda-with-tag-filtering
2623    :END:
2625    It is often convenient to group org files into separate categories,
2626    such as "home" and "work" (or "personal" and "professional"). One
2627    of the main reasons for such classification is to create agenda
2628    views that are limited by type of work or area of responsibility.
2629    For instance, while at work, one may want to see only professional
2630    tasks; while away from work, one may want to see only personal
2631    tasks.
2633    One way to categorize files and tasks is to use a "#+FILETAGS"
2634    declaration at the top of each file, such as:
2636    : #+FILETAGS: work
2638    As long as org-use-tag-inheritance is turned on, the filetags will
2639    be inherited by all tasks in the file. A file can have multiple
2640    filetags. And, of course, tags can be added to individual headings.
2642    Tasks can be quickly filtered by tag from within the agenda by
2643    typing "/" and the name of the tag. The full key sequence to filter
2644    for work items in an agenda view would be:
2646    : C-c a a / work [or a tag shortcut]
2648 ** How can I limit the agenda view to a particular category?
2649    :PROPERTIES:
2650    :CUSTOM_ID: limit-agenda-with-category-match
2651    :END:
2653    Another way to filter agenda views by type of work is to use a
2654    "#+CATEGORY" declaration at the top of each file, such as:
2656    : #+CATEGORY: work
2658    Categories can also be added to individual headings within a file:
2660    : * Big project
2661    :   :PROPERTIES:
2662    :   :CATEGORY: work
2663    :   :END:
2665    All todos belonging to the category "work" can be found a with a
2666    simple tags-todo search:
2668    : C-c a M
2670    At the prompt, type:
2672    : CATEGORY="work"
2674    The same results can be achieved with custom agenda commands, such as:
2676 #+BEGIN_SRC emacs-lisp
2677 (setq org-agenda-custom-commands
2678       '(("h" tags-todo "CATEGORY=\"home\"")
2679         ("w" tags-todo "CATEGORY=\"work\"")
2680         ;; other custom agenda commands here
2681         ))
2682 #+END_SRC
2684 ** How can include all org files in a directory in my agenda?
2685    :PROPERTIES:
2686    :CUSTOM_ID: set-agenda-files-using-wildcards
2687    :END:
2689 You can simply include the directory (as one of the items) in the
2690 value of the variable org-agenda-files:
2692 : (setq org-agenda-files '("/my/special/path/org/"))
2694 There is another way of accomplishing the same end:
2696 : (setq org-agenda-files (file-expand-wildcards "/my/special/path/org/*.org"))
2698 ** Why aren't items disappearing from my agenda once they are marked done?
2699    :PROPERTIES:
2700    :CUSTOM_ID: removing-done-items-from-agenda
2701    :END:
2703 If items remain on your daily/weekly agenda after they are marked
2704 done, check the configuration of the following variables:
2706 : org-agenda-skip-scheduled-if-done
2707 : org-agenda-skip-deadline-if-done
2708 : org-agenda-skip-timestamp-if-done
2710 For instance, type:
2712 : M-x customize-variable RET org-agenda-skip-scheduled-if-done
2714 If this variable is turned off (=nil=), then scheduled items will
2715 remain on the agenda even after they are marked done.
2717 If the variable is turned on (=t=), then scheduled items will
2718 disappear from the agenda after they are marked done.
2720 If these settings seem not to behave the way you expect, then make
2721 sure you understand [[scheduled-vs-deadline-vs-timestamp][the
2722 difference between SCHEDULED, DEADLINE, and timestamps]].
2724 ** How do I keep repeating timestamps from being displayed multiple times?
2725    :PROPERTIES:
2726    :CUSTOM_ID: repeating-timestamps-show-once
2727    :END:
2729 To show only the /current/ instance of a repeating timestamp, put the
2730 following in your .emacs:
2732 #+begin_src emacs-lisp
2733 (setq org-agenda-repeating-timestamp-show-all nil)
2734 #+end_src
2736 ** What is the difference between SCHEDULED, DEADLINE, and plain timestamps?
2737    :PROPERTIES:
2738    :CUSTOM_ID: scheduled-vs-deadline-vs-timestamp
2739    :END:
2741 1. SCHEDULED items (set with =C-c C-s=) will appear on your agenda on
2742    the day they are scheduled and on every day thereafter until they
2743    are done. Schedule a task if you want to be reminded to do
2744    something beginning on a certain day and until it is done.
2746    : ** TODO Scheduled item
2747    :    SCHEDULED: <2009-03-01 Sun>
2749 2. Items with a DEADLINE timestamp (set with =C-c C-d=) appear on your
2750    agenda in advance of the when they are due and remain on your
2751    agenda until they are done. Add a DEADLINE to an item if you want
2752    to make sure to complete it by a certain date. (The variable
2753    org-deadline-warning-days determines how far in advance items with
2754    deadlines will show up in the agenda. See [[warning-period-for-deadlines][this FAQ]] for more
2755    information.)
2757    : ** TODO Item with a deadline
2758    :    DEADLINE: <2009-01-20 Tue>
2760 3. An active timestamp (set with =C-c .=) will appear on your agenda
2761    only on the day it is scheduled. Use a timestamp for appointments
2762    or any reminders you want to show up only on a particular day.
2764    : ** TODO Item with an active timestamp
2765    : <2009-04-18 Sat>
2767 Note: items with inactive timestamps (set with C-c ! and marked by
2768 square brackets) will not show up in the agenda at all.
2770 ** Can I add files recursively to my list of agenda files?
2771    :PROPERTIES:
2772    :CUSTOM_ID: set-agenda-files-recursively
2773    :END:
2775 Yes, you can use the library "find-lisp."
2777 : (load-library "find-lisp")
2778 : (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$"))
2780 This will add all files ending in =org= in the directory "~/org"
2781 and all of its subdirectories to your list of agenda files.
2783 If on a *nix machine, you can also use the find utility, which can be
2784 faster than the find-lisp library:
2786 : (setq org-agenda-files
2787 :       (mapcar 'abbreviate-file-name
2788 :               (split-string
2789 :                (shell-command-to-string "find ~/org -name \"*.org\"") "\n")))
2792 See [[http://thread.gmane.org/gmane.emacs.orgmode/8992][this thread]] on the mailing list for more information.
2794 ** Why does an item appearing at the wrong time of day in my agenda?
2795    :PROPERTIES:
2796    :CUSTOM_ID: agenda-wrong-time-of-day
2797    :END:
2799 When preparing the agenda view, org-mode scans each relevant headline
2800 for a time designation. This approach is very nice for adding
2801 free-form timestamps to an item for scheduling. Thus, either of the
2802 following work would work to schedule an item at 10:00am:
2804 #+begin_src org
2805 ,** 10:00am Get dried ice at the magic store
2806 ,   SCHEDULED: <2009-05-27 Wed>
2807 #+end_src
2809 #+begin_src org
2810 ,** Get dried ice at the magic store
2811 ,   SCHEDULED: <2009-05-27 Wed 10:00>
2812 #+end_src
2814 To enable this flexibility, org-mode scans the entire headline for
2815 time of day notation. A potential problem can arise if you use
2816 inactive timestamps in the headline to note when an item was created.
2817 For example,
2819 #+begin_src org
2820 ,** Get dried ice at the magic store [2009-05-26 Tue 12:58]
2821 ,   SCHEDULED: <2009-05-27 Wed>
2822 #+end_src
2824 Org mode would interpret the time in the inactive timestamp as a
2825 time-of-day indicator and the entry would appear in your agenda at
2826 12:58.
2828 If you would like to turn off the time-of-day search, you can
2829 configure the variable =org-agenda-search-headline-for-time= (requires
2830 org-mode >= 6.24).
2832 ** How can I change the visibility of an item from the agenda?
2833    :PROPERTIES:
2834    :CUSTOM_ID: cycling-visibility-from-agenda
2835    :END:
2837 You can add a keybinding as follows:
2839 #+begin_src emacs-lisp
2840 (add-hook 'org-agenda-mode-hook
2841    (lambda ()
2842      (define-key org-agenda-mode-map " " 'org-agenda-cycle-show)))
2843 #+end_src
2845 Then, as you press SPACE on an item on the agenda, it will cycle the
2846 visibility of its original location.
2848 ** Is there any way to set org-mode so that tags don't appear in the agenda view?
2850 See the =org-agenda-remove-tags= variable.
2852 ** I work late at night! How can I extend my current day past midnight?
2853    :PROPERTIES:
2854    :CUSTOM_ID: org-extend-today-until
2855    :END:
2857 If you work past midnight, you may not want your daily agenda view to
2858 switch to the next day at 12 a.m. (the default). To extend your day,
2859 simply set the value of org-extend-today-until to a positive number
2860 corresponding to the number of hours you work past midnight. For
2861 example, the following setting will cause the current day to extend
2862 until 6 a.m.
2864 : (setq org-extend-today-until 6)
2866 * Appointments/Diary
2867   :PROPERTIES:
2868   :CUSTOM_ID: Appointments/Diary
2869   :END:
2870 ** Is it possible to include entries from org-mode files into my emacs diary?
2871    :PROPERTIES:
2872    :CUSTOM_ID: include-entries-from-org-mode-files-into-emacs-diary
2873    :END:
2875    Since the org-mode agenda is much more powerful and can contain the
2876    diary, you should think twice before deciding to do this.  If you
2877    insist, however, integrating Org-mode information into the diary is
2878    possible.  You need to turn on /fancy diary display/ by setting in
2879    .emacs:
2881    : (add-hook 'diary-display-hook 'diary-fancy-display)
2883    Then include the following line into your ~/diary file, in
2884    order to get the entries from all files listed in the variable
2885    =org-agenda-files=
2887    : &%%(org-diary)
2889    You may also select specific files with
2891    : &%%(org-diary) ~/path/to/some/org-file.org
2892    : &%%(org-diary) ~/path/to/another/org-file.org
2894    If you now launch the calendar and press ~d~ to display a
2895    diary, the headlines of entries containing a timestamp, date range,
2896    schedule, or deadline referring to the selected date will be listed.
2897    Just like Org-mode's agenda view, the diary for /today/ contains
2898    additional entries for overdue deadlines and scheduled items.  See
2899    also the documentation of the =org-diary= function.  Under XEmacs, it
2900    is not possible to jump back from the diary to the org, this works
2901    only in the agenda buffer.
2902 ** I want to add my Org scheduled/deadlined entries in my diary!
2903    :PROPERTIES:
2904    :CUSTOM_ID: add-Org-scheduled/deadlined-entries-to-diary!
2905    :END:
2907   Put this in your ~/.diary:
2909   : &%%(org-diary :scheduled :timestamp :deadline)
2911 ** How can I set up automatic reminders based on Org information?
2912    :PROPERTIES:
2913    :CUSTOM_ID: automatic-reminders
2914    :END:
2916   See [[http://article.gmane.org/gmane.emacs.orgmode/5271][this post]] by N. Dokos on the list. See also Russell Adams's hack in [[file:org-hacks.org::#agenda-appt-zenity][org-hacks]].
2917 ** How can I make =appt= notice my Org appointments?
2918    :PROPERTIES:
2919    :CUSTOM_ID: appt-notice-my-Org-appointments
2920    :END:
2922   : M-x org-agenda-to-appt RET
2924 ** How can I create more complex appointments in my org-files?
2925    :PROPERTIES:
2926    :CUSTOM_ID: diary-sexp-in-org-files
2927    :END:
2929 Org-mode's active timestamps work very well for scheduling individual
2930 or recurring appointments, such as:
2932 #+begin_src org
2933   ,* 8:00am Dentist appointment <2009-01-16 Fri>
2934 #+end_src
2937 #+begin_src org
2938   ,* Vacation
2939   ,  <2009-03-20 Fri>--<2009-04-01 Wed>
2940 #+end_src
2944 #+begin_src org
2945   ,* Weekly meeting with boss
2946   ,  <2009-01-20 Tue 14:00 +1w>
2947 #+end_src
2949 Sometimes, however, you need to set up more complicated recurring
2950 appointments. Org-mode has built-in support for many of
2951 [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Sexp-Diary-Entries.html][the
2952 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
2953 instance, that you teach a class that meets every Monday evening
2954 between February 16 and April 20, 2009. The way to enter this an
2955 org-mode file is:
2957 #+begin_src org
2958   ,** Class 7:00pm-9:00pm
2959   ,   <%%(and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009))>
2960 #+end_src
2962 The expression above designates all Mondays that fall between February
2963 16 and April 20. How exactly does it work?
2965  - (and... :: Indicates that *both* of the conditions that follow have
2966           to be true.
2968    - (= 1 (calendar-day-of-week date)) :: Is the day of the week a
2969         Monday?
2971        - Note: the function calendar-day-of-week converts the date to the day of week
2972          expressed in numeric form, where 0 = Sunday, 1 = Monday, and so on.
2974    - (diary-block 2 16 2009 4 20 2009) :: Does the date fall between
2975         these two dates?
2977 You can make a sexp as complex as you like. If you wanted to omit a
2978 week because of holidays, for instance, you could add another
2979 condition to the sexp:
2981 #+begin_src org
2982   ,** Class 7:00pm-9:00pm
2983   ,   <%%(unless (diary-block 3 9 2009 3 13 2009) (and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009)))>
2984 #+end_src
2986 The sexp above would omit Monday during the week of March 9, 2009. For
2987 another way to accomplish the same thing, see [[org-diary-class][this FAQ]].
2989 Another diary function commonly used for more complex scheduling is
2990 diary-float. For instance,
2992 #+begin_src org
2993   ,* Monthly meeting
2994   ,  <%%(diary-float t 3 3)>
2995 #+end_src
2997 ...would appear on the third Wednesday of every month.
2999 For more ideas on how to create diary special expressions, see [[http://www.emacswiki.org/cgi-bin/wiki/DiaryMode][this
3000 page on the Emacs wiki]].
3002 ** How can I schedule a weekly class that lasts for a limited period of time?
3003    :PROPERTIES:
3004    :CUSTOM_ID: org-class
3005    :END:
3007 Org-mode offers a convenient diary sexp function for setting up a
3008 recurring appointment that lasts for a certain period of time, such as
3009 a class. It is called org-class and it can be entered as
3010 follows:
3012 #+begin_src org
3013   ,** Class 7:00pm-9:00pm
3014   ,   <%%(org-class 2009 2 16 2009 4 20 1 10)>
3015 #+end_src
3017 The function above schedules an appointment for every Monday (1)
3018 between February 16 and April 20, 2009, except for ISO week 10 (March
3019 1 to March 7).
3021 If you would prefer not to place the timestamp in the headline, you
3022 can use the following format:
3024 #+begin_src org
3025   ,** Class
3026   ,%%(org-class 2009 2 16 2009 4 20 1 10) 7:00pm-9:00pm Class
3028 #+end_src
3030 In this case, the string following the sexp will be displayed in the
3031 agenda.
3033 The function org-class has the following format:
3035 : (org-class Y1 M1 D1 Y2 M2 D2 DAYNAME &rest SKIP-WEEKS)
3037 Y1/2, M1/2, and D1/2 indicate the beginning and ending dates. DAYNAME
3038 takes the form of a number indicating the day of the week (0 = Sunday,
3039 1 = Monday, and so on...). In addition, one can add an optional
3040 argument SKIP-WEEKS to indicate weeks on the calendar that should be
3041 skipped. This argument should be expressed as an ISO week number. You
3042 can find the number by invoking emacs' built-in calendar (=M-x
3043 calendar=), navigating to the appropriate week, and typing =p c
3044 (calendar-iso-print-date)=.  If one of the SKIP-WEEKS is the symbol
3045 =holidays=, then any holidays known to the calendar are also skipped.
3047 Here is an alternative method, shared by Paul Sexton on the org
3048 mailing list:
3050 Let's say you are taking night classes in Spanish. The class is every
3051 Wednesday evening at 7pm, starting on 18 August, and runs for 8 weeks.
3052 Org-mode's timestamps do not support limited occurrences of recurrent
3053 items -- you have to schedule the item with infinite recurrences, then
3054 delete it when it finishes.
3056 To schedule the Spanish classes, put the following in your =.emacs=:
3058 #+begin_src emacs-lisp
3059   (defun diary-limited-cyclic (recurrences interval m d y)
3060     "For use in emacs diary. Cyclic item with limited number of recurrences.
3061   Occurs every INTERVAL days, starting on YYYY-MM-DD, for a total of
3062   RECURRENCES occasions."
3063     (let ((startdate (calendar-absolute-from-gregorian (list m d y)))
3064           (today (calendar-absolute-from-gregorian date)))
3065       (and (not (minusp (- today startdate)))
3066            (zerop (% (- today startdate) interval))
3067            (< (floor (- today startdate) interval) recurrences))))
3068 #+end_src
3069 The item in the org file looks like this:
3071 #+begin_src org
3072   ,** 19:00-21:00 Spanish lessons
3073   ,   <%%(diary-limited-cyclic 8 7 8 18 2010)>
3074 #+end_src
3076 ** How can I set an event to occur every day except Saturday and Sunday?
3078 #+begin_src org
3079   ,** Daily meeting
3080   ,   <%%(memq (calendar-day-of-week date) '(1 2 3 4 5))>
3081 #+end_src
3083 ** How do I schedule events relative to Easter Sunday?
3085    Easter's date moves around from year to year according to a
3086    complicated set of criteria which I do not claim to understand.
3087    However the following code will allow you to schedule recurring
3088    events relative to Easter Sunday.
3090    Note: the function da-easter is from:
3091    http://github.com/soren/elisp/blob/master/da-kalender.el
3093    Put the following in your .emacs:
3095 #+begin_src emacs-lisp
3096   (defun da-easter (year)
3097     "Calculate the date for Easter Sunday in YEAR. Returns the date in the
3098   Gregorian calendar, ie (MM DD YY) format."
3099     (let* ((century (1+ (/ year 100)))
3100            (shifted-epact (% (+ 14 (* 11 (% year 19))
3101                                 (- (/ (* 3 century) 4))
3102                                 (/ (+ 5 (* 8 century)) 25)
3103                                 (* 30 century))
3104                              30))
3105            (adjusted-epact (if (or (= shifted-epact 0)
3106                                    (and (= shifted-epact 1)
3107                                         (< 10 (% year 19))))
3108                                (1+ shifted-epact)
3109                              shifted-epact))
3110            (paschal-moon (- (calendar-absolute-from-gregorian
3111                              (list 4 19 year))
3112                             adjusted-epact)))
3113       (calendar-dayname-on-or-before 0 (+ paschal-moon 7))))
3116   (defun da-easter-gregorian (year)
3117     (calendar-gregorian-from-absolute (da-easter year)))
3119   (defun calendar-days-from-easter ()
3120     "When used in a diary sexp, this function will calculate how many days
3121   are between the current date (DATE) and Easter Sunday."
3122     (- (calendar-absolute-from-gregorian date)
3123        (da-easter (calendar-extract-year date))))
3124 #+end_src
3126     Now we can schedule the public holidays associated with Easter as
3127     recurring events. Good Friday is 2 days before "Easter", Easter
3128     Monday is one day after.
3130 #+begin_src org
3131   ,* Good Friday
3132   ,  <%%(= -2 (calendar-days-from-easter))>
3134   ,* Easter Sunday
3135   ,  <%%(= 0 (calendar-days-from-easter))>
3137   ,* Easter Monday
3138   ,  <%%(= 1 (calendar-days-from-easter))>
3139 #+end_src
3140    [Source: Posted by Paul Sexton on Org-mode mailing list.]
3142 ** How to schedule public holiday that is "the nearest Monday to DATE"?
3144    In New Zealand each regional capital has an "Anniversary Day". The
3145    date of Auckland's anniversary day is "the nearest Monday to 29
3146    January".
3148    Put this in your =.emacs=:
3150 #+begin_src emacs-lisp
3151   (defun calendar-nearest-to (target-dayname target-day target-month)
3152     "Recurring event that occurs in the nearest TARGET-DAYNAME to
3153   the date TARGET-DAY, TARGET-MONTH each year."
3154     (interactive)
3155     (let* ((dayname (calendar-day-of-week date))
3156            (target-date (list target-month target-day (calendar-extract-year date)))
3157            (days-diff (abs (- (calendar-day-number date)
3158                               (calendar-day-number target-date)))))
3159       (and (= dayname target-dayname)
3160            (< days-diff 4))))
3161 #+end_src
3163    Now we can schedule Auckland Anniversary Day. The first argument,
3164    1, means Monday (days of the week are numbered starting with
3165    Sunday=0).
3167    [Source: Originally posted by Paul Sexton on Org-mode mailing list.]
3169 ** How to schedule public holiday on "the 4th Monday in October"?
3171    This does not require any additions to =.emacs=:
3173 #+begin_src org
3174   ,* Labour Day (NZ)
3175   ,  <%%(diary-float 10 1 4)>
3176 #+end_src
3178 ** Why isn't the agenda showing all the times I put under a single entry?
3179    :PROPERTIES:
3180    :CATEGORY: multiple-timestamps-same-entry
3181    :END:
3183 Probably because you have not set the following variable:
3185 : org-agenda-skip-additional-timestamps-same-entry
3187 The default value of this variable is t, which means that entries with
3188 multiple timestamps, such as the following...
3190 #+begin_src org
3191   ,* Work really, really hard
3192   ,  <2010-11-20 Sat 10:00>
3193   ,  <2010-11-20 Sat 14:00>
3194 #+end_src
3196 ...will only appear in the agenda at the time specified by the first
3197 timestamp. If you set org-agenda-skip-additional-timestamps-same-entry
3198 to nil, the item will appear will appear at all the times you specify.
3200 ** Can I import iCal events/appts from Gnus?
3202 Yes.  Vagn Johansen wrote [[http://ozymandias.dk/emacs/org-import-calendar.el][org-import-calendar.el]] which lets you do this.
3204 * Export
3205   :PROPERTIES:
3206   :CUSTOM_ID: Export
3207   :END:
3208 ** Can I get TODO items exported to HTML as lists, rather than as headlines?
3209    :PROPERTIES:
3210    :CUSTOM_ID: export-TODO-items-as-lists
3211    :END:
3213    If you plan to use ASCII or HTML export, make sure things you want to
3214    be exported as item lists are level 4 at least, even if that does
3215    mean there is a level jump.  For example:
3217    : * Todays top priorities
3218    : **** TODO write a letter to xyz
3219    : **** TODO Finish the paper
3220    : **** Pick up kids at the school
3222    Alternatively, if you need a specific value for the heading/item
3223    transition in a particular file, use the =#+OPTIONS= line to
3224    configure the H switch.
3226    : #+OPTIONS:   H:2; ...
3228 ** Can I export only a single subtree?
3229    :PROPERTIES:
3230    :CUSTOM_ID: export-single-subtree
3231    :END:
3233 If you want to export a subtree, mark the subtree as region and then
3234 export. Marking can be done with =C-c @ C-x C-x=, for example.
3236 Alternatively, you can select option =1= in the org export dispatcher
3237 (e.g.., =C-c C-e 1 h= to export the current subtree to html).
3239 By default, the title of the exported file will be set to the heading
3240 of the subtree. You can, however, [[#export-options-for-subtree][customize the title and other export
3241 options]].
3243 ** How can I customize export options for a single subtree?
3244    :PROPERTIES:
3245    :CUSTOM_ID: export-options-for-subtree
3246    :END:
3248 You can set unique export options for a [[#export-single-subtree][single subtree]] by using
3249 properties. Relevant properties include:
3251  - EXPORT_TITLE
3252  - EXPORT_AUTHOR
3253  - EXPORT_DATE
3254  - EXPORT_FILE_NAME
3255  - EXPORT_OPTIONS (corresponds to the =#+OPTIONS:= [[http://orgmode.org/manual/Export-options.html#Export-options][configuration line]])
3257 ** How can I tell my calendar web application about appointments in my agenda files?
3259 Here is what you need to do:
3261 1. a script that calls Emacs in batch mode and produce a .ics file
3262 2. a script that uploads this .ics file somewhere on the web
3263 3. tell your webapp to fetch this .ics file on the web
3265 Here is the script I use for the first step:
3267 #+begin_src shell-script-mode
3268 #!/bin/bash
3270 /usr/local/bin/emacs --batch --eval \
3271 "(progn (load-file \"~/install/git/org-mode/org.el\") \
3272         (load-file \"~/elisp/config/org-batch-config.el\") \
3273         (setq org-combined-agenda-icalendar-file \"~/org/cal/org.ics\")
3274         (setq org-agenda-files (quote (\"~/org/bzg.org\"))))" \
3275     -f org-export-icalendar-combine-agenda-files
3276 #+end_src
3278 Depending on your configuration, you might change the load sequence.
3280 Here is the script I use for the second step:
3282 #+begin_src shell-script-mode
3283 #!/bin/bash
3284 /usr/bin/rsync -rtv ~/org/org.ics -e ssh me@my_server:/home/me/public_html/
3285 #+end_src
3287 Note: if you want to cron this rsync script, you will need to let
3288 =my_server= to know about your SSH public key.  Check [[http://troy.jdmz.net/rsync/index.html][this page]] as a
3289 starter.
3291 Now you can cron the two scripts above and your webapp will always be
3292 up to date with your Org agendas.
3294 Also see [[http://orgmode.org/org.html#Exporting-Agenda-Views][Exporting agenda views]] from Org manual.
3296 ** How can I get Mac OSX 10.3 iCal to import my Org-exported .ics files?
3297    :PROPERTIES:
3298    :CUSTOM_ID: iCal-import-ics-files-old
3299    :END:
3301    When using iCal under Apple MacOS X Tiger, you can create a new
3302    calendar /OrgMode/ (the default name for the calendar created by =C-c
3303    C-e c=, see the variables =org-icalendar-combined-name= and
3304    =org-combined-agenda-icalendar-file=).  Then set Org-mode to
3305    overwrite the corresponding file /~/Library/Calendars/OrgMode.ics/.
3306    You may even use AppleScript to make iCal re-read the calendar files
3307    each time a new version of /OrgMode.ics/ is produced.  Here is the
3308    setup needed for this:
3310    : (setq org-combined-agenda-icalendar-file
3311    :     "~/Library/Calendars/OrgMode.ics")
3312    : (add-hook 'org-after-save-iCalendar-file-hook
3313    :  (lambda ()
3314    :   (shell-command
3315    :    "osascript -e 'tell application \"iCal\" to reload calendars'")))
3317 ** How can I get Mac OSX 10.4 or later iCal to import my Org-exported .ics files?
3318    :PROPERTIES:
3319    :CUSTOM_ID: iCal-import-ics-files-new
3320    :END:
3322    For Mac OS X 10.4, you need to write the ics file to
3323    =/Library/WebServer/Documents/= and then subscribe iCalendar to
3324    =http: //localhost/orgmode.ics=
3326 ** How can I remove timestamps and todo keywords from my exported file?
3327    :PROPERTIES:
3328    :CUSTOM_ID: export-options-remove-timestamps
3329    :END:
3331 You can place an options line at the top of your org file:
3333 : #+OPTIONS: <:nil todo:nil
3335 There is a whole host of export options you can set with an in-buffer
3336 options or via global variables. See [[http://orgmode.org/manual/Export-options.html#Export-options][this section]] of the manual for a
3337 full list.
3339 ** How can I preserve faces when I export an agenda from the command line?
3340    :PROPERTIES:
3341    :CUSTOM_ID: preserving-faces-during-batch-export
3342    :END:
3344 Normally, when you export an org file or an agenda view from within
3345 emacs, htmlize will convert your face definitions to direct color css
3346 styles inlined into each =<span>= object, resulting in an HTML output
3347 that preserves the general look of your Org buffers and agenda views.
3349 Let's say you generate an export from the command line, such as the
3350 following:
3352 : emacs -batch -l ~/.emacs -eval '(org-batch-agenda "e")'
3356 : emacs -batch -l ~/.emacs -eval '(org-publish-all)'
3358 In such an instance, the exported HTML will contain only very basic
3359 color styles. The reason is that when Emacs is run in batch mode, it
3360 does not have a display and therefore only rudimentary face
3361 definitions.  If you'd like to use more complex styles, you'll have to
3362 make sure that the export process only assigns classes instead of
3363 direct color values.  This can be done by binding the variable
3364 =org-export-htmlize-output-style= to =css= for the duration of the
3365 export, for example with
3367 : emacs -batch -l ~/.emacs
3368 :   -eval '(let ((org-export-htmlize-generate-css (quote css)))
3369 :            (org-batch-agenda "e"))'
3371 Then you can use a style file to make these classes look any way you
3372 like.  To generate face definitions for a CSS file based on any faces
3373 you are currently using in Emacs, you can use the following command:
3375 : M-x org-export-htmlize-generate-css RET
3377 This will generate a =<style>...</style>= section, the content of
3378 which you can add to your style file.
3380 ** How can I avoid dark color background when exporting agenda to ps format?
3381    :PROPERTIES:
3382    :CUSTOM_ID: avoiding-dark-background-when-exporting-agenda
3383    :END:
3385 Add this to your .emacs and evaluate it.
3387 #+BEGIN_SRC emacs-lisp
3388   (setq org-agenda-exporter-settings
3389         '((ps-print-color-p 'black-white)))
3390 #+END_SRC
3392 ** How can I include e.g. an abstract in export to Latex and HTML?
3393    :PROPERTIES:
3394    :CUSTOM_ID: include-abstract-in-export-to-latex-and-html
3395    :END:
3397 Org does not currently have special markup for abstracts, but for
3398 export purposes, you can extend the block-level structural and
3399 semantic markup in Org with the contributed package [[file:org-contrib/org-special-blocks.org][org-special-blocks]]
3400 (by Chris Gray). To turn it on, put this in your =.emacs=:
3402 : (require 'org-special-blocks)
3404 Now, you can mark up the abstract of your article like this:
3406 : #+BEGIN_ABSTRACT
3407 : Falling apples were observed and compared with pears. Newton's laws
3408 : were confirmed at the 95% confidence level.
3409 : #+END_ABSTRACT
3411 Exporting to Latex wraps this in a
3412 =\begin{abstract}....\end{abstract}= environment, which just works.
3414 HTML export wraps it in a ~<div class="abstract">...</div>~
3415 element. The HTML result won't look like anything special until you
3416 style it. Here is some sample CSS to get you started; put these in
3417 your document header:
3419 : #+STYLE: <style>.abstract {margin: 1em; padding: 1em; border: 1px solid black}
3420 : #+STYLE: .abstract:before {content: "Abstract: "; font-weight: bold}</style>
3422 Generally, =#+begin_foo= will work for any simple Latex =foo=
3423 environment not supported by existing Org markup.
3425 If you need to pass parameters, process the block content in some way,
3426 or support other exporters, you may want to consider whether you can
3427 customize it using Eric Schulte's [[file:org-contrib/org-exp-blocks.org][org-exp-blocks]] instead.
3429 ** How can I get colored source code when exporting to LaTeX?
3430    :PROPERTIES:
3431    :CUSTOM_ID: fontified_source_code_w_latex
3432    :END:
3434 As of Sun Aug 9 2009 the "current" version of Org-mode (see
3435 [[keeping-current-with-Org-mode-development]]) supports exporting
3436 source code to LaTeX using the listings package.
3438 To turn on listing export add the following to your Org-mode
3439 customization.
3440 #+begin_src emacs-lisp
3441   ;; requite org-latex so that the following variables are defined
3442   (require 'org-latex)
3444   ;; tell org to use listings
3445   (setq org-export-latex-listings t)
3447   ;; you must include the listings package
3448   (add-to-list 'org-export-latex-packages-alist '("" "listings"))
3450   ;; if you want colored source code then you need to include the color package
3451   (add-to-list 'org-export-latex-packages-alist '("" "color"))
3452 #+end_src
3454 The listings package will now be used to fontify source code in your
3455 LaTeX documents.  By default listings will not color any of your
3456 source code.  If you would like to set colors for keywords and
3457 comments in your latex documents you can do so using LaTeX directives
3458 like the following.
3459 #+begin_src latex
3460   \lstset{keywordstyle=\color{blue},
3461     commentstyle=\color{red},
3462     stringstyle=\color{green}
3463   }
3464 #+end_src
3466 of if you want to get even fancier with your colors you can try
3467 something like the following
3468 #+begin_src latex
3469 \definecolor{keywords}{RGB}{255,0,90}
3470 \definecolor{comments}{RGB}{60,179,113}
3471 \definecolor{fore}{RGB}{249,242,215}
3472 \definecolor{back}{RGB}{51,51,51}
3473 \lstset{
3474   basicstyle=\color{fore},
3475   keywordstyle=\color{keywords},
3476   commentstyle=\color{comments},
3477   backgroundcolor=\color{back}
3479 #+end_src
3481 For more complex listings use cases consult the [[ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/listings/listings.pdf][listings manual]].
3483 ** How can I export to Latex Beamer
3484    :PROPERTIES:
3485    :CUSTOM_ID: beamer
3486    :END:
3487 The latex [[http://latex-beamer.sourceforge.net/][Beamer Class]] is a useful class for generating slide shows.
3488 The following can be used to export Org-mode documents to LaTeX
3489 beamer.
3491 Add the following to your Emacs initialization file.
3492 #+begin_src emacs-lisp
3493   (unless (boundp 'org-export-latex-classes)
3494     (setq org-export-latex-classes nil))
3495   (add-to-list 'org-export-latex-classes
3496                '("beamer"
3497                  "\\documentclass[11pt]{beamer}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{hyperref}\n\\usepackage{verbatim}\n"
3498                  ("\\section{%s}" . "\\section*{%s}")
3499                  ("\\begin{frame}\\frametitle{%s}" "\\end{frame}"
3500                   "\\begin{frame}\\frametitle{%s}" "\\end{frame}")))
3501 #+end_src
3503 Then by placing
3504 : #+LaTeX_CLASS: beamer
3505 in the header of your Org-mode document it will automatically export
3506 to the Beamer document class on LaTeX export.  With the above
3507 configuration top-level headers will be mapped to sections in the
3508 Beamer document, second-level headers will be mapped to frames, and
3509 lower level headlines will be mapped to itemize objects.
3511 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
3512 Thomas Dye]].  For a much more complex Beamer setup see the [[http://article.gmane.org/gmane.emacs.orgmode/17767/match=beamer+dokos][email by
3513 Thomas Dye]].
3515 ** How can I use RefTeX in Org-mode files for LaTeX export and in Org-babel LaTeX code blocks?
3516    :PROPERTIES:
3517    :CUSTOM_ID: using-reftex-in-org-mode
3518    :END:
3520 [[http://www.gnu.org/software/auctex/reftex.html][RefTeX]] is an indispensable tool for the author of LaTeX documents.  It
3521 aids in creation of bibliographies, cross-references, indexes, and
3522 glossaries.  RefTeX understands the structure of multi-file LaTeX
3523 documents and is able to collect from them information about the
3524 location(s) of external data stores used in creation of the final
3525 document.  RefTeX was written by Carsten Dominik and is currently
3526 being maintained by the [[http://www.gnu.org/software/auctex/index.html][AucTeX]] project.
3528 *** Using RefTeX In Org-mode Files for LaTeX Export
3529 In Org-mode files for LaTeX export, the trick is to find a way to tell
3530 RefTeX the locations of external data stores.  One way is to set the
3531 variable, =reftex-default-bibliography=.  Add lines like these to
3532 .emacs:
3534 #+begin_src emacs-lisp
3535   (setq reftex-default-bibliography
3536         (quote
3537          ("default.bib" "other-default.bib")))
3538 #+end_src
3540 In practice, this is a limited solution and the
3541 typical user will want to pass this information on a per-file basis.
3542 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
3543 Braindump]].
3545 The first solution, proposed by Mario, enables the RefTeX citation
3546 function in Org-mode.  Add these lines to .emacs:
3548 #+begin_src emacs-lisp
3549   (defun org-mode-reftex-setup ()
3550     (load-library "reftex")
3551     (and (buffer-file-name)
3552          (file-exists-p (buffer-file-name))
3553          (reftex-parse-all))
3554     (define-key org-mode-map (kbd "C-c )") 'reftex-citation))
3555   (add-hook 'org-mode-hook 'org-mode-reftex-setup)
3556 #+end_src
3558 Then add the following lines anywhere in the Org-mode file (Org-mode
3559 will recognize them as LaTeX commands):
3561 #+begin_src org
3562 \bibliographystyle{plain}
3563 \bibliography{BIB-NAME}
3564 #+end_src
3566 With this setup, =C-c )= will invoke =reftex-citation= which will
3567 insert a reference in the usual way:
3569 #+begin_src org
3570   ,* test reftex
3572   ,This is a citation \cite{tierney90}.
3574   ,\bibliographystyle{plain}
3575   ,\bibliography{tsd}
3576 #+end_src
3578 This Org-mode file will export the following LaTeX output:
3580 #+begin_src latex :exports code
3581   % Created 2010-03-22 Mon 14:34
3582   \documentclass[11pt,letter]{article}
3583   \usepackage[utf8]{inputenc}
3584   \usepackage[T1]{fontenc}
3585   \usepackage{hyperref}
3587   \title{test.org}
3588   \author{Tom Dye}
3589   \date{2010-03-22 Mon}
3591   \begin{document}
3593   \maketitle
3595   \setcounter{tocdepth}{3}
3596   \tableofcontents
3597   \vspace*{1cm}
3599   \section{test reftex}
3600   \label{sec-1}
3603   This is a citation \cite{tierney90}.
3605   \bibliographystyle{plain}
3606   \bibliography{tsd}
3608   \end{document}
3609 #+end_src
3612 A second solution, to activate the RefTeX minor mode on a per-file
3613 basis, was posted by Kevin Brubeck Unhammer in response to this idea.
3614 Add the following lines to .emacs:
3616 #+begin_src emacs-lisp
3617   (add-hook ‘org-mode-hook
3618              (lambda ()
3619                (if (member “WRITE” org-todo-keywords-1)
3620                    (org-mode-article-modes))))
3621 #+end_src
3623 where =org-mode-article-modes= is defined as follows:
3625 #+begin_src emacs-lisp
3626   (defun org-mode-article-modes ()
3627     (reftex-mode t)
3628     (bib-cite-minor-mode t)
3629     (and (buffer-file-name)
3630          (file-exists-p (buffer-file-name))
3631          (reftex-parse-all)))
3632 #+end_src
3634 Add the =\bibliographystyle{}= and =\bibliography{}= lines to the
3635 Org-mode file as before and define a TODO keyword, =WRITE=, perhaps
3636 like this:
3638 #+begin_src org
3639   ,#+TODO: TODO(t) STARTED(s) WRITE | DONE(d) DEFERRED(f)
3640 #+end_src
3642 With this setup, you insert a citation with =M-x reftex-citation RET=.
3644 *** Using RefTeX in Org-babel LaTeX Code Blocks
3646 In Org-babel LaTeX code blocks, the trick is to give RefTeX access to
3647 information in other Org-babel LaTeX code blocks.  If you use an Emacs
3648 starter kit where configuration information is held in Org-mode files,
3649 then the second solution is preferable because you won't be asked for
3650 a master file when Emacs is started.  For this reason, the second
3651 solution is modified for use with Org-babel latex code blocks.  No
3652 key-binding is needed here because Org-babel code blocks are edited
3653 within the usual AucTeX environment.
3655 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]])
3656 #+begin_src emacs-lisp
3657   (defun org-mode-article-modes ()
3658     (reftex-mode t)
3659     (and (buffer-file-name)
3660          (file-exists-p (buffer-file-name))
3661          (reftex-parse-all)))
3663   (add-hook 'org-mode-hook
3664             (lambda ()
3665               (if (member "REFTEX" org-todo-keywords-1)
3666                   (org-mode-article-modes))))
3667 #+end_src
3669 Then add a line like the following line to the top of your org-mode file:
3671 #+begin_src org
3672   ,#+TODO: TODO(t) STARTED(s) | DONE(d) DEFERRED(f) REFTEX
3673 #+end_src
3675 When you open an org-mode file with a line like this, RefTeX will
3676 prompt for the master .tex file, which will be parsed in the usual
3677 way.  This means that the .tex file should already exist, perhaps by
3678 tangling the LaTeX preamble and postamble, before
3679 =org-mode-article-modes= is activated for the Org-mode file.
3681 ** How can I use XeLaTeX for LaTeX export instead of pdfLaTeX?
3682    :PROPERTIES:
3683    :CUSTOM_ID: using-xelatex-for-pdf-export
3684    :END:
3685 [[http://en.wikipedia.org/wiki/XeTeX][ XeLaTeX]] is an alternative to pdfLaTeX for typesetting LaTeX
3686 documents. XeTeX can use any fonts installed in the operating system
3687 without configuring TeX font metrics, and can make direct use of
3688 advanced typographic features of OpenType and other font formats. By
3689 default, org-mode exports =org= files to =pdf= via pdfLaTeX.
3691 Here is one way to smoothly incorporate XeLaTeX into org-mode's export
3692 process. This solution takes advantage of [[http://www.phys.psu.edu/~collins/software/latexmk-jcc][latexmk]], a perl script that
3693 intelligently and automatically manages latex compilation. It
3694 is included with TeXLive, but at present the version included is not
3695 quite up-to-date enough for our needs. Version 4.20 and higher
3696 includes an option allowing you to specify which program to use when
3697 "pdflatex" is called. Install a current version of latexmk as per the
3698 instructions on the [[http://www.phys.psu.edu/~collins/software/latexmk-jcc][latexmk]] site. If necessary, disable the older
3699 version that comes with TeXLive. This is likely in =/usr/texbin/=, and
3700 you should rename or remove it. Then you can put the following in your
3701 =~/.emacs.d/= or equivalent:
3703 #+begin_src emacs-lisp
3704   (require 'org-latex)
3705   (setq org-export-latex-listings t)
3707   ;; Originally taken from Bruno Tavernier: http://thread.gmane.org/gmane.emacs.orgmode/31150/focus=31432
3708   ;; but adapted to use latexmk 4.20 or higher.
3709   (defun my-auto-tex-cmd ()
3710     "When exporting from .org with latex, automatically run latex,
3711        pdflatex, or xelatex as appropriate, using latexmk."
3712     (let ((texcmd)))
3713     ;; default command: oldstyle latex via dvi
3714     (setq texcmd "latexmk -dvi -pdfps -quiet %f")
3715     ;; pdflatex -> .pdf
3716     (if (string-match "LATEX_CMD: pdflatex" (buffer-string))
3717         (setq texcmd "latexmk -pdf -quiet %f"))
3718     ;; xelatex -> .pdf
3719     (if (string-match "LATEX_CMD: xelatex" (buffer-string))
3720         (setq texcmd "latexmk -pdflatex=xelatex -pdf -quiet %f"))
3721     ;; LaTeX compilation command
3722     (setq org-latex-to-pdf-process (list texcmd)))
3724   (add-hook 'org-export-latex-after-initial-vars-hook 'my-auto-tex-cmd)
3727   ;; Specify default packages to be included in every tex file, whether pdflatex or xelatex
3728   (setq org-export-latex-packages-alist
3729         '(("" "graphicx" t)
3730               ("" "longtable" nil)
3731               ("" "float" nil)))
3733   (defun my-auto-tex-parameters ()
3734         "Automatically select the tex packages to include."
3735         ;; default packages for ordinary latex or pdflatex export
3736         (setq org-export-latex-default-packages-alist
3737               '(("AUTO" "inputenc" t)
3738                 ("T1"   "fontenc"   t)
3739                 (""     "fixltx2e"  nil)
3740                 (""     "wrapfig"   nil)
3741                 (""     "soul"      t)
3742                 (""     "textcomp"  t)
3743                 (""     "marvosym"  t)
3744                 (""     "wasysym"   t)
3745                 (""     "latexsym"  t)
3746                 (""     "amssymb"   t)
3747                 (""     "hyperref"  nil)))
3749         ;; Packages to include when xelatex is used
3750         (if (string-match "LATEX_CMD: xelatex" (buffer-string))
3751             (setq org-export-latex-default-packages-alist
3752                   '(("" "fontspec" t)
3753                     ("" "xunicode" t)
3754                     ("" "url" t)
3755                     ("" "rotating" t)
3756                     ("american" "babel" t)
3757                     ("babel" "csquotes" t)
3758                     ("" "soul" t)
3759                     ("xetex" "hyperref" nil)
3760                     )))
3762         (if (string-match "LATEX_CMD: xelatex" (buffer-string))
3763             (setq org-export-latex-classes
3764                   (cons '("article"
3765                           "\\documentclass[11pt,article,oneside]{memoir}"
3766                           ("\\section{%s}" . "\\section*{%s}")
3767                           ("\\subsection{%s}" . "\\subsection*{%s}")
3768                           ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
3769                           ("\\paragraph{%s}" . "\\paragraph*{%s}")
3770                           ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
3771                         org-export-latex-classes))))
3773   (add-hook 'org-export-latex-after-initial-vars-hook 'my-auto-tex-parameters)
3774 #+end_src
3776 The =my-auto-tex-cmd= function looks at your =.org= file and checks
3777 whether you've specified which latex to use. If there are no
3778 instructions, it just runs regular old latex. If it finds the string
3779 =LATEX_CMD: pdflatex= in your file, it runs pdflatex. If it finds
3780 =LATEX_CMD: xelatex=, it runs xelatex. Because control is handed off
3781 to latexmk, nothing else is needed: it takes care of figuring things
3782 out so that the references and citations are correct.
3784 The second half of the code above specifies the latex packages that
3785 will be included in the =.tex= file. The variable
3786 =org-export-latex-packages-alist= specifies a list of packages that
3787 are always included in the header of latex documents, regardless of
3788 how they are compiled. The variable
3789 =org-export-latex-default-packages-alist= adds additional packages
3790 depending on whether latex/pdflatex or xelatex is being used. You can
3791 change the content of these as needed.
3793 Finally, the =org-export-latex-classes= variable redefines elements of
3794 the =.tex= file's preamble for the xelatex case. These can also be
3795 customized as needed.
3797 By way of example, an =.org= file you want compiled with xelatex might
3798 contain the following header:
3800 : #+TITLE: My Paper
3801 : #+AUTHOR: Jane Doe
3802 : #+DATE:
3803 : #+OPTIONS: toc:nil num:nil
3804 : #+LATEX_CMD: xelatex
3805 : #+LATEX_HEADER: \setsansfont[Mapping=tex-text]{Unit-Bold}
3806 : #+LATEX_HEADER: \setmonofont[Mapping=tex-text,Scale=MatchLowercase]{PragmataPro}
3807 : #+LATEX_HEADER: \setromanfont[Mapping=tex-text,Numbers=OldStyle]{Minion Pro}
3809 If you always want to have the same font setup in your xelatex
3810 documents, the =fontspec= commands setting the font choices can be
3811 put in the =org-export-latex-classes= setting instead.
3813 The upshot is that when you want to export an =.org= file using
3814 XeLaTeX, you can now simply make sure the line =LATEX_CMD: xelatex= is
3815 in your =.org= file, then do =C-c C-e d= as usual, and org-mode, with
3816 latexmk in the background, does the rest for you.
3818 ** Why is my exported PDF file almost unreadable?
3819    :PROPERTIES:
3820    :CUSTOM_ID: unreadable-pdfs
3821    :END:
3823 Some PDF viewers (earlier versions (< v6) of Acrobat Reader, Evince,
3824 possibly others) do not get along with Adobe Type3 fonts, producing
3825 almost unreadable screen output (printed output is OK). If you see
3826 this, first verify the fonts that your document uses: open it with
3827 Acrobat Reader or Evince, select "Properties" from the "File" menu and
3828 click on the "Fonts" tab; alternatively, you can use the pdffonts
3829 program (part of the xpdf-reader package) from the command line.  If
3830 that is indeed the problem, then either use a different viewer or
3831 install Type1 versions of the problematic fonts. For more details, see
3832 the "PDF export" section of [[./org-dependencies.org][org-dependencies]].
3834 ** Can I add attributes to a link or an image in HTML export?
3835    :PROPERTIES:
3836    :CUSTOM_ID: html-image-and-link-attributes
3837    :END:
3839 Yes.  Excerpt from [[http://orgmode.org/manual/Images-in-HTML-export.html#Images-in-HTML-export][Org's manual]]:
3841 If you need to add attributes to an inlined image, use a `#+ATTR_HTML'.
3842 In the example below we specify the `alt' and `title' attributes to
3843 support text viewers and accessibility, and align it to the right.
3845 :  #+CAPTION: A black cat stalking a spider
3846 :  #+ATTR_HTML: alt="cat/spider image" title="Action!" align="right"
3847 :  [[./img/a.jpg]]
3849 and you could use `http' addresses just as well.
3851 ** How can I export an org file to rtf, odt (Open Office), or doc (Word)?
3852    :PROPERTIES:
3853    :CUSTOM_ID: convert-to-open-office
3854    :END:
3856 Orgmode exports natively to =OpenDocument= format using =org-odt=
3857 module. 
3859 The key bindings for export are =C-c C-e o= and =C-c C-e O=. 
3861 If you don't see =OpenDocumentText= as an option under =C-c C-e= you
3862 need to upgrade to =Org-mode 7.6= by one of the following means:
3864 1. Install org-7.6 using a distribution .zip or .tar.gz file, or
3865    through Git. Then do the following:
3866    1. Add =contrib/lisp= to the load-path in your =.emacs=
3867      #+begin_src emacs-lisp
3868        ;; modify org-root-dir as needed
3869        (add-to-list 'load-path "org-root-dir/contrib/lisp") 
3870     #+end_src
3871    2. Do =M-x customize-variable RET org-modules RET= and enable the
3872       =odt= option
3874 2. Upgrade to (atleast) the =Emacs-24.1 pretest= version. Install
3875    =org-odt= package using =M-x list-packages=.
3877 #+begin_comment
3879 - Use existing exporters
3881   Export to one of org-mode's supported export formats and then use an
3882   external tool or method to convert the exported file to doc or odt.
3884   With simple documents, these methods work well. However for complex
3885   documents containing footnotes, embedded images, math formuale etc
3886   the results may be less than satisfactory. (Note, the lists below
3887   are by no means comprehensive).
3888   1. html -> odt/doc/rtf
3889      - open html in Open Office and save as odt/doc ([[http://permalink.gmane.org/gmane.emacs.orgmode/31482][see this post by
3890         Eric Fraga]])
3891      - [[http://www.artofsolving.com/opensource/pyodconverter][PyODConverter]]
3892      - [[http://johnmacfarlane.net/pandoc/][Pandoc]] (this works for LaTeX and docbook as well)
3893      - (Mac only) The [[http://developer.apple.com/library/mac/#DOCUMENTATION/Darwin/Reference/ManPages/man1/textutil.1.html][textutil]] utility bundled with OS X can convert
3894         from html to doc
3895   2. LaTeX -> odt/doc/rtf
3896       - [[http://latex2rtf.sourceforge.net/][LaTeX2rtf]] (works well with index, footnotes, and references)
3897       - [[http://www.tug.org/tex4ht/][TeX4ht]] (works with more complex latex elements, though can be
3898         difficult to install)
3899         - run =mk4ht oolatex file.tex=
3901 See [[http://permalink.gmane.org/gmane.emacs.orgmode/31168][this thread]] for further details.
3902 #+end_comment
3904 ** ODT export aborts on my Windows machine as I don't have zip installed. Where can I find a zip utility?
3905    
3906 You can either use [[http://en.wikipedia.org/wiki/Info-ZIP][Info-ZIP]] or zip package from Cygwin. Please
3907 customize =exec-path= to include the installation directory.
3909 ** I cannot open an exported =*.odt= file in LibreOffice because it is corrupt. What do I do?
3910    :PROPERTIES:
3911    :CUSTOM_ID: debugging-org-odt
3912    :END:
3914 Typically the corruption of =odt= file happens when the XML emitted by
3915 Org is not well-formed according to =OpenDocument schema=.
3917 If you encounter corruption issues please identify the root cause
3918 using one of the methods described below:
3920 - Use an Online validator
3921   - Pass the exported document through the [[http://tools.services.openoffice.org/odfvalidator/][ODF Validator]] and note down
3922     the errors.
3924 - Use Emacs' in-built validator
3925   1. Switch to =*.odt= buffer =(C-x b whatever.odt)=
3926   2. Open the =content.xml= file - =(Hit RET on content.xml)=
3927   3. Do a =C-u C-c C-n= - =(M-x rng-first-error)=
3928   4. Note the error message, the XML markup at the point of error and
3929      the surrounding context.
3931 Once you have identified the error
3932 1. Create a minimal org file that reproduces the error.
3933 2. Post a bug-report to =emacs-orgmode@gnu.org=.
3935 ** How can I specify ODT export styles?
3937 Check the variable =org-export-odt-styles-file=.  Here is its docstring, 
3938 as of Org version 7.8:
3940 : org-export-odt-styles-file is a variable defined in `org-odt.el'.
3941 : Its value is nil
3943 : Documentation:
3944 : Default styles file for use with ODT export.
3945 : Valid values are one of:
3946 : 1. nil
3947 : 2. path to a styles.xml file
3948 : 3. path to a *.odt or a *.ott file
3949 : 4. list of the form (ODT-OR-OTT-FILE (FILE-MEMBER-1 FILE-MEMBER-2
3950 : ...))
3952 : [snip]
3954 : Use "#+ODT_STYLES_FILE: ..." directive to set this variable on
3955 : a per-file basis.  For example,
3957 : #+ODT_STYLES_FILE: "/path/to/styles.xml" or
3958 : #+ODT_STYLES_FILE: ("/path/to/file.ott" ("styles.xml" "image/hdr.png")).
3960 : You can customize this variable.
3962 * Backup
3964 Since =org= files are so central to your life, you probably want to back
3965 them up in a safe place.
3967 If the =org= file you want to back up are in a single directory, the
3968 preferred method is to us a =RCS= (Revision Control System) -- pick up your
3969 favorite ([[http://git-scm.com/][git]], [[http://bazaar.canonical.com/en/][bazaar]], [[http://mercurial.selenic.com/][mercurial]], [[http://subversion.apache.org/][subversion]], [[http://www.nongnu.org/cvs/][cvs]], etc.).  Depending on the
3970 RCS you use and how you use it, you can have a /local/ backup or sync it on
3971 a remote place.
3973 If you want to store all your =org= files from your =$HOME= to a single
3974 =~/org/backup/= folder, you can use this shell script (as [[http://article.gmane.org/gmane.emacs.orgmode/37655][suggested by
3975 Suvayu Ali]]):
3977 #+begin_src sh
3978 mkdir -p ~/org/backup && \
3979 find $HOME -type f -name '*\.org' ! -path "$HOME/org/backup/*" \
3980      -exec cp -t ~/org/backup/ \{\} \;
3981 #+end_src
3983 It will recursively search for =org= files in your =$HOME= directory
3984 (except those in =~/org/backup/=) and copy them to =~/org/backup/=.
3985 You can then use rsync to make sure =~/org/backup/= also lives on a
3986 remote and safe place.
3988 * MobileOrg
3990 ** Which versions of MobileOrg do exist
3991    :PROPERTIES:
3992    :CUSTOM_ID: mobileorg_versions
3993    :END:
3995 - MobileOrg for the iPhone/iPod Touch/iPad series of devices, by
3996   Richard Moreland.  Check out
3997   [[http://mobileorg.ncogni.to/][Richard's page]]
3998 - Matt Jones is developing a feature-equivalent application for
3999   Android, see
4000   [[http://wiki.github.com/matburt/mobileorg-android/][his project page]].
4002 ** What can I do if I don't want to use Dropbox.com
4003    :PROPERTIES:
4004    :CUSTOM_ID: mobileorg_webdav
4005    :END:
4007 Dropbox.com is the easiest way to connect between Emacs and MobileOrg,
4008 you can get a free account there.  If for some reason you cannot or do
4009 not want to use this path, you can use any webdav server.  On this
4010 webdav server you need to create a dedicated directory for the
4011 communication between Emacs and MobileOrg.  If you can mount that
4012 directory locally so that Emacs can directly write to it, just point
4013 to that directory using the variable =org-mobile-directory=.  Using
4014 the /tramp/ method, =org-mobile-directory= may point to a remote
4015 directory accessible through, for example, /ssh/ and /scp/:
4017 #+begin_src emacs-lisp
4018 (setq org-mobile-directory "/scpc:user@@remote.host:org/webdav/")
4019 #+end_src
4021 If Emacs cannot access the WebDAV directory directly using a /tramp/
4022 method, you can use a local directory for staging.  Other means must
4023 then be used to keep this directory in sync with the WebDAV directory.
4024 In the following example, files are staged in =~/stage/=, and Org-mode
4025 hooks take care of moving files to and from the WebDAV directory using
4026 /scp/.
4028 #+begin_src emacs-lisp
4029 (setq org-mobile-directory "~/stage/")
4030 (add-hook 'org-mobile-post-push-hook
4031   (lambda () (shell-command "scp -r ~/stage/* user@@wdhost:mobile/")))
4032 (add-hook 'org-mobile-pre-pull-hook
4033   (lambda () (shell-command "scp user@@wdhost:mobile/mobileorg.org ~/stage/ ")))
4034 (add-hook 'org-mobile-post-pull-hook
4035   (lambda () (shell-command "scp ~/stage/mobileorg.org user@@wdhost:mobile/")))
4036 #+end_src
4038 * Mathjax
4040 ** How to install MathJax on my server?
4042 :PROPERTIES:
4043 :CUSTOM_ID: install_mathjax_on_server
4044 :END:
4046 Org uses MathJax as its default HTML display engine for equations.
4048 Org relies on the version of MathJax available from orgmode.org, but you
4049 might want to use another version and install MathJax on your own server.
4051 1. Download a [[http://sourceforge.net/projects/mathjax/files/][MathJax archive]].
4053 2. Upload it somewhere on your server (say http://me.org/mathjax/)
4055 3. Set the correct path in =org-export-html-mathjax-options= (i.e. replace
4056    http://orgmode.org/mathjax/MathJax.js by
4057    http://me.org/mathjax/MathJax.js)
4059 You can also get [[http://www.mathjax.org/resources/docs/?installation.html][MathJax from git or svn]] -- in this case, be careful not to
4060 forget to unzip the fonts.zip archive in the mathjax directory.
4062 * Tips and Tricks
4064 ** Can I create an Org link from a gmail email?
4066 Yes.  See [[http://comments.gmane.org/gmane.emacs.orgmode/48056][this email]] from Torsten Wagner.
4068 Also check this comment by Tom:
4070 : Since any mail can be found under the All label by definition the
4071 : simplest solution is extracting the message id from the end of
4072 : the current url and then creating a new url pointing to All. 
4073 : This URL should always work unless the mail is deleted:
4075 : https://mail.google.com/mail/?shva=1#all/<msgid>
4077 ** Problems with LaTeX macros with #+latex or #+begin_latex
4078   :PROPERTIES:
4079   :CUSTOM_ID: Problems-with-LaTeX-macros-with-#+latex-or-#+begin_latex
4080   :END:
4081 Org's LaTeX exporter has a difficult job on its hands and even though
4082 it does a great job most of the time, there are times when it falls
4083 short. One situation that has arisen a few times in the past is when a
4084 macro definition or use includes an opening brace, but the
4085 corresponding closing brace is on a different line. That has caused
4086 LaTeX compilation problems or mysterious excisions of content - see
4087 for example the following two threads in the mailing list:
4089  - http://thread.gmane.org/gmane.emacs.orgmode/39308
4090    
4091  - http://thread.gmane.org/gmane.emacs.orgmode/42196
4093 In both cases, the exporter was getting confused by the opening brace
4094 which did not have a corresponding closing brace on the same
4095 line. Although the first of these cases is fixed in current Org, there
4096 might be more such cases or there might be a regression which causes
4097 the incorrect behavior again. While waiting for a fix, it's worth
4098 trying out the simple workaround of including a fake closing brace on
4099 the same line as the opening brace but *commenting it out* so that
4100 LaTeX never sees it.  That is often enough to make the exporter behave
4101 properly. In other words, to take one of the examples above, instead
4102 of writing
4104 : #+latex: \custommacro {
4105 : ...
4106 : #+latex: }
4108 use the following idiom instead:
4110 : #+latex: \custommacro { % hide the closing brace in a LaTeX comment }
4111 : ...
4112 : #+latex: }
4114 I emphasize that this is a workaround, not a fix: if you do run into such
4115 a case and the workaround fixes it, at least you can continue working, but
4116 please submit a bug report so that it can be fixed properly.
4118 ** Inserting a Mairix type link when calling Orgmode capture in VM
4120 See the "rather crude solution" posted in [[http://robert-adesam.blogspot.com/2011/07/orgmode-capture-to-insert-mairix-link.html][this blog entry]] by Robert
4121 Adesam.  
4123 * COMMENT Function to create =CUSTOM_ID=
4125 #+begin_src emacs-lisp
4126   (defun org-faq-make-target ()
4127     "Make hard target for current headline."
4128     (interactive)
4129     (if (not (org-on-heading-p))
4130         (error "Not on a headline"))
4131     (let ((h (org-trim (org-get-heading 'no-tags))))
4132       (if (string-match "[ \t]*\\?\\'" h)
4133           (setq h (replace-match "" t t h)))
4134       (while (string-match "[ \t]+" h)
4135         (setq h (replace-match "-" t t h)))
4136       (org-entry-put nil "CUSTOM_ID" h)))
4137 #+end_src