contribute: Add Davide Peressoni
[worg.git] / org-faq.org
blob6f170e8d2ac164728cbd4edb2325530a8486edad
1 #+title:     Org-mode Frequently Asked Questions
2 #+email:     mdl AT imapmail DOT org
3 #+author:    Worg people
4 #+language:  en
5 #+options:   toc:t H:2
6 #+setupfile: macros.setupfile
7 #+HTML_LINK_UP:    index.html
8 #+HTML_LINK_HOME:  https://orgmode.org/worg/
10 # This file is released by its authors and contributors under the GNU
11 # Free Documentation license v1.3 or later, code examples are released
12 # under the GNU General Public License v3 or later.
14 * Is my question already a Frequently Asked Questions ?
16 You can find answers by asking on the mailing list, but people will
17 probably direct you here, so it is safer to start by checking this
18 FAQ.
20 * What is org-mode?
21   :PROPERTIES:
22   :CUSTOM_ID: What-is-org-mode
23   :END:
25 ** Can Org-mode do "x"? Does org have "x" feature?
26    :PROPERTIES:
27    :CUSTOM_ID: can-org-do-x
28    :END:
30 In its default setup, Org-mode offers a simple outlining and task
31 management environment. But it also has a huge number of features and
32 settings "under the hood." Advanced users have configured Org-mode for
33 almost every conceivable use scenario.
35 Org-mode has a very active community and rich and extensive
36 documentation. Before emailing the mailing list to ask whether
37 Org-mode has a particular feature or setting, please consult the
38 following:
40  - Read/search the manual.
42    - https://orgmode.org/manual/index.html
44      - Make sure to check out the following indexes:
46        - [[https://orgmode.org/manual/Main-Index.html#Main-Index][Main Index]]
47        - [[https://orgmode.org/manual/Key-Index.html#Key-Index][Key Index]]
48        - [[https://orgmode.org/manual/Variable-Index.html#Variable-Index][Variable Index]]
50    - The manual is also easily available from within emacs.
52      To read the manual within emacs, you can evaluate =(info
53      "(org)")= within emacs---i.e., type =C-x C-e= after the closing
54      paragraph of the info expression above.
56      You can also type =M-x info= and navigate to "Org Mode".
58      You can search the entire manual by typing ~C-s term~. Keep
59      pressing ~C-s~ to cycle through the results
61  - Search the mailing list archives at [[http://lists.gnu.org/archive/html/emacs-orgmode/][lists.gnu.org]] or
62    [[https://orgmode.org/list/][orgmode.org/list]].
64    There is a good chance that the feature you are looking for has
65    already been discussed (most likely several times).
67  - Check for features from within emacs.
69    - Emacs has a wonderful built-in help system.
71    - You can browse (and change) most customization options by typing
72      =M-x org-customize=.
74    - You can check for a feature by typing =M-x apropos [RET] [word]= or
75      =C-h a word=. This will search for all functions and variables
76      matching the term (or regexp) you enter.
78    - You can browse (and search for) org functions, variables, and
79      faces by using =M-x describe-variable= (=C-h v=), =M-x
80      describe-function= (=C-h f=), or =M-x describe-face=.
82      After invoking one of these commands, simply type =org-[TAB]= to
83      see a full list of relevant functions or variables or faces. You
84      can then drill down further: e.g., =org-export-[TAB]= for export
85      features.
87  - Checkout the [[file:org-tutorials/index.org][tutorials on Worg]].
89    Several of these tutorials discuss advanced features (e.g.,
90    searching, custom agenda commands, tables, publishing) of Org-mode
91    in depth.
93    There are many other resources on Worg as well:
95    - [[https://orgmode.org/worg/org-configs/index.html][Org Customization]] :: Includes a guide for beginners.
97    - [[https://orgmode.org/worg/org-hacks.html][Org Hacks]] :: User-generated modifications and add-ons.
99    - [[https://orgmode.org/worg/org-glossary.html][Org Glossary]] :: An explanation of basic Org-mode terms and
100                      concepts.
102 ** Can I implement a GTD workflow with Org-mode?
103    :PROPERTIES:
104    :CUSTOM_ID: GTD-workflow-with-Org-mode
105    :END:
107 #+index: GTD!Workflow
109    Yes, you can.  Check for discussions and pointers [[https://orgmode.org/worg/org-gtd-etc.html][here]].
111 ** What is the difference between Org and TaskPaper?
112    :PROPERTIES:
113    :CUSTOM_ID: Org-and-TaskPaper
114    :END:
116 #+index: TaskPaper
118   There is really no difference.  Org is as /simple/ as [[http://hogbaysoftware.com/products/taskpaper][TaskPaper]].  It
119   is just that, when using Org within Emacs, it lets you do many things
120   that you wouldn't be able to do with TaskPaper.  Yes, TaskPaper is
121   fiddle-proof and people using Emacs tends to like fiddling (which is
122   orthogonal to the idea of using todo-lists efficiently), but this is
123   just a matter of discipline and common sense, not one of Org's design.
125   Read [[https://orgmode.org/list/0277B507-1486-4172-B1C6-1B73B84148DD@science.uva.nl][Carsten's enlightening statement]] on this.
126 ** What is the meaning of the Unicorn on Org's website?
127    :PROPERTIES:
128    :CUSTOM_ID: unicorn
129    :END:
131 #+index: Unicorn
133 The Unicorn is the logo of Org-mode because:
135 - Org-mode is the UNICs of ORgaNizers.
137 - Org-mode is an Emacs mode, so it makes sense to use an animal
138   similar or related to the gnu used for GNU Emacs.
140 - Org-mode is meant to show you the way, and an animal with two horns
141   can not do this very well, can it?
143 - Unicorn tears are said to reverse petrification, and wasn't this how
144   we all felt before getting to some degree of time and task
145   management?
147 - It will take forever to learn everything there is to know about a
148   unicorn.
150 - A unicorn is a fabulous creature.  Org-mode wants to be a fabulous
151   creation.
153 Using a unicorn was originally /Bastien Guerry's/ idea.  His friend,
154 the french artist [[http://intemperies.over-blog.com/][Christophe Bataillon]], designed the logo for us, and
155 /Greg Newman/ gave it a refresh some time later.  Bastien writes why
156 he chose a unicorn:
158 #+BEGIN_QUOTE
159 The first reason is not linked to the animal, but to the sounding of the
160 word "Unicorn" - because Org gives you a /uni/que way of producing files
161 in several format (HTML, LaTeX, etc.).
163 The second reason is that a Unicorn doesn't really exist, it is just
164 something you can dream about, and make others believe it does exist.
165 Just like the perfect organizer.
166 #+END_QUOTE
168 There was a [[https://orgmode.org/list/49A5BF02.1090400@rk-f.me][thread about unicorns]] on the mailing list.  [[https://orgmode.org/list/49A5BF02.1090400@rk-f.me][Christopher
169 Suckling]] posted a link showing how to make a simple foldable unicorn
170 (very appropriate for an outlining program!).
172 [[https://orgmode.org/list/18859.6342.338919.506488@nitrogen.rketburt][Tim Burt]] made a very complicated one which is now a treasured
173 possession of the Org-mode author.
175 - Official logo: [[https://orgmode.org/img/org-mode-unicorn.png]]
176   This logo is available in a number of different formats including
177   Photoshop /.psd/ and scaleable vector graphics /.svg/ [[https://orgmode.org/img/][here]].
179 - An [[https://orgmode.org/img/nrocinu4.jpg][alternative version]] from Christophe Bataillon (c):
181 - [[https://orgmode.org/list/B7CC380355F946DF8DCA0392A362CDB6@CUBE][Chris Randle]] made a [[https://orgmode.org/img/nrocinu.txt][text version]] using the logo and [[http://glassgiant.com][glassgiant.com]]:
183 - [[https://orgmode.org/list/43B268EF-3DDC-439F-B0DB-85B09974B037@nf.mpg.de][Stefan Vollmar]] made a [[https://orgmode.org/img/nrocinu.pdf][pdf version]] (here in [[https://orgmode.org/img/nrocinu_pdf.png][png]]) using "a simple
184   threshold technique".
186 - [[https://orgmode.org/list/18859.6342.338919.506488@nitrogen.rketburt][Tim Burt]] made a folded Unicorn to match the spirit of Org - see the
187   whole set of pictures [[http://www.flickr.com/photos/tcburt/sets/72157614543357071/][on his flickr page]].
189 - Are unicorns real?  Answer [[https://orgmode.org/list/87ljrru3vc.fsf@rosslaird.info][here]] by Ross Laird.
191 ** Is Org's documentation written in Org?
193 As of January 2018, yes.  You can access the =.org= source of the manual
194 [[https://code.orgmode.org/bzg/org-mode/raw/master/doc/org-manual.org][on the repository]].
196 Previously, Org mode documentation was written in TeXinfo, which is the
197 standard format for Emacs documentation. Today, the Org mode documentation is exported to TeXinfo with the ox-texinfo exporter written by Jonathan Leech-Pepin and Nicolas Goaziou.
199 ** Is there a bibtex entry for the Org manual?
201 Yes.  Please evaluate this function and run =M-x
202 org-insert-manual-bibtex-citation-at-point RET=.
204 #+begin_src emacs-lisp
205 (defun org-insert-manual-bibtex-citation-at-point ()
206   "Insert a BibTeX citation of the Org manual at point."
207   (interactive)
208   (insert
209   "@book{dominik10:_org_mode_refer_manual,
210   author =       {Carsten Dominik},
211   title =        {The Org-Mode 7 Reference Manual: Organize
212                   Your Life with GNU Emacs},
213   publisher =    {Network Theory},
214   year =         2010,
215   address =      {UK},
216   note =         {with contributions by David O'Toole, Bastien Guerry,
217                   Philip Rooke, Dan Davison, Eric Schulte, and Thomas
218                   Dye}
220   (message "Thanks for quoting the Org manual!")))
221 #+end_src
223 Please check [[file:org-papers.org][the Org papers page]] for more references related to Org.
224 * Mailing list
225 ** I think my Org-mode is broken! How do I report a bug?
226    :PROPERTIES:
227    :CUSTOM_ID: bug-reporting
228    :END:
230 #+index: Bug!Report
232  1. Make sure you are running [[#updating-org][the latest version of Org-mode]].
234  2. Read [[https://orgmode.org/manual/Feedback.html][the Feedback section]] of the manual.
236  3. Provide a minimal example that duplicates the bug.
238     - Create a minimal .emacs file and start emacs with that file as
239       detailed in [[#minimal-emacs][these instructions]].
241     - Create a sample, minimal .org file that reliably reproduces the
242       problem and post it to the mailing list.
244     - Some users call this an "[[#ecm][ECM]]", a French acronym that means a
245       "minimal complete example".
247 ** What is an "ECM"?
248    :PROPERTIES:
249    :CUSTOM_ID: ecm
250    :END:
252    #+index: ECM
254    This is a French acronym used by some mailing list members; it
255    stands for "Exemple Complet Minimal", or "Complete Minimal
256    Example". The term refers to test files that can reliably reproduce
257    a bug with the minimal amount of code. When you report a bug to the
258    mailing list, you should provide a minimal .org file (with no more
259    text than necessary) that demonstrates the bug. See [[https://orgmode.org/list/80oc3s13rg.fsf@somewhere.org][this post]] for
260    more information.
262 ** What should I do before contacting the mailing list?
263    :PROPERTIES:
264    :CUSTOM_ID: when-to-contact-mailing-list
265    :END:
267    The Org-mode mailing list is a high volume list, in which community
268    members discuss use cases, configuration, bugs, and developments.
270    If you are new to Org-mode, please read/search the excellent [[https://orgmode.org/manual/index.html][manual]]
271    (and pay special attention to the indexes) before asking your
272    question.
274    You should also search the mailing list at [[http://lists.gnu.org/archive/html/emacs-orgmode/][lists.gnu.org]] or
275    [[https://orgmode.org/list/][orgmode.org/list]] to see if your issue has already been discussed.
277    See [[#can-org-do-x][this faq]] for more details.
279 ** Why hasn't my email to the mailing list shown up yet?
280    :PROPERTIES:
281    :CUSTOM_ID: ml-post-delay
282    :END:
284    The org-mode mailing list is moderated. Thus, if you are not
285    subscribed to the mailing list, your mail will only appear on the
286    list after it has been approved by a moderator. To ensure that your
287    mail appears quickly, please [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe to the list]].
289 ** I read the mailing list through gmane. Should I subscribe?
290    :PROPERTIES:
291    :CUSTOM_ID: ml-subscription-and-gmane
292    :END:
294    #+index: Gmane
296    The org-mode mailing list is available via nntp at
297    =news.gmane.io/gmane.emacs.orgmode=.  Many participants in the list
298    prefer to read the list in a newsreader, such as Gnus, instead of
299    receiving emails.  If you choose to read the list via nntp, you can
300    still [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe]] to the list and then opt not to receive any emails
301    on the mailman settings page (see the "Mail Delivery" setting).
303    This will ensure that your messages to the list get through
304    quickly, reduce the work load of the mailing list moderators (who
305    need to clear every mail from non-members), and provide more
306    accurate information about the number of list readers.
308 * Keeping current
309   :PROPERTIES:
310   :CUSTOM_ID: Keeping-current
311   :END:
312 ** Upgrading to Org 8.0/master and using the new export engine
313    :PROPERTIES:
314    :CUSTOM_ID: new-exporter-switch
315    :END:
317 #+index: Upgrade!new exporter
318 #+index: Export!new exporter
320 See [[file:org-8.0.org][Upgrading to Org 8.0 (or the current master branch)]].
322 ** My Emacs ships with an older version Org-mode! How do I upgrade?
323    :PROPERTIES:
324    :CUSTOM_ID: updating-org
325    :END:
327 #+index: Upgrade
329 Org-mode develops quickly, which means that versions of Org-mode
330 shipped with Emacs are more or less out-of-date. If you'd like to
331 upgrade to the most recent version of org-mode, you have a number of
332 options.
334  1. Download the [[https://orgmode.org/index.html#sec-3][most recent release]] of org-mode as zip or tarball and
335     follow the [[https://orgmode.org/manual/Installation.html#Installation][installation instructions]] in the manual.
336  2. Clone and install the development git repository as [[#keeping-current-with-Org-mode-development][explained
337     here]]. If you don't want to run the bleeding edge, you can still
338     use git [[#using-stable-releases-only][to track the most recent stable releases]].
339  3. Install and updated org-mode automatically through the Emacs
340     Package Manager as [[#installing-via-elpa][explained in this FAQ]].
342 /Note/: Please also see [[#mixed-install][Is my Orgmode installation mixed?]] for a common
343 issue with mixed installations.
345 ** How do I keep current with bleeding edge development?
346    :PROPERTIES:
347    :CUSTOM_ID: keeping-current-with-Org-mode-development
348    :END:
350 #+index: Bleeding Edge
352    Org-mode is developed in [[https://en.wikipedia.org/wiki/Git_(software)][Git]]. You can keep up-to-date with Org-mode
353    developement by cloning the Org-mode repository and refreshing your
354    copy with latest changes whenever you wish. You only need to use
355    two Git commands (clone and pull.) Here are the steps in brief
356    (assuming a POSIX compatible shell and please customize locations
357    to suit your setup):
359    1. Select a location to house the Org-mode repository (approx. 40
360       MB; includes documentation, compiled elisp files and history
361       going all the way back to v4.12a)
363       : $ mkdir $HOME/elisp && cd $HOME/elisp
365    2. Clone the Org-mode Git repository.
367       Recommended approach:
369       : $ git clone git@code.orgmode.org:bzg/org-mode.git
371       (See [[file:worg-about.org::#contribute-to-worg][The first time you contribute to Worg]] for how to gain access).
373    3. Compile and install Org-mode and build documentation.
375       : $ cd $HOME/elisp/org-mode && make
377       Please note that you can choose to /not/ compile at all and run
378       using source =.el= files only (compiled files speed things up),
379       but you will still need to generate the autoload files.
381       : $ cd $HOME/elisp/org-mode && make uncompiled
383       If you'd like to install org-mode someplace outside the source
384       tree (private or system-wide), you should edit =local.mk= to
385       point to the appropriate install location.  You may need
386       administrator rights to do a system-wide installation.
388       : $ cd $HOME/elisp/org-mode && make install
390    4. This is where you configure Org-mode with Emacs.  Please refer
391       to [[./org-tutorials/index.org][Org tutorials]].
393    5. Keeping up-to-date.
395       Cloning the repository is a one time activity.  From this point
396       onwards you only need to /pull/ the latest changes, which the
397       Makefile is set up to do automatically for certain make targets.
399       : $ cd $HOME/elisp/org-mode && make update
401       or if you immediately want to install as well
403       : $ cd $HOME/elisp/org-mode && make update2
405       Actually in this case it is recommended to run the test suite
406       before installation so that you don't install a version that
407       fails testing.
409       : $ cd $HOME/elisp/org-mode && make up2
411    6. You should reload Org-mode to have the changes take effect (if
412       you are not restarting Emacs, which is recommended).  Also since
413       the intention is to "keep up" with Org-mode, you should visit
414       updated sections of documentation for latest updates (use =git
415       log=.)
417    7. As you use your repository over time it will accumulate loose objects.
418       You can reduce the total size of your git repository with
420       : $ git gc
422       which will consolidate loose git objects into pack files.  This
423       reduces the size of the repository and speeds up data access to
424       the objects.
426 ** How do I update the info manual pages to the latest org-mode version?
427    :PROPERTIES:
428    :CUSTOM_ID: update-info-manual-to-latest
429    :END:
431    *This is not a problem if org-mode is installed system-wide, which
432    automatically takes care of this issue!* Since org-mode already
433    ships with Emacs, a rather common problem among users is "How do I
434    update the info documentation to the latest version of org-mode?".
435    There are three ways to achieve this if for whatever reason you
436    can't install into the standard, system-wide info directory:
438    1. You can set the =INFOPATH= environment variable in your login
439       script like this:
441       #+begin_src shell-script :eval no
442         # ~/.bash_profile
443         export INFOPATH=/path/to/org-mode/info:$INFOPATH
444         ...
445       #+end_src
447       =/path/to/org-mode/info= is wherever you install org-mode.
449    2. You can achieve the same with elisp like this:
451       #+begin_src emacs-lisp :eval no
452         ;; Info directory
453         (add-to-list 'Info-additional-directory-list
454                      (expand-file-name "/path/to/org-mode/info"))
455       #+end_src
457    3. You should specify the same location in the Makefile while
458       installing org-mode like this:
460       #+begin_src makefile-gmake :eval no
461         # Where local software is found
462         prefix=/path/to/emacs-root
463         ...
464         # Where info files go.
465         infodir = $(prefix)/share/info
466       #+end_src
468 ** How can I keep local changes and still track Org-mode development?
469    :PROPERTIES:
470    :CUSTOM_ID: keeping-local-changes-current-with-Org-mode-development
471    :END:
473   There is no need to do this anymore for the purpose of adapting the
474   build system to the local environment, since this can now be
475   specified in =local.mk=.  However, there may be a need to make other
476   local changes to Org.
478   Say you want to make minor changes to the =org.el= or any other
479   version controlled file from Org and you want to keep these changes
480   on top of the =master= branch from Org.  Create a local branch for
481   your changes on top of origin/master as follows:
483   : $ git checkout -b local origin/master
484   : $ git config branch.local.rebase true
485   : # Make your changes to the sources and create a new commit
486   : $ git commit -am 'My local changes to Org'
487   : # Update to a newer version
488   : $ git pull
490   Now each time you pull new commits from the distribution repository
491   your local commits will be rewound and replayed on top of the new
492   origin/master.  You would normally work on your =local= branch which
493   includes your custom commits; there's no need to switch back to the
494   =master= branch.
496   If you get a conflict during a =git pull= (a change in Org and one
497   of your local changes try to alter the same line of code) you will
498   need to edit the file with the conflict to fix up the conflicting
499   lines and then tell git that you have resolved the conflict:
501   1. =git pull= fails with a conflict
502   2. edit the file: look for the conflict markers =>>>>>>>= and
503      =<<<<<<<= and either keep one version or create a new one and
504      remove all conflict markers while doing this.
505   3. =git add= the file to the index to mark the conflict resolved
506   4. =git rebase --continue=
507   5. lather, rinse, and repeat 2-4 as needed
509   Note that it is possible to have silent conflicts when a change in
510   Org and one of your local changes do not edit the same line of code,
511   but are logically incompatible — for example Org might have changed
512   to assume /roses are red/ while you've made a local change that
513   defines /my roses are yellow/ in some other place.  Git will not
514   warn you about such conflicts (it doesn't understand what the code
515   _does_, of course).
517   At anytime during the rebase conflict resolution you can say "oops
518   this is all wrong - put it back the way it was before I did a pull"
519   using
520 : $ git rebase --abort
522 ** How can I use a stable release version instead of the bleeding edge master?
523    :PROPERTIES:
524    :CUSTOM_ID: using-stable-releases-only
525    :END:
527 The =master= branch of the git repository always contains the bleeding
528 edge development code.  This is important for Org's fast development,
529 because code on master gets checked out by many people daily and we
530 quickly receive bug reports if something is wrong.  On rare occasions,
531 this code may not function perfectly for a limited time while we are
532 trying to fix things.  It is therefore recommended to keep a
533 known-good version of org-mode installed outside the source tree and
534 always run the full test suite before using a new version from master.
536 Not everyone like to use this bleeding-edge code and face the danger
537 to hit a surprising bug.  The branch =maint= is specifically for
538 collecting only fixes for known bugs between releases.  If you don't
539 want to wait for a new release, but don't want to live on the bleeding
540 edge, consider using =maint=.
542 From time to time, we make a release by merging all the new features
543 from =master= into =maint=.  This typically happens when the
544 maintainers feel that
546 1. they have reached a good point in the development
547 2. the code has a feature set that should stay and be supported in the
548    future
550 Stable releases are used as the basis for [[https://orgmode.org/index.html#sec-3_3][alternative distributions]] of
551 Org, and they are also the code that gets merged into the Emacs
552 distribution. If you want to work only with stable releases, you can
553 always download [[https://orgmode.org/index.html#sec-3][them here]], but you can also also use the git
554 repository to keep automatically up-to-date with the most recent
555 stable releases (and save bandwidth!). Here's how to do so:
557 *** Run a specific stable release
559 In the repository, do
561 : $ git fetch --tags
562 : $ git tag
564 To see which release tags are available.  Let's say you decide to use
565 =release_7.01f=.
567 : $ git checkout release_7.01f
569 This set the working tree of the repository to the state of Org at the
570 moment of release 7.01f.  You can then run Org from the repository be
571 sure to use the stable release while development continues on the
572 master branch.
574 Later, when we release 7.02, you can switch to that using
576 : $ git fetch --tags                   # to get all the new stuff
577 : $ git tag
578 : $ git checkout release_7.02
580 *** Always run the most recent stable release
582 Alternatively, if you just want to always run whatever the latest
583 stable release is, you can do
585 : $ git checkout -b stable origin/maint
587 and then regularly update this branch by doing
589 : $ git pull
591 ** How can I install an up-to-date version of org-mode without "make" tools?
592    :PROPERTIES:
593    :CUSTOM_ID: installing-org-without-make-tools
594    :END:
596 If you are using org-mode on a computer that lacks developer tools for
597 compiling software, such as [[http://www.gnu.org/software/make/][GNU Make]], you will have to use a
598 *different* installation method than [[https://orgmode.org/manual/Installation.html#Installation][the one outlined in the manual]].
599 Please see this description for [[https://orgmode.org/worg/org-hacks.html#compiling-org-without-make][compiling org-mode without make]] so you
600 can install a recent version of org-mode without using the full build
601 system.
603 ** I don't use git. Can I download bleeding edge .zip and .tar.gz archives?
605    Yes. You can download [[https://orgmode.org/org-latest.zip][org-latest.zip]] or [[https://orgmode.org/org-latest.tar.gz][org-latest.tar.gz]] of Org-mode --
606    these archives are updated every day at midnight.
608    Alternatively, you can download a [[https://code.orgmode.org/bzg/org-mode/releases][tar.gz release archive]].
610 ** How do I install Org-mode through Emacs' Package Manager?
611    :PROPERTIES:
612    :CUSTOM_ID: installing-via-elpa
613    :END:
615    Daily builds of Org-mode are distributed as an ELPA package from both
616    [[http://elpa.gnu.org/packages/][GNU Emacs Lisp Package Archive]] as well as from the [[https://orgmode.org/elpa/][Org-mode Emacs Lisp
617    Archive]].
619    Steps for installing Org with package manager:
620    1) Do =M-x list-packages= to browse available packages.
621    2) If the above command is unavailable you need to [[#installing-elpa][install the package
622       manager]] before proceeding ahead.
623    3) If you see =org= as an available package, skip to step 5.
624    4) If you are here it means that org is unavailable in the GNU's
625       archives.  Report this discrepancy to [[mailto:emacs-orgmode@gnu.org][Orgmode mailing list.]]
627       In the meanwhile, you can manually download the tarball and
628       install it. Refer [[*How do I install Org-mode from a ELPA-compatible tarball?][to this FAQ entry]] for further information.
629    5) Press =i= to mark the package for installation
630    6) Press =x= to install
631    7) Reload Emacs
632    8) Use =M-x locate-library RET org=. If your installation is
633       successful you would something like the following:
635       =Library is file ~/.emacs.d/elpa/org-20110403/org.elc=
637 #   7) If you get the following error "*Failed to download `Org-mode'
638 #      archive.*" in step 2, you can manually download the tarball and
639 #      install it.
641 #   8) Add Orgmode as a package archive. This can be done in two ways:
642 #   9) Use =M-x customize-variable RET package-archives=
643 #   10) Add the following line to your =.emacs= and reload Emacs.
644 #       #+begin_src emacs-lisp
645 #         (add-to-list 'package-archives '("Org-mode" . "https://orgmode.org/elpa/"))
646 #       #+end_src
649 ** How do I install Emacs package manager?
650    :PROPERTIES:
651    :CUSTOM_ID: installing-elpa
652    :END:
654    If you are running Emacs 24 or find the command =M-x list-packages=
655    available you already have the package manager installed.
657    Steps for installing package manager on emacs-23:
659    1. Download the package manager [[http://git.savannah.gnu.org/gitweb/?p=emacs.git;a=blob_plain;hb=ba08b24186711eaeb3748f3d1f23e2c2d9ed0d09;f=lisp/emacs-lisp/package.el][package.el]]
661    2. Add the following to your =.emacs= and reload Emacs.
662       #+begin_src emacs-lisp
663         ;; change "~/elisp/" as appropiate
664         (setq load-path (cons "~/elisp" load-path))
666         ;; Add the below lines *at the beginning* of your .emacs.
667         (require 'package)
668         (package-initialize)
669       #+end_src
671 ** I don't see Org-mode as an installation option in Package Manager Menu?
672    :PROPERTIES:
673    :CUSTOM_ID: why-no-org-in-elpa
674    :END:
676    Emacs Package Manager is a very recent addition to Emacs. Work is
677    under way to have have Org-mode seamlessly integrate with Emacs'
678    Package Manager. As a result, it will be some time before the
679    Org-mode packages are available and usable from either GNU or
680    Org-mode package archives.
682    In the meanwhile, you can install Org-mode via package manager
683    through ELPA-compatible tar. Refer [[#installing-from-elpa-tarball][to this FAQ entry]] for more
684    information.
686 ** How do I install Org-mode from a ELPA-compatible tarball?
687    :PROPERTIES:
688    :CUSTOM_ID: installing-from-elpa-tarball
689    :END:
691 #+index: ELPA
693    Org-mode is distributed as an ELPA-compatible tar which can be used
694    in conjunction with Emacs' package manager.
696    1. If you are already running Org-mode, note the current version
697       reported by M-x org-version.
698    2. Download the latest tarball from [[https://orgmode.org/elpa/][Org-mode repo]].
699    3. Do =M-x package-install-file=. When prompted for =Package file
700       name=, point it to .tar file downloaded in step 2.
702       You will now see Package Manager compiling the files and
703       installing it.
704    4. Reload emacs. This step is very important.
705    5. Note the version of the new installation using M-x
706       org-version. If the new and old versions are different, the
707       installation is done and you are all set to enjoy the updated
708       Org-mode. Otherwise skip to step 6.
709    6. Review you load-path using =C-h v load-path=. Most likely that
710       your old installation path takes precedence over the path chosen
711       by package manager (which is typically
712       =~/.emacs.d/elpa/...=). Fix this anamoly by moving
713       =(package-initialize)= line in .emacs to a more appropriate
714       location.
716 ** Why would I use ELPA tarballs instead of the snapshot tarballs?
717    :PROPERTIES:
718    :CUSTOM_ID: why-elpa
719    :END:
721 #+index: ELPA
723    ELPA-tarballs automate much the process of upgrading org-mode. Much
724    of the following grunt work is done automatically by the Package
725    Manager:
727    1. Downloading, compiling, and activating of org-mode (including
728       setting org-mode's =load-path= and autoloads).
729    2. Updating info files.
731 * Setup
732   :PROPERTIES:
733   :CUSTOM_ID: Setup
734   :END:
736 #+index: Setup
738 ** How can I quickly browse all Org options?
740 #+index: Options
742 =M-x org-customize RET=
744 See also [[file:org-tutorials/org-customize.org][Carsten's Org customize tutorial]] and [[file:org-configs/org-customization-guide.org][this customization guide]]
745 for details.
747 ** Can I use the editing features of org-mode in other modes?
748    :PROPERTIES:
749    :CUSTOM_ID: use-editing-features-in-other-modes
750    :END:
752    Not really---but there are a few editing features you can use in
753    other modes.
755    - For tables there is =orgtbl-mode= which implements the table
756      editor as a minor mode. (To enable, type =M-x orgtbl-mode=)
757    - For ordered lists there is =orgstruct-mode= which allows for easy
758      list editing as a minor mode. (To enable, type =M-x
759      orgstruct-mode=)
761    You can activate these modes automatically by using hooks:
763    : (add-hook 'mail-mode-hook 'turn-on-orgtbl)
764    : (add-hook 'mail-mode-hook 'turn-on-orgstruct)
766    For footnotes, there is the function =org-footnote-action=, which
767    works in non-org buffers. This function is a powerful tool for
768    creating and sorting footnotes. To use it globally, you can add the
769    following keybinding to your =.emacs= file (requires Org 6.17 or
770    greater):
772    : (global-set-key (kbd "C-c f") 'org-footnote-action)
774    For other features you need to switch to Org-mode temporarily, or
775    prepare text in a different buffer.
777 ** Why isn't feature "X" working the way it is described in the manual?
778    :PROPERTIES:
779    :CUSTOM_ID: making-sure-org-mode-is-up-to-date
780    :END:
782 Org-mode develops very quickly. If you are using a version of Org-mode
783 that shipped with emacs, there is a good chance that it is somewhat
784 out of date.
786 Many of the users on the Org-mode mailing list are using either a
787 recent release of Org-mode or the
788 [[https://orgmode.org/index.html#sec-3.2][development version of
789 org-mode from the git repository]].
791 If some settings and features aren't working the way you expect, make
792 sure that the version of the manual you are consulting matches the
793 version of Org-mode you are using.
795    - You can check which version of Org-mode you are using by
796      selection =Org --> Documentation --> Show Version= in the Emacs
797      menu.
799    - The [[https://orgmode.org/manual/index.html][online manual]] at [[https://orgmode.org][orgmode.org]] corresponds to the most recent
800      release.
802    - 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
803      released with the latest official Gnu Emacs release. Compared
804      with the manual at the orgmode.org, the manual at www.gnu.org is
805      somewhat out of date.
807 For instructions on how to stay current with Org-mode, consult [[#keeping-current-with-Org-mode-development][this
808 FAQ]] or follow the instructions on [[https://orgmode.org][the official Org-mode site]].
810 ** Can I get the visibility-cycling features in emacs-lisp-mode?
812 Yes.  This snippet in your =.emacs= will bind =C-M-]= and =M-]= to global
813 and local cycling:
815 #+BEGIN_SRC emacs-lisp
816 (global-set-key (kbd "C-M-]") (lambda () (interactive) (org-cycle t)))
817 (global-set-key (kbd "M-]") (lambda ()
818                               (interactive)
819                               (ignore-errors
820                                 (end-of-defun)
821                                 (beginning-of-defun))
822                               (org-cycle)))
823 #+END_SRC
825 ** Can I get the visibility-cycling features in outline-mode and outline-minor-mode?
826    :PROPERTIES:
827    :CUSTOM_ID: use-visibility-cycling-in-outline-mode
828    :END:
830 #+index: Visibility!Cycling
832    Yes, these functions are written in a way that they are independent of
833    the outline setup.  The following setup provides standard Org-mode
834    functionality in outline-mode on =TAB= and =S-TAB=.  For
835    outline-minor-mode, we use =C-TAB= instead of =TAB=,
836    because =TAB= usually has mode-specific tasks.
838 #+BEGIN_SRC emacs-lisp
839 (add-hook 'outline-minor-mode-hook
840   (lambda ()
841     (define-key outline-minor-mode-map [(control tab)] 'org-cycle)
842     (define-key outline-minor-mode-map [(shift tab)] 'org-global-cycle)))
843 (add-hook 'outline-mode-hook
844   (lambda ()
845     (define-key outline-mode-map [(tab)] 'org-cycle)
846     (define-key outline-mode-map [(shift tab)] 'org-global-cycle)))
847 #+END_SRC
849 Or check out /outline-magic.el/, which does this and also provides
850 promotion and demotion functionality.  /outline-magic.el/ is
851 available at [[http://www.astro.uva.nl/~dominik/Tools/outline-magic.el][Outline Magic]].
853 ** Can I save and restore the visibility state of an org-mode buffer?
854    :PROPERTIES:
855    :CUSTOM_ID: saving-visibility-state
856    :END:
858 #+index: Visibility!Restore
860 Well, no---at least not automatically. You can, however, control the
861 visibility of an org-file or of individual trees by adding
862 instructions to your org file. See [[https://orgmode.org/manual/Visibility-cycling.html#Visibility-cycling][this section of the manual]] for more
863 information.
865 ** How can I keep track of changes in my Org files?
866    :PROPERTIES:
867    :CUSTOM_ID: track-of-changes-in-Org-files
868    :END:
870   Use git to track the history of the files, use a cronjob to check in
871   changes regularly.  Such a setup is described by Bernt Hansen in
872   [[https://orgmode.org/list/87tzilzgkv.fsf@gollum.intra.norang.ca][this message]].
874 ** Can I use Org-mode as the default mode for all README files?
875    :PROPERTIES:
876    :CUSTOM_ID: Org-mode-as-default-mode
877    :END:
879 #+index: default-major-mode
881 Add the following to your .emacs file:
883 : (add-to-list 'auto-mode-alist '("README$" . org-mode))
885 You can even make it the default mode for any files with unspecified
886 mode using
888 : (setq default-major-mode 'org-mode)
890 ** Can I use ido.el for completing stuff in Org?
891    :PROPERTIES:
892    :CUSTOM_ID: ido-complete
893    :END:
895 #+index: Ido
897    Yes, you can.  If you are an ido user and ido-mode is active, the
898    following setting will make Org use =ido-completing-read= for most
899    of its completing prompts.
901 : (setq org-completion-use-ido t)
903 ** Should I use one big org file or multiple files?
904    :PROPERTIES:
905    :CUSTOM_ID: how-to-organize-org-mode-files
906    :END:
908 Org-mode is flexible enough to accomodate a variety of organizational and
909 time management schemes.  Org's [[https://orgmode.org/manual/Document-structure.html#Document-structure][outline cycling and convenient editing and
910 navigation commands]] make it possible to maintain all of your projects and
911 notes in a single file.  But org-mode's [[https://orgmode.org/manual/Hyperlinks.html#Hyperlinks][quick and easy hyperlinks]], along
912 with [[https://orgmode.org/manual/Refile-and-copy.html#Refile-and-copy][easy refiling of notes and todos]], also make it a delight to maintain a
913 private "wiki" consisting of multiple files.
915 No matter how you organize your org files, org-mode's agenda commands
916 make it easy to search all your notes and gather together crucial data
917 in a single view.
919 Moreover, several org-mode settings can be configured either globally in
920 your =.emacs= file or locally (per file or per outline tree).  See the
921 [[https://orgmode.org/manual/index.html#Top][manual]] for more details.  For an example of local customizations see [[#limit-agenda-with-category-match][this
922 FAQ]].
924 Here are a few ideas for organizing org-mode files:
926 - A single file for all your projects and notes.
927 - One file per project.
928 - One file per client.
929 - One file per area of responsibility or type of work (e.g.,
930   household, health, work, etc.).
931 - One file for projects, one for appointments, one for reference
932   material, one for someday/maybe items, etc.
933 - A wiki of hyperlinked files that grows and adapts to meet your
934   needs.
936 For more ideas, see some of the links on the [[file:org-tutorials/index.org][org-tutorial index]] or
937 [[file:org-gtd-etc.org][this page on org-mode and GTD]].
939 ** Why doesn't C-c a call the agenda? Why don't some org keybindings work?
940    :PROPERTIES:
941    :CUSTOM_ID: setting-global-keybindings
942    :END:
944 Org-mode has a few global keybindings that the user must set explicitly in
945 an =.emacs= file.  These keybindings include the customary shortcut for
946 calling the agenda (=C-c a=).  If nothing happens when you type =C-c a=,
947 then make sure that the following lines are in your =.emacs= file:
949 #+BEGIN_SRC emacs-lisp
950   ;; The following lines are always needed.  Choose your own keys.
951   (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
952   (global-set-key "\C-cl" 'org-store-link)
953   (global-set-key "\C-ca" 'org-agenda)
954   (global-set-key "\C-cb" 'org-iswitchb)
955 #+END_SRC
957 You may, of course, choose whatever keybindings work best for you
958 and do not conflict with other modes.
960 Please see [[https://orgmode.org/manual/Activation.html][this section of the manual]] if you have additional
961 questions.
963 ** Why aren't some of the variables I've customized having an effect?
964    :PROPERTIES:
965    :CUSTOM_ID: load-org-after-setting-variables
966    :END:
968 Some org variables have to be set before org.el is loaded or else they
969 will not work. (An example is the new variable
970 =org-enforce-todo-dependencies=.)
972 You should also make sure that you do not require any other =org-...=
973 files in your =.emacs= file before you have set your org variables,
974 since these will also cause org.el to be loaded. To be safe, load org
975 files *after* you have set your variables.
977 ** How can I make sure that timestamps appear in English?
978    :PROPERTIES:
979    :CUSTOM_ID: timestamps-and-system-time-locale
980    :END:
982 If your system's locale is not set to English, but you would like the
983 timestamps in your org-mode files to appear in English, you can set
984 the following variable:
986 #+begin_src emacs-lisp
987   (setq system-time-locale "C")
988 #+end_src
990 ** What does a minimal .emacs look like?
991    :PROPERTIES:
992    :CUSTOM_ID: minimal-emacs
993    :END:
995 Using a stripped down minimal .emacs files removes broken custom
996 settings as the cause of an issue and makes it easy to reproduce for
997 other people.  The example below has system-specific paths that you'll
998 need to change for your own use.
1000 #+begin_src emacs-lisp
1001   (add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
1002   (add-to-list 'auto-mode-alist '("\\.\\(org\\  |org_archive\\|txt\\)$" . org-mode))
1003   (setq org-agenda-files '("/tmp/test.org"))
1004   (require 'org)
1005   (require 'org-habit)
1007   (global-set-key "\C-cl" 'org-store-link)
1008   (global-set-key "\C-ca" 'org-agenda)
1009   (global-set-key "\C-cb" 'org-iswitchb)
1010 #+end_src
1012 You can save the minimal .emacs file to ~/minimal.emacs, add suspect
1013 configuration code to it, then start emacs something like this:
1015 #+begin_src sh
1016 emacs -Q -l ~/minimal.emacs
1017 #+end_src
1019 On OS X, starting emacs with minimal configuration might look
1020 something like this:
1022 #+begin_src sh
1023 /Applications/emacs.app/Contents/MacOS/Emacs -Q -l ~/minimal.emacs
1024 #+end_src
1026 ** What is the best setup for indenting?
1027    :PROPERTIES:
1028    :CUSTOM_ID: indentation
1029    :END:
1031 Indentation, both appearance and behavior, is a matter of personal
1032 preferences.  You may try if the following adjustments suits better
1033 for you than the defaults.  Set ~org-adapt-indentation~ to have
1034 content aligned to headline titles.  Disable ~electric-indent-mode~ to
1035 avoid automatic indentation in response to =RET= key.
1037 In more details, ~org-adapt-indentation~ controls indentation with
1038 regards to previous element.  Apparent effect is increased indentation
1039 for content of deeper nested headings.  The variable accepts three
1040 values: =nil= (no special indentation), =t= (always indent relatively
1041 to the element above) and =headline-data= (only indent the
1042 ~PROPERTIES/LOGBOOK~ drawers relatively to the current level).  Value
1043 =t= is suitable for short entries especially if you plan to share your
1044 documents with someone who does not use Emacs.  If you just want to
1045 make heading level more prominent then consider adding visual left
1046 margin using =#+STARTUP: indent= as described in the [[https://orgmode.org/manual/Clean-View.html#Clean-View][Clean View]]
1047 section of the manual.  The option works without adding extra spaces
1048 to the document text.
1050 Configured indentation may be applied in response to =RET= or to
1051 =C-j= depending on the state of ~electric-indent-mode~.  The following
1052 tables summarizes the difference.  Version number is added to column
1053 header if it describes default settings.
1055 With ~electric-indent-mode~ enabled:
1057 | org-adapt-indentation =>  | nil (Org >= 9.5)       | t (Org 9.4)                | headline-data              |
1058 |---------------------------+------------------------+----------------------------+----------------------------|
1059 | RET after a headline      | Do not indent          | Indent                     | Do not indent              |
1060 | C-j after a headline      | Do not indent          | Do not indent              | Do not indent              |
1061 | RET elsewhere             | Indent wrt previous    | Indent wrt previous        | Indent wrt previous        |
1062 | C-j elsewhere             | Do not indent wrt prev | Do not indent wrt previous | Do not indent wrt previous |
1063 | Insert PROPERTIES/LOGBOOK | Do not indent          | Indent wrt headline        | Indent wrt headline        |
1065 With ~electric-indent-mode~ disabled:
1067 | org-adapt-indentation =>  | nil                 | t                          | headline-data (Org < 9.4)  |
1068 |---------------------------+---------------------+----------------------------+----------------------------|
1069 | RET after a headline      | Do not indent       | Do not indent              | Do not indent              |
1070 | C-j after a headline      | Do not indent       | Indent                     | Do not indent              |
1071 | RET elsewhere             | Do not indent       | Do not indent wrt previous | Do not indent wrt previous |
1072 | C-j elsewhere             | Indent wrt previous | Indent wrt previous        | Indent wrt previous        |
1073 | Insert PROPERTIES/LOGBOOK | Do not indent       | Indent wrt headline        | Indent wrt headline        |
1075 Do not try to avoid or to ignore indentation of heading body or
1076 properties drawer determined by current state of
1077 ~org-adapt-indentation~ and ~electric-indent-mode~ by pressing =C-j=
1078 instead of =RET= (or vice versa). The result is transient and you will
1079 lose formatting when you refile heading or change its level (promote
1080 or demote it).
1082 You may have noticed recommendation to disable ~electric-indent-mode~
1083 to restore behavior prior to Org 9.4.  In Org 9.5
1084 ~org-adapt-indentation~ default value changed to =nil= and, more
1085 importantly, a number of bugs related to indentation were fixed.
1086 Using =RET= with enabled ~electric-indent-mode~ should be convenient
1087 now.  Just customize ~org-adapt-indentation~ variable accordingly to
1088 you preferences.
1090 ** Can I migrate from Planner?
1092    Yes.  This [[http://www.c0t0d0s0.de/plan2org/plan2org.pl][perl script]] or [[http://gitorious.org/bkuhn-small-hacks/org-mode/blobs/master/planner2org.plx
1093 ][this Perl script]] can help.
1095 * Errors and general problems
1096   :PROPERTIES:
1097   :CUSTOM_ID: Errors
1098   :END:
1099 ** Is my Orgmode installation mixed?
1100    :PROPERTIES:
1101    :CUSTOM_ID: mixed-install
1102    :END:
1103    Emacs is distributed with a version of Orgmode bundled with it.  A
1104    common problem among users who install a [[#updating-org][newer version]] of Orgmode
1105    separately is a mixed install where Emacs loads some files from the
1106    bundled and the rest from the latest version.  This can lead to
1107    /unending/ troubles in the future.  With a recent installation of
1108    Org mode =M-x org-version= will indicate if the installation is mixed.
1110    With somewhat older Org mode installations, the procedure is more
1111    involved and indeterminate. An easy first step is to look
1112    at the output of =M-x org-version=.
1113    - Good :: ~Org-mode version 7.8.11 (release_7.8.11-448-g1737d3 @
1114              /path/to/org-mode/lisp/)~
1115    - Bad :: ~Org-mode version 6.33x (release_7.8.11.409.ga3778)~
1117    A second step is to go through the output of =list-load-path-shadows=
1118    line-by-line to get hints to what in your configuration is causing
1119    the issue.  Among the most common reasons is Orgmode gets loaded
1120    before the =load-path= variable is updated to include the
1121    installation directory of the latest Orgmode.  To avoid issues like
1122    this, it is recommended that the load path is updated very early on
1123    in your init file.
1125    /Note:/ The formatting of the version information, as shown in the
1126    examples above, will be different for older Org mode releases,
1127    e.g. ~Org-mode version 7.8.02~.
1129 ** Opening Org files in Emacs leads to a crash
1130    :PROPERTIES:
1131    :CUSTOM_ID: Emacs-crashes-with-org-indent-mode
1132    :END:
1133    The only known case where Org-mode can crash Emacs is when you are
1134    using =org-indent-mode= with Emacs 23.1 (in fact, any version of
1135    Emacs before version 23.1.50.3).  Upgrade to Emacs 23.2 and the
1136    problem should go away.
1138 ** When I try to use Org-mode, I always get the error message =(wrong-type-argument keymapp nil)=
1139    :PROPERTIES:
1140    :CUSTOM_ID: wrong-type-argument-keymapp
1141    :END:
1143    This is a conflict with an outdated version of the /allout.el/, see
1144    the [[https://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section in the manual
1146 ** How can I control the application launched by Org-mode to open a certain file type like pdf, html...?
1147    :PROPERTIES:
1148    :CUSTOM_ID: external-application-launched-to-open-file-link
1149    :END:
1151 If you want special control about how Org-mode opens files, see the
1152 variables =org-file-apps=, =org-file-apps-defaults-gnu=,
1153 =org-file-apps-defaults-macosx=, =org-file-apps-defaults-windowsnt=.
1155 *However*, normally it is best to just use the mechanism the
1156 operating-system provides:
1158 *** GNU/Linux systems
1159     You you have to check your mailcap settings, find the files:
1161     : /etc/mailcap
1162     :
1163     : or
1164     :
1165     : $HOME/.mailcap
1167 and modify them accordingly. Please read their manual entry.
1169 *** Windows systems
1170     + for html pages you may configure the =browse-url-= variables through
1171       the Customize interface,
1172     + the pdf files are automatically opened with Acrobat Reader (if it is
1173       installed)
1175 *** Mac OSX
1176     Change the application responsible for this file type by selecting
1177     such a file in the Finder, select =File->Get Info= from the menu
1178     and select the application to open this file with.  Then, to
1179     propagate the change to all files with the same extension, select
1180     the =Change all= button.
1182 ** Org-mode takes over the TAB key.  I also want to use YASnippet, is there a way to fix this conflict?
1183    :PROPERTIES:
1184    :CUSTOM_ID: YASnippet
1185    :END:
1187 [[http://code.google.com/p/yasnippet/][yasnippet]] is yet another snippet expansion system for Emacs.  It is
1188 inspired by TextMate's templating syntax.
1189 - watch the [[http://www.youtube.com/watch?v=vOj7btx3ATg][video on YouTube]]
1190 - see the [[http://yasnippet.googlecode.com/svn/trunk/doc/index.html][intro and tutorial]]
1192 *Note*: yasnippet is not compatible with =org-indent-mode= currently
1193 there is no known way to use both successfully with =yas/trigger-key=
1194 set to =TAB= (or =[tab]= etc...)
1196 The way Org-mode binds the =TAB= key (binding to =[tab]= instead of
1197 =\t=) overrules yasnippets' access to this key.  The following code
1198 fixes this problem:
1200 #+begin_src emacs-lisp
1201 (add-hook 'org-mode-hook
1202           (lambda ()
1203             (org-set-local 'yas/trigger-key [tab])
1204             (define-key yas/keymap [tab] 'yas/next-field-group)))
1205 #+end_src
1207 If the above code doesn't work (which it may not with later versions
1208 of yasnippet).  Then try the following
1210 #+begin_src emacs-lisp
1211   (defun yas/org-very-safe-expand ()
1212     (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
1214   (add-hook 'org-mode-hook
1215             (lambda ()
1216               ;; yasnippet (using the new org-cycle hooks)
1217               (make-variable-buffer-local 'yas/trigger-key)
1218               (setq yas/trigger-key [tab])
1219               (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
1220               (define-key yas/keymap [tab] 'yas/next-field)))
1221 #+end_src
1223 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]])
1224 with YASnippets for Org-mode.
1226 ** Org-mode takes over the S-cursor keys.  I also want to use CUA-mode, is there a way to fix this conflict?
1227    :PROPERTIES:
1228    :CUSTOM_ID: CUA-mode
1229    :END:
1231 Yes, see the  [[https://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
1233 ** Org-mode takes over the S-cursor keys.  I also want to use windmove.el, is there a way to fix this conflict?
1234    :PROPERTIES:
1235    :CUSTOM_ID: windmove.el
1236    :END:
1238 Yes, see the [[https://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
1240 ** Org behaves strangely: some keys don't work, some features are missing, my settings have no effect, ...
1241    :PROPERTIES:
1242    :CUSTOM_ID: loaded-old-org
1243    :END:
1245 When this sort of things happen, it probably is because Emacs is
1246 loading an old version of Org-mode instead of the one you expected.
1247 Check it with =M-x org-version=.
1249 This happens because Emacs loads first the system org-mode (the one
1250 included with Emacs) before the one in your directory. Check the
1251 =load-path= variable; you might see that your org-mode appears /after/
1252 the system-wide path; this is bad.
1254 You should add your directories to the =load-path= at the beginning:
1256 :  (add-to-list 'load-path "~/.emacs.d/org-mode/lisp")
1258 Function =add-to-list= adds at the beginning. Don't use =append= because
1259 it appends at the end.
1261 This wrong version loading may also happen if you have a byte-compiled
1262 =org.elc= from an old version together with a new =org.el=. Since
1263 Emacs prefers loading byte-compiled files (even if the =.el= is
1264 newer), it will load the old Org-mode.
1266 ** Why doesn't org-batch-agenda work under Win32?
1267    :PROPERTIES:
1268    :CUSTOM_ID: org-batch-agenda-under-win32
1269    :END:
1271 When I run the example batch files to print my agenda to the console
1272 under Win32 I get the failure:
1274 : End of file during parsing
1276 and no agenda is printed.
1278 The problem is the use of single quotes surrounding the eval in the
1279 emacs command-line. This gets confused under Win32. All string
1280 parameters with spaces must be surrounded in double quotes. This means
1281 that double quotes being passed to the eval must be escaped.
1283 Therefore, instead of the following:
1285 : <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
1286 :     -eval '(org-batch-agenda "a")'
1288 you need to use the following:
1290 :  <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
1291 :     -eval "(org-batch-agenda \"a\")"
1293 (all on one line, of course).
1295 ** Org agenda seems very slow
1296    :PROPERTIES:
1297    :CUSTOM_ID: slow-agenda
1298    :END:
1300 If it takes a long time to generate or refresh the agenda, you might
1301 want first check which version of org-mode you are using. There have
1302 been major optimizations of org-agenda since 6.21b, which was the
1303 version of org-mode released with Emacs 23. If you are using 6.21b or
1304 earlier (you can check with =M-x org-version=), then you might want to
1305 consider upgrading to a more recent version of org-mode.
1307 Here are some other ideas for speeding up the agenda:
1309 1. Use a one day agenda view (rather than a seven day view).
1311    =(setq org-agenda-ndays 1)=
1313 2. Archive inactive items to separate files.
1315    =C-c C-x C-s= (org-archive-subtree)
1317 3. Do not include the global todo list in your agenda view.
1319    (setq org-agenda-include-all-todo nil)
1321 4. Make sure that your org files are byte-compiled.
1323    I.e., make sure there are files ending in =.elc= in your org
1324    installation directory.
1326 5. Limit your agenda files (=org-agenda-files=) to files that have
1327    active todos and or projects.
1329    If you have a number of older reference files---i.e., files you
1330    search only occasionally---in your agenda files list, consider
1331    removing them from your agenda files and adding them to
1332    =org-agenda-text-search-extra-files= instead. Similarly, you might
1333    consider searching some of your older reference files with =M-x
1334    grep= so that Org-mode does not have to load them into memory when
1335    the agenda is called.
1337 ** Visual-line-mode doesn't work well with Org-mode
1338    :PROPERTIES:
1339    :CUSTOM_ID: visual-line-mode
1340    :END:
1342 Visual-line-mode "soft wraps" lines so that the visual edge of the
1343 buffer is considered a line break for purposes of navigation, even
1344 though there is no line break in reality.
1346 In older versions of org-mode, org-beginning-of-line and
1347 org-end-of-line do not work well with visual line mode. (The two
1348 commands disregard soft line breaks and move to the beginning and end
1349 of the hard line break.) A patch was introduces to fix this behavior
1350 in July of 2009.
1352 If you are using an older version of Org-mode, you can:
1354 1. Add a hook to turn off visual line mode.
1356 2. Add the following to your =.emacs=:
1358 #+begin_src emacs-lisp
1360 (add-hook 'org-mode-hook
1361   (lambda ()
1362     (define-key org-mode-map "\C-a" 'move-beginning-of-line)
1363     (define-key org-mode-map "\C-e" 'move-end-of-line)))
1365 #+end_src
1366 ** Can I hide blocks at startup?
1368 Yes:
1370 #+begin_src emacs-lisp
1371 (setq org-hide-block-startup t)
1372 #+end_src
1374 Or use
1376 #+begin_src org
1377 ,#+STARTUP: hideblocks
1378 #+end_src
1380 on a per-file basis.
1382 ** After updating Org I get an error about an =invalid function=
1383    :PROPERTIES:
1384    :CUSTOM_ID: invalid-function-error
1385    :END:
1387 In almost all cases an =invalid function= error is caused by an
1388 unclean Org-mode source directory. Cleaning it up and recompiling
1389 should fix the problem
1391 : cd /path/to/orgmode
1392 : make clean
1393 : make
1395 In some cases, bits and pieces of org are loaded from various places (previous
1396 installs, the built-in install of org that came with whatever emacs version you have)
1397 and things get very confused. In all cases, cleaning up every last bit of org installation
1398 from everywhere and reinstalling org from git should restore sanity. See also the [[id:facac2a6-3526-450d-ac42-8d36b16c6bab][next question]].
1400 ** I use starter-kit and I get an error =(void-function org-pop-to-buffer-same-window)=
1401    :PROPERTIES:
1402    :ID:       facac2a6-3526-450d-ac42-8d36b16c6bab
1403    :END:
1404 This is a particular instance of the [[#invalid-function-error][previous question]] but with some twists and turns,
1405 and a solution culled from various postings on the mailing list.
1407 starter-kit loads the site-file version of org (the one that came with
1408 your emacs install).  Then when you load your init file, the local
1409 version is added to the front of load-path, so it looks as if things
1410 are originating there, but the damage is already done: you have a
1411 "frankenstein" org.
1413 One possible solution is to add (package-initialize) to the primary init.el
1414 before starter-kit gets going. This will pick up the local install so
1415 that the built-in version never enters to muddy the picture.
1417 ** (Filling a paragraph|Indenting a list|...) behaves strangely
1418 Many filling/indenting problems have been reported on the mailing
1419 list: many of those were bugs (that have been fixed), but quite a lot
1420 are caused by people using the filladapt package, which is fundamentally
1421 incompatible with Org, which has its own facilities for these tasks. If you see
1422 strange behavior in this area, first check if you are using filladapt: visit an org
1423 file and check the modeline for "Filladapt".
1425 If filladapt is on, you want to turn it off before investigating
1426 further. Anthony Lander suggested on the mailing list the following
1427 method to turn off filladapt mode when you visit org files:
1429 #+BEGIN_SRC emacs-lisp
1430 (add-hook 'org-mode-hook 'turn-off-filladapt-mode)
1431 #+END_SRC
1433 This should be placed in your .emacs (or other initialization file) after org
1434 is loaded.
1436 * Faces and highlighting
1437   :PROPERTIES:
1438   :CUSTOM_ID: Faces
1439   :END:
1440 ** Org-mode has a lot of colors?  How can I change them?
1441    :PROPERTIES:
1442    :CUSTOM_ID: customizing-org-faces
1443    :END:
1445 #+index: Faces
1447 This is a question that applies to Emacs as a whole, but it comes up
1448 quite frequently on the org-mode mailing list, so it is appropriate to
1449 discuss it here.
1451 If you would like to change the style of a face in org-mode (or any
1452 other Emacs mode), simply type =M-x customize-face [RET]= while the
1453 cursor is on the color/style you are interested in modifying. You will
1454 be given the opportunity to customize all the faces located at that
1455 point.
1457 If you would like an overview of all the faces in org-mode, you can
1458 type =C-u M-x list-faces-display [RET] org= and you will be shown all
1459 the faces defined by org-mode along with an illustration of their
1460 current settings.
1462 If you would like to customize org-faces and other aspects of
1463 org-appearance, type =M-x customize-group org-font-lock [RET]=.
1465 Finally, if you would like verbose information about the properties of
1466 the text under the cursor, you can type =C-u C-x ==.
1468 See the Worg page on [[file:org-tutorials/org-appearance.org][customizing Org appearance]] for further information.
1469 ** Why do I get a tiny font in column view when using emacs daemon?
1470    :PROPERTIES:
1471    :CUSTOM_ID: column-view-tiny-font
1472    :END:
1474 #+index: Column view
1476 When using emacs in daemon mode (=emacs --daemon=), client frames
1477 sometimes override the column view face settings, resulting in very
1478 small fonts. Here is a fix:
1480 #+begin_src emacs-lisp
1481   (defun org-column-view-uses-fixed-width-face ()
1482   ;; copy from org-faces.el
1483   (when (fboundp 'set-face-attribute)
1484       ;; Make sure that a fixed-width face is used when we have a column
1485       ;; table.
1486       (set-face-attribute 'org-column nil
1487                           :height (face-attribute 'default :height)
1488                           :family (face-attribute 'default :family))))
1490    (when (and (fboundp 'daemonp) (daemonp))
1491     (add-hook 'org-mode-hook 'org-column-view-uses-fixed-width-face))
1492 #+end_src
1494 This fix was provided in the following mailing list post:
1496 https://orgmode.org/list/loom.20100715T095418-84@post.gmane.org
1497 ** How can I stop the mouse cursor from highlighting lines in the agenda?
1498    :PROPERTIES:
1499    :CUSTOM_ID: ratpoison-for-agenda-highlighting
1500    :END:
1502 #+index: Highlighting
1504 You can add the following to your =.emacs=:
1506 #+begin_src emacs-lisp
1507 (add-hook 'org-finalize-agenda-hook
1508     (lambda () (remove-text-properties
1509                (point-min) (point-max) '(mouse-face t))))
1510 #+end_src
1512 * Outline
1513   :PROPERTIES:
1514   :CUSTOM_ID: Outline
1515   :END:
1516 ** Can I close an outline section without starting a new section?
1517    :PROPERTIES:
1518    :CUSTOM_ID: closing-outline-sections
1519    :END:
1521 #+index: Outline
1523 Can I have nested, closed outline sections, similar to xml? This
1524 question comes up quite frequently on the mailing list.
1526 See the following threads:
1528   - https://orgmode.org/list/20110327170251.58923564@hsdev.com
1529   - https://orgmode.org/list/AANLkTinaTdYWQTXLzCf2kJVOMv64OM_5tL_0JCYAssPr@mail.gmail.com
1530   - https://orgmode.org/list/q2sc8f5e1e41004151315v433bc7b7udb98e65771a15340@mail.gmail.com
1531   - https://orgmode.org/list/49CE32EC.5060508@gmx.de
1533 The desired behavior looks something like this:
1535 #+begin_src org
1536 ,* Section one
1538 Some text
1540 ,** Subsection one
1542 Some text
1544 ,** Subsection two
1546 Some text
1548 ,# end Subsection Two
1550 Continue text in section one.
1551 #+end_src
1553 The short answer to the question is no. Org-mode adheres to the
1554 cascading logic of outlines, in which a section is closed only by
1555 another section that occupies an equal or greater level.
1557 Here are some workarounds:
1559 1. You can use inline tasks to create non-folding subsections. See the
1560    documentation in org-inlinetask.el, which is part of the org-mode
1561    distribution.
1562 2. You can create a temporary heading, such as "** Continue main
1563    section" and then remove it when you are ready to export.
1564 3. You can create a separate outline heading (e.g., * ACTIONS),
1565    creating TODOs there with links to the relevant sections of your
1566    main text.
1568 ** Can I add a TODO to a list item?
1569    :PROPERTIES:
1570    :CUSTOM_ID: list-item-as-todo
1571    :END:
1573 No.  When generating agenda views, org-mode treats only headlines as TODO
1574 items.
1576 You can, however, use a status cookie together with checkboxes to
1577 monitor your progress on a series of subtasks:
1579 #+begin_src org
1580 ,** TODO Big task [1/3]
1582    - [X] Subtask 1
1583    - [ ] Subtask 2
1584    - [ ] Subtask 3
1585 #+end_src
1587 If you would like to embed a TODO within text without treating it as
1588 an outline heading, you can use inline tasks. Simply add...
1590 : (require 'org-inlinetask)
1592 ...to your =.emacs= and then type =C-c C-x t= to insert an inline task.
1594 ** Can I have two windows on the same Org-mode file, with different outline visibilities?
1595    :PROPERTIES:
1596    :CUSTOM_ID: indirect-buffers
1597    :END:
1599    You may use /indirect buffers/ which do exactly this.  See the
1600    documentation on the command =make-indirect-buffer=.
1602    Org-mode has built-in commands that allow you create an indirect
1603    buffer from a subtree of an outline. To open a subtree in new
1604    window, type =C-c C-x b=. Any changes you make in the new window
1605    will be saved to the original file, but the visibility of both
1606    buffers will remain independent of one another.
1608    For multiple indirect buffers from the same file, you must use the
1609    prefix =C-u= when creating the second (or third) buffer. Otherwise
1610    the new indirect buffer will replace the old.
1612    You can also create an independent view of an outline subtree by
1613    typing =b= on an item in the agenda.
1615 ** Emacs outlines are unreadable.  Can I get rid of all those stars?
1616    :PROPERTIES:
1617    :CUSTOM_ID: Emacs-outlines-are-unreadable
1618    :END:
1620    See the section [[https://orgmode.org/manual/Clean-view.html#Clean-view][Clean outline view]] in the manual.
1622 ** C-k is killing whole subtrees!  I lost my work!
1623    :PROPERTIES:
1624    :CUSTOM_ID: C-k-is-killing-subtrees
1625    :END:
1627    =(setq org-ctrl-k-protect-subtree t)= before losing your work.
1629    =(setq org-catch-invisible-edits 'show)= will also be helpful.  See the
1630    docstring of this option, as it allows more flexible options.
1632 ** Why aren't commands working on regions?
1633    :PROPERTIES:
1634    :CUSTOM_ID: transient-mark-mode
1635    :END:
1637 Some org-mode commands, such as M-right and M-left for demoting or
1638 promoting headlines (see [[#demote-multiple-headlines][this FAQ]]), can be applied to entire
1639 regions.  These commands, however, will only work on active regions set
1640 with [[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
1641 Emacs 23. To enable it in earlier versions of emacs, put the following in
1642 your =.emacs= file:
1644 : (transient-mark-mode 1)
1646 Alternatively, you may turn off transient mark mode and use [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Momentary-Mark.html][a momentary
1647 mark]] (=C-<SPC> C-<SPC>=).
1649 ** Why is a blank line inserted after headlines and list items?
1650    :PROPERTIES:
1651    :ID:       2463F4D8-F686-4CF3-AA07-08976F8A4972
1652    :CUSTOM_ID: blank-line-after-headlines-and-list-items
1653    :END:
1655 #+index: Blank
1657 In org-mode, typing =M-RET= at the end of a headline will create a new
1658 headline of the same level on a new line. The same is true for plain
1659 lists. By default org-mode uses context to determine if a blank line should
1660 be inserted after each headline or plain list item when =M-RET= is
1661 pressed. For instance, if a there is a blank line before a headline, then
1662 typing =M-RET= at the end of the line will insert a blank line before the
1663 new headline. For instance, hitting =M-RET= at the end of "Headline Two"
1664 below inserts a new headline without a blank line:
1666 : ** Headline One
1667 : ** Headline Two
1668 : **
1670 If there is a blank line between Headline One and Headline Two,
1671 however, the results will be as follows:
1673 : ** Headline One
1675 : ** Headline Two
1677 : **
1679 If you do not like the default behavior you can change it with the
1680 variable =org-blank-before-new-entry=. You can set headings and/or
1681 plain lists to auto (the default setting), t (always), or nil (never).
1683 ** How can I promote or demote multiple headlines at once?
1684    :PROPERTIES:
1685    :CUSTOM_ID: demote-multiple-headlines
1686    :END:
1688 #+index: Promote!Multiple
1689 #+index: Demote!Multiple
1691 If you have a long list of first level headlines that you'd like to
1692 demote to second level headlines, you can select the headlines as a
1693 region and then hit =M-<right>= to demote all the headlines at once.
1695 Note: =M-S-<right>= will not work on a selected region. Its use is to
1696 demote a single subtree (i.e., a headline and all sub-headlines).
1698 If M-<right> doesn't seem to work, make sure transient mark mode is
1699 enabled. See [[#transient-mark-mode][this FAQ]].
1701 ** What's the deal with all the ellipses in my org outlines?
1702    :PROPERTIES:
1703    :CUSTOM_ID: org-ellipses
1704    :END:
1706 #+index: Ellipsis
1708 Org-mode uses ellipses to indicate folded (and thus hidden) text. Most
1709 commonly, ellispes occur at the end of headings with folded content:
1711 : * Heading ...
1713 Or, for instance, they may indicate closed drawers:
1715 : :PROPERTIES: ...
1717 Sometimes, as a result of editing and cycling an outline, ellipses may
1718 appear in unexpected places. You should *never* delete these ellipses,
1719 as you may accidentally delete hidden text. Instead, you can type =C-c
1720 C-r= (org-reveal) to display all hidden text in the vicinity. Or you
1721 may type =M-x RET show-all= to reveal all text in the org file.
1723 If you would prefer a symbol or face for indicating hidden text, you
1724 can customize the variable org-ellipses.
1726 ** How do I yank a subtree so it's indented according to the point's location?
1727    :PROPERTIES:
1728    :CUSTOM_ID: yank-indent-subtree
1729    :END:
1731 #+index: Indentation
1733 You can either use =C-c C-w= with a working [[https://orgmode.org/manual/Refile-and-copy.html#Refile-and-copy][refile-targets]] setup.
1735 Or set =org-yank-adjusted-subtrees= to =t= which will adjust the
1736 yanked headline's level correctly.
1738 Just use =C-k= and =C-y= as you would everywhere else in Emacs.
1740 ** Can I read org-mode outlines in vim?
1741    :PROPERTIES:
1742    :CUSTOM_ID: org-outlines-in-vim
1743    :END:
1745 #+index: Vim
1747 Yes, there is a script that enables one to view and navigate folded
1748 outline/org files in vim (though without most of org-mode's
1749 functionality, of course).
1751   - [[http://www.vim.org/scripts/script.php?script_id%3D1266][Emacs outline mode - Imitates Emacsen : vim online]]
1753 For instructions on how to set it up, please see [[http://orgmode.org/list/EA275862-B97A-4BAC-B879-177FD07A2D56@gaillourdet.net][this mailing list post]].
1755 Work is also underway on an org-mode clone for Vim. You can check it
1756 out on git hub:
1758 https://github.com/hsitz/VimOrganizer
1760 ** Can I use another character than "*" to start a headline?
1762 No.  The "*" character is used in =outline-mode=, and Org is derived from
1763 =outline-mode=.
1765 If you are curious as to what other rationales there are for "*", check out
1766 [[https://orgmode.org/list/8739i7ke8i.fsf@gmail.com][this]] mail and the thread it is in.
1768 Even if you cannot use another character, you can add an overlay on top of
1769 the "*" characters and your buffer will look like the way you want.
1771 See the library =org-bullets.el= (by Evgeni Sabof) from the =contrib/=
1772 directory, or test this snippet shared by Jambunathan:
1774 #+BEGIN_SRC emacs-lisp
1775   (font-lock-add-keywords
1776    'org-mode `(("\\(?:^\\(?1:\\*+\\)[[:blank:]]\\)"
1777                 (0 (progn (compose-region
1778                            (match-beginning 1) (match-end 1)
1779                            (pcase (length (match-string 1))
1780                              (1 ?\u2219)
1781                              (2 ?\u2022)
1782                              (3 ?\u25c9)
1783                              (_ ?\u25CB)))
1784                           nil)))))
1785 #+END_SRC
1787 * Todos and Tags
1788   :PROPERTIES:
1789   :CUSTOM_ID: Todos-and-Tags
1790   :END:
1791 ** How can I automatically archive canceled tasks?
1793 #+BEGIN_SRC emacs-lisp
1794 (setq org-todo-state-tags-triggers '(("CANCELLED" ("ARCHIVE" . t))))
1795 #+END_SRC
1797 See https://orgmode.org/list/2013-01-18T11-28-57@devnull.Karl-Voit.at -- thanks to Victor
1798 Rosenfeld for sharing [[http://doc.norang.ca/org-mode.html][Bernt Hansen]]'s solution.
1800 ** How can I cycle through the TODO keyword of an entry?
1801    :PROPERTIES:
1802    :CUSTOM_ID: cycle-TODO-keywords
1803    :END:
1805 #+index: Cycling!Todo
1807   =C-c C-t= or =S-<left/right>= is what you need.
1809 ** How do I track state changes for tasks in Org?
1810    :PROPERTIES:
1811    :CUSTOM_ID: track-state-changes-for-tasks
1812    :END:
1814 #+index: Logging
1816   Take a look at the [[https://orgmode.org/list/8763vfa9hl.fsf@legolas.norang.ca][post by Bernt Hansen]] for setting up TODO keyword
1817   states and logging timestamps for task state changes.
1819 ** Can I select the TODO keywords with a tag-like interface?
1820    :PROPERTIES:
1821    :CUSTOM_ID: select-TODO-keywords-with-tag-like-interface
1822    :END:
1824 #+index: Tag!Fast selection
1826   Yes.  Use =(setq org-use-fast-todo-selection t)=
1828   If you want to set both your todos and your tags using a single
1829   interface, then check out the variable
1830   =org-fast-tag-selection-include-todo=.
1832   See [[https://orgmode.org/manual/Fast-access-to-TODO-states.html][this section of the manual]] for more details.
1834 ** How can I quickly set the tag of an entry?
1835    :PROPERTIES:
1836    :CUSTOM_ID: quickly-set-tag-of-entry
1837    :END:
1839 #+index: Tag!Set
1841    Use =C-c C-c= or =C-c C-q= on the headline. =C-c C-q= is useful for
1842    setting tabs in a =Remember= buffer, since =C-c C-c= is the default
1843    keybinding for filing a note from the remember buffer.
1845    You can set tags even more quickly by setting one of the character
1846    shortcuts for [[https://orgmode.org/manual/Setting-tags.html#Setting-tags][fast tag selection]].
1848    To set tag shortcuts for all org buffers, put something like the
1849    following in your =.emacs= file (or create the same settings by
1850    typing =M-x customize-variable RET org-tag-alist=):
1852 : (setq org-tag-alist '(("computer" . ?c) ("office" . ?o) ("home" . ?h)))
1854    To set tag shortcuts for a single buffer, put something like the
1855    following at the top of your org file:
1857 : #+TAGS: computer(c) office(o) home(h)
1859 ** How can I change the colors of TODO keywords?
1861 #+index: Faces!Todo
1863 You can use the variable =org-todo-keyword-faces=.  Here are some sample
1864 settings:
1866 #+begin_src emacs-lisp
1867 (setq org-todo-keyword-faces
1868       '(
1869         ("TODO"  . (:foreground "firebrick2" :weight bold))
1870         ("WAITING"  . (:foreground "olivedrab" :weight bold))
1871         ("LATER"  . (:foreground "sienna" :weight bold))
1872         ("PROJECT"  . (:foreground "steelblue" :weight bold))
1873         ("DONE"  . (:foreground "forestgreen" :weight bold))
1874         ("MAYBE"  . (:foreground "dimgrey" :weight bold))
1875         ("CANCELED"  . shadow)
1876         ))
1877 #+end_src
1879 If you want to change the color of all active todos or all inactive todos,
1880 type:
1882 : M-x customize-face RET org-todo
1883 : M-x customize-face RET org-done
1885 You can also set values for each of these in your =.emacs= file:
1887 : (set-face-foreground 'org-todo "firebrick2")
1888 : (set-face-foreground 'org-done "forestgreen")
1890 ** Can I use a arbitrary character in a TODO keyword?
1892 Yes, provided you add it to the "word" syntax in Emacs.
1894 For example, to add the =\u25b6= and the =\u25b8= chars, just add this to
1895 your Emacs configuration:
1897 #+begin_src emacs-lisp
1898   (add-hook 'org-mode-hook
1899      (lambda ()
1900        (modify-syntax-entry (string-to-char "\u25b6") "w")
1901        (modify-syntax-entry (string-to-char "\u25b8") "w")))
1902 #+end_src
1904 ** How do I arrange for an item to be automatically marked DONE when all checkboxes are checked?
1906 #+index: Checkbox
1908 This has arisen a couple of time
1909 (e.g. https://orgmode.org/list/87r5718ytv.fsf@sputnik.localhost and
1910 https://orgmode.org/list/m2d3efqkl0.fsf@pluto.luannocracy.com in the mailing list.
1912 There is an [[https://orgmode.org/worg/org-hacks.html#mark-done-when-all-checkboxes-checked][org-hack]] that describes a possible solution.
1914 * Hyperlinks
1915   :PROPERTIES:
1916   :CUSTOM_ID: Hyperlinks
1917   :END:
1919 ** Why do I have to confirm the execution of each shell/elisp link?
1920    :PROPERTIES:
1921    :CUSTOM_ID: confirm-shell/elisp-link
1922    :END:
1924 #+index: Link!Shell
1925 #+index: Link!Elisp
1927    The confirmation is there to protect you from unwantingly execute
1928    potentially dangerous commands.  For example, imagine a link
1930    : [[shell:rm -rf ~/*][Google Search]]
1932    In an Org-mode buffer, this command would look like /Google Search/,
1933    but really it would remove your home directory.  If you wish, you can
1934    make it easier to respond to the query by setting
1936    : (setq org-confirm-shell-link-function 'y-or-n-p
1937    :       org-confirm-elisp-link-function 'y-or-n-p).
1939    Then a single keypress will be enough to confirm those links.  It is
1940    also possible to turn off this check entirely, but I strongly
1941    recommend against this.  Be warned.
1943 ** Can I use RET or TAB to follow a link?
1944    :PROPERTIES:
1945    :CUSTOM_ID: RET-or-TAB-to-follow-link
1946    :END:
1948 #+index: Link!Follow
1950    Yes, this is how:
1952    : (setq org-return-follows-link t)
1953    : (setq org-tab-follows-link t)
1955 ** Can I keep mouse-1 clicks from following a link?
1956    :PROPERTIES:
1957    :CUSTOM_ID: mouse-1-following-link
1958    :END:
1960    Activating links with =mouse-1= is a new feature in Emacs 22, to make
1961    link behavior similar to other applications like web browsers.  If
1962    you hold the mouse button down a bit longer, the cursor will be set
1963    without following the link.  If you cannot get used to this behavior,
1964    you can (as in Emacs 21) use =mouse-2= to follow links and turn off
1965    link activation for =mouse-1= with
1967    : (setq org-mouse-1-follows-link nil)
1969 ** How can I get completion of file names when creating a link?
1970    :PROPERTIES:
1971    :CUSTOM_ID: completion-of-file-links
1972    :END:
1974 #+index: Link!Completion
1976 You can use org-insert-link with a prefix argument:
1978 : C-u C-c C-l
1980 You will be greeted with prompt in the minibuffer that allows for file
1981 completion using your preferred Emacs method for finding files.
1983 ** How can I use invisible targets within lists?
1984    :PROPERTIES:
1985    :CUSTOM_ID: invisible-targets-in-lists
1986    :END:
1988 #+index: Target!Invisible
1990 The usual way of turning radio links invisible is to comment them, but
1991 Org comments need to be at the beginning of the line, which breaks list
1992 indentation.
1994 The workaround here is to add (INVISIBLE) after your <<target>>
1996 For example:
1998 : 11. <<target>>(INVISIBLE)
1999 :     Some text
2000 : 12. More text [[target][go to]]
2002 ** Org-mode is not opening mailto links in my default mail client
2003    :PROPERTIES:
2004    :CUSTOM_ID: mailto-links
2005    :END:
2007 #+index: Link!Mailto
2009 You can customize the function org-mode uses to open mailto links by
2010 setting the variable =org-link-mailto-program=:
2012 =M-x customize-variable org-link-mailto-program=
2014 The default function called is =browse-url=, which opens a mail
2015 composition buffer within Emacs. The type of buffer opened by
2016 browse-url depends on the setting of the variable =mail-user-agent=.
2017 Thus, if you want to ensure that mailto links use Gnus to open a
2018 message buffer, you could add the following to your =.emacs=:
2020 #+begin_src elisp
2021 (setq mail-user-agent 'gnus-user-agent)
2022 #+end_src
2024 ** Can I use CamelCase links?
2025    :PROPERTIES:
2026    :CUSTOM_ID: CamelCase-links
2027    :END:
2029 #+index: Link!CamelCase
2031 Yes, you can with the contributed package =org-wikinodes.el=.  Please
2032 consult the [[https://orgmode.org/worg/org-contrib/org-wikinodes.html][documentation]].
2034 ** Can I create links to Thunderbirds emails?
2036 Yes, see this: [[http://orgmode.org/list/ka42mn$mn9$1@ger.gmane.org][from Christoph Herzog: Re: Linking to Thunderbird (correction)]]
2038 #+BEGIN_SRC emacs-lisp
2039 (require 'org)
2041 (org-add-link-type "thunderlink" 'org-thunderlink-open)
2043 (defun org-thunderlink-open (path)
2044   "Opens an email in Thunderbird with ThunderLink."
2045   (start-process "myname" nil "thunderbird" "-thunderlink" (concat "thunderlink:" path)))
2047 (provide 'org-thunderlink)
2048 #+END_SRC
2050 * Plain Lists
2051   :PROPERTIES:
2052   :CUSTOM_ID: Plain-Lists
2053   :END:
2055 ** How can I insert an empty line before each newly inserted headline, but not before each newly inserted plain-list item?
2056    :PROPERTIES:
2057    :CUSTOM_ID: empty-line-before-each-new-headline-but-not-item
2058    :END:
2060 : (setq org-blank-before-new-entry
2061 :       '((heading . t) (plain-list-item . nil))
2063 See also [[id:2463F4D8-F686-4CF3-AA07-08976F8A4972][Why is a blank line inserted after headlines and list items?]].
2065 ** How can I convert itemized lists to enumerated lists?
2066    :PROPERTIES:
2067    :CUSTOM_ID: convert-itemized-to-enumerated-lists
2068    :END:
2070 #+index: List!Itemized
2071 #+index: List!Enumerated
2073    You can use =C-c -= or =S-<left>/<right>= to cycle through the various
2074    bullet headlines available for lists: =-, +, *, 1., 1)=.
2076    See [[https://orgmode.org/manual/Plain-lists.html#Plain-lists][this section of the manual]] for more information.
2078 ** How can I convert plain lists to headlines and vice versa?
2079    :PROPERTIES:
2080    :CUSTOM_ID: convert-plain-lists-to-headlines
2081    :END:
2083 #+index: List!Plain
2084 #+index: Headline
2086    To convert a plain list item or line to a headline, type =C-c *= on
2087    the headline. This will make the line a subheading of the current
2088    headline.
2090    To convert a headline to a plain list item, type =C-c -= while the
2091    cursor is on the headline.
2093    To convert a headline to an unadorned line of text, type =C-c *= on
2094    the headline.
2096    You can use query replace to accomplish the same things, as Bernt
2097    Hansen explains in [[https://orgmode.org/list/871vvrym45.fsf@gollum.intra.norang.ca][this mailing list post]].
2099 ** Is there a good way to create a description list?
2100    :PROPERTIES:
2101    :CUSTOM_ID: description-lists
2102    :END:
2104 #+index: List!Description
2106   Yes, these are now built-in:
2108 #+BEGIN_EXAMPLE
2109 - item1 :: Description of this item 1
2110 - item2 :: Description of this item 2
2111 - item1 :: Description of this item 3
2112       also in multiple lines
2113 #+END_EXAMPLE
2115 ** How can I export alphabetical lists to... alphabetical lists?
2117 =org-list-allow-alphabetical= allows you to use alphabetical lists in
2118 Org, but this is purely visual, there is no effect on how the list is
2119 exported.  It is simply exported as an /ordered/ list, just like when
2120 you use numberes.  How the list will be represented in the export
2121 depends on the backend.  For example, the style file of a LaTeX
2122 document, or the CSS file for HTML documents set how ordered lists
2123 should be represented.  It is good style to adhere to these general
2124 settings because it keeps the overall document structure consistent.
2126 See [[http://orgmode.org/list/87mwq6qtjk.fsf@gmail.com][this thread]] (and earlier ones) for a discussion about this.
2128 * Tables
2129   :PROPERTIES:
2130   :CUSTOM_ID: Tables
2131   :END:
2133 ** Will there ever be support for multiple lines in a table field?
2134    :PROPERTIES:
2135    :CUSTOM_ID: table-multiline-fields
2136    :END:
2138    No.
2140    You can embed tables created with the =table.el= package in org-mode
2141    buffers, with mixed success when it comes to export and publishing.
2143 ** How can I make table alignment work with Asian character sets
2144    :PROPERTIES:
2145    :CUSTOM_ID: table-alignment-asian-characters
2146    :END:
2148 #+index: Table!Alignment
2150 When table alignment fails, it usually has to do with character sets
2151 where some characters have non-integer width.  Org will deal correctly
2152 with characters that are one or two or three ASCII characters wide,
2153 but not with characters that are, for example, 1.5 ASCII characters
2154 wide.  To make table alignment work you need to switch to a different
2155 character set.
2157 ** Can I plot data from a table?
2158    :PROPERTIES:
2159    :CUSTOM_ID: plotting-table-data
2160    :END:
2162 #+index: Table!Plot
2163 #+index: Table!Data
2164 #+index: Plot
2166    Yes, you can, using org-plot.el written by Eric Schulte and now
2167    bundled with Org.  See [[https://orgmode.org/manual/Org_002dPlot.html#Org-Plot][the manual section about this]].
2169    See also [[file:org-tutorials/org-plot.org][this excellent tutorial]] by Eric Schulte.
2171 ** How can I fill a table column with incremental numbers?
2172    :PROPERTIES:
2173    :CUSTOM_ID: fill-table-column-with-incremental-numbers
2174    :END:
2176 #+index: Table!Fill
2178 Here is how: Use a field formula to set the first value in the column:
2180 #+begin_src org
2181 | N   |   |
2182 |-----+---|
2183 | :=1 |   |
2184 |     |   |
2185 |     |   |
2186 |     |   |
2187 ,#+TBLFM: @2$1=1
2188 #+end_src
2190 Then define a column formula in the second field:
2192 #+begin_src org
2193 | N        |   |
2194 |----------+---|
2195 | 1        |   |
2196 | =@-1 + 1 |   |
2197 |          |   |
2198 |          |   |
2199 ,#+TBLFM: @2$1=1
2200 #+end_src
2202 After recomputing the table, the column will be filled with
2203 incremental numbers:
2205 #+begin_src org
2206 | N |   |
2207 |---+---|
2208 | 1 |   |
2209 | 2 |   |
2210 | 3 |   |
2211 | 4 |   |
2212 ,#+TBLFM: $1=@-1 + 1::@2$1=1
2213 #+end_src
2215 Note that you could use arbitrary starting values and column formulas.
2217 Alternatively, you can just start the table
2219 #+begin_src org
2220 | N |   |
2221 |---+---|
2222 | 1 |   |
2223 #+end_src
2225 and with the cursor on the 1, use S-RET (bound to org-table-copy-down). That
2226 will add a row, incrementing the number as it goes. See the docstring for org-table-copy-down
2227 for more information and also see the next FAQ entry [[=S-RET= in a table keeps increasing the copied numbers.  How can I stop this?]]
2228 if you don't want this behavior.
2230 ** =S-RET= in a table keeps increasing the copied numbers.  How can I stop this?
2231    :PROPERTIES:
2232    :CUSTOM_ID: S-RET-in-a-table-increases-copied-numbers
2233    :END:
2235    Well, it is /supposed/ to be a feature, to make it easy to create a
2236    column with increasing numbers.  If this gets into your way, turn it
2237    off with
2239    : (setq org-table-copy-increment nil)
2241 ** Why does my table column get filled with #ERROR?
2242    :PROPERTIES:
2243    :CUSTOM_ID: table-column-filled-with-ERROR
2244    :END:
2246 #+index: Table!#ERROR
2248    Org-mode tried to compute the column from other fields using a
2249    formula stored in the =#+TBLFM:= line just below the table, and
2250    the evaluation of the formula fails.  Fix the fields used in the
2251    formula, or fix the formula, or remove it!
2253 ** How can I stop the table editor from creating new lines?
2254    :PROPERTIES:
2255    :CUSTOM_ID: table-editor-creates-new-lines
2256    :END:
2258    When I am in the last column of a table and just above a horizontal
2259    line in the table, pressing TAB creates a new table line before the
2260    horizontal line.  To move to the line below the
2261    horizontal line instead, do this:
2263    Press =down= (to get on the separator line) and then =TAB=.
2264    Or configure the variable
2266    : (setq org-table-tab-jumps-over-hlines t)
2268 ** How can I get table fields starting with "="?
2269    :PROPERTIES:
2270    :CUSTOM_ID: table-fields-starting-with-=
2271    :END:
2273    With the setting
2275    : (setq org-table-formula-evaluate-inline nil)
2277    this will no longer happen.  You can still use formulas using the
2278    commands ~C-c =~ and ~C-u C-c =~
2280 ** How can I get a vertical bar "|" inside a table field?
2281    :PROPERTIES:
2282    :CUSTOM_ID: table-fields-with-vertical-bar
2283    :END:
2285    You can use =\vert= to put a vertical bar inside a table field.  This
2286    will be converted for export.  To use it inside a word use
2287    =abc\vert{}def=.  If you need something that looks like a bar in the Org
2288    mode buffer, you can use the unicode character brvbar which looks like
2289    this: \brvbar{}.
2291 ** How can I change the indentation of an entire table without fixing every line by hand?
2292    :PROPERTIES:
2293    :CUSTOM_ID: change-indentation-entire-table
2294    :END:
2296 #+index: Table!Indentation
2298    The indentation of a table is set by the first line.  So just fix the
2299    indentation of the first line and realign with =TAB=.
2301 ** In my huge table the realigning after each TAB takes too long.  What can I do?
2302    :PROPERTIES:
2303    :CUSTOM_ID: table-realigning-after-TAB-takes-long
2304    :END:
2306 #+index: Table!Realign
2308    Either split the table into several by inserting an empty line every
2309    100 lines or so.  Or turn off the automatic re-align with
2311    : (setq org-table-automatic-realign nil)
2313    After this the only way to realign a table is to press =C-c C-c=.  It
2314    will no longer happen automatically, removing the corresponding delays
2315    during editing.
2317 ** Recalculation of my table takes too long.  What can I do?
2318    :PROPERTIES:
2319    :CUSTOM_ID: Recalculation-of-my-table-takes-too-long
2320    :END:
2322 #+index: Table!Calculation
2324    Nothing, really.  The spreadsheet in org is mostly done to make
2325    calculations possible, not so much to make them fast.  Since Org-mode is
2326    firmly committed to the ASCII format, nothing is stopping you from
2327    editing the table by hand.  Therefore, there is no internal
2328    representation of the data.  Each time Org-mode starts a computation, it
2329    must scan the table for special lines, find the fields etc.  This is
2330    slow.  Furthermore, Calc is slow compared to hardware computations.  To
2331    make this work with normal editing, recalculation is not happening
2332    automatically, or only for the current line, so that the long wait for a
2333    full table iteration only happens when you ask for it.
2335    So for really complex tables, moving to a "real" spreadsheet may
2336    still be the best option.
2338    That said, there are some ways to optimize things in Org-mode, and I
2339    have been thinking about moving a bit further down this line.
2340    However, for my applications this has so far not been an issue at
2341    all.  If you have a good case, you could try to convince me.
2343 ** When I export tables to HTML, they don't have borders.
2344    :PROPERTIES:
2345    :CUSTOM_ID: table-borders-in-html-export
2346    :END:
2348 #+index: Table!HTML
2350 By default, Org-mode exports tables without borders.
2352 You can changed this by placing an =#+ATTR_HTML= line before the table:
2354 :  #+ATTR_HTML: :border 2 :rules all :frame all
2356 See [[https://orgmode.org/manual/Tables-in-HTML-export.html#Tables-in-HTML-export][the manual]] for more details.
2358 ** Why does the Calc high precision (e. g. =p20=) not work like expected?
2359    :PROPERTIES:
2360    :CUSTOM_ID: table-high-precision
2361    :END:
2363 - *Short answer*
2365   Avoid
2366   : | 1 / 2 * 3 | 0.16666667000000 |
2367   : #+TBLFM: $2 = $1; p20 %.14f
2369   and use
2370   : | 1 / 2 * 3 | 0.16666666666667 |
2371   : #+TBLFM: $2 = $1 +.0; p20 f-14
2373 - *Longer answer*
2375   It is important to distinguish between the precision of
2376   1) =p20=: Calc internal calculation (=calc-internal-prec=)
2377   2) =f-14=: Calc float formatting, unlimited in precision (=calc-float-format=)
2378   3) =%.14f=: the =printf= reformatting, limited in precision
2380   See [[https://orgmode.org/manual/Formula-syntax-for-Calc.html#Formula-syntax-for-Calc][the Org manual]] (org-version 6.35 or newer) for more details.
2382   Use =C-h v org-calc-default-modes RET= to check the Org default settings
2383   which are used if no format specifiers are added to a table formula.
2384   The examples below have been made with the out_of_the_box Org defaults
2385   =calc-internal-prec = 12= and =calc-float-format = 8=.
2387   Remember the formula debugger, toggled with =C-c {=,
2388   to view the processing stages like:
2389   |   | formula debugger label | processing stage           |
2390   | / | <                      | <>                         |
2391   |---+------------------------+----------------------------|
2392   |   | Result:                | output of Calc             |
2393   |   | Format:                | reformatting with =printf= |
2395   Following are some examples to demonstrate
2396   the interaction of the three precisions.
2398   - *display precision limitations for Calc formulas*
2399     - limited by Calc internal calculation precision from Org default
2400       (here =p12=)
2401       : | 0.16666666666700 |
2402       : #+TBLFM: $1 = 1 / 2 * 3;     f-14
2404       : | 0.1666666666670000000 |
2405       : #+TBLFM: $1 = 1 / 2 * 3;     f-19
2407     - limited by Calc float format from Org default (here =f8=)
2408       : | 0.16666667 |
2409       : #+TBLFM: $1 = 1 / 2 * 3
2411       : | 0.16666667 |
2412       : #+TBLFM: $1 = 1 / 2 * 3; p20
2414       : | 0.16666667000000 |
2415       : #+TBLFM: $1 = 1 / 2 * 3;          %.14f
2417       : | 0.16666667000000 |
2418       : #+TBLFM: $1 = 1 / 2 * 3; p20      %.14f
2420     - limited by Calc float format specified
2421       : | 0.166667 |
2422       : #+TBLFM: $1 = 1 / 2 * 3;     f-6
2424       : | 0.16666666666667 |
2425       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-14
2427       : | 0.1666666666666666667 |
2428       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-19
2430     - limited by =printf= conversion to Emacs Lisp float
2431       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
2432       : #+TBLFM: $1 = 1 / 2 * 3;          %.19f
2434       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
2435       : #+TBLFM: $1 = 1 / 2 * 3; p20      %.19f
2437       : | 0.1666666666666666600 | the inaccuracy is platform dependent |
2438       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-20 %.19f
2440     - limited by =printf= format specified
2441       : | 0.166667 |
2442       : #+TBLFM: $1 = 1 / 2 * 3;         %.6f
2444   - *display precision limitations for Emacs Lisp formulas*
2445     - limited by Emacs Lisp float
2446       : | 0.16666666666666666 |
2447       : #+TBLFM: $1 = '(/ 1.0 (* 2 3))
2449       : | 0.1666666666666666574 | the inaccuracy is platform dependent |
2450       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.19f
2452     - limited by =printf= format specified
2453       : | 0.16666666666667 |
2454       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.14f
2456 This FAQ entry is based on this [[https://orgmode.org/list/4B882C11.90406@alumni.ethz.ch][mailing list thread]]
2457 and is continued in the [[#table-float-fraction][next FAQ entry]].
2459 ** Which float format shows the fraction part also when the latter is zero?
2460    :PROPERTIES:
2461    :CUSTOM_ID: table-float-fraction
2462    :END:
2464 - *Short answer*
2466   Avoid
2467    : | 1 | 1 |
2468    : #+TBLFM: $2 = $1; f-3
2469   and use
2470    : | 1 | 1.000 |
2471    : #+TBLFM: $2 = $1 +.0; f-3
2473 - *Longer answer*
2475   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]]
2476   in the section Mode Settings -> Display Modes -> Float Formats
2477   [[http://www.delorie.com/gnu/docs/calc/calc_163.html][found here as long as the section numbering is unchanged]].
2479   Remember the formula debugger, toggled with =C-c {=,
2480   to view the processing stages like:
2481   |   | formula debugger label | processing stage           |
2482   | / | <                      | <>                         |
2483   |---+------------------------+----------------------------|
2484   |   | Result:                | output of Calc             |
2485   |   | Format:                | reformatting with =printf= |
2487   Following are some examples to demonstrate different float formats.
2489   - normal precision
2490     : |-----------+---------+-------+---------+----------+-------|
2491     : |    number |      f3 |   f-3 | +.0; f3 | +.0; f-3 |  %.3f |
2492     : |-----------+---------+-------+---------+----------+-------|
2493     : |         1 |       1 |     1 |   1.000 |    1.000 | 1.000 |
2494     : |         0 |       0 |     0 |   0.000 |    0.000 | 0.000 |
2495     : |-----------+---------+-------+---------+----------+-------|
2496     : |       1.0 |   1.000 | 1.000 |   1.000 |    1.000 | 1.000 |
2497     : |       0.0 |   0.000 | 0.000 |   0.000 |    0.000 | 0.000 |
2498     : |-----------+---------+-------+---------+----------+-------|
2499     : | 1.0001666 |   1.000 | 1.000 |   1.000 |    1.000 | 1.000 |
2500     : | 0.0001666 | 1.67e-4 | 0.000 | 1.67e-4 |    0.000 | 0.000 |
2501     : |-----------+---------+-------+---------+----------+-------|
2502     : | 1.0016666 |   1.002 | 1.002 |   1.002 |    1.002 | 1.002 |
2503     : | 0.0016666 |   0.002 | 0.002 |   0.002 |    0.002 | 0.002 |
2504     : |-----------+---------+-------+---------+----------+-------|
2505     : #+TBLFM: $2 = $1; f3 :: $3 = $1; f-3 :: $4 = $1 +.0; f3 :: $5 = $1 +.0; f-3 :: $6 = $1; %.3f
2507   - high precision
2508     : |----------------------+--------------------------+-----------------------|
2509     : | number               |                      f19 |                  f-19 |
2510     : |----------------------+--------------------------+-----------------------|
2511     : | 1                    |                        1 |                     1 |
2512     : | 0                    |                        0 |                     0 |
2513     : |----------------------+--------------------------+-----------------------|
2514     : | 1.0                  |    1.0000000000000000000 | 1.0000000000000000000 |
2515     : | 0.0                  |    0.0000000000000000000 | 0.0000000000000000000 |
2516     : |----------------------+--------------------------+-----------------------|
2517     : | 1 + 1 / 2 * 3 * 1e19 |    1.0000000000000000000 | 1.0000000000000000000 |
2518     : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
2519     : |----------------------+--------------------------+-----------------------|
2520     : | 1 + 1 / 2 * 3 * 1e18 |    1.0000000000000000002 | 1.0000000000000000002 |
2521     : | 0 + 1 / 2 * 3 * 1e18 |    0.0000000000000000002 | 0.0000000000000000002 |
2522     : |----------------------+--------------------------+-----------------------|
2523     : #+TBLFM: $2 = $1; p20 f19 :: $3 = $1; p20 f-19
2525     : |----------------------+--------------------------+-----------------------|
2526     : | number               |                 +.0; f19 |             +.0; f-19 |
2527     : |----------------------+--------------------------+-----------------------|
2528     : | 1                    |    1.0000000000000000000 | 1.0000000000000000000 |
2529     : | 0                    |    0.0000000000000000000 | 0.0000000000000000000 |
2530     : |----------------------+--------------------------+-----------------------|
2531     : | 1.0                  |    1.0000000000000000000 | 1.0000000000000000000 |
2532     : | 0.0                  |    0.0000000000000000000 | 0.0000000000000000000 |
2533     : |----------------------+--------------------------+-----------------------|
2534     : | 1 + 1 / 2 * 3 * 1e19 |    1.0000000000000000000 | 1.0000000000000000000 |
2535     : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
2536     : |----------------------+--------------------------+-----------------------|
2537     : | 1 + 1 / 2 * 3 * 1e18 |    1.0000000000000000002 | 1.0000000000000000002 |
2538     : | 0 + 1 / 2 * 3 * 1e18 |    0.0000000000000000002 | 0.0000000000000000002 |
2539     : |----------------------+--------------------------+-----------------------|
2540     : #+TBLFM: $2 = $1 +.0; p20 f19 :: $3 = $1 +.0; p20 f-19
2542     The =printf= reformatting (=%.19f=) cannot be used with high precision,
2543     see the [[#table-high-precision][previous FAQ entry]].
2545 ** How can I center tables in LaTeX output?
2546    :PROPERTIES:
2547    :CATEGORY: centered-tables-in-latex
2548    :END:
2550 #+index: Table!Center
2552 Set the `org-latex-tables-centered' to `t':
2554 : (defcustom org-latex-tables-centered t
2555 :   "When non-nil, tables are exported in a center environment."
2556 :   :group 'org-export-latex
2557 :   :type 'boolean)
2559 ** Can I exclude columns from a table when exporting it?
2563 * Markup
2564   :PROPERTIES:
2565   :CUSTOM_ID: Footnotes
2566   :END:
2567 ** How can I get automatic renumbering of footnotes in org-mode?
2568    :PROPERTIES:
2569    :CUSTOM_ID:       footnote-auto-adjust
2570    :END:
2572 #+index: Footnotes!Renumbering
2574 You can add the following line to your .emacs file:
2576 : (setq org-footnote-auto-adjust t)
2578 Or, if you prefer, you can turn this option on locally by placing the
2579 following line at the top of your org file:
2581 : #+STARTUP: fnadjust
2583 When auto-adjust is turned on, footnotes in the file with numerical
2584 labels will be renumbered whenever a new footnote is added. Meanwhile,
2585 all footnotes, including those with custom labels such
2586 =[fn:custom-label ]=, will be sorted in the order of their appearance
2587 in the text.
2589 This emulates the footnote behavior that many users may be familiar
2590 with from word-processing programs or from the footnote-mode included
2591 with emacs.
2593 If you do not turn on org-footnote-auto-adjust, you sort and/or
2594 renumber footnotes at any time by calling org-footnote-action with a
2595 prefix argument.
2597 ** Why isn't auto renumbering of footnotes turned on by default?
2598    :PROPERTIES:
2599    :CUSTOM_ID:       why-no-default-auto-adjust
2600    :END:
2602 Org-mode has a very robust footnote mechanism allowing for a variety of
2603 types of footnotes. With some of the following footnote notations,
2604 auto-adjust may be either irrelevant or undesired:
2606  - Automatically numbered
2607  - Footnotes with custom labels
2608  - Inline footnotes
2610 In addition, Org-mode can be customized to place footnotes either at
2611 the end of a document or at the end of the outline heading in which
2612 they appear. Users who change this setting while editing a document
2613 may be disconcerted to find all of their footnotes rearranged
2614 automatically.
2616 ** I have auto-fill-mode set and org-mode is inserting unwanted comment markers!
2617    :PROPERTIES:
2618    :CUSTOM_ID: auto-fill-and-unwanted-comments
2619    :END:
2621 If the following occurs:
2623 #+begin_src org
2624 ,#+OPTIONS: toc:nil
2625 Some entered text.
2626 ,# More entered tex.
2627 #+end_src
2629 Make sure that the variable comment-start is nil.
2631 ** Are there any shortcuts for entering source blocks and comment lines?
2632    :PROPERTIES:
2633    :CUSTOM_ID: shortcuts-for-entering-source-blocks
2634    :END:
2636 Org-mode has some [[https://orgmode.org/manual/Literal-examples.html#Literal-examples][very convenient markup]] for including literal blocks and
2637 lines of code in a file.  (This is especially useful when exporting
2638 documents or using the contributed package [[file:org-contrib/babel/index.org][org-babel]] for executing blocks
2639 of code.)
2641 #+begin_src org
2642 ,#+begin_src perl
2643 print "Hello, world!\n";
2644 ,#+end_src
2645 #+end_src
2647 It can be tiresome to enter the block comment lines manually. There are
2648 several possible shortcuts you can use to enter them:
2650 1) Built-in expansion
2652    - Org-mode has a "secret" method of expanding source code blocks
2653      and comment lines.
2655    - If you type "<s" followed by =TAB= or =M-TAB=, a source block will
2656      magically appear.
2658    - For a full list of expansions, type =M-x describe-variable
2659      [RET] org-structure-template-alist=.
2661 2) [[https://orgmode.org/manual/Literal-examples.html#Literal-examples][Registers]]
2663    - Add the following line to your emacs file:
2665      =(set-register ?p "#+begin_src\n\n#+end_src perl")=
2667    - Then type =C-x r i p= to insert the source block. Please note: if
2668      you save another value to the register "p" with =C-x r s p=, it
2669      will overwrite the setting above for the current emacs session.
2671 3) [[https://orgmode.org/manual/Literal-examples.html#Literal-examples][Abbrevs]]
2673    - Activate the abbrev minor-mode in org-mode:
2675      + M-x abbrev-mode
2677      + /Permanently/:
2679        + =(add-hook 'org-mode-hook (lambda () (abbrev-mode 1)))=
2681    - In org-mode, type "sbp" (a sample abbreviation for a perl source
2682      block).
2684    - Immediately after "sbp" type =C-x a i l=.
2686    - Enter the expansion:
2688      - =#+begin_src perl[C-q C-j][C-q C-j]#+end_src=
2690      - Note: =C-q C-j= creates a new line in the minibuffer
2692    - Now, whenever, you type sbp followed by =SPACE= or =RET= in an
2693      org-mode buffer, the src block will magically appear.
2695    - To review your list of abbrevs, type =M-x edit-abbrevs=.
2697 4) [[http://www.emacswiki.org/emacs/SkeletonMode][Skeletons]]
2699    - Skeletons offer a simple way of automatically entering text.
2700      Here's a skeleton that queries for the type of block and wraps
2701      the active region inside it:
2703      #+begin_src elisp
2704        (define-skeleton skel-org-block
2705          "Insert an org block, querying for type."
2706          "Type: "
2707          "#+begin_" str "\n"
2708          _ - \n
2709          "#+end_" str "\n")
2710      #+end_src
2712    - Simply type skel-org-block to insert the block.
2714      - You can bind this to a key.
2716      - You can also create an abbrev that invokes this function:
2718        : (define-abbrev org-mode-abbrev-table "blk" "" 'skel-org-block)
2720 5) [[http://code.google.com/p/yasnippet/][Yasnippet]]
2722    - Several org-mode users install yasnippet for convenient, complex
2723      expansion.
2725    - See Bernt Hansen's [[http://doc.norang.ca/org-mode.html#Yasnippets][org-mode setup]] for a good introduction to
2726      yasnippet.
2728 * Capture and remember
2729   :PROPERTIES:
2730   :CUSTOM_ID: Remember
2731   :END:
2733 ** Can I use a variable or a function inside the `org-capture-templates' variable?
2734    :PROPERTIES:
2735    :CUSTOM_ID: variable-inside-capture-templates
2736    :END:
2738 #+index: Capture
2740 Yes.  Use [[http://www.gnu.org/s/emacs/manual/html_node/elisp/Backquote.html][backquotes]].
2742 E.g. if you have a variable called =org-test-file= and you want the
2743 variable =org-capture-templates= to "understand" (i.e. evaluate)
2744 =org-test-file= when Emacs evaluates the =(setq org-capture-templates
2745 [...])= expression, use backquotes like this:
2747 #+begin_src emacs-lisp
2748 (setq org-capture-templates
2749       `(("t" "Todo" entry (file+headline ,org-test-file "Tasks")
2750        "* TODO %?\n  %i\n  %a")
2751       ("b" "Buy" item (file+olp ,org-test-file "Stuff to Buy" "House")
2752        "")))
2753 #+end_src
2755 ** Can I use the remember buffer to clock a customer phone call?
2756    :PROPERTIES:
2757    :CUSTOM_ID: use-remember-buffer-to-clock-phone-call
2758    :END:
2760   Yes, you can.  Take a look at the [[https://orgmode.org/list/87tzkhoi45.fsf@gollum.intra.norang.ca][setup described by Bernt Hansen]] and
2761   check out (in the same thread) what Nick Docos had to fix to make Bernt's
2762   set-up work for him.
2764 ** Can I automatically start the clock when opening a remember template?
2765    :PROPERTIES:
2766    :CUSTOM_ID: start-clock-when-opening-remember-template
2767    :END:
2769 #+index: Clock!Start
2771    Yes, this is possible.  Use the following code and make sure that
2772    after executing it, `my-start-clock-if-needed' is in
2773    `remember-mode-hook' /after/ `org-remember-apply-template'.
2775    : (add-hook 'remember-mode-hook 'my-start-clock-if-needed 'append)
2776    : (defun my-start-clock-if-needed ()
2777    :   (save-excursion
2778    :     (goto-char (point-min))
2779    :     (when (re-search-forward " *CLOCK-IN *" nil t)
2780    :       (replace-match "")
2781    :       (org-clock-in))))
2783    Then, when a template contains the key string CLOCK-IN, the clock
2784    will be started.  Starting with Org-mode version 5.20, the clock will
2785    automatically be stopped when storing the remember buffer.
2787 * Searches
2788   :PROPERTIES:
2789   :CUSTOM_ID: Searches
2790   :END:
2792 ** Isearch does not find string hidden in links.  What can I do?
2793    :PROPERTIES:
2794    :CUSTOM_ID: isearch-in-links
2795    :END:
2797 #+index: Isearch
2799   M-x =visible-mode= will display the full link, making them searchable.
2801 ** How can I reduce the amount of context shown in sparse trees?
2802    :PROPERTIES:
2803    :CUSTOM_ID: context-in-sparse-trees
2804    :END:
2806 #+index: Context
2808    Take a look at the following variables:
2810    - =org-show-hierarchy-above=
2811    - =org-show-following-headline=
2812    - =org-show-siblings=
2813    - =org-show-entry-blow=
2815    which give command-dependent control over how much context is shown by a
2816    particular operation.
2818 ** How can I combine the results of two calls to =org-occur=?
2819    :PROPERTIES:
2820    :CUSTOM_ID: two-calls-to-org-occur
2821    :END:
2823 #+index: Occur
2825    You can construct a regular expression that matches all targets you
2826    want.  Alternatively, use a =C-u= prefix with the second and any
2827    further calls to =org-occur= to keep the current visibility and
2828    highlighting in addition to the new ones.
2830 * Agenda
2831   :PROPERTIES:
2832   :CUSTOM_ID: Agenda
2833   :END:
2835 ** My agenda commands are slow.  What to do?
2837 See the dedicated page about [[file:agenda-optimization.org][agenda speed up and optimization]].
2839 ** How can I change the advanced warning time for deadlines?
2840    :PROPERTIES:
2841    :CUSTOM_ID: warning-period-for-deadlines
2842    :END:
2844 #+index: DEADLINE!Warning
2846 Deadline warnings appear in the daily agenda view a specified number
2847 of days before the deadline is due. The default setting is 14 days.
2848 You can change this with the variable =org-deadline-warning-days=.
2849 (See [[https://orgmode.org/manual/Deadlines-and-scheduling.html#Deadlines-and-scheduling][this section]] of the manual.)
2851 For instance,
2853 : (setq org-deadline-warning-days 30)
2855 would cause warnings for each deadline to appear 30 days in advance.
2857 Naturally, you might not want warnings for all of your deadlines to
2858 appear so far in advance. Thus, you can change the lead time for
2859 individual items as follows:
2861 : * TODO Get a gift for the party
2862 :   DEADLINE: <2009-01-16 Fri -2d>
2864 The "-2d" above changes the lead time for this deadline warning to two
2865 days in advance. You can also use "w" for weeks and "m" for months.
2867 ** How can I postpone a task until a certain date?
2868    :PROPERTIES:
2869    :CUSTOM_ID: deferring-tasks
2870    :END:
2872 #+index: Postpone
2874 The easiest way to postpone a task is to schedule it in the future.  For
2875 instance, typing =C-c C-s +2w= on a headline will push a task two weeks
2876 into the future, so that it won't show up on the daily agenda until two
2877 weeks from now.
2879 If you'd like to prevent the task from showing up on your global todo list,
2880 you have a couple of options.
2882 1. You can set the variable =org-agenda-todo-ignore-scheduled= to
2883    =t=.  This will exclude any scheduled items from your global list of
2884    active todos (=C-c a t=). (The variable
2885    =org-agenda-todo-ignore-with-date= will exclude both scheduled and
2886    deadline items from your todo list).
2888 2. You can remove the todo keyword from the item (C-c C-t <SPC>). The item
2889    will still appear on your agenda two weeks from today, but it won't show
2890    up on your todo lists.
2892 ** Can I send myself an email containing tasks or other agenda info?
2893    :PROPERTIES:
2894    :CUSTOM_ID: email-containing-tasks-or-other-agenda-info
2895    :END:
2897    Yes.  See [[https://orgmode.org/list/m3ve3d1596.fsf@richardriley.net][this thread]] on the list.
2899 ** How can I limit the agenda view to my "work" tasks?
2900    :PROPERTIES:
2901    :CUSTOM_ID: limit-agenda-with-tag-filtering
2902    :END:
2904 #+index: FILETAGS
2906    It is often convenient to group org files into separate categories, such
2907    as "home" and "work" (or "personal" and "professional"). One of the main
2908    reasons for such classification is to create agenda views that are
2909    limited by type of work or area of responsibility.  For instance, while
2910    at work, one may want to see only professional tasks; while away from
2911    work, one may want to see only personal tasks.
2913    One way to categorize files and tasks is to use a "#+FILETAGS"
2914    declaration at the top of each file, such as:
2916    : #+FILETAGS: work
2918    As long as org-use-tag-inheritance is turned on, the filetags will
2919    be inherited by all tasks in the file. A file can have multiple
2920    filetags. And, of course, tags can be added to individual headings.
2922    Tasks can be quickly filtered by tag from within the agenda by
2923    typing "/" and the name of the tag. The full key sequence to filter
2924    for work items in an agenda view would be:
2926    : C-c a a / work [or a tag shortcut]
2928 ** How can I limit the agenda view to a particular category?
2929    :PROPERTIES:
2930    :CUSTOM_ID: limit-agenda-with-category-match
2931    :END:
2933 #+index: Agenda view!Category
2935    Another way to filter agenda views by type of work is to use a
2936    "#+CATEGORY" declaration at the top of each file, such as:
2938    : #+CATEGORY: work
2940    Categories can also be added to individual headings within a file:
2942    : * Big project
2943    :   :PROPERTIES:
2944    :   :CATEGORY: work
2945    :   :END:
2947    All todos belonging to the category "work" can be found a with a
2948    simple tags-todo search:
2950    : C-c a M
2952    At the prompt, type:
2954    : CATEGORY="work"
2956    The same results can be achieved with custom agenda commands, such as:
2958 #+BEGIN_SRC emacs-lisp
2959 (setq org-agenda-custom-commands
2960       '(("h" tags-todo "CATEGORY=\"home\"")
2961         ("w" tags-todo "CATEGORY=\"work\"")
2962         ;; other custom agenda commands here
2963         ))
2964 #+END_SRC
2966 ** How can include all org files in a directory in my agenda?
2967    :PROPERTIES:
2968    :CUSTOM_ID: set-agenda-files-using-wildcards
2969    :END:
2971 #+index: Agenda!Directory
2973 You can simply include the directory (as one of the items) in the value of
2974 the variable org-agenda-files:
2976 : (setq org-agenda-files '("/my/special/path/org/"))
2978 There is another way of accomplishing the same end:
2980 : (setq org-agenda-files (file-expand-wildcards "/my/special/path/org/*.org"))
2982 ** Why aren't items disappearing from my agenda once they are marked done?
2983    :PROPERTIES:
2984    :CUSTOM_ID: removing-done-items-from-agenda
2985    :END:
2987 If items remain on your daily/weekly agenda after they are marked done,
2988 check the configuration of the following variables:
2990 : org-agenda-skip-scheduled-if-done
2991 : org-agenda-skip-deadline-if-done
2992 : org-agenda-skip-timestamp-if-done
2994 For instance, type:
2996 : M-x customize-variable RET org-agenda-skip-scheduled-if-done
2998 If this variable is turned off (=nil=), then scheduled items will
2999 remain on the agenda even after they are marked done.
3001 If the variable is turned on (=t=), then scheduled items will
3002 disappear from the agenda after they are marked done.
3004 If these settings seem not to behave the way you expect, then make
3005 sure you understand [[#scheduled-vs-deadline-vs-timestamp][the difference between SCHEDULED, DEADLINE, and
3006 timestamps]].
3008 ** How do I keep repeating timestamps from being displayed multiple times?
3009    :PROPERTIES:
3010    :CUSTOM_ID: repeating-timestamps-show-once
3011    :END:
3013 #+index: Timestamp!Repeating
3015 To show only the /current/ instance of a repeating timestamp, put the
3016 following in your .emacs:
3018 #+begin_src emacs-lisp
3019 (setq org-agenda-repeating-timestamp-show-all nil)
3020 #+end_src
3022 ** What is the difference between SCHEDULED, DEADLINE, and plain timestamps?
3023    :PROPERTIES:
3024    :CUSTOM_ID: scheduled-vs-deadline-vs-timestamp
3025    :END:
3027 #+index: SCHEDULED
3028 #+index: DEADLINE
3029 #+index: Timestamp
3031 1. SCHEDULED items (set with =C-c C-s=) will appear on your agenda on
3032    the day they are scheduled and on every day thereafter until they
3033    are done. Schedule a task if you want to be reminded to do
3034    something beginning on a certain day and until it is done.
3036    : ** TODO Scheduled item
3037    :    SCHEDULED: <2009-03-01 Sun>
3039 2. Items with a DEADLINE timestamp (set with =C-c C-d=) appear on your
3040    agenda in advance of the when they are due and remain on your
3041    agenda until they are done. Add a DEADLINE to an item if you want
3042    to make sure to complete it by a certain date. (The variable
3043    org-deadline-warning-days determines how far in advance items with
3044    deadlines will show up in the agenda. See [[#warning-period-for-deadlines][this FAQ]] for more
3045    information.)
3047    : ** TODO Item with a deadline
3048    :    DEADLINE: <2009-01-20 Tue>
3050 3. An active timestamp (set with =C-c .=) will appear on your agenda
3051    only on the day it is scheduled. Use a timestamp for appointments
3052    or any reminders you want to show up only on a particular day.
3054    : ** TODO Item with an active timestamp
3055    : <2009-04-18 Sat>
3057 Note: items with inactive timestamps (set with C-c ! and marked by
3058 square brackets) will not show up in the agenda at all.
3060 ** Can I add files recursively to my list of agenda files?
3061    :PROPERTIES:
3062    :CUSTOM_ID: set-agenda-files-recursively
3063    :END:
3065 Yes, you can use the library =find-lisp=.
3067 : (load-library "find-lisp")
3068 : (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$"))
3070 This will add all files ending in =org= in the directory "~/org"
3071 and all of its subdirectories to your list of agenda files.
3073 If on a *nix machine, you can also use the find utility, which can be
3074 faster than the find-lisp library:
3076 : (setq org-agenda-files
3077 :       (mapcar 'abbreviate-file-name
3078 :               (split-string
3079 :                (shell-command-to-string "find ~/org -name \"*.org\"") "\n")))
3082 See [[https://orgmode.org/list/7b4bbp$11a9u8@dmzms99802.na.baesystems.com][this thread]] on the mailing list for more information.
3084 ** Why does an item appearing at the wrong time of day in my agenda?
3085    :PROPERTIES:
3086    :CUSTOM_ID: agenda-wrong-time-of-day
3087    :END:
3089 When preparing the agenda view, org-mode scans each relevant headline for a
3090 time designation.  This approach is very nice for adding free-form
3091 timestamps to an item for scheduling.  Thus, either of the following work
3092 would work to schedule an item at 10:00am:
3094 #+begin_src org
3095 ,** 10:00am Get dried ice at the magic store
3096    SCHEDULED: <2009-05-27 Wed>
3097 #+end_src
3099 #+begin_src org
3100 ,** Get dried ice at the magic store
3101    SCHEDULED: <2009-05-27 Wed 10:00>
3102 #+end_src
3104 To enable this flexibility, org-mode scans the entire headline for time of
3105 day notation. A potential problem can arise if you use inactive timestamps
3106 in the headline to note when an item was created.  For example :
3108 #+begin_src org
3109 ,** Get dried ice at the magic store [2009-05-26 Tue 12:58]
3110    SCHEDULED: <2009-05-27 Wed>
3111 #+end_src
3113 Org-mode would interpret the time in the inactive timestamp as a
3114 time-of-day indicator and the entry would appear in your agenda at
3115 12:58.
3117 If you would like to turn off the time-of-day search, you can configure the
3118 variable =org-agenda-search-headline-for-time= (requires org-mode >= 6.24).
3120 ** How can I change the visibility of an item from the agenda?
3121    :PROPERTIES:
3122    :CUSTOM_ID: cycling-visibility-from-agenda
3123    :END:
3125 #+index: Agenda!Visibility
3127 You can add a keybinding as follows:
3129 #+begin_src emacs-lisp
3130 (add-hook 'org-agenda-mode-hook
3131    (lambda ()
3132      (define-key org-agenda-mode-map " " 'org-agenda-cycle-show)))
3133 #+end_src
3135 Then, as you press SPACE on an item on the agenda, it will cycle the
3136 visibility of its original location.
3138 ** Is there any way to set org-mode so that tags don't appear in the agenda view?
3140 See the =org-agenda-remove-tags= variable.
3142 ** I work late at night! How can I extend my current day past midnight?
3143    :PROPERTIES:
3144    :CUSTOM_ID: org-extend-today-until
3145    :END:
3147 If you work past midnight, you may not want your daily agenda view to
3148 switch to the next day at 12 a.m. (the default). To extend your day, simply
3149 set the value of org-extend-today-until to a positive number corresponding
3150 to the number of hours you work past midnight. For example, the following
3151 setting will cause the current day to extend until 6 a.m.
3153 : (setq org-extend-today-until 6)
3155 ** How can I let a task repeat until a certain date?
3157 Use =org-clone-subtree-with-time-shift= and read [[http://karl-voit.at/2017/01/15/org-clone-subtree-with-time-shift/][this blog post]] for
3158 details.
3160 * Appointments/Diary
3161   :PROPERTIES:
3162   :CUSTOM_ID: Appointments/Diary
3163   :END:
3164 ** Is it possible to include entries from org-mode files into my emacs diary?
3165    :PROPERTIES:
3166    :CUSTOM_ID: include-entries-from-org-mode-files-into-emacs-diary
3167    :END:
3169 #+index: Diary
3171    Since the org-mode agenda is much more powerful and can contain the
3172    diary, you should think twice before deciding to do this.  If you
3173    insist, however, integrating Org-mode information into the diary is
3174    possible.  You need to turn on /fancy diary display/ by setting in
3175    .emacs:
3177    : (add-hook 'diary-display-hook 'diary-fancy-display)
3179    Then include the following line into your ~/diary file, in
3180    order to get the entries from all files listed in the variable
3181    =org-agenda-files=
3183    : &%%(org-diary)
3185    You may also select specific files with
3187    : &%%(org-diary) ~/path/to/some/org-file.org
3188    : &%%(org-diary) ~/path/to/another/org-file.org
3190    If you now launch the calendar and press ~d~ to display a
3191    diary, the headlines of entries containing a timestamp, date range,
3192    schedule, or deadline referring to the selected date will be listed.
3193    Just like Org-mode's agenda view, the diary for /today/ contains
3194    additional entries for overdue deadlines and scheduled items.  See
3195    also the documentation of the =org-diary= function.  Under XEmacs, it
3196    is not possible to jump back from the diary to the org, this works
3197    only in the agenda buffer.
3198 ** I want to add my Org scheduled/deadlined entries in my diary!
3199    :PROPERTIES:
3200    :CUSTOM_ID: add-Org-scheduled/deadlined-entries-to-diary!
3201    :END:
3203    Put this in your ~/.diary:
3205    : &%%(org-diary :scheduled :timestamp :deadline)
3207 ** How can I set up automatic reminders based on Org information?
3208    :PROPERTIES:
3209    :CUSTOM_ID: automatic-reminders
3210    :END:
3212 #+index: Reminders
3214   See [[https://orgmode.org/list/13222.1201471868@gamaville.dokosmarshall.org][this post]] by N. Dokos on the list. See also Russell Adams's hack in
3215   [[https://orgmode.org/worg/org-hacks.html#org-agenda-appt-zenity][org-hacks]].
3217 ** How can I make =appt= notice my Org appointments?
3218    :PROPERTIES:
3219    :CUSTOM_ID: appt-notice-my-Org-appointments
3220    :END:
3222 #+index: Appointment
3223 #+index: Appt
3225   : M-x org-agenda-to-appt RET
3227 ** How can I create more complex appointments in my org-files?
3228    :PROPERTIES:
3229    :CUSTOM_ID: diary-sexp-in-org-files
3230    :END:
3232 #+index: Appointment
3234 Org-mode's active timestamps work very well for scheduling individual
3235 or recurring appointments, such as:
3237 #+begin_src org
3238 ,* 8:00am Dentist appointment <2009-01-16 Fri>
3239 #+end_src
3243 #+begin_src org
3244 ,* Vacation
3245   <2009-03-20 Fri>--<2009-04-01 Wed>
3246 #+end_src
3250 #+begin_src org
3251 ,* Weekly meeting with boss
3252   <2009-01-20 Tue 14:00 +1w>
3253 #+end_src
3255 Sometimes, however, you need to set up more complicated recurring
3256 appointments.  Org-mode has built-in support for many of [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Sexp-Diary-Entries.html][the powerful sexp
3257 entries]] that work in [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Diary.html#Diary][Emacs diary]].
3259 Let's say, for instance, that you teach a class that meets every Monday
3260 evening between February 16 and April 20, 2009. The way to enter this an
3261 org-mode file is:
3263 #+begin_src org
3264 ,** Class 7:00pm-9:00pm
3265    <%%(and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009))>
3266 #+end_src
3268 The expression above designates all Mondays that fall between February
3269 16 and April 20. How exactly does it work?
3271  - (and... :: Indicates that *both* of the conditions that follow have
3272           to be true.
3274    - (= 1 (calendar-day-of-week date)) :: Is the day of the week a
3275         Monday?
3277        - Note: the function calendar-day-of-week converts the date to the day of week
3278          expressed in numeric form, where 0 = Sunday, 1 = Monday, and so on.
3280    - (diary-block 2 16 2009 4 20 2009) :: Does the date fall between
3281         these two dates?
3283 You can make a sexp as complex as you like. If you wanted to omit a week
3284 because of holidays, for instance, you could add another condition to the
3285 sexp:
3287 #+begin_src org
3288 ,** Class 7:00pm-9:00pm
3289    <%%(unless (diary-block 3 9 2009 3 13 2009) (and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009)))>
3290 #+end_src
3292 The sexp above would omit Monday during the week of March 9, 2009. For
3293 another way to accomplish the same thing, see [[#org-class][this FAQ]].
3295 Another diary function commonly used for more complex scheduling is
3296 diary-float. For instance,
3298 #+begin_src org
3299 ,* Monthly meeting
3300   <%%(diary-float t 3 3)>
3301 #+end_src
3303 ... would appear on the third Wednesday of every month.
3305 For more ideas on how to create diary special expressions, see [[http://www.emacswiki.org/cgi-bin/wiki/DiaryMode][this
3306 page on the Emacs wiki]].
3308 ** How can I schedule a weekly class that lasts for a limited period of time?
3309    :PROPERTIES:
3310    :CUSTOM_ID: org-class
3311    :END:
3313 Org-mode offers a convenient diary sexp function for setting up a recurring
3314 appointment that lasts for a certain period of time, such as a class. It is
3315 called org-class and it can be entered as follows:
3317 #+begin_src org
3318 ,** Class 7:00pm-9:00pm
3319    <%%(org-class 2009 2 16 2009 4 20 1 10)>
3320 #+end_src
3322 The function above schedules an appointment for every Monday (1)
3323 between February 16 and April 20, 2009, except for ISO week 10 (March
3324 1 to March 7).
3326 If you would prefer not to place the timestamp in the headline, you can use
3327 the following format:
3329 #+begin_src org
3330 ,** Class
3331    <%%(org-class 2009 2 16 2009 4 20 1 10)> 7:00pm-9:00pm Class
3332 #+end_src
3334 In this case, the string following the sexp will be displayed in the
3335 agenda.
3337 The function org-class has the following format:
3339 : (org-class Y1 M1 D1 Y2 M2 D2 DAYNAME &rest SKIP-WEEKS)
3341 Y1/2, M1/2, and D1/2 indicate the beginning and ending dates. DAYNAME takes
3342 the form of a number indicating the day of the week (0 = Sunday, 1 =
3343 Monday, and so on...). In addition, one can add an optional argument
3344 SKIP-WEEKS to indicate weeks on the calendar that should be skipped. This
3345 argument should be expressed as an ISO week number. You can find the number
3346 by invoking emacs' built-in calendar (=M-x calendar=), navigating to the
3347 appropriate week, and typing =p c (calendar-iso-print-date)=.  If one of
3348 the SKIP-WEEKS is the symbol =holidays=, then any holidays known to the
3349 calendar are also skipped.
3351 Here is an alternative method, shared by Paul Sexton on the org mailing
3352 list:
3354 Let's say you are taking night classes in Spanish. The class is every
3355 Wednesday evening at 7pm, starting on 18 August, and runs for 8
3356 weeks.  Org-mode's timestamps do not support limited occurrences of
3357 recurrent items -- you have to schedule the item with infinite recurrences,
3358 then delete it when it finishes.
3360 To schedule the Spanish classes, put the following in your =.emacs=:
3362 #+begin_src emacs-lisp
3363   (defun diary-limited-cyclic (recurrences interval m d y)
3364     "For use in emacs diary. Cyclic item with limited number of recurrences.
3365   Occurs every INTERVAL days, starting on YYYY-MM-DD, for a total of
3366   RECURRENCES occasions."
3367     (let ((startdate (calendar-absolute-from-gregorian (list m d y)))
3368           (today (calendar-absolute-from-gregorian date)))
3369       (and (not (minusp (- today startdate)))
3370            (zerop (% (- today startdate) interval))
3371            (< (floor (- today startdate) interval) recurrences))))
3372 #+end_src
3374 The item in the org file looks like this:
3376 #+begin_src org
3377 ,** 19:00-21:00 Spanish lessons
3378    <%%(diary-limited-cyclic 8 7 8 18 2010)>
3379 #+end_src
3381 ** How can I set an event to occur every day except Saturday and Sunday?
3383 #+begin_src org
3384 ,** Daily meeting
3385    <%%(memq (calendar-day-of-week date) '(1 2 3 4 5))>
3386 #+end_src
3388 ** How do I schedule events relative to Easter Sunday?
3390    Easter's date moves around from year to year according to a complicated
3391    set of criteria which I do not claim to understand.  However the
3392    following code will allow you to schedule recurring events relative to
3393    Easter Sunday.
3395    Note: the function da-easter is from [[http://github.com/soren/elisp/blob/master/da-kalender.el][da-kalender.el]].
3397    Put the following in your .emacs:
3399    #+begin_src emacs-lisp
3400      (defun da-easter (year)
3401        "Calculate the date for Easter Sunday in YEAR. Returns the date in the
3402      Gregorian calendar, ie (MM DD YY) format."
3403        (let* ((century (1+ (/ year 100)))
3404               (shifted-epact (% (+ 14 (* 11 (% year 19))
3405                                    (- (/ (* 3 century) 4))
3406                                    (/ (+ 5 (* 8 century)) 25)
3407                                    (* 30 century))
3408                                 30))
3409               (adjusted-epact (if (or (= shifted-epact 0)
3410                                       (and (= shifted-epact 1)
3411                                            (< 10 (% year 19))))
3412                                   (1+ shifted-epact)
3413                                 shifted-epact))
3414               (paschal-moon (- (calendar-absolute-from-gregorian
3415                                 (list 4 19 year))
3416                                adjusted-epact)))
3417          (calendar-dayname-on-or-before 0 (+ paschal-moon 7))))
3420      (defun da-easter-gregorian (year)
3421        (calendar-gregorian-from-absolute (da-easter year)))
3423      (defun calendar-days-from-easter ()
3424        "When used in a diary sexp, this function will calculate how many days
3425      are between the current date (DATE) and Easter Sunday."
3426        (- (calendar-absolute-from-gregorian date)
3427           (da-easter (calendar-extract-year date))))
3428     #+end_src
3430     Now we can schedule the public holidays associated with Easter as
3431     recurring events.  Good Friday is 2 days before "Easter", Easter Monday
3432     is one day after.
3434     #+begin_src org
3435     ,* Good Friday
3436       <%%(= -2 (calendar-days-from-easter))>
3438     ,* Easter Sunday
3439       <%%(= 0 (calendar-days-from-easter))>
3441     ,* Easter Monday
3442       <%%(= 1 (calendar-days-from-easter))>
3443     #+end_src
3445    [Source: Posted by Paul Sexton on Org-mode mailing list.]
3447 ** How to schedule public holiday that is "the nearest Monday to DATE"?
3449    In New Zealand each regional capital has an "Anniversary Day". The date
3450    of Auckland's anniversary day is "the nearest Monday to 29 January".
3452    Put this in your =.emacs=:
3454    #+begin_src emacs-lisp
3455      (defun calendar-nearest-to (target-dayname target-day target-month)
3456        "Recurring event that occurs in the nearest TARGET-DAYNAME to
3457      the date TARGET-DAY, TARGET-MONTH each year."
3458        (interactive)
3459        (let* ((dayname (calendar-day-of-week date))
3460               (target-date (list target-month target-day (calendar-extract-year date)))
3461               (days-diff (abs (- (calendar-day-number date)
3462                                  (calendar-day-number target-date)))))
3463          (and (= dayname target-dayname)
3464               (< days-diff 4))))
3465     #+end_src
3467    Now we can schedule Auckland Anniversary Day. The first argument, 1,
3468    means Monday (days of the week are numbered starting with Sunday=0).
3470    [Source: Originally posted by Paul Sexton on Org-mode mailing list.]
3472 ** How to schedule public holiday on "the 4th Monday in October"?
3474 #+index: Holiday
3476    This does not require any additions to =.emacs=:
3478 #+begin_src org
3479 ,* Labour Day (NZ)
3480   <%%(diary-float 10 1 4)>
3481 #+end_src
3483 ** Why isn't the agenda showing all the times I put under a single entry?
3484    :PROPERTIES:
3485    :CATEGORY: multiple-timestamps-same-entry
3486    :END:
3488 Probably because you have not set the following variable:
3490 : org-agenda-skip-additional-timestamps-same-entry
3492 The default value of this variable is t, which means that entries with
3493 multiple timestamps, such as the following...
3495 #+begin_src org
3496 ,* Work really, really hard
3497   <2010-11-20 Sat 10:00>
3498   <2010-11-20 Sat 14:00>
3499 #+end_src
3501 ... will only appear in the agenda at the time specified by the first
3502 timestamp. If you set =org-agenda-skip-additional-timestamps-same-entry= to
3503 nil, the item will appear will appear at all the times you specify.
3505 ** Can I import iCal events/appts from Gnus?
3507 #+index: iCal
3508 #+index: Gnus
3510 Yes.  Vagn Johansen wrote [[http://ozymandias.dk/emacs/org-import-calendar.el][org-import-calendar.el]] which lets you do this.
3512 * Export
3513   :PROPERTIES:
3514   :CUSTOM_ID: Export
3515   :END:
3516 ** How do I ignore a headline?
3518    This is one of the most common FAQs on the Org mailing list.  The
3519    following export filter will allow headlines tagged =ignore= to be
3520    ignored during export, while their contents and children headlines
3521    are retained and children headlines are promoted to the level of
3522    the original headline.  Alternately, a more in depth discussion
3523    with a variety of alternate solutions is available in org-hacks
3524    [[file:org-hacks.org::#ignoreheadline][here]].
3526    #+begin_src emacs-lisp
3527      ;; During export headlines which have the "ignore" tag are removed
3528      ;; from the parse tree.  Their contents are retained (leading to a
3529      ;; possibly invalid parse tree, which nevertheless appears to function
3530      ;; correctly with most export backends) all children headlines are
3531      ;; retained and are promoted to the level of the ignored parent
3532      ;; headline.
3533      ;;
3534      ;; This makes it possible to add structure to the original Org-mode
3535      ;; document which does not effect the exported version, such as in the
3536      ;; following examples.
3537      ;;
3538      ;; Wrapping an abstract in a headline
3539      ;;
3540      ;;     * Abstract                        :ignore:
3541      ;;     #+LaTeX: \begin{abstract}
3542      ;;     #+HTML: <div id="abstract">
3543      ;;
3544      ;;     ...
3545      ;;
3546      ;;     #+HTML: </div>
3547      ;;     #+LaTeX: \end{abstract}
3548      ;;
3549      ;; Placing References under a headline (using ox-bibtex in contrib)
3550      ;;
3551      ;;     * References                     :ignore:
3552      ;;     #+BIBLIOGRAPHY: dissertation plain
3553      ;;
3554      ;; Inserting an appendix for LaTeX using the appendix package.
3555      ;;
3556      ;;     * Appendix                       :ignore:
3557      ;;     #+LaTeX: \begin{appendices}
3558      ;;     ** Reproduction
3559      ;;     ...
3560      ;;     ** Definitions
3561      ;;     #+LaTeX: \end{appendices}
3562      ;;
3563      (defun org-export-ignore-headlines (data backend info)
3564        "Remove headlines tagged \"ignore\" retaining contents and promoting children.
3565      Each headline tagged \"ignore\" will be removed retaining its
3566      contents and promoting any children headlines to the level of the
3567      parent."
3568        (org-element-map data 'headline
3569          (lambda (object)
3570            (when (member "ignore" (org-element-property :tags object))
3571              (let ((level-top (org-element-property :level object))
3572                    level-diff)
3573                (mapc (lambda (el)
3574                        ;; recursively promote all nested headlines
3575                        (org-element-map el 'headline
3576                          (lambda (el)
3577                            (when (equal 'headline (org-element-type el))
3578                              (unless level-diff
3579                                (setq level-diff (- (org-element-property :level el)
3580                                                    level-top)))
3581                              (org-element-put-property el
3582                                :level (- (org-element-property :level el)
3583                                          level-diff)))))
3584                        ;; insert back into parse tree
3585                        (org-element-insert-before el object))
3586                      (org-element-contents object)))
3587              (org-element-extract-element object)))
3588          info nil)
3589        data)
3591      (add-hook 'org-export-filter-parse-tree-functions 'org-export-ignore-headlines)
3592    #+end_src
3594 ** My old beamer presentations does not look the same with =ox-beamer.el=
3595    :PROPERTIES:
3596    :CUSTOM_ID: beamer-backwards-incompatibility
3597    :END:
3599 #+index: Export!Beamer
3601    The new beamer introduced a few backwards incompatible changes.
3602    Some of these are discussed [[file:exporters/beamer/ox-beamer.org::#backwards-compatibility][here]].  If you think the discussion can
3603    be improved, please share your thoughts on the mailing list; better
3604    yet, improve the entry on Worg!
3606 ** How can I export <my favourite element> as <my favourite environment> or how can I transform the export output using filters
3607    :PROPERTIES:
3608    :CUSTOM_ID: filter
3609    :END:
3611 #+index: Export!Filters
3613    It is often useful to be able to make small tweaks to the export
3614    output by using filters.
3616    There have been a lot of requests like this on the mailing list
3617    lately.  Often a user wants to export an image in different ways
3618    during LaTeX export; or export different image files for different
3619    backends.  All these can be easily achieved by using export
3620    filters.  You can look at [[https://orgmode.org/list/20130719102315.GB9369@kuru.dyndns-at-home.com][this example]] on the mailing list.  For a
3621    more general discussion on the "new" export engine, including a
3622    description of filters and how they work, see Nicolas Goaziou's
3623    [[https://orgmode.org/list/876229nrxf.fsf@gmail.com][announcement]]: it is very much worth reading in its entirety (except
3624    for the section on users of the experimental version who are by now
3625    extinct - as is the experimental version.)
3627 ** Can I get TODO items exported to HTML as lists, rather than as headlines?
3628    :PROPERTIES:
3629    :CUSTOM_ID: export-TODO-items-as-lists
3630    :END:
3632 #+index: Export!HTML
3634    If you plan to use ASCII or HTML export, make sure things you want to
3635    be exported as item lists are level 4 at least, even if that does
3636    mean there is a level jump.  For example:
3638    : * Todays top priorities
3639    : **** TODO write a letter to xyz
3640    : **** TODO Finish the paper
3641    : **** Pick up kids at the school
3643    Alternatively, if you need a specific value for the heading/item
3644    transition in a particular file, use the =#+OPTIONS= line to
3645    configure the H switch.
3647    : #+OPTIONS:   H:2; ...
3649 ** Can I export only a single subtree?
3650    :PROPERTIES:
3651    :CUSTOM_ID: export-single-subtree
3652    :END:
3654 #+index: Export!Subtree
3656 If you want to export a subtree, mark the subtree as region and then
3657 export. Marking can be done with =C-c @ C-x C-x=, for example.
3659 Alternatively, you can select option =1= in the org export dispatcher
3660 (e.g.., =C-c C-e 1 h= to export the current subtree to html).
3662 By default, the title of the exported file will be set to the heading
3663 of the subtree. You can, however, [[#export-options-for-subtree][customize the title and other export
3664 options]].
3666 ** How can I customize export options for a single subtree?
3667    :PROPERTIES:
3668    :CUSTOM_ID: export-options-for-subtree
3669    :END:
3671 #+index: Export!Options
3673 You can set unique export options for a [[#export-single-subtree][single subtree]] by using
3674 properties. Relevant properties include:
3676  - =EXPORT_TITLE=
3677  - =EXPORT_AUTHOR=
3678  - =EXPORT_DATE=
3679  - =EXPORT_FILE_NAME=
3680  - =EXPORT_OPTIONS= (corresponds to the =#+OPTIONS:= [[https://orgmode.org/manual/Export-settings.html#Export-settings][configuration line]])
3682 ** How can I tell my calendar web application about appointments in my agenda files?
3684 Here is what you need to do:
3686 1. a script that calls Emacs in batch mode and produce a .ics file
3687 2. a script that uploads this .ics file somewhere on the web
3688 3. tell your webapp to fetch this .ics file on the web
3690 Here is the script I use for the first step:
3692 #+begin_src shell-script-mode
3693 #!/bin/bash
3695 /usr/local/bin/emacs --batch --eval \
3696 "(progn (load-file \"~/install/git/org-mode/org.el\") \
3697         (load-file \"~/elisp/config/org-batch-config.el\") \
3698         (setq org-combined-agenda-icalendar-file \"~/org/cal/org.ics\")
3699         (setq org-agenda-files (quote (\"~/org/bzg.org\"))))" \
3700     -f org-export-icalendar-combine-agenda-files
3701 #+end_src
3703 Depending on your configuration, you might change the load sequence.
3705 Here is the script I use for the second step:
3707 #+begin_src shell-script-mode
3708 #!/bin/bash
3709 /usr/bin/rsync -rtv ~/org/org.ics -e ssh me@my_server:/home/me/public_html/
3710 #+end_src
3712 Note: if you want to cron this rsync script, you will need to let
3713 =my_server= to know about your SSH public key.  Check [[http://troy.jdmz.net/rsync/index.html][this page]] as a
3714 starter.
3716 Now you can cron the two scripts above and your webapp will always be
3717 up to date with your Org agendas.
3719 Also see [[https://orgmode.org/org.html#Exporting-Agenda-Views][Exporting agenda views]] from Org manual.
3721 ** How can I get Mac OSX 10.3 iCal to import my org-exported .ics files?
3722    :PROPERTIES:
3723    :CUSTOM_ID: iCal-import-ics-files-old
3724    :END:
3726 #+index: .ics
3727 #+index:  iCal!Mac OSX 10.3
3729    When using iCal under Apple MacOS X Tiger, you can create a new C-e c=,
3730    see the variables =org-icalendar-combined-name= and
3731    =org-combined-agenda-icalendar-file=).  Then set Org-mode to overwrite
3732    the corresponding file /~/Library/Calendars/OrgMode.ics/.  You may even
3733    use AppleScript to make iCal re-read the calendar files each time a new
3734    version of /OrgMode.ics/ is produced.  Here is the setup needed for
3735    this:
3737    : (setq org-combined-agenda-icalendar-file
3738    :     "~/Library/Calendars/OrgMode.ics")
3739    : (add-hook 'org-after-save-iCalendar-file-hook
3740    :  (lambda ()
3741    :   (shell-command
3742    :    "osascript -e 'tell application \"iCal\" to reload calendars'")))
3744 ** How can I get Mac OSX 10.4 or later iCal to import my Org-exported .ics files?
3745    :PROPERTIES:
3746    :CUSTOM_ID: iCal-import-ics-files-new
3747    :END:
3749 #+index:  iCal!Mac OSX 10.4
3751    For Mac OS X 10.4, you need to write the ics file to
3752    =/Library/WebServer/Documents/= and then subscribe iCalendar to =http:
3753    //localhost/orgmode.ics=
3755 ** How can I remove timestamps and todo keywords from my exported file?
3756    :PROPERTIES:
3757    :CUSTOM_ID: export-options-remove-timestamps
3758    :END:
3760 #+index: Export!Timestamps
3761 #+index: Export!Todo keywords
3763 You can place an options line at the top of your org file:
3765 : #+OPTIONS: <:nil todo:nil
3767 There is a whole host of export options you can set with an in-buffer
3768 options or via global variables. See [[https://orgmode.org/manual/Export-settings.html#Export-settings][this section]] of the manual for a
3769 full list.
3771 ** How can I preserve faces when I export an agenda from the command line?
3772    :PROPERTIES:
3773    :CUSTOM_ID: preserving-faces-during-batch-export
3774    :END:
3776 #+index: Export!Agenda
3777 #+index: Export!Faces
3779 Normally, when you export an org file or an agenda view from within
3780 emacs, htmlize will convert your face definitions to direct color css
3781 styles inlined into each =<span>= object, resulting in an HTML output
3782 that preserves the general look of your Org buffers and agenda views.
3784 Let's say you generate an export from the command line, such as the
3785 following:
3787 : emacs -batch -l ~/.emacs -eval '(org-batch-agenda "e")'
3791 : emacs -batch -l ~/.emacs -eval '(org-publish-all)'
3793 In such an instance, the exported HTML will contain only very basic
3794 color styles. The reason is that when Emacs is run in batch mode, it
3795 does not have a display and therefore only rudimentary face
3796 definitions.  If you'd like to use more complex styles, you'll have to
3797 make sure that the export process only assigns classes instead of
3798 direct color values.  This can be done by binding the variable
3799 =org-export-htmlize-output-style= to =css= for the duration of the
3800 export, for example with
3802 : emacs -batch -l ~/.emacs
3803 :   -eval '(let ((org-export-htmlize-generate-css (quote css)))
3804 :            (org-batch-agenda "e"))'
3806 Then you can use a style file to make these classes look any way you
3807 like.  To generate face definitions for a CSS file based on any faces
3808 you are currently using in Emacs, you can use the following command:
3810 : M-x org-export-htmlize-generate-css RET
3812 This will generate a =<style>...</style>= section, the content of
3813 which you can add to your style file.
3815 ** How can I avoid dark color background when exporting agenda to ps format?
3816    :PROPERTIES:
3817    :CUSTOM_ID: avoiding-dark-background-when-exporting-agenda
3818    :END:
3820 #+index: Export!.ps
3822 Add this to your .emacs and evaluate it.
3824 #+BEGIN_SRC emacs-lisp
3825   (setq org-agenda-exporter-settings
3826         '((ps-print-color-p 'black-white)))
3827 #+END_SRC
3829 ** How can I include e.g. an abstract in export to Latex and HTML?
3830    :PROPERTIES:
3831    :CUSTOM_ID: include-abstract-in-export-to-latex-and-html
3832    :END:
3834 #+index: Export!Abstract
3836 Org does not currently have special markup for abstracts, but for
3837 export purposes, you can extend the block-level structural and
3838 semantic markup in Org with the contributed package [[file:org-contrib/org-special-blocks.org][org-special-blocks]]
3839 (by Chris Gray). To turn it on, put this in your =.emacs=:
3841 : (require 'org-special-blocks)
3843 Now, you can mark up the abstract of your article like this:
3845 : #+BEGIN_ABSTRACT
3846 : Falling apples were observed and compared with pears. Newton's laws
3847 : were confirmed at the 95% confidence level.
3848 : #+END_ABSTRACT
3850 Exporting to Latex wraps this in a
3851 =\begin{abstract}....\end{abstract}= environment, which just works.
3853 HTML export wraps it in a ~<div class="abstract">...</div>~
3854 element. The HTML result won't look like anything special until you
3855 style it. Here is some sample CSS to get you started; put these in
3856 your document header:
3858 : #+STYLE: <style>.abstract {margin: 1em; padding: 1em; border: 1px solid black}
3859 : #+STYLE: .abstract:before {content: "Abstract: "; font-weight: bold}</style>
3861 Generally, =#+begin_foo= will work for any simple Latex =foo=
3862 environment not supported by existing Org markup.
3864 If you need to pass parameters, process the block content in some way,
3865 or support other exporters, you may want to consider whether you can
3866 customize it using Eric Schulte's [[file:org-contrib/org-exp-blocks.org][org-exp-blocks]] instead.
3868 ** How can I get colored source code when exporting to LaTeX?
3869    :PROPERTIES:
3870    :CUSTOM_ID: fontified_source_code_w_latex
3871    :END:
3873 #+index: Export!LaTeX
3875 As of Sun Aug 9 2009 the "current" version of Org-mode (see
3876 [[#keeping-current-with-Org-mode-development]]) supports exporting source
3877 code to LaTeX using the listings package.
3879 To turn on listing export add the following to your Org-mode
3880 customization.
3881 #+begin_src emacs-lisp
3882   ;; requite org-latex so that the following variables are defined
3883   (require 'ox-latex)
3885   ;; tell org to use listings
3886   (setq org-latex-listings t)
3888   ;; you must include the listings package
3889   (add-to-list 'org-latex-packages-alist '("" "listings"))
3891   ;; if you want colored source code then you need to include the color package
3892   (add-to-list 'org-latex-packages-alist '("" "color"))
3893 #+end_src
3895 The listings package will now be used to fontify source code in your
3896 LaTeX documents.  By default listings will not color any of your
3897 source code.  If you would like to set colors for keywords and
3898 comments in your latex documents you can do so using LaTeX directives
3899 like the following.
3900 #+begin_src latex
3901   \lstset{keywordstyle=\color{blue},
3902     commentstyle=\color{red},
3903     stringstyle=\color{green}
3904   }
3905 #+end_src
3907 of if you want to get even fancier with your colors you can try
3908 something like the following
3909 #+begin_src latex
3910 \definecolor{keywords}{RGB}{255,0,90}
3911 \definecolor{comments}{RGB}{60,179,113}
3912 \definecolor{fore}{RGB}{249,242,215}
3913 \definecolor{back}{RGB}{51,51,51}
3914 \lstset{
3915   basicstyle=\color{fore},
3916   keywordstyle=\color{keywords},
3917   commentstyle=\color{comments},
3918   backgroundcolor=\color{back}
3920 #+end_src
3922 For more complex listings use cases consult the [[ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/listings/listings.pdf][listings manual]].
3924 ** How can I export to Latex Beamer?
3925    :PROPERTIES:
3926    :CUSTOM_ID: beamer
3927    :END:
3929 #+index: Export!Beamer
3931 The latex [[http://latex-beamer.sourceforge.net/][Beamer Class]] is a useful class for generating slide shows.
3932 The following can be used to export Org-mode documents to LaTeX
3933 beamer.
3935 Add the following to your Emacs initialization file.
3936 #+begin_src emacs-lisp
3937   (unless (boundp 'org-latex-classes)
3938     (setq org-latex-classes nil))
3939   (add-to-list 'org-latex-classes
3940                '("beamer"
3941                  "\\documentclass[11pt]{beamer}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{hyperref}\n\\usepackage{verbatim}\n"
3942                  ("\\section{%s}" . "\\section*{%s}")
3943                  ("\\begin{frame}\\frametitle{%s}" "\\end{frame}"
3944                   "\\begin{frame}\\frametitle{%s}" "\\end{frame}")))
3945 #+end_src
3947 Then by placing
3948 : #+LaTeX_CLASS: beamer
3949 in the header of your Org-mode document it will automatically export
3950 to the Beamer document class on LaTeX export.  With the above
3951 configuration top-level headers will be mapped to sections in the
3952 Beamer document, second-level headers will be mapped to frames, and
3953 lower level headlines will be mapped to itemize objects.
3955 This above is adapted from an [[https://orgmode.org/list/9854.1246500519@gamaville.dokosmarshall.org][email by Nick Dokos]], and an [[https://orgmode.org/list/935736B7-18C4-4730-B765-D9E8463E9C84@tsdye.com][email by
3956 Thomas Dye]].  For a much more complex Beamer setup see the [[https://orgmode.org/list/935736B7-18C4-4730-B765-D9E8463E9C84@tsdye.com][email by
3957 Thomas Dye]].
3959 ** How can I use RefTeX in Org-mode files for LaTeX export and in Org-babel LaTeX code blocks?
3960    :PROPERTIES:
3961    :CUSTOM_ID: using-reftex-in-org-mode
3962    :END:
3964 #+index: RefTeX
3965 #+index: Babel
3966 #+index: Code blocks
3968 [[http://www.gnu.org/software/auctex/reftex.html][RefTeX]] is an indispensable tool for the author of LaTeX documents.  It
3969 aids in creation of bibliographies, cross-references, indexes, and
3970 glossaries.  RefTeX understands the structure of multi-file LaTeX
3971 documents and is able to collect from them information about the
3972 location(s) of external data stores used in creation of the final
3973 document.  RefTeX was written by Carsten Dominik and is currently
3974 being maintained by the [[http://www.gnu.org/software/auctex/index.html][AucTeX]] project.
3976 *** Using RefTeX In Org-mode Files for LaTeX Export
3977 In Org-mode files for LaTeX export, the trick is to find a way to tell
3978 RefTeX the locations of external data stores.  One way is to set the
3979 variable, =reftex-default-bibliography=.  Add lines like these to
3980 .emacs:
3982 #+begin_src emacs-lisp
3983   (setq reftex-default-bibliography
3984         (quote
3985          ("default.bib" "other-default.bib")))
3986 #+end_src
3988 In practice, this is a limited solution and the
3989 typical user will want to pass this information on a per-file basis.
3990 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
3991 Braindump]].
3993 The first solution, proposed by Mario, enables the RefTeX citation
3994 function in Org-mode.  Add these lines to .emacs:
3996 #+begin_src emacs-lisp
3997   (defun org-mode-reftex-setup ()
3998     (load-library "reftex")
3999     (and (buffer-file-name)
4000          (file-exists-p (buffer-file-name))
4001          (reftex-parse-all))
4002     (define-key org-mode-map (kbd "C-c )") 'reftex-citation))
4003   (add-hook 'org-mode-hook 'org-mode-reftex-setup)
4004 #+end_src
4006 Then add the following lines anywhere in the Org-mode file (Org-mode
4007 will recognize them as LaTeX commands):
4009 #+begin_src org
4010 \bibliographystyle{plain}
4011 \bibliography{BIB-NAME}
4012 #+end_src
4014 With this setup, =C-c )= will invoke =reftex-citation= which will
4015 insert a reference in the usual way:
4017 #+begin_src org
4018 ,* test reftex
4020 This is a citation \cite{tierney90}.
4022 \bibliographystyle{plain}
4023 \bibliography{tsd}
4024 #+end_src
4026 This Org-mode file will export the following LaTeX output:
4028 #+begin_src latex :exports code
4029   % Created 2010-03-22 Mon 14:34
4030   \documentclass[11pt,letter]{article}
4031   \usepackage[utf8]{inputenc}
4032   \usepackage[T1]{fontenc}
4033   \usepackage{hyperref}
4035   \title{test.org}
4036   \author{Tom Dye}
4037   \date{2010-03-22 Mon}
4039   \begin{document}
4041   \maketitle
4043   \setcounter{tocdepth}{3}
4044   \tableofcontents
4045   \vspace*{1cm}
4047   \section{test reftex}
4048   \label{sec-1}
4051   This is a citation \cite{tierney90}.
4053   \bibliographystyle{plain}
4054   \bibliography{tsd}
4056   \end{document}
4057 #+end_src
4060 A second solution, to activate the RefTeX minor mode on a per-file
4061 basis, was posted by Kevin Brubeck Unhammer in response to this idea.
4062 Add the following lines to .emacs:
4064 #+begin_src emacs-lisp
4065   (add-hook ‘org-mode-hook
4066              (lambda ()
4067                (if (member “WRITE” org-todo-keywords-1)
4068                    (org-mode-article-modes))))
4069 #+end_src
4071 where =org-mode-article-modes= is defined as follows:
4073 #+begin_src emacs-lisp
4074   (defun org-mode-article-modes ()
4075     (reftex-mode t)
4076     (bib-cite-minor-mode t)
4077     (and (buffer-file-name)
4078          (file-exists-p (buffer-file-name))
4079          (reftex-parse-all)))
4080 #+end_src
4082 Add the =\bibliographystyle{}= and =\bibliography{}= lines to the
4083 Org-mode file as before and define a TODO keyword, =WRITE=, perhaps
4084 like this:
4086 #+begin_src org
4087 ,#+TODO: TODO(t) STARTED(s) WRITE | DONE(d) DEFERRED(f)
4088 #+end_src
4090 With this setup, you insert a citation with =M-x reftex-citation RET=.
4092 *** Using RefTeX in Org-babel LaTeX Code Blocks
4094 In Org-babel LaTeX code blocks, the trick is to give RefTeX access to
4095 information in other Org-babel LaTeX code blocks.  If you use an Emacs
4096 starter kit where configuration information is held in Org-mode files,
4097 then the second solution is preferable because you won't be asked for
4098 a master file when Emacs is started.  For this reason, the second
4099 solution is modified for use with Org-babel latex code blocks.  No
4100 key-binding is needed here because Org-babel code blocks are edited
4101 within the usual AucTeX environment.
4103 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]])
4104 #+begin_src emacs-lisp
4105   (defun org-mode-article-modes ()
4106     (reftex-mode t)
4107     (and (buffer-file-name)
4108          (file-exists-p (buffer-file-name))
4109          (reftex-parse-all)))
4111   (add-hook 'org-mode-hook
4112             (lambda ()
4113               (if (member "REFTEX" org-todo-keywords-1)
4114                   (org-mode-article-modes))))
4115 #+end_src
4117 Then add a line like the following line to the top of your org-mode file:
4119 #+begin_src org
4120 ,#+TODO: TODO(t) STARTED(s) | DONE(d) DEFERRED(f) REFTEX
4121 #+end_src
4123 When you open an org-mode file with a line like this, RefTeX will
4124 prompt for the master .tex file, which will be parsed in the usual
4125 way.  This means that the .tex file should already exist, perhaps by
4126 tangling the LaTeX preamble and postamble, before
4127 =org-mode-article-modes= is activated for the Org-mode file.
4129 ** How can I use XeLaTeX for LaTeX export instead of pdfLaTeX?
4130    :PROPERTIES:
4131    :CUSTOM_ID: using-xelatex-for-pdf-export
4132    :END:
4134 #+index: XeLaTeX
4135 #+index: pdfLaTeX
4137 [[https://en.wikipedia.org/wiki/XeTeX][XeLaTeX]] is an alternative to pdfLaTeX for typesetting LaTeX
4138 documents.  XeTeX can use any fonts installed in the operating system
4139 without configuring TeX font metrics, and can make direct use of advanced
4140 typographic features of OpenType and other font formats.  By default,
4141 org-mode exports =org= files to =pdf= via pdfLaTeX.
4143 Here is one way to smoothly incorporate XeLaTeX into org-mode's export
4144 process.  This solution takes advantage of [[http://www.phys.psu.edu/~collins/software/latexmk-jcc][latexmk]], a perl script that
4145 intelligently and automatically manages latex compilation.  It is included
4146 with TeXLive, but at present the version included is not quite up-to-date
4147 enough for our needs.  Version 4.20 and higher includes an option allowing
4148 you to specify which program to use when "pdflatex" is called.  Install a
4149 current version of latexmk as per the instructions on the [[http://www.phys.psu.edu/~collins/software/latexmk-jcc][latexmk]] site.  If
4150 necessary, disable the older version that comes with TeXLive.  This is
4151 likely in =/usr/texbin/=, and you should rename or remove it.  Then you can
4152 put the following in your =~/.emacs.d/= or equivalent:
4154 #+begin_src emacs-lisp
4155   (require 'ox-latex)
4156   (setq org-latex-listings t)
4158   ;; Originally taken from Bruno Tavernier: https://orgmode.org/list/87zkv0pqyi.fsf@mundaneum.com
4159   ;; but adapted to use latexmk 4.20 or higher.
4160   (defun my-auto-tex-cmd ()
4161     "When exporting from .org with latex, automatically run latex,
4162        pdflatex, or xelatex as appropriate, using latexmk."
4163     (let ((texcmd)))
4164     ;; default command: oldstyle latex via dvi
4165     (setq texcmd "latexmk -dvi -pdfps -quiet %f")
4166     ;; pdflatex -> .pdf
4167     (if (string-match "LATEX_CMD: pdflatex" (buffer-string))
4168         (setq texcmd "latexmk -pdf -quiet %f"))
4169     ;; xelatex -> .pdf
4170     (if (string-match "LATEX_CMD: xelatex" (buffer-string))
4171         (setq texcmd "latexmk -pdflatex=xelatex -pdf -quiet %f"))
4172     ;; LaTeX compilation command
4173     (setq org-latex-to-pdf-process (list texcmd)))
4175   (add-hook 'org-export-latex-after-initial-vars-hook 'my-auto-tex-cmd)
4178   ;; Specify default packages to be included in every tex file, whether pdflatex or xelatex
4179   (setq org-latex-packages-alist
4180         '(("" "graphicx" t)
4181               ("" "longtable" nil)
4182               ("" "float" nil)))
4184   (defun my-auto-tex-parameters ()
4185         "Automatically select the tex packages to include."
4186         ;; default packages for ordinary latex or pdflatex export
4187         (setq org-latex-default-packages-alist
4188               '(("AUTO" "inputenc" t)
4189                 ("T1"   "fontenc"   t)
4190                 (""     "fixltx2e"  nil)
4191                 (""     "wrapfig"   nil)
4192                 (""     "soul"      t)
4193                 (""     "textcomp"  t)
4194                 (""     "marvosym"  t)
4195                 (""     "wasysym"   t)
4196                 (""     "latexsym"  t)
4197                 (""     "amssymb"   t)
4198                 (""     "hyperref"  nil)))
4200         ;; Packages to include when xelatex is used
4201         (if (string-match "LATEX_CMD: xelatex" (buffer-string))
4202             (setq org-latex-default-packages-alist
4203                   '(("" "fontspec" t)
4204                     ("" "xunicode" t)
4205                     ("" "url" t)
4206                     ("" "rotating" t)
4207                     ("american" "babel" t)
4208                     ("babel" "csquotes" t)
4209                     ("" "soul" t)
4210                     ("xetex" "hyperref" nil)
4211                     )))
4213         (if (string-match "LATEX_CMD: xelatex" (buffer-string))
4214             (setq org-latex-classes
4215                   (cons '("article"
4216                           "\\documentclass[11pt,article,oneside]{memoir}"
4217                           ("\\section{%s}" . "\\section*{%s}")
4218                           ("\\subsection{%s}" . "\\subsection*{%s}")
4219                           ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
4220                           ("\\paragraph{%s}" . "\\paragraph*{%s}")
4221                           ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
4222                         org-latex-classes))))
4224   (add-hook 'org-export-latex-after-initial-vars-hook 'my-auto-tex-parameters)
4225 #+end_src
4227 The =my-auto-tex-cmd= function looks at your =.org= file and checks whether
4228 you've specified which latex to use. If there are no instructions, it just
4229 runs regular old latex. If it finds the string =LATEX_CMD: pdflatex= in
4230 your file, it runs pdflatex. If it finds =LATEX_CMD: xelatex=, it runs
4231 xelatex. Because control is handed off to latexmk, nothing else is needed:
4232 it takes care of figuring things out so that the references and citations
4233 are correct.
4235 The second half of the code above specifies the latex packages that will be
4236 included in the =.tex= file. The variable =org-latex-packages-alist=
4237 specifies a list of packages that are always included in the header of
4238 latex documents, regardless of how they are compiled. The variable
4239 =org-latex-default-packages-alist= adds additional packages
4240 depending on whether latex/pdflatex or xelatex is being used. You can
4241 change the content of these as needed.
4243 Finally, the =org-latex-classes= variable redefines elements of the
4244 =.tex= file's preamble for the xelatex case. These can also be customized
4245 as needed.
4247 By way of example, an =.org= file you want compiled with xelatex might
4248 contain the following header:
4250 : #+TITLE: My Paper
4251 : #+AUTHOR: Jane Doe
4252 : #+DATE:
4253 : #+OPTIONS: toc:nil num:nil
4254 : #+LATEX_CMD: xelatex
4255 : #+LATEX_HEADER: \setsansfont[Mapping=tex-text]{Unit-Bold}
4256 : #+LATEX_HEADER: \setmonofont[Mapping=tex-text,Scale=MatchLowercase]{PragmataPro}
4257 : #+LATEX_HEADER: \setromanfont[Mapping=tex-text,Numbers=OldStyle]{Minion Pro}
4259 If you always want to have the same font setup in your xelatex documents,
4260 the =fontspec= commands setting the font choices can be put in the
4261 =org-latex-classes= setting instead.
4263 The upshot is that when you want to export an =.org= file using XeLaTeX,
4264 you can now simply make sure the line =LATEX_CMD: xelatex= is in your
4265 =.org= file, then do =C-c C-e d= as usual, and org-mode, with latexmk in
4266 the background, does the rest for you.
4268 ** Why is my exported PDF file almost unreadable?
4269    :PROPERTIES:
4270    :CUSTOM_ID: unreadable-pdfs
4271    :END:
4273 Some PDF viewers (earlier versions (< v6) of Acrobat Reader, Evince,
4274 possibly others) do not get along with Adobe Type3 fonts, producing almost
4275 unreadable screen output (printed output is OK). If you see this, first
4276 verify the fonts that your document uses: open it with Acrobat Reader or
4277 Evince, select "Properties" from the "File" menu and click on the "Fonts"
4278 tab; alternatively, you can use the pdffonts program (part of the
4279 xpdf-reader package) from the command line.  If that is indeed the problem,
4280 then either use a different viewer or install Type1 versions of the
4281 problematic fonts. For more details, see the "PDF export" section of
4282 [[./org-dependencies.org][org-dependencies]].
4284 ** Can I add attributes to a link or an image in HTML export?
4285    :PROPERTIES:
4286    :CUSTOM_ID: html-image-and-link-attributes
4287    :END:
4289 #+index: Export!Link
4290 #+index: Export!Image
4291 #+index: Link!Attributes
4292 #+index: Image!Attributes
4294 Yes.  Excerpt from [[https://orgmode.org/manual/Images-in-HTML-export.html#Images-in-HTML-export][Org's manual]]:
4296 If you need to add attributes to an inlined image, use a `#+ATTR_HTML'.
4297 In the example below we specify the `alt' and `title' attributes to
4298 support text viewers and accessibility, and align it to the right.
4300 :  #+CAPTION: A black cat stalking a spider
4301 :  #+ATTR_HTML: :alt cat/spider image :title Action! :align right
4302 :  [[./img/a.jpg]]
4304 and you could use `http' addresses just as well.
4306 ** How can I export an org file to rtf, odt (Open Office), or doc (Word)?
4307    :PROPERTIES:
4308    :CUSTOM_ID: convert-to-open-office
4309    :END:
4311 #+index: Export!rtf
4312 #+index: Export!odt
4313 #+index: Export!doc
4315 Orgmode exports natively to =OpenDocument= format using =org-odt= module.
4317 The key bindings for export are =C-c C-e o= and =C-c C-e O=.
4319 If you don't see =OpenDocumentText= as an option under =C-c C-e= you need
4320 to upgrade to =Org-mode 7.6= by one of the following means:
4322 1. Install org-7.6 using a distribution .zip or .tar.gz file, or
4323    through Git. Then do the following:
4324    1. Add =contrib/lisp= to the load-path in your =.emacs=
4325      #+begin_src emacs-lisp
4326        ;; modify org-root-dir as needed
4327        (add-to-list 'load-path "org-root-dir/contrib/lisp")
4328     #+end_src
4329    2. Do =M-x customize-variable RET org-modules RET= and enable the
4330       =odt= option
4332 2. Upgrade to (atleast) the =Emacs-24.1 pretest= version. Install
4333    =org-odt= package using =M-x list-packages=.
4335 #+begin_comment
4337 - Use existing exporters
4339   Export to one of org-mode's supported export formats and then use an
4340   external tool or method to convert the exported file to doc or odt.
4342   With simple documents, these methods work well. However for complex
4343   documents containing footnotes, embedded images, math formuale etc
4344   the results may be less than satisfactory. (Note, the lists below
4345   are by no means comprehensive).
4346   1. html -> odt/doc/rtf
4347      - open html in Open Office and save as odt/doc ([[https://orgmode.org/list/87lj6btkim.wl%ucecesf@ucl.ac.uk][see this post by
4348         Eric Fraga]])
4349      - [[http://www.artofsolving.com/opensource/pyodconverter][PyODConverter]]
4350      - [[http://johnmacfarlane.net/pandoc/][Pandoc]] (this works for LaTeX and docbook as well)
4351      - (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
4352         from html to doc
4353   2. LaTeX -> odt/doc/rtf
4354       - [[http://latex2rtf.sourceforge.net/][LaTeX2rtf]] (works well with index, footnotes, and references)
4355       - [[http://www.tug.org/tex4ht/][TeX4ht]] (works with more complex latex elements, though can be
4356         difficult to install)
4357         - run =mk4ht oolatex file.tex=
4359 See [[https://orgmode.org/list/AANLkTi=nbM9j=jO+wfBw9hTvnp_BXzQn51Pv7c0gKTRa@mail.gmail.com][this thread]] for further details.
4360 #+end_comment
4362 ** ODT export aborts on my Windows machine as I don't have zip installed.  Where can I find a zip utility?
4364 #+index: Zip
4366 You can either use [[https://en.wikipedia.org/wiki/Info-ZIP][Info-ZIP]] or zip package from Cygwin. Please customize
4367 =exec-path= to include the installation directory.
4369 ** I cannot open an exported =*.odt= file in LibreOffice because it is corrupt.  What do I do?
4370    :PROPERTIES:
4371    :CUSTOM_ID: debugging-org-odt
4372    :END:
4374 #+index: Export!odt
4376 Typically the corruption of =odt= file happens when the XML emitted by
4377 Org is not well-formed according to =OpenDocument schema=.
4379 If you encounter corruption issues please identify the root cause
4380 using one of the methods described below:
4382 - Use an Online validator
4383   - Pass the exported document through the [[http://tools.services.openoffice.org/odfvalidator/][ODF Validator]] and note down
4384     the errors.
4386 - Use Emacs' in-built validator
4387   1. Switch to =*.odt= buffer =(C-x b whatever.odt)=
4388   2. Open the =content.xml= file - =(Hit RET on content.xml)=
4389   3. Do a =C-u C-c C-n= - =(M-x rng-first-error)=
4390   4. Note the error message, the XML markup at the point of error and
4391      the surrounding context.
4393 Once you have identified the error
4394 1. Create a minimal org file that reproduces the error.
4395 2. Post a bug-report to =emacs-orgmode@gnu.org=.
4397 ** How can I specify ODT export styles?
4399 #+index: Export!odt style
4401 Check the variable =org-export-odt-styles-file=.  Here is its docstring,
4402 as of Org version 7.8:
4404 : org-export-odt-styles-file is a variable defined in `org-odt.el'.
4405 : Its value is nil
4407 : Documentation:
4408 : Default styles file for use with ODT export.
4409 : Valid values are one of:
4410 : 1. nil
4411 : 2. path to a styles.xml file
4412 : 3. path to a *.odt or a *.ott file
4413 : 4. list of the form (ODT-OR-OTT-FILE (FILE-MEMBER-1 FILE-MEMBER-2
4414 : ...))
4416 : [snip]
4418 : Use "#+ODT_STYLES_FILE: ..." directive to set this variable on
4419 : a per-file basis.  For example,
4421 : #+ODT_STYLES_FILE: "/path/to/styles.xml" or
4422 : #+ODT_STYLES_FILE: ("/path/to/file.ott" ("styles.xml" "image/hdr.png")).
4424 : You can customize this variable.
4426 ** Can I omit the title in the LaTeX export?
4428 Yes: simply use a blank #+TITLE in your Org file.
4430 ** How can I use arbitrary colors for words/sentences in HTML export?
4432 Add the following to your Emacs config,
4434 #+BEGIN_SRC emacs-lisp
4435     ;; -*- emacs-lisp -*-
4436     (org-add-link-type
4437      "color"
4438      (lambda (path)
4439        (message (concat "color "
4440                         (progn (add-text-properties
4441                                 0 (length path)
4442                                 (list 'face `((t (:foreground ,path))))
4443                                 path) path))))
4444      (lambda (path desc format)
4445        (cond
4446         ((eq format 'html)
4447          (format "<span style=\"color:%s;\">%s</span>" path desc))
4448         ((eq format 'latex)
4449          (format "{\\color{%s}%s}" path desc)))))
4450 #+END_SRC
4452 and then you can use
4454 : [[color:red][red]]
4456 for colored export.
4458 This question has been raised [[https://orgmode.org/list/44B0EAE8544C834188E8790873CDE1CC226BF8F8@ARCEXCHANGE.arc.local][on the mailing list]] by Jos'h Fuller and
4459 answered by Eric Schulte.
4462 ** How can I suppress the page number in the footer of an exported PDF?
4463 #+index: Export!pdf
4464 #+index: pdfLaTeX
4466 Use the following directive in your Org file:
4468 : #+LATEX: \thispagestyle{empty}
4470 * Backup
4472 #+index: Backup
4474 Since =org= files are so central to your life, you probably want to back
4475 them up in a safe place.
4477 If the =org= file you want to back up are in a single directory, the
4478 preferred method is to us a =RCS= (Revision Control System) -- pick up your
4479 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
4480 RCS you use and how you use it, you can have a /local/ backup or sync it on
4481 a remote place.
4483 If you want to store all your =org= files from your =$HOME= to a single
4484 =~/org/backup/= folder, you can use this shell script (as [[https://orgmode.org/list/AANLkTimemfOeZFYajbpeW09OOJ87CVo-cTnarK-E=c3h@mail.gmail.com][suggested by
4485 Suvayu Ali]]):
4487 #+begin_src sh
4488 mkdir -p ~/org/backup && \
4489 find $HOME -type f -name '*\.org' ! -path "$HOME/org/backup/*" \
4490      -exec cp -t ~/org/backup/ \{\} \;
4491 #+end_src
4493 It will recursively search for =org= files in your =$HOME= directory
4494 (except those in =~/org/backup/=) and copy them to =~/org/backup/=.
4495 You can then use rsync to make sure =~/org/backup/= also lives on a
4496 remote and safe place.
4498 * Org-mode on mobile devices
4500 #+index: MobileDevices
4502 ** What mobile apps for org-mode are available?
4504 These are the most popular apps for keeping notes in org-mode format
4505 on mobile devices:
4507 - MobileOrg for *iOS*, created by Richard Moreland.  Check out [[https://mobileorg.github.io][the project's page]].
4508 - Orgzly for *Android*. See [[http://www.orgzly.com/][the project's page]].
4509 - Organice, a React-based [[https://en.wikipedia.org/wiki/Progressive_web_application][Progressive Web App (PWA)]] for any device
4510   with a browser.  Syncs with Dropbox, Google Drive, and WebDAV.  Can
4511   be self-hosted, or simply use [[https://organice.200ok.ch/][the public instance]].  Check out [[https://organice.200ok.ch/documentation.html][the
4512   documentation]] for more info.
4514 There is also an app called MobileOrg for *Android* which is now
4515 unmaintained and not fully compatible with recent versions of
4516 Android. See [[http://wiki.github.com/matburt/mobileorg-android/][the project page]].
4518 ** Can I use the same files on my mobile device as on my computer?
4520 Absolutely! Depending on the mobile app and your preferences, a number
4521 of options are available.
4523 *** Synchronizing using the MobileOrg protocol
4525 Org-mode in Emacs has a builtin protocol for synchronizing and merging
4526 changes from the mobile device. This protocol is supported by
4527 MobileOrg for iOS and by the (unmaintained) MobileOrg for Android, but
4528 *not* by Orgzly. Synchronization is initiated from within Emacs, which
4529 needs to fetch a file containing only the changes in a
4530 MobileOrg-specific file format. The file can be retrieved:
4532 - via [[http://www.dropbox.com/][Dropbox.com]] (easier to set up, free accounts available)
4533 - via [[https://syncthing.net/][Syncthing]] (open source and self hosted, potentially more data privacy)
4534 - via a [[https://en.wikipedia.org/wiki/WebDAV][WebDAV]] server of your choice (potentially more data privacy)
4536 **** How does synchronization via WebDAV work?
4537    :PROPERTIES:
4538    :CUSTOM_ID: mobileorg_webdav
4539    :END:
4541 You need to create a dedicated directory on the WebDAV server for the
4542 communication between Emacs and MobileOrg.
4544 #+begin_src ditaa :file images/orgmobile-tramp-webdav.png :cmdline -r
4545   +----------------------+           +----------------------+
4546   | desktop              |           | WebDAV server        |
4547   +----------------------+           +----------------------+
4548   | emacs                |           | org-mobile-directory |
4549   |   + org-mode         |           | containing:          |
4550   |                      | scp (ssh) |                      |
4551   |   org-mobile-push ----------------->  *.org             |
4552   |   org-mobile-pull <-----------------                    |
4553   |                      | via tramp |       ^              |
4554   +----------------------+           +-------|--------------+
4555                                              |
4556                 +----------------------+     |
4557                 | mobile device        |     | WebDAV
4558                 +----------------------+     |
4559                 |                      |     |
4560                 |    MobileOrg     <---------+
4561                 |                      |
4562                 +----------------------+
4563 #+end_src
4565 #+RESULTS:
4566 [[file:images/orgmobile-tramp-webdav.png]]
4568 If you can mount that directory locally so that Emacs can directly
4569 write to it, just set the variable =org-mobile-directory= to point to
4570 that directory.  Alternatively, by using the [[http://www.gnu.org/software/tramp/][/TRAMP/]] method,
4571 =org-mobile-directory= may point to a remote directory accessible
4572 through, for example, /ssh/ and /scp/:
4574 #+begin_src emacs-lisp
4575 (setq org-mobile-directory "/scpc:user@remote.host:org/webdav/")
4576 #+end_src
4578   {{{BeginWarningBox}}} N.B. Since this configures /TRAMP/ to connect
4579   via /ssh/, you will need to use your /ssh/ password, not a WebDAV
4580   password.
4582   Also note that if you have configured ssh to use =ControlPersist=, due
4583   to [[https://lists.gnu.org/archive/html/tramp-devel/2012-03/msg00010.html][a bug with tramp and =ControlPersist=]] you may need to use =scpx=
4584   instead of =scp= as the /tramp/ transfer method.{{{EndWarningBox}}}
4586 **** Does Emacs have to use /TRAMP/ to access the remote directory?
4588 No, you can alternatively use a local directory for staging.  Other
4589 means must then be used to keep this directory in sync with the WebDAV
4590 directory.  In the following example, files are staged in =~/stage/=,
4591 and Org-mode hooks take care of moving files to and from the WebDAV
4592 directory using /scp/.
4594 #+begin_src emacs-lisp
4595 (setq org-mobile-directory "~/stage/")
4596 (add-hook 'org-mobile-post-push-hook
4597   (lambda () (shell-command "scp -r ~/stage/* user@wdhost:mobile/")))
4598 (add-hook 'org-mobile-pre-pull-hook
4599   (lambda () (shell-command "scp user@wdhost:mobile/mobileorg.org ~/stage/ ")))
4600 (add-hook 'org-mobile-post-pull-hook
4601   (lambda () (shell-command "scp ~/stage/mobileorg.org user@wdhost:mobile/")))
4602 #+end_src
4604 Alternatively you could write a simple script to synchronize from
4605 =~/stage/= to the remote directory via /rsync/.
4607 *** Synchronizing with Syncthing or Dropbox directly
4609 Among Orgzly users it is popular to synchronize the org files
4610 themselves (rather than just the changesets) with [[https://syncthing.net/][Syncthing]] or
4611 [[http://www.dropbox.com/][Dropbox.com]]. This method provides no way of merging parallel edits, so
4612 you must ensure that a synchronization is performed when switching
4613 device, or you'll be in trouble. [[https://medium.com/@JosephKiran/replacing-cloud-based-to-do-apps-with-orgzly-and-syncthing-6a065419d61][This blog post]] provides some details
4614 for using Orgzly with Syncthing.
4616 *** Synchronizing with Git and a shell script
4618 An option which is attractive if you already prefer to have your org
4619 files version controlled by git is to initiate synchronization from a
4620 shell script on the computer, and handle merge conflicts with git
4621 merges. Edits made in parallel will be visible as parallel branches in
4622 the git log, and most conflicts should be handled by the
4623 auto-merger. [[https://pantarei.xyz/posts/sync-org-mode-with-mobile/][This blog post]] provides such a script with setup
4624 instructions.
4626 * Mathjax
4628 #+index: Mathjax
4630 ** How to install MathJax on my server?
4631 :PROPERTIES:
4632 :CUSTOM_ID: install_mathjax_on_server
4633 :END:
4635 Org uses MathJax as its default HTML display engine for equations.
4637 Org relies on the version of MathJax available from orgmode.org, but you
4638 might want to use another version and install MathJax on your own server.
4640 1. Download a [[http://sourceforge.net/projects/mathjax/files/][MathJax archive]].
4642 2. Upload it somewhere on your server (say http://me.org/mathjax/)
4644 3. Set the correct path in =org-export-html-mathjax-options= (i.e. replace
4645    https://orgmode.org/mathjax/MathJax.js by
4646    http://me.org/mathjax/MathJax.js)
4648 You can also get [[http://www.mathjax.org/resources/docs/?installation.html][MathJax from git or svn]] -- in this case, be careful not to
4649 forget to unzip the fonts.zip archive in the mathjax directory.
4651 * Tips and Tricks
4653 ** Can I create an Org link from a gmail email?
4655 #+index: Link!Gmail
4657 Yes.  See [[https://orgmode.org/list/4E9F8A54.5070007@gmail.com][this email]] from Torsten Wagner.
4659 Also check this comment by Tom:
4661 : Since any mail can be found under the All label by definition the
4662 : simplest solution is extracting the message id from the end of
4663 : the current url and then creating a new url pointing to All.
4664 : This URL should always work unless the mail is deleted:
4666 : https://mail.google.com/mail/?shva=1#all/<msgid>
4668 ** Problems with LaTeX macros with #+latex or #+begin_latex
4669   :PROPERTIES:
4670   :CUSTOM_ID: Problems-with-LaTeX-macros-with-#+latex-or-#+begin_latex
4671   :END:
4673 #+index: LaTeX!Macro
4675 Org's LaTeX exporter has a difficult job on its hands and even though it
4676 does a great job most of the time, there are times when it falls short. One
4677 situation that has arisen a few times in the past is when a macro
4678 definition or use includes an opening brace, but the corresponding closing
4679 brace is on a different line. That has caused LaTeX compilation problems or
4680 mysterious excisions of content - see for example the following two threads
4681 in the mailing list:
4683  - https://orgmode.org/list/87r5abi1tn.fsf@fastmail.fm
4685  - https://orgmode.org/list/BANLkTikRuyA7_sCC3pyVEHsJ0KXtP88_xw@mail.gmail.com
4687 In both cases, the exporter was getting confused by the opening brace which
4688 did not have a corresponding closing brace on the same line. Although the
4689 first of these cases is fixed in current Org, there might be more such
4690 cases or there might be a regression which causes the incorrect behavior
4691 again. While waiting for a fix, it's worth trying out the simple workaround
4692 of including a fake closing brace on the same line as the opening brace but
4693 *commenting it out* so that LaTeX never sees it.  That is often enough to
4694 make the exporter behave properly. In other words, to take one of the
4695 examples above, instead of writing
4697 : #+latex: \custommacro {
4698 : ...
4699 : #+latex: }
4701 use the following idiom instead:
4703 : #+latex: \custommacro { % hide the closing brace in a LaTeX comment }
4704 : ...
4705 : #+latex: }
4707 I emphasize that this is a workaround, not a fix: if you do run into such
4708 a case and the workaround fixes it, at least you can continue working, but
4709 please submit a bug report so that it can be fixed properly.
4711 ** Inserting a Mairix type link when calling Orgmode capture in VM
4713 #+index: lMairix
4715 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
4716 Adesam.
4718 ** Can I prevent ispell from checking source blocks?
4720 Yes, use this:
4722 #+BEGIN_SRC emacs-lisp
4723 (add-to-list 'ispell-skip-region-alist '("#\\+begin_src". "#\\+end_src"))
4724 #+END_SRC
4726 ** Can I archive a subtree while keeping its hiearchy above?
4728 Yes, you can check this [[https://gist.github.com/edgimar/072d99d8650abe81a9fe7c8687c0c993][code]].
4730 * Google Summer of Code (GSoC)
4731   :PROPERTIES:
4732   :CUSTOM_ID: GSoC
4733   :END:
4734 ** Does Org Mode participate in GNU's application for the GSoC 2012?
4735    :PROPERTIES:
4736    :CUSTOM_ID: GSoC-2012
4737    :END:
4739 #+index: GSoC 2012
4741 Org Mode will contribute project ideas to GNU's application as
4742 mentoring organisation in Google's Summer of Code 2012 (see Google's
4743 [[http://www.google-melange.com/document/show/gsoc_program/google/gsoc2012/faqs][faq]]). You can have a look at the [[file:org-contrib/gsoc2012/index.org][GSoC 2012 page]] on Worg for more
4744 information about the project itself, and how to participate as
4745 student or mentor.
4747 * COMMENT Function to create =CUSTOM_ID=
4749 #+begin_src emacs-lisp
4750   (defun org-faq-make-target ()
4751     "Make hard target for current headline."
4752     (interactive)
4753     (if (not (org-on-heading-p))
4754         (error "Not on a headline"))
4755     (let ((h (org-trim (org-get-heading 'no-tags))))
4756       (if (string-match "[ \t]*\\?\\'" h)
4757           (setq h (replace-match "" t t h)))
4758       (while (string-match "[ \t]+" h)
4759         (setq h (replace-match "-" t t h)))
4760       (org-entry-put nil "CUSTOM_ID" h)))
4761 #+end_src