1 #+TITLE: Org-mode Frequently Asked Questions
2 #+EMAIL: mdl AT imapmail DOT org
6 #+SETUPFILE: macros.setupfile
8 [[file:index.org][{Back to Worg's index}]]
10 * Latest questions on StackOverflow
12 #+index: StackOverflow
15 <script language="JavaScript" src="http://feed2js.org//feed2js.php?src=http%3A%2F%2Fstackoverflow.com%2Ffeeds%2Ftag%3Ftagnames%3Dorg-mode%26sort%3Dnewest&chan=title&num=5&utf=y" charset="UTF-8" type="text/javascript"></script>
18 <a href="http://feed2js.org//feed2js.php?src=http%3A%2F%2Fstackoverflow.com%2Ffeeds%2Ftag%3Ftagnames%3Dorg-mode%26sort%3Dnewest&chan=title&num=5&utf=y&html=y">View RSS feed</a>
24 :CUSTOM_ID: What-is-org-mode
26 ** Can Org-mode do "x"? Does org have "x" feature?
28 :CUSTOM_ID: can-org-do-x
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
41 - Read/search the manual.
43 - http://orgmode.org/manual/index.html
45 - Make sure to check out the following indexes:
47 - [[http://orgmode.org/manual/Main-Index.html#Main-Index][Main Index]]
48 - [[http://orgmode.org/manual/Key-Index.html#Key-Index][Key Index]]
49 - [[http://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
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
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
93 There are many other resources on Worg as well:
95 - [[http://orgmode.org/worg/org-configs/index.html][Org Customization]] :: Includes a guide for beginners.
97 - [[http://orgmode.org/worg/org-hacks.html][Org Hacks]] :: User-generated modifications and add-ons.
99 - [[http://orgmode.org/worg/org-glossary.html][Org Glossary]] :: An explanation of basic Org-mode terms and
102 ** Can I implement a GTD workflow with Org-mode?
104 :CUSTOM_ID: GTD-workflow-with-Org-mode
107 #+index: GTD!Workflow
109 Yes, you can. Check for discussions and pointers [[http://orgmode.org/worg/org-gtd-etc.html][here]].
111 ** What is the difference between Org and TaskPaper?
113 :CUSTOM_ID: Org-and-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?
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
147 - It will take forever to learn everything there is to know about a
150 - A unicorn is a fabulous creature. Org-mode wants to be a fabulous
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
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.
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: [[http://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/ [[http://orgmode.org/img/][here]].
179 - An [[http://orgmode.org/img/nrocinu4.jpg][alternative version]] from Christophe Bataillon (c):
181 - [[http://article.gmane.org/gmane.emacs.orgmode/14293][Chris Randle]] made a [[http://orgmode.org/img/nrocinu.txt][text version]] using the logo and [[http://glassgiant.com][glassgiant.com]]:
183 - [[http://article.gmane.org/gmane.emacs.orgmode/14362][Stefan Vollmar]] made a [[http://orgmode.org/img/nrocinu.pdf][pdf version]] (here in [[http://orgmode.org/img/nrocinu_pdf.png][png]]) using "a simple
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
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."
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},
214 note = {with contributions by David O'Toole, Bastien Guerry,
215 Philip Rooke, Dan Davison, Eric Schulte, and Thomas
218 (message "Thanks for quoting the Org manual!")))
221 Please check [[file:org-papers.org][the Org papers page]] for more references related to Org.
224 ** I think my Org-mode is broken! How do I report a bug?
226 :CUSTOM_ID: bug-reporting
231 1. Make sure you are running [[#updating-org][the latest version of Org-mode]].
233 2. Read [[http://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".
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?
262 :CUSTOM_ID: when-to-contact-mailing-list
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 [[http://orgmode.org/manual/index.html][manual]]
269 (and pay special attention to the indexes) before asking your
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?
279 :CUSTOM_ID: ml-post-delay
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?
289 :CUSTOM_ID: ml-subscription-and-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"
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.
308 :CUSTOM_ID: Keeping-current
310 ** Switching to the new export engine
312 :CUSTOM_ID: new-exporter-switch
318 *** Using the current master branch
320 As of [[http://orgmode.org/cgit.cgi/org-mode.git/commit/?id%3D1cac3127c2f810e83fcc1203f1dd2b15250a687e][commit 1cac3127c]], the master branch of Org's git repository uses the
321 new exporter by default. If you use the master branch, you need to update
324 If the instructions below do not help solving your problem, please ask any
325 question on the mailing list, it will help us moving forward with
326 documenting every thing for Org 8.0.
328 **** Updating global export configuration options
330 Global export options start with the =org-export-*= prefix, most of them
331 are in the =ox.el= file.
333 For options starting with e.g. =org-export-html-*=, see the section below.
335 For generic export options, most of them should not need any change. If
336 you find that a generic option is useless or broken or badly documented in
337 the manual, please report it to the list.
339 **** Updating backend-specific configuration options
341 Backend-specific options are defined like this:
343 - =org-html-*= for =HTML= and live in =ox-html.el=
344 - =org-latex-*= for =LaTeX= and live in =ox-latex.el=
347 There is a new variable =org-export-backends= which controls what backends
348 are loaded when you lauch Org. By default, the =ASCII=, =HTML= and =LaTeX=
349 are loaded, with some others.
351 *Updating*: In your =.emacs= you need to rename =org-export-html-*= options
352 to =org-html-*= (except for =ox-jsinfo.el= options), and do the same for
355 **** Updating =org-publish-project-alist=
357 The publishing functions are not loaded until the corresponding backend has
358 been loaded. You need to update =org-publish-project-alist= and to use the
359 function from the new publishing engine -- here is correspondance table:
361 | Old publishing engine | New publishing engine |
362 |--------------------------+----------------------------|
363 | org-publish-org-to-html | org-html-publish-to-html |
364 | org-publish-org-to-org | org-org-publish-to-org |
365 | org-publish-org-to-latex | org-latex-publish-to-latex |
368 If something does not work, please report it on the mailing list.
370 **** Other important changes
372 1. =#+style:= -> =#+html_style=:
374 2. =#+setupfile: myfile= -> =#+include: "myfile"=
376 Quotes are required and =#+include= works a little differently
377 than #+setupfile: by default, it makes sure that every headline in the
378 included file will be a child of the headline containing the include
379 keyword. You can overwrite this behaviour with =:minlevel= num
382 1. Attribute lines now take plists:
384 : #+attr_latex :width "5cm"
385 : #+attr_beamer :options "width=5cm"
387 2. Beamer backend now interprets nested headline levels as blocks instead
388 of lists. For some preliminary guidance you can look at [[http://orgmode.org/worg/org-tutorials/org-beamer/org-e-beamer.html][this page]].
390 *** Using Org 7.9.3e or earlier versions of Org
392 Some quick notes on how to switch to the new exporter.
394 1. If you had already been using the new exporter from contrib, you
395 should remove the following lines from your local.mk:
396 : ORG_ADD_CONTRIB = org-e-*
397 followed by a =make clean=, before you do =git pull=.
398 2. Export engine renamed: org-export → ox
399 3. Backend requires renamed: org-e-* → ox-*
400 4. All backend specific variables and functions renamed:
401 - org-export-* → org-* (e.g. org-html-xml-declaration, ..)
402 - org-e-* → org-* (e.g. org-latex-classes, org-ascii-bullets, ..)
403 5. Generic export variables retain the name org-export-*
404 (e.g. org-export-dispatch-use-expert-ui,
405 org-export-filter-headline-functions, ..)
406 6. org-latex-to-pdf-process has been renamed to org-latex-pdf-process
407 7. This is a guess, export snippets and backend symbols renamed:
408 - e-<backend> → <backend>
410 Please also read [[http://mid.gmane.org/876229nrxf.fsf@gmail.com][Nicolas' announcement]] about the merge.
412 ** My Emacs ships with an older version Org-mode! How do I upgrade?
414 :CUSTOM_ID: updating-org
419 Org-mode develops quickly, which means that versions of Org-mode
420 shipped with Emacs are more or less out-of-date. If you'd like to
421 upgrade to the most recent version of org-mode, you have a number of
424 1. Download the [[http://orgmode.org/index.html#sec-3][most recent release]] of org-mode as zip or tarball and
425 follow the [[http://orgmode.org/manual/Installation.html#Installation][installation instructions]] in the manual.
426 2. Clone and install the development git repository as [[#keeping-current-with-Org-mode-development][explained
427 here]]. If you don't want to run the bleeding edge, you can still
428 use git [[#using-stable-releases-only][to track the most recent stable releases]].
429 3. Install and updated org-mode automatically through the Emacs
430 Package Manager as [[#installing-via-elpa][explained in this FAQ]].
432 /Note/: Please also see [[#mixed-install][Is my Orgmode installation mixed?]] for a common
433 issue with mixed installations.
435 ** How do I keep current with bleeding edge development?
437 :CUSTOM_ID: keeping-current-with-Org-mode-development
440 #+index: Bleeding Edge
442 Org-mode is developed in [[http://en.wikipedia.org/wiki/Git_(software)][Git]]. You can keep up-to-date with Org-mode
443 developement by cloning the Org-mode repository and refreshing your
444 copy with latest changes whenever you wish. You only need to use
445 two Git commands (clone and pull.) Here are the steps in brief
446 (assuming a POSIX compatible shell and please customize locations
449 1. Select a location to house the Org-mode repository (approx. 40
450 MB; includes documentation, compiled elisp files and history
451 going all the way back to v4.12a)
453 : $ mkdir $HOME/elisp && cd $HOME/elisp
455 2. Clone the Org-mode Git repository.
457 Recommended approach:
459 : $ git clone git://orgmode.org/org-mode.git
461 You can also clone from this mirror (lagging one hour behind
464 : $ git clone git://repo.or.cz/org-mode.git
466 For those of you behind a firewall that allows only HTTP, you can
467 clone like this (can be somewhat slow), either from orgmode.org or
470 : $ git clone http://orgmode.org/org-mode.git
471 : $ git clone http://repo.or.cz/r/org-mode.git
473 3. Compile and install Org-mode and build documentation.
475 : $ cd $HOME/elisp/org-mode && make
477 Please note that you can choose to /not/ compile at all and run
478 using source =.el= files only (compiled files speed things up),
479 but you will still need to generate the autoload files.
481 : $ cd $HOME/elisp/org-mode && make uncompiled
483 If you'd like to install org-mode someplace outside the source
484 tree (private or system-wide), you should edit =local.mk= to
485 point to the appropriate install location. You may need
486 administrator rights to do a system-wide installation.
488 : $ cd $HOME/elisp/org-mode && make install
490 4. This is where you configure Org-mode with Emacs. Please refer
491 to [[./org-tutorials/index.org][Org tutorials]].
493 5. Keeping up-to-date.
495 Cloning the repository is a one time activity. From this point
496 onwards you only need to /pull/ the latest changes, which the
497 Makefile is set up to do automatically for certain make targets.
499 : $ cd $HOME/elisp/org-mode && make update
501 or if you immediately want to install as well
503 : $ cd $HOME/elisp/org-mode && make update2
505 Actually in this case it is recommended to run the test suite
506 before installation so that you don't install a version that
509 : $ cd $HOME/elisp/org-mode && make up2
511 6. You should reload Org-mode to have the changes take effect (if
512 you are not restarting Emacs, which is recommended). Also since
513 the intention is to "keep up" with Org-mode, you should visit
514 updated sections of documentation for latest updates (use =git
517 7. As you use your repository over time it will accumulate loose objects.
518 You can reduce the total size of your git repository with
522 which will consolidate loose git objects into pack files. This
523 reduces the size of the repository and speeds up data access to
526 ** How do I update the info manual pages to the latest org-mode version?
528 :CUSTOM_ID: update-info-manual-to-latest
531 *This is not a problem if org-mode is installed system-wide, which
532 automatically takes care of this issue!* Since org-mode already
533 ships with Emacs, a rather common problem among users is "How do I
534 update the info documentation to the latest version of org-mode?".
535 There are three ways to achieve this if for whatever reason you
536 can't install into the standard, system-wide info directory:
538 1. You can set the =INFOPATH= environment variable in your login
541 #+begin_src shell-script :eval no
543 export INFOPATH=/path/to/org-mode/info:$INFOPATH
547 =/path/to/org-mode/info= is wherever you install org-mode.
549 2. You can achieve the same with elisp like this:
551 #+begin_src emacs-lisp :eval no
553 (add-to-list 'Info-additional-directory-list
554 (expand-file-name "/path/to/org-mode/info"))
557 3. You should specify the same location in the Makefile while
558 installing org-mode like this:
560 #+begin_src makefile-gmake :eval no
561 # Where local software is found
562 prefix=/path/to/emacs-root
564 # Where info files go.
565 infodir = $(prefix)/share/info
568 ** How can I keep local changes and still track Org-mode development?
570 :CUSTOM_ID: keeping-local-changes-current-with-Org-mode-development
573 There is no need to do this anymore for the purpose of adapting the
574 build system to the local environment, since this can now be
575 specified in =local.mk=. However, there may be a need to make other
576 local changes to Org.
578 Say you want to make minor changes to the =org.el= or any other
579 version controlled file from Org and you want to keep these changes
580 on top of the =master= branch from Org. Create a local branch for
581 your changes on top of origin/master as follows:
583 : $ git checkout -b local origin/master
584 : $ git config branch.local.rebase true
585 : # Make your changes to the sources and create a new commit
586 : $ git commit -am 'My local changes to Org'
587 : # Update to a newer version
590 Now each time you pull new commits from the distribution repository
591 your local commits will be rewound and replayed on top of the new
592 origin/master. You would normally work on your =local= branch which
593 includes your custom commits; there's no need to switch back to the
596 If you get a conflict during a =git pull= (a change in Org and one
597 of your local changes try to alter the same line of code) you will
598 need to edit the file with the conflict to fix up the conflicting
599 lines and then tell git that you have resolved the conflict:
601 1. =git pull= fails with a conflict
602 2. edit the file: look for the conflict markers =>>>>>>>= and
603 =<<<<<<<= and either keep one version or create a new one and
604 remove all conflict markers while doing this.
605 3. =git add= the file to the index to mark the conflict resolved
606 4. =git rebase --continue=
607 5. lather, rinse, and repeat 2-4 as needed
609 Note that it is possible to have silent conflicts when a change in
610 Org and one of your local changes do not edit the same line of code,
611 but are logically incompatible — for example Org might have changed
612 to assume /roses are red/ while you've made a local change that
613 defines /my roses are yellow/ in some other place. Git will not
614 warn you about such conflicts (it doesn't understand what the code
617 At anytime during the rebase conflict resolution you can say "oops
618 this is all wrong - put it back the way it was before I did a pull"
620 : $ git rebase --abort
622 ** How can I use a stable release version instead of the bleeding edge master?
624 :CUSTOM_ID: using-stable-releases-only
627 The =master= branch of the git repository always contains the bleeding
628 edge development code. This is important for Org's fast development,
629 because code on master gets checked out by many people daily and we
630 quickly receive bug reports if something is wrong. On rare occasions,
631 this code may not function perfectly for a limited time while we are
632 trying to fix things. It is therefore recommended to keep a
633 known-good version of org-mode installed outside the source tree and
634 always run the full test suite before using a new version from master.
636 Not everyone like to use this bleeding-edge code and face the danger
637 to hit a surprising bug. The branch =maint= is specifically for
638 collecting only fixes for known bugs between releases. If you don't
639 want to wait for a new release, but don't want to live on the bleeding
640 edge, consider using =maint=.
642 From time to time, we make a release by merging all the new features
643 from =master= into =maint=. This typically happens when the
644 maintainers feel that
646 1. they have reached a good point in the development
647 2. the code has a feature set that should stay and be supported in the
650 Stable releases are used as the basis for [[http://orgmode.org/index.html#sec-3_3][alternative distributions]] of
651 Org, and they are also the code that gets merged into the Emacs
652 distribution. If you want to work only with stable releases, you can
653 always download [[http://orgmode.org/index.html#sec-3][them here]], but you can also also use the git
654 repository to keep automatically up-to-date with the most recent
655 stable releases (and save bandwidth!). Here's how to do so:
657 *** Run a specific stable release
659 In the repository, do
664 To see which release tags are available. Let's say you decide to use
667 : $ git checkout release_7.01f
669 This set the working tree of the repository to the state of Org at the
670 moment of release 7.01f. You can then run Org from the repository be
671 sure to use the stable release while development continues on the
674 Later, when we release 7.02, you can switch to that using
676 : $ git fetch --tags # to get all the new stuff
678 : $ git checkout release_7.02
680 *** Always run the most recent stable release
682 Alternatively, if you just want to always run whatever the latest
683 stable release is, you can do
685 : $ git checkout -b stable origin/maint
687 and then regularly update this branch by doing
691 ** How can I install an up-to-date version of org-mode without "make" tools?
693 :CUSTOM_ID: installing-org-without-make-tools
696 If you are using org-mode on a computer that lacks developer tools for
697 compiling software, such as [[http://www.gnu.org/software/make/][GNU Make]], you will have to use a
698 *different* installation method than [[http://orgmode.org/manual/Installation.html#Installation][the one outlined in the manual]].
699 Please see this description for [[http://orgmode.org/worg/org-hacks.html#compiling-org-without-make][compiling org-mode without make]] so you
700 can install a recent version of org-mode without using the full build
703 ** I don't use git. Can I download bleeding edge .zip and .tar.gz archives?
705 Yes. You can download [[http://orgmode.org/org-latest.zip][org-latest.zip]] or [[http://orgmode.org/org-latest.tar.gz][org-latest.tar.gz]] of Org-mode --
706 these archives are udpated every day at midnight.
708 Alternatively, you can download a [[http://orgmode.org/w/org-mode.git/snapshot][tar.gz snapshot from orgmode.org]].
710 ** How do I install Org-mode through Emacs' Package Manager?
712 :CUSTOM_ID: installing-via-elpa
715 Daily builds of Org-mode are distributed as an ELPA package from both
716 [[http://elpa.gnu.org/packages/][GNU Emacs Lisp Package Archive]] as well as from the [[http://orgmode.org/elpa/][Org-mode Emacs Lisp
719 Steps for installing Org with package manager:
720 1) Do =M-x list-packages= to browse available packages.
721 2) If the above command is unavailable you need to [[#installing-elpa][install the package
722 manager]] before proceeding ahead.
723 3) If you see =org= as an available package, skip to step 5.
724 4) If you are here it means that org is unavailable in the GNU's
725 archives. Report this discrepancy to [[mailto:emacs-orgmode@gnu.org][Orgmode mailing list.]]
727 In the meanwhile, you can manually download the tarball and
728 install it. Refer [[Installing%20from%20ELPA-tar][this FAQ entry]] for further information.
729 5) Press =i= to mark the package for installation
730 6) Press =x= to install
732 8) Use =M-x locate-library RET org=. If your installation is
733 successful you would something like the following:
735 =Library is file ~/.emacs.d/elpa/org-20110403/org.elc=
737 # 7) If you get the following error "*Failed to download `Org-mode'
738 # archive.*" in step 2, you can manually download the tarball and
739 # install it. Refer [[Installing from ELPA-tar][this FAQ entry]] for more information.
741 # 8) Add Orgmode as a package archive. This can be done in two ways:
742 # 9) Use =M-x customize-variable RET package-archives=
743 # 10) Add the following line to your =.emacs= and reload Emacs.
744 # #+begin_src emacs-lisp
745 # (add-to-list 'package-archives '("Org-mode" . "http://orgmode.org/elpa/"))
749 ** How do I install Emacs package manager?
751 :CUSTOM_ID: installing-elpa
754 If you are running Emacs 24 or find the command =M-x list-packages=
755 available you already have the package manager installed.
757 Steps for installing package manager on emacs-23:
758 1. Download the package manager [[http://repo.or.cz/w/emacs.git/blob_plain/1a0a666f941c99882093d7bd08ced15033bc3f0c:/lisp/emacs-lisp/package.el][package.el]]
760 2. Add the following to your =.emacs= and reload Emacs.
761 #+begin_src emacs-lisp
762 ;; change "~/elisp/" as appropiate
763 (setq load-path (cons "~/elisp" load-path))
765 ;; Add the below lines *at the beginning* of your .emacs.
770 ** I don't see Org-mode as an installation option in Package Manager Menu?
772 :CUSTOM_ID: why-no-org-in-elpa
775 Emacs Package Manager is a very recent addition to Emacs. Work is
776 under way to have have Org-mode seamlessly integrate with Emacs'
777 Package Manager. As a result, it will be some time before the
778 Org-mode packages are available and usable from either GNU or
779 Org-mode package archives.
781 In the meanwhile, you can install Org-mode via package manager
782 through ELPA-compatible tar. Refer [[Installing from ELPA-tar][this FAQ entry]] for more information.
784 ** How do I install Org-mode from a ELPA-compatible tarball?
786 :CUSTOM_ID: installing-from-elpa-tarball
788 # <<Installing from ELPA-tar>>
792 Org-mode is distributed as an ELPA-compatible tar which can be used
793 in conjunction with Emacs' package manager.
795 1. If you are already running Org-mode, note the current version
796 reported by M-x org-version.
797 2. Download the latest tarball from [[http://orgmode.org/elpa/][Org-mode repo]].
798 3. Do =M-x package-install-file=. When prompted for =Package file
799 name=, point it to .tar file downloaded in step 2.
801 You will now see Package Manager compiling the files and
803 4. Reload emacs. This step is very important.
804 5. Note the version of the new installation using M-x
805 org-version. If the new and old versions are different, the
806 installation is done and you are all set to enjoy the updated
807 Org-mode. Otherwise skip to step 6.
808 6. Review you load-path using =C-h v load-path=. Most likely that
809 your old installation path takes precedence over the path chosen
810 by package manager (which is typically
811 =~/.emacs.d/elpa/...=). Fix this anamoly by moving
812 =(package-initialize)= line in .emacs to a more appropriate
815 ** Why would I use ELPA tarballs instead of the snapshot tarballs?
822 ELPA-tarballs automate much the process of upgrading org-mode. Much
823 of the following grunt work is done automatically by the Package
826 1. Downloading, compiling, and activating of org-mode (including
827 setting org-mode's =load-path= and autoloads).
828 2. Updating info files.
837 ** How can I quickly browse all Org options?
841 =M-x org-customize RET=
843 See also [[file:org-tutorials/org-customize.org][Carsten's Org customize tutorial]] and [[file:org-configs/org-customization-guide.org][this customization guide]]
846 ** Can I use the editing features of org-mode in other modes?
848 :CUSTOM_ID: use-editing-features-in-other-modes
851 Not really---but there are a few editing features you can use in
854 - For tables there is =orgtbl-mode= which implements the table
855 editor as a minor mode. (To enable, type =M-x orgtbl-mode=)
856 - For ordered lists there is =orgstruct-mode= which allows for easy
857 list editing as a minor mode. (To enable, type =M-x
860 You can activate these modes automatically by using hooks:
862 : (add-hook 'mail-mode-hook 'turn-on-orgtbl)
863 : (add-hook 'mail-mode-hook 'turn-on-orgstruct)
865 For footnotes, there is the function =org-footnote-action=, which
866 works in non-org buffers. This function is a powerful tool for
867 creating and sorting footnotes. To use it globally, you can add the
868 following keybinding to your =.emacs= file (requires Org 6.17 or
871 : (global-set-key (kbd "C-c f") 'org-footnote-action)
873 For other features you need to switch to Org-mode temporarily, or
874 prepare text in a different buffer.
876 ** Why isn't feature "X" working the way it is described in the manual?
878 :CUSTOM_ID: making-sure-org-mode-is-up-to-date
881 Org-mode develops very quickly. If you are using a version of Org-mode
882 that shipped with emacs, there is a good chance that it is somewhat
885 Many of the users on the Org-mode mailing list are using either a
886 recent release of Org-mode or the
887 [[http://orgmode.org/index.html#sec-3.2][development version of
888 org-mode from the git repository]].
890 If some settings and features aren't working the way you expect, make
891 sure that the version of the manual you are consulting matches the
892 version of Org-mode you are using.
894 - You can check which version of Org-mode you are using by
895 selection =Org --> Documentation --> Show Version= in the Emacs
898 - The [[http://orgmode.org/manual/index.html][online manual]] at [[http://orgmode.org][orgmode.org]] corresponds to the most recent
901 - 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
902 released with the latest official Gnu Emacs release. Compared
903 with the manual at the orgmode.org, the manual at www.gnu.org is
904 somewhat out of date.
906 For instructions on how to stay current with Org-mode, consult [[keeping-current-with-Org-mode-development][this
907 FAQ]] or follow the instructions on [[http://orgmode.org][the official Org-mode site]].
909 ** Can I get the visibility-cycling features in emacs-lisp-mode?
911 Yes. This snippet in your =.emacs= will bind =C-M-]= and =M-]= to global
914 #+BEGIN_SRC emacs-lisp
915 (global-set-key (kbd "C-M-]") (lambda () (interactive) (org-cycle t)))
916 (global-set-key (kbd "M-]") (lambda ()
920 (beginning-of-defun))
924 ** Can I get the visibility-cycling features in outline-mode and outline-minor-mode?
926 :CUSTOM_ID: use-visibility-cycling-in-outline-mode
929 #+index: Visibility!Cycling
931 Yes, these functions are written in a way that they are independent of
932 the outline setup. The following setup provides standard Org-mode
933 functionality in outline-mode on =TAB= and =S-TAB=. For
934 outline-minor-mode, we use =C-TAB= instead of =TAB=,
935 because =TAB= usually has mode-specific tasks.
937 #+BEGIN_SRC emacs-lisp
938 (add-hook 'outline-minor-mode-hook
940 (define-key outline-minor-mode-map [(control tab)] 'org-cycle)
941 (define-key outline-minor-mode-map [(shift tab)] 'org-global-cycle)))
942 (add-hook 'outline-mode-hook
944 (define-key outline-mode-map [(tab)] 'org-cycle)
945 (define-key outline-mode-map [(shift tab)] 'org-global-cycle)))
948 Or check out /outline-magic.el/, which does this and also provides
949 promotion and demotion functionality. /outline-magic.el/ is
950 available at [[http://www.astro.uva.nl/~dominik/Tools/outline-magic.el][Outline Magic]].
952 ** Can I save/restore the visibility state of an org-mode buffer?
954 :CUSTOM_ID: saving-visibility-state
957 #+index: Visibility!Restore
959 Well, no---at least not automatically. You can, however, control the
960 visibility of an org-file or of individual trees by adding
961 instructions to your org file. See [[http://orgmode.org/manual/Visibility-cycling.html#Visibility-cycling][this section of the manual]] for more
964 ** How can I keep track of changes in my Org files?
966 :CUSTOM_ID: track-of-changes-in-Org-files
969 Use git to track the history of the files, use a cronjob to check in
970 changes regularly. Such a setup is described by Bernt Hansen in [[http://article.gmane.org/gmane.emacs.orgmode/6233][this
971 message]] on [[http://dir.gmane.org/gmane.emacs.orgmode][emacs-orgmode]].
973 ** Can I use Org-mode as the default mode for all README files?
975 :CUSTOM_ID: Org-mode-as-default-mode
978 #+index: default-major-mode
980 Add the following to your .emacs file:
982 : (add-to-list 'auto-mode-alist '("README$" . org-mode))
984 You can even make it the default mode for any files with unspecified
987 : (setq default-major-mode 'org-mode)
989 ** Can I use ido.el for completing stuff in Org?
991 :CUSTOM_ID: ido-complete
996 Yes, you can. If you are an ido user and ido-mode is active, the
997 following setting will make Org use =ido-completing-read= for most
998 of its completing prompts.
1000 : (setq org-completion-use-ido t)
1002 ** Should I use one big org file or multiple files?
1004 :CUSTOM_ID: how-to-organize-org-mode-files
1007 Org-mode is flexible enough to accomodate a variety of organizational and
1008 time management schemes. Org's [[http://orgmode.org/manual/Document-Structure.html#Document-Structure][outline cycling and convenient editing and
1009 navigation commands]] make it possible to maintain all of your projects and
1010 notes in a single file. But org-mode's [[http://orgmode.org/manual/Hyperlinks.html#Hyperlinks][quick and easy hyperlinks]], along
1011 with [[http://orgmode.org/manual/Refiling-notes.html#Refiling-notes][easy refiling of notes and todos]], also make it a delight to maintain a
1012 private "wiki" consisting of multiple files.
1014 No matter how you organize your org files, org-mode's agenda commands
1015 make it easy to search all your notes and gather together crucial data
1018 Moreover, several org-mode settings can be configured either globally in
1019 your =.emacs= file or locally (per file or per outline tree). See the
1020 [[http://orgmode.org/manual/index.html#Top][manual]] for more details. For an example of local customizations see [[limit-agenda-with-category-match][this
1023 Here are a few ideas for organizing org-mode files:
1025 - A single file for all your projects and notes.
1026 - One file per project.
1027 - One file per client.
1028 - One file per area of responsibility or type of work (e.g.,
1029 household, health, work, etc.).
1030 - One file for projects, one for appointments, one for reference
1031 material, one for someday/maybe items, etc.
1032 - A wiki of hyperlinked files that grows and adapts to meet your
1035 For more ideas, see some of the links on the [[file:org-tutorials/index.org][org-tutorial index]] or
1036 [[file:org-gtd-etc.org][this page on org-mode and GTD]].
1038 ** Why doesn't C-c a call the agenda? Why don't some org keybindings work?
1040 :CUSTOM_ID: setting-global-keybindings
1043 Org-mode has a few global keybindings that the user must set explicitly in
1044 an =.emacs= file. These keybindings include the customary shortcut for
1045 calling the agenda (=C-c a=). If nothing happens when you type =C-c a=,
1046 then make sure that the following lines are in your =.emacs= file:
1048 #+BEGIN_SRC emacs-lisp
1049 ;; The following lines are always needed. Choose your own keys.
1050 (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode))
1051 (global-set-key "\C-cl" 'org-store-link)
1052 (global-set-key "\C-ca" 'org-agenda)
1053 (global-set-key "\C-cb" 'org-iswitchb)
1054 #+END_SRC emacs-lisp
1056 You may, of course, choose whatever keybindings work best for you
1057 and do not conflict with other modes.
1059 Please see [[http://orgmode.org/manual/Activation.html][this section of the manual]] if you have additional
1062 ** Why aren't some of the variables I've customized having an effect?
1064 :CUSTOM_ID: load-org-after-setting-variables
1067 Some org variables have to be set before org.el is loaded or else they
1068 will not work. (An example is the new variable
1069 =org-enforce-todo-dependencies=.)
1071 To make sure all your variables work you should not use =(require
1072 'org)=. Instead use the following setting:
1074 : (require 'org-install)
1076 You should also make sure that you do not require any other =org-...=
1077 files in your =.emacs= file before you have set your org variables,
1078 since these will also cause org.el to be loaded. To be safe, load org
1079 files *after* you have set your variables.
1081 ** How can I make sure that timestamps appear in English?
1083 :CUSTOM_ID: timestamps-and-system-time-locale
1086 If your system's locale is not set to English, but you would like the
1087 timestamps in your org-mode files to appear in English, you can set
1088 the following variable:
1090 #+begin_src emacs-lisp
1091 (setq system-time-locale "C")
1094 ** What does a minimal .emacs look like?
1096 :CUSTOM_ID: minimal-emacs
1099 Using a stripped down minimal .emacs files removes broken custom
1100 settings as the cause of an issue and makes it easy to reproduce for
1101 other people. The example below has system-specific paths that you'll
1102 need to change for your own use.
1104 #+begin_src emacs-lisp
1105 (add-to-list 'load-path (expand-file-name "~/git/org-mode/lisp"))
1106 (add-to-list 'auto-mode-alist '("\\.\\(org\\ |org_archive\\|txt\\)$" . org-mode))
1107 (setq org-agenda-files '("/tmp/test.org"))
1108 (require 'org-install)
1109 (require 'org-habit)
1111 (global-set-key "\C-cl" 'org-store-link)
1112 (global-set-key "\C-ca" 'org-agenda)
1113 (global-set-key "\C-cb" 'org-iswitchb)
1116 You can save the minimal .emacs file to ~/minimal.emacs, add suspect
1117 configuration code to it, then start emacs something like this:
1120 emacs -Q -l ~/minimal.emacs
1123 On OS X, starting emacs with minimal configuration might look
1124 something like this:
1127 /Applications/emacs.app/Contents/MacOS/Emacs -Q -l ~/minimal.emacs
1130 ** Can I migrate from Planner?
1132 Yes. This [[http://www.c0t0d0s0.de/plan2org/plan2org.pl][perl script]] or [[http://gitorious.org/bkuhn-small-hacks/org-mode/blobs/master/planner2org.plx
1133 ][this Perl script]] can help.
1135 * Errors and general problems
1139 ** Is my Orgmode installation mixed?
1141 :CUSTOM_ID: mixed-install
1143 Emacs is distributed with a version of Orgmode bundled with it. A
1144 common problem among users who install a [[#updating-org][newer version]] of Orgmode
1145 separately is a mixed install where Emacs loads some files from the
1146 bundled and the rest from the latest version. This can lead to
1147 /unending/ troubles in the future. With a recent installation of
1148 Org mode =M-x org-version= will indicate if the installation is mixed.
1150 With somewhat older Org mode installations, the procedure is more
1151 involved and indeterminate. An easy first step is to look
1152 at the output of =M-x org-version=.
1153 - Good :: ~Org-mode version 7.8.11 (release_7.8.11-448-g1737d3 @
1154 /path/to/org-mode/lisp/)~
1155 - Bad :: ~Org-mode version 6.33x (release_7.8.11.409.ga3778)~
1157 A second step is to go through the output of =list-load-path-shadows=
1158 line-by-line to get hints to what in your configuration is causing
1159 the issue. Among the most common reasons is Orgmode gets loaded
1160 before the =load-path= variable is updated to include the
1161 installation directory of the latest Orgmode. To avoid issues like
1162 this, it is recommended that the load path is updated very early on
1165 /Note:/ The formatting of the version information, as shown in the
1166 examples above, will be different for older Org mode releases,
1167 e.g. ~Org-mode version 7.8.02~.
1169 ** Opening Org files in Emacs leads to a crash
1171 :CUSTOM_ID: Emacs-crashes-with-org-indent-mode
1173 The only known case where Org-mode can crash Emacs is when you are
1174 using =org-indent-mode= with Emacs 23.1 (in fact, any version of
1175 Emacs before version 23.1.50.3). Upgrade to Emacs 23.2 and the
1176 problem should go away.
1178 ** When I try to use Org-mode, I always get the error message =(wrong-type-argument keymapp nil)=
1180 :CUSTOM_ID: wrong-type-argument-keymapp
1183 This is a conflict with an outdated version of the /allout.el/, see
1184 the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section in the manual
1186 ** How can I control the application launched by Org-mode to open a certain file type like pdf, html...?
1188 :CUSTOM_ID: external-application-launched-to-open-file-link
1191 If you want special control about how Org-mode opens files, see the
1192 variables =org-file-apps=, =org-file-apps-defaults-gnu=,
1193 =org-file-apps-defaults-macosx=, =org-file-apps-defaults-windowsnt=.
1195 *However*, normally it is best to just use the mechanism the
1196 operating-system provides:
1198 *** GNU/Linux systems
1199 You you have to check your mailcap settings, find the files:
1207 and modify them accordingly. Please read their manual entry.
1210 + for html pages you may configure the =browse-url-= variables through
1211 the Customize interface,
1212 + the pdf files are automatically opened with Acrobat Reader (if it is
1216 Change the application responsible for this file type by selecting
1217 such a file in the Finder, select =File->Get Info= from the menu
1218 and select the application to open this file with. Then, to
1219 propagate the change to all files with the same extension, select
1220 the =Change all= button.
1222 ** Org-mode takes over the TAB key. I also want to use YASnippet, is there a way to fix this conflict?
1224 :CUSTOM_ID: YASnippet
1227 [[http://code.google.com/p/yasnippet/][yasnippet]] is yet another snippet expansion system for Emacs. It is
1228 inspired by TextMate's templating syntax.
1229 - watch the [[http://www.youtube.com/watch?v=vOj7btx3ATg][video on YouTube]]
1230 - see the [[http://yasnippet.googlecode.com/svn/trunk/doc/index.html][intro and tutorial]]
1232 *Note*: yasnippet is not compatible with =org-indent-mode= currently
1233 there is no known way to use both successfully with =yas/trigger-key=
1234 set to =TAB= (or =[tab]= etc...)
1236 The way Org-mode binds the =TAB= key (binding to =[tab]= instead of
1237 =\t=) overrules yasnippets' access to this key. The following code
1240 #+begin_src emacs-lisp
1241 (add-hook 'org-mode-hook
1243 (org-set-local 'yas/trigger-key [tab])
1244 (define-key yas/keymap [tab] 'yas/next-field-group)))
1247 If the above code doesn't work (which it may not with later versions
1248 of yasnippet). Then try the following
1250 #+begin_src emacs-lisp
1251 (defun yas/org-very-safe-expand ()
1252 (let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
1254 (add-hook 'org-mode-hook
1256 ;; yasnippet (using the new org-cycle hooks)
1257 (make-variable-buffer-local 'yas/trigger-key)
1258 (setq yas/trigger-key [tab])
1259 (add-to-list 'org-tab-first-hook 'yas/org-very-safe-expand)
1260 (define-key yas/keymap [tab] 'yas/next-field)))
1263 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]])
1264 with YASnippets for Org-mode.
1266 ** Org-mode takes over the S-cursor keys. I also want to use CUA-mode, is there a way to fix this conflict?
1268 :CUSTOM_ID: CUA-mode
1271 Yes, see the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
1273 ** Org-mode takes over the S-cursor keys. I also want to use windmove.el, is there a way to fix this conflict?
1275 :CUSTOM_ID: windmove.el
1278 Yes, see the [[http://orgmode.org/manual/Conflicts.html#Conflicts][Conflicts]] section of the manual.
1280 ** Org behaves strangely: some keys don't work, some features are missing, my settings have no effect, ...
1282 :CUSTOM_ID: loaded-old-org
1285 When this sort of things happen, it probably is because Emacs is
1286 loading an old version of Org-mode instead of the one you expected.
1287 Check it with =M-x org-version=.
1289 This happens because Emacs loads first the system org-mode (the one
1290 included with Emacs) before the one in your directory. Check the
1291 =load-path= variable; you might see that your org-mode appears /after/
1292 the system-wide path; this is bad.
1294 You should add your directories to the =load-path= at the beginning:
1296 : (add-to-list 'load-path "~/.emacs.d/org-mode/lisp") (require 'org-install)
1298 Function =add-to-list= adds at the beginning. Don't use =append=
1299 because it appends at the end. Also be sure to use =(require
1300 'org-install)= and not =(require 'org)=.
1302 This wrong version loading may also happen if you have a byte-compiled
1303 =org.elc= from an old version together with a new =org.el=. Since
1304 Emacs prefers loading byte-compiled files (even if the =.el= is
1305 newer), it will load the old Org-mode.
1307 ** Why doesn't org-batch-agenda work under Win32?
1309 :CUSTOM_ID: org-batch-agenda-under-win32
1312 When I run the example batch files to print my agenda to the console
1313 under Win32 I get the failure:
1315 : End of file during parsing
1317 and no agenda is printed.
1319 The problem is the use of single quotes surrounding the eval in the
1320 emacs command-line. This gets confused under Win32. All string
1321 parameters with spaces must be surrounded in double quotes. This means
1322 that double quotes being passed to the eval must be escaped.
1324 Therefore, instead of the following:
1326 : <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
1327 : -eval '(org-batch-agenda "a")'
1329 you need to use the following:
1331 : <path to emacs>\emacs.exe -batch -l ~/_emacs_org \
1332 : -eval "(org-batch-agenda \"a\")"
1334 (all on one line, of course).
1336 ** Org agenda seems very slow
1338 :CUSTOM_ID: slow-agenda
1341 If it takes a long time to generate or refresh the agenda, you might
1342 want first check which version of org-mode you are using. There have
1343 been major optimizations of org-agenda since 6.21b, which was the
1344 version of org-mode released with Emacs 23. If you are using 6.21b or
1345 earlier (you can check with =M-x org-version=), then you might want to
1346 consider upgrading to a more recent version of org-mode.
1348 Here are some other ideas for speeding up the agenda:
1350 1. Use a one day agenda view (rather than a seven day view).
1352 =(setq org-agenda-ndays 1)=
1354 2. Archive inactive items to separate files.
1356 =C-c C-x C-s= (org-archive-subtree)
1358 3. Do not include the global todo list in your agenda view.
1360 (setq org-agenda-include-all-todo nil)
1362 4. Make sure that your org files are byte-compiled.
1364 I.e., make sure there are files ending in =.elc= in your org
1365 installation directory.
1367 5. Limit your agenda files (=org-agenda-files=) to files that have
1368 active todos and or projects.
1370 If you have a number of older reference files---i.e., files you
1371 search only occasionally---in your agenda files list, consider
1372 removing them from your agenda files and adding them to
1373 =org-agenda-text-search-extra-files= instead. Similarly, you might
1374 consider searching some of your older reference files with =M-x
1375 grep= so that Org-mode does not have to load them into memory when
1376 the agenda is called.
1378 ** Visual-line-mode doesn't work well with Org-mode
1380 :CUSTOM_ID: visual-line-mode
1383 Visual-line-mode "soft wraps" lines so that the visual edge of the
1384 buffer is considered a line break for purposes of navigation, even
1385 though there is no line break in reality.
1387 In older versions of org-mode, org-beginning-of-line and
1388 org-end-of-line do not work well with visual line mode. (The two
1389 commands disregard soft line breaks and move to the beginning and end
1390 of the hard line break.) A patch was introduces to fix this behavior
1393 If you are using an older version of Org-mode, you can:
1395 1. Add a hook to turn off visual line mode.
1397 2. Add the following to your =.emacs=:
1399 #+begin_src emacs-lisp
1401 (add-hook 'org-mode-hook
1403 (define-key org-mode-map "\C-a" 'move-beginning-of-line)
1404 (define-key org-mode-map "\C-e" 'move-end-of-line)))
1407 ** Can I hide blocks at startup?
1411 #+begin_src emacs-lisp
1412 (setq org-hide-block-startup t)
1418 ,#+STARTUP: hideblocks
1421 on a per-file basis.
1423 ** After updating Org I get an error about an =invalid function=
1425 :CUSTOM_ID: invalid-function-error
1428 In almost all cases an =invalid function= error is caused by an
1429 unclean Org-mode source directory. Cleaning it up and recompiling
1430 should fix the problem
1432 : cd /path/to/orgmode
1436 In some cases, bits and pieces of org are loaded from various places (previous
1437 installs, the built-in install of org that came with whatever emacs version you have)
1438 and things get very confused. In all cases, cleaning up every last bit of org installation
1439 from everywhere and reinstalling org from git should restore sanity. See also the [[id:facac2a6-3526-450d-ac42-8d36b16c6bab][next question]].
1441 ** I use starter-kit and I get an error =(void-function org-pop-to-buffer-same-window)=
1443 :ID: facac2a6-3526-450d-ac42-8d36b16c6bab
1445 This is a particular instance of the [[#invalid-function-error][previous question]] but with some twists and turns,
1446 and a solution culled from various postings on the mailing list.
1448 starter-kit loads the site-file version of org (the one that came with
1449 your emacs install). Then when you load your init file, the local
1450 version is added to the front of load-path, so it looks as if things
1451 are originating there, but the damage is already done: you have a
1454 One possible solution is to add (package-initialize) to the primary init.el
1455 before starter-kit gets going. This will pick up the local install so
1456 that the built-in version never enters to muddy the picture.
1458 ** (Filling a paragraph|Indenting a list|...) behaves strangely
1459 Many filling/indenting problems have been reported on the mailing
1460 list: many of those were bugs (that have been fixed), but quite a lot
1461 are caused by people using the filladapt package, which is fundamentally
1462 incompatible with Org, which has its own facilities for these tasks. If you see
1463 strange behavior in this area, first check if you are using filladapt: visit an org
1464 file and check the modeline for "Filladapt".
1466 If filladapt is on, you want to turn it off before investigating
1467 further. Anthony Lander suggested on the mailing list the following
1468 method to turn off filladapt mode when you visit org files:
1470 #+BEGIN_SRC emacs-lisp
1471 (add-hook 'org-mode-hook 'turn-off-filladapt-mode)
1474 This should be placed in your .emacs (or other initialization file) after org
1477 * Faces and highlighting
1481 ** Org-mode has a lot of colors? How can I change them?
1483 :CUSTOM_ID: customizing-org-faces
1488 This is a question that applies to Emacs as a whole, but it comes up
1489 quite frequently on the org-mode mailing list, so it is appropriate to
1492 If you would like to change the style of a face in org-mode (or any
1493 other Emacs mode), simply type =M-x customize-face [RET]= while the
1494 cursor is on the color/style you are interested in modifying. You will
1495 be given the opportunity to customize all the faces located at that
1498 If you would like an overview of all the faces in org-mode, you can
1499 type =C-u M-x list-faces-display [RET] org= and you will be shown all
1500 the faces defined by org-mode along with an illustration of their
1503 If you would like to customize org-faces and other aspects of
1504 org-appearance, type =M-x customize-group org-font-lock [RET]=.
1506 Finally, if you would like verbose information about the properties of
1507 the text under the cursor, you can type =C-u C-x ==.
1509 See the Worg page on [[file:org-tutorials/org-appearance.org][customizing Org appearance]] for further information.
1510 ** Why do I get a tiny font in column view when using emacs daemon?
1512 :CUSTOM_ID: column-view-tiny-font
1515 #+index: Column view
1517 When using emacs in daemon mode (=emacs --daemon=), client frames
1518 sometimes override the column view face settings, resulting in very
1519 small fonts. Here is a fix:
1521 #+begin_src emacs-lisp
1522 (defun org-column-view-uses-fixed-width-face ()
1523 ;; copy from org-faces.el
1524 (when (fboundp 'set-face-attribute)
1525 ;; Make sure that a fixed-width face is used when we have a column
1527 (set-face-attribute 'org-column nil
1528 :height (face-attribute 'default :height)
1529 :family (face-attribute 'default :family))))
1531 (when (and (fboundp 'daemonp) (daemonp))
1532 (add-hook 'org-mode-hook 'org-column-view-uses-fixed-width-face))
1535 This fix was provided in the following mailing list post:
1537 http://article.gmane.org/gmane.emacs.orgmode/27560
1538 ** How can I stop the mouse cursor from highlighting lines in the agenda?
1540 :CUSTOM_ID: ratpoison-for-agenda-highlighting
1543 #+index: Highlighting
1545 You can add the following to your =.emacs=:
1547 #+begin_src emacs-lisp
1548 (add-hook 'org-finalize-agenda-hook
1549 (lambda () (remove-text-properties
1550 (point-min) (point-max) '(mouse-face t))))
1557 ** Can I close an outline section without starting a new section?
1559 :CUSTOM_ID: closing-outline-sections
1564 Can I have nested, closed outline sections, similar to xml? This
1565 question comes up quite frequently on the mailing list.
1567 See the following threads:
1569 - http://permalink.gmane.org/gmane.emacs.orgmode/40182
1570 - http://permalink.gmane.org/gmane.emacs.orgmode/36719
1571 - http://permalink.gmane.org/gmane.emacs.orgmode/24092
1572 - http://permalink.gmane.org/gmane.emacs.orgmode/12425
1574 The desired behavior looks something like this:
1589 ,# end Subsection Two
1591 ,Continue text in section one.
1594 The short answer to the question is no. Org-mode adheres to the
1595 cascading logic of outlines, in which a section is closed only by
1596 another section that occupies an equal or greater level.
1598 Here are some workarounds:
1600 1. You can use inline tasks to create non-folding subsections. See the
1601 documentation in org-inlinetask.el, which is part of the org-mode
1603 2. You can create a temporary heading, such as "** Continue main
1604 section" and then remove it when you are ready to export.
1605 3. You can create a separate outline heading (e.g., * ACTIONS),
1606 creating TODOs there with links to the relevant sections of your
1609 ** Can I add a TODO to a list item?
1611 :CUSTOM_ID: list-item-as-todo
1614 No. When generating agenda views, org-mode treats only headlines as TODO
1617 You can, however, use a status cookie together with checkboxes to
1618 monitor your progress on a series of subtasks:
1621 ,** TODO Big task [1/3]
1628 If you would like to embed a TODO within text without treating it as
1629 an outline heading, you can use inline tasks. Simply add...
1631 : (require 'org-inlinetask)
1633 ...to your =.emacs= and then type =C-c C-x t= to insert an inline task.
1635 ** Can I have two windows on the same Org-mode file, with different outline visibilities?
1637 :CUSTOM_ID: indirect-buffers
1640 You may use /indirect buffers/ which do exactly this. See the
1641 documentation on the command =make-indirect-buffer=.
1643 Org-mode has built-in commands that allow you create an indirect
1644 buffer from a subtree of an outline. To open a subtree in new
1645 window, type =C-c C-x b=. Any changes you make in the new window
1646 will be saved to the original file, but the visibility of both
1647 buffers will remain independent of one another.
1649 For multiple indirect buffers from the same file, you must use the
1650 prefix =C-u= when creating the second (or third) buffer. Otherwise
1651 the new indirect buffer will replace the old.
1653 You can also create an independent view of an outline subtree by
1654 typing =b= on an item in the agenda.
1656 ** Emacs outlines are unreadable. Can I get rid of all those stars?
1658 :CUSTOM_ID: Emacs-outlines-are-unreadable
1661 See the section [[http://orgmode.org/manual/Clean-view.html#Clean-view][Clean outline view]] in the manual.
1663 ** C-k is killing whole subtrees! I lost my work!
1665 :CUSTOM_ID: C-k-is-killing-subtrees
1668 =(setq org-ctrl-k-protect-subtree t)= before losing your work.
1670 =(setq org-catch-invisible-edits 'show)= will also be helpful. See the
1671 docstring of this option, as it allows more flexible options.
1673 ** Why aren't commands working on regions?
1675 :CUSTOM_ID: transient-mark-mode
1678 Some org-mode commands, such as M-right and M-left for demoting or
1679 promoting headlines (see [[demote-multiple-headlines][this FAQ]]), can be applied to entire
1680 regions. These commands, however, will only work on active regions set
1681 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
1682 Emacs 23. To enable it in earlier versions of emacs, put the following in
1685 : (transient-mark-mode 1)
1687 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
1688 mark]] (=C-<SPC> C-<SPC>=).
1690 ** Why is a blank line inserted after headlines and list items?
1692 :ID: 2463F4D8-F686-4CF3-AA07-08976F8A4972
1693 :CUSTOM_ID: blank-line-after-headlines-and-list-items
1698 In org-mode, typing =M-RET= at the end of a headline will create a new
1699 headline of the same level on a new line. The same is true for plain
1700 lists. By default org-mode uses context to determine if a blank line should
1701 be inserted after each headline or plain list item when =M-RET= is
1702 pressed. For instance, if a there is a blank line before a headline, then
1703 typing =M-RET= at the end of the line will insert a blank line before the
1704 new headline. For instance, hitting =M-RET= at the end of "Headline Two"
1705 below inserts a new headline without a blank line:
1711 If there is a blank line between Headline One and Headline Two,
1712 however, the results will be as follows:
1720 If you do not like the default behavior you can change it with the
1721 variable =org-blank-before-new-entry=. You can set headings and/or
1722 plain lists to auto (the default setting), t (always), or nil (never).
1724 ** How can I promote or demote multiple headlines at once?
1726 :CUSTOM_ID: demote-multiple-headlines
1729 #+index: Promote!Multiple
1730 #+index: Demote!Multiple
1732 If you have a long list of first level headlines that you'd like to
1733 demote to second level headlines, you can select the headlines as a
1734 region and then hit =M-<right>= to demote all the headlines at once.
1736 Note: =M-S-<right>= will not work on a selected region. Its use is to
1737 demote a single subtree (i.e., a headline and all sub-headlines).
1739 If M-<right> doesn't seem to work, make sure transient mark mode is
1740 enabled. See [[transient-mark-mode][this FAQ]].
1742 ** What's the deal with all the ellipses in my org outlines?
1744 :CUSTOM_ID: org-ellipses
1749 Org-mode uses ellipses to indicate folded (and thus hidden) text. Most
1750 commonly, ellispes occur at the end of headings with folded content:
1754 Or, for instance, they may indicate closed drawers:
1758 Sometimes, as a result of editing and cycling an outline, ellipses may
1759 appear in unexpected places. You should *never* delete these ellipses,
1760 as you may accidentally delete hidden text. Instead, you can type =C-c
1761 C-r= (org-reveal) to display all hidden text in the vicinity. Or you
1762 may type =M-x RET show-all= to reveal all text in the org file.
1764 If you would prefer a symbol or face for indicating hidden text, you
1765 can customize the variable org-ellipses.
1767 ** How do I yank a subtree so it's indented according to the point's location?
1769 :CUSTOM_ID: yank-indent-subtree
1772 #+index: Indentation
1774 You can either use =C-c C-w= with a working [[http://orgmode.org/manual/Refiling-notes.html#Refiling-notes][refile-targets]] setup.
1776 Or set =org-yank-adjusted-subtrees= to =t= which will adjust the
1777 yanked headline's level correctly.
1779 Just use =C-k= and =C-y= as you would everywhere else in Emacs.
1781 ** Can I read org-mode outlines in vim?
1783 :CUSTOM_ID: org-outlines-in-vim
1788 Yes, there is a script that enables one to view and navigate folded
1789 outline/org files in vim (though without most of org-mode's
1790 functionality, of course).
1792 - [[http://www.vim.org/scripts/script.php?script_id%3D1266][Emacs outline mode - Imitates Emacsen : vim online]]
1794 For instructions on how to set it up, please see [[http://mid.gmane.org/EA275862-B97A-4BAC-B879-177FD07A2D56@gaillourdet.net][this mailing list
1797 Work is also underway on an org-mode clone for Vim. You can check it
1800 https://github.com/hsitz/VimOrganizer
1802 ** Can I use another character than "*" to start a headline?
1804 No. The "*" character is used in =outline-mode=, and Org is derived from
1807 If you are curious as to what other rationales there are for "*", check out
1808 [[http://permalink.gmane.org/gmane.emacs.orgmode/44271][this]] mail and the thread it is in.
1810 Even if you cannot use another character, you can add an overlay on top of
1811 the "*" characters and your buffer will look like the way you want.
1813 See the library =org-bullets.el= (by Evgeni Sabof) from the =contrib/=
1814 directory, or test this snippet shared by Jambunathan:
1816 #+BEGIN_SRC emacs-lisp
1817 (font-lock-add-keywords
1818 Â Â 'org-mode `(("\\(?:^\\(?1:\\*+\\)[[:blank:]]\\)"
1819 Â Â Â Â Â Â Â Â (0 (progn (compose-region
1820 Â Â Â Â Â Â Â Â Â Â Â Â Â Â (match-beginning 1) (match-end 1)
1821 Â Â Â Â Â Â Â Â Â Â Â Â Â Â (pcase (length (match-string 1))
1822 Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â (1 ?\u2219)
1823 Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â (2 ?\u2022)
1824 Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â (3 ?\u25c9)
1825 Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â (_ ?\u25CB)))
1826 Â Â Â Â Â Â Â Â Â Â Â Â Â nil)))))
1831 :CUSTOM_ID: Todos-and-Tags
1833 ** How can I automatically archive canceled tasks?
1835 #+BEGIN_SRC emacs-lisp
1836 (setq org-todo-state-tags-triggers '(("CANCELLED" ("ARCHIVE" . t))))
1839 See http://thread.gmane.org/gmane.emacs.orgmode/64824 -- thanks to Victor
1840 Rosenfeld for sharing [[http://doc.norang.ca/org-mode.html][Bernt Hansen]]'s solution.
1842 ** How can I cycle through the TODO keyword of an entry?
1844 :CUSTOM_ID: cycle-TODO-keywords
1847 #+index: Cycling!Todo
1849 =C-c C-t= or =S-<left/right>= is what you need.
1851 ** How do I track state changes for tasks in Org?
1853 :CUSTOM_ID: track-state-changes-for-tasks
1858 Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/6082][post by Bernt Hansen]] for setting up TODO keyword
1859 states and logging timestamps for task state changes.
1861 ** Can I select the TODO keywords with a tag-like interface?
1863 :CUSTOM_ID: select-TODO-keywords-with-tag-like-interface
1866 #+index: Tag!Fast selection
1868 Yes. Use =(setq org-use-fast-todo-selection t)=
1870 If you want to set both your todos and your tags using a single
1871 interface, then check out the variable
1872 =org-fast-tag-selection-include-todo=.
1874 See [[http://orgmode.org/manual/Fast-access-to-TODO-states.html][this section of the manual]] for more details.
1876 ** How can I quickly set the tag of an entry?
1878 :CUSTOM_ID: quickly-set-tag-of-entry
1883 Use =C-c C-c= or =C-c C-q= on the headline. =C-c C-q= is useful for
1884 setting tabs in a [[http://orgmode.org/manual/Remember.html#Remember][remember]] buffer, since =C-c C-c= is the default
1885 keybinding for filing a note from the remember buffer.
1887 You can set tags even more quickly by setting one of the character
1888 shortcuts for [[http://orgmode.org/manual/Setting-tags.html#Setting-tags][fast tag selection]].
1890 To set tag shortcuts for all org buffers, put something like the
1891 following in your =.emacs= file (or create the same settings by
1892 typing =M-x customize-variable RET org-tag-alist=):
1894 : (setq org-tag-alist '(("computer" . ?c) ("office" . ?o) ("home" . ?h)))
1896 To set tag shortcuts for a single buffer, put something like the
1897 following at the top of your org file:
1899 : #+TAGS: computer(c) office(o) home(h)
1901 ** How can I change the colors of TODO keywords?
1905 You can use the variable =org-todo-keyword-faces=. Here are some sample
1908 #+begin_src emacs-lisp
1909 (setq org-todo-keyword-faces
1911 ("TODO" . (:foreground "firebrick2" :weight bold))
1912 ("WAITING" . (:foreground "olivedrab" :weight bold))
1913 ("LATER" . (:foreground "sienna" :weight bold))
1914 ("PROJECT" . (:foreground "steelblue" :weight bold))
1915 ("DONE" . (:foreground "forestgreen" :weight bold))
1916 ("MAYBE" . (:foreground "dimgrey" :weight bold))
1917 ("CANCELED" . shadow)
1921 If you want to change the color of all active todos or all inactive todos,
1924 : M-x customize-face RET org-todo
1925 : M-x customize-face RET org-done
1927 You can also set values for each of these in your =.emacs= file:
1929 : (set-face-foreground 'org-todo "firebrick2")
1930 : (set-face-foreground 'org-done "forestgreen")
1932 ** Can I use a arbitrary character in a TODO keyword?
1934 Yes, provided you add it to the "word" syntax in Emacs.
1936 For example, to add the =\u25b6= and the =\u25b8= chars, just add this to
1937 your Emacs configuration:
1939 #+begin_src emacs-lisp
1940 (add-hook 'org-mode-hook
1942 (modify-syntax-entry (string-to-char "\u25b6") "w")
1943 (modify-syntax-entry (string-to-char "\u25b8") "w")))
1946 ** How do I arrange for an item to be automatically marked DONE when all checkboxes are checked?
1950 This has arisen a couple of time
1951 (e.g. http://thread.gmane.org/gmane.emacs.orgmode/42715 and
1952 http://thread.gmane.org/gmane.emacs.orgmode/47363) in the mailing list.
1954 There is an [[http://orgmode.org/worg/org-hacks.html#mark-done-when-all-checkboxes-checked][org-hack]] that describes a possible solution.
1958 :CUSTOM_ID: Hyperlinks
1961 ** Why do I have to confirm the execution of each shell/elisp link?
1963 :CUSTOM_ID: confirm-shell/elisp-link
1969 The confirmation is there to protect you from unwantingly execute
1970 potentially dangerous commands. For example, imagine a link
1972 : [[shell:rm -rf ~/*][Google Search]]
1974 In an Org-mode buffer, this command would look like /Google Search/,
1975 but really it would remove your home directory. If you wish, you can
1976 make it easier to respond to the query by setting
1978 : (setq org-confirm-shell-link-function 'y-or-n-p
1979 : org-confirm-elisp-link-function 'y-or-n-p).
1981 Then a single keypress will be enough to confirm those links. It is
1982 also possible to turn off this check entirely, but I strongly
1983 recommend against this. Be warned.
1985 ** Can I use RET or TAB to follow a link?
1987 :CUSTOM_ID: RET-or-TAB-to-follow-link
1990 #+index: Link!Follow
1994 : (setq org-return-follows-link t)
1995 : (setq org-tab-follows-link t)
1997 ** Can I keep mouse-1 clicks from following a link?
1999 :CUSTOM_ID: mouse-1-following-link
2002 Activating links with =mouse-1= is a new feature in Emacs 22, to make
2003 link behavior similar to other applications like web browsers. If
2004 you hold the mouse button down a bit longer, the cursor will be set
2005 without following the link. If you cannot get used to this behavior,
2006 you can (as in Emacs 21) use =mouse-2= to follow links and turn off
2007 link activation for =mouse-1= with
2009 : (setq org-mouse-1-follows-link nil)
2011 ** How can I get completion of file names when creating a link?
2013 :CUSTOM_ID: completion-of-file-links
2016 #+index: Link!Completion
2018 You can use org-insert-link with a prefix argument:
2022 You will be greeted with prompt in the minibuffer that allows for file
2023 completion using your preferred Emacs method for finding files.
2025 ** How can I use invisible targets within lists?
2027 :CUSTOM_ID: invisible-targets-in-lists
2030 #+index: Target!Invisible
2032 The usual way of turning radio links invisible is to comment them, but
2033 Org comments need to be at the beginning of the line, which breaks list
2036 The workaround here is to add (INVISIBLE) after your <<target>>
2040 : 11. <<target>>(INVISIBLE)
2042 : 12. More text [[target][go to]]
2044 ** Org-mode is not opening mailto links in my default mail client
2046 :CUSTOM_ID: mailto-links
2049 #+index: Link!Mailto
2051 You can customize the function org-mode uses to open mailto links by
2052 setting the variable =org-link-mailto-program=:
2054 =M-x customize-variable org-link-mailto-program=
2056 The default function called is =browse-url=, which opens a mail
2057 composition buffer within Emacs. The type of buffer opened by
2058 browse-url depends on the setting of the variable =mail-user-agent=.
2059 Thus, if you want to ensure that mailto links use Gnus to open a
2060 message buffer, you could add the following to your =.emacs=:
2063 (setq mail-user-agent 'gnus-user-agent)
2066 ** Can I use CamelCase links?
2068 :CUSTOM_ID: CamelCase-links
2071 #+index: Link!CamelCase
2073 Yes, you can with the contributed package =org-wikinodes.el=. Please
2074 consult the [[http://orgmode.org/worg/org-contrib/org-wikinodes.html][documentation]].
2076 ** Can I create links to Thunderbirds emails?
2078 Yes, see this: [[http://mid.gmane.org/ka42mn$mn9$1%2540ger.gmane.org][from Christoph Herzog: Re: Linking to Thunderbird (correction)]]
2080 #+BEGIN_SRC emacs-lisp
2083 (org-add-link-type "thunderlink" 'org-thunderlink-open)
2085 (defun org-thunderlink-open (path)
2086 "Opens an email in Thunderbird with ThunderLink."
2087 (start-process "myname" nil "thunderbird" "-thunderlink" (concat "thunderlink:" path)))
2089 (provide 'org-thunderlink)
2094 :CUSTOM_ID: Plain-Lists
2097 ** How can I insert an empty line before each newly inserted headline, but not before each newly inserted plain-list item?
2099 :CUSTOM_ID: empty-line-before-each-new-headline-but-not-item
2102 : (setq org-blank-before-new-entry
2103 : '((heading . t) (plain-list-item . nil))
2105 See also [[id:2463F4D8-F686-4CF3-AA07-08976F8A4972][Why is a blank line inserted after headlines and list items?]].
2107 ** How can I convert itemized lists to enumerated lists?
2109 :CUSTOM_ID: convert-itemized-to-enumerated-lists
2112 #+index: List!Itemized
2113 #+index: List!Enumerated
2115 You can use =C-c -= or =S-<left>/<right>= to cycle through the various
2116 bullet headlines available for lists: =-, +, *, 1., 1)=.
2118 See [[http://orgmode.org/manual/Plain-lists.html#Plain-lists][this section of the manual]] for more information.
2120 ** How can I convert plain lists to headlines and vice versa?
2122 :CUSTOM_ID: convert-plain-lists-to-headlines
2128 To convert a plain list item or line to a headline, type =C-c *= on
2129 the headline. This will make the line a subheading of the current
2132 To convert a headline to a plain list item, type =C-c -= while the
2133 cursor is on the headline.
2135 To convert a headline to an unadorned line of text, type =C-c *= on
2138 You can use query replace to accomplish the same things, as Bernt
2139 Hansen explains in [[http://article.gmane.org/gmane.emacs.orgmode/10148][this mailing list post]].
2141 ** Is there a good way to create a description list?
2143 :CUSTOM_ID: description-lists
2146 #+index: List!Description
2148 Yes, these are now built-in:
2151 - item1 :: Description of this item 1
2152 - item2 :: Description of this item 2
2153 - item1 :: Description of this item 3
2154 also in multiple lines
2162 ** Will there ever be support for multiple lines in a table field?
2164 :CUSTOM_ID: table-multiline-fields
2169 You can embed tables created with the =table.el= package in org-mode
2170 buffers, with mixed success when it comes to export and publishing.
2172 ** How can I make table alignment work with Asian character sets
2174 :CUSTOM_ID: table-alignment-asian-characters
2177 #+index: Table!Alignment
2179 When table alignment fails, it usually has to do with character sets
2180 where some characters have non-integer width. Org will deal correctly
2181 with characters that are one or two or three ASCII characters wide,
2182 but not with characters that are, for example, 1.5 ASCII characters
2183 wide. To make table alignment work you need to switch to a different
2186 ** Can I plot data from a table?
2188 :CUSTOM_ID: plotting-table-data
2195 Yes, you can, using org-plot.el written by Eric Schulte and now
2196 bundled with Org. See [[http://orgmode.org/manual/Org_002dPlot.html#Org-Plot][the manual section about this]].
2198 See also [[file:org-tutorials/org-plot.org][this excellent tutorial]] by Eric Schulte.
2200 ** How can I fill a table column with incremental numbers?
2202 :CUSTOM_ID: fill-table-column-with-incremental-numbers
2207 Here is how: Use a field formula to set the first value in the column:
2219 Then define a column formula in the second field:
2231 After recomputing the table, the column will be filled with
2232 incremental numbers:
2241 ,#+TBLFM: $1=@-1 + 1::@2$1=1
2244 Note that you could use arbitrary starting values and column formulas.
2246 Alternatively, you can just start the table
2254 and with the cursor on the 1, use S-RET (bound to org-table-copy-down). That
2255 will add a row, incrementing the number as it goes. See the docstring for org-table-copy-down
2256 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?]]
2257 if you don't want this behavior.
2259 ** =S-RET= in a table keeps increasing the copied numbers. How can I stop this?
2261 :CUSTOM_ID: S-RET-in-a-table-increases-copied-numbers
2264 Well, it is /supposed/ to be a feature, to make it easy to create a
2265 column with increasing numbers. If this gets into your way, turn it
2268 : (setq org-table-copy-increment nil)
2270 ** Why does my table column get filled with #ERROR?
2272 :CUSTOM_ID: table-column-filled-with-ERROR
2275 #+index: Table!#ERROR
2277 Org-mode tried to compute the column from other fields using a
2278 formula stored in the =#+TBLFM:= line just below the table, and
2279 the evaluation of the formula fails. Fix the fields used in the
2280 formula, or fix the formula, or remove it!
2282 ** How can I stop the table editor from creating new lines?
2284 :CUSTOM_ID: table-editor-creates-new-lines
2287 When I am in the last column of a table and just above a horizontal
2288 line in the table, pressing TAB creates a new table line before the
2289 horizontal line. To move to the line below the
2290 horizontal line instead, do this:
2292 Press =down= (to get on the separator line) and then =TAB=.
2293 Or configure the variable
2295 : (setq org-table-tab-jumps-over-hlines t)
2297 ** How can I get table fields starting with "="?
2299 :CUSTOM_ID: table-fields-starting-with-=
2304 : (setq org-table-formula-evaluate-inline nil)
2306 this will no longer happen. You can still use formulas using the
2307 commands ~C-c =~ and ~C-u C-c =~
2309 ** How can I get a vertical bar "|" inside a table field?
2311 :CUSTOM_ID: table-fields-with-vertical-bar
2314 You can use =\vert= to put a vertical bar inside a table field. This
2315 will be converted for export. To use it inside a word use
2316 =abc\vert{}def=. If you need something that looks like a bar in the Org
2317 mode buffer, you can use the unicode character brvbar which looks like
2320 ** How can I change the indentation of an entire table without fixing every line by hand?
2322 :CUSTOM_ID: change-indentation-entire-table
2325 #+index: Table!Indentation
2327 The indentation of a table is set by the first line. So just fix the
2328 indentation of the first line and realign with =TAB=.
2330 ** In my huge table the realigning after each TAB takes too long. What can I do?
2332 :CUSTOM_ID: table-realigning-after-TAB-takes-long
2335 #+index: Table!Realign
2337 Either split the table into several by inserting an empty line every
2338 100 lines or so. Or turn off the automatic re-align with
2340 : (setq org-table-automatic-realign nil)
2342 After this the only way to realign a table is to press =C-c C-c=. It
2343 will no longer happen automatically, removing the corresponding delays
2346 ** Recalculation of my table takes too long. What can I do?
2348 :CUSTOM_ID: Recalculation-of-my-table-takes-too-long
2351 #+index: Table!Calculation
2353 Nothing, really. The spreadsheet in org is mostly done to make
2354 calculations possible, not so much to make them fast. Since Org-mode is
2355 firmly committed to the ASCII format, nothing is stopping you from
2356 editing the table by hand. Therefore, there is no internal
2357 representation of the data. Each time Org-mode starts a computation, it
2358 must scan the table for special lines, find the fields etc. This is
2359 slow. Furthermore, Calc is slow compared to hardware computations. To
2360 make this work with normal editing, recalculation is not happening
2361 automatically, or only for the current line, so that the long wait for a
2362 full table iteration only happens when you ask for it.
2364 So for really complex tables, moving to a "real" spreadsheet may
2365 still be the best option.
2367 That said, there are some ways to optimize things in Org-mode, and I
2368 have been thinking about moving a bit further down this line.
2369 However, for my applications this has so far not been an issue at
2370 all. If you have a good case, you could try to convince me.
2372 ** When I export tables to HTML, they don't have borders.
2374 :CUSTOM_ID: table-borders-in-html-export
2379 By default, Org-mode exports tables without borders.
2381 You can changed this by placing an =#+ATTR_HTML= line before the table:
2383 : #+ATTR_HTML: border="2" rules="all" frame="all"
2385 See [[http://orgmode.org/manual/Tables-in-HTML-export.html#Tables-in-HTML-export][the manual]] for more details.
2387 ** Why does the Calc high precision (e. g. =p20=) not work like expected?
2389 :CUSTOM_ID: table-high-precision
2395 : | 1 / 2 * 3 | 0.16666667000000 |
2396 : #+TBLFM: $2 = $1; p20 %.14f
2399 : | 1 / 2 * 3 | 0.16666666666667 |
2400 : #+TBLFM: $2 = $1 +.0; p20 f-14
2404 It is important to distinguish between the precision of
2405 1) =p20=: Calc internal calculation (=calc-internal-prec=)
2406 2) =f-14=: Calc float formatting, unlimited in precision (=calc-float-format=)
2407 3) =%.14f=: the =printf= reformatting, limited in precision
2409 See [[http://orgmode.org/manual/Formula-syntax-for-Calc.html#Formula-syntax-for-Calc][the Org manual]] (org-version 6.35 or newer) for more details.
2411 Use =C-h v org-calc-default-modes RET= to check the Org default settings
2412 which are used if no format specifiers are added to a table formula.
2413 The examples below have been made with the out_of_the_box Org defaults
2414 =calc-internal-prec = 12= and =calc-float-format = 8=.
2416 Remember the formula debugger, toggled with =C-c {=,
2417 to view the processing stages like:
2418 | | formula debugger label | processing stage |
2420 |---+------------------------+----------------------------|
2421 | | Result: | output of Calc |
2422 | | Format: | reformatting with =printf= |
2424 Following are some examples to demonstrate
2425 the interaction of the three precisions.
2427 - *display precision limitations for Calc formulas*
2428 - limited by Calc internal calculation precision from Org default
2430 : | 0.16666666666700 |
2431 : #+TBLFM: $1 = 1 / 2 * 3; f-14
2433 : | 0.1666666666670000000 |
2434 : #+TBLFM: $1 = 1 / 2 * 3; f-19
2436 - limited by Calc float format from Org default (here =f8=)
2438 : #+TBLFM: $1 = 1 / 2 * 3
2441 : #+TBLFM: $1 = 1 / 2 * 3; p20
2443 : | 0.16666667000000 |
2444 : #+TBLFM: $1 = 1 / 2 * 3; %.14f
2446 : | 0.16666667000000 |
2447 : #+TBLFM: $1 = 1 / 2 * 3; p20 %.14f
2449 - limited by Calc float format specified
2451 : #+TBLFM: $1 = 1 / 2 * 3; f-6
2453 : | 0.16666666666667 |
2454 : #+TBLFM: $1 = 1 / 2 * 3; p20 f-14
2456 : | 0.1666666666666666667 |
2457 : #+TBLFM: $1 = 1 / 2 * 3; p20 f-19
2459 - limited by =printf= conversion to Emacs Lisp float
2460 : | 0.1666666699999999900 | the inaccuracy is platform dependent |
2461 : #+TBLFM: $1 = 1 / 2 * 3; %.19f
2463 : | 0.1666666699999999900 | the inaccuracy is platform dependent |
2464 : #+TBLFM: $1 = 1 / 2 * 3; p20 %.19f
2466 : | 0.1666666666666666600 | the inaccuracy is platform dependent |
2467 : #+TBLFM: $1 = 1 / 2 * 3; p20 f-20 %.19f
2469 - limited by =printf= format specified
2471 : #+TBLFM: $1 = 1 / 2 * 3; %.6f
2473 - *display precision limitations for Emacs Lisp formulas*
2474 - limited by Emacs Lisp float
2475 : | 0.16666666666666666 |
2476 : #+TBLFM: $1 = '(/ 1.0 (* 2 3))
2478 : | 0.1666666666666666574 | the inaccuracy is platform dependent |
2479 : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.19f
2481 - limited by =printf= format specified
2482 : | 0.16666666666667 |
2483 : #+TBLFM: $1 = '(/ 1.0 (* 2 3)); %.14f
2485 This FAQ entry is based on this [[http://thread.gmane.org/gmane.emacs.orgmode/22642][mailing list thread]]
2486 and is continued in the [[#table-float-fraction][next FAQ entry]].
2488 ** Which float format shows the fraction part also when the latter is zero?
2490 :CUSTOM_ID: table-float-fraction
2497 : #+TBLFM: $2 = $1; f-3
2500 : #+TBLFM: $2 = $1 +.0; f-3
2504 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]]
2505 in the section Mode Settings -> Display Modes -> Float Formats
2506 [[http://www.delorie.com/gnu/docs/calc/calc_163.html][found here as long as the section numbering is unchanged]].
2508 Remember the formula debugger, toggled with =C-c {=,
2509 to view the processing stages like:
2510 | | formula debugger label | processing stage |
2512 |---+------------------------+----------------------------|
2513 | | Result: | output of Calc |
2514 | | Format: | reformatting with =printf= |
2516 Following are some examples to demonstrate different float formats.
2519 : |-----------+---------+-------+---------+----------+-------|
2520 : | number | f3 | f-3 | +.0; f3 | +.0; f-3 | %.3f |
2521 : |-----------+---------+-------+---------+----------+-------|
2522 : | 1 | 1 | 1 | 1.000 | 1.000 | 1.000 |
2523 : | 0 | 0 | 0 | 0.000 | 0.000 | 0.000 |
2524 : |-----------+---------+-------+---------+----------+-------|
2525 : | 1.0 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
2526 : | 0.0 | 0.000 | 0.000 | 0.000 | 0.000 | 0.000 |
2527 : |-----------+---------+-------+---------+----------+-------|
2528 : | 1.0001666 | 1.000 | 1.000 | 1.000 | 1.000 | 1.000 |
2529 : | 0.0001666 | 1.67e-4 | 0.000 | 1.67e-4 | 0.000 | 0.000 |
2530 : |-----------+---------+-------+---------+----------+-------|
2531 : | 1.0016666 | 1.002 | 1.002 | 1.002 | 1.002 | 1.002 |
2532 : | 0.0016666 | 0.002 | 0.002 | 0.002 | 0.002 | 0.002 |
2533 : |-----------+---------+-------+---------+----------+-------|
2534 : #+TBLFM: $2 = $1; f3 :: $3 = $1; f-3 :: $4 = $1 +.0; f3 :: $5 = $1 +.0; f-3 :: $6 = $1; %.3f
2537 : |----------------------+--------------------------+-----------------------|
2538 : | number | f19 | f-19 |
2539 : |----------------------+--------------------------+-----------------------|
2542 : |----------------------+--------------------------+-----------------------|
2543 : | 1.0 | 1.0000000000000000000 | 1.0000000000000000000 |
2544 : | 0.0 | 0.0000000000000000000 | 0.0000000000000000000 |
2545 : |----------------------+--------------------------+-----------------------|
2546 : | 1 + 1 / 2 * 3 * 1e19 | 1.0000000000000000000 | 1.0000000000000000000 |
2547 : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
2548 : |----------------------+--------------------------+-----------------------|
2549 : | 1 + 1 / 2 * 3 * 1e18 | 1.0000000000000000002 | 1.0000000000000000002 |
2550 : | 0 + 1 / 2 * 3 * 1e18 | 0.0000000000000000002 | 0.0000000000000000002 |
2551 : |----------------------+--------------------------+-----------------------|
2552 : #+TBLFM: $2 = $1; p20 f19 :: $3 = $1; p20 f-19
2554 : |----------------------+--------------------------+-----------------------|
2555 : | number | +.0; f19 | +.0; f-19 |
2556 : |----------------------+--------------------------+-----------------------|
2557 : | 1 | 1.0000000000000000000 | 1.0000000000000000000 |
2558 : | 0 | 0.0000000000000000000 | 0.0000000000000000000 |
2559 : |----------------------+--------------------------+-----------------------|
2560 : | 1.0 | 1.0000000000000000000 | 1.0000000000000000000 |
2561 : | 0.0 | 0.0000000000000000000 | 0.0000000000000000000 |
2562 : |----------------------+--------------------------+-----------------------|
2563 : | 1 + 1 / 2 * 3 * 1e19 | 1.0000000000000000000 | 1.0000000000000000000 |
2564 : | 0 + 1 / 2 * 3 * 1e19 | 1.666666666666666667e-20 | 0.0000000000000000000 |
2565 : |----------------------+--------------------------+-----------------------|
2566 : | 1 + 1 / 2 * 3 * 1e18 | 1.0000000000000000002 | 1.0000000000000000002 |
2567 : | 0 + 1 / 2 * 3 * 1e18 | 0.0000000000000000002 | 0.0000000000000000002 |
2568 : |----------------------+--------------------------+-----------------------|
2569 : #+TBLFM: $2 = $1 +.0; p20 f19 :: $3 = $1 +.0; p20 f-19
2571 The =printf= reformatting (=%.19f=) cannot be used with high precision,
2572 see the [[#table-high-precision][previous FAQ entry]].
2574 ** How can I center tables in LaTeX output?
2576 :CATEGORY: centered-tables-in-latex
2579 #+index: Table!Center
2581 Set the `org-export-latex-tables-centered' to `t':
2583 : (defcustom org-export-latex-tables-centered t
2584 : "When non-nil, tables are exported in a center environment."
2585 : :group 'org-export-latex
2588 ** Can I exclude columns from a table when exporting it?
2594 :CUSTOM_ID: Footnotes
2596 ** How can I get automatic renumbering of footnotes in org-mode?
2598 :CUSTOM_ID: footnote-auto-adjust
2601 #+index: Footnotes!Renumbering
2603 You can add the following line to your .emacs file:
2605 : (setq org-footnote-auto-adjust t)
2607 Or, if you prefer, you can turn this option on locally by placing the
2608 following line at the top of your org file:
2610 : #+STARTUP: fnadjust
2612 When auto-adjust is turned on, footnotes in the file with numerical
2613 labels will be renumbered whenever a new footnote is added. Meanwhile,
2614 all footnotes, including those with custom labels such
2615 =[fn:custom-label ]=, will be sorted in the order of their appearance
2618 This emulates the footnote behavior that many users may be familiar
2619 with from word-processing programs or from the footnote-mode included
2622 If you do not turn on org-footnote-auto-adjust, you sort and/or
2623 renumber footnotes at any time by calling org-footnote-action with a
2626 ** Why isn't auto renumbering of footnotes turned on by default?
2628 :CUSTOM_ID: why-no-default-auto-adjust
2631 Org-mode has a very robust footnote mechanism allowing for a variety of
2632 types of footnotes. With some of the following footnote notations,
2633 auto-adjust may be either irrelevant or undesired:
2635 - Automatically numbered
2636 - Footnotes with custom labels
2639 In addition, Org-mode can be customized to place footnotes either at
2640 the end of a document or at the end of the outline heading in which
2641 they appear. Users who change this setting while editing a document
2642 may be disconcerted to find all of their footnotes rearranged
2645 ** I have auto-fill-mode set and org-mode is inserting unwanted comment markers!
2647 :CUSTOM_ID: auto-fill-and-unwanted-comments
2650 If the following occurs:
2655 ,# More entered tex.
2658 Make sure that the variable comment-start is nil.
2660 ** Are there any shortcuts for entering source blocks and comment lines?
2662 :CUSTOM_ID: shortcuts-for-entering-source-blocks
2665 Org-mode has some [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][very convenient markup]] for including literal blocks and
2666 lines of code in a file. (This is especially useful when exporting
2667 documents or using the contributed package [[file:org-contrib/babel/index.org][org-babel]] for executing blocks
2672 , print "Hello, world!\n";
2676 It can be tiresome to enter the block comment lines manually. There are
2677 several possible shortcuts you can use to enter them:
2679 1) Built-in expansion
2681 - Org-mode has a "secret" method of expanding source code blocks
2684 - If you type "<s" followed by =TAB= or =M-TAB=, a source block will
2687 - For a full list of expansions, type =M-x describe-variable
2688 [RET] org-structure-template-alist=.
2690 2) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Registers]]
2692 - Add the following line to your emacs file:
2694 =(set-register ?p "#+begin_src\n\n#+end_src perl")=
2696 - Then type =C-x r i p= to insert the source block. Please note: if
2697 you save another value to the register "p" with =C-x r s p=, it
2698 will overwrite the setting above for the current emacs session.
2700 3) [[http://orgmode.org/manual/Literal-examples.html#Literal-examples][Abbrevs]]
2702 - Activate the abbrev minor-mode in org-mode:
2708 + =(add-hook 'org-mode-hook (lambda () (abbrev-mode 1)))=
2710 - In org-mode, type "sbp" (a sample abbreviation for a perl source
2713 - Immediately after "sbp" type =C-x a i l=.
2715 - Enter the expansion:
2717 - =#+begin_src perl[C-q C-j][C-q C-j]#+end_src=
2719 - Note: =C-q C-j= creates a new line in the minibuffer
2721 - Now, whenever, you type sbp followed by =SPACE= or =RET= in an
2722 org-mode buffer, the src block will magically appear.
2724 - To review your list of abbrevs, type =M-x edit-abbrevs=.
2726 4) [[http://www.slashgear.com/nokia-n900-android-dual-boot-hack-video-2371099/][Skeletons]]
2728 - Skeletons offer a simple way of automatically entering text.
2729 Here's a skeleton that queries for the type of block and wraps
2730 the active region inside it:
2733 (define-skeleton skel-org-block
2734 "Insert an org block, querying for type."
2741 - Simply type skel-org-block to insert the block.
2743 - You can bind this to a key.
2745 - You can also create an abbrev that invokes this function:
2747 : (define-abbrev org-mode-abbrev-table "blk" "" 'skel-org-block)
2749 5) [[http://code.google.com/p/yasnippet/][Yasnippet]]
2751 - Several org-mode users install yasnippet for convenient, complex
2754 - See Bernt Hansen's [[http://doc.norang.ca/org-mode.html#Yasnippets][org-mode setup]] for a good introduction to
2757 * Capture and remember
2759 :CUSTOM_ID: Remember
2762 ** Can I use a variable or a function inside the `org-capture-templates' variable?
2764 :CUSTOM_ID: variable-inside-capture-templates
2769 Yes. Use [[http://www.gnu.org/s/emacs/manual/html_node/elisp/Backquote.html][backquotes]].
2771 E.g. if you have a variable called =org-test-file= and you want the
2772 variable =org-capture-templates= to "understand" (i.e. evaluate)
2773 =org-test-file= when Emacs evaluates the =(setq org-capture-templates
2774 [...])= expression, use backquotes like this:
2776 #+begin_src emacs-lisp
2777 (setq org-capture-templates
2778 `(("t" "Todo" entry (file+headline ,org-test-file "Tasks")
2779 "* TODO %?\n %i\n %a")
2780 ("b" "Buy" item (file+olp ,org-test-file "Stuff to Buy" "House")
2784 ** Can I use the remember buffer to clock a customer phone call?
2786 :CUSTOM_ID: use-remember-buffer-to-clock-phone-call
2789 Yes, you can. Take a look at the [[http://thread.gmane.org/gmane.emacs.orgmode/5482][setup described by Bernt Hansen]] and
2790 check out (in the same thread) what Nick Docos had to fix to make Bernt's
2791 set-up work for him.
2793 ** Can I automatically start the clock when opening a remember template?
2795 :CUSTOM_ID: start-clock-when-opening-remember-template
2798 #+index: Clock!Start
2800 Yes, this is possible. Use the following code and make sure that
2801 after executing it, `my-start-clock-if-needed' is in
2802 `remember-mode-hook' /after/ `org-remember-apply-template'.
2804 : (add-hook 'remember-mode-hook 'my-start-clock-if-needed 'append)
2805 : (defun my-start-clock-if-needed ()
2807 : (goto-char (point-min))
2808 : (when (re-search-forward " *CLOCK-IN *" nil t)
2809 : (replace-match "")
2812 Then, when a template contains the key string CLOCK-IN, the clock
2813 will be started. Starting with Org-mode version 5.20, the clock will
2814 automatically be stopped when storing the remember buffer.
2818 :CUSTOM_ID: Searches
2821 ** Isearch does not find string hidden in links. What can I do?
2823 :CUSTOM_ID: isearch-in-links
2828 M-x =visible-mode= will display the full link, making them searchable.
2830 ** How can I reduce the amount of context shown in sparse trees?
2832 :CUSTOM_ID: context-in-sparse-trees
2837 Take a look at the following variables:
2839 - =org-show-hierarchy-above=
2840 - =org-show-following-headline=
2841 - =org-show-siblings=
2842 - =org-show-entry-blow=
2844 which give command-dependent control over how much context is shown by a
2845 particular operation.
2847 ** How can I combine the results of two calls to =org-occur=?
2849 :CUSTOM_ID: two-calls-to-org-occur
2854 You can construct a regular expression that matches all targets you
2855 want. Alternatively, use a =C-u= prefix with the second and any
2856 further calls to =org-occur= to keep the current visibility and
2857 highlighting in addition to the new ones.
2864 ** How can I change the advanced warning time for deadlines?
2866 :CUSTOM_ID: warning-period-for-deadlines
2868 ##<<warning-period-for-deadlines>>
2870 #+index: DEADLINE!Warning
2872 Deadline warnings appear in the daily agenda view a specified number
2873 of days before the deadline is due. The default setting is 14 days.
2874 You can change this with the variable =org-deadline-warning-days=.
2875 (See [[http://orgmode.org/manual/Deadlines-and-scheduling.html#Deadlines-and-scheduling][this section]] of the manual.)
2879 : (setq org-deadline-warning-days 30)
2881 would cause warnings for each deadline to appear 30 days in advance.
2883 Naturally, you might not want warnings for all of your deadlines to
2884 appear so far in advance. Thus, you can change the lead time for
2885 individual items as follows:
2887 : * TODO Get a gift for the party
2888 : DEADLINE: <2009-01-16 Fri -2d>
2890 The "-2d" above changes the lead time for this deadline warning to two
2891 days in advance. You can also use "w" for weeks and "m" for months.
2893 ** How can I postpone a task until a certain date?
2895 :CUSTOM_ID: deferring-tasks
2900 The easiest way to postpone a task is to schedule it in the future. For
2901 instance, typing =C-c C-s +2w= on a headline will push a task two weeks
2902 into the future, so that it won't show up on the daily agenda until two
2905 If you'd like to prevent the task from showing up on your global todo list,
2906 you have a couple of options.
2908 1. You can set the variable =org-agenda-todo-ignore-scheduled= to
2909 =t=. This will exclude any scheduled items from your global list of
2910 active todos (=C-c a t=). (The variable
2911 =org-agenda-todo-ignore-with-date= will exclude both scheduled and
2912 deadline items from your todo list).
2914 2. You can remove the todo keyword from the item (C-c C-t <SPC>). The item
2915 will still appear on your agenda two weeks from today, but it won't show
2916 up on your todo lists.
2918 ** Can I send myself an email containing tasks or other agenda info?
2920 :CUSTOM_ID: email-containing-tasks-or-other-agenda-info
2923 Yes. See [[http://article.gmane.org/gmane.emacs.orgmode/6112][this thread]] on the list.
2925 ** How can I limit the agenda view to my "work" tasks?
2927 :CUSTOM_ID: limit-agenda-with-tag-filtering
2932 It is often convenient to group org files into separate categories, such
2933 as "home" and "work" (or "personal" and "professional"). One of the main
2934 reasons for such classification is to create agenda views that are
2935 limited by type of work or area of responsibility. For instance, while
2936 at work, one may want to see only professional tasks; while away from
2937 work, one may want to see only personal tasks.
2939 One way to categorize files and tasks is to use a "#+FILETAGS"
2940 declaration at the top of each file, such as:
2944 As long as org-use-tag-inheritance is turned on, the filetags will
2945 be inherited by all tasks in the file. A file can have multiple
2946 filetags. And, of course, tags can be added to individual headings.
2948 Tasks can be quickly filtered by tag from within the agenda by
2949 typing "/" and the name of the tag. The full key sequence to filter
2950 for work items in an agenda view would be:
2952 : C-c a a / work [or a tag shortcut]
2954 ** How can I limit the agenda view to a particular category?
2956 :CUSTOM_ID: limit-agenda-with-category-match
2959 #+index: Agenda view!Category
2961 Another way to filter agenda views by type of work is to use a
2962 "#+CATEGORY" declaration at the top of each file, such as:
2966 Categories can also be added to individual headings within a file:
2973 All todos belonging to the category "work" can be found a with a
2974 simple tags-todo search:
2978 At the prompt, type:
2982 The same results can be achieved with custom agenda commands, such as:
2984 #+BEGIN_SRC emacs-lisp
2985 (setq org-agenda-custom-commands
2986 '(("h" tags-todo "CATEGORY=\"home\"")
2987 ("w" tags-todo "CATEGORY=\"work\"")
2988 ;; other custom agenda commands here
2992 ** How can include all org files in a directory in my agenda?
2994 :CUSTOM_ID: set-agenda-files-using-wildcards
2997 #+index: Agenda!Directory
2999 You can simply include the directory (as one of the items) in the value of
3000 the variable org-agenda-files:
3002 : (setq org-agenda-files '("/my/special/path/org/"))
3004 There is another way of accomplishing the same end:
3006 : (setq org-agenda-files (file-expand-wildcards "/my/special/path/org/*.org"))
3008 ** Why aren't items disappearing from my agenda once they are marked done?
3010 :CUSTOM_ID: removing-done-items-from-agenda
3013 If items remain on your daily/weekly agenda after they are marked done,
3014 check the configuration of the following variables:
3016 : org-agenda-skip-scheduled-if-done
3017 : org-agenda-skip-deadline-if-done
3018 : org-agenda-skip-timestamp-if-done
3022 : M-x customize-variable RET org-agenda-skip-scheduled-if-done
3024 If this variable is turned off (=nil=), then scheduled items will
3025 remain on the agenda even after they are marked done.
3027 If the variable is turned on (=t=), then scheduled items will
3028 disappear from the agenda after they are marked done.
3030 If these settings seem not to behave the way you expect, then make
3031 sure you understand [[scheduled-vs-deadline-vs-timestamp][the
3032 difference between SCHEDULED, DEADLINE, and timestamps]].
3034 ** How do I keep repeating timestamps from being displayed multiple times?
3036 :CUSTOM_ID: repeating-timestamps-show-once
3039 #+index: Timestamp!Repeating
3041 To show only the /current/ instance of a repeating timestamp, put the
3042 following in your .emacs:
3044 #+begin_src emacs-lisp
3045 (setq org-agenda-repeating-timestamp-show-all nil)
3048 ** What is the difference between SCHEDULED, DEADLINE, and plain timestamps?
3050 :CUSTOM_ID: scheduled-vs-deadline-vs-timestamp
3057 1. SCHEDULED items (set with =C-c C-s=) will appear on your agenda on
3058 the day they are scheduled and on every day thereafter until they
3059 are done. Schedule a task if you want to be reminded to do
3060 something beginning on a certain day and until it is done.
3062 : ** TODO Scheduled item
3063 : SCHEDULED: <2009-03-01 Sun>
3065 2. Items with a DEADLINE timestamp (set with =C-c C-d=) appear on your
3066 agenda in advance of the when they are due and remain on your
3067 agenda until they are done. Add a DEADLINE to an item if you want
3068 to make sure to complete it by a certain date. (The variable
3069 org-deadline-warning-days determines how far in advance items with
3070 deadlines will show up in the agenda. See [[warning-period-for-deadlines][this FAQ]] for more
3073 : ** TODO Item with a deadline
3074 : DEADLINE: <2009-01-20 Tue>
3076 3. An active timestamp (set with =C-c .=) will appear on your agenda
3077 only on the day it is scheduled. Use a timestamp for appointments
3078 or any reminders you want to show up only on a particular day.
3080 : ** TODO Item with an active timestamp
3083 Note: items with inactive timestamps (set with C-c ! and marked by
3084 square brackets) will not show up in the agenda at all.
3086 ** Can I add files recursively to my list of agenda files?
3088 :CUSTOM_ID: set-agenda-files-recursively
3091 Yes, you can use the library =find-lisp=.
3093 : (load-library "find-lisp")
3094 : (setq org-agenda-files (find-lisp-find-files "~/org" "\.org$"))
3096 This will add all files ending in =org= in the directory "~/org"
3097 and all of its subdirectories to your list of agenda files.
3099 If on a *nix machine, you can also use the find utility, which can be
3100 faster than the find-lisp library:
3102 : (setq org-agenda-files
3103 : (mapcar 'abbreviate-file-name
3105 : (shell-command-to-string "find ~/org -name \"*.org\"") "\n")))
3108 See [[http://thread.gmane.org/gmane.emacs.orgmode/8992][this thread]] on the mailing list for more information.
3110 ** Why does an item appearing at the wrong time of day in my agenda?
3112 :CUSTOM_ID: agenda-wrong-time-of-day
3115 When preparing the agenda view, org-mode scans each relevant headline for a
3116 time designation. This approach is very nice for adding free-form
3117 timestamps to an item for scheduling. Thus, either of the following work
3118 would work to schedule an item at 10:00am:
3121 ,** 10:00am Get dried ice at the magic store
3122 , SCHEDULED: <2009-05-27 Wed>
3126 ,** Get dried ice at the magic store
3127 , SCHEDULED: <2009-05-27 Wed 10:00>
3130 To enable this flexibility, org-mode scans the entire headline for time of
3131 day notation. A potential problem can arise if you use inactive timestamps
3132 in the headline to note when an item was created. For example :
3135 ,** Get dried ice at the magic store [2009-05-26 Tue 12:58]
3136 , SCHEDULED: <2009-05-27 Wed>
3139 Org-mode would interpret the time in the inactive timestamp as a
3140 time-of-day indicator and the entry would appear in your agenda at
3143 If you would like to turn off the time-of-day search, you can configure the
3144 variable =org-agenda-search-headline-for-time= (requires org-mode >= 6.24).
3146 ** How can I change the visibility of an item from the agenda?
3148 :CUSTOM_ID: cycling-visibility-from-agenda
3151 #+index: Agenda!Visibility
3153 You can add a keybinding as follows:
3155 #+begin_src emacs-lisp
3156 (add-hook 'org-agenda-mode-hook
3158 (define-key org-agenda-mode-map " " 'org-agenda-cycle-show)))
3161 Then, as you press SPACE on an item on the agenda, it will cycle the
3162 visibility of its original location.
3164 ** Is there any way to set org-mode so that tags don't appear in the agenda view?
3166 See the =org-agenda-remove-tags= variable.
3168 ** I work late at night! How can I extend my current day past midnight?
3170 :CUSTOM_ID: org-extend-today-until
3173 If you work past midnight, you may not want your daily agenda view to
3174 switch to the next day at 12 a.m. (the default). To extend your day, simply
3175 set the value of org-extend-today-until to a positive number corresponding
3176 to the number of hours you work past midnight. For example, the following
3177 setting will cause the current day to extend until 6 a.m.
3179 : (setq org-extend-today-until 6)
3181 * Appointments/Diary
3183 :CUSTOM_ID: Appointments/Diary
3185 ** Is it possible to include entries from org-mode files into my emacs diary?
3187 :CUSTOM_ID: include-entries-from-org-mode-files-into-emacs-diary
3192 Since the org-mode agenda is much more powerful and can contain the
3193 diary, you should think twice before deciding to do this. If you
3194 insist, however, integrating Org-mode information into the diary is
3195 possible. You need to turn on /fancy diary display/ by setting in
3198 : (add-hook 'diary-display-hook 'diary-fancy-display)
3200 Then include the following line into your ~/diary file, in
3201 order to get the entries from all files listed in the variable
3206 You may also select specific files with
3208 : &%%(org-diary) ~/path/to/some/org-file.org
3209 : &%%(org-diary) ~/path/to/another/org-file.org
3211 If you now launch the calendar and press ~d~ to display a
3212 diary, the headlines of entries containing a timestamp, date range,
3213 schedule, or deadline referring to the selected date will be listed.
3214 Just like Org-mode's agenda view, the diary for /today/ contains
3215 additional entries for overdue deadlines and scheduled items. See
3216 also the documentation of the =org-diary= function. Under XEmacs, it
3217 is not possible to jump back from the diary to the org, this works
3218 only in the agenda buffer.
3219 ** I want to add my Org scheduled/deadlined entries in my diary!
3221 :CUSTOM_ID: add-Org-scheduled/deadlined-entries-to-diary!
3224 Put this in your ~/.diary:
3226 : &%%(org-diary :scheduled :timestamp :deadline)
3228 ** How can I set up automatic reminders based on Org information?
3230 :CUSTOM_ID: automatic-reminders
3235 See [[http://article.gmane.org/gmane.emacs.orgmode/5271][this post]] by N. Dokos on the list. See also Russell Adams's hack in
3236 [[http://orgmode.org/worg/org-hacks.html#org-agenda-appt-zenity][org-hacks]].
3238 ** How can I make =appt= notice my Org appointments?
3240 :CUSTOM_ID: appt-notice-my-Org-appointments
3243 #+index: Appointment
3246 : M-x org-agenda-to-appt RET
3248 ** How can I create more complex appointments in my org-files?
3250 :CUSTOM_ID: diary-sexp-in-org-files
3253 #+index: Appointment
3255 Org-mode's active timestamps work very well for scheduling individual
3256 or recurring appointments, such as:
3259 ,* 8:00am Dentist appointment <2009-01-16 Fri>
3265 , <2009-03-20 Fri>--<2009-04-01 Wed>
3271 ,* Weekly meeting with boss
3272 , <2009-01-20 Tue 14:00 +1w>
3275 Sometimes, however, you need to set up more complicated recurring
3276 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
3277 entries]] that work in [[http://www.gnu.org/software/emacs/manual/html_node/emacs/Diary.html#Diary][Emacs diary]].
3279 Let's say, for instance, that you teach a class that meets every Monday
3280 evening between February 16 and April 20, 2009. The way to enter this an
3284 ,** Class 7:00pm-9:00pm
3285 , <%%(and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009))>
3288 The expression above designates all Mondays that fall between February
3289 16 and April 20. How exactly does it work?
3291 - (and... :: Indicates that *both* of the conditions that follow have
3294 - (= 1 (calendar-day-of-week date)) :: Is the day of the week a
3297 - Note: the function calendar-day-of-week converts the date to the day of week
3298 expressed in numeric form, where 0 = Sunday, 1 = Monday, and so on.
3300 - (diary-block 2 16 2009 4 20 2009) :: Does the date fall between
3303 You can make a sexp as complex as you like. If you wanted to omit a week
3304 because of holidays, for instance, you could add another condition to the
3308 ,** Class 7:00pm-9:00pm
3309 , <%%(unless (diary-block 3 9 2009 3 13 2009) (and (= 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 2009)))>
3312 The sexp above would omit Monday during the week of March 9, 2009. For
3313 another way to accomplish the same thing, see [[org-diary-class][this FAQ]].
3315 Another diary function commonly used for more complex scheduling is
3316 diary-float. For instance,
3320 , <%%(diary-float t 3 3)>
3323 ... would appear on the third Wednesday of every month.
3325 For more ideas on how to create diary special expressions, see [[http://www.emacswiki.org/cgi-bin/wiki/DiaryMode][this
3326 page on the Emacs wiki]].
3328 ** How can I schedule a weekly class that lasts for a limited period of time?
3330 :CUSTOM_ID: org-class
3333 Org-mode offers a convenient diary sexp function for setting up a recurring
3334 appointment that lasts for a certain period of time, such as a class. It is
3335 called org-class and it can be entered as follows:
3338 ,** Class 7:00pm-9:00pm
3339 , <%%(org-class 2009 2 16 2009 4 20 1 10)>
3342 The function above schedules an appointment for every Monday (1)
3343 between February 16 and April 20, 2009, except for ISO week 10 (March
3346 If you would prefer not to place the timestamp in the headline, you can use
3347 the following format:
3351 ,<%%(org-class 2009 2 16 2009 4 20 1 10)> 7:00pm-9:00pm Class
3354 In this case, the string following the sexp will be displayed in the
3357 The function org-class has the following format:
3359 : (org-class Y1 M1 D1 Y2 M2 D2 DAYNAME &rest SKIP-WEEKS)
3361 Y1/2, M1/2, and D1/2 indicate the beginning and ending dates. DAYNAME takes
3362 the form of a number indicating the day of the week (0 = Sunday, 1 =
3363 Monday, and so on...). In addition, one can add an optional argument
3364 SKIP-WEEKS to indicate weeks on the calendar that should be skipped. This
3365 argument should be expressed as an ISO week number. You can find the number
3366 by invoking emacs' built-in calendar (=M-x calendar=), navigating to the
3367 appropriate week, and typing =p c (calendar-iso-print-date)=. If one of
3368 the SKIP-WEEKS is the symbol =holidays=, then any holidays known to the
3369 calendar are also skipped.
3371 Here is an alternative method, shared by Paul Sexton on the org mailing
3374 Let's say you are taking night classes in Spanish. The class is every
3375 Wednesday evening at 7pm, starting on 18 August, and runs for 8
3376 weeks. Org-mode's timestamps do not support limited occurrences of
3377 recurrent items -- you have to schedule the item with infinite recurrences,
3378 then delete it when it finishes.
3380 To schedule the Spanish classes, put the following in your =.emacs=:
3382 #+begin_src emacs-lisp
3383 (defun diary-limited-cyclic (recurrences interval m d y)
3384 "For use in emacs diary. Cyclic item with limited number of recurrences.
3385 Occurs every INTERVAL days, starting on YYYY-MM-DD, for a total of
3386 RECURRENCES occasions."
3387 (let ((startdate (calendar-absolute-from-gregorian (list m d y)))
3388 (today (calendar-absolute-from-gregorian date)))
3389 (and (not (minusp (- today startdate)))
3390 (zerop (% (- today startdate) interval))
3391 (< (floor (- today startdate) interval) recurrences))))
3394 The item in the org file looks like this:
3397 ,** 19:00-21:00 Spanish lessons
3398 , <%%(diary-limited-cyclic 8 7 8 18 2010)>
3401 ** How can I set an event to occur every day except Saturday and Sunday?
3405 , <%%(memq (calendar-day-of-week date) '(1 2 3 4 5))>
3408 ** How do I schedule events relative to Easter Sunday?
3410 Easter's date moves around from year to year according to a complicated
3411 set of criteria which I do not claim to understand. However the
3412 following code will allow you to schedule recurring events relative to
3415 Note: the function da-easter is from [[http://github.com/soren/elisp/blob/master/da-kalender.el][da-kalender.el]].
3417 Put the following in your .emacs:
3419 #+begin_src emacs-lisp
3420 (defun da-easter (year)
3421 "Calculate the date for Easter Sunday in YEAR. Returns the date in the
3422 Gregorian calendar, ie (MM DD YY) format."
3423 (let* ((century (1+ (/ year 100)))
3424 (shifted-epact (% (+ 14 (* 11 (% year 19))
3425 (- (/ (* 3 century) 4))
3426 (/ (+ 5 (* 8 century)) 25)
3429 (adjusted-epact (if (or (= shifted-epact 0)
3430 (and (= shifted-epact 1)
3431 (< 10 (% year 19))))
3434 (paschal-moon (- (calendar-absolute-from-gregorian
3437 (calendar-dayname-on-or-before 0 (+ paschal-moon 7))))
3440 (defun da-easter-gregorian (year)
3441 (calendar-gregorian-from-absolute (da-easter year)))
3443 (defun calendar-days-from-easter ()
3444 "When used in a diary sexp, this function will calculate how many days
3445 are between the current date (DATE) and Easter Sunday."
3446 (- (calendar-absolute-from-gregorian date)
3447 (da-easter (calendar-extract-year date))))
3450 Now we can schedule the public holidays associated with Easter as
3451 recurring events. Good Friday is 2 days before "Easter", Easter Monday
3456 , <%%(= -2 (calendar-days-from-easter))>
3459 , <%%(= 0 (calendar-days-from-easter))>
3462 , <%%(= 1 (calendar-days-from-easter))>
3465 [Source: Posted by Paul Sexton on Org-mode mailing list.]
3467 ** How to schedule public holiday that is "the nearest Monday to DATE"?
3469 In New Zealand each regional capital has an "Anniversary Day". The date
3470 of Auckland's anniversary day is "the nearest Monday to 29 January".
3472 Put this in your =.emacs=:
3474 #+begin_src emacs-lisp
3475 (defun calendar-nearest-to (target-dayname target-day target-month)
3476 "Recurring event that occurs in the nearest TARGET-DAYNAME to
3477 the date TARGET-DAY, TARGET-MONTH each year."
3479 (let* ((dayname (calendar-day-of-week date))
3480 (target-date (list target-month target-day (calendar-extract-year date)))
3481 (days-diff (abs (- (calendar-day-number date)
3482 (calendar-day-number target-date)))))
3483 (and (= dayname target-dayname)
3487 Now we can schedule Auckland Anniversary Day. The first argument, 1,
3488 means Monday (days of the week are numbered starting with Sunday=0).
3490 [Source: Originally posted by Paul Sexton on Org-mode mailing list.]
3492 ** How to schedule public holiday on "the 4th Monday in October"?
3496 This does not require any additions to =.emacs=:
3500 , <%%(diary-float 10 1 4)>
3503 ** Why isn't the agenda showing all the times I put under a single entry?
3505 :CATEGORY: multiple-timestamps-same-entry
3508 Probably because you have not set the following variable:
3510 : org-agenda-skip-additional-timestamps-same-entry
3512 The default value of this variable is t, which means that entries with
3513 multiple timestamps, such as the following...
3516 ,* Work really, really hard
3517 , <2010-11-20 Sat 10:00>
3518 , <2010-11-20 Sat 14:00>
3521 ... will only appear in the agenda at the time specified by the first
3522 timestamp. If you set =org-agenda-skip-additional-timestamps-same-entry= to
3523 nil, the item will appear will appear at all the times you specify.
3525 ** Can I import iCal events/appts from Gnus?
3530 Yes. Vagn Johansen wrote [[http://ozymandias.dk/emacs/org-import-calendar.el][org-import-calendar.el]] which lets you do this.
3536 ** Can I get TODO items exported to HTML as lists, rather than as headlines?
3538 :CUSTOM_ID: export-TODO-items-as-lists
3541 #+index: Export!HTML
3543 If you plan to use ASCII or HTML export, make sure things you want to
3544 be exported as item lists are level 4 at least, even if that does
3545 mean there is a level jump. For example:
3547 : * Todays top priorities
3548 : **** TODO write a letter to xyz
3549 : **** TODO Finish the paper
3550 : **** Pick up kids at the school
3552 Alternatively, if you need a specific value for the heading/item
3553 transition in a particular file, use the =#+OPTIONS= line to
3554 configure the H switch.
3556 : #+OPTIONS: H:2; ...
3558 ** Can I export only a single subtree?
3560 :CUSTOM_ID: export-single-subtree
3563 #+index: Export!Subtree
3565 If you want to export a subtree, mark the subtree as region and then
3566 export. Marking can be done with =C-c @ C-x C-x=, for example.
3568 Alternatively, you can select option =1= in the org export dispatcher
3569 (e.g.., =C-c C-e 1 h= to export the current subtree to html).
3571 By default, the title of the exported file will be set to the heading
3572 of the subtree. You can, however, [[#export-options-for-subtree][customize the title and other export
3575 ** How can I customize export options for a single subtree?
3577 :CUSTOM_ID: export-options-for-subtree
3580 #+index: Export!Options
3582 You can set unique export options for a [[#export-single-subtree][single subtree]] by using
3583 properties. Relevant properties include:
3588 - =EXPORT_FILE_NAME=
3589 - =EXPORT_OPTIONS= (corresponds to the =#+OPTIONS:= [[http://orgmode.org/manual/Export-options.html#Export-options][configuration line]])
3591 ** How can I tell my calendar web application about appointments in my agenda files?
3593 Here is what you need to do:
3595 1. a script that calls Emacs in batch mode and produce a .ics file
3596 2. a script that uploads this .ics file somewhere on the web
3597 3. tell your webapp to fetch this .ics file on the web
3599 Here is the script I use for the first step:
3601 #+begin_src shell-script-mode
3604 /usr/local/bin/emacs --batch --eval \
3605 "(progn (load-file \"~/install/git/org-mode/org.el\") \
3606 (load-file \"~/elisp/config/org-batch-config.el\") \
3607 (setq org-combined-agenda-icalendar-file \"~/org/cal/org.ics\")
3608 (setq org-agenda-files (quote (\"~/org/bzg.org\"))))" \
3609 -f org-export-icalendar-combine-agenda-files
3612 Depending on your configuration, you might change the load sequence.
3614 Here is the script I use for the second step:
3616 #+begin_src shell-script-mode
3618 /usr/bin/rsync -rtv ~/org/org.ics -e ssh me@my_server:/home/me/public_html/
3621 Note: if you want to cron this rsync script, you will need to let
3622 =my_server= to know about your SSH public key. Check [[http://troy.jdmz.net/rsync/index.html][this page]] as a
3625 Now you can cron the two scripts above and your webapp will always be
3626 up to date with your Org agendas.
3628 Also see [[http://orgmode.org/org.html#Exporting-Agenda-Views][Exporting agenda views]] from Org manual.
3630 ** How can I get Mac OSX 10.3 iCal to import my org-exported .ics files?
3632 :CUSTOM_ID: iCal-import-ics-files-old
3636 #+index: iCal!Mac OSX 10.3
3638 When using iCal under Apple MacOS X Tiger, you can create a new C-e c=,
3639 see the variables =org-icalendar-combined-name= and
3640 =org-combined-agenda-icalendar-file=). Then set Org-mode to overwrite
3641 the corresponding file /~/Library/Calendars/OrgMode.ics/. You may even
3642 use AppleScript to make iCal re-read the calendar files each time a new
3643 version of /OrgMode.ics/ is produced. Here is the setup needed for
3646 : (setq org-combined-agenda-icalendar-file
3647 : "~/Library/Calendars/OrgMode.ics")
3648 : (add-hook 'org-after-save-iCalendar-file-hook
3651 : "osascript -e 'tell application \"iCal\" to reload calendars'")))
3653 ** How can I get Mac OSX 10.4 or later iCal to import my Org-exported .ics files?
3655 :CUSTOM_ID: iCal-import-ics-files-new
3658 #+index: iCal!Mac OSX 10.4
3660 For Mac OS X 10.4, you need to write the ics file to
3661 =/Library/WebServer/Documents/= and then subscribe iCalendar to =http:
3662 //localhost/orgmode.ics=
3664 ** How can I remove timestamps and todo keywords from my exported file?
3666 :CUSTOM_ID: export-options-remove-timestamps
3669 #+index: Export!Timestamps
3670 #+index: Export!Todo keywords
3672 You can place an options line at the top of your org file:
3674 : #+OPTIONS: <:nil todo:nil
3676 There is a whole host of export options you can set with an in-buffer
3677 options or via global variables. See [[http://orgmode.org/manual/Export-options.html#Export-options][this section]] of the manual for a
3680 ** How can I preserve faces when I export an agenda from the command line?
3682 :CUSTOM_ID: preserving-faces-during-batch-export
3685 #+index: Export!Agenda
3686 #+index: Export!Faces
3688 Normally, when you export an org file or an agenda view from within
3689 emacs, htmlize will convert your face definitions to direct color css
3690 styles inlined into each =<span>= object, resulting in an HTML output
3691 that preserves the general look of your Org buffers and agenda views.
3693 Let's say you generate an export from the command line, such as the
3696 : emacs -batch -l ~/.emacs -eval '(org-batch-agenda "e")'
3700 : emacs -batch -l ~/.emacs -eval '(org-publish-all)'
3702 In such an instance, the exported HTML will contain only very basic
3703 color styles. The reason is that when Emacs is run in batch mode, it
3704 does not have a display and therefore only rudimentary face
3705 definitions. If you'd like to use more complex styles, you'll have to
3706 make sure that the export process only assigns classes instead of
3707 direct color values. This can be done by binding the variable
3708 =org-export-htmlize-output-style= to =css= for the duration of the
3709 export, for example with
3711 : emacs -batch -l ~/.emacs
3712 : -eval '(let ((org-export-htmlize-generate-css (quote css)))
3713 : (org-batch-agenda "e"))'
3715 Then you can use a style file to make these classes look any way you
3716 like. To generate face definitions for a CSS file based on any faces
3717 you are currently using in Emacs, you can use the following command:
3719 : M-x org-export-htmlize-generate-css RET
3721 This will generate a =<style>...</style>= section, the content of
3722 which you can add to your style file.
3724 ** How can I avoid dark color background when exporting agenda to ps format?
3726 :CUSTOM_ID: avoiding-dark-background-when-exporting-agenda
3731 Add this to your .emacs and evaluate it.
3733 #+BEGIN_SRC emacs-lisp
3734 (setq org-agenda-exporter-settings
3735 '((ps-print-color-p 'black-white)))
3738 ** How can I include e.g. an abstract in export to Latex and HTML?
3740 :CUSTOM_ID: include-abstract-in-export-to-latex-and-html
3743 #+index: Export!Abstract
3745 Org does not currently have special markup for abstracts, but for
3746 export purposes, you can extend the block-level structural and
3747 semantic markup in Org with the contributed package [[file:org-contrib/org-special-blocks.org][org-special-blocks]]
3748 (by Chris Gray). To turn it on, put this in your =.emacs=:
3750 : (require 'org-special-blocks)
3752 Now, you can mark up the abstract of your article like this:
3755 : Falling apples were observed and compared with pears. Newton's laws
3756 : were confirmed at the 95% confidence level.
3759 Exporting to Latex wraps this in a
3760 =\begin{abstract}....\end{abstract}= environment, which just works.
3762 HTML export wraps it in a ~<div class="abstract">...</div>~
3763 element. The HTML result won't look like anything special until you
3764 style it. Here is some sample CSS to get you started; put these in
3765 your document header:
3767 : #+STYLE: <style>.abstract {margin: 1em; padding: 1em; border: 1px solid black}
3768 : #+STYLE: .abstract:before {content: "Abstract: "; font-weight: bold}</style>
3770 Generally, =#+begin_foo= will work for any simple Latex =foo=
3771 environment not supported by existing Org markup.
3773 If you need to pass parameters, process the block content in some way,
3774 or support other exporters, you may want to consider whether you can
3775 customize it using Eric Schulte's [[file:org-contrib/org-exp-blocks.org][org-exp-blocks]] instead.
3777 ** How can I get colored source code when exporting to LaTeX?
3779 :CUSTOM_ID: fontified_source_code_w_latex
3782 #+index: Export!LaTeX
3784 As of Sun Aug 9 2009 the "current" version of Org-mode (see
3785 [[keeping-current-with-Org-mode-development]]) supports exporting
3786 source code to LaTeX using the listings package.
3788 To turn on listing export add the following to your Org-mode
3790 #+begin_src emacs-lisp
3791 ;; requite org-latex so that the following variables are defined
3792 (require 'org-latex)
3794 ;; tell org to use listings
3795 (setq org-export-latex-listings t)
3797 ;; you must include the listings package
3798 (add-to-list 'org-export-latex-packages-alist '("" "listings"))
3800 ;; if you want colored source code then you need to include the color package
3801 (add-to-list 'org-export-latex-packages-alist '("" "color"))
3804 The listings package will now be used to fontify source code in your
3805 LaTeX documents. By default listings will not color any of your
3806 source code. If you would like to set colors for keywords and
3807 comments in your latex documents you can do so using LaTeX directives
3810 \lstset{keywordstyle=\color{blue},
3811 commentstyle=\color{red},
3812 stringstyle=\color{green}
3816 of if you want to get even fancier with your colors you can try
3817 something like the following
3819 \definecolor{keywords}{RGB}{255,0,90}
3820 \definecolor{comments}{RGB}{60,179,113}
3821 \definecolor{fore}{RGB}{249,242,215}
3822 \definecolor{back}{RGB}{51,51,51}
3824 basicstyle=\color{fore},
3825 keywordstyle=\color{keywords},
3826 commentstyle=\color{comments},
3827 backgroundcolor=\color{back}
3831 For more complex listings use cases consult the [[ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/listings/listings.pdf][listings manual]].
3833 ** How can I export to Latex Beamer?
3838 #+index: Export!Beamer
3840 The latex [[http://latex-beamer.sourceforge.net/][Beamer Class]] is a useful class for generating slide shows.
3841 The following can be used to export Org-mode documents to LaTeX
3844 Add the following to your Emacs initialization file.
3845 #+begin_src emacs-lisp
3846 (unless (boundp 'org-export-latex-classes)
3847 (setq org-export-latex-classes nil))
3848 (add-to-list 'org-export-latex-classes
3850 "\\documentclass[11pt]{beamer}\n\\usepackage[utf8]{inputenc}\n\\usepackage[T1]{fontenc}\n\\usepackage{hyperref}\n\\usepackage{verbatim}\n"
3851 ("\\section{%s}" . "\\section*{%s}")
3852 ("\\begin{frame}\\frametitle{%s}" "\\end{frame}"
3853 "\\begin{frame}\\frametitle{%s}" "\\end{frame}")))
3857 : #+LaTeX_CLASS: beamer
3858 in the header of your Org-mode document it will automatically export
3859 to the Beamer document class on LaTeX export. With the above
3860 configuration top-level headers will be mapped to sections in the
3861 Beamer document, second-level headers will be mapped to frames, and
3862 lower level headlines will be mapped to itemize objects.
3864 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
3865 Thomas Dye]]. For a much more complex Beamer setup see the [[http://article.gmane.org/gmane.emacs.orgmode/17767/match=beamer+dokos][email by
3868 ** How can I use RefTeX in Org-mode files for LaTeX export and in Org-babel LaTeX code blocks?
3870 :CUSTOM_ID: using-reftex-in-org-mode
3875 #+index: Code blocks
3877 [[http://www.gnu.org/software/auctex/reftex.html][RefTeX]] is an indispensable tool for the author of LaTeX documents. It
3878 aids in creation of bibliographies, cross-references, indexes, and
3879 glossaries. RefTeX understands the structure of multi-file LaTeX
3880 documents and is able to collect from them information about the
3881 location(s) of external data stores used in creation of the final
3882 document. RefTeX was written by Carsten Dominik and is currently
3883 being maintained by the [[http://www.gnu.org/software/auctex/index.html][AucTeX]] project.
3885 *** Using RefTeX In Org-mode Files for LaTeX Export
3886 In Org-mode files for LaTeX export, the trick is to find a way to tell
3887 RefTeX the locations of external data stores. One way is to set the
3888 variable, =reftex-default-bibliography=. Add lines like these to
3891 #+begin_src emacs-lisp
3892 (setq reftex-default-bibliography
3894 ("default.bib" "other-default.bib")))
3897 In practice, this is a limited solution and the
3898 typical user will want to pass this information on a per-file basis.
3899 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
3902 The first solution, proposed by Mario, enables the RefTeX citation
3903 function in Org-mode. Add these lines to .emacs:
3905 #+begin_src emacs-lisp
3906 (defun org-mode-reftex-setup ()
3907 (load-library "reftex")
3908 (and (buffer-file-name)
3909 (file-exists-p (buffer-file-name))
3911 (define-key org-mode-map (kbd "C-c )") 'reftex-citation))
3912 (add-hook 'org-mode-hook 'org-mode-reftex-setup)
3915 Then add the following lines anywhere in the Org-mode file (Org-mode
3916 will recognize them as LaTeX commands):
3919 \bibliographystyle{plain}
3920 \bibliography{BIB-NAME}
3923 With this setup, =C-c )= will invoke =reftex-citation= which will
3924 insert a reference in the usual way:
3929 ,This is a citation \cite{tierney90}.
3931 ,\bibliographystyle{plain}
3935 This Org-mode file will export the following LaTeX output:
3937 #+begin_src latex :exports code
3938 % Created 2010-03-22 Mon 14:34
3939 \documentclass[11pt,letter]{article}
3940 \usepackage[utf8]{inputenc}
3941 \usepackage[T1]{fontenc}
3942 \usepackage{hyperref}
3946 \date{2010-03-22 Mon}
3952 \setcounter{tocdepth}{3}
3956 \section{test reftex}
3960 This is a citation \cite{tierney90}.
3962 \bibliographystyle{plain}