Delete unused file
[worg.git] / org-faq.org
blob119cae6a42ce59b58c49b6bdf88bc8b83b3eaf19
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
8 [[file:index.org][{Back to Worg's index}]]
10 * Latest questions on StackOverflow
12 #+index: StackOverflow
14 #+begin_export html
15 <script language="JavaScript" src="https://feed2js.org//feed2js.php?src=http%3A%2F%2Fstackoverflow.com%2Ffeeds%2Ftag%3Ftagnames%3Dorg-mode%26sort%3Dnewest&chan=title&num=5&utf=y"  charset="UTF-8" type="text/javascript"></script>
17 <noscript>
18 <a href="https://feed2js.org//feed2js.php?src=http%3A%2F%2Fstackoverflow.com%2Ffeeds%2Ftag%3Ftagnames%3Dorg-mode%26sort%3Dnewest&chan=title&num=5&utf=y&html=y">View RSS feed</a>
19 </noscript>
20 #+end_export
22 * What is org-mode?
23   :PROPERTIES:
24   :CUSTOM_ID: What-is-org-mode
25   :END:
26 ** Can Org-mode do "x"? Does org have "x" feature?
27    :PROPERTIES:
28    :CUSTOM_ID: can-org-do-x
29    :END:
31 In its default setup, Org-mode offers a simple outlining and task
32 management environment. But it also has a huge number of features and
33 settings "under the hood." Advanced users have configured Org-mode for
34 almost every conceivable use scenario.
36 Org-mode has a very active community and rich and extensive
37 documentation. Before emailing the mailing list to ask whether
38 Org-mode has a particular feature or setting, please consult the
39 following:
41  - Read/search the manual.
43    - https://orgmode.org/manual/index.html
45      - Make sure to check out the following indexes:
47        - [[https://orgmode.org/manual/Main-Index.html#Main-Index][Main Index]]
48        - [[https://orgmode.org/manual/Key-Index.html#Key-Index][Key Index]]
49        - [[https://orgmode.org/manual/Variable-Index.html#Variable-Index][Variable Index]]
51    - The manual is also easily available from within emacs.
53      To read the manual within emacs, you can evaluate =(info
54      "(org)")= within emacs---i.e., type =C-x C-e= after the closing
55      paragraph of the info expression above.
57      You can also type =M-x info= and navigate to "Org Mode".
59      You can search the entire manual by typing ~C-s term~. Keep
60      pressing ~C-s~ to cycle through the results
62  - Search the [[http://dir.gmane.org/gmane.emacs.orgmode][mailing list archives]].
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 [[http://article.gmane.org/gmane.emacs.orgmode/6224][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 [[http://thread.gmane.org/gmane.emacs.orgmode/11641/focus%3D11641][thread about unicorns]] on the mailing list.  [[http://thread.gmane.org/gmane.emacs.orgmode/11641/focus%3D11641][Christopher
169 Suckling]] posted a link showing how to make a simple foldable unicorn
170 (very appropriate for an outlining program!).
172 [[http://article.gmane.org/gmane.emacs.orgmode/11735][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 - [[http://article.gmane.org/gmane.emacs.orgmode/14293][Chris Randle]] made a [[https://orgmode.org/img/nrocinu.txt][text version]] using the logo and [[http://glassgiant.com][glassgiant.com]]:
183 - [[http://article.gmane.org/gmane.emacs.orgmode/14362][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 - [[http://article.gmane.org/gmane.emacs.orgmode/11735/match%3D][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 [[http://article.gmane.org/gmane.emacs.orgmode/11687/match%3Drosslaird%2Bunicorn][here]] by Ross Laird.
191 ** Is Org's documentation written in Org?
193 No.  Org's documentation is written in TeXinfo, which is the standard
194 format for Emacs documentation.  There is no export mechanism from Org
195 to TeXinfo (yet).
197 ** Is there a bibtex entry for the Org manual?
199 Yes.  Please evaluate this function and run =M-x
200 org-insert-manual-bibtex-citation-at-point RET=.
202 #+begin_src emacs-lisp
203 (defun org-insert-manual-bibtex-citation-at-point ()
204   "Insert a BibTeX citation of the Org manual at point."
205   (interactive)
206   (insert
207   "@book{dominik10:_org_mode_refer_manual,
208   author =       {Carsten Dominik},
209   title =        {The Org-Mode 7 Reference Manual: Organize
210                   Your Life with GNU Emacs},
211   publisher =    {Network Theory},
212   year =         2010,
213   address =      {UK},
214   note =         {with contributions by David O'Toole, Bastien Guerry,
215                   Philip Rooke, Dan Davison, Eric Schulte, and Thomas
216                   Dye}
218   (message "Thanks for quoting the Org manual!")))
219 #+end_src
221 Please check [[file:org-papers.org][the Org papers page]] for more references related to Org.
223 * Mailing list
224 ** I think my Org-mode is broken! How do I report a bug?
225    :PROPERTIES:
226    :CUSTOM_ID: bug-reporting
227    :END:
229 #+index: Bug!Report
231  1. Make sure you are running [[#updating-org][the latest version of Org-mode]].
233  2. Read [[https://orgmode.org/manual/Feedback.html][this section]] of the manual.
235  3. Provide a minimal example that duplicates the bug.
237     - Create a minimal .emacs file and start emacs with that file as
238       detailed in [[#minimal-emacs][these instructions]].
240     - Create a sample, minimal .org file that reliably reproduces the
241       problem and post it to the mailing list.
243       - Some users call this an "[[#ecm][ECM]]", a French acronym that means a
244         "minimal complete example".
246 ** What is an "ECM"?
247    :PROPERTIES:
248    :CUSTOM_ID: ecm
249    :END:
251 #+index: ECM
253 This is a French acronym used by some mailing list members; it stands
254 for "Exemple Complet Minimal", or "Complete Minimal Example". The term
255 refers to test files that can reliably reproduce a bug with the
256 minimal amount of code. When you report a bug to the mailing list, you
257 should provide a minimal .org file (with no more text than necessary)
258 that demonstrates the bug. See [[http://permalink.gmane.org/gmane.emacs.orgmode/41281][this post]] for more information.
260 ** What should I do before contacting the mailing list?
261    :PROPERTIES:
262    :CUSTOM_ID: when-to-contact-mailing-list
263    :END:
265    The Org-mode mailing list is a high volume list, in which community
266    members discuss use cases, configuration, bugs, and developments.
268    If you are new to Org-mode, please read/search the excellent [[https://orgmode.org/manual/index.html][manual]]
269    (and pay special attention to the indexes) before asking your
270    question.
272    You should also [[http://dir.gmane.org/gmane.emacs.orgmode][search the mailing list]] to see if your issue has
273    already been discussed.
275    See [[#can-org-do-x][this faq]] for more details.
277 ** Why hasn't my email to the mailing list shown up yet?
278    :PROPERTIES:
279    :CUSTOM_ID: ml-post-delay
280    :END:
282 The org-mode mailing list is moderated. Thus, if you are not
283 subscribed to the mailing list, your mail will only appear on the list
284 after it has been approved by a moderator. To ensure that your mail
285 appears quickly, please [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe to the list]].
287 ** I read the mailing list through gmane. Should I subscribe?
288    :PROPERTIES:
289    :CUSTOM_ID: ml-subscription-and-gmane
290    :END:
292 #+index: Gmane
294 The org-mode mailing list is available via nntp at [[http://dir.gmane.org/gmane.emacs.orgmode][Gmane]]. Many
295 participants in the list prefer read the list in a newsreader, such as
296 Gnus, instead of receiving emails. If you choose to read the list via
297 nntp, you can still [[http://lists.gnu.org/mailman/listinfo/emacs-orgmode][subscribe]] to the list and then opt not to receive
298 any emails on the mailman settings page (see the "Mail Delivery"
299 setting).
301 This will ensure that your messages to the list get through quickly,
302 reduce the work load of the mailing list moderators (who need to clear
303 every mail from non-members), and provide more accurate information
304 about the number of list readers.
306 * Keeping current
307   :PROPERTIES:
308   :CUSTOM_ID: Keeping-current
309   :END:
310 ** Upgrading to Org 8.0/master and using the new export engine
311    :PROPERTIES:
312    :CUSTOM_ID: new-exporter-switch
313    :END:
315 #+index: Upgrade!new exporter
316 #+index: Export!new exporter
318 See [[file:org-8.0.org][Upgrading to Org 8.0 (or the current master branch)]].
320 ** My Emacs ships with an older version Org-mode! How do I upgrade?
321    :PROPERTIES:
322    :CUSTOM_ID: updating-org
323    :END:
325 #+index: Upgrade
327 Org-mode develops quickly, which means that versions of Org-mode
328 shipped with Emacs are more or less out-of-date. If you'd like to
329 upgrade to the most recent version of org-mode, you have a number of
330 options.
332  1. Download the [[https://orgmode.org/index.html#sec-3][most recent release]] of org-mode as zip or tarball and
333     follow the [[https://orgmode.org/manual/Installation.html#Installation][installation instructions]] in the manual.
334  2. Clone and install the development git repository as [[#keeping-current-with-Org-mode-development][explained
335     here]]. If you don't want to run the bleeding edge, you can still
336     use git [[#using-stable-releases-only][to track the most recent stable releases]].
337  3. Install and updated org-mode automatically through the Emacs
338     Package Manager as [[#installing-via-elpa][explained in this FAQ]].
340 /Note/: Please also see [[#mixed-install][Is my Orgmode installation mixed?]] for a common
341 issue with mixed installations.
343 ** How do I keep current with bleeding edge development?
344    :PROPERTIES:
345    :CUSTOM_ID: keeping-current-with-Org-mode-development
346    :END:
348 #+index: Bleeding Edge
350    Org-mode is developed in [[https://en.wikipedia.org/wiki/Git_(software)][Git]]. You can keep up-to-date with Org-mode
351    developement by cloning the Org-mode repository and refreshing your
352    copy with latest changes whenever you wish. You only need to use
353    two Git commands (clone and pull.) Here are the steps in brief
354    (assuming a POSIX compatible shell and please customize locations
355    to suit your setup):
357    1. Select a location to house the Org-mode repository (approx. 40
358       MB; includes documentation, compiled elisp files and history
359       going all the way back to v4.12a)
361       : $ mkdir $HOME/elisp && cd $HOME/elisp
363    2. Clone the Org-mode Git repository.
365       Recommended approach:
367       : $ git clone git@code.orgmode.org:bzg/org-mode.git
369    3. Compile and install Org-mode and build documentation.
371       : $ cd $HOME/elisp/org-mode && make
373       Please note that you can choose to /not/ compile at all and run
374       using source =.el= files only (compiled files speed things up),
375       but you will still need to generate the autoload files.
377       : $ cd $HOME/elisp/org-mode && make uncompiled
379       If you'd like to install org-mode someplace outside the source
380       tree (private or system-wide), you should edit =local.mk= to
381       point to the appropriate install location.  You may need
382       administrator rights to do a system-wide installation.
384       : $ cd $HOME/elisp/org-mode && make install
386    4. This is where you configure Org-mode with Emacs.  Please refer
387       to [[./org-tutorials/index.org][Org tutorials]].
389    5. Keeping up-to-date.
391       Cloning the repository is a one time activity.  From this point
392       onwards you only need to /pull/ the latest changes, which the
393       Makefile is set up to do automatically for certain make targets.
395       : $ cd $HOME/elisp/org-mode && make update
397       or if you immediately want to install as well
399       : $ cd $HOME/elisp/org-mode && make update2
401       Actually in this case it is recommended to run the test suite
402       before installation so that you don't install a version that
403       fails testing.
405       : $ cd $HOME/elisp/org-mode && make up2
407    6. You should reload Org-mode to have the changes take effect (if
408       you are not restarting Emacs, which is recommended).  Also since
409       the intention is to "keep up" with Org-mode, you should visit
410       updated sections of documentation for latest updates (use =git
411       log=.)
413    7. As you use your repository over time it will accumulate loose objects.
414       You can reduce the total size of your git repository with
416       : $ git gc
418       which will consolidate loose git objects into pack files.  This
419       reduces the size of the repository and speeds up data access to
420       the objects.
422 ** How do I update the info manual pages to the latest org-mode version?
423    :PROPERTIES:
424    :CUSTOM_ID: update-info-manual-to-latest
425    :END:
427    *This is not a problem if org-mode is installed system-wide, which
428    automatically takes care of this issue!* Since org-mode already
429    ships with Emacs, a rather common problem among users is "How do I
430    update the info documentation to the latest version of org-mode?".
431    There are three ways to achieve this if for whatever reason you
432    can't install into the standard, system-wide info directory:
434    1. You can set the =INFOPATH= environment variable in your login
435       script like this:
437       #+begin_src shell-script :eval no
438         # ~/.bash_profile
439         export INFOPATH=/path/to/org-mode/info:$INFOPATH
440         ...
441       #+end_src
443       =/path/to/org-mode/info= is wherever you install org-mode.
445    2. You can achieve the same with elisp like this:
447       #+begin_src emacs-lisp :eval no
448         ;; Info directory
449         (add-to-list 'Info-additional-directory-list
450                      (expand-file-name "/path/to/org-mode/info"))
451       #+end_src
453    3. You should specify the same location in the Makefile while
454       installing org-mode like this:
456       #+begin_src makefile-gmake :eval no
457         # Where local software is found
458         prefix=/path/to/emacs-root
459         ...
460         # Where info files go.
461         infodir = $(prefix)/share/info
462       #+end_src
464 ** How can I keep local changes and still track Org-mode development?
465    :PROPERTIES:
466    :CUSTOM_ID: keeping-local-changes-current-with-Org-mode-development
467    :END:
469   There is no need to do this anymore for the purpose of adapting the
470   build system to the local environment, since this can now be
471   specified in =local.mk=.  However, there may be a need to make other
472   local changes to Org.
474   Say you want to make minor changes to the =org.el= or any other
475   version controlled file from Org and you want to keep these changes
476   on top of the =master= branch from Org.  Create a local branch for
477   your changes on top of origin/master as follows:
479   : $ git checkout -b local origin/master
480   : $ git config branch.local.rebase true
481   : # Make your changes to the sources and create a new commit
482   : $ git commit -am 'My local changes to Org'
483   : # Update to a newer version
484   : $ git pull
486   Now each time you pull new commits from the distribution repository
487   your local commits will be rewound and replayed on top of the new
488   origin/master.  You would normally work on your =local= branch which
489   includes your custom commits; there's no need to switch back to the
490   =master= branch.
492   If you get a conflict during a =git pull= (a change in Org and one
493   of your local changes try to alter the same line of code) you will
494   need to edit the file with the conflict to fix up the conflicting
495   lines and then tell git that you have resolved the conflict:
497   1. =git pull= fails with a conflict
498   2. edit the file: look for the conflict markers =>>>>>>>= and
499      =<<<<<<<= and either keep one version or create a new one and
500      remove all conflict markers while doing this.
501   3. =git add= the file to the index to mark the conflict resolved
502   4. =git rebase --continue=
503   5. lather, rinse, and repeat 2-4 as needed
505   Note that it is possible to have silent conflicts when a change in
506   Org and one of your local changes do not edit the same line of code,
507   but are logically incompatible — for example Org might have changed
508   to assume /roses are red/ while you've made a local change that
509   defines /my roses are yellow/ in some other place.  Git will not
510   warn you about such conflicts (it doesn't understand what the code
511   _does_, of course).
513   At anytime during the rebase conflict resolution you can say "oops
514   this is all wrong - put it back the way it was before I did a pull"
515   using
516 : $ git rebase --abort
518 ** How can I use a stable release version instead of the bleeding edge master?
519    :PROPERTIES:
520    :CUSTOM_ID: using-stable-releases-only
521    :END:
523 The =master= branch of the git repository always contains the bleeding
524 edge development code.  This is important for Org's fast development,
525 because code on master gets checked out by many people daily and we
526 quickly receive bug reports if something is wrong.  On rare occasions,
527 this code may not function perfectly for a limited time while we are
528 trying to fix things.  It is therefore recommended to keep a
529 known-good version of org-mode installed outside the source tree and
530 always run the full test suite before using a new version from master.
532 Not everyone like to use this bleeding-edge code and face the danger
533 to hit a surprising bug.  The branch =maint= is specifically for
534 collecting only fixes for known bugs between releases.  If you don't
535 want to wait for a new release, but don't want to live on the bleeding
536 edge, consider using =maint=.
538 From time to time, we make a release by merging all the new features
539 from =master= into =maint=.  This typically happens when the
540 maintainers feel that
542 1. they have reached a good point in the development
543 2. the code has a feature set that should stay and be supported in the
544    future
546 Stable releases are used as the basis for [[https://orgmode.org/index.html#sec-3_3][alternative distributions]] of
547 Org, and they are also the code that gets merged into the Emacs
548 distribution. If you want to work only with stable releases, you can
549 always download [[https://orgmode.org/index.html#sec-3][them here]], but you can also also use the git
550 repository to keep automatically up-to-date with the most recent
551 stable releases (and save bandwidth!). Here's how to do so:
553 *** Run a specific stable release
555 In the repository, do
557 : $ git fetch --tags
558 : $ git tag
560 To see which release tags are available.  Let's say you decide to use
561 =release_7.01f=.
563 : $ git checkout release_7.01f
565 This set the working tree of the repository to the state of Org at the
566 moment of release 7.01f.  You can then run Org from the repository be
567 sure to use the stable release while development continues on the
568 master branch.
570 Later, when we release 7.02, you can switch to that using
572 : $ git fetch --tags                   # to get all the new stuff
573 : $ git tag
574 : $ git checkout release_7.02
576 *** Always run the most recent stable release
578 Alternatively, if you just want to always run whatever the latest
579 stable release is, you can do
581 : $ git checkout -b stable origin/maint
583 and then regularly update this branch by doing
585 : $ git pull
587 ** How can I install an up-to-date version of org-mode without "make" tools?
588    :PROPERTIES:
589    :CUSTOM_ID: installing-org-without-make-tools
590    :END:
592 If you are using org-mode on a computer that lacks developer tools for
593 compiling software, such as [[http://www.gnu.org/software/make/][GNU Make]], you will have to use a
594 *different* installation method than [[https://orgmode.org/manual/Installation.html#Installation][the one outlined in the manual]].
595 Please see this description for [[https://orgmode.org/worg/org-hacks.html#compiling-org-without-make][compiling org-mode without make]] so you
596 can install a recent version of org-mode without using the full build
597 system.
599 ** I don't use git. Can I download bleeding edge .zip and .tar.gz archives?
601    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 --
602    these archives are updated every day at midnight.
604    Alternatively, you can download a [[https://code.orgmode.org/bzg/org-mode/releases][tar.gz release archive]].
606 ** How do I install Org-mode through Emacs' Package Manager?
607    :PROPERTIES:
608    :CUSTOM_ID: installing-via-elpa
609    :END:
611    Daily builds of Org-mode are distributed as an ELPA package from both
612    [[http://elpa.gnu.org/packages/][GNU Emacs Lisp Package Archive]] as well as from the [[https://orgmode.org/elpa/][Org-mode Emacs Lisp
613    Archive]].
615    Steps for installing Org with package manager:
616    1) Do =M-x list-packages= to browse available packages.
617    2) If the above command is unavailable you need to [[#installing-elpa][install the package
618       manager]] before proceeding ahead.
619    3) If you see =org= as an available package, skip to step 5.
620    4) If you are here it means that org is unavailable in the GNU's
621       archives.  Report this discrepancy to [[mailto:emacs-orgmode@gnu.org][Orgmode mailing list.]]
623       In the meanwhile, you can manually download the tarball and
624       install it. Refer [[*How do I install Org-mode from a ELPA-compatible tarball?][to this FAQ entry]] for further information.
625    5) Press =i= to mark the package for installation
626    6) Press =x= to install
627    7) Reload Emacs
628    8) Use =M-x locate-library RET org=. If your installation is
629       successful you would something like the following:
631       =Library is file ~/.emacs.d/elpa/org-20110403/org.elc=
633 #   7) If you get the following error "*Failed to download `Org-mode'
634 #      archive.*" in step 2, you can manually download the tarball and
635 #      install it.
637 #   8) Add Orgmode as a package archive. This can be done in two ways:
638 #   9) Use =M-x customize-variable RET package-archives=
639 #   10) Add the following line to your =.emacs= and reload Emacs.
640 #       #+begin_src emacs-lisp
641 #         (add-to-list 'package-archives '("Org-mode" . "https://orgmode.org/elpa/"))
642 #       #+end_src
645 ** How do I install Emacs package manager?
646    :PROPERTIES:
647    :CUSTOM_ID: installing-elpa
648    :END:
650    If you are running Emacs 24 or find the command =M-x list-packages=
651    available you already have the package manager installed.
653    Steps for installing package manager on emacs-23:
655    1. Download the package manager [[http://repo.or.cz/w/emacs.git/blob_plain/1a0a666f941c99882093d7bd08ced15033bc3f0c:/lisp/emacs-lisp/package.el][package.el]]
657    2. Add the following to your =.emacs= and reload Emacs.
658       #+begin_src emacs-lisp
659         ;; change "~/elisp/" as appropiate
660         (setq load-path (cons "~/elisp" load-path))
662         ;; Add the below lines *at the beginning* of your .emacs.
663         (require 'package)
664         (package-initialize)
665       #+end_src
667 ** I don't see Org-mode as an installation option in Package Manager Menu?
668    :PROPERTIES:
669    :CUSTOM_ID: why-no-org-in-elpa
670    :END:
672    Emacs Package Manager is a very recent addition to Emacs. Work is
673    under way to have have Org-mode seamlessly integrate with Emacs'
674    Package Manager. As a result, it will be some time before the
675    Org-mode packages are available and usable from either GNU or
676    Org-mode package archives.
678    In the meanwhile, you can install Org-mode via package manager
679    through ELPA-compatible tar. Refer [[#installing-from-elpa-tarball][to this FAQ entry]] for more
680    information.
682 ** How do I install Org-mode from a ELPA-compatible tarball?
683    :PROPERTIES:
684    :CUSTOM_ID: installing-from-elpa-tarball
685    :END:
687 #+index: ELPA
689    Org-mode is distributed as an ELPA-compatible tar which can be used
690    in conjunction with Emacs' package manager.
692    1. If you are already running Org-mode, note the current version
693       reported by M-x org-version.
694    2. Download the latest tarball from [[https://orgmode.org/elpa/][Org-mode repo]].
695    3. Do =M-x package-install-file=. When prompted for =Package file
696       name=, point it to .tar file downloaded in step 2.
698       You will now see Package Manager compiling the files and
699       installing it.
700    4. Reload emacs. This step is very important.
701    5. Note the version of the new installation using M-x
702       org-version. If the new and old versions are different, the
703       installation is done and you are all set to enjoy the updated
704       Org-mode. Otherwise skip to step 6.
705    6. Review you load-path using =C-h v load-path=. Most likely that
706       your old installation path takes precedence over the path chosen
707       by package manager (which is typically
708       =~/.emacs.d/elpa/...=). Fix this anamoly by moving
709       =(package-initialize)= line in .emacs to a more appropriate
710       location.
712 ** Why would I use ELPA tarballs instead of the snapshot tarballs?
713    :PROPERTIES:
714    :CUSTOM_ID: why-elpa
715    :END:
717 #+index: ELPA
719    ELPA-tarballs automate much the process of upgrading org-mode. Much
720    of the following grunt work is done automatically by the Package
721    Manager:
723    1. Downloading, compiling, and activating of org-mode (including
724       setting org-mode's =load-path= and autoloads).
725    2. Updating info files.
727 * Setup
728   :PROPERTIES:
729   :CUSTOM_ID: Setup
730   :END:
732 #+index: Setup
734 ** How can I quickly browse all Org options?
736 #+index: Options
738 =M-x org-customize RET=
740 See also [[file:org-tutorials/org-customize.org][Carsten's Org customize tutorial]] and [[file:org-configs/org-customization-guide.org][this customization guide]]
741 for details.
743 ** Can I use the editing features of org-mode in other modes?
744    :PROPERTIES:
745    :CUSTOM_ID: use-editing-features-in-other-modes
746    :END:
748    Not really---but there are a few editing features you can use in
749    other modes.
751    - For tables there is =orgtbl-mode= which implements the table
752      editor as a minor mode. (To enable, type =M-x orgtbl-mode=)
753    - For ordered lists there is =orgstruct-mode= which allows for easy
754      list editing as a minor mode. (To enable, type =M-x
755      orgstruct-mode=)
757    You can activate these modes automatically by using hooks:
759    : (add-hook 'mail-mode-hook 'turn-on-orgtbl)
760    : (add-hook 'mail-mode-hook 'turn-on-orgstruct)
762    For footnotes, there is the function =org-footnote-action=, which
763    works in non-org buffers. This function is a powerful tool for
764    creating and sorting footnotes. To use it globally, you can add the
765    following keybinding to your =.emacs= file (requires Org 6.17 or
766    greater):
768    : (global-set-key (kbd "C-c f") 'org-footnote-action)
770    For other features you need to switch to Org-mode temporarily, or
771    prepare text in a different buffer.
773 ** Why isn't feature "X" working the way it is described in the manual?
774    :PROPERTIES:
775    :CUSTOM_ID: making-sure-org-mode-is-up-to-date
776    :END:
778 Org-mode develops very quickly. If you are using a version of Org-mode
779 that shipped with emacs, there is a good chance that it is somewhat
780 out of date.
782 Many of the users on the Org-mode mailing list are using either a
783 recent release of Org-mode or the
784 [[https://orgmode.org/index.html#sec-3.2][development version of
785 org-mode from the git repository]].
787 If some settings and features aren't working the way you expect, make
788 sure that the version of the manual you are consulting matches the
789 version of Org-mode you are using.
791    - You can check which version of Org-mode you are using by
792      selection =Org --> Documentation --> Show Version= in the Emacs
793      menu.
795    - The [[https://orgmode.org/manual/index.html][online manual]] at [[https://orgmode.org][orgmode.org]] corresponds to the most recent
796      release.
798    - 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
799      released with the latest official Gnu Emacs release. Compared
800      with the manual at the orgmode.org, the manual at www.gnu.org is
801      somewhat out of date.
803 For instructions on how to stay current with Org-mode, consult [[#keeping-current-with-Org-mode-development][this
804 FAQ]] or follow the instructions on [[https://orgmode.org][the official Org-mode site]].
806 ** Can I get the visibility-cycling features in emacs-lisp-mode?
808 Yes.  This snippet in your =.emacs= will bind =C-M-]= and =M-]= to global
809 and local cycling:
811 #+BEGIN_SRC emacs-lisp
812 (global-set-key (kbd "C-M-]") (lambda () (interactive) (org-cycle t)))
813 (global-set-key (kbd "M-]") (lambda ()
814                               (interactive)
815                               (ignore-errors
816                                 (end-of-defun)
817                                 (beginning-of-defun))
818                               (org-cycle)))
819 #+END_SRC
821 ** Can I get the visibility-cycling features in outline-mode and outline-minor-mode?
822    :PROPERTIES:
823    :CUSTOM_ID: use-visibility-cycling-in-outline-mode
824    :END:
826 #+index: Visibility!Cycling
828    Yes, these functions are written in a way that they are independent of
829    the outline setup.  The following setup provides standard Org-mode
830    functionality in outline-mode on =TAB= and =S-TAB=.  For
831    outline-minor-mode, we use =C-TAB= instead of =TAB=,
832    because =TAB= usually has mode-specific tasks.
834 #+BEGIN_SRC emacs-lisp
835 (add-hook 'outline-minor-mode-hook
836   (lambda ()
837     (define-key outline-minor-mode-map [(control tab)] 'org-cycle)
838     (define-key outline-minor-mode-map [(shift tab)] 'org-global-cycle)))
839 (add-hook 'outline-mode-hook
840   (lambda ()
841     (define-key outline-mode-map [(tab)] 'org-cycle)
842     (define-key outline-mode-map [(shift tab)] 'org-global-cycle)))
843 #+END_SRC
845 Or check out /outline-magic.el/, which does this and also provides
846 promotion and demotion functionality.  /outline-magic.el/ is
847 available at [[http://www.astro.uva.nl/~dominik/Tools/outline-magic.el][Outline Magic]].
849 ** Can I save/restore the visibility state of an org-mode buffer?
850    :PROPERTIES:
851    :CUSTOM_ID: saving-visibility-state
852    :END:
854 #+index: Visibility!Restore
856 Well, no---at least not automatically. You can, however, control the
857 visibility of an org-file or of individual trees by adding
858 instructions to your org file. See [[https://orgmode.org/manual/Visibility-cycling.html#Visibility-cycling][this section of the manual]] for more
859 information.
861 ** How can I keep track of changes in my Org files?
862    :PROPERTIES:
863    :CUSTOM_ID: track-of-changes-in-Org-files
864    :END:
866   Use git to track the history of the files, use a cronjob to check in
867   changes regularly.  Such a setup is described by Bernt Hansen in [[http://article.gmane.org/gmane.emacs.orgmode/6233][this
868   message]] on [[http://dir.gmane.org/gmane.emacs.orgmode][emacs-orgmode]].
870 ** Can I use Org-mode as the default mode for all README files?
871    :PROPERTIES:
872    :CUSTOM_ID: Org-mode-as-default-mode
873    :END:
875 #+index: default-major-mode
877 Add the following to your .emacs file:
879 : (add-to-list 'auto-mode-alist '("README$" . org-mode))
881 You can even make it the default mode for any files with unspecified
882 mode using
884 : (setq default-major-mode 'org-mode)
886 ** Can I use ido.el for completing stuff in Org?
887    :PROPERTIES:
888    :CUSTOM_ID: ido-complete
889    :END:
891 #+index: Ido
893    Yes, you can.  If you are an ido user and ido-mode is active, the
894    following setting will make Org use =ido-completing-read= for most
895    of its completing prompts.
897 : (setq org-completion-use-ido t)
899 ** Should I use one big org file or multiple files?
900    :PROPERTIES:
901    :CUSTOM_ID: how-to-organize-org-mode-files
902    :END:
904 Org-mode is flexible enough to accomodate a variety of organizational and
905 time management schemes.  Org's [[https://orgmode.org/manual/Document-structure.html#Document-structure][outline cycling and convenient editing and
906 navigation commands]] make it possible to maintain all of your projects and
907 notes in a single file.  But org-mode's [[https://orgmode.org/manual/Hyperlinks.html#Hyperlinks][quick and easy hyperlinks]], along
908 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
909 private "wiki" consisting of multiple files.
911 No matter how you organize your org files, org-mode's agenda commands
912 make it easy to search all your notes and gather together crucial data
913 in a single view.
915 Moreover, several org-mode settings can be configured either globally in
916 your =.emacs= file or locally (per file or per outline tree).  See the
917 [[https://orgmode.org/manual/index.html#Top][manual]] for more details.  For an example of local customizations see [[#limit-agenda-with-category-match][this
918 FAQ]].
920 Here are a few ideas for organizing org-mode files:
922 - A single file for all your projects and notes.
923 - One file per project.
924 - One file per client.
925 - One file per area of responsibility or type of work (e.g.,
926   household, health, work, etc.).
927 - One file for projects, one for appointments, one for reference
928   material, one for someday/maybe items, etc.
929 - A wiki of hyperlinked files that grows and adapts to meet your
930   needs.
932 For more ideas, see some of the links on the [[file:org-tutorials/index.org][org-tutorial index]] or
933 [[file:org-gtd-etc.org][this page on org-mode and GTD]].
935 ** Why doesn't C-c a call the agenda? Why don't some org keybindings work?
936    :PROPERTIES:
937    :CUSTOM_ID: setting-global-keybindings
938    :END:
940 Org-mode has a few global keybindings that the user must set explicitly in
941 an =.emacs= file.  These keybindings include the customary shortcut for
942 calling the agenda (=C-c a=).  If nothing happens when you type =C-c a=,
943 then make sure that the following lines are in your =.emacs= file:
945 #+BEGIN_SRC emacs-lisp
946   ;; The following lines are always needed.  Choose your own keys.
947   (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
948   (global-set-key "\C-cl" 'org-store-link)
949   (global-set-key "\C-ca" 'org-agenda)
950   (global-set-key "\C-cb" 'org-iswitchb)
951 #+END_SRC
953 You may, of course, choose whatever keybindings work best for you
954 and do not conflict with other modes.
956 Please see [[https://orgmode.org/manual/Activation.html][this section of the manual]] if you have additional
957 questions.
959 ** Why aren't some of the variables I've customized having an effect?
960    :PROPERTIES:
961    :CUSTOM_ID: load-org-after-setting-variables
962    :END:
964 Some org variables have to be set before org.el is loaded or else they
965 will not work. (An example is the new variable
966 =org-enforce-todo-dependencies=.)
968 To make sure all your variables work you should not use =(require
969 'org)=. Instead use the following setting:
971 : (require 'org-install)
973 You should also make sure that you do not require any other =org-...=
974 files in your =.emacs= file before you have set your org variables,
975 since these will also cause org.el to be loaded. To be safe, load org
976 files *after* you have set your variables.
978 ** How can I make sure that timestamps appear in English?
979    :PROPERTIES:
980    :CUSTOM_ID: timestamps-and-system-time-locale
981    :END:
983 If your system's locale is not set to English, but you would like the
984 timestamps in your org-mode files to appear in English, you can set
985 the following variable:
987 #+begin_src emacs-lisp
988   (setq system-time-locale "C")
989 #+end_src
991 ** What does a minimal .emacs look like?
992    :PROPERTIES:
993    :CUSTOM_ID: minimal-emacs
994    :END:
996 Using a stripped down minimal .emacs files removes broken custom
997 settings as the cause of an issue and makes it easy to reproduce for
998 other people.  The example below has system-specific paths that you'll
999 need to change for your own use.
1001 #+begin_src emacs-lisp
1002   (add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
1003   (add-to-list 'auto-mode-alist '("\\.\\(org\\  |org_archive\\|txt\\)$" . org-mode))
1004   (setq org-agenda-files '("/tmp/test.org"))
1005   (require 'org-install)
1006   (require 'org-habit)
1008   (global-set-key "\C-cl" 'org-store-link)
1009   (global-set-key "\C-ca" 'org-agenda)
1010   (global-set-key "\C-cb" 'org-iswitchb)
1011 #+end_src
1013 You can save the minimal .emacs file to ~/minimal.emacs, add suspect
1014 configuration code to it, then start emacs something like this:
1016 #+begin_src sh
1017   emacs -Q -l ~/minimal.emacs
1018 #+end_src
1020 On OS X, starting emacs with minimal configuration might look
1021 something like this:
1023 #+begin_src sh
1024   /Applications/emacs.app/Contents/MacOS/Emacs -Q -l ~/minimal.emacs
1025 #+end_src sh
1027 ** Can I migrate from Planner?
1029    Yes.  This [[http://www.c0t0d0s0.de/plan2org/plan2org.pl][perl script]] or [[http://gitorious.org/bkuhn-small-hacks/org-mode/blobs/master/planner2org.plx
1030 ][this Perl script]] can help.
1032 * Errors and general problems
1033   :PROPERTIES:
1034   :CUSTOM_ID: Errors
1035   :END:
1036 ** Is my Orgmode installation mixed?
1037    :PROPERTIES:
1038    :CUSTOM_ID: mixed-install
1039    :END:
1040    Emacs is distributed with a version of Orgmode bundled with it.  A
1041    common problem among users who install a [[#updating-org][newer version]] of Orgmode
1042    separately is a mixed install where Emacs loads some files from the
1043    bundled and the rest from the latest version.  This can lead to
1044    /unending/ troubles in the future.  With a recent installation of
1045    Org mode =M-x org-version= will indicate if the installation is mixed.
1047    With somewhat older Org mode installations, the procedure is more
1048    involved and indeterminate. An easy first step is to look
1049    at the output of =M-x org-version=.
1050    - Good :: ~Org-mode version 7.8.11 (release_7.8.11-448-g1737d3 @
1051              /path/to/org-mode/lisp/)~
1052    - Bad :: ~Org-mode version 6.33x (release_7.8.11.409.ga3778)~
1054    A second step is to go through the output of =list-load-path-shadows=
1055    line-by-line to get hints to what in your configuration is causing
1056    the issue.  Among the most common reasons is Orgmode gets loaded
1057    before the =load-path= variable is updated to include the
1058    installation directory of the latest Orgmode.  To avoid issues like
1059    this, it is recommended that the load path is updated very early on
1060    in your init file.
1062    /Note:/ The formatting of the version information, as shown in the
1063    examples above, will be different for older Org mode releases,
1064    e.g. ~Org-mode version 7.8.02~.
1066 ** Opening Org files in Emacs leads to a crash
1067    :PROPERTIES:
1068    :CUSTOM_ID: Emacs-crashes-with-org-indent-mode
1069    :END:
1070    The only known case where Org-mode can crash Emacs is when you are
1071    using =org-indent-mode= with Emacs 23.1 (in fact, any version of
1072    Emacs before version 23.1.50.3).  Upgrade to Emacs 23.2 and the
1073    problem should go away.
1075 ** When I try to use Org-mode, I always get the error message =(wrong-type-argument keymapp nil)=
1076    :PROPERTIES:
1077    :CUSTOM_ID: wrong-type-argument-keymapp
1078    :END:
1080    This is a conflict with an outdated version of the /allout.el/, see
1081    the [[https://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section in the manual
1083 ** How can I control the application launched by Org-mode to open a certain file type like pdf, html...?
1084    :PROPERTIES:
1085    :CUSTOM_ID: external-application-launched-to-open-file-link
1086    :END:
1088 If you want special control about how Org-mode opens files, see the
1089 variables =org-file-apps=, =org-file-apps-defaults-gnu=,
1090 =org-file-apps-defaults-macosx=, =org-file-apps-defaults-windowsnt=.
1092 *However*, normally it is best to just use the mechanism the
1093 operating-system provides:
1095 *** GNU/Linux systems
1096     You you have to check your mailcap settings, find the files:
1098     : /etc/mailcap
1099     :
1100     : or
1101     :
1102     : $HOME/.mailcap
1104 and modify them accordingly. Please read their manual entry.
1106 *** Windows systems
1107     + for html pages you may configure the =browse-url-= variables through
1108       the Customize interface,
1109     + the pdf files are automatically opened with Acrobat Reader (if it is
1110       installed)
1112 *** Mac OSX
1113     Change the application responsible for this file type by selecting
1114     such a file in the Finder, select =File->Get Info= from the menu
1115     and select the application to open this file with.  Then, to
1116     propagate the change to all files with the same extension, select
1117     the =Change all= button.
1119 ** Org-mode takes over the TAB key.  I also want to use YASnippet, is there a way to fix this conflict?
1120    :PROPERTIES:
1121    :CUSTOM_ID: YASnippet
1122    :END:
1124 [[http://code.google.com/p/yasnippet/][yasnippet]] is yet another snippet expansion system for Emacs.  It is
1125 inspired by TextMate's templating syntax.
1126 - watch the [[http://www.youtube.com/watch?v=vOj7btx3ATg][video on YouTube]]
1127 - see the [[http://yasnippet.googlecode.com/svn/trunk/doc/index.html][intro and tutorial]]
1129 *Note*: yasnippet is not compatible with =org-indent-mode= currently
1130 there is no known way to use both successfully with =yas/trigger-key=
1131 set to =TAB= (or =[tab]= etc...)
1133 The way Org-mode binds the =TAB= key (binding to =[tab]= instead of
1134 =\t=) overrules yasnippets' access to this key.  The following code
1135 fixes this problem:
1137 #+begin_src emacs-lisp
1138 (add-hook 'org-mode-hook
1139           (lambda ()
1140             (org-set-local 'yas/trigger-key [tab])
1141             (define-key yas/keymap [tab] 'yas/next-field-group)))
1142 #+end_src
1144 If the above code doesn't work (which it may not with later versions
1145 of yasnippet).  Then try the following
1147 #+begin_src emacs-lisp
1148   (defun yas/org-very-safe-expand ()
1149     (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
1151   (add-hook 'org-mode-hook
1152             (lambda ()
1153               ;; yasnippet (using the new org-cycle hooks)
1154               (make-variable-buffer-local 'yas/trigger-key)
1155               (setq yas/trigger-key [tab])
1156               (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
1157               (define-key yas/keymap [tab] 'yas/next-field)))
1158 #+end_src
1160 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]])
1161 with YASnippets for Org-mode.
1163 ** Org-mode takes over the S-cursor keys.  I also want to use CUA-mode, is there a way to fix this conflict?
1164    :PROPERTIES:
1165    :CUSTOM_ID: CUA-mode
1166    :END:
1168 Yes, see the  [[https://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
1170 ** Org-mode takes over the S-cursor keys.  I also want to use windmove.el, is there a way to fix this conflict?
1171    :PROPERTIES:
1172    :CUSTOM_ID: windmove.el
1173    :END:
1175 Yes, see the [[https://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
1177 ** Org behaves strangely: some keys don't work, some features are missing, my settings have no effect, ...
1178    :PROPERTIES:
1179    :CUSTOM_ID: loaded-old-org
1180    :END:
1182 When this sort of things happen, it probably is because Emacs is
1183 loading an old version of Org-mode instead of the one you expected.
1184 Check it with =M-x org-version=.
1186 This happens because Emacs loads first the system org-mode (the one
1187 included with Emacs) before the one in your directory. Check the
1188 =load-path= variable; you might see that your org-mode appears /after/
1189 the system-wide path; this is bad.
1191 You should add your directories to the =load-path= at the beginning:
1193 :  (add-to-list 'load-path "~/.emacs.d/org-mode/lisp") (require 'org-install)
1195 Function =add-to-list= adds at the beginning. Don't use =append=
1196 because it appends at the end. Also be sure to use =(require
1197 'org-install)= and not =(require 'org)=.
1199 This wrong version loading may also happen if you have a byte-compiled
1200 =org.elc= from an old version together with a new =org.el=. Since
1201 Emacs prefers loading byte-compiled files (even if the =.el= is
1202 newer), it will load the old Org-mode.
1204 ** Why doesn't org-batch-agenda work under Win32?
1205    :PROPERTIES:
1206    :CUSTOM_ID: org-batch-agenda-under-win32
1207    :END:
1209 When I run the example batch files to print my agenda to the console
1210 under Win32 I get the failure:
1212 : End of file during parsing
1214 and no agenda is printed.
1216 The problem is the use of single quotes surrounding the eval in the
1217 emacs command-line. This gets confused under Win32. All string
1218 parameters with spaces must be surrounded in double quotes. This means
1219 that double quotes being passed to the eval must be escaped.
1221 Therefore, instead of the following:
1223 : <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
1224 :     -eval '(org-batch-agenda "a")'
1226 you need to use the following:
1228 :  <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
1229 :     -eval "(org-batch-agenda \"a\")"
1231 (all on one line, of course).
1233 ** Org agenda seems very slow
1234    :PROPERTIES:
1235    :CUSTOM_ID: slow-agenda
1236    :END:
1238 If it takes a long time to generate or refresh the agenda, you might
1239 want first check which version of org-mode you are using. There have
1240 been major optimizations of org-agenda since 6.21b, which was the
1241 version of org-mode released with Emacs 23. If you are using 6.21b or
1242 earlier (you can check with =M-x org-version=), then you might want to
1243 consider upgrading to a more recent version of org-mode.
1245 Here are some other ideas for speeding up the agenda:
1247 1. Use a one day agenda view (rather than a seven day view).
1249    =(setq org-agenda-ndays 1)=
1251 2. Archive inactive items to separate files.
1253    =C-c C-x C-s= (org-archive-subtree)
1255 3. Do not include the global todo list in your agenda view.
1257    (setq org-agenda-include-all-todo nil)
1259 4. Make sure that your org files are byte-compiled.
1261    I.e., make sure there are files ending in =.elc= in your org
1262    installation directory.
1264 5. Limit your agenda files (=org-agenda-files=) to files that have
1265    active todos and or projects.
1267    If you have a number of older reference files---i.e., files you
1268    search only occasionally---in your agenda files list, consider
1269    removing them from your agenda files and adding them to
1270    =org-agenda-text-search-extra-files= instead. Similarly, you might
1271    consider searching some of your older reference files with =M-x
1272    grep= so that Org-mode does not have to load them into memory when
1273    the agenda is called.
1275 ** Visual-line-mode doesn't work well with Org-mode
1276    :PROPERTIES:
1277    :CUSTOM_ID: visual-line-mode
1278    :END:
1280 Visual-line-mode "soft wraps" lines so that the visual edge of the
1281 buffer is considered a line break for purposes of navigation, even
1282 though there is no line break in reality.
1284 In older versions of org-mode, org-beginning-of-line and
1285 org-end-of-line do not work well with visual line mode. (The two
1286 commands disregard soft line breaks and move to the beginning and end
1287 of the hard line break.) A patch was introduces to fix this behavior
1288 in July of 2009.
1290 If you are using an older version of Org-mode, you can:
1292 1. Add a hook to turn off visual line mode.
1294 2. Add the following to your =.emacs=:
1296 #+begin_src emacs-lisp
1298 (add-hook 'org-mode-hook
1299   (lambda ()
1300     (define-key org-mode-map "\C-a" 'move-beginning-of-line)
1301     (define-key org-mode-map "\C-e" 'move-end-of-line)))
1303 #+end_src
1304 ** Can I hide blocks at startup?
1306 Yes:
1308 #+begin_src emacs-lisp
1309 (setq org-hide-block-startup t)
1310 #+end_src
1312 Or use
1314 #+begin_src org
1315 ,#+STARTUP: hideblocks
1316 #+end_src
1318 on a per-file basis.
1320 ** After updating Org I get an error about an =invalid function=
1321    :PROPERTIES:
1322    :CUSTOM_ID: invalid-function-error
1323    :END:
1325 In almost all cases an =invalid function= error is caused by an
1326 unclean Org-mode source directory. Cleaning it up and recompiling
1327 should fix the problem
1329 : cd /path/to/orgmode
1330 : make clean
1331 : make
1333 In some cases, bits and pieces of org are loaded from various places (previous
1334 installs, the built-in install of org that came with whatever emacs version you have)
1335 and things get very confused. In all cases, cleaning up every last bit of org installation
1336 from everywhere and reinstalling org from git should restore sanity. See also the [[id:facac2a6-3526-450d-ac42-8d36b16c6bab][next question]].
1338 ** I use starter-kit and I get an error =(void-function org-pop-to-buffer-same-window)=
1339    :PROPERTIES:
1340    :ID:       facac2a6-3526-450d-ac42-8d36b16c6bab
1341    :END:
1342 This is a particular instance of the [[#invalid-function-error][previous question]] but with some twists and turns,
1343 and a solution culled from various postings on the mailing list.
1345 starter-kit loads the site-file version of org (the one that came with
1346 your emacs install).  Then when you load your init file, the local
1347 version is added to the front of load-path, so it looks as if things
1348 are originating there, but the damage is already done: you have a
1349 "frankenstein" org.
1351 One possible solution is to add (package-initialize) to the primary init.el
1352 before starter-kit gets going. This will pick up the local install so
1353 that the built-in version never enters to muddy the picture.
1355 ** (Filling a paragraph|Indenting a list|...) behaves strangely
1356 Many filling/indenting problems have been reported on the mailing
1357 list: many of those were bugs (that have been fixed), but quite a lot
1358 are caused by people using the filladapt package, which is fundamentally
1359 incompatible with Org, which has its own facilities for these tasks. If you see
1360 strange behavior in this area, first check if you are using filladapt: visit an org
1361 file and check the modeline for "Filladapt".
1363 If filladapt is on, you want to turn it off before investigating
1364 further. Anthony Lander suggested on the mailing list the following
1365 method to turn off filladapt mode when you visit org files:
1367 #+BEGIN_SRC emacs-lisp
1368 (add-hook 'org-mode-hook 'turn-off-filladapt-mode)
1369 #+END_SRC
1371 This should be placed in your .emacs (or other initialization file) after org
1372 is loaded.
1374 * Faces and highlighting
1375   :PROPERTIES:
1376   :CUSTOM_ID: Faces
1377   :END:
1378 ** Org-mode has a lot of colors?  How can I change them?
1379    :PROPERTIES:
1380    :CUSTOM_ID: customizing-org-faces
1381    :END:
1383 #+index: Faces
1385 This is a question that applies to Emacs as a whole, but it comes up
1386 quite frequently on the org-mode mailing list, so it is appropriate to
1387 discuss it here.
1389 If you would like to change the style of a face in org-mode (or any
1390 other Emacs mode), simply type =M-x customize-face [RET]= while the
1391 cursor is on the color/style you are interested in modifying. You will
1392 be given the opportunity to customize all the faces located at that
1393 point.
1395 If you would like an overview of all the faces in org-mode, you can
1396 type =C-u M-x list-faces-display [RET] org= and you will be shown all
1397 the faces defined by org-mode along with an illustration of their
1398 current settings.
1400 If you would like to customize org-faces and other aspects of
1401 org-appearance, type =M-x customize-group org-font-lock [RET]=.
1403 Finally, if you would like verbose information about the properties of
1404 the text under the cursor, you can type =C-u C-x ==.
1406 See the Worg page on [[file:org-tutorials/org-appearance.org][customizing Org appearance]] for further information.
1407 ** Why do I get a tiny font in column view when using emacs daemon?
1408    :PROPERTIES:
1409    :CUSTOM_ID: column-view-tiny-font
1410    :END:
1412 #+index: Column view
1414 When using emacs in daemon mode (=emacs --daemon=), client frames
1415 sometimes override the column view face settings, resulting in very
1416 small fonts. Here is a fix:
1418 #+begin_src emacs-lisp
1419   (defun org-column-view-uses-fixed-width-face ()
1420   ;; copy from org-faces.el
1421   (when (fboundp 'set-face-attribute)
1422       ;; Make sure that a fixed-width face is used when we have a column
1423       ;; table.
1424       (set-face-attribute 'org-column nil
1425                           :height (face-attribute 'default :height)
1426                           :family (face-attribute 'default :family))))
1428    (when (and (fboundp 'daemonp) (daemonp))
1429     (add-hook 'org-mode-hook 'org-column-view-uses-fixed-width-face))
1430 #+end_src
1432 This fix was provided in the following mailing list post:
1434 http://article.gmane.org/gmane.emacs.orgmode/27560
1435 ** How can I stop the mouse cursor from highlighting lines in the agenda?
1436    :PROPERTIES:
1437    :CUSTOM_ID: ratpoison-for-agenda-highlighting
1438    :END:
1440 #+index: Highlighting
1442 You can add the following to your =.emacs=:
1444 #+begin_src emacs-lisp
1445 (add-hook 'org-finalize-agenda-hook
1446     (lambda () (remove-text-properties
1447                (point-min) (point-max) '(mouse-face t))))
1448 #+end_src
1450 * Outline
1451   :PROPERTIES:
1452   :CUSTOM_ID: Outline
1453   :END:
1454 ** Can I close an outline section without starting a new section?
1455    :PROPERTIES:
1456    :CUSTOM_ID: closing-outline-sections
1457    :END:
1459 #+index: Outline
1461 Can I have nested, closed outline sections, similar to xml? This
1462 question comes up quite frequently on the mailing list.
1464 See the following threads:
1466   - http://permalink.gmane.org/gmane.emacs.orgmode/40182
1467   - http://permalink.gmane.org/gmane.emacs.orgmode/36719
1468   - http://permalink.gmane.org/gmane.emacs.orgmode/24092
1469   - http://permalink.gmane.org/gmane.emacs.orgmode/12425
1471 The desired behavior looks something like this:
1473 #+begin_src org
1474 ,* Section one
1476 Some text
1478 ,** Subsection one
1480 Some text
1482 ,** Subsection two
1484 Some text
1486 ,# end Subsection Two
1488 Continue text in section one.
1489 #+end_src
1491 The short answer to the question is no. Org-mode adheres to the
1492 cascading logic of outlines, in which a section is closed only by
1493 another section that occupies an equal or greater level.
1495 Here are some workarounds:
1497 1. You can use inline tasks to create non-folding subsections. See the
1498    documentation in org-inlinetask.el, which is part of the org-mode
1499    distribution.
1500 2. You can create a temporary heading, such as "** Continue main
1501    section" and then remove it when you are ready to export.
1502 3. You can create a separate outline heading (e.g., * ACTIONS),
1503    creating TODOs there with links to the relevant sections of your
1504    main text.
1506 ** Can I add a TODO to a list item?
1507    :PROPERTIES:
1508    :CUSTOM_ID: list-item-as-todo
1509    :END:
1511 No.  When generating agenda views, org-mode treats only headlines as TODO
1512 items.
1514 You can, however, use a status cookie together with checkboxes to
1515 monitor your progress on a series of subtasks:
1517 #+begin_src org
1518 ,** TODO Big task [1/3]
1520    - [X] Subtask 1
1521    - [ ] Subtask 2
1522    - [ ] Subtask 3
1523 #+end_src
1525 If you would like to embed a TODO within text without treating it as
1526 an outline heading, you can use inline tasks. Simply add...
1528 : (require 'org-inlinetask)
1530 ...to your =.emacs= and then type =C-c C-x t= to insert an inline task.
1532 ** Can I have two windows on the same Org-mode file, with different outline visibilities?
1533    :PROPERTIES:
1534    :CUSTOM_ID: indirect-buffers
1535    :END:
1537    You may use /indirect buffers/ which do exactly this.  See the
1538    documentation on the command =make-indirect-buffer=.
1540    Org-mode has built-in commands that allow you create an indirect
1541    buffer from a subtree of an outline. To open a subtree in new
1542    window, type =C-c C-x b=. Any changes you make in the new window
1543    will be saved to the original file, but the visibility of both
1544    buffers will remain independent of one another.
1546    For multiple indirect buffers from the same file, you must use the
1547    prefix =C-u= when creating the second (or third) buffer. Otherwise
1548    the new indirect buffer will replace the old.
1550    You can also create an independent view of an outline subtree by
1551    typing =b= on an item in the agenda.
1553 ** Emacs outlines are unreadable.  Can I get rid of all those stars?
1554    :PROPERTIES:
1555    :CUSTOM_ID: Emacs-outlines-are-unreadable
1556    :END:
1558    See the section [[https://orgmode.org/manual/Clean-view.html#Clean-view][Clean outline view]] in the manual.
1560 ** C-k is killing whole subtrees!  I lost my work!
1561    :PROPERTIES:
1562    :CUSTOM_ID: C-k-is-killing-subtrees
1563    :END:
1565    =(setq org-ctrl-k-protect-subtree t)= before losing your work.
1567    =(setq org-catch-invisible-edits 'show)= will also be helpful.  See the
1568    docstring of this option, as it allows more flexible options.
1570 ** Why aren't commands working on regions?
1571    :PROPERTIES:
1572    :CUSTOM_ID: transient-mark-mode
1573    :END:
1575 Some org-mode commands, such as M-right and M-left for demoting or
1576 promoting headlines (see [[#demote-multiple-headlines][this FAQ]]), can be applied to entire
1577 regions.  These commands, however, will only work on active regions set
1578 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
1579 Emacs 23. To enable it in earlier versions of emacs, put the following in
1580 your =.emacs= file:
1582 : (transient-mark-mode 1)
1584 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
1585 mark]] (=C-<SPC> C-<SPC>=).
1587 ** Why is a blank line inserted after headlines and list items?
1588    :PROPERTIES:
1589    :ID:       2463F4D8-F686-4CF3-AA07-08976F8A4972
1590    :CUSTOM_ID: blank-line-after-headlines-and-list-items
1591    :END:
1593 #+index: Blank
1595 In org-mode, typing =M-RET= at the end of a headline will create a new
1596 headline of the same level on a new line. The same is true for plain
1597 lists. By default org-mode uses context to determine if a blank line should
1598 be inserted after each headline or plain list item when =M-RET= is
1599 pressed. For instance, if a there is a blank line before a headline, then
1600 typing =M-RET= at the end of the line will insert a blank line before the
1601 new headline. For instance, hitting =M-RET= at the end of "Headline Two"
1602 below inserts a new headline without a blank line:
1604 : ** Headline One
1605 : ** Headline Two
1606 : **
1608 If there is a blank line between Headline One and Headline Two,
1609 however, the results will be as follows:
1611 : ** Headline One
1613 : ** Headline Two
1615 : **
1617 If you do not like the default behavior you can change it with the
1618 variable =org-blank-before-new-entry=. You can set headings and/or
1619 plain lists to auto (the default setting), t (always), or nil (never).
1621 ** How can I promote or demote multiple headlines at once?
1622    :PROPERTIES:
1623    :CUSTOM_ID: demote-multiple-headlines
1624    :END:
1626 #+index: Promote!Multiple
1627 #+index: Demote!Multiple
1629 If you have a long list of first level headlines that you'd like to
1630 demote to second level headlines, you can select the headlines as a
1631 region and then hit =M-<right>= to demote all the headlines at once.
1633 Note: =M-S-<right>= will not work on a selected region. Its use is to
1634 demote a single subtree (i.e., a headline and all sub-headlines).
1636 If M-<right> doesn't seem to work, make sure transient mark mode is
1637 enabled. See [[#transient-mark-mode][this FAQ]].
1639 ** What's the deal with all the ellipses in my org outlines?
1640    :PROPERTIES:
1641    :CUSTOM_ID: org-ellipses
1642    :END:
1644 #+index: Ellipsis
1646 Org-mode uses ellipses to indicate folded (and thus hidden) text. Most
1647 commonly, ellispes occur at the end of headings with folded content:
1649 : * Heading ...
1651 Or, for instance, they may indicate closed drawers:
1653 : :PROPERTIES: ...
1655 Sometimes, as a result of editing and cycling an outline, ellipses may
1656 appear in unexpected places. You should *never* delete these ellipses,
1657 as you may accidentally delete hidden text. Instead, you can type =C-c
1658 C-r= (org-reveal) to display all hidden text in the vicinity. Or you
1659 may type =M-x RET show-all= to reveal all text in the org file.
1661 If you would prefer a symbol or face for indicating hidden text, you
1662 can customize the variable org-ellipses.
1664 ** How do I yank a subtree so it's indented according to the point's location?
1665    :PROPERTIES:
1666    :CUSTOM_ID: yank-indent-subtree
1667    :END:
1669 #+index: Indentation
1671 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.
1673 Or set =org-yank-adjusted-subtrees= to =t= which will adjust the
1674 yanked headline's level correctly.
1676 Just use =C-k= and =C-y= as you would everywhere else in Emacs.
1678 ** Can I read org-mode outlines in vim?
1679    :PROPERTIES:
1680    :CUSTOM_ID: org-outlines-in-vim
1681    :END:
1683 #+index: Vim
1685 Yes, there is a script that enables one to view and navigate folded
1686 outline/org files in vim (though without most of org-mode's
1687 functionality, of course).
1689   - [[http://www.vim.org/scripts/script.php?script_id%3D1266][Emacs outline mode - Imitates Emacsen : vim online]]
1691 For instructions on how to set it up, please see [[http://mid.gmane.org/EA275862-B97A-4BAC-B879-177FD07A2D56@gaillourdet.net][this mailing list
1692 post]].
1694 Work is also underway on an org-mode clone for Vim. You can check it
1695 out on git hub:
1697 https://github.com/hsitz/VimOrganizer
1699 ** Can I use another character than "*" to start a headline?
1701 No.  The "*" character is used in =outline-mode=, and Org is derived from
1702 =outline-mode=.
1704 If you are curious as to what other rationales there are for "*", check out
1705 [[http://permalink.gmane.org/gmane.emacs.orgmode/44271][this]] mail and the thread it is in.
1707 Even if you cannot use another character, you can add an overlay on top of
1708 the "*" characters and your buffer will look like the way you want.
1710 See the library =org-bullets.el= (by Evgeni Sabof) from the =contrib/=
1711 directory, or test this snippet shared by Jambunathan:
1713 #+BEGIN_SRC emacs-lisp
1714   (font-lock-add-keywords
1715    'org-mode `(("\\(?:^\\(?1:\\*+\\)[[:blank:]]\\)"
1716                 (0 (progn (compose-region
1717                            (match-beginning 1) (match-end 1)
1718                            (pcase (length (match-string 1))
1719                              (1 ?\u2219)
1720                              (2 ?\u2022)
1721                              (3 ?\u25c9)
1722                              (_ ?\u25CB)))
1723                           nil)))))
1724 #+END_SRC
1726 * Todos and Tags
1727   :PROPERTIES:
1728   :CUSTOM_ID: Todos-and-Tags
1729   :END:
1730 ** How can I automatically archive canceled tasks?
1732 #+BEGIN_SRC emacs-lisp
1733 (setq org-todo-state-tags-triggers '(("CANCELLED" ("ARCHIVE" . t))))
1734 #+END_SRC
1736 See http://thread.gmane.org/gmane.emacs.orgmode/64824 -- thanks to Victor
1737 Rosenfeld for sharing [[http://doc.norang.ca/org-mode.html][Bernt Hansen]]'s solution.
1739 ** How can I cycle through the TODO keyword of an entry?
1740    :PROPERTIES:
1741    :CUSTOM_ID: cycle-TODO-keywords
1742    :END:
1744 #+index: Cycling!Todo
1746   =C-c C-t= or =S-<left/right>= is what you need.
1748 ** How do I track state changes for tasks in Org?
1749    :PROPERTIES:
1750    :CUSTOM_ID: track-state-changes-for-tasks
1751    :END:
1753 #+index: Logging
1755   Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/6082][post by Bernt Hansen]] for setting up TODO keyword
1756   states and logging timestamps for task state changes.
1758 ** Can I select the TODO keywords with a tag-like interface?
1759    :PROPERTIES:
1760    :CUSTOM_ID: select-TODO-keywords-with-tag-like-interface
1761    :END:
1763 #+index: Tag!Fast selection
1765   Yes.  Use =(setq org-use-fast-todo-selection t)=
1767   If you want to set both your todos and your tags using a single
1768   interface, then check out the variable
1769   =org-fast-tag-selection-include-todo=.
1771   See [[https://orgmode.org/manual/Fast-access-to-TODO-states.html][this section of the manual]] for more details.
1773 ** How can I quickly set the tag of an entry?
1774    :PROPERTIES:
1775    :CUSTOM_ID: quickly-set-tag-of-entry
1776    :END:
1778 #+index: Tag!Set
1780    Use =C-c C-c= or =C-c C-q= on the headline. =C-c C-q= is useful for
1781    setting tabs in a =Remember= buffer, since =C-c C-c= is the default
1782    keybinding for filing a note from the remember buffer.
1784    You can set tags even more quickly by setting one of the character
1785    shortcuts for [[https://orgmode.org/manual/Setting-tags.html#Setting-tags][fast tag selection]].
1787    To set tag shortcuts for all org buffers, put something like the
1788    following in your =.emacs= file (or create the same settings by
1789    typing =M-x customize-variable RET org-tag-alist=):
1791 : (setq org-tag-alist '(("computer" . ?c) ("office" . ?o) ("home" . ?h)))
1793    To set tag shortcuts for a single buffer, put something like the
1794    following at the top of your org file:
1796 : #+TAGS: computer(c) office(o) home(h)
1798 ** How can I change the colors of TODO keywords?
1800 #+index: Faces!Todo
1802 You can use the variable =org-todo-keyword-faces=.  Here are some sample
1803 settings:
1805 #+begin_src emacs-lisp
1806 (setq org-todo-keyword-faces
1807       '(
1808         ("TODO"  . (:foreground "firebrick2" :weight bold))
1809         ("WAITING"  . (:foreground "olivedrab" :weight bold))
1810         ("LATER"  . (:foreground "sienna" :weight bold))
1811         ("PROJECT"  . (:foreground "steelblue" :weight bold))
1812         ("DONE"  . (:foreground "forestgreen" :weight bold))
1813         ("MAYBE"  . (:foreground "dimgrey" :weight bold))
1814         ("CANCELED"  . shadow)
1815         ))
1816 #+end_src
1818 If you want to change the color of all active todos or all inactive todos,
1819 type:
1821 : M-x customize-face RET org-todo
1822 : M-x customize-face RET org-done
1824 You can also set values for each of these in your =.emacs= file:
1826 : (set-face-foreground 'org-todo "firebrick2")
1827 : (set-face-foreground 'org-done "forestgreen")
1829 ** Can I use a arbitrary character in a TODO keyword?
1831 Yes, provided you add it to the "word" syntax in Emacs.
1833 For example, to add the =\u25b6= and the =\u25b8= chars, just add this to
1834 your Emacs configuration:
1836 #+begin_src emacs-lisp
1837   (add-hook 'org-mode-hook
1838      (lambda ()
1839        (modify-syntax-entry (string-to-char "\u25b6") "w")
1840        (modify-syntax-entry (string-to-char "\u25b8") "w")))
1841 #+end_src
1843 ** How do I arrange for an item to be automatically marked DONE when all checkboxes are checked?
1845 #+index: Checkbox
1847 This has arisen a couple of time
1848 (e.g. http://thread.gmane.org/gmane.emacs.orgmode/42715 and
1849 http://thread.gmane.org/gmane.emacs.orgmode/47363) in the mailing list.
1851 There is an [[https://orgmode.org/worg/org-hacks.html#mark-done-when-all-checkboxes-checked][org-hack]] that describes a possible solution.
1853 * Hyperlinks
1854   :PROPERTIES:
1855   :CUSTOM_ID: Hyperlinks
1856   :END:
1858 ** Why do I have to confirm the execution of each shell/elisp link?
1859    :PROPERTIES:
1860    :CUSTOM_ID: confirm-shell/elisp-link
1861    :END:
1863 #+index: Link!Shell
1864 #+index: Link!Elisp
1866    The confirmation is there to protect you from unwantingly execute
1867    potentially dangerous commands.  For example, imagine a link
1869    : [[shell:rm -rf ~/*][Google Search]]
1871    In an Org-mode buffer, this command would look like /Google Search/,
1872    but really it would remove your home directory.  If you wish, you can
1873    make it easier to respond to the query by setting
1875    : (setq org-confirm-shell-link-function 'y-or-n-p
1876    :       org-confirm-elisp-link-function 'y-or-n-p).
1878    Then a single keypress will be enough to confirm those links.  It is
1879    also possible to turn off this check entirely, but I strongly
1880    recommend against this.  Be warned.
1882 ** Can I use RET or TAB to follow a link?
1883    :PROPERTIES:
1884    :CUSTOM_ID: RET-or-TAB-to-follow-link
1885    :END:
1887 #+index: Link!Follow
1889    Yes, this is how:
1891    : (setq org-return-follows-link t)
1892    : (setq org-tab-follows-link t)
1894 ** Can I keep mouse-1 clicks from following a link?
1895    :PROPERTIES:
1896    :CUSTOM_ID: mouse-1-following-link
1897    :END:
1899    Activating links with =mouse-1= is a new feature in Emacs 22, to make
1900    link behavior similar to other applications like web browsers.  If
1901    you hold the mouse button down a bit longer, the cursor will be set
1902    without following the link.  If you cannot get used to this behavior,
1903    you can (as in Emacs 21) use =mouse-2= to follow links and turn off
1904    link activation for =mouse-1= with
1906    : (setq org-mouse-1-follows-link nil)
1908 ** How can I get completion of file names when creating a link?
1909    :PROPERTIES:
1910    :CUSTOM_ID: completion-of-file-links
1911    :END:
1913 #+index: Link!Completion
1915 You can use org-insert-link with a prefix argument:
1917 : C-u C-c C-l
1919 You will be greeted with prompt in the minibuffer that allows for file
1920 completion using your preferred Emacs method for finding files.
1922 ** How can I use invisible targets within lists?
1923    :PROPERTIES:
1924    :CUSTOM_ID: invisible-targets-in-lists
1925    :END:
1927 #+index: Target!Invisible
1929 The usual way of turning radio links invisible is to comment them, but
1930 Org comments need to be at the beginning of the line, which breaks list
1931 indentation.
1933 The workaround here is to add (INVISIBLE) after your <<target>>
1935 For example:
1937 : 11. <<target>>(INVISIBLE)
1938 :     Some text
1939 : 12. More text [[target][go to]]
1941 ** Org-mode is not opening mailto links in my default mail client
1942    :PROPERTIES:
1943    :CUSTOM_ID: mailto-links
1944    :END:
1946 #+index: Link!Mailto
1948 You can customize the function org-mode uses to open mailto links by
1949 setting the variable =org-link-mailto-program=:
1951 =M-x customize-variable org-link-mailto-program=
1953 The default function called is =browse-url=, which opens a mail
1954 composition buffer within Emacs. The type of buffer opened by
1955 browse-url depends on the setting of the variable =mail-user-agent=.
1956 Thus, if you want to ensure that mailto links use Gnus to open a
1957 message buffer, you could add the following to your =.emacs=:
1959 #+begin_src elisp
1960 (setq mail-user-agent 'gnus-user-agent)
1961 #+end_src
1963 ** Can I use CamelCase links?
1964    :PROPERTIES:
1965    :CUSTOM_ID: CamelCase-links
1966    :END:
1968 #+index: Link!CamelCase
1970 Yes, you can with the contributed package =org-wikinodes.el=.  Please
1971 consult the [[https://orgmode.org/worg/org-contrib/org-wikinodes.html][documentation]].
1973 ** Can I create links to Thunderbirds emails?
1975 Yes, see this: [[http://mid.gmane.org/ka42mn$mn9$1@ger.gmane.org][from Christoph Herzog: Re: Linking to Thunderbird (correction)]]
1977 #+BEGIN_SRC emacs-lisp
1978 (require 'org)
1980 (org-add-link-type "thunderlink" 'org-thunderlink-open)
1982 (defun org-thunderlink-open (path)
1983   "Opens an email in Thunderbird with ThunderLink."
1984   (start-process "myname" nil "thunderbird" "-thunderlink" (concat "thunderlink:" path)))
1986 (provide 'org-thunderlink)
1987 #+END_SRC
1989 * Plain Lists
1990   :PROPERTIES:
1991   :CUSTOM_ID: Plain-Lists
1992   :END:
1994 ** How can I insert an empty line before each newly inserted headline, but not before each newly inserted plain-list item?
1995    :PROPERTIES:
1996    :CUSTOM_ID: empty-line-before-each-new-headline-but-not-item
1997    :END:
1999 : (setq org-blank-before-new-entry
2000 :       '((heading . t) (plain-list-item . nil))
2002 See also [[id:2463F4D8-F686-4CF3-AA07-08976F8A4972][Why is a blank line inserted after headlines and list items?]].
2004 ** How can I convert itemized lists to enumerated lists?
2005    :PROPERTIES:
2006    :CUSTOM_ID: convert-itemized-to-enumerated-lists
2007    :END:
2009 #+index: List!Itemized
2010 #+index: List!Enumerated
2012    You can use =C-c -= or =S-<left>/<right>= to cycle through the various
2013    bullet headlines available for lists: =-, +, *, 1., 1)=.
2015    See [[https://orgmode.org/manual/Plain-lists.html#Plain-lists][this section of the manual]] for more information.
2017 ** How can I convert plain lists to headlines and vice versa?
2018    :PROPERTIES:
2019    :CUSTOM_ID: convert-plain-lists-to-headlines
2020    :END:
2022 #+index: List!Plain
2023 #+index: Headline
2025    To convert a plain list item or line to a headline, type =C-c *= on
2026    the headline. This will make the line a subheading of the current
2027    headline.
2029    To convert a headline to a plain list item, type =C-c -= while the
2030    cursor is on the headline.
2032    To convert a headline to an unadorned line of text, type =C-c *= on
2033    the headline.
2035    You can use query replace to accomplish the same things, as Bernt
2036    Hansen explains in [[http://article.gmane.org/gmane.emacs.orgmode/10148][this mailing list post]].
2038 ** Is there a good way to create a description list?
2039    :PROPERTIES:
2040    :CUSTOM_ID: description-lists
2041    :END:
2043 #+index: List!Description
2045   Yes, these are now built-in:
2047 #+BEGIN_EXAMPLE
2048 - item1 :: Description of this item 1
2049 - item2 :: Description of this item 2
2050 - item1 :: Description of this item 3
2051       also in multiple lines
2052 #+END_EXAMPLE
2054 ** How can I export alphabetical lists to... alphabetical lists?
2056 =org-list-allow-alphabetical= allows you to use alphabetical lists in
2057 Org, but this is purely visual, there is no effect on how the list is
2058 exported.  It is simply exported as an /ordered/ list, just like when
2059 you use numberes.  How the list will be represented in the export
2060 depends on the backend.  For example, the style file of a LaTeX
2061 document, or the CSS file for HTML documents set how ordered lists
2062 should be represented.  It is good style to adhere to these general
2063 settings because it keeps the overall document structure consistent.
2065 See [[http://mid.gmane.org/87mwq6qtjk.fsf@gmail.com][this thread]] (and earlier ones) for a discussion about this.
2067 * Tables
2068   :PROPERTIES:
2069   :CUSTOM_ID: Tables
2070   :END:
2072 ** Will there ever be support for multiple lines in a table field?
2073    :PROPERTIES:
2074    :CUSTOM_ID: table-multiline-fields
2075    :END:
2077    No.
2079    You can embed tables created with the =table.el= package in org-mode
2080    buffers, with mixed success when it comes to export and publishing.
2082 ** How can I make table alignment work with Asian character sets
2083    :PROPERTIES:
2084    :CUSTOM_ID: table-alignment-asian-characters
2085    :END:
2087 #+index: Table!Alignment
2089 When table alignment fails, it usually has to do with character sets
2090 where some characters have non-integer width.  Org will deal correctly
2091 with characters that are one or two or three ASCII characters wide,
2092 but not with characters that are, for example, 1.5 ASCII characters
2093 wide.  To make table alignment work you need to switch to a different
2094 character set.
2096 ** Can I plot data from a table?
2097    :PROPERTIES:
2098    :CUSTOM_ID: plotting-table-data
2099    :END:
2101 #+index: Table!Plot
2102 #+index: Table!Data
2103 #+index: Plot
2105    Yes, you can, using org-plot.el written by Eric Schulte and now
2106    bundled with Org.  See [[https://orgmode.org/manual/Org_002dPlot.html#Org-Plot][the manual section about this]].
2108    See also [[file:org-tutorials/org-plot.org][this excellent tutorial]] by Eric Schulte.
2110 ** How can I fill a table column with incremental numbers?
2111    :PROPERTIES:
2112    :CUSTOM_ID: fill-table-column-with-incremental-numbers
2113    :END:
2115 #+index: Table!Fill
2117 Here is how: Use a field formula to set the first value in the column:
2119 #+begin_src org
2120 | N   |   |
2121 |-----+---|
2122 | :=1 |   |
2123 |     |   |
2124 |     |   |
2125 |     |   |
2126 ,#+TBLFM: @2$1=1
2127 #+end_src
2129 Then define a column formula in the second field:
2131 #+begin_src org
2132 | N        |   |
2133 |----------+---|
2134 | 1        |   |
2135 | =@-1 + 1 |   |
2136 |          |   |
2137 |          |   |
2138 ,#+TBLFM: @2$1=1
2139 #+end_src
2141 After recomputing the table, the column will be filled with
2142 incremental numbers:
2144 #+begin_src org
2145 | N |   |
2146 |---+---|
2147 | 1 |   |
2148 | 2 |   |
2149 | 3 |   |
2150 | 4 |   |
2151 ,#+TBLFM: $1=@-1 + 1::@2$1=1
2152 #+end_src
2154 Note that you could use arbitrary starting values and column formulas.
2156 Alternatively, you can just start the table
2158 #+begin_src org
2159 | N |   |
2160 |---+---|
2161 | 1 |   |
2162 #+end_src
2164 and with the cursor on the 1, use S-RET (bound to org-table-copy-down). That
2165 will add a row, incrementing the number as it goes. See the docstring for org-table-copy-down
2166 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?]]
2167 if you don't want this behavior.
2169 ** =S-RET= in a table keeps increasing the copied numbers.  How can I stop this?
2170    :PROPERTIES:
2171    :CUSTOM_ID: S-RET-in-a-table-increases-copied-numbers
2172    :END:
2174    Well, it is /supposed/ to be a feature, to make it easy to create a
2175    column with increasing numbers.  If this gets into your way, turn it
2176    off with
2178    : (setq org-table-copy-increment nil)
2180 ** Why does my table column get filled with #ERROR?
2181    :PROPERTIES:
2182    :CUSTOM_ID: table-column-filled-with-ERROR
2183    :END:
2185 #+index: Table!#ERROR
2187    Org-mode tried to compute the column from other fields using a
2188    formula stored in the =#+TBLFM:= line just below the table, and
2189    the evaluation of the formula fails.  Fix the fields used in the
2190    formula, or fix the formula, or remove it!
2192 ** How can I stop the table editor from creating new lines?
2193    :PROPERTIES:
2194    :CUSTOM_ID: table-editor-creates-new-lines
2195    :END:
2197    When I am in the last column of a table and just above a horizontal
2198    line in the table, pressing TAB creates a new table line before the
2199    horizontal line.  To move to the line below the
2200    horizontal line instead, do this:
2202    Press =down= (to get on the separator line) and then =TAB=.
2203    Or configure the variable
2205    : (setq org-table-tab-jumps-over-hlines t)
2207 ** How can I get table fields starting with "="?
2208    :PROPERTIES:
2209    :CUSTOM_ID: table-fields-starting-with-=
2210    :END:
2212    With the setting
2214    : (setq org-table-formula-evaluate-inline nil)
2216    this will no longer happen.  You can still use formulas using the
2217    commands ~C-c =~ and ~C-u C-c =~
2219 ** How can I get a vertical bar "|" inside a table field?
2220    :PROPERTIES:
2221    :CUSTOM_ID: table-fields-with-vertical-bar
2222    :END:
2224    You can use =\vert= to put a vertical bar inside a table field.  This
2225    will be converted for export.  To use it inside a word use
2226    =abc\vert{}def=.  If you need something that looks like a bar in the Org
2227    mode buffer, you can use the unicode character brvbar which looks like
2228    this: \brvbar{}.
2230 ** How can I change the indentation of an entire table without fixing every line by hand?
2231    :PROPERTIES:
2232    :CUSTOM_ID: change-indentation-entire-table
2233    :END:
2235 #+index: Table!Indentation
2237    The indentation of a table is set by the first line.  So just fix the
2238    indentation of the first line and realign with =TAB=.
2240 ** In my huge table the realigning after each TAB takes too long.  What can I do?
2241    :PROPERTIES:
2242    :CUSTOM_ID: table-realigning-after-TAB-takes-long
2243    :END:
2245 #+index: Table!Realign
2247    Either split the table into several by inserting an empty line every
2248    100 lines or so.  Or turn off the automatic re-align with
2250    : (setq org-table-automatic-realign nil)
2252    After this the only way to realign a table is to press =C-c C-c=.  It
2253    will no longer happen automatically, removing the corresponding delays
2254    during editing.
2256 ** Recalculation of my table takes too long.  What can I do?
2257    :PROPERTIES:
2258    :CUSTOM_ID: Recalculation-of-my-table-takes-too-long
2259    :END:
2261 #+index: Table!Calculation
2263    Nothing, really.  The spreadsheet in org is mostly done to make
2264    calculations possible, not so much to make them fast.  Since Org-mode is
2265    firmly committed to the ASCII format, nothing is stopping you from
2266    editing the table by hand.  Therefore, there is no internal
2267    representation of the data.  Each time Org-mode starts a computation, it
2268    must scan the table for special lines, find the fields etc.  This is
2269    slow.  Furthermore, Calc is slow compared to hardware computations.  To
2270    make this work with normal editing, recalculation is not happening
2271    automatically, or only for the current line, so that the long wait for a
2272    full table iteration only happens when you ask for it.
2274    So for really complex tables, moving to a "real" spreadsheet may
2275    still be the best option.
2277    That said, there are some ways to optimize things in Org-mode, and I
2278    have been thinking about moving a bit further down this line.
2279    However, for my applications this has so far not been an issue at
2280    all.  If you have a good case, you could try to convince me.
2282 ** When I export tables to HTML, they don't have borders.
2283    :PROPERTIES:
2284    :CUSTOM_ID: table-borders-in-html-export
2285    :END:
2287 #+index: Table!HTML
2289 By default, Org-mode exports tables without borders.
2291 You can changed this by placing an =#+ATTR_HTML= line before the table:
2293 :  #+ATTR_HTML: :border 2 :rules all :frame all
2295 See [[https://orgmode.org/manual/Tables-in-HTML-export.html#Tables-in-HTML-export][the manual]] for more details.
2297 ** Why does the Calc high precision (e. g. =p20=) not work like expected?
2298    :PROPERTIES:
2299    :CUSTOM_ID: table-high-precision
2300    :END:
2302 - *Short answer*
2304   Avoid
2305   : | 1 / 2 * 3 | 0.16666667000000 |
2306   : #+TBLFM: $2 = $1; p20 %.14f
2308   and use
2309   : | 1 / 2 * 3 | 0.16666666666667 |
2310   : #+TBLFM: $2 = $1 +.0; p20 f-14
2312 - *Longer answer*
2314   It is important to distinguish between the precision of
2315   1) =p20=: Calc internal calculation (=calc-internal-prec=)
2316   2) =f-14=: Calc float formatting, unlimited in precision (=calc-float-format=)
2317   3) =%.14f=: the =printf= reformatting, limited in precision
2319   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.
2321   Use =C-h v org-calc-default-modes RET= to check the Org default settings
2322   which are used if no format specifiers are added to a table formula.
2323   The examples below have been made with the out_of_the_box Org defaults
2324   =calc-internal-prec = 12= and =calc-float-format = 8=.
2326   Remember the formula debugger, toggled with =C-c {=,
2327   to view the processing stages like:
2328   |   | formula debugger label | processing stage           |
2329   | / | <                      | <>                         |
2330   |---+------------------------+----------------------------|
2331   |   | Result:                | output of Calc             |
2332   |   | Format:                | reformatting with =printf= |
2334   Following are some examples to demonstrate
2335   the interaction of the three precisions.
2337   - *display precision limitations for Calc formulas*
2338     - limited by Calc internal calculation precision from Org default
2339       (here =p12=)
2340       : | 0.16666666666700 |
2341       : #+TBLFM: $1 = 1 / 2 * 3;     f-14
2343       : | 0.1666666666670000000 |
2344       : #+TBLFM: $1 = 1 / 2 * 3;     f-19
2346     - limited by Calc float format from Org default (here =f8=)
2347       : | 0.16666667 |
2348       : #+TBLFM: $1 = 1 / 2 * 3
2350       : | 0.16666667 |
2351       : #+TBLFM: $1 = 1 / 2 * 3; p20
2353       : | 0.16666667000000 |
2354       : #+TBLFM: $1 = 1 / 2 * 3;          %.14f
2356       : | 0.16666667000000 |
2357       : #+TBLFM: $1 = 1 / 2 * 3; p20      %.14f
2359     - limited by Calc float format specified
2360       : | 0.166667 |
2361       : #+TBLFM: $1 = 1 / 2 * 3;     f-6
2363       : | 0.16666666666667 |
2364       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-14
2366       : | 0.1666666666666666667 |
2367       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-19
2369     - limited by =printf= conversion to Emacs Lisp float
2370       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
2371       : #+TBLFM: $1 = 1 / 2 * 3;          %.19f
2373       : | 0.1666666699999999900 | the inaccuracy is platform dependent |
2374       : #+TBLFM: $1 = 1 / 2 * 3; p20      %.19f
2376       : | 0.1666666666666666600 | the inaccuracy is platform dependent |
2377       : #+TBLFM: $1 = 1 / 2 * 3; p20 f-20 %.19f
2379     - limited by =printf= format specified
2380       : | 0.166667 |
2381       : #+TBLFM: $1 = 1 / 2 * 3;         %.6f
2383   - *display precision limitations for Emacs Lisp formulas*
2384     - limited by Emacs Lisp float
2385       : | 0.16666666666666666 |
2386       : #+TBLFM: $1 = '(/ 1.0 (* 2 3))
2388       : | 0.1666666666666666574 | the inaccuracy is platform dependent |
2389       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.19f
2391     - limited by =printf= format specified
2392       : | 0.16666666666667 |
2393       : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.14f
2395 This FAQ entry is based on this [[http://thread.gmane.org/gmane.emacs.orgmode/22642][mailing list thread]]
2396 and is continued in the [[#table-float-fraction][next FAQ entry]].
2398 ** Which float format shows the fraction part also when the latter is zero?
2399    :PROPERTIES:
2400    :CUSTOM_ID: table-float-fraction
2401    :END:
2403 - *Short answer*
2405   Avoid
2406    : | 1 | 1 |
2407    : #+TBLFM: $2 = $1; f-3
2408   and use
2409    : | 1 | 1.000 |
2410    : #+TBLFM: $2 = $1 +.0; f-3
2412 - *Longer answer*
2414   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]]
2415   in the section Mode Settings -> Display Modes -> Float Formats
2416   [[http://www.delorie.com/gnu/docs/calc/calc_163.html][found here as long as the section numbering is unchanged]].
2418   Remember the formula debugger, toggled with =C-c {=,
2419   to view the processing stages like:
2420   |   | formula debugger label | processing stage           |
2421   | / | <                      | <>                         |
2422   |---+------------------------+----------------------------|
2423   |   | Result:                | output of Calc             |
2424   |   | Format:                | reformatting with =printf= |
2426   Following are some examples to demonstrate different float formats.
2428   - normal precision
2429     : |-----------+---------+-------+---------+----------+-------|
2430     : |    number |      f3 |   f-3 | +.0; f3 | +.0; f-3 |  %.3f |
2431     : |-----------+---------+-------+---------+----------+-------|
2432     : |         1 |       1 |     1 |   1.000 |    1.000 | 1.000 |
2433     : |         0 |       0 |     0 |   0.000 |    0.000 | 0.000 |
2434     : |-----------+---------+-------+---------+----------+-------|
2435     : |       1.0 |   1.000 | 1.000 |   1.000 |    1.000 | 1.000 |
2436     : |       0.0 |   0.000 | 0.000 |   0.000 |    0.000 | 0.000 |
2437     : |-----------+---------+-------+---------+----------+-------|
2438     : | 1.0001666 |   1.000 | 1.000 |   1.000 |    1.000 | 1.000 |
2439     : | 0.0001666 | 1.67e-4 | 0.000 | 1.67e-4 |    0.000 | 0.000 |
2440     : |-----------+---------+-------+---------+----------+-------|
2441     : | 1.0016666 |   1.002 | 1.002 |   1.002 |    1.002 | 1.002 |
2442     : | 0.0016666 |   0.002 | 0.002 |   0.002 |    0.002 | 0.002 |
2443     : |-----------+---------+-------+---------+----------+-------|
2444     : #+TBLFM: $2 = $1; f3 :: $3 = $1; f-3 :: $4 = $1 +.0; f3 :: $5 = $1 +.0; f-3 :: $6 = $1; %.3f
2446   - high precision
2447     : |----------------------+--------------------------+-----------------------|
2448     : | number               |                      f19 |                  f-19 |
2449     : |----------------------+--------------------------+-----------------------|
2450     : | 1                    |                        1 |                     1 |
2451     : | 0                    |                        0 |                     0 |
2452     : |----------------------+--------------------------+-----------------------|
2453     : | 1.0                  |    1.0000000000000000000 | 1.0000000000000000000 |
2454     : | 0.0                  |    0.0000000000000000000 | 0.0000000000000000000 |
2455     : |----------------------+--------------------------+-----------------------|
2456     : | 1 + 1 / 2 * 3 * 1e19 |    1.0000000000000000000 | 1.0000000000000000000 |
2457     : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
2458     : |----------------------+--------------------------+-----------------------|
2459     : | 1 + 1 / 2 * 3 * 1e18 |    1.0000000000000000002 | 1.0000000000000000002 |
2460     : | 0 + 1 / 2 * 3 * 1e18 |    0.0000000000000000002 | 0.0000000000000000002 |
2461     : |----------------------+--------------------------+-----------------------|
2462     : #+TBLFM: $2 = $1; p20 f19 :: $3 = $1; p20 f-19
2464     : |----------------------+--------------------------+-----------------------|
2465     : | number               |                 +.0; f19 |             +.0; f-19 |
2466     : |----------------------+--------------------------+-----------------------|
2467     : | 1                    |    1.0000000000000000000 | 1.0000000000000000000 |
2468     : | 0                    |    0.0000000000000000000 | 0.0000000000000000000 |
2469     : |----------------------+--------------------------+-----------------------|
2470     : | 1.0                  |    1.0000000000000000000 | 1.0000000000000000000 |
2471     : | 0.0                  |    0.0000000000000000000 | 0.0000000000000000000 |
2472     : |----------------------+--------------------------+-----------------------|
2473     : | 1 + 1 / 2 * 3 * 1e19 |    1.0000000000000000000 | 1.0000000000000000000 |
2474     : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
2475     : |----------------------+--------------------------+-----------------------|
2476     : | 1 + 1 / 2 * 3 * 1e18 |    1.0000000000000000002 | 1.0000000000000000002 |
2477     : | 0 + 1 / 2 * 3 * 1e18 |    0.0000000000000000002 | 0.0000000000000000002 |
2478     : |----------------------+--------------------------+-----------------------|
2479     : #+TBLFM: $2 = $1 +.0; p20 f19 :: $3 = $1 +.0; p20 f-19
2481     The =printf= reformatting (=%.19f=) cannot be used with high precision,
2482     see the [[#table-high-precision][previous FAQ entry]].
2484 ** How can I center tables in LaTeX output?
2485    :PROPERTIES:
2486    :CATEGORY: centered-tables-in-latex
2487    :END:
2489 #+index: Table!Center
2491 Set the `org-latex-tables-centered' to `t':
2493 : (defcustom org-latex-tables-centered t
2494 :   "When non-nil, tables are exported in a center environment."
2495 :   :group 'org-export-latex
2496 :   :type 'boolean)
2498 ** Can I exclude columns from a table when exporting it?
2502 * Markup
2503   :PROPERTIES:
2504   :CUSTOM_ID: Footnotes
2505   :END:
2506 ** How can I get automatic renumbering of footnotes in org-mode?
2507    :PROPERTIES:
2508    :CUSTOM_ID:       footnote-auto-adjust
2509    :END:
2511 #+index: Footnotes!Renumbering
2513 You can add the following line to your .emacs file:
2515 : (setq org-footnote-auto-adjust t)
2517 Or, if you prefer, you can turn this option on locally by placing the
2518 following line at the top of your org file:
2520 : #+STARTUP: fnadjust
2522 When auto-adjust is turned on, footnotes in the file with numerical
2523 labels will be renumbered whenever a new footnote is added. Meanwhile,
2524 all footnotes, including those with custom labels such
2525 =[fn:custom-label ]=, will be sorted in the order of their appearance
2526 in the text.
2528 This emulates the footnote behavior that many users may be familiar
2529 with from word-processing programs or from the footnote-mode included
2530 with emacs.
2532 If you do not turn on org-footnote-auto-adjust, you sort and/or
2533 renumber footnotes at any time by calling org-footnote-action with a
2534 prefix argument.
2536 ** Why isn't auto renumbering of footnotes turned on by default?
2537    :PROPERTIES:
2538    :CUSTOM_ID:       why-no-default-auto-adjust
2539    :END:
2541 Org-mode has a very robust footnote mechanism allowing for a variety of
2542 types of footnotes. With some of the following footnote notations,
2543 auto-adjust may be either irrelevant or undesired:
2545  - Automatically numbered
2546  - Footnotes with custom labels
2547  - Inline footnotes
2549 In addition, Org-mode can be customized to place footnotes either at
2550 the end of a document or at the end of the outline heading in which
2551 they appear. Users who change this setting while editing a document
2552 may be disconcerted to find all of their footnotes rearranged
2553 automatically.
2555 ** I have auto-fill-mode set and org-mode is inserting unwanted comment markers!
2556    :PROPERTIES:
2557    :CUSTOM_ID: auto-fill-and-unwanted-comments
2558    :END:
2560 If the following occurs:
2562 #+begin_src org
2563 ,#+OPTIONS: toc:nil
2564 Some entered text.
2565 ,# More entered tex.
2566 #+end_src
2568 Make sure that the variable comment-start is nil.
2570 ** Are there any shortcuts for entering source blocks and comment lines?
2571    :PROPERTIES:
2572    :CUSTOM_ID: shortcuts-for-entering-source-blocks
2573    :END:
2575 Org-mode has some [[https://orgmode.org/manual/Literal-examples.html#Literal-examples][very convenient markup]] for including literal blocks and
2576 lines of code in a file.  (This is especially useful when exporting
2577 documents or using the contributed package [[file:org-contrib/babel/index.org][org-babel]] for executing blocks
2578 of code.)
2580 #+begin_src org
2581 ,#+begin_src perl
2582 print "Hello, world!\n";
2583 ,#+end_src
2584 #+end_src
2586 It can be tiresome to enter the block comment lines manually. There are
2587 several possible shortcuts you can use to enter them:
2589 1) Built-in expansion
2591    - Org-mode has a "secret" method of expanding source code blocks
2592      and comment lines.
2594    - If you type "<s" followed by =TAB= or =M-TAB=, a source block will
2595      magically appear.
2597    - For a full list of expansions, type =M-x describe-variable
2598      [RET] org-structure-template-alist=.
2600 2) [[https://orgmode.org/manual/Literal-examples.html#Literal-examples][Registers]]
2602    - Add the following line to your emacs file:
2604      =(set-register ?p "#+begin_src\n\n#+end_src perl")=
2606    - Then type =C-x r i p= to insert the source block. Please note: if
2607      you save another value to the register "p" with =C-x r s p=, it
2608      will overwrite the setting above for the current emacs session.
2610 3) [[https://orgmode.org/manual/Literal-examples.html#Literal-examples][Abbrevs]]
2612    - Activate the abbrev minor-mode in org-mode:
2614      + M-x abbrev-mode
2616      + /Permanently/:
2618        + =(add-hook 'org-mode-hook (lambda () (abbrev-mode 1)))=
2620    - In org-mode, type "sbp" (a sample abbreviation for a perl source
2621      block).
2623    - Immediately after "sbp" type =C-x a i l=.
2625    - Enter the expansion:
2627      - =#+begin_src perl[C-q C-j][C-q C-j]#+end_src=
2629      - Note: =C-q C-j= creates a new line in the minibuffer
2631    - Now, whenever, you type sbp followed by =SPACE= or =RET= in an
2632      org-mode buffer, the src block will magically appear.
2634    - To review your list of abbrevs, type =M-x edit-abbrevs=.
2636 4) [[http://www.emacswiki.org/emacs/SkeletonMode][Skeletons]]
2638    - Skeletons offer a simple way of automatically entering text.
2639      Here's a skeleton that queries for the type of block and wraps
2640      the active region inside it:
2642      #+begin_src elisp
2643        (define-skeleton skel-org-block
2644          "Insert an org block, querying for type."
2645          "Type: "
2646          "#+begin_" str "\n"
2647          _ - \n
2648          "#+end_" str "\n")
2649      #+end_src
2651    - Simply type skel-org-block to insert the block.
2653      - You can bind this to a key.
2655      - You can also create an abbrev that invokes this function:
2657        : (define-abbrev org-mode-abbrev-table "blk" "" 'skel-org-block)
2659 5) [[http://code.google.com/p/yasnippet/][Yasnippet]]
2661    - Several org-mode users install yasnippet for convenient, complex
2662      expansion.
2664    - See Bernt Hansen's [[http://doc.norang.ca/org-mode.html#Yasnippets][org-mode setup]] for a good introduction to
2665      yasnippet.
2667 * Capture and remember
2668   :PROPERTIES:
2669   :CUSTOM_ID: Remember
2670   :END:
2672 ** Can I use a variable or a function inside the `org-capture-templates' variable?
2673    :PROPERTIES:
2674    :CUSTOM_ID: variable-inside-capture-templates
2675    :END:
2677 #+index: Capture
2679 Yes.  Use [[http://www.gnu.org/s/emacs/manual/html_node/elisp/Backquote.html][backquotes]].
2681 E.g. if you have a variable called =org-test-file= and you want the
2682 variable =org-capture-templates= to "understand" (i.e. evaluate)
2683 =org-test-file= when Emacs evaluates the =(setq org-capture-templates
2684 [...])= expression, use backquotes like this:
2686 #+begin_src emacs-lisp
2687 (setq org-capture-templates
2688       `(("t" "Todo" entry (file+headline ,org-test-file "Tasks")
2689        "* TODO %?\n  %i\n  %a")
2690       ("b" "Buy" item (file+olp ,org-test-file "Stuff to Buy" "House")
2691        "")))
2692 #+end_src
2694 ** Can I use the remember buffer to clock a customer phone call?
2695    :PROPERTIES:
2696    :CUSTOM_ID: use-remember-buffer-to-clock-phone-call
2697    :END:
2699   Yes, you can.  Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/5482][setup described by Bernt Hansen]] and
2700   check out (in the same thread) what Nick Docos had to fix to make Bernt's
2701   set-up work for him.
2703 ** Can I automatically start the clock when opening a remember template?
2704    :PROPERTIES:
2705    :CUSTOM_ID: start-clock-when-opening-remember-template
2706    :END:
2708 #+index: Clock!Start
2710    Yes, this is possible.  Use the following code and make sure that
2711    after executing it, `my-start-clock-if-needed' is in
2712    `remember-mode-hook' /after/ `org-remember-apply-template'.
2714    : (add-hook 'remember-mode-hook 'my-start-clock-if-needed 'append)
2715    : (defun my-start-clock-if-needed ()
2716    :   (save-excursion
2717    :     (goto-char (point-min))
2718    :     (when (re-search-forward " *CLOCK-IN *" nil t)
2719    :       (replace-match "")
2720    :       (org-clock-in))))
2722    Then, when a template contains the key string CLOCK-IN, the clock
2723    will be started.  Starting with Org-mode version 5.20, the clock will
2724    automatically be stopped when storing the remember buffer.
2726 * Searches
2727   :PROPERTIES:
2728   :CUSTOM_ID: Searches
2729   :END:
2731 ** Isearch does not find string hidden in links.  What can I do?
2732    :PROPERTIES:
2733    :CUSTOM_ID: isearch-in-links
2734    :END:
2736 #+index: Isearch
2738   M-x =visible-mode= will display the full link, making them searchable.
2740 ** How can I reduce the amount of context shown in sparse trees?
2741    :PROPERTIES:
2742    :CUSTOM_ID: context-in-sparse-trees
2743    :END:
2745 #+index: Context
2747    Take a look at the following variables:
2749    - =org-show-hierarchy-above=
2750    - =org-show-following-headline=
2751    - =org-show-siblings=
2752    - =org-show-entry-blow=
2754    which give command-dependent control over how much context is shown by a
2755    particular operation.
2757 ** How can I combine the results of two calls to =org-occur=?
2758    :PROPERTIES:
2759    :CUSTOM_ID: two-calls-to-org-occur
2760    :END:
2762 #+index: Occur
2764    You can construct a regular expression that matches all targets you
2765    want.  Alternatively, use a =C-u= prefix with the second and any
2766    further calls to =org-occur= to keep the current visibility and
2767    highlighting in addition to the new ones.
2769 * Agenda
2770   :PROPERTIES:
2771   :CUSTOM_ID: Agenda
2772   :END:
2774 ** My agenda commands are slow.  What to do?
2776 See the dedicated page about [[file:agenda-optimization.org][agenda speed up and optimization]].
2778 ** How can I change the advanced warning time for deadlines?
2779    :PROPERTIES:
2780    :CUSTOM_ID: warning-period-for-deadlines
2781    :END:
2783 #+index: DEADLINE!Warning
2785 Deadline warnings appear in the daily agenda view a specified number
2786 of days before the deadline is due. The default setting is 14 days.
2787 You can change this with the variable =org-deadline-warning-days=.
2788 (See [[https://orgmode.org/manual/Deadlines-and-scheduling.html#Deadlines-and-scheduling][this section]] of the manual.)
2790 For instance,
2792 : (setq org-deadline-warning-days 30)
2794 would cause warnings for each deadline to appear 30 days in advance.
2796 Naturally, you might not want warnings for all of your deadlines to
2797 appear so far in advance. Thus, you can change the lead time for
2798 individual items as follows:
2800 : * TODO Get a gift for the party
2801 :   DEADLINE: <2009-01-16 Fri -2d>
2803 The "-2d" above changes the lead time for this deadline warning to two
2804 days in advance. You can also use "w" for weeks and "m" for months.
2806 ** How can I postpone a task until a certain date?
2807    :PROPERTIES:
2808    :CUSTOM_ID: deferring-tasks
2809    :END:
2811 #+index: Postpone
2813 The easiest way to postpone a task is to schedule it in the future.  For
2814 instance, typing =C-c C-s +2w= on a headline will push a task two weeks
2815 into the future, so that it won't show up on the daily agenda until two
2816 weeks from now.
2818 If you'd like to prevent the task from showing up on your global todo list,
2819 you have a couple of options.
2821 1. You can set the variable =org-agenda-todo-ignore-scheduled= to
2822    =t=.  This will exclude any scheduled items from your global list of
2823    active todos (=C-c a t=). (The variable
2824    =org-agenda-todo-ignore-with-date= will exclude both scheduled and
2825    deadline items from your todo list).
2827 2. You can remove the todo keyword from the item (C-c C-t <SPC>). The item
2828    will still appear on your agenda two weeks from today, but it won't show
2829    up on your todo lists.
2831 ** Can I send myself an email containing tasks or other agenda info?
2832    :PROPERTIES:
2833    :CUSTOM_ID: email-containing-tasks-or-other-agenda-info
2834    :END:
2836    Yes.  See [[http://article.gmane.org/gmane.emacs.orgmode/6112][this thread]] on the list.
2838 ** How can I limit the agenda view to my "work" tasks?
2839    :PROPERTIES:
2840    :CUSTOM_ID: limit-agenda-with-tag-filtering
2841    :END:
2843 #+index: FILETAGS
2845    It is often convenient to group org files into separate categories, such
2846    as "home" and "work" (or "personal" and "professional"). One of the main
2847    reasons for such classification is to create agenda views that are
2848    limited by type of work or area of responsibility.  For instance, while
2849    at work, one may want to see only professional tasks; while away from
2850    work, one may want to see only personal tasks.
2852    One way to categorize files and tasks is to use a "#+FILETAGS"
2853    declaration at the top of each file, such as:
2855    : #+FILETAGS: work
2857    As long as org-use-tag-inheritance is turned on, the filetags will
2858    be inherited by all tasks in the file. A file can have multiple
2859    filetags. And, of course, tags can be added to individual headings.
2861    Tasks can be quickly filtered by tag from within the agenda by
2862    typing "/" and the name of the tag. The full key sequence to filter
2863    for work items in an agenda view would be:
2865    : C-c a a / work [or a tag shortcut]
2867 ** How can I limit the agenda view to a particular category?
2868    :PROPERTIES:
2869    :CUSTOM_ID: limit-agenda-with-category-match
2870    :END:
2872 #+index: Agenda view!Category
2874    Another way to filter agenda views by type of work is to use a
2875    "#+CATEGORY" declaration at the top of each file, such as:
2877    : #+CATEGORY: work
2879    Categories can also be added to individual headings within a file:
2881    : * Big project
2882    :   :PROPERTIES:
2883    :   :CATEGORY: work
2884    :   :END:
2886    All todos belonging to the category "work" can be found a with a
2887    simple tags-todo search:
2889    : C-c a M
2891    At the prompt, type:
2893    : CATEGORY="work"
2895    The same results can be achieved with custom agenda commands, such as:
2897 #+BEGIN_SRC emacs-lisp
2898 (setq org-agenda-custom-commands
2899       '(("h" tags-todo "CATEGORY=\"home\"")
2900         ("w" tags-todo "CATEGORY=\"work\"")
2901         ;; other custom agenda commands here
2902         ))
2903 #+END_SRC
2905 ** How can include all org files in a directory in my agenda?
2906    :PROPERTIES:
2907    :CUSTOM_ID: set-agenda-files-using-wildcards
2908    :END:
2910 #+index: Agenda!Directory
2912 You can simply include the directory (as one of the items) in the value of
2913 the variable org-agenda-files:
2915 : (setq org-agenda-files '("/my/special/path/org/"))
2917 There is another way of accomplishing the same end:
2919 : (setq org-agenda-files (file-expand-wildcards "/my/special/path/org/*.org"))
2921 ** Why aren't items disappearing from my agenda once they are marked done?
2922    :PROPERTIES:
2923    :CUSTOM_ID: removing-done-items-from-agenda
2924    :END:
2926 If items remain on your daily/weekly agenda after they are marked done,
2927 check the configuration of the following variables:
2929 : org-agenda-skip-scheduled-if-done
2930 : org-agenda-skip-deadline-if-done
2931 : org-agenda-skip-timestamp-if-done
2933 For instance, type:
2935 : M-x customize-variable RET org-agenda-skip-scheduled-if-done
2937 If this variable is turned off (=nil=), then scheduled items will
2938 remain on the agenda even after they are marked done.
2940 If the variable is turned on (=t=), then scheduled items will
2941 disappear from the agenda after they are marked done.
2943 If these settings seem not to behave the way you expect, then make
2944 sure you understand [[#scheduled-vs-deadline-vs-timestamp][the difference between SCHEDULED, DEADLINE, and
2945 timestamps]].
2947 ** How do I keep repeating timestamps from being displayed multiple times?
2948    :PROPERTIES:
2949    :CUSTOM_ID: repeating-timestamps-show-once
2950    :END:
2952 #+index: Timestamp!Repeating
2954 To show only the /current/ instance of a repeating timestamp, put the
2955 following in your .emacs:
2957 #+begin_src emacs-lisp
2958 (setq org-agenda-repeating-timestamp-show-all nil)
2959 #+end_src
2961 ** What is the difference between SCHEDULED, DEADLINE, and plain timestamps?
2962    :PROPERTIES:
2963    :CUSTOM_ID: scheduled-vs-deadline-vs-timestamp
2964    :END:
2966 #+index: SCHEDULED
2967 #+index: DEADLINE
2968 #+index: Timestamp
2970 1. SCHEDULED items (set with =C-c C-s=) will appear on your agenda on
2971    the day they are scheduled and on every day thereafter until they
2972    are done. Schedule a task if you want to be reminded to do
2973    something beginning on a certain day and until it is done.
2975    : ** TODO Scheduled item
2976    :    SCHEDULED: <2009-03-01 Sun>
2978 2. Items with a DEADLINE timestamp (set with =C-c C-d=) appear on your
2979    agenda in advance of the when they are due and remain on your
2980    agenda until they are done. Add a DEADLINE to an item if you want
2981    to make sure to complete it by a certain date. (The variable
2982    org-deadline-warning-days determines how far in advance items with
2983    deadlines will show up in the agenda. See [[#warning-period-for-deadlines][this FAQ]] for more
2984    information.)
2986    : ** TODO Item with a deadline
2987    :    DEADLINE: <2009-01-20 Tue>
2989 3. An active timestamp (set with =C-c .=) will appear on your agenda
2990    only on the day it is scheduled. Use a timestamp for appointments
2991    or any reminders you want to show up only on a particular day.
2993    : ** TODO Item with an active timestamp
2994    : <2009-04-18 Sat>
2996 Note: items with inactive timestamps (set with C-c ! and marked by
2997 square brackets) will not show up in the agenda at all.
2999 ** Can I add files recursively to my list of agenda files?
3000    :PROPERTIES:
3001    :CUSTOM_ID: set-agenda-files-recursively
3002    :END:
3004 Yes, you can use the library =find-lisp=.
3006 : (load-library "find-lisp")
3007 : (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$"))
3009 This will add all files ending in =org= in the directory "~/org"
3010 and all of its subdirectories to your list of agenda files.
3012 If on a *nix machine, you can also use the find utility, which can be
3013 faster than the find-lisp library:
3015 : (setq org-agenda-files
3016 :       (mapcar 'abbreviate-file-name
3017 :               (split-string
3018 :                (shell-command-to-string "find ~/org -name \"*.org\"") "\n")))
3021 See [[http://thread.gmane.org/gmane.emacs.orgmode/8992][this thread]] on the mailing list for more information.
3023 ** Why does an item appearing at the wrong time of day in my agenda?
3024    :PROPERTIES:
3025    :CUSTOM_ID: agenda-wrong-time-of-day
3026    :END:
3028 When preparing the agenda view, org-mode scans each relevant headline for a
3029 time designation.  This approach is very nice for adding free-form
3030 timestamps to an item for scheduling.  Thus, either of the following work
3031 would work to schedule an item at 10:00am:
3033 #+begin_src org
3034 ,** 10:00am Get dried ice at the magic store
3035    SCHEDULED: <2009-05-27 Wed>
3036 #+end_src
3038 #+begin_src org
3039 ,** Get dried ice at the magic store
3040    SCHEDULED: <2009-05-27 Wed 10:00>
3041 #+end_src
3043 To enable this flexibility, org-mode scans the entire headline for time of
3044 day notation. A potential problem can arise if you use inactive timestamps
3045 in the headline to note when an item was created.  For example :
3047 #+begin_src org
3048 ,** Get dried ice at the magic store [2009-05-26 Tue 12:58]
3049    SCHEDULED: <2009-05-27 Wed>
3050 #+end_src
3052 Org-mode would interpret the time in the inactive timestamp as a
3053 time-of-day indicator and the entry would appear in your agenda at
3054 12:58.
3056 If you would like to turn off the time-of-day search, you can configure the
3057 variable =org-agenda-search-headline-for-time= (requires org-mode >= 6.24).
3059 ** How can I change the visibility of an item from the agenda?
3060    :PROPERTIES:
3061    :CUSTOM_ID: cycling-visibility-from-agenda
3062    :END:
3064 #+index: Agenda!Visibility
3066 You can add a keybinding as follows:
3068 #+begin_src emacs-lisp
3069 (add-hook 'org-agenda-mode-hook
3070    (lambda ()
3071      (define-key org-agenda-mode-map " " 'org-agenda-cycle-show)))
3072 #+end_src
3074 Then, as you press SPACE on an item on the agenda, it will cycle the
3075 visibility of its original location.
3077 ** Is there any way to set org-mode so that tags don't appear in the agenda view?
3079 See the =org-agenda-remove-tags= variable.
3081 ** I work late at night! How can I extend my current day past midnight?
3082    :PROPERTIES:
3083    :CUSTOM_ID: org-extend-today-until
3084    :END:
3086 If you work past midnight, you may not want your daily agenda view to
3087 switch to the next day at 12 a.m. (the default). To extend your day, simply
3088 set the value of org-extend-today-until to a positive number corresponding
3089 to the number of hours you work past midnight. For example, the following
3090 setting will cause the current day to extend until 6 a.m.
3092 : (setq org-extend-today-until 6)
3094 * Appointments/Diary
3095   :PROPERTIES:
3096   :CUSTOM_ID: Appointments/Diary
3097   :END:
3098 ** Is it possible to include entries from org-mode files into my emacs diary?
3099    :PROPERTIES:
3100    :CUSTOM_ID: include-entries-from-org-mode-files-into-emacs-diary
3101    :END:
3103 #+index: Diary
3105    Since the org-mode agenda is much more powerful and can contain the
3106    diary, you should think twice before deciding to do this.  If you
3107    insist, however, integrating Org-mode information into the diary is
3108    possible.  You need to turn on /fancy diary display/ by setting in
3109    .emacs:
3111    : (add-hook 'diary-display-hook 'diary-fancy-display)
3113    Then include the following line into your ~/diary file, in
3114    order to get the entries from all files listed in the variable
3115    =org-agenda-files=
3117    : &%%(org-diary)
3119    You may also select specific files with
3121    : &%%(org-diary) ~/path/to/some/org-file.org
3122    : &%%(org-diary) ~/path/to/another/org-file.org
3124    If you now launch the calendar and press ~d~ to display a
3125    diary, the headlines of entries containing a timestamp, date range,
3126    schedule, or deadline referring to the selected date will be listed.
3127    Just like Org-mode's agenda view, the diary for /today/ contains
3128    additional entries for overdue deadlines and scheduled items.  See
3129    also the documentation of the =org-diary= function.  Under XEmacs, it
3130    is not possible to jump back from the diary to the org, this works
3131    only in the agenda buffer.
3132 ** I want to add my Org scheduled/deadlined entries in my diary!
3133    :PROPERTIES:
3134    :CUSTOM_ID: add-Org-scheduled/deadlined-entries-to-diary!
3135    :END:
3137    Put this in your ~/.diary:
3139    : &%%(org-diary :scheduled :timestamp :deadline)
3141 ** How can I set up automatic reminders based on Org information?
3142    :PROPERTIES:
3143    :CUSTOM_ID: automatic-reminders
3144    :END:
3146 #+index: Reminders
3148   See [[http://article.gmane.org/gmane.emacs.orgmode/5271][this post]] by N. Dokos on the list. See also Russell Adams's hack in
3149   [[https://orgmode.org/worg/org-hacks.html#org-agenda-appt-zenity][org-hacks]].
3151 ** How can I make =appt= notice my Org appointments?
3152    :PROPERTIES:
3153    :CUSTOM_ID: appt-notice-my-Org-appointments
3154    :END:
3156 #+index: Appointment
3157 #+index: Appt
3159   : M-x org-agenda-to-appt RET
3161 ** How can I create more complex appointments in my org-files?
3162    :PROPERTIES:
3163    :CUSTOM_ID: diary-sexp-in-org-files
3164    :END:
3166 #+index: Appointment
3168 Org-mode's active timestamps work very well for scheduling individual
3169 or recurring appointments, such as:
3171 #+begin_src org
3172 ,* 8:00am Dentist appointment <2009-01-16 Fri>
3173 #+end_src
3177 #+begin_src org
3178 ,* Vacation
3179   <2009-03-20 Fri>--<2009-04-01 Wed>
3180 #+end_src
3184 #+begin_src org
3185 ,* Weekly meeting with boss
3186   <2009-01-20 Tue 14:00 +1w>
3187 #+end_src
3189 Sometimes, however, you need to set up more complicated recurring
3190 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
3191 entries]] that work in [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Diary.html#Diary][Emacs diary]].
3193 Let's say, for instance, that you teach a class that meets every Monday
3194 evening between February 16 and April 20, 2009. The way to enter this an
3195 org-mode file is:
3197 #+begin_src org
3198 ,** Class 7:00pm-9:00pm
3199    <%%(and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009))>
3200 #+end_src
3202 The expression above designates all Mondays that fall between February
3203 16 and April 20. How exactly does it work?
3205  - (and... :: Indicates that *both* of the conditions that follow have
3206           to be true.
3208    - (= 1 (calendar-day-of-week date)) :: Is the day of the week a
3209         Monday?
3211        - Note: the function calendar-day-of-week converts the date to the day of week
3212          expressed in numeric form, where 0 = Sunday, 1 = Monday, and so on.
3214    - (diary-block 2 16 2009 4 20 2009) :: Does the date fall between
3215         these two dates?
3217 You can make a sexp as complex as you like. If you wanted to omit a week
3218 because of holidays, for instance, you could add another condition to the
3219 sexp:
3221 #+begin_src org
3222 ,** Class 7:00pm-9:00pm
3223    <%%(unless (diary-block 3 9 2009 3 13 2009) (and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009)))>
3224 #+end_src
3226 The sexp above would omit Monday during the week of March 9, 2009. For
3227 another way to accomplish the same thing, see [[#org-class][this FAQ]].
3229 Another diary function commonly used for more complex scheduling is
3230 diary-float. For instance,
3232 #+begin_src org
3233 ,* Monthly meeting
3234   <%%(diary-float t 3 3)>
3235 #+end_src
3237 ... would appear on the third Wednesday of every month.
3239 For more ideas on how to create diary special expressions, see [[http://www.emacswiki.org/cgi-bin/wiki/DiaryMode][this
3240 page on the Emacs wiki]].
3242 ** How can I schedule a weekly class that lasts for a limited period of time?
3243    :PROPERTIES:
3244    :CUSTOM_ID: org-class
3245    :END:
3247 Org-mode offers a convenient diary sexp function for setting up a recurring
3248 appointment that lasts for a certain period of time, such as a class. It is
3249 called org-class and it can be entered as follows:
3251 #+begin_src org
3252 ,** Class 7:00pm-9:00pm
3253    <%%(org-class 2009 2 16 2009 4 20 1 10)>
3254 #+end_src
3256 The function above schedules an appointment for every Monday (1)
3257 between February 16 and April 20, 2009, except for ISO week 10 (March
3258 1 to March 7).
3260 If you would prefer not to place the timestamp in the headline, you can use
3261 the following format:
3263 #+begin_src org
3264 ,** Class
3265    <%%(org-class 2009 2 16 2009 4 20 1 10)> 7:00pm-9:00pm Class
3266 #+end_src
3268 In this case, the string following the sexp will be displayed in the
3269 agenda.
3271 The function org-class has the following format:
3273 : (org-class Y1 M1 D1 Y2 M2 D2 DAYNAME &rest SKIP-WEEKS)
3275 Y1/2, M1/2, and D1/2 indicate the beginning and ending dates. DAYNAME takes
3276 the form of a number indicating the day of the week (0 = Sunday, 1 =
3277 Monday, and so on...). In addition, one can add an optional argument
3278 SKIP-WEEKS to indicate weeks on the calendar that should be skipped. This
3279 argument should be expressed as an ISO week number. You can find the number
3280 by invoking emacs' built-in calendar (=M-x calendar=), navigating to the
3281 appropriate week, and typing =p c (calendar-iso-print-date)=.  If one of
3282 the SKIP-WEEKS is the symbol =holidays=, then any holidays known to the
3283 calendar are also skipped.
3285 Here is an alternative method, shared by Paul Sexton on the org mailing
3286 list:
3288 Let's say you are taking night classes in Spanish. The class is every
3289 Wednesday evening at 7pm, starting on 18 August, and runs for 8
3290 weeks.  Org-mode's timestamps do not support limited occurrences of
3291 recurrent items -- you have to schedule the item with infinite recurrences,
3292 then delete it when it finishes.
3294 To schedule the Spanish classes, put the following in your =.emacs=:
3296 #+begin_src emacs-lisp
3297   (defun diary-limited-cyclic (recurrences interval m d y)
3298     "For use in emacs diary. Cyclic item with limited number of recurrences.
3299   Occurs every INTERVAL days, starting on YYYY-MM-DD, for a total of
3300   RECURRENCES occasions."
3301     (let ((startdate (calendar-absolute-from-gregorian (list m d y)))
3302           (today (calendar-absolute-from-gregorian date)))
3303       (and (not (minusp (- today startdate)))
3304            (zerop (% (- today startdate) interval))
3305            (< (floor (- today startdate) interval) recurrences))))
3306 #+end_src
3308 The item in the org file looks like this:
3310 #+begin_src org
3311 ,** 19:00-21:00 Spanish lessons
3312    <%%(diary-limited-cyclic 8 7 8 18 2010)>
3313 #+end_src
3315 ** How can I set an event to occur every day except Saturday and Sunday?
3317 #+begin_src org
3318 ,** Daily meeting
3319    <%%(memq (calendar-day-of-week date) '(1 2 3 4 5))>
3320 #+end_src
3322 ** How do I schedule events relative to Easter Sunday?
3324    Easter's date moves around from year to year according to a complicated
3325    set of criteria which I do not claim to understand.  However the
3326    following code will allow you to schedule recurring events relative to
3327    Easter Sunday.
3329    Note: the function da-easter is from [[http://github.com/soren/elisp/blob/master/da-kalender.el][da-kalender.el]].
3331    Put the following in your .emacs:
3333    #+begin_src emacs-lisp
3334      (defun da-easter (year)
3335        "Calculate the date for Easter Sunday in YEAR. Returns the date in the
3336      Gregorian calendar, ie (MM DD YY) format."
3337        (let* ((century (1+ (/ year 100)))
3338               (shifted-epact (% (+ 14 (* 11 (% year 19))
3339                                    (- (/ (* 3 century) 4))
3340                                    (/ (+ 5 (* 8 century)) 25)
3341                                    (* 30 century))
3342                                 30))
3343               (adjusted-epact (if (or (= shifted-epact 0)
3344                                       (and (= shifted-epact 1)
3345                                            (< 10 (% year 19))))
3346                                   (1+ shifted-epact)
3347                                 shifted-epact))
3348               (paschal-moon (- (calendar-absolute-from-gregorian
3349                                 (list 4 19 year))
3350                                adjusted-epact)))
3351          (calendar-dayname-on-or-before 0 (+ paschal-moon 7))))
3354      (defun da-easter-gregorian (year)
3355        (calendar-gregorian-from-absolute (da-easter year)))
3357      (defun calendar-days-from-easter ()
3358        "When used in a diary sexp, this function will calculate how many days
3359      are between the current date (DATE) and Easter Sunday."
3360        (- (calendar-absolute-from-gregorian date)
3361           (da-easter (calendar-extract-year date))))
3362     #+end_src
3364     Now we can schedule the public holidays associated with Easter as
3365     recurring events.  Good Friday is 2 days before "Easter", Easter Monday
3366     is one day after.
3368     #+begin_src org
3369     ,* Good Friday
3370       <%%(= -2 (calendar-days-from-easter))>
3372     ,* Easter Sunday
3373       <%%(= 0 (calendar-days-from-easter))>
3375     ,* Easter Monday
3376       <%%(= 1 (calendar-days-from-easter))>
3377     #+end_src
3379    [Source: Posted by Paul Sexton on Org-mode mailing list.]
3381 ** How to schedule public holiday that is "the nearest Monday to DATE"?
3383    In New Zealand each regional capital has an "Anniversary Day". The date
3384    of Auckland's anniversary day is "the nearest Monday to 29 January".
3386    Put this in your =.emacs=:
3388    #+begin_src emacs-lisp
3389      (defun calendar-nearest-to (target-dayname target-day target-month)
3390        "Recurring event that occurs in the nearest TARGET-DAYNAME to
3391      the date TARGET-DAY, TARGET-MONTH each year."
3392        (interactive)
3393        (let* ((dayname (calendar-day-of-week date))
3394               (target-date (list target-month target-day (calendar-extract-year date)))
3395               (days-diff (abs (- (calendar-day-number date)
3396                                  (calendar-day-number target-date)))))
3397          (and (= dayname target-dayname)
3398               (< days-diff 4))))
3399     #+end_src
3401    Now we can schedule Auckland Anniversary Day. The first argument, 1,
3402    means Monday (days of the week are numbered starting with Sunday=0).
3404    [Source: Originally posted by Paul Sexton on Org-mode mailing list.]
3406 ** How to schedule public holiday on "the 4th Monday in October"?
3408 #+index: Holiday
3410    This does not require any additions to =.emacs=:
3412 #+begin_src org
3413 ,* Labour Day (NZ)
3414   <%%(diary-float 10 1 4)>
3415 #+end_src
3417 ** Why isn't the agenda showing all the times I put under a single entry?
3418    :PROPERTIES:
3419    :CATEGORY: multiple-timestamps-same-entry
3420    :END:
3422 Probably because you have not set the following variable:
3424 : org-agenda-skip-additional-timestamps-same-entry
3426 The default value of this variable is t, which means that entries with
3427 multiple timestamps, such as the following...
3429 #+begin_src org
3430 ,* Work really, really hard
3431   <2010-11-20 Sat 10:00>
3432   <2010-11-20 Sat 14:00>
3433 #+end_src
3435 ... will only appear in the agenda at the time specified by the first
3436 timestamp. If you set =org-agenda-skip-additional-timestamps-same-entry= to
3437 nil, the item will appear will appear at all the times you specify.
3439 ** Can I import iCal events/appts from Gnus?
3441 #+index: iCal
3442 #+index: Gnus
3444 Yes.  Vagn Johansen wrote [[http://ozymandias.dk/emacs/org-import-calendar.el][org-import-calendar.el]] which lets you do this.
3446 * Export
3447   :PROPERTIES:
3448   :CUSTOM_ID: Export
3449   :END:
3450 ** How do I ignore a headline?
3452    This is one of the most common FAQs on the Org mailing list.  The
3453    following export filter will allow headlines tagged =ignore= to be
3454    ignored during export, while their contents and children headlines
3455    are retained and children headlines are promoted to the level of
3456    the original headline.  Alternately, a more in depth discussion
3457    with a variety of alternate solutions is available in org-hacks
3458    [[file:org-hacks.org::#ignoreheadline][here]].
3460    #+begin_src emacs-lisp
3461      ;; During export headlines which have the "ignore" tag are removed
3462      ;; from the parse tree.  Their contents are retained (leading to a
3463      ;; possibly invalid parse tree, which nevertheless appears to function
3464      ;; correctly with most export backends) all children headlines are
3465      ;; retained and are promoted to the level of the ignored parent
3466      ;; headline.
3467      ;;
3468      ;; This makes it possible to add structure to the original Org-mode
3469      ;; document which does not effect the exported version, such as in the
3470      ;; following examples.
3471      ;;
3472      ;; Wrapping an abstract in a headline
3473      ;;
3474      ;;     * Abstract                        :ignore:
3475      ;;     #+LaTeX: \begin{abstract}
3476      ;;     #+HTML: <div id="abstract">
3477      ;;
3478      ;;     ...
3479      ;;
3480      ;;     #+HTML: </div>
3481      ;;     #+LaTeX: \end{abstract}
3482      ;;
3483      ;; Placing References under a headline (using ox-bibtex in contrib)
3484      ;;
3485      ;;     * References                     :ignore:
3486      ;;     #+BIBLIOGRAPHY: dissertation plain
3487      ;;
3488      ;; Inserting an appendix for LaTeX using the appendix package.
3489      ;;
3490      ;;     * Appendix                       :ignore:
3491      ;;     #+LaTeX: \begin{appendices}
3492      ;;     ** Reproduction
3493      ;;     ...
3494      ;;     ** Definitions
3495      ;;     #+LaTeX: \end{appendices}
3496      ;;
3497      (defun org-export-ignore-headlines (data backend info)
3498        "Remove headlines tagged \"ignore\" retaining contents and promoting children.
3499      Each headline tagged \"ignore\" will be removed retaining its
3500      contents and promoting any children headlines to the level of the
3501      parent."
3502        (org-element-map data 'headline
3503          (lambda (object)
3504            (when (member "ignore" (org-element-property :tags object))
3505              (let ((level-top (org-element-property :level object))
3506                    level-diff)
3507                (mapc (lambda (el)
3508                        ;; recursively promote all nested headlines
3509                        (org-element-map el 'headline
3510                          (lambda (el)
3511                            (when (equal 'headline (org-element-type el))
3512                              (unless level-diff
3513                                (setq level-diff (- (org-element-property :level el)
3514                                                    level-top)))
3515                              (org-element-put-property el
3516                                :level (- (org-element-property :level el)
3517                                          level-diff)))))
3518                        ;; insert back into parse tree
3519                        (org-element-insert-before el object))
3520                      (org-element-contents object)))
3521              (org-element-extract-element object)))
3522          info nil)
3523        data)
3525      (add-hook 'org-export-filter-parse-tree-functions 'org-export-ignore-headlines)
3526    #+end_src
3528 ** My old beamer presentations does not look the same with =ox-beamer.el=
3529    :PROPERTIES:
3530    :CUSTOM_ID: beamer-backwards-incompatibility
3531    :END:
3533 #+index: Export!Beamer
3535    The new beamer introduced a few backwards incompatible changes.
3536    Some of these are discussed [[file:exporters/beamer/ox-beamer.org::#backwards-compatibility][here]].  If you think the discussion can
3537    be improved, please share your thoughts on the mailing list; better
3538    yet, improve the entry on Worg!
3540 ** How can I export <my favourite element> as <my favourite environment> or how can I transform the export output using filters
3541    :PROPERTIES:
3542    :CUSTOM_ID: filter
3543    :END:
3545 #+index: Export!Filters
3547    It is often useful to be able to make small tweaks to the export
3548    output by using filters.
3550    There have been a lot of requests like this on the mailing list
3551    lately.  Often a user wants to export an image in different ways
3552    during LaTeX export; or export different image files for different
3553    backends.  All these can be easily achieved by using export
3554    filters.  You can look at [[http://article.gmane.org/gmane.emacs.orgmode/74876][this example]] on the mailing list.  For a
3555    more general discussion on the "new" export engine, including a
3556    description of filters and how they work, see Nicolas Goaziou's
3557    [[http://thread.gmane.org/gmane.emacs.orgmode/65574][announcement]]: it is very much worth reading in its entirety (except
3558    for the section on users of the experimental version who are by now
3559    extinct - as is the experimental version.)
3561 ** Can I get TODO items exported to HTML as lists, rather than as headlines?
3562    :PROPERTIES:
3563    :CUSTOM_ID: export-TODO-items-as-lists
3564    :END:
3566 #+index: Export!HTML
3568    If you plan to use ASCII or HTML export, make sure things you want to
3569    be exported as item lists are level 4 at least, even if that does
3570    mean there is a level jump.  For example:
3572    : * Todays top priorities
3573    : **** TODO write a letter to xyz
3574    : **** TODO Finish the paper
3575    : **** Pick up kids at the school
3577    Alternatively, if you need a specific value for the heading/item
3578    transition in a particular file, use the =#+OPTIONS= line to
3579    configure the H switch.
3581    : #+OPTIONS:   H:2; ...
3583 ** Can I export only a single subtree?
3584    :PROPERTIES:
3585    :CUSTOM_ID: export-single-subtree
3586    :END:
3588 #+index: Export!Subtree
3590 If you want to export a subtree, mark the subtree as region and then
3591 export. Marking can be done with =C-c @ C-x C-x=, for example.
3593 Alternatively, you can select option =1= in the org export dispatcher
3594 (e.g.., =C-c C-e 1 h= to export the current subtree to html).
3596 By default, the title of the exported file will be set to the heading
3597 of the subtree. You can, however, [[#export-options-for-subtree][customize the title and other export
3598 options]].
3600 ** How can I customize export options for a single subtree?
3601    :PROPERTIES:
3602    :CUSTOM_ID: export-options-for-subtree
3603    :END:
3605 #+index: Export!Options
3607 You can set unique export options for a [[#export-single-subtree][single subtree]] by using
3608 properties. Relevant properties include:
3610  - =EXPORT_TITLE=
3611  - =EXPORT_AUTHOR=
3612  - =EXPORT_DATE=
3613  - =EXPORT_FILE_NAME=
3614  - =EXPORT_OPTIONS= (corresponds to the =#+OPTIONS:= [[https://orgmode.org/manual/Export-settings.html#Export-settings][configuration line]])
3616 ** How can I tell my calendar web application about appointments in my agenda files?
3618 Here is what you need to do:
3620 1. a script that calls Emacs in batch mode and produce a .ics file
3621 2. a script that uploads this .ics file somewhere on the web
3622 3. tell your webapp to fetch this .ics file on the web
3624 Here is the script I use for the first step:
3626 #+begin_src shell-script-mode
3627 #!/bin/bash
3629 /usr/local/bin/emacs --batch --eval \
3630 "(progn (load-file \"~/install/git/org-mode/org.el\") \
3631         (load-file \"~/elisp/config/org-batch-config.el\") \
3632         (setq org-combined-agenda-icalendar-file \"~/org/cal/org.ics\")
3633         (setq org-agenda-files (quote (\"~/org/bzg.org\"))))" \
3634     -f org-export-icalendar-combine-agenda-files
3635 #+end_src
3637 Depending on your configuration, you might change the load sequence.
3639 Here is the script I use for the second step:
3641 #+begin_src shell-script-mode
3642 #!/bin/bash
3643 /usr/bin/rsync -rtv ~/org/org.ics -e ssh me@my_server:/home/me/public_html/
3644 #+end_src
3646 Note: if you want to cron this rsync script, you will need to let
3647 =my_server= to know about your SSH public key.  Check [[http://troy.jdmz.net/rsync/index.html][this page]] as a
3648 starter.
3650 Now you can cron the two scripts above and your webapp will always be
3651 up to date with your Org agendas.
3653 Also see [[https://orgmode.org/org.html#Exporting-Agenda-Views][Exporting agenda views]] from Org manual.
3655 ** How can I get Mac OSX 10.3 iCal to import my org-exported .ics files?
3656    :PROPERTIES:
3657    :CUSTOM_ID: iCal-import-ics-files-old
3658    :END:
3660 #+index: .ics
3661 #+index:  iCal!Mac OSX 10.3
3663    When using iCal under Apple MacOS X Tiger, you can create a new C-e c=,
3664    see the variables =org-icalendar-combined-name= and
3665    =org-combined-agenda-icalendar-file=).  Then set Org-mode to overwrite
3666    the corresponding file /~/Library/Calendars/OrgMode.ics/.  You may even
3667    use AppleScript to make iCal re-read the calendar files each time a new
3668    version of /OrgMode.ics/ is produced.  Here is the setup needed for
3669    this:
3671    : (setq org-combined-agenda-icalendar-file
3672    :     "~/Library/Calendars/OrgMode.ics")
3673    : (add-hook 'org-after-save-iCalendar-file-hook
3674    :  (lambda ()
3675    :   (shell-command
3676    :    "osascript -e 'tell application \"iCal\" to reload calendars'")))
3678 ** How can I get Mac OSX 10.4 or later iCal to import my Org-exported .ics files?
3679    :PROPERTIES:
3680    :CUSTOM_ID: iCal-import-ics-files-new
3681    :END:
3683 #+index:  iCal!Mac OSX 10.4
3685    For Mac OS X 10.4, you need to write the ics file to
3686    =/Library/WebServer/Documents/= and then subscribe iCalendar to =http:
3687    //localhost/orgmode.ics=
3689 ** How can I remove timestamps and todo keywords from my exported file?
3690    :PROPERTIES:
3691    :CUSTOM_ID: export-options-remove-timestamps
3692    :END:
3694 #+index: Export!Timestamps
3695 #+index: Export!Todo keywords
3697 You can place an options line at the top of your org file:
3699 : #+OPTIONS: <:nil todo:nil
3701 There is a whole host of export options you can set with an in-buffer
3702 options or via global variables. See [[https://orgmode.org/manual/Export-settings.html#Export-settings][this section]] of the manual for a
3703 full list.
3705 ** How can I preserve faces when I export an agenda from the command line?
3706    :PROPERTIES:
3707    :CUSTOM_ID: preserving-faces-during-batch-export
3708    :END:
3710 #+index: Export!Agenda
3711 #+index: Export!Faces
3713 Normally, when you export an org file or an agenda view from within
3714 emacs, htmlize will convert your face definitions to direct color css
3715 styles inlined into each =<span>= object, resulting in an HTML output
3716 that preserves the general look of your Org buffers and agenda views.
3718 Let's say you generate an export from the command line, such as the
3719 following:
3721 : emacs -batch -l ~/.emacs -eval '(org-batch-agenda "e")'
3725 : emacs -batch -l ~/.emacs -eval '(org-publish-all)'
3727 In such an instance, the exported HTML will contain only very basic
3728 color styles. The reason is that when Emacs is run in batch mode, it
3729 does not have a display and therefore only rudimentary face
3730 definitions.  If you'd like to use more complex styles, you'll have to
3731 make sure that the export process only assigns classes instead of
3732 direct color values.  This can be done by binding the variable
3733 =org-export-htmlize-output-style= to =css= for the duration of the
3734 export, for example with
3736 : emacs -batch -l ~/.emacs
3737 :   -eval '(let ((org-export-htmlize-generate-css (quote css)))
3738 :            (org-batch-agenda "e"))'
3740 Then you can use a style file to make these classes look any way you
3741 like.  To generate face definitions for a CSS file based on any faces
3742 you are currently using in Emacs, you can use the following command:
3744 : M-x org-export-htmlize-generate-css RET
3746 This will generate a =<style>...</style>= section, the content of
3747 which you can add to your style file.
3749 ** How can I avoid dark color background when exporting agenda to ps format?
3750    :PROPERTIES:
3751    :CUSTOM_ID: avoiding-dark-background-when-exporting-agenda
3752    :END:
3754 #+index: Export!.ps
3756 Add this to your .emacs and evaluate it.
3758 #+BEGIN_SRC emacs-lisp
3759   (setq org-agenda-exporter-settings
3760         '((ps-print-color-p 'black-white)))
3761 #+END_SRC
3763 ** How can I include e.g. an abstract in export to Latex and HTML?
3764    :PROPERTIES:
3765    :CUSTOM_ID: include-abstract-in-export-to-latex-and-html
3766    :END:
3768 #+index: Export!Abstract
3770 Org does not currently have special markup for abstracts, but for
3771 export purposes, you can extend the block-level structural and
3772 semantic markup in Org with the contributed package [[file:org-contrib/org-special-blocks.org][org-special-blocks]]
3773 (by Chris Gray). To turn it on, put this in your =.emacs=:
3775 : (require 'org-special-blocks)
3777 Now, you can mark up the abstract of your article like this:
3779 : #+BEGIN_ABSTRACT
3780 : Falling apples were observed and compared with pears. Newton's laws
3781 : were confirmed at the 95% confidence level.
3782 : #+END_ABSTRACT
3784 Exporting to Latex wraps this in a
3785 =\begin{abstract}....\end{abstract}= environment, which just works.
3787 HTML export wraps it in a ~<div class="abstract">...</div>~
3788 element. The HTML result won't look like anything special until you
3789 style it. Here is some sample CSS to get you started; put these in
3790 your document header:
3792 : #+STYLE: <style>.abstract {margin: 1em; padding: 1em; border: 1px solid black}
3793 : #+STYLE: .abstract:before {content: "Abstract: "; font-weight: bold}</style>
3795 Generally, =#+begin_foo= will work for any simple Latex =foo=
3796 environment not supported by existing Org markup.
3798 If you need to pass parameters, process the block content in some way,
3799 or support other exporters, you may want to consider whether you can
3800 customize it using Eric Schulte's [[file:org-contrib/org-exp-blocks.org][org-exp-blocks]] instead.
3802 ** How can I get colored source code when exporting to LaTeX?
3803    :PROPERTIES:
3804    :CUSTOM_ID: fontified_source_code_w_latex
3805    :END:
3807 #+index: Export!LaTeX
3809 As of Sun Aug 9 2009 the "current" version of Org-mode (see
3810 [[#keeping-current-with-Org-mode-development]]) supports exporting source
3811 code to LaTeX using the listings package.
3813 To turn on listing export add the following to your Org-mode
3814 customization.
3815 #+begin_src emacs-lisp
3816   ;; requite org-latex so that the following variables are defined
3817   (require 'ox-latex)
3819   ;; tell org to use listings
3820   (setq org-latex-listings t)
3822   ;; you must include the listings package
3823   (add-to-list 'org-latex-packages-alist '("" "listings"))
3825   ;; if you want colored source code then you need to include the color package
3826   (add-to-list 'org-latex-packages-alist '("" "color"))
3827 #+end_src
3829 The listings package will now be used to fontify source code in your
3830 LaTeX documents.  By default listings will not color any of your
3831 source code.  If you would like to set colors for keywords and
3832 comments in your latex documents you can do so using LaTeX directives
3833 like the following.
3834 #+begin_src latex
3835   \lstset{keywordstyle=\color{blue},
3836     commentstyle=\color{red},
3837     stringstyle=\color{green}
3838   }
3839 #+end_src
3841 of if you want to get even fancier with your colors you can try
3842 something like the following
3843 #+begin_src latex
3844 \definecolor{keywords}{RGB}{255,0,90}
3845 \definecolor{comments}{RGB}{60,179,113}
3846 \definecolor{fore}{RGB}{249,242,215}
3847 \definecolor{back}{RGB}{51,51,51}
3848 \lstset{
3849   basicstyle=\color{fore},
3850   keywordstyle=\color{keywords},
3851   commentstyle=\color{comments},
3852   backgroundcolor=\color{back}
3854 #+end_src
3856 For more complex listings use cases consult the [[ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/listings/listings.pdf][listings manual]].
3858 ** How can I export to Latex Beamer?
3859    :PROPERTIES:
3860    :CUSTOM_ID: beamer
3861    :END:
3863 #+index: Export!Beamer
3865 The latex [[http://latex-beamer.sourceforge.net/][Beamer Class]] is a useful class for generating slide shows.
3866 The following can be used to export Org-mode documents to LaTeX
3867 beamer.
3869 Add the following to your Emacs initialization file.
3870 #+begin_src emacs-lisp
3871   (unless (boundp 'org-latex-classes)
3872     (setq org-latex-classes nil))
3873   (add-to-list 'org-latex-classes
3874                '("beamer"
3875                  "\\documentclass[11pt]{beamer}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{hyperref}\n\\usepackage{verbatim}\n"
3876                  ("\\section{%s}" . "\\section*{%s}")
3877                  ("\\begin{frame}\\frametitle{%s}" "\\end{frame}"
3878                   "\\begin{frame}\\frametitle{%s}" "\\end{frame}")))
3879 #+end_src
3881 Then by placing
3882 : #+LaTeX_CLASS: beamer
3883 in the header of your Org-mode document it will automatically export
3884 to the Beamer document class on LaTeX export.  With the above
3885 configuration top-level headers will be mapped to sections in the
3886 Beamer document, second-level headers will be mapped to frames, and
3887 lower level headlines will be mapped to itemize objects.
3889 This above is adapted from an [[http://article.gmane.org/gmane.emacs.orgmode/15077/match=beamer+dokos][email by Nick Dokos]], and an [[http://article.gmane.org/gmane.emacs.orgmode/17767/match=beamer+dokos][email by
3890 Thomas Dye]].  For a much more complex Beamer setup see the [[http://article.gmane.org/gmane.emacs.orgmode/17767/match=beamer+dokos][email by
3891 Thomas Dye]].
3893 ** How can I use RefTeX in Org-mode files for LaTeX export and in Org-babel LaTeX code blocks?
3894    :PROPERTIES:
3895    :CUSTOM_ID: using-reftex-in-org-mode
3896    :END:
3898 #+index: RefTeX
3899 #+index: Babel
3900 #+index: Code blocks
3902 [[http://www.gnu.org/software/auctex/reftex.html][RefTeX]] is an indispensable tool for the author of LaTeX documents.  It
3903 aids in creation of bibliographies, cross-references, indexes, and
3904 glossaries.  RefTeX understands the structure of multi-file LaTeX
3905 documents and is able to collect from them information about the
3906 location(s) of external data stores used in creation of the final
3907 document.  RefTeX was written by Carsten Dominik and is currently
3908 being maintained by the [[http://www.gnu.org/software/auctex/index.html][AucTeX]] project.
3910 *** Using RefTeX In Org-mode Files for LaTeX Export
3911 In Org-mode files for LaTeX export, the trick is to find a way to tell
3912 RefTeX the locations of external data stores.  One way is to set the
3913 variable, =reftex-default-bibliography=.  Add lines like these to
3914 .emacs:
3916 #+begin_src emacs-lisp
3917   (setq reftex-default-bibliography
3918         (quote
3919          ("default.bib" "other-default.bib")))
3920 #+end_src
3922 In practice, this is a limited solution and the
3923 typical user will want to pass this information on a per-file basis.
3924 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
3925 Braindump]].
3927 The first solution, proposed by Mario, enables the RefTeX citation
3928 function in Org-mode.  Add these lines to .emacs:
3930 #+begin_src emacs-lisp
3931   (defun org-mode-reftex-setup ()
3932     (load-library "reftex")
3933     (and (buffer-file-name)
3934          (file-exists-p (buffer-file-name))
3935          (reftex-parse-all))
3936     (define-key org-mode-map (kbd "C-c )") 'reftex-citation))
3937   (add-hook 'org-mode-hook 'org-mode-reftex-setup)
3938 #+end_src
3940 Then add the following lines anywhere in the Org-mode file (Org-mode
3941 will recognize them as LaTeX commands):
3943 #+begin_src org
3944 \bibliographystyle{plain}
3945 \bibliography{BIB-NAME}
3946 #+end_src
3948 With this setup, =C-c )= will invoke =reftex-citation= which will
3949 insert a reference in the usual way:
3951 #+begin_src org
3952 ,* test reftex
3954 This is a citation \cite{tierney90}.
3956 \bibliographystyle{plain}
3957 \bibliography{tsd}
3958 #+end_src
3960 This Org-mode file will export the following LaTeX output:
3962 #+begin_src latex :exports code
3963   % Created 2010-03-22 Mon 14:34
3964   \documentclass[11pt,letter]{article}
3965   \usepackage[utf8]{inputenc}
3966   \usepackage[T1]{fontenc}
3967   \usepackage{hyperref}
3969   \title{test.org}
3970   \author{Tom Dye}
3971   \date{2010-03-22 Mon}
3973   \begin{document}
3975   \maketitle
3977   \setcounter{tocdepth}{3}
3978   \tableofcontents
3979   \vspace*{1cm}
3981   \section{test reftex}
3982   \label{sec-1}
3985   This is a citation \cite{tierney90}.
3987   \bibliographystyle{plain}
3988   \bibliography{tsd}
3990   \end{document}
3991 #+end_src
3994 A second solution, to activate the RefTeX minor mode on a per-file
3995 basis, was posted by Kevin Brubeck Unhammer in response to this idea.
3996 Add the following lines to .emacs:
3998 #+begin_src emacs-lisp
3999   (add-hook ‘org-mode-hook
4000              (lambda ()
4001                (if (member “WRITE” org-todo-keywords-1)
4002                    (org-mode-article-modes))))
4003 #+end_src
4005 where =org-mode-article-modes= is defined as follows:
4007 #+begin_src emacs-lisp
4008   (defun org-mode-article-modes ()
4009     (reftex-mode t)
4010     (bib-cite-minor-mode t)
4011     (and (buffer-file-name)
4012          (file-exists-p (buffer-file-name))
4013          (reftex-parse-all)))
4014 #+end_src
4016 Add the =\bibliographystyle{}= and =\bibliography{}= lines to the
4017 Org-mode file as before and define a TODO keyword, =WRITE=, perhaps
4018 like this:
4020 #+begin_src org
4021 ,#+TODO: TODO(t) STARTED(s) WRITE | DONE(d) DEFERRED(f)
4022 #+end_src
4024 With this setup, you insert a citation with =M-x reftex-citation RET=.
4026 *** Using RefTeX in Org-babel LaTeX Code Blocks
4028 In Org-babel LaTeX code blocks, the trick is to give RefTeX access to
4029 information in other Org-babel LaTeX code blocks.  If you use an Emacs
4030 starter kit where configuration information is held in Org-mode files,
4031 then the second solution is preferable because you won't be asked for
4032 a master file when Emacs is started.  For this reason, the second
4033 solution is modified for use with Org-babel latex code blocks.  No
4034 key-binding is needed here because Org-babel code blocks are edited
4035 within the usual AucTeX environment.
4037 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]])
4038 #+begin_src emacs-lisp
4039   (defun org-mode-article-modes ()
4040     (reftex-mode t)
4041     (and (buffer-file-name)
4042          (file-exists-p (buffer-file-name))
4043          (reftex-parse-all)))
4045   (add-hook 'org-mode-hook
4046             (lambda ()
4047               (if (member "REFTEX" org-todo-keywords-1)
4048                   (org-mode-article-modes))))
4049 #+end_src
4051 Then add a line like the following line to the top of your org-mode file:
4053 #+begin_src org
4054 ,#+TODO: TODO(t) STARTED(s) | DONE(d) DEFERRED(f) REFTEX
4055 #+end_src
4057 When you open an org-mode file with a line like this, RefTeX will
4058 prompt for the master .tex file, which will be parsed in the usual
4059 way.  This means that the .tex file should already exist, perhaps by
4060 tangling the LaTeX preamble and postamble, before
4061 =org-mode-article-modes= is activated for the Org-mode file.
4063 ** How can I use XeLaTeX for LaTeX export instead of pdfLaTeX?
4064    :PROPERTIES:
4065    :CUSTOM_ID: using-xelatex-for-pdf-export
4066    :END:
4068 #+index: XeLaTeX
4069 #+index: pdfLaTeX
4071 [[https://en.wikipedia.org/wiki/XeTeX][XeLaTeX]] is an alternative to pdfLaTeX for typesetting LaTeX
4072 documents.  XeTeX can use any fonts installed in the operating system
4073 without configuring TeX font metrics, and can make direct use of advanced
4074 typographic features of OpenType and other font formats.  By default,
4075 org-mode exports =org= files to =pdf= via pdfLaTeX.
4077 Here is one way to smoothly incorporate XeLaTeX into org-mode's export
4078 process.  This solution takes advantage of [[http://www.phys.psu.edu/~collins/software/latexmk-jcc][latexmk]], a perl script that
4079 intelligently and automatically manages latex compilation.  It is included
4080 with TeXLive, but at present the version included is not quite up-to-date
4081 enough for our needs.  Version 4.20 and higher includes an option allowing
4082 you to specify which program to use when "pdflatex" is called.  Install a
4083 current version of latexmk as per the instructions on the [[http://www.phys.psu.edu/~collins/software/latexmk-jcc][latexmk]] site.  If
4084 necessary, disable the older version that comes with TeXLive.  This is
4085 likely in =/usr/texbin/=, and you should rename or remove it.  Then you can
4086 put the following in your =~/.emacs.d/= or equivalent:
4088 #+begin_src emacs-lisp
4089   (require 'ox-latex)
4090   (setq org-latex-listings t)
4092   ;; Originally taken from Bruno Tavernier: http://thread.gmane.org/gmane.emacs.orgmode/31150/focus=31432
4093   ;; but adapted to use latexmk 4.20 or higher.
4094   (defun my-auto-tex-cmd ()
4095     "When exporting from .org with latex, automatically run latex,
4096        pdflatex, or xelatex as appropriate, using latexmk."
4097     (let ((texcmd)))
4098     ;; default command: oldstyle latex via dvi
4099     (setq texcmd "latexmk -dvi -pdfps -quiet %f")
4100     ;; pdflatex -> .pdf
4101     (if (string-match "LATEX_CMD: pdflatex" (buffer-string))
4102         (setq texcmd "latexmk -pdf -quiet %f"))
4103     ;; xelatex -> .pdf
4104     (if (string-match "LATEX_CMD: xelatex" (buffer-string))
4105         (setq texcmd "latexmk -pdflatex=xelatex -pdf -quiet %f"))
4106     ;; LaTeX compilation command
4107     (setq org-latex-to-pdf-process (list texcmd)))
4109   (add-hook 'org-export-latex-after-initial-vars-hook 'my-auto-tex-cmd)
4112   ;; Specify default packages to be included in every tex file, whether pdflatex or xelatex
4113   (setq org-latex-packages-alist
4114         '(("" "graphicx" t)
4115               ("" "longtable" nil)
4116               ("" "float" nil)))
4118   (defun my-auto-tex-parameters ()
4119         "Automatically select the tex packages to include."
4120         ;; default packages for ordinary latex or pdflatex export
4121         (setq org-latex-default-packages-alist
4122               '(("AUTO" "inputenc" t)
4123                 ("T1"   "fontenc"   t)
4124                 (""     "fixltx2e"  nil)
4125                 (""     "wrapfig"   nil)
4126                 (""     "soul"      t)
4127                 (""     "textcomp"  t)
4128                 (""     "marvosym"  t)
4129                 (""     "wasysym"   t)
4130                 (""     "latexsym"  t)
4131                 (""     "amssymb"   t)
4132                 (""     "hyperref"  nil)))
4134         ;; Packages to include when xelatex is used
4135         (if (string-match "LATEX_CMD: xelatex" (buffer-string))
4136             (setq org-latex-default-packages-alist
4137                   '(("" "fontspec" t)
4138                     ("" "xunicode" t)
4139                     ("" "url" t)
4140                     ("" "rotating" t)
4141                     ("american" "babel" t)
4142                     ("babel" "csquotes" t)
4143                     ("" "soul" t)
4144                     ("xetex" "hyperref" nil)
4145                     )))
4147         (if (string-match "LATEX_CMD: xelatex" (buffer-string))
4148             (setq org-latex-classes
4149                   (cons '("article"
4150                           "\\documentclass[11pt,article,oneside]{memoir}"
4151                           ("\\section{%s}" . "\\section*{%s}")
4152                           ("\\subsection{%s}" . "\\subsection*{%s}")
4153                           ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
4154                           ("\\paragraph{%s}" . "\\paragraph*{%s}")
4155                           ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
4156                         org-latex-classes))))
4158   (add-hook 'org-export-latex-after-initial-vars-hook 'my-auto-tex-parameters)
4159 #+end_src
4161 The =my-auto-tex-cmd= function looks at your =.org= file and checks whether
4162 you've specified which latex to use. If there are no instructions, it just
4163 runs regular old latex. If it finds the string =LATEX_CMD: pdflatex= in
4164 your file, it runs pdflatex. If it finds =LATEX_CMD: xelatex=, it runs
4165 xelatex. Because control is handed off to latexmk, nothing else is needed:
4166 it takes care of figuring things out so that the references and citations
4167 are correct.
4169 The second half of the code above specifies the latex packages that will be
4170 included in the =.tex= file. The variable =org-latex-packages-alist=
4171 specifies a list of packages that are always included in the header of
4172 latex documents, regardless of how they are compiled. The variable
4173 =org-latex-default-packages-alist= adds additional packages
4174 depending on whether latex/pdflatex or xelatex is being used. You can
4175 change the content of these as needed.
4177 Finally, the =org-latex-classes= variable redefines elements of the
4178 =.tex= file's preamble for the xelatex case. These can also be customized
4179 as needed.
4181 By way of example, an =.org= file you want compiled with xelatex might
4182 contain the following header:
4184 : #+TITLE: My Paper
4185 : #+AUTHOR: Jane Doe
4186 : #+DATE:
4187 : #+OPTIONS: toc:nil num:nil
4188 : #+LATEX_CMD: xelatex
4189 : #+LATEX_HEADER: \setsansfont[Mapping=tex-text]{Unit-Bold}
4190 : #+LATEX_HEADER: \setmonofont[Mapping=tex-text,Scale=MatchLowercase]{PragmataPro}
4191 : #+LATEX_HEADER: \setromanfont[Mapping=tex-text,Numbers=OldStyle]{Minion Pro}
4193 If you always want to have the same font setup in your xelatex documents,
4194 the =fontspec= commands setting the font choices can be put in the
4195 =org-latex-classes= setting instead.
4197 The upshot is that when you want to export an =.org= file using XeLaTeX,
4198 you can now simply make sure the line =LATEX_CMD: xelatex= is in your
4199 =.org= file, then do =C-c C-e d= as usual, and org-mode, with latexmk in
4200 the background, does the rest for you.
4202 ** Why is my exported PDF file almost unreadable?
4203    :PROPERTIES:
4204    :CUSTOM_ID: unreadable-pdfs
4205    :END:
4207 Some PDF viewers (earlier versions (< v6) of Acrobat Reader, Evince,
4208 possibly others) do not get along with Adobe Type3 fonts, producing almost
4209 unreadable screen output (printed output is OK). If you see this, first
4210 verify the fonts that your document uses: open it with Acrobat Reader or
4211 Evince, select "Properties" from the "File" menu and click on the "Fonts"
4212 tab; alternatively, you can use the pdffonts program (part of the
4213 xpdf-reader package) from the command line.  If that is indeed the problem,
4214 then either use a different viewer or install Type1 versions of the
4215 problematic fonts. For more details, see the "PDF export" section of
4216 [[./org-dependencies.org][org-dependencies]].
4218 ** Can I add attributes to a link or an image in HTML export?
4219    :PROPERTIES:
4220    :CUSTOM_ID: html-image-and-link-attributes
4221    :END:
4223 #+index: Export!Link
4224 #+index: Export!Image
4225 #+index: Link!Attributes
4226 #+index: Image!Attributes
4228 Yes.  Excerpt from [[https://orgmode.org/manual/Images-in-HTML-export.html#Images-in-HTML-export][Org's manual]]:
4230 If you need to add attributes to an inlined image, use a `#+ATTR_HTML'.
4231 In the example below we specify the `alt' and `title' attributes to
4232 support text viewers and accessibility, and align it to the right.
4234 :  #+CAPTION: A black cat stalking a spider
4235 :  #+ATTR_HTML: :alt cat/spider image :title Action! :align right
4236 :  [[./img/a.jpg]]
4238 and you could use `http' addresses just as well.
4240 ** How can I export an org file to rtf, odt (Open Office), or doc (Word)?
4241    :PROPERTIES:
4242    :CUSTOM_ID: convert-to-open-office
4243    :END:
4245 #+index: Export!rtf
4246 #+index: Export!odt
4247 #+index: Export!doc
4249 Orgmode exports natively to =OpenDocument= format using =org-odt= module.
4251 The key bindings for export are =C-c C-e o= and =C-c C-e O=.
4253 If you don't see =OpenDocumentText= as an option under =C-c C-e= you need
4254 to upgrade to =Org-mode 7.6= by one of the following means:
4256 1. Install org-7.6 using a distribution .zip or .tar.gz file, or
4257    through Git. Then do the following:
4258    1. Add =contrib/lisp= to the load-path in your =.emacs=
4259      #+begin_src emacs-lisp
4260        ;; modify org-root-dir as needed
4261        (add-to-list 'load-path "org-root-dir/contrib/lisp")
4262     #+end_src
4263    2. Do =M-x customize-variable RET org-modules RET= and enable the
4264       =odt= option
4266 2. Upgrade to (atleast) the =Emacs-24.1 pretest= version. Install
4267    =org-odt= package using =M-x list-packages=.
4269 #+begin_comment
4271 - Use existing exporters
4273   Export to one of org-mode's supported export formats and then use an
4274   external tool or method to convert the exported file to doc or odt.
4276   With simple documents, these methods work well. However for complex
4277   documents containing footnotes, embedded images, math formuale etc
4278   the results may be less than satisfactory. (Note, the lists below
4279   are by no means comprehensive).
4280   1. html -> odt/doc/rtf
4281      - open html in Open Office and save as odt/doc ([[http://permalink.gmane.org/gmane.emacs.orgmode/31482][see this post by
4282         Eric Fraga]])
4283      - [[http://www.artofsolving.com/opensource/pyodconverter][PyODConverter]]
4284      - [[http://johnmacfarlane.net/pandoc/][Pandoc]] (this works for LaTeX and docbook as well)
4285      - (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
4286         from html to doc
4287   2. LaTeX -> odt/doc/rtf
4288       - [[http://latex2rtf.sourceforge.net/][LaTeX2rtf]] (works well with index, footnotes, and references)
4289       - [[http://www.tug.org/tex4ht/][TeX4ht]] (works with more complex latex elements, though can be
4290         difficult to install)
4291         - run =mk4ht oolatex file.tex=
4293 See [[http://permalink.gmane.org/gmane.emacs.orgmode/31168][this thread]] for further details.
4294 #+end_comment
4296 ** ODT export aborts on my Windows machine as I don't have zip installed.  Where can I find a zip utility?
4298 #+index: Zip
4300 You can either use [[https://en.wikipedia.org/wiki/Info-ZIP][Info-ZIP]] or zip package from Cygwin. Please customize
4301 =exec-path= to include the installation directory.
4303 ** I cannot open an exported =*.odt= file in LibreOffice because it is corrupt.  What do I do?
4304    :PROPERTIES:
4305    :CUSTOM_ID: debugging-org-odt
4306    :END:
4308 #+index: Export!odt
4310 Typically the corruption of =odt= file happens when the XML emitted by
4311 Org is not well-formed according to =OpenDocument schema=.
4313 If you encounter corruption issues please identify the root cause
4314 using one of the methods described below:
4316 - Use an Online validator
4317   - Pass the exported document through the [[http://tools.services.openoffice.org/odfvalidator/][ODF Validator]] and note down
4318     the errors.
4320 - Use Emacs' in-built validator
4321   1. Switch to =*.odt= buffer =(C-x b whatever.odt)=
4322   2. Open the =content.xml= file - =(Hit RET on content.xml)=
4323   3. Do a =C-u C-c C-n= - =(M-x rng-first-error)=
4324   4. Note the error message, the XML markup at the point of error and
4325      the surrounding context.
4327 Once you have identified the error
4328 1. Create a minimal org file that reproduces the error.
4329 2. Post a bug-report to =emacs-orgmode@gnu.org=.
4331 ** How can I specify ODT export styles?
4333 #+index: Export!odt style
4335 Check the variable =org-export-odt-styles-file=.  Here is its docstring,
4336 as of Org version 7.8:
4338 : org-export-odt-styles-file is a variable defined in `org-odt.el'.
4339 : Its value is nil
4341 : Documentation:
4342 : Default styles file for use with ODT export.
4343 : Valid values are one of:
4344 : 1. nil
4345 : 2. path to a styles.xml file
4346 : 3. path to a *.odt or a *.ott file
4347 : 4. list of the form (ODT-OR-OTT-FILE (FILE-MEMBER-1 FILE-MEMBER-2
4348 : ...))
4350 : [snip]
4352 : Use "#+ODT_STYLES_FILE: ..." directive to set this variable on
4353 : a per-file basis.  For example,
4355 : #+ODT_STYLES_FILE: "/path/to/styles.xml" or
4356 : #+ODT_STYLES_FILE: ("/path/to/file.ott" ("styles.xml" "image/hdr.png")).
4358 : You can customize this variable.
4360 ** Can I omit the title in the LaTeX export?
4362 Yes: simply use a blank #+TITLE in your Org file.
4364 ** How can I use arbitrary colors for words/sentences in HTML export?
4366 Add the following to your Emacs config,
4368 #+BEGIN_SRC emacs-lisp
4369     ;; -*- emacs-lisp -*-
4370     (org-add-link-type
4371      "color"
4372      (lambda (path)
4373        (message (concat "color "
4374                         (progn (add-text-properties
4375                                 0 (length path)
4376                                 (list 'face `((t (:foreground ,path))))
4377                                 path) path))))
4378      (lambda (path desc format)
4379        (cond
4380         ((eq format 'html)
4381          (format "<span style=\"color:%s;\">%s</span>" path desc))
4382         ((eq format 'latex)
4383          (format "{\\color{%s}%s}" path desc)))))
4384 #+END_SRC
4386 and then you can use
4388 : [[color:red][red]]
4390 for colored export.
4392 This question has been raised [[http://thread.gmane.org/gmane.emacs.orgmode/59130][on the mailing list]] by Jos'h Fuller and
4393 answered by Eric Schulte.
4396 ** How can I suppress the page number in the footer of an exported PDF?
4397 #+index: Export!pdf
4398 #+index: pdfLaTeX
4400 Use the following directive in your Org file:
4402 : #+LATEX: \thispagestyle{empty}
4404 * Backup
4406 #+index: Backup
4408 Since =org= files are so central to your life, you probably want to back
4409 them up in a safe place.
4411 If the =org= file you want to back up are in a single directory, the
4412 preferred method is to us a =RCS= (Revision Control System) -- pick up your
4413 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
4414 RCS you use and how you use it, you can have a /local/ backup or sync it on
4415 a remote place.
4417 If you want to store all your =org= files from your =$HOME= to a single
4418 =~/org/backup/= folder, you can use this shell script (as [[http://article.gmane.org/gmane.emacs.orgmode/37655][suggested by
4419 Suvayu Ali]]):
4421 #+begin_src sh
4422 mkdir -p ~/org/backup && \
4423 find $HOME -type f -name '*\.org' ! -path "$HOME/org/backup/*" \
4424      -exec cp -t ~/org/backup/ \{\} \;
4425 #+end_src
4427 It will recursively search for =org= files in your =$HOME= directory
4428 (except those in =~/org/backup/=) and copy them to =~/org/backup/=.
4429 You can then use rsync to make sure =~/org/backup/= also lives on a
4430 remote and safe place.
4432 * MobileOrg
4434 #+index: MobileOrg
4436 ** Which versions of MobileOrg are available?
4437    :PROPERTIES:
4438    :CUSTOM_ID: mobileorg_versions
4439    :END:
4441 MobileOrg is available for Apple's iOS, and for Google's Android.
4443 - MobileOrg for *iOS*, created by Richard Moreland.  Check out [[https://mobileorg.github.io][the project's page]].
4444 - MobileOrg for *Android*, by Matt Jones.  See [[http://wiki.github.com/matburt/mobileorg-android/][his project page]].
4446 ** Can I use the same files on my mobile device as on my computer?
4448 Absolutely!  Both apps currently offer the same options for
4449 synchronization of =.org= files with a computer-based installation of
4450 Org-mode:
4452 - via [[http://www.dropbox.com/][Dropbox.com]] (easier to set up, free accounts available)
4453 - via a [[https://en.wikipedia.org/wiki/WebDAV][WebDAV]] server of your choice (potentially more data privacy)
4455 ** How does synchronization via WebDAV work?
4456    :PROPERTIES:
4457    :CUSTOM_ID: mobileorg_webdav
4458    :END:
4460 You need to create a dedicated directory on the WebDAV server for the
4461 communication between Emacs and MobileOrg.
4463 #+begin_src ditaa :file images/orgmobile/tramp-webdav.png :cmdline -r
4464   +----------------------+           +----------------------+
4465   | desktop              |           | WebDAV server        |
4466   +----------------------+           +----------------------+
4467   | emacs                |           | org-mobile-directory |
4468   |   + org-mode         |           | containing:          |
4469   |                      | scp (ssh) |                      |
4470   |   org-mobile-push ----------------->  *.org             |
4471   |   org-mobile-pull <-----------------                    |
4472   |                      | via tramp |       ^              |
4473   +----------------------+           +-------|--------------+
4474                                              |
4475                 +----------------------+     |
4476                 | mobile device        |     | WebDAV
4477                 +----------------------+     |
4478                 |                      |     |
4479                 |    MobileOrg     <---------+
4480                 |                      |
4481                 +----------------------+
4482 #+end_src
4484 #+RESULTS:
4485 [[file:images/orgmobile/org-mobile-tramp-webdav.png]]
4487 If you can mount that directory locally so that Emacs can directly
4488 write to it, just set the variable =org-mobile-directory= to point to
4489 that directory.  Alternatively, by using the [[http://www.gnu.org/software/tramp/][/TRAMP/]] method,
4490 =org-mobile-directory= may point to a remote directory accessible
4491 through, for example, /ssh/ and /scp/:
4493 #+begin_src emacs-lisp
4494 (setq org-mobile-directory "/scpc:user@remote.host:org/webdav/")
4495 #+end_src
4497   {{{BeginWarningBox}}} N.B. Since this configures /TRAMP/ to connect
4498   via /ssh/, you will need to use your /ssh/ password, not a WebDAV
4499   password.
4501   Also note that if you have configured ssh to use =ControlPersist=, due
4502   to [[http://article.gmane.org/gmane.emacs.tramp/7991][a bug with tramp and =ControlPersist=]] you may need to use =scpx=
4503   instead of =scp= as the /tramp/ transfer method.{{{EndWarningBox}}}
4505 ** Does Emacs have to use /TRAMP/ to access the remote directory?
4507 No, you can alternatively use a local directory for staging.  Other
4508 means must then be used to keep this directory in sync with the WebDAV
4509 directory.  In the following example, files are staged in =~/stage/=,
4510 and Org-mode hooks take care of moving files to and from the WebDAV
4511 directory using /scp/.
4513 #+begin_src emacs-lisp
4514 (setq org-mobile-directory "~/stage/")
4515 (add-hook 'org-mobile-post-push-hook
4516   (lambda () (shell-command "scp -r ~/stage/* user@wdhost:mobile/")))
4517 (add-hook 'org-mobile-pre-pull-hook
4518   (lambda () (shell-command "scp user@wdhost:mobile/mobileorg.org ~/stage/ ")))
4519 (add-hook 'org-mobile-post-pull-hook
4520   (lambda () (shell-command "scp ~/stage/mobileorg.org user@wdhost:mobile/")))
4521 #+end_src
4523 Alternatively you could write a simple script to synchronise from
4524 =~/stage/= to the remote directory via /rsync/.
4526 * Mathjax
4528 #+index: Mathjax
4530 ** How to install MathJax on my server?
4532 :PROPERTIES:
4533 :CUSTOM_ID: install_mathjax_on_server
4534 :END:
4536 Org uses MathJax as its default HTML display engine for equations.
4538 Org relies on the version of MathJax available from orgmode.org, but you
4539 might want to use another version and install MathJax on your own server.
4541 1. Download a [[http://sourceforge.net/projects/mathjax/files/][MathJax archive]].
4543 2. Upload it somewhere on your server (say http://me.org/mathjax/)
4545 3. Set the correct path in =org-export-html-mathjax-options= (i.e. replace
4546    https://orgmode.org/mathjax/MathJax.js by
4547    http://me.org/mathjax/MathJax.js)
4549 You can also get [[http://www.mathjax.org/resources/docs/?installation.html][MathJax from git or svn]] -- in this case, be careful not to
4550 forget to unzip the fonts.zip archive in the mathjax directory.
4552 * Tips and Tricks
4554 ** Can I create an Org link from a gmail email?
4556 #+index: Link!Gmail
4558 Yes.  See [[http://comments.gmane.org/gmane.emacs.orgmode/48056][this email]] from Torsten Wagner.
4560 Also check this comment by Tom:
4562 : Since any mail can be found under the All label by definition the
4563 : simplest solution is extracting the message id from the end of
4564 : the current url and then creating a new url pointing to All.
4565 : This URL should always work unless the mail is deleted:
4567 : https://mail.google.com/mail/?shva=1#all/<msgid>
4569 ** Problems with LaTeX macros with #+latex or #+begin_latex
4570   :PROPERTIES:
4571   :CUSTOM_ID: Problems-with-LaTeX-macros-with-#+latex-or-#+begin_latex
4572   :END:
4574 #+index: LaTeX!Macro
4576 Org's LaTeX exporter has a difficult job on its hands and even though it
4577 does a great job most of the time, there are times when it falls short. One
4578 situation that has arisen a few times in the past is when a macro
4579 definition or use includes an opening brace, but the corresponding closing
4580 brace is on a different line. That has caused LaTeX compilation problems or
4581 mysterious excisions of content - see for example the following two threads
4582 in the mailing list:
4584  - http://thread.gmane.org/gmane.emacs.orgmode/39308
4586  - http://thread.gmane.org/gmane.emacs.orgmode/42196
4588 In both cases, the exporter was getting confused by the opening brace which
4589 did not have a corresponding closing brace on the same line. Although the
4590 first of these cases is fixed in current Org, there might be more such
4591 cases or there might be a regression which causes the incorrect behavior
4592 again. While waiting for a fix, it's worth trying out the simple workaround
4593 of including a fake closing brace on the same line as the opening brace but
4594 *commenting it out* so that LaTeX never sees it.  That is often enough to
4595 make the exporter behave properly. In other words, to take one of the
4596 examples above, instead of writing
4598 : #+latex: \custommacro {
4599 : ...
4600 : #+latex: }
4602 use the following idiom instead:
4604 : #+latex: \custommacro { % hide the closing brace in a LaTeX comment }
4605 : ...
4606 : #+latex: }
4608 I emphasize that this is a workaround, not a fix: if you do run into such
4609 a case and the workaround fixes it, at least you can continue working, but
4610 please submit a bug report so that it can be fixed properly.
4612 ** Inserting a Mairix type link when calling Orgmode capture in VM
4614 #+index: lMairix
4616 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
4617 Adesam.
4619 ** Can I prevent ispell from checking source blocks?
4621 Yes, use this:
4623 #+BEGIN_SRC emacs-lisp
4624 (add-to-list 'ispell-skip-region-alist '("#\\+begin_src". "#\\+end_src"))
4625 #+END_SRC
4627 * Google Summer of Code (GSoC)
4628   :PROPERTIES:
4629   :CUSTOM_ID: GSoC
4630   :END:
4631 ** Does Org Mode participate in GNU's application for the GSoC 2012?
4632    :PROPERTIES:
4633    :CUSTOM_ID: GSoC-2012
4634    :END:
4636 #+index: GSoC 2012
4638 Org Mode will contribute project ideas to GNU's application as
4639 mentoring organisation in Google's Summer of Code 2012 (see Google's
4640 [[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
4641 information about the project itself, and how to participate as
4642 student or mentor.
4644 * COMMENT Function to create =CUSTOM_ID=
4646 #+begin_src emacs-lisp
4647   (defun org-faq-make-target ()
4648     "Make hard target for current headline."
4649     (interactive)
4650     (if (not (org-on-heading-p))
4651         (error "Not on a headline"))
4652     (let ((h (org-trim (org-get-heading 'no-tags))))
4653       (if (string-match "[ \t]*\\?\\'" h)
4654           (setq h (replace-match "" t t h)))
4655       (while (string-match "[ \t]+" h)
4656         (setq h (replace-match "-" t t h)))
4657       (org-entry-put nil "CUSTOM_ID" h)))
4658 #+end_src