diff options
| author | Rasmus | 2017-06-21 13:20:20 +0200 |
|---|---|---|
| committer | Rasmus | 2017-06-22 11:54:18 +0200 |
| commit | 5cecd275820df825c51bf9a27fcc7e35f30ff273 (patch) | |
| tree | b3f72e63953613d565e6d5a35bec97f158eb603c /doc | |
| parent | 386a3da920482b8cb3e962fb944d135c8a770e26 (diff) | |
| download | emacs-5cecd275820df825c51bf9a27fcc7e35f30ff273.tar.gz emacs-5cecd275820df825c51bf9a27fcc7e35f30ff273.zip | |
Update Org to v9.0.9
Please see etc/ORG-NEWS for details.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/misc/org.texi | 9875 |
1 files changed, 5357 insertions, 4518 deletions
diff --git a/doc/misc/org.texi b/doc/misc/org.texi index fca5185337e..272788b1a11 100644 --- a/doc/misc/org.texi +++ b/doc/misc/org.texi | |||
| @@ -4,7 +4,8 @@ | |||
| 4 | @settitle The Org Manual | 4 | @settitle The Org Manual |
| 5 | @include docstyle.texi | 5 | @include docstyle.texi |
| 6 | 6 | ||
| 7 | @set VERSION 8.2.9 | 7 | @set VERSION 9.0.9 |
| 8 | @set DATE 2017-06-22 | ||
| 8 | 9 | ||
| 9 | @c Version and Contact Info | 10 | @c Version and Contact Info |
| 10 | @set MAINTAINERSITE @uref{http://orgmode.org,maintainers web page} | 11 | @set MAINTAINERSITE @uref{http://orgmode.org,maintainers web page} |
| @@ -284,8 +285,8 @@ modify this GNU manual.'' | |||
| 284 | 285 | ||
| 285 | @subtitle Release @value{VERSION} | 286 | @subtitle Release @value{VERSION} |
| 286 | @author by Carsten Dominik | 287 | @author by Carsten Dominik |
| 287 | with contributions by David O'Toole, Bastien Guerry, Philip Rooke, Dan | 288 | with contributions by Bastien Guerry, Nicolas Goaziou, Eric Schulte, |
| 288 | Davison, Eric Schulte, Thomas Dye, Jambunathan K and Nicolas Goaziou. | 289 | Jambunathan K, Dan Davison, Thomas Dye, David O'Toole, and Philip Rooke. |
| 289 | 290 | ||
| 290 | @c The following two commands start the copyright page. | 291 | @c The following two commands start the copyright page. |
| 291 | @page | 292 | @page |
| @@ -293,13 +294,14 @@ Davison, Eric Schulte, Thomas Dye, Jambunathan K and Nicolas Goaziou. | |||
| 293 | @insertcopying | 294 | @insertcopying |
| 294 | @end titlepage | 295 | @end titlepage |
| 295 | 296 | ||
| 297 | @c Output the short table of contents at the beginning. | ||
| 298 | @shortcontents | ||
| 299 | |||
| 296 | @c Output the table of contents at the beginning. | 300 | @c Output the table of contents at the beginning. |
| 297 | @contents | 301 | @contents |
| 298 | 302 | ||
| 299 | @ifnottex | 303 | @ifnottex |
| 300 | @c FIXME These hand-written next,prev,up node pointers make editing a lot | 304 | |
| 301 | @c harder. There should be no need for them, makeinfo can do it | ||
| 302 | @c automatically for any document with a normal structure. | ||
| 303 | @node Top, Introduction, (dir), (dir) | 305 | @node Top, Introduction, (dir), (dir) |
| 304 | @top Org Mode Manual | 306 | @top Org Mode Manual |
| 305 | 307 | ||
| @@ -308,23 +310,23 @@ Davison, Eric Schulte, Thomas Dye, Jambunathan K and Nicolas Goaziou. | |||
| 308 | 310 | ||
| 309 | @menu | 311 | @menu |
| 310 | * Introduction:: Getting started | 312 | * Introduction:: Getting started |
| 311 | * Document Structure:: A tree works like your brain | 313 | * Document structure:: A tree works like your brain |
| 312 | * Tables:: Pure magic for quick formatting | 314 | * Tables:: Pure magic for quick formatting |
| 313 | * Hyperlinks:: Notes in context | 315 | * Hyperlinks:: Notes in context |
| 314 | * TODO Items:: Every tree branch can be a TODO item | 316 | * TODO items:: Every tree branch can be a TODO item |
| 315 | * Tags:: Tagging headlines and matching sets of tags | 317 | * Tags:: Tagging headlines and matching sets of tags |
| 316 | * Properties and Columns:: Storing information about an entry | 318 | * Properties and columns:: Storing information about an entry |
| 317 | * Dates and Times:: Making items useful for planning | 319 | * Dates and times:: Making items useful for planning |
| 318 | * Capture - Refile - Archive:: The ins and outs for projects | 320 | * Capture - Refile - Archive:: The ins and outs for projects |
| 319 | * Agenda Views:: Collecting information into views | 321 | * Agenda views:: Collecting information into views |
| 320 | * Markup:: Prepare text for rich export | 322 | * Markup:: Prepare text for rich export |
| 321 | * Exporting:: Sharing and publishing notes | 323 | * Exporting:: Sharing and publishing notes |
| 322 | * Publishing:: Create a web site of linked Org files | 324 | * Publishing:: Create a web site of linked Org files |
| 323 | * Working With Source Code:: Export, evaluate, and tangle code blocks | 325 | * Working with source code:: Export, evaluate, and tangle code blocks |
| 324 | * Miscellaneous:: All the rest which did not fit elsewhere | 326 | * Miscellaneous:: All the rest which did not fit elsewhere |
| 325 | * Hacking:: How to hack your way around | 327 | * Hacking:: How to hack your way around |
| 326 | * MobileOrg:: Viewing and capture on a mobile device | 328 | * MobileOrg:: Viewing and capture on a mobile device |
| 327 | * History and Acknowledgments:: How Org came into being | 329 | * History and acknowledgments:: How Org came into being |
| 328 | * GNU Free Documentation License:: The license for this documentation. | 330 | * GNU Free Documentation License:: The license for this documentation. |
| 329 | * Main Index:: An index of Org's concepts and features | 331 | * Main Index:: An index of Org's concepts and features |
| 330 | * Key Index:: Key bindings and where they are described | 332 | * Key Index:: Key bindings and where they are described |
| @@ -363,11 +365,6 @@ Visibility cycling | |||
| 363 | * Initial visibility:: Setting the initial visibility state | 365 | * Initial visibility:: Setting the initial visibility state |
| 364 | * Catching invisible edits:: Preventing mistakes when editing invisible parts | 366 | * Catching invisible edits:: Preventing mistakes when editing invisible parts |
| 365 | 367 | ||
| 366 | Global and local cycling | ||
| 367 | |||
| 368 | * Initial visibility:: Setting the initial visibility state | ||
| 369 | * Catching invisible edits:: Preventing mistakes when editing invisible parts | ||
| 370 | |||
| 371 | Tables | 368 | Tables |
| 372 | 369 | ||
| 373 | * Built-in table editor:: Simple tables | 370 | * Built-in table editor:: Simple tables |
| @@ -434,7 +431,7 @@ Tags | |||
| 434 | 431 | ||
| 435 | * Tag inheritance:: Tags use the tree structure of the outline | 432 | * Tag inheritance:: Tags use the tree structure of the outline |
| 436 | * Setting tags:: How to assign tags to a headline | 433 | * Setting tags:: How to assign tags to a headline |
| 437 | * Tag groups:: Use one tag to search for several tags | 434 | * Tag hierarchy:: Create a hierarchy of tags |
| 438 | * Tag searches:: Searching for combinations of tags | 435 | * Tag searches:: Searching for combinations of tags |
| 439 | 436 | ||
| 440 | Properties and columns | 437 | Properties and columns |
| @@ -464,8 +461,7 @@ Dates and times | |||
| 464 | * Deadlines and scheduling:: Planning your work | 461 | * Deadlines and scheduling:: Planning your work |
| 465 | * Clocking work time:: Tracking how long you spend on a task | 462 | * Clocking work time:: Tracking how long you spend on a task |
| 466 | * Effort estimates:: Planning work effort in advance | 463 | * Effort estimates:: Planning work effort in advance |
| 467 | * Relative timer:: Notes with a running timer | 464 | * Timers:: Notes with a running timer |
| 468 | * Countdown timer:: Starting a countdown timer for a task | ||
| 469 | 465 | ||
| 470 | Creating timestamps | 466 | Creating timestamps |
| 471 | 467 | ||
| @@ -487,7 +483,7 @@ Capture - Refile - Archive | |||
| 487 | 483 | ||
| 488 | * Capture:: Capturing new stuff | 484 | * Capture:: Capturing new stuff |
| 489 | * Attachments:: Add files to tasks | 485 | * Attachments:: Add files to tasks |
| 490 | * RSS Feeds:: Getting input from RSS feeds | 486 | * RSS feeds:: Getting input from RSS feeds |
| 491 | * Protocols:: External (e.g., Browser) access to Emacs and Org | 487 | * Protocols:: External (e.g., Browser) access to Emacs and Org |
| 492 | * Refile and copy:: Moving/copying a tree from one place to another | 488 | * Refile and copy:: Moving/copying a tree from one place to another |
| 493 | * Archiving:: What to do with finished projects | 489 | * Archiving:: What to do with finished projects |
| @@ -517,7 +513,7 @@ Agenda views | |||
| 517 | * Presentation and sorting:: How agenda items are prepared for display | 513 | * Presentation and sorting:: How agenda items are prepared for display |
| 518 | * Agenda commands:: Remote editing of Org trees | 514 | * Agenda commands:: Remote editing of Org trees |
| 519 | * Custom agenda views:: Defining special searches and views | 515 | * Custom agenda views:: Defining special searches and views |
| 520 | * Exporting Agenda Views:: Writing a view to a file | 516 | * Exporting agenda views:: Writing a view to a file |
| 521 | * Agenda column view:: Using column view for collected entries | 517 | * Agenda column view:: Using column view for collected entries |
| 522 | 518 | ||
| 523 | The built-in agenda views | 519 | The built-in agenda views |
| @@ -540,114 +536,127 @@ Custom agenda views | |||
| 540 | 536 | ||
| 541 | * Storing searches:: Type once, use often | 537 | * Storing searches:: Type once, use often |
| 542 | * Block agenda:: All the stuff you need in a single buffer | 538 | * Block agenda:: All the stuff you need in a single buffer |
| 543 | * Setting Options:: Changing the rules | 539 | * Setting options:: Changing the rules |
| 544 | 540 | ||
| 545 | Markup for rich export | 541 | Markup for rich export |
| 546 | 542 | ||
| 547 | * Structural markup elements:: The basic structure as seen by the exporter | 543 | * Paragraphs:: The basic unit of text |
| 544 | * Emphasis and monospace:: Bold, italic, etc. | ||
| 545 | * Horizontal rules:: Make a line | ||
| 548 | * Images and tables:: Images, tables and caption mechanism | 546 | * Images and tables:: Images, tables and caption mechanism |
| 549 | * Literal examples:: Source code examples with special formatting | 547 | * Literal examples:: Source code examples with special formatting |
| 550 | * Include files:: Include additional files into a document | 548 | * Special symbols:: Greek letters and other symbols |
| 551 | * Index entries:: Making an index | 549 | * Subscripts and superscripts:: Simple syntax for raising/lowering text |
| 552 | * Macro replacement:: Use macros to create templates | ||
| 553 | * Embedded @LaTeX{}:: LaTeX can be freely used inside Org documents | 550 | * Embedded @LaTeX{}:: LaTeX can be freely used inside Org documents |
| 554 | * Special blocks:: Containers targeted at export back-ends | ||
| 555 | |||
| 556 | Structural markup elements | ||
| 557 | |||
| 558 | * Document title:: Where the title is taken from | ||
| 559 | * Headings and sections:: The document structure as seen by the exporter | ||
| 560 | * Table of contents:: The if and where of the table of contents | ||
| 561 | * Lists:: Lists | ||
| 562 | * Paragraphs:: Paragraphs | ||
| 563 | * Footnote markup:: Footnotes | ||
| 564 | * Emphasis and monospace:: Bold, italic, etc. | ||
| 565 | * Horizontal rules:: Make a line | ||
| 566 | * Comment lines:: What will *not* be exported | ||
| 567 | 551 | ||
| 568 | Embedded @LaTeX{} | 552 | Embedded @LaTeX{} |
| 569 | 553 | ||
| 570 | * Special symbols:: Greek letters and other symbols | ||
| 571 | * Subscripts and superscripts:: Simple syntax for raising/lowering text | ||
| 572 | * @LaTeX{} fragments:: Complex formulas made easy | 554 | * @LaTeX{} fragments:: Complex formulas made easy |
| 573 | * Previewing @LaTeX{} fragments:: What will this snippet look like? | 555 | * Previewing @LaTeX{} fragments:: What will this snippet look like? |
| 574 | * CDLaTeX mode:: Speed up entering of formulas | 556 | * CDLaTeX mode:: Speed up entering of formulas |
| 575 | 557 | ||
| 576 | Exporting | 558 | Exporting |
| 577 | 559 | ||
| 578 | * The Export Dispatcher:: The main exporter interface | 560 | * The export dispatcher:: The main interface |
| 579 | * Export back-ends:: Built-in export formats | 561 | * Export settings:: Common export settings |
| 580 | * Export settings:: Generic export settings | 562 | * Table of contents:: The if and where of the table of contents |
| 563 | * Include files:: Include additional files into a document | ||
| 564 | * Macro replacement:: Use macros to create templates | ||
| 565 | * Comment lines:: What will not be exported | ||
| 581 | * ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding | 566 | * ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding |
| 582 | * Beamer export:: Exporting as a Beamer presentation | 567 | * Beamer export:: Exporting as a Beamer presentation |
| 583 | * HTML export:: Exporting to HTML | 568 | * HTML export:: Exporting to HTML |
| 584 | * @LaTeX{} and PDF export:: Exporting to @LaTeX{}, and processing to PDF | 569 | * @LaTeX{} export:: Exporting to @LaTeX{}, and processing to PDF |
| 585 | * Markdown export:: Exporting to Markdown | 570 | * Markdown export:: Exporting to Markdown |
| 586 | * OpenDocument Text export:: Exporting to OpenDocument Text | 571 | * OpenDocument Text export:: Exporting to OpenDocument Text |
| 587 | * Org export:: Exporting to Org | 572 | * Org export:: Exporting to Org |
| 588 | * Texinfo export:: Exporting to Texinfo | 573 | * Texinfo export:: Exporting to Texinfo |
| 589 | * iCalendar export:: Exporting to iCalendar | 574 | * iCalendar export:: Exporting to iCalendar |
| 590 | * Other built-in back-ends:: Exporting to a man page | 575 | * Other built-in back-ends:: Exporting to a man page |
| 591 | * Export in foreign buffers:: Author tables and lists in Org syntax | ||
| 592 | * Advanced configuration:: Fine-tuning the export output | 576 | * Advanced configuration:: Fine-tuning the export output |
| 577 | * Export in foreign buffers:: Author tables and lists in Org syntax | ||
| 578 | |||
| 579 | Beamer export | ||
| 580 | |||
| 581 | * Beamer export commands:: For creating Beamer documents. | ||
| 582 | * Beamer specific export settings:: For customizing Beamer export. | ||
| 583 | * Sectioning Frames and Blocks in Beamer:: For composing Beamer slides. | ||
| 584 | * Beamer specific syntax:: For using in Org documents. | ||
| 585 | * Editing support:: For using helper functions. | ||
| 586 | * A Beamer example:: A complete presentation. | ||
| 593 | 587 | ||
| 594 | HTML export | 588 | HTML export |
| 595 | 589 | ||
| 596 | * HTML Export commands:: How to invoke HTML export | 590 | * HTML Export commands:: Invoking HTML export |
| 597 | * HTML doctypes:: Org can export to various (X)HTML flavors | 591 | * HTML Specific export settings:: Settings for HTML export |
| 598 | * HTML preamble and postamble:: How to insert a preamble and a postamble | 592 | * HTML doctypes:: Exporting various (X)HTML flavors |
| 599 | * Quoting HTML tags:: Using direct HTML in Org mode | 593 | * HTML preamble and postamble:: Inserting preamble and postamble |
| 600 | * Links in HTML export:: How links will be interpreted and formatted | 594 | * Quoting HTML tags:: Using direct HTML in Org files |
| 601 | * Tables in HTML export:: How to modify the formatting of tables | 595 | * Links in HTML export:: Interpreting and formatting links |
| 602 | * Images in HTML export:: How to insert figures into HTML output | 596 | * Tables in HTML export:: Formatting and modifying tables |
| 603 | * Math formatting in HTML export:: Beautiful math also on the web | 597 | * Images in HTML export:: Inserting figures with HTML output |
| 604 | * Text areas in HTML export:: An alternative way to show an example | 598 | * Math formatting in HTML export:: Handling math equations |
| 605 | * CSS support:: Changing the appearance of the output | 599 | * Text areas in HTML export:: Showing an alternate approach, an example |
| 606 | * JavaScript support:: Info and Folding in a web browser | 600 | * CSS support:: Styling HTML output |
| 607 | 601 | * JavaScript support:: Folding scripting in the web browser | |
| 608 | @LaTeX{} and PDF export | 602 | |
| 609 | 603 | @LaTeX{} export | |
| 610 | * @LaTeX{} export commands:: How to export to LaTeX and PDF | 604 | |
| 611 | * Header and sectioning:: Setting up the export file structure | 605 | * @LaTeX{} export commands:: For producing @LaTeX{} and PDF documents. |
| 612 | * Quoting @LaTeX{} code:: Incorporating literal @LaTeX{} code | 606 | * @LaTeX{} specific export settings:: Unique to this @LaTeX{} back-end. |
| 613 | * @LaTeX{} specific attributes:: Controlling @LaTeX{} output | 607 | * @LaTeX{} header and sectioning:: For file structure. |
| 608 | * Quoting @LaTeX{} code:: Directly in the Org document. | ||
| 609 | * Tables in @LaTeX{} export:: Attributes specific to tables. | ||
| 610 | * Images in @LaTeX{} export:: Attributes specific to images. | ||
| 611 | * Plain lists in @LaTeX{} export:: Attributes specific to lists. | ||
| 612 | * Source blocks in @LaTeX{} export:: Attributes specific to source code blocks. | ||
| 613 | * Example blocks in @LaTeX{} export:: Attributes specific to example blocks. | ||
| 614 | * Special blocks in @LaTeX{} export:: Attributes specific to special blocks. | ||
| 615 | * Horizontal rules in @LaTeX{} export:: Attributes specific to horizontal rules. | ||
| 614 | 616 | ||
| 615 | OpenDocument Text export | 617 | OpenDocument Text export |
| 616 | 618 | ||
| 617 | * Pre-requisites for ODT export:: What packages ODT exporter relies on | 619 | * Pre-requisites for ODT export:: Required packages. |
| 618 | * ODT export commands:: How to invoke ODT export | 620 | * ODT export commands:: Invoking export. |
| 619 | * Extending ODT export:: How to produce @samp{doc}, @samp{pdf} files | 621 | * ODT specific export settings:: Configuration options. |
| 620 | * Applying custom styles:: How to apply custom styles to the output | 622 | * Extending ODT export:: Producing @file{.doc}, @file{.pdf} files. |
| 621 | * Links in ODT export:: How links will be interpreted and formatted | 623 | * Applying custom styles:: Styling the output. |
| 622 | * Tables in ODT export:: How Tables are exported | 624 | * Links in ODT export:: Handling and formatting links. |
| 623 | * Images in ODT export:: How to insert images | 625 | * Tables in ODT export:: Org table conversions. |
| 624 | * Math formatting in ODT export:: How @LaTeX{} fragments are formatted | 626 | * Images in ODT export:: Inserting images. |
| 625 | * Labels and captions in ODT export:: How captions are rendered | 627 | * Math formatting in ODT export:: Formatting @LaTeX{} fragments. |
| 626 | * Literal examples in ODT export:: How source and example blocks are formatted | 628 | * Labels and captions in ODT export:: Rendering objects. |
| 627 | * Advanced topics in ODT export:: Read this if you are a power user | 629 | * Literal examples in ODT export:: For source code and example blocks. |
| 630 | * Advanced topics in ODT export:: For power users. | ||
| 628 | 631 | ||
| 629 | Math formatting in ODT export | 632 | Math formatting in ODT export |
| 630 | 633 | ||
| 631 | * Working with @LaTeX{} math snippets:: How to embed @LaTeX{} math fragments | 634 | * Working with @LaTeX{} math snippets:: Embedding in @LaTeX{} format. |
| 632 | * Working with MathML or OpenDocument formula files:: How to embed equations in native format | 635 | * Working with MathML or OpenDocument formula files:: Embedding in native format. |
| 633 | 636 | ||
| 634 | Advanced topics in ODT export | 637 | Advanced topics in ODT export |
| 635 | 638 | ||
| 636 | * Configuring a document converter:: How to register a document converter | 639 | * Configuring a document converter:: Registering a document converter. |
| 637 | * Working with OpenDocument style files:: Explore the internals | 640 | * Working with OpenDocument style files:: Exploring internals. |
| 638 | * Creating one-off styles:: How to produce custom highlighting etc | 641 | * Creating one-off styles:: Customizing styles, highlighting. |
| 639 | * Customizing tables in ODT export:: How to define and use Table templates | 642 | * Customizing tables in ODT export:: Defining table templates. |
| 640 | * Validating OpenDocument XML:: How to debug corrupt OpenDocument files | 643 | * Validating OpenDocument XML:: Debugging corrupted OpenDocument files. |
| 641 | 644 | ||
| 642 | Texinfo export | 645 | Texinfo export |
| 643 | 646 | ||
| 644 | * Texinfo export commands:: How to invoke Texinfo export | 647 | * Texinfo export commands:: Invoking commands. |
| 645 | * Document preamble:: File header, title and copyright page | 648 | * Texinfo specific export settings:: Setting the environment. |
| 646 | * Headings and sectioning structure:: Building document structure | 649 | * Texinfo file header:: Generating the header. |
| 647 | * Indices:: Creating indices | 650 | * Texinfo title and copyright page:: Creating preamble pages. |
| 648 | * Quoting Texinfo code:: Incorporating literal Texinfo code | 651 | * Info directory file:: Installing a manual in Info file hierarchy. |
| 649 | * Texinfo specific attributes:: Controlling Texinfo output | 652 | * Headings and sectioning structure:: Building document structure. |
| 650 | * An example:: | 653 | * Indices:: Creating indices. |
| 654 | * Quoting Texinfo code:: Incorporating literal Texinfo code. | ||
| 655 | * Plain lists in Texinfo export:: List attributes. | ||
| 656 | * Tables in Texinfo export:: Table attributes. | ||
| 657 | * Images in Texinfo export:: Image attributes. | ||
| 658 | * Special blocks in Texinfo export:: Special block attributes. | ||
| 659 | * A Texinfo example:: Processing Org to Texinfo. | ||
| 651 | 660 | ||
| 652 | Publishing | 661 | Publishing |
| 653 | 662 | ||
| @@ -694,36 +703,32 @@ Header arguments | |||
| 694 | 703 | ||
| 695 | Using header arguments | 704 | Using header arguments |
| 696 | 705 | ||
| 697 | * System-wide header arguments:: Set global default values | 706 | * System-wide header arguments:: Set globally, language-specific |
| 698 | * Language-specific header arguments:: Set default values by language | 707 | * Language-specific header arguments:: Set in the Org file's headers |
| 699 | * Header arguments in Org mode properties:: Set default values for a buffer or heading | 708 | * Header arguments in Org mode properties:: Set in the Org file |
| 700 | * Language-specific header arguments in Org mode properties:: Set language-specific default values for a buffer or heading | 709 | * Language-specific mode properties:: |
| 701 | * Code block specific header arguments:: The most common way to set values | 710 | * Code block specific header arguments:: The most commonly used method |
| 702 | * Header arguments in function calls:: The most specific level | 711 | * Arguments in function calls:: The most specific level, takes highest priority |
| 703 | 712 | ||
| 704 | Specific header arguments | 713 | Specific header arguments |
| 705 | 714 | ||
| 706 | * var:: Pass arguments to code blocks | 715 | * var:: Pass arguments to @samp{src} code blocks |
| 707 | * results:: Specify the type of results and how they will | 716 | * results:: Specify results type; how to collect |
| 708 | be collected and handled | 717 | * file:: Specify a path for output file |
| 709 | * file:: Specify a path for file output | ||
| 710 | * file-desc:: Specify a description for file results | 718 | * file-desc:: Specify a description for file results |
| 711 | * dir:: Specify the default (possibly remote) | 719 | * file-ext:: Specify an extension for file output |
| 712 | directory for code block execution | 720 | * output-dir:: Specify a directory for output file |
| 713 | * exports:: Export code and/or results | 721 | * dir:: Specify the default directory for code block execution |
| 714 | * tangle:: Toggle tangling and specify file name | 722 | * exports:: Specify exporting code, results, both, none |
| 715 | * mkdirp:: Toggle creation of parent directories of target | 723 | * tangle:: Toggle tangling; or specify file name |
| 716 | files during tangling | 724 | * mkdirp:: Toggle for parent directory creation for target files during tangling |
| 717 | * comments:: Toggle insertion of comments in tangled | 725 | * comments:: Toggle insertion of comments in tangled code files |
| 718 | code files | 726 | * padline:: Control insertion of padding lines in tangled code files |
| 719 | * padline:: Control insertion of padding lines in tangled | 727 | * no-expand:: Turn off variable assignment and noweb expansion during tangling |
| 720 | code files | ||
| 721 | * no-expand:: Turn off variable assignment and noweb | ||
| 722 | expansion during tangling | ||
| 723 | * session:: Preserve the state of code evaluation | 728 | * session:: Preserve the state of code evaluation |
| 724 | * noweb:: Toggle expansion of noweb references | 729 | * noweb:: Toggle expansion of noweb references |
| 725 | * noweb-ref:: Specify block's noweb reference resolution target | 730 | * noweb-ref:: Specify block's noweb reference resolution target |
| 726 | * noweb-sep:: String used to separate noweb references | 731 | * noweb-sep:: String to separate noweb references |
| 727 | * cache:: Avoid re-evaluating unchanged code blocks | 732 | * cache:: Avoid re-evaluating unchanged code blocks |
| 728 | * sep:: Delimiter for writing tabular results outside Org | 733 | * sep:: Delimiter for writing tabular results outside Org |
| 729 | * hlines:: Handle horizontal lines in tables | 734 | * hlines:: Handle horizontal lines in tables |
| @@ -733,22 +738,22 @@ Specific header arguments | |||
| 733 | * tangle-mode:: Set permission of tangled files | 738 | * tangle-mode:: Set permission of tangled files |
| 734 | * eval:: Limit evaluation of specific code blocks | 739 | * eval:: Limit evaluation of specific code blocks |
| 735 | * wrap:: Mark source block evaluation results | 740 | * wrap:: Mark source block evaluation results |
| 736 | * post:: Post processing of code block results | 741 | * post:: Post processing of results of code block evaluation |
| 737 | * prologue:: Text to prepend to code block body | 742 | * prologue:: Text to prepend to body of code block |
| 738 | * epilogue:: Text to append to code block body | 743 | * epilogue:: Text to append to body of code block |
| 739 | 744 | ||
| 740 | Miscellaneous | 745 | Miscellaneous |
| 741 | 746 | ||
| 742 | * Completion:: M-TAB knows what you need | 747 | * Completion:: M-TAB guesses completions |
| 743 | * Easy Templates:: Quick insertion of structural elements | 748 | * Easy templates:: Quick insertion of structural elements |
| 744 | * Speed keys:: Electric commands at the beginning of a headline | 749 | * Speed keys:: Electric commands at the beginning of a headline |
| 745 | * Code evaluation security:: Org mode files evaluate inline code | 750 | * Code evaluation security:: Org mode files evaluate inline code |
| 746 | * Customization:: Adapting Org to your taste | 751 | * Customization:: Adapting Org to changing tastes |
| 747 | * In-buffer settings:: Overview of the #+KEYWORDS | 752 | * In-buffer settings:: Overview of the #+KEYWORDS |
| 748 | * The very busy C-c C-c key:: When in doubt, press C-c C-c | 753 | * The very busy C-c C-c key:: When in doubt, press C-c C-c |
| 749 | * Clean view:: Getting rid of leading stars in the outline | 754 | * Clean view:: Getting rid of leading stars in the outline |
| 750 | * TTY keys:: Using Org on a tty | 755 | * TTY keys:: Using Org on a tty |
| 751 | * Interaction:: Other Emacs packages | 756 | * Interaction:: With other Emacs packages |
| 752 | * org-crypt:: Encrypting Org files | 757 | * org-crypt:: Encrypting Org files |
| 753 | 758 | ||
| 754 | Interaction with other packages | 759 | Interaction with other packages |
| @@ -780,14 +785,14 @@ Tables and lists in arbitrary syntax | |||
| 780 | 785 | ||
| 781 | MobileOrg | 786 | MobileOrg |
| 782 | 787 | ||
| 783 | * Setting up the staging area:: Where to interact with the mobile device | 788 | * Setting up the staging area:: For the mobile device |
| 784 | * Pushing to MobileOrg:: Uploading Org files and agendas | 789 | * Pushing to MobileOrg:: Uploading Org files and agendas |
| 785 | * Pulling from MobileOrg:: Integrating captured and flagged items | 790 | * Pulling from MobileOrg:: Integrating captured and flagged items |
| 786 | 791 | ||
| 787 | @end detailmenu | 792 | @end detailmenu |
| 788 | @end menu | 793 | @end menu |
| 789 | 794 | ||
| 790 | @node Introduction, Document Structure, Top, Top | 795 | @node Introduction |
| 791 | @chapter Introduction | 796 | @chapter Introduction |
| 792 | @cindex introduction | 797 | @cindex introduction |
| 793 | 798 | ||
| @@ -799,79 +804,65 @@ MobileOrg | |||
| 799 | * Conventions:: Typesetting conventions in the manual | 804 | * Conventions:: Typesetting conventions in the manual |
| 800 | @end menu | 805 | @end menu |
| 801 | 806 | ||
| 802 | @node Summary, Installation, Introduction, Introduction | 807 | @node Summary |
| 803 | @section Summary | 808 | @section Summary |
| 804 | @cindex summary | 809 | @cindex summary |
| 805 | 810 | ||
| 806 | Org is a mode for keeping notes, maintaining TODO lists, and doing | 811 | Org is a mode for keeping notes, maintaining TODO lists, and project planning |
| 807 | project planning with a fast and effective plain-text system. | 812 | with a fast and effective plain-text system. It also is an authoring system |
| 808 | 813 | with unique support for literate programming and reproducible research. | |
| 809 | Org develops organizational tasks around NOTES files that contain | 814 | |
| 810 | lists or information about projects as plain text. Org is | 815 | Org is implemented on top of Outline mode, which makes it possible to keep |
| 811 | implemented on top of Outline mode, which makes it possible to keep the | 816 | the content of large files well structured. Visibility cycling and structure |
| 812 | content of large files well structured. Visibility cycling and | 817 | editing help to work with the tree. Tables are easily created with a |
| 813 | structure editing help to work with the tree. Tables are easily created | 818 | built-in table editor. Plain text URL-like links connect to websites, |
| 814 | with a built-in table editor. Org supports TODO items, deadlines, | 819 | emails, Usenet messages, BBDB entries, and any files related to the projects. |
| 815 | timestamps, and scheduling. It dynamically compiles entries into an | 820 | |
| 816 | agenda that utilizes and smoothly integrates much of the Emacs calendar | 821 | Org develops organizational tasks around notes files that contain lists or |
| 817 | and diary. Plain text URL-like links connect to websites, emails, | 822 | information about projects as plain text. Project planning and task |
| 818 | Usenet messages, BBDB entries, and any files related to the projects. | 823 | management makes use of metadata which is part of an outline node. Based on |
| 819 | For printing and sharing notes, an Org file can be exported as a | 824 | this data, specific entries can be extracted in queries and create dynamic |
| 820 | structured ASCII file, as HTML, or (TODO and agenda items only) as an | 825 | @i{agenda views} that also integrate the Emacs calendar and diary. Org can |
| 821 | iCalendar file. It can also serve as a publishing tool for a set of | 826 | be used to implement many different project planning schemes, such as David |
| 822 | linked web pages. | 827 | Allen's GTD system. |
| 823 | 828 | ||
| 824 | As a project planning environment, Org works by adding metadata to outline | 829 | Org files can serve as a single source authoring system with export to many |
| 825 | nodes. Based on this data, specific entries can be extracted in queries and | 830 | different formats such as HTML, @LaTeX{}, Open Document, and Markdown. New |
| 826 | create dynamic @i{agenda views}. | 831 | export backends can be derived from existing ones, or defined from scratch. |
| 827 | 832 | ||
| 828 | Org mode contains the Org Babel environment which allows you to work with | 833 | Org files can include source code blocks, which makes Org uniquely suited for |
| 829 | embedded source code blocks in a file, to facilitate code evaluation, | 834 | authoring technical documents with code examples. Org source code blocks are |
| 830 | documentation, and literate programming techniques. | 835 | fully functional; they can be evaluated in place and their results can be |
| 831 | 836 | captured in the file. This makes it possible to create a single file | |
| 832 | Org's automatic, context-sensitive table editor with spreadsheet | 837 | reproducible research compendium. |
| 833 | capabilities can be integrated into any major mode by activating the | 838 | |
| 834 | minor Orgtbl mode. Using a translation step, it can be used to maintain | 839 | Org keeps simple things simple. When first fired up, it should feel like a |
| 835 | tables in arbitrary file types, for example in @LaTeX{}. The structure | 840 | straightforward, easy to use outliner. Complexity is not imposed, but a |
| 836 | editing and list creation capabilities can be used outside Org with | 841 | large amount of functionality is available when needed. Org is a toolbox. |
| 837 | the minor Orgstruct mode. | 842 | Many users actually run only a (very personal) fraction of Org's capabilities, and |
| 838 | 843 | know that there is more whenever they need it. | |
| 839 | Org keeps simple things simple. When first fired up, it should | 844 | |
| 840 | feel like a straightforward, easy to use outliner. Complexity is not | 845 | All of this is achieved with strictly plain text files, the most portable and |
| 841 | imposed, but a large amount of functionality is available when you need | 846 | future-proof file format. Org runs in Emacs. Emacs is one of the most |
| 842 | it. Org is a toolbox and can be used in different ways and for different | 847 | widely ported programs, so that Org mode is available on every major |
| 843 | ends, for example: | 848 | platform. |
| 844 | |||
| 845 | @example | ||
| 846 | @r{@bullet{} an outline extension with visibility cycling and structure editing} | ||
| 847 | @r{@bullet{} an ASCII system and table editor for taking structured notes} | ||
| 848 | @r{@bullet{} a TODO list editor} | ||
| 849 | @r{@bullet{} a full agenda and planner with deadlines and work scheduling} | ||
| 850 | @pindex GTD, Getting Things Done | ||
| 851 | @r{@bullet{} an environment in which to implement David Allen's GTD system} | ||
| 852 | @r{@bullet{} a simple hypertext system, with HTML and @LaTeX{} export} | ||
| 853 | @r{@bullet{} a publishing tool to create a set of interlinked web pages} | ||
| 854 | @r{@bullet{} an environment for literate programming} | ||
| 855 | @end example | ||
| 856 | 849 | ||
| 857 | @cindex FAQ | 850 | @cindex FAQ |
| 858 | There is a website for Org which provides links to the newest | 851 | There is a website for Org which provides links to the newest |
| 859 | version of Org, as well as additional information, frequently asked | 852 | version of Org, as well as additional information, frequently asked |
| 860 | questions (FAQ), links to tutorials, etc. This page is located at | 853 | questions (FAQ), links to tutorials, etc. This page is located at |
| 861 | @uref{http://orgmode.org}. | 854 | @uref{http://orgmode.org}. |
| 862 | |||
| 863 | @cindex print edition | 855 | @cindex print edition |
| 864 | The version 7.3 of this manual is available as a | ||
| 865 | @uref{http://www.network-theory.co.uk/org/manual/, paperback book from Network | ||
| 866 | Theory Ltd.} | ||
| 867 | 856 | ||
| 868 | @page | 857 | An earlier version (7.3) of this manual is available as a |
| 858 | @uref{http://www.network-theory.co.uk/org/manual/, paperback book from | ||
| 859 | Network Theory Ltd.} | ||
| 869 | 860 | ||
| 861 | @page | ||
| 870 | 862 | ||
| 871 | @node Installation, Activation, Summary, Introduction | 863 | @node Installation |
| 872 | @section Installation | 864 | @section Installation |
| 873 | @cindex installation | 865 | @cindex installation |
| 874 | @cindex XEmacs | ||
| 875 | 866 | ||
| 876 | Org is part of recent distributions of GNU Emacs, so you normally don't need | 867 | Org is part of recent distributions of GNU Emacs, so you normally don't need |
| 877 | to install it. If, for one reason or another, you want to install Org on top | 868 | to install it. If, for one reason or another, you want to install Org on top |
| @@ -895,7 +886,7 @@ been visited, i.e., where no Org built-in function have been loaded. | |||
| 895 | Otherwise autoload Org functions will mess up the installation. | 886 | Otherwise autoload Org functions will mess up the installation. |
| 896 | 887 | ||
| 897 | Then, to make sure your Org configuration is taken into account, initialize | 888 | Then, to make sure your Org configuration is taken into account, initialize |
| 898 | the package system with @code{(package-initialize)} in your @file{.emacs} | 889 | the package system with @code{(package-initialize)} in your Emacs init file |
| 899 | before setting any Org option. If you want to use Org's package repository, | 890 | before setting any Org option. If you want to use Org's package repository, |
| 900 | check out the @uref{http://orgmode.org/elpa.html, Org ELPA page}. | 891 | check out the @uref{http://orgmode.org/elpa.html, Org ELPA page}. |
| 901 | 892 | ||
| @@ -903,7 +894,7 @@ check out the @uref{http://orgmode.org/elpa.html, Org ELPA page}. | |||
| 903 | 894 | ||
| 904 | You can download Org latest release from @uref{http://orgmode.org/, Org's | 895 | You can download Org latest release from @uref{http://orgmode.org/, Org's |
| 905 | website}. In this case, make sure you set the load-path correctly in your | 896 | website}. In this case, make sure you set the load-path correctly in your |
| 906 | @file{.emacs}: | 897 | Emacs init file: |
| 907 | 898 | ||
| 908 | @lisp | 899 | @lisp |
| 909 | (add-to-list 'load-path "~/path/to/orgdir/lisp") | 900 | (add-to-list 'load-path "~/path/to/orgdir/lisp") |
| @@ -945,7 +936,7 @@ For more detailed explanations on Org's build system, please check the Org | |||
| 945 | Build System page on @uref{http://orgmode.org/worg/dev/org-build-system.html, | 936 | Build System page on @uref{http://orgmode.org/worg/dev/org-build-system.html, |
| 946 | Worg}. | 937 | Worg}. |
| 947 | 938 | ||
| 948 | @node Activation, Feedback, Installation, Introduction | 939 | @node Activation |
| 949 | @section Activation | 940 | @section Activation |
| 950 | @cindex activation | 941 | @cindex activation |
| 951 | @cindex autoload | 942 | @cindex autoload |
| @@ -957,14 +948,6 @@ Worg}. | |||
| 957 | @findex org-store-link | 948 | @findex org-store-link |
| 958 | @findex org-iswitchb | 949 | @findex org-iswitchb |
| 959 | 950 | ||
| 960 | Since Emacs 22.2, files with the @file{.org} extension use Org mode by | ||
| 961 | default. If you are using an earlier version of Emacs, add this line to your | ||
| 962 | @file{.emacs} file: | ||
| 963 | |||
| 964 | @lisp | ||
| 965 | (add-to-list 'auto-mode-alist '("\\.org\\'" . org-mode)) | ||
| 966 | @end lisp | ||
| 967 | |||
| 968 | Org mode buffers need font-lock to be turned on: this is the default in | 951 | Org mode buffers need font-lock to be turned on: this is the default in |
| 969 | Emacs@footnote{If you don't use font-lock globally, turn it on in Org buffer | 952 | Emacs@footnote{If you don't use font-lock globally, turn it on in Org buffer |
| 970 | with @code{(add-hook 'org-mode-hook 'turn-on-font-lock)}}. | 953 | with @code{(add-hook 'org-mode-hook 'turn-on-font-lock)}}. |
| @@ -979,15 +962,15 @@ suggested bindings for these keys, please modify the keys to your own | |||
| 979 | liking. | 962 | liking. |
| 980 | @lisp | 963 | @lisp |
| 981 | (global-set-key "\C-cl" 'org-store-link) | 964 | (global-set-key "\C-cl" 'org-store-link) |
| 982 | (global-set-key "\C-cc" 'org-capture) | ||
| 983 | (global-set-key "\C-ca" 'org-agenda) | 965 | (global-set-key "\C-ca" 'org-agenda) |
| 966 | (global-set-key "\C-cc" 'org-capture) | ||
| 984 | (global-set-key "\C-cb" 'org-iswitchb) | 967 | (global-set-key "\C-cb" 'org-iswitchb) |
| 985 | @end lisp | 968 | @end lisp |
| 986 | 969 | ||
| 987 | @cindex Org mode, turning on | 970 | @cindex Org mode, turning on |
| 988 | With this setup, all files with extension @samp{.org} will be put | 971 | Files with the @file{.org} extension use Org mode by default. To turn on Org |
| 989 | into Org mode. As an alternative, make the first line of a file look | 972 | mode in a file that does not have the extension @file{.org}, make the first |
| 990 | like this: | 973 | line of a file look like this: |
| 991 | 974 | ||
| 992 | @example | 975 | @example |
| 993 | MY PROJECTS -*- mode: org; -*- | 976 | MY PROJECTS -*- mode: org; -*- |
| @@ -999,17 +982,12 @@ the file's name is. See also the variable | |||
| 999 | @code{org-insert-mode-line-in-empty-file}. | 982 | @code{org-insert-mode-line-in-empty-file}. |
| 1000 | 983 | ||
| 1001 | Many commands in Org work on the region if the region is @i{active}. To make | 984 | Many commands in Org work on the region if the region is @i{active}. To make |
| 1002 | use of this, you need to have @code{transient-mark-mode} | 985 | use of this, you need to have @code{transient-mark-mode} turned on, which is |
| 1003 | (@code{zmacs-regions} in XEmacs) turned on. In Emacs 23 this is the default, | 986 | the default. If you do not like @code{transient-mark-mode}, you can create |
| 1004 | in Emacs 22 you need to do this yourself with | 987 | an active region by using the mouse to select a region, or pressing |
| 1005 | @lisp | ||
| 1006 | (transient-mark-mode 1) | ||
| 1007 | @end lisp | ||
| 1008 | @noindent If you do not like @code{transient-mark-mode}, you can create an | ||
| 1009 | active region by using the mouse to select a region, or pressing | ||
| 1010 | @kbd{C-@key{SPC}} twice before moving the cursor. | 988 | @kbd{C-@key{SPC}} twice before moving the cursor. |
| 1011 | 989 | ||
| 1012 | @node Feedback, Conventions, Activation, Introduction | 990 | @node Feedback |
| 1013 | @section Feedback | 991 | @section Feedback |
| 1014 | @cindex feedback | 992 | @cindex feedback |
| 1015 | @cindex bug reports | 993 | @cindex bug reports |
| @@ -1018,6 +996,8 @@ active region by using the mouse to select a region, or pressing | |||
| 1018 | 996 | ||
| 1019 | If you find problems with Org, or if you have questions, remarks, or ideas | 997 | If you find problems with Org, or if you have questions, remarks, or ideas |
| 1020 | about it, please mail to the Org mailing list @email{emacs-orgmode@@gnu.org}. | 998 | about it, please mail to the Org mailing list @email{emacs-orgmode@@gnu.org}. |
| 999 | You can subscribe to the list | ||
| 1000 | @uref{https://lists.gnu.org/mailman/listinfo/emacs-orgmode, on this web page}. | ||
| 1021 | If you are not a member of the mailing list, your mail will be passed to the | 1001 | If you are not a member of the mailing list, your mail will be passed to the |
| 1022 | list after a moderator has approved it@footnote{Please consider subscribing | 1002 | list after a moderator has approved it@footnote{Please consider subscribing |
| 1023 | to the mailing list, in order to minimize the work the mailing list | 1003 | to the mailing list, in order to minimize the work the mailing list |
| @@ -1028,13 +1008,13 @@ version of Org available---if you are running an outdated version, it is | |||
| 1028 | quite possible that the bug has been fixed already. If the bug persists, | 1008 | quite possible that the bug has been fixed already. If the bug persists, |
| 1029 | prepare a report and provide as much information as possible, including the | 1009 | prepare a report and provide as much information as possible, including the |
| 1030 | version information of Emacs (@kbd{M-x emacs-version @key{RET}}) and Org | 1010 | version information of Emacs (@kbd{M-x emacs-version @key{RET}}) and Org |
| 1031 | (@kbd{M-x org-version RET}), as well as the Org related setup in | 1011 | (@kbd{M-x org-version RET}), as well as the Org related setup in the Emacs |
| 1032 | @file{.emacs}. The easiest way to do this is to use the command | 1012 | init file. The easiest way to do this is to use the command |
| 1033 | @example | 1013 | @example |
| 1034 | @kbd{M-x org-submit-bug-report RET} | 1014 | @kbd{M-x org-submit-bug-report RET} |
| 1035 | @end example | 1015 | @end example |
| 1036 | @noindent which will put all this information into an Emacs mail buffer so | 1016 | @noindent which will put all this information into an Emacs mail buffer so |
| 1037 | that you only need to add your description. If you re not sending the Email | 1017 | that you only need to add your description. If you are not sending the Email |
| 1038 | from within Emacs, please copy and paste the content into your Email program. | 1018 | from within Emacs, please copy and paste the content into your Email program. |
| 1039 | 1019 | ||
| 1040 | Sometimes you might face a problem due to an error in your Emacs or Org mode | 1020 | Sometimes you might face a problem due to an error in your Emacs or Org mode |
| @@ -1097,8 +1077,7 @@ To do this, use | |||
| 1097 | or select @code{Org -> Refresh/Reload -> Reload Org uncompiled} from the | 1077 | or select @code{Org -> Refresh/Reload -> Reload Org uncompiled} from the |
| 1098 | menu. | 1078 | menu. |
| 1099 | @item | 1079 | @item |
| 1100 | Go to the @code{Options} menu and select @code{Enter Debugger on Error} | 1080 | Go to the @code{Options} menu and select @code{Enter Debugger on Error}. |
| 1101 | (XEmacs has this option in the @code{Troubleshooting} sub-menu). | ||
| 1102 | @item | 1081 | @item |
| 1103 | Do whatever you have to do to hit the error. Don't forget to | 1082 | Do whatever you have to do to hit the error. Don't forget to |
| 1104 | document the steps you take. | 1083 | document the steps you take. |
| @@ -1108,7 +1087,7 @@ screen. Save this buffer to a file (for example using @kbd{C-x C-w}) and | |||
| 1108 | attach it to your bug report. | 1087 | attach it to your bug report. |
| 1109 | @end enumerate | 1088 | @end enumerate |
| 1110 | 1089 | ||
| 1111 | @node Conventions, , Feedback, Introduction | 1090 | @node Conventions |
| 1112 | @section Typesetting conventions used in this manual | 1091 | @section Typesetting conventions used in this manual |
| 1113 | 1092 | ||
| 1114 | @subsubheading TODO keywords, tags, properties, etc. | 1093 | @subsubheading TODO keywords, tags, properties, etc. |
| @@ -1132,21 +1111,20 @@ special meaning are written with all capitals. | |||
| 1132 | @end table | 1111 | @end table |
| 1133 | 1112 | ||
| 1134 | Moreover, Org uses @i{option keywords} (like @code{#+TITLE} to set the title) | 1113 | Moreover, Org uses @i{option keywords} (like @code{#+TITLE} to set the title) |
| 1135 | and @i{environment keywords} (like @code{#+BEGIN_HTML} to start a @code{HTML} | 1114 | and @i{environment keywords} (like @code{#+BEGIN_EXPORT html} to start |
| 1136 | environment). They are written in uppercase in the manual to enhance its | 1115 | a @code{HTML} environment). They are written in uppercase in the manual to |
| 1137 | readability, but you can use lowercase in your Org files@footnote{Easy | 1116 | enhance its readability, but you can use lowercase in your Org file. |
| 1138 | templates insert lowercase keywords and Babel dynamically inserts | ||
| 1139 | @code{#+results}.}. | ||
| 1140 | 1117 | ||
| 1141 | @subsubheading Keybindings and commands | 1118 | @subsubheading Key bindings and commands |
| 1142 | @kindex C-c a | 1119 | @kindex C-c a |
| 1143 | @findex org-agenda | 1120 | @findex org-agenda |
| 1144 | @kindex C-c c | 1121 | @kindex C-c c |
| 1145 | @findex org-capture | 1122 | @findex org-capture |
| 1146 | 1123 | ||
| 1147 | The manual suggests two global keybindings: @kbd{C-c a} for @code{org-agenda} | 1124 | The manual suggests a few global key bindings, in particular @kbd{C-c a} for |
| 1148 | and @kbd{C-c c} for @code{org-capture}. These are only suggestions, but the | 1125 | @code{org-agenda} and @kbd{C-c c} for @code{org-capture}. These are only |
| 1149 | rest of the manual assumes that you are using these keybindings. | 1126 | suggestions, but the rest of the manual assumes that these key bindings are in |
| 1127 | place in order to list commands by key access. | ||
| 1150 | 1128 | ||
| 1151 | Also, the manual lists both the keys and the corresponding commands for | 1129 | Also, the manual lists both the keys and the corresponding commands for |
| 1152 | accessing a functionality. Org mode often uses the same key for different | 1130 | accessing a functionality. Org mode often uses the same key for different |
| @@ -1159,7 +1137,7 @@ will be listed to call @code{org-table-move-column-right}. If you prefer, | |||
| 1159 | you can compile the manual without the command names by unsetting the flag | 1137 | you can compile the manual without the command names by unsetting the flag |
| 1160 | @code{cmdnames} in @file{org.texi}. | 1138 | @code{cmdnames} in @file{org.texi}. |
| 1161 | 1139 | ||
| 1162 | @node Document Structure, Tables, Introduction, Top | 1140 | @node Document structure |
| 1163 | @chapter Document structure | 1141 | @chapter Document structure |
| 1164 | @cindex document structure | 1142 | @cindex document structure |
| 1165 | @cindex structure of document | 1143 | @cindex structure of document |
| @@ -1182,7 +1160,7 @@ edit the structure of the document. | |||
| 1182 | * Org syntax:: Formal description of Org's syntax | 1160 | * Org syntax:: Formal description of Org's syntax |
| 1183 | @end menu | 1161 | @end menu |
| 1184 | 1162 | ||
| 1185 | @node Outlines, Headlines, Document Structure, Document Structure | 1163 | @node Outlines |
| 1186 | @section Outlines | 1164 | @section Outlines |
| 1187 | @cindex outlines | 1165 | @cindex outlines |
| 1188 | @cindex Outline mode | 1166 | @cindex Outline mode |
| @@ -1196,7 +1174,7 @@ currently being worked on. Org greatly simplifies the use of | |||
| 1196 | outlines by compressing the entire show/hide functionality into a single | 1174 | outlines by compressing the entire show/hide functionality into a single |
| 1197 | command, @command{org-cycle}, which is bound to the @key{TAB} key. | 1175 | command, @command{org-cycle}, which is bound to the @key{TAB} key. |
| 1198 | 1176 | ||
| 1199 | @node Headlines, Visibility cycling, Outlines, Document Structure | 1177 | @node Headlines |
| 1200 | @section Headlines | 1178 | @section Headlines |
| 1201 | @cindex headlines | 1179 | @cindex headlines |
| 1202 | @cindex outline tree | 1180 | @cindex outline tree |
| @@ -1209,7 +1187,7 @@ start with one or more stars, on the left margin@footnote{See the variables | |||
| 1209 | @code{org-special-ctrl-a/e}, @code{org-special-ctrl-k}, and | 1187 | @code{org-special-ctrl-a/e}, @code{org-special-ctrl-k}, and |
| 1210 | @code{org-ctrl-k-protect-subtree} to configure special behavior of @kbd{C-a}, | 1188 | @code{org-ctrl-k-protect-subtree} to configure special behavior of @kbd{C-a}, |
| 1211 | @kbd{C-e}, and @kbd{C-k} in headlines.} @footnote{Clocking only works with | 1189 | @kbd{C-e}, and @kbd{C-k} in headlines.} @footnote{Clocking only works with |
| 1212 | headings indented less then 30 stars.}. For example: | 1190 | headings indented less than 30 stars.}. For example: |
| 1213 | 1191 | ||
| 1214 | @example | 1192 | @example |
| 1215 | * Top level headline | 1193 | * Top level headline |
| @@ -1222,7 +1200,12 @@ headings indented less then 30 stars.}. For example: | |||
| 1222 | * Another top level headline | 1200 | * Another top level headline |
| 1223 | @end example | 1201 | @end example |
| 1224 | 1202 | ||
| 1225 | @noindent Some people find the many stars too noisy and would prefer an | 1203 | @vindex org-footnote-section |
| 1204 | @noindent Note that a headline named after @code{org-footnote-section}, | ||
| 1205 | which defaults to @samp{Footnotes}, is considered as special. A subtree with | ||
| 1206 | this headline will be silently ignored by exporting functions. | ||
| 1207 | |||
| 1208 | Some people find the many stars too noisy and would prefer an | ||
| 1226 | outline that has whitespace followed by a single star as headline | 1209 | outline that has whitespace followed by a single star as headline |
| 1227 | starters. @ref{Clean view}, describes a setup to realize this. | 1210 | starters. @ref{Clean view}, describes a setup to realize this. |
| 1228 | 1211 | ||
| @@ -1233,7 +1216,7 @@ least two empty lines, one empty line will remain visible after folding | |||
| 1233 | the subtree, in order to structure the collapsed view. See the | 1216 | the subtree, in order to structure the collapsed view. See the |
| 1234 | variable @code{org-cycle-separator-lines} to modify this behavior. | 1217 | variable @code{org-cycle-separator-lines} to modify this behavior. |
| 1235 | 1218 | ||
| 1236 | @node Visibility cycling, Motion, Headlines, Document Structure | 1219 | @node Visibility cycling |
| 1237 | @section Visibility cycling | 1220 | @section Visibility cycling |
| 1238 | @cindex cycling, visibility | 1221 | @cindex cycling, visibility |
| 1239 | @cindex visibility cycling | 1222 | @cindex visibility cycling |
| @@ -1247,7 +1230,7 @@ variable @code{org-cycle-separator-lines} to modify this behavior. | |||
| 1247 | * Catching invisible edits:: Preventing mistakes when editing invisible parts | 1230 | * Catching invisible edits:: Preventing mistakes when editing invisible parts |
| 1248 | @end menu | 1231 | @end menu |
| 1249 | 1232 | ||
| 1250 | @node Global and local cycling, Initial visibility, Visibility cycling, Visibility cycling | 1233 | @node Global and local cycling |
| 1251 | @subsection Global and local cycling | 1234 | @subsection Global and local cycling |
| 1252 | 1235 | ||
| 1253 | Outlines make it possible to hide parts of the text in the buffer. | 1236 | Outlines make it possible to hide parts of the text in the buffer. |
| @@ -1299,7 +1282,7 @@ tables, @kbd{S-@key{TAB}} jumps to the previous field. | |||
| 1299 | @orgcmd{C-u C-u @key{TAB},org-set-startup-visibility} | 1282 | @orgcmd{C-u C-u @key{TAB},org-set-startup-visibility} |
| 1300 | Switch back to the startup visibility of the buffer (@pxref{Initial visibility}). | 1283 | Switch back to the startup visibility of the buffer (@pxref{Initial visibility}). |
| 1301 | @cindex show all, command | 1284 | @cindex show all, command |
| 1302 | @orgcmd{C-u C-u C-u @key{TAB},show-all} | 1285 | @orgcmd{C-u C-u C-u @key{TAB},outline-show-all} |
| 1303 | Show all, including drawers. | 1286 | Show all, including drawers. |
| 1304 | @cindex revealing context | 1287 | @cindex revealing context |
| 1305 | @orgcmd{C-c C-r,org-reveal} | 1288 | @orgcmd{C-c C-r,org-reveal} |
| @@ -1310,37 +1293,25 @@ exposed by a sparse tree command (@pxref{Sparse trees}) or an agenda command | |||
| 1310 | level, all sibling headings. With a double prefix argument, also show the | 1293 | level, all sibling headings. With a double prefix argument, also show the |
| 1311 | entire subtree of the parent. | 1294 | entire subtree of the parent. |
| 1312 | @cindex show branches, command | 1295 | @cindex show branches, command |
| 1313 | @orgcmd{C-c C-k,show-branches} | 1296 | @orgcmd{C-c C-k,outline-show-branches} |
| 1314 | Expose all the headings of the subtree, CONTENT view for just one subtree. | 1297 | Expose all the headings of the subtree, CONTENT view for just one subtree. |
| 1315 | @cindex show children, command | 1298 | @cindex show children, command |
| 1316 | @orgcmd{C-c @key{TAB},show-children} | 1299 | @orgcmd{C-c @key{TAB},outline-show-children} |
| 1317 | Expose all direct children of the subtree. With a numeric prefix argument N, | 1300 | Expose all direct children of the subtree. With a numeric prefix argument N, |
| 1318 | expose all children down to level N@. | 1301 | expose all children down to level N@. |
| 1319 | @orgcmd{C-c C-x b,org-tree-to-indirect-buffer} | 1302 | @orgcmd{C-c C-x b,org-tree-to-indirect-buffer} |
| 1320 | Show the current subtree in an indirect buffer@footnote{The indirect | 1303 | Show the current subtree in an indirect buffer@footnote{The indirect buffer |
| 1321 | buffer | 1304 | (@pxref{Indirect Buffers,,,emacs,GNU Emacs Manual}) will contain the entire |
| 1322 | @ifinfo | 1305 | buffer, but will be narrowed to the current tree. Editing the indirect |
| 1323 | (@pxref{Indirect Buffers,,,emacs,GNU Emacs Manual}) | 1306 | buffer will also change the original buffer, but without affecting visibility |
| 1324 | @end ifinfo | 1307 | in that buffer.}. With a numeric prefix argument N, go up to level N and |
| 1325 | @ifnotinfo | 1308 | then take that tree. If N is negative then go up that many levels. With a |
| 1326 | (see the Emacs manual for more information about indirect buffers) | 1309 | @kbd{C-u} prefix, do not remove the previously used indirect buffer. |
| 1327 | @end ifnotinfo | ||
| 1328 | will contain the entire buffer, but will be narrowed to the current | ||
| 1329 | tree. Editing the indirect buffer will also change the original buffer, | ||
| 1330 | but without affecting visibility in that buffer.}. With a numeric | ||
| 1331 | prefix argument N, go up to level N and then take that tree. If N is | ||
| 1332 | negative then go up that many levels. With a @kbd{C-u} prefix, do not remove | ||
| 1333 | the previously used indirect buffer. | ||
| 1334 | @orgcmd{C-c C-x v,org-copy-visible} | 1310 | @orgcmd{C-c C-x v,org-copy-visible} |
| 1335 | Copy the @i{visible} text in the region into the kill ring. | 1311 | Copy the @i{visible} text in the region into the kill ring. |
| 1336 | @end table | 1312 | @end table |
| 1337 | 1313 | ||
| 1338 | @menu | 1314 | @node Initial visibility |
| 1339 | * Initial visibility:: Setting the initial visibility state | ||
| 1340 | * Catching invisible edits:: Preventing mistakes when editing invisible parts | ||
| 1341 | @end menu | ||
| 1342 | |||
| 1343 | @node Initial visibility, Catching invisible edits, Global and local cycling, Visibility cycling | ||
| 1344 | @subsection Initial visibility | 1315 | @subsection Initial visibility |
| 1345 | 1316 | ||
| 1346 | @cindex visibility, initialize | 1317 | @cindex visibility, initialize |
| @@ -1366,14 +1337,10 @@ following lines anywhere in the buffer: | |||
| 1366 | #+STARTUP: showeverything | 1337 | #+STARTUP: showeverything |
| 1367 | @end example | 1338 | @end example |
| 1368 | 1339 | ||
| 1369 | The startup visibility options are ignored when the file is open for the | ||
| 1370 | first time during the agenda generation: if you want the agenda to honor | ||
| 1371 | the startup visibility, set @code{org-agenda-inhibit-startup} to @code{nil}. | ||
| 1372 | |||
| 1373 | @cindex property, VISIBILITY | 1340 | @cindex property, VISIBILITY |
| 1374 | @noindent | 1341 | @noindent |
| 1375 | Furthermore, any entries with a @samp{VISIBILITY} property (@pxref{Properties | 1342 | Furthermore, any entries with a @samp{VISIBILITY} property (@pxref{Properties |
| 1376 | and Columns}) will get their visibility adapted accordingly. Allowed values | 1343 | and columns}) will get their visibility adapted accordingly. Allowed values |
| 1377 | for this property are @code{folded}, @code{children}, @code{content}, and | 1344 | for this property are @code{folded}, @code{children}, @code{content}, and |
| 1378 | @code{all}. | 1345 | @code{all}. |
| 1379 | 1346 | ||
| @@ -1384,7 +1351,7 @@ requested by startup options and @samp{VISIBILITY} properties in individual | |||
| 1384 | entries. | 1351 | entries. |
| 1385 | @end table | 1352 | @end table |
| 1386 | 1353 | ||
| 1387 | @node Catching invisible edits, , Initial visibility, Visibility cycling | 1354 | @node Catching invisible edits |
| 1388 | @subsection Catching invisible edits | 1355 | @subsection Catching invisible edits |
| 1389 | 1356 | ||
| 1390 | @vindex org-catch-invisible-edits | 1357 | @vindex org-catch-invisible-edits |
| @@ -1395,7 +1362,7 @@ confused on what has been edited and how to undo the mistake. Setting | |||
| 1395 | docstring of this option on how Org should catch invisible edits and process | 1362 | docstring of this option on how Org should catch invisible edits and process |
| 1396 | them. | 1363 | them. |
| 1397 | 1364 | ||
| 1398 | @node Motion, Structure editing, Visibility cycling, Document Structure | 1365 | @node Motion |
| 1399 | @section Motion | 1366 | @section Motion |
| 1400 | @cindex motion, between headlines | 1367 | @cindex motion, between headlines |
| 1401 | @cindex jumping, to headlines | 1368 | @cindex jumping, to headlines |
| @@ -1403,9 +1370,9 @@ them. | |||
| 1403 | The following commands jump to other headlines in the buffer. | 1370 | The following commands jump to other headlines in the buffer. |
| 1404 | 1371 | ||
| 1405 | @table @asis | 1372 | @table @asis |
| 1406 | @orgcmd{C-c C-n,outline-next-visible-heading} | 1373 | @orgcmd{C-c C-n,org-next-visible-heading} |
| 1407 | Next heading. | 1374 | Next heading. |
| 1408 | @orgcmd{C-c C-p,outline-previous-visible-heading} | 1375 | @orgcmd{C-c C-p,org-previous-visible-heading} |
| 1409 | Previous heading. | 1376 | Previous heading. |
| 1410 | @orgcmd{C-c C-f,org-forward-same-level} | 1377 | @orgcmd{C-c C-f,org-forward-same-level} |
| 1411 | Next heading same level. | 1378 | Next heading same level. |
| @@ -1435,7 +1402,7 @@ q @r{Quit} | |||
| 1435 | See also the option @code{org-goto-interface}. | 1402 | See also the option @code{org-goto-interface}. |
| 1436 | @end table | 1403 | @end table |
| 1437 | 1404 | ||
| 1438 | @node Structure editing, Sparse trees, Motion, Document Structure | 1405 | @node Structure editing |
| 1439 | @section Structure editing | 1406 | @section Structure editing |
| 1440 | @cindex structure editing | 1407 | @cindex structure editing |
| 1441 | @cindex headline, promotion and demotion | 1408 | @cindex headline, promotion and demotion |
| @@ -1451,24 +1418,23 @@ See also the option @code{org-goto-interface}. | |||
| 1451 | @table @asis | 1418 | @table @asis |
| 1452 | @orgcmd{M-@key{RET},org-insert-heading} | 1419 | @orgcmd{M-@key{RET},org-insert-heading} |
| 1453 | @vindex org-M-RET-may-split-line | 1420 | @vindex org-M-RET-may-split-line |
| 1454 | Insert a new heading/item with the same level than the one at point. | 1421 | Insert a new heading/item with the same level as the one at point. |
| 1455 | If the cursor is in a plain list item, a new item is created | 1422 | |
| 1456 | (@pxref{Plain lists}). To prevent this behavior in lists, call the | 1423 | If the command is used at the @emph{beginning} of a line, and if there is |
| 1457 | command with a prefix argument. When this command is used in the | 1424 | a heading or a plain list item (@pxref{Plain lists}) at point, the new |
| 1458 | middle of a line, the line is split and the rest of the line becomes | 1425 | heading/item is created @emph{before} the current line. When used at the |
| 1459 | the new item or headline@footnote{If you do not want the line to be | 1426 | beginning of a regular line of text, turn that line into a heading. |
| 1460 | split, customize the variable @code{org-M-RET-may-split-line}.}. If | 1427 | |
| 1461 | the command is used at the @emph{beginning} of a headline, the new | 1428 | When this command is used in the middle of a line, the line is split and the |
| 1462 | headline is created before the current line. If the command is used | 1429 | rest of the line becomes the new item or headline. If you do not want the |
| 1463 | at the @emph{end} of a folded subtree (i.e., behind the ellipses at | 1430 | line to be split, customize @code{org-M-RET-may-split-line}. |
| 1464 | the end of a headline), then a headline will be | 1431 | |
| 1465 | inserted after the end of the subtree. Calling this command with | 1432 | Calling the command with a @kbd{C-u} prefix unconditionally inserts a new |
| 1466 | @kbd{C-u C-u} will unconditionally respect the headline's content and | 1433 | heading at the end of the current subtree, thus preserving its contents. |
| 1467 | create a new item at the end of the parent subtree. | 1434 | With a double @kbd{C-u C-u} prefix, the new heading is created at the end of |
| 1435 | the parent subtree instead. | ||
| 1468 | @orgcmd{C-@key{RET},org-insert-heading-respect-content} | 1436 | @orgcmd{C-@key{RET},org-insert-heading-respect-content} |
| 1469 | Just like @kbd{M-@key{RET}}, except when adding a new heading below the | 1437 | Insert a new heading at the end of the current subtree. |
| 1470 | current heading, the new heading is placed after the body instead of before | ||
| 1471 | it. This command works from anywhere in the entry. | ||
| 1472 | @orgcmd{M-S-@key{RET},org-insert-todo-heading} | 1438 | @orgcmd{M-S-@key{RET},org-insert-todo-heading} |
| 1473 | @vindex org-treat-insert-todo-heading-as-state-change | 1439 | @vindex org-treat-insert-todo-heading-as-state-change |
| 1474 | Insert new TODO entry with same level as current heading. See also the | 1440 | Insert new TODO entry with same level as current heading. See also the |
| @@ -1572,33 +1538,29 @@ inside a table (@pxref{Tables}), the Meta-Cursor keys have different | |||
| 1572 | functionality. | 1538 | functionality. |
| 1573 | 1539 | ||
| 1574 | 1540 | ||
| 1575 | @node Sparse trees, Plain lists, Structure editing, Document Structure | 1541 | @node Sparse trees |
| 1576 | @section Sparse trees | 1542 | @section Sparse trees |
| 1577 | @cindex sparse trees | 1543 | @cindex sparse trees |
| 1578 | @cindex trees, sparse | 1544 | @cindex trees, sparse |
| 1579 | @cindex folding, sparse trees | 1545 | @cindex folding, sparse trees |
| 1580 | @cindex occur, command | 1546 | @cindex occur, command |
| 1581 | 1547 | ||
| 1582 | @vindex org-show-hierarchy-above | 1548 | @vindex org-show-context-detail |
| 1583 | @vindex org-show-following-heading | ||
| 1584 | @vindex org-show-siblings | ||
| 1585 | @vindex org-show-entry-below | ||
| 1586 | An important feature of Org mode is the ability to construct @emph{sparse | 1549 | An important feature of Org mode is the ability to construct @emph{sparse |
| 1587 | trees} for selected information in an outline tree, so that the entire | 1550 | trees} for selected information in an outline tree, so that the entire |
| 1588 | document is folded as much as possible, but the selected information is made | 1551 | document is folded as much as possible, but the selected information is made |
| 1589 | visible along with the headline structure above it@footnote{See also the | 1552 | visible along with the headline structure above it@footnote{See also the |
| 1590 | variables @code{org-show-hierarchy-above}, @code{org-show-following-heading}, | 1553 | variable @code{org-show-context-detail} to decide how much context is shown |
| 1591 | @code{org-show-siblings}, and @code{org-show-entry-below} for detailed | 1554 | around each match.}. Just try it out and you will see immediately how it |
| 1592 | control on how much context is shown around each match.}. Just try it out | 1555 | works. |
| 1593 | and you will see immediately how it works. | ||
| 1594 | 1556 | ||
| 1595 | Org mode contains several commands creating such trees, all these | 1557 | Org mode contains several commands for creating such trees, all these |
| 1596 | commands can be accessed through a dispatcher: | 1558 | commands can be accessed through a dispatcher: |
| 1597 | 1559 | ||
| 1598 | @table @asis | 1560 | @table @asis |
| 1599 | @orgcmd{C-c /,org-sparse-tree} | 1561 | @orgcmd{C-c /,org-sparse-tree} |
| 1600 | This prompts for an extra key to select a sparse-tree creating command. | 1562 | This prompts for an extra key to select a sparse-tree creating command. |
| 1601 | @orgcmd{C-c / r,org-occur} | 1563 | @orgcmdkkc{C-c / r,C-c / /,org-occur} |
| 1602 | @vindex org-remove-highlights-with-change | 1564 | @vindex org-remove-highlights-with-change |
| 1603 | Prompts for a regexp and shows a sparse tree with all matches. If | 1565 | Prompts for a regexp and shows a sparse tree with all matches. If |
| 1604 | the match is in a headline, the headline is made visible. If the match is in | 1566 | the match is in a headline, the headline is made visible. If the match is in |
| @@ -1639,13 +1601,11 @@ tags, or properties and will be discussed later in this manual. | |||
| 1639 | @cindex printing sparse trees | 1601 | @cindex printing sparse trees |
| 1640 | @cindex visible text, printing | 1602 | @cindex visible text, printing |
| 1641 | To print a sparse tree, you can use the Emacs command | 1603 | To print a sparse tree, you can use the Emacs command |
| 1642 | @code{ps-print-buffer-with-faces} which does not print invisible parts | 1604 | @code{ps-print-buffer-with-faces} which does not print invisible parts of the |
| 1643 | of the document @footnote{This does not work under XEmacs, because | 1605 | document. Or you can use @kbd{C-c C-e C-v} to export only the visible part |
| 1644 | XEmacs uses selective display for outlining, not text properties.}. | 1606 | of the document and print the resulting file. |
| 1645 | Or you can use @kbd{C-c C-e C-v} to export only the visible part of | ||
| 1646 | the document and print the resulting file. | ||
| 1647 | 1607 | ||
| 1648 | @node Plain lists, Drawers, Sparse trees, Document Structure | 1608 | @node Plain lists |
| 1649 | @section Plain lists | 1609 | @section Plain lists |
| 1650 | @cindex plain lists | 1610 | @cindex plain lists |
| 1651 | @cindex lists, plain | 1611 | @cindex lists, plain |
| @@ -1714,25 +1674,23 @@ In that case, all items are closed. Here is an example: | |||
| 1714 | But in the end, no individual scenes matter but the film as a whole. | 1674 | But in the end, no individual scenes matter but the film as a whole. |
| 1715 | Important actors in this film are: | 1675 | Important actors in this film are: |
| 1716 | - @b{Elijah Wood} :: He plays Frodo | 1676 | - @b{Elijah Wood} :: He plays Frodo |
| 1717 | - @b{Sean Austin} :: He plays Sam, Frodo's friend. I still remember | 1677 | - @b{Sean Astin} :: He plays Sam, Frodo's friend. I still remember |
| 1718 | him very well from his role as Mikey Walsh in @i{The Goonies}. | 1678 | him very well from his role as Mikey Walsh in @i{The Goonies}. |
| 1719 | @end group | 1679 | @end group |
| 1720 | @end example | 1680 | @end example |
| 1721 | 1681 | ||
| 1722 | Org supports these lists by tuning filling and wrapping commands to deal with | 1682 | Org supports these lists by tuning filling and wrapping commands to deal with |
| 1723 | them correctly@footnote{Org only changes the filling settings for Emacs. For | 1683 | them correctly, and by exporting them properly (@pxref{Exporting}). Since |
| 1724 | XEmacs, you should use Kyle E. Jones' @file{filladapt.el}. To turn this on, | 1684 | indentation is what governs the structure of these lists, many structural |
| 1725 | put into @file{.emacs}: @code{(require 'filladapt)}}, and by exporting them | 1685 | constructs like @code{#+BEGIN_...} blocks can be indented to signal that they |
| 1726 | properly (@pxref{Exporting}). Since indentation is what governs the | 1686 | belong to a particular item. |
| 1727 | structure of these lists, many structural constructs like @code{#+BEGIN_...} | ||
| 1728 | blocks can be indented to signal that they belong to a particular item. | ||
| 1729 | 1687 | ||
| 1730 | @vindex org-list-demote-modify-bullet | 1688 | @vindex org-list-demote-modify-bullet |
| 1731 | @vindex org-list-indent-offset | 1689 | @vindex org-list-indent-offset |
| 1732 | If you find that using a different bullet for a sub-list (than that used for | 1690 | If you find that using a different bullet for a sub-list (than that used for |
| 1733 | the current list-level) improves readability, customize the variable | 1691 | the current list-level) improves readability, customize the variable |
| 1734 | @code{org-list-demote-modify-bullet}. To get a greater difference of | 1692 | @code{org-list-demote-modify-bullet}. To get a greater difference of |
| 1735 | indentation between items and theirs sub-items, customize | 1693 | indentation between items and their sub-items, customize |
| 1736 | @code{org-list-indent-offset}. | 1694 | @code{org-list-indent-offset}. |
| 1737 | 1695 | ||
| 1738 | @vindex org-list-automatic-rules | 1696 | @vindex org-list-automatic-rules |
| @@ -1824,10 +1782,10 @@ Cycle the entire list level through the different itemize/enumerate bullets | |||
| 1824 | (@samp{-}, @samp{+}, @samp{*}, @samp{1.}, @samp{1)}) or a subset of them, | 1782 | (@samp{-}, @samp{+}, @samp{*}, @samp{1.}, @samp{1)}) or a subset of them, |
| 1825 | depending on @code{org-plain-list-ordered-item-terminator}, the type of list, | 1783 | depending on @code{org-plain-list-ordered-item-terminator}, the type of list, |
| 1826 | and its indentation. With a numeric prefix argument N, select the Nth bullet | 1784 | and its indentation. With a numeric prefix argument N, select the Nth bullet |
| 1827 | from this list. If there is an active region when calling this, selected | 1785 | from this list. If there is an active region when calling this, all selected |
| 1828 | text will be changed into an item. With a prefix argument, all lines will be | 1786 | lines are converted to list items. With a prefix argument, selected text is |
| 1829 | converted to list items. If the first line already was a list item, any item | 1787 | changed into a single item. If the first line already was a list item, any |
| 1830 | marker will be removed from the list. Finally, even without an active | 1788 | item marker will be removed from the list. Finally, even without an active |
| 1831 | region, a normal line will be converted into a list item. | 1789 | region, a normal line will be converted into a list item. |
| 1832 | @kindex C-c * | 1790 | @kindex C-c * |
| 1833 | @item C-c * | 1791 | @item C-c * |
| @@ -1853,20 +1811,17 @@ numerically, alphabetically, by time, by checked status for check lists, | |||
| 1853 | or by a custom function. | 1811 | or by a custom function. |
| 1854 | @end table | 1812 | @end table |
| 1855 | 1813 | ||
| 1856 | @node Drawers, Blocks, Plain lists, Document Structure | 1814 | @node Drawers |
| 1857 | @section Drawers | 1815 | @section Drawers |
| 1858 | @cindex drawers | 1816 | @cindex drawers |
| 1859 | @cindex #+DRAWERS | ||
| 1860 | @cindex visibility cycling, drawers | 1817 | @cindex visibility cycling, drawers |
| 1861 | 1818 | ||
| 1862 | @vindex org-drawers | ||
| 1863 | @cindex org-insert-drawer | 1819 | @cindex org-insert-drawer |
| 1864 | @kindex C-c C-x d | 1820 | @kindex C-c C-x d |
| 1865 | Sometimes you want to keep information associated with an entry, but you | 1821 | Sometimes you want to keep information associated with an entry, but you |
| 1866 | normally don't want to see it. For this, Org mode has @emph{drawers}. | 1822 | normally don't want to see it. For this, Org mode has @emph{drawers}. They |
| 1867 | Drawers need to be configured with the option @code{org-drawers}@footnote{You | 1823 | can contain anything but a headline and another drawer. Drawers look like |
| 1868 | can define additional drawers on a per-file basis with a line like | 1824 | this: |
| 1869 | @code{#+DRAWERS: HIDDEN STATE}}. Drawers look like this: | ||
| 1870 | 1825 | ||
| 1871 | @example | 1826 | @example |
| 1872 | ** This is a headline | 1827 | ** This is a headline |
| @@ -1880,18 +1835,21 @@ can define additional drawers on a per-file basis with a line like | |||
| 1880 | You can interactively insert drawers at point by calling | 1835 | You can interactively insert drawers at point by calling |
| 1881 | @code{org-insert-drawer}, which is bound to @key{C-c C-x d}. With an active | 1836 | @code{org-insert-drawer}, which is bound to @key{C-c C-x d}. With an active |
| 1882 | region, this command will put the region inside the drawer. With a prefix | 1837 | region, this command will put the region inside the drawer. With a prefix |
| 1883 | argument, this command calls @code{org-insert-property-drawer} and add a | 1838 | argument, this command calls @code{org-insert-property-drawer} and add |
| 1884 | property drawer right below the current headline. Completion over drawer | 1839 | a property drawer right below the current headline. Completion over drawer |
| 1885 | keywords is also possible using @key{M-TAB}. | 1840 | keywords is also possible using @kbd{M-@key{TAB}}@footnote{Many desktops |
| 1841 | intercept @kbd{M-@key{TAB}} to switch windows. Use @kbd{C-M-i} or | ||
| 1842 | @kbd{@key{ESC} @key{TAB}} instead for completion (@pxref{Completion}).}. | ||
| 1886 | 1843 | ||
| 1887 | Visibility cycling (@pxref{Visibility cycling}) on the headline will hide and | 1844 | Visibility cycling (@pxref{Visibility cycling}) on the headline will hide and |
| 1888 | show the entry, but keep the drawer collapsed to a single line. In order to | 1845 | show the entry, but keep the drawer collapsed to a single line. In order to |
| 1889 | look inside the drawer, you need to move the cursor to the drawer line and | 1846 | look inside the drawer, you need to move the cursor to the drawer line and |
| 1890 | press @key{TAB} there. Org mode uses the @code{PROPERTIES} drawer for | 1847 | press @key{TAB} there. Org mode uses the @code{PROPERTIES} drawer for |
| 1891 | storing properties (@pxref{Properties and Columns}), and you can also arrange | 1848 | storing properties (@pxref{Properties and columns}), and you can also arrange |
| 1892 | for state change notes (@pxref{Tracking TODO state changes}) and clock times | 1849 | for state change notes (@pxref{Tracking TODO state changes}) and clock times |
| 1893 | (@pxref{Clocking work time}) to be stored in a drawer @code{LOGBOOK}. If you | 1850 | (@pxref{Clocking work time}) to be stored in a drawer @code{LOGBOOK}. If you |
| 1894 | want to store a quick note in the LOGBOOK drawer, in a similar way to state changes, use | 1851 | want to store a quick note in the LOGBOOK drawer, in a similar way to state |
| 1852 | changes, use | ||
| 1895 | 1853 | ||
| 1896 | @table @kbd | 1854 | @table @kbd |
| 1897 | @kindex C-c C-z | 1855 | @kindex C-c C-z |
| @@ -1900,12 +1858,13 @@ Add a time-stamped note to the LOGBOOK drawer. | |||
| 1900 | @end table | 1858 | @end table |
| 1901 | 1859 | ||
| 1902 | @vindex org-export-with-drawers | 1860 | @vindex org-export-with-drawers |
| 1861 | @vindex org-export-with-properties | ||
| 1903 | You can select the name of the drawers which should be exported with | 1862 | You can select the name of the drawers which should be exported with |
| 1904 | @code{org-export-with-drawers}. In that case, drawer contents will appear in | 1863 | @code{org-export-with-drawers}. In that case, drawer contents will appear in |
| 1905 | export output. Property drawers are not affected by this variable and are | 1864 | export output. Property drawers are not affected by this variable: configure |
| 1906 | never exported. | 1865 | @code{org-export-with-properties} instead. |
| 1907 | 1866 | ||
| 1908 | @node Blocks, Footnotes, Drawers, Document Structure | 1867 | @node Blocks |
| 1909 | @section Blocks | 1868 | @section Blocks |
| 1910 | 1869 | ||
| 1911 | @vindex org-hide-block-startup | 1870 | @vindex org-hide-block-startup |
| @@ -1924,18 +1883,17 @@ or on a per-file basis by using | |||
| 1924 | #+STARTUP: nohideblocks | 1883 | #+STARTUP: nohideblocks |
| 1925 | @end example | 1884 | @end example |
| 1926 | 1885 | ||
| 1927 | @node Footnotes, Orgstruct mode, Blocks, Document Structure | 1886 | @node Footnotes |
| 1928 | @section Footnotes | 1887 | @section Footnotes |
| 1929 | @cindex footnotes | 1888 | @cindex footnotes |
| 1930 | 1889 | ||
| 1931 | Org mode supports the creation of footnotes. In contrast to the | 1890 | Org mode supports the creation of footnotes. |
| 1932 | @file{footnote.el} package, Org mode's footnotes are designed for work on | ||
| 1933 | a larger document, not only for one-off documents like emails. | ||
| 1934 | 1891 | ||
| 1935 | A footnote is started by a footnote marker in square brackets in column 0, no | 1892 | A footnote is started by a footnote marker in square brackets in column 0, no |
| 1936 | indentation allowed. It ends at the next footnote definition, headline, or | 1893 | indentation allowed. It ends at the next footnote definition, headline, or |
| 1937 | after two consecutive empty lines. The footnote reference is simply the | 1894 | after two consecutive empty lines. The footnote reference is simply the |
| 1938 | marker in square brackets, inside text. For example: | 1895 | marker in square brackets, inside text. Markers always start with |
| 1896 | @code{fn:}. For example: | ||
| 1939 | 1897 | ||
| 1940 | @example | 1898 | @example |
| 1941 | The Org homepage[fn:1] now looks a lot better than it used to. | 1899 | The Org homepage[fn:1] now looks a lot better than it used to. |
| @@ -1944,23 +1902,16 @@ The Org homepage[fn:1] now looks a lot better than it used to. | |||
| 1944 | @end example | 1902 | @end example |
| 1945 | 1903 | ||
| 1946 | Org mode extends the number-based syntax to @emph{named} footnotes and | 1904 | Org mode extends the number-based syntax to @emph{named} footnotes and |
| 1947 | optional inline definition. Using plain numbers as markers (as | 1905 | optional inline definition. Here are the valid references: |
| 1948 | @file{footnote.el} does) is supported for backward compatibility, but not | ||
| 1949 | encouraged because of possible conflicts with @LaTeX{} snippets (@pxref{Embedded | ||
| 1950 | @LaTeX{}}). Here are the valid references: | ||
| 1951 | 1906 | ||
| 1952 | @table @code | 1907 | @table @code |
| 1953 | @item [1] | ||
| 1954 | A plain numeric footnote marker. Compatible with @file{footnote.el}, but not | ||
| 1955 | recommended because something like @samp{[1]} could easily be part of a code | ||
| 1956 | snippet. | ||
| 1957 | @item [fn:name] | 1908 | @item [fn:name] |
| 1958 | A named footnote reference, where @code{name} is a unique label word, or, for | 1909 | A named footnote reference, where @code{name} is a unique label word, or, for |
| 1959 | simplicity of automatic creation, a number. | 1910 | simplicity of automatic creation, a number. |
| 1960 | @item [fn:: This is the inline definition of this footnote] | 1911 | @item [fn::This is the inline definition of this footnote] |
| 1961 | A @LaTeX{}-like anonymous footnote where the definition is given directly at the | 1912 | A @LaTeX{}-like anonymous footnote where the definition is given directly at the |
| 1962 | reference point. | 1913 | reference point. |
| 1963 | @item [fn:name: a definition] | 1914 | @item [fn:name:a definition] |
| 1964 | An inline definition of a footnote, which also specifies a name for the note. | 1915 | An inline definition of a footnote, which also specifies a name for the note. |
| 1965 | Since Org allows multiple references to the same note, you can then use | 1916 | Since Org allows multiple references to the same note, you can then use |
| 1966 | @code{[fn:name]} to create additional references. | 1917 | @code{[fn:name]} to create additional references. |
| @@ -2007,9 +1958,7 @@ r @r{Renumber the simple @code{fn:N} footnotes. Automatic renumbering} | |||
| 2007 | S @r{Short for first @code{r}, then @code{s} action.} | 1958 | S @r{Short for first @code{r}, then @code{s} action.} |
| 2008 | n @r{Normalize the footnotes by collecting all definitions (including} | 1959 | n @r{Normalize the footnotes by collecting all definitions (including} |
| 2009 | @r{inline definitions) into a special section, and then numbering them} | 1960 | @r{inline definitions) into a special section, and then numbering them} |
| 2010 | @r{in sequence. The references will then also be numbers. This is} | 1961 | @r{in sequence. The references will then also be numbers.} |
| 2011 | @r{meant to be the final step before finishing a document (e.g., sending} | ||
| 2012 | @r{off an email).} | ||
| 2013 | d @r{Delete the footnote at point, and all definitions of and references} | 1962 | d @r{Delete the footnote at point, and all definitions of and references} |
| 2014 | @r{to it.} | 1963 | @r{to it.} |
| 2015 | @end example | 1964 | @end example |
| @@ -2029,9 +1978,17 @@ location with a prefix argument, offer the same menu as @kbd{C-c C-x f}. | |||
| 2029 | @item C-c C-o @r{or} mouse-1/2 | 1978 | @item C-c C-o @r{or} mouse-1/2 |
| 2030 | Footnote labels are also links to the corresponding definition/reference, and | 1979 | Footnote labels are also links to the corresponding definition/reference, and |
| 2031 | you can use the usual commands to follow these links. | 1980 | you can use the usual commands to follow these links. |
| 1981 | |||
| 1982 | @vindex org-edit-footnote-reference | ||
| 1983 | @kindex C-c ' | ||
| 1984 | @item C-c ' | ||
| 1985 | @item C-c ' | ||
| 1986 | Edit the footnote definition corresponding to the reference at point in | ||
| 1987 | a seperate window. The window can be closed by pressing @kbd{C-c '}. | ||
| 1988 | |||
| 2032 | @end table | 1989 | @end table |
| 2033 | 1990 | ||
| 2034 | @node Orgstruct mode, Org syntax, Footnotes, Document Structure | 1991 | @node Orgstruct mode |
| 2035 | @section The Orgstruct minor mode | 1992 | @section The Orgstruct minor mode |
| 2036 | @cindex Orgstruct mode | 1993 | @cindex Orgstruct mode |
| 2037 | @cindex minor mode for structure editing | 1994 | @cindex minor mode for structure editing |
| @@ -2066,7 +2023,7 @@ Lisp files, you will be able to fold and unfold headlines in Emacs Lisp | |||
| 2066 | commented lines. Some commands like @code{org-demote} are disabled when the | 2023 | commented lines. Some commands like @code{org-demote} are disabled when the |
| 2067 | prefix is set, but folding/unfolding will work correctly. | 2024 | prefix is set, but folding/unfolding will work correctly. |
| 2068 | 2025 | ||
| 2069 | @node Org syntax, , Orgstruct mode, Document Structure | 2026 | @node Org syntax |
| 2070 | @section Org syntax | 2027 | @section Org syntax |
| 2071 | @cindex Org syntax | 2028 | @cindex Org syntax |
| 2072 | 2029 | ||
| @@ -2088,7 +2045,11 @@ abstract structure. The export engine relies on the information stored in | |||
| 2088 | this list. Most interactive commands (e.g., for structure editing) also | 2045 | this list. Most interactive commands (e.g., for structure editing) also |
| 2089 | rely on the syntactic meaning of the surrounding context. | 2046 | rely on the syntactic meaning of the surrounding context. |
| 2090 | 2047 | ||
| 2091 | @node Tables, Hyperlinks, Document Structure, Top | 2048 | @cindex syntax checker |
| 2049 | @cindex linter | ||
| 2050 | You can check syntax in your documents using @code{org-lint} command. | ||
| 2051 | |||
| 2052 | @node Tables | ||
| 2092 | @chapter Tables | 2053 | @chapter Tables |
| 2093 | @cindex tables | 2054 | @cindex tables |
| 2094 | @cindex editing tables | 2055 | @cindex editing tables |
| @@ -2106,7 +2067,7 @@ calculations are supported using the Emacs @file{calc} package | |||
| 2106 | * Org-Plot:: Plotting from org tables | 2067 | * Org-Plot:: Plotting from org tables |
| 2107 | @end menu | 2068 | @end menu |
| 2108 | 2069 | ||
| 2109 | @node Built-in table editor, Column width and alignment, Tables, Tables | 2070 | @node Built-in table editor |
| 2110 | @section The built-in table editor | 2071 | @section The built-in table editor |
| 2111 | @cindex table editor, built-in | 2072 | @cindex table editor, built-in |
| 2112 | 2073 | ||
| @@ -2155,12 +2116,13 @@ unpredictable for you, configure the options | |||
| 2155 | @table @kbd | 2116 | @table @kbd |
| 2156 | @tsubheading{Creation and conversion} | 2117 | @tsubheading{Creation and conversion} |
| 2157 | @orgcmd{C-c |,org-table-create-or-convert-from-region} | 2118 | @orgcmd{C-c |,org-table-create-or-convert-from-region} |
| 2158 | Convert the active region to table. If every line contains at least one | 2119 | Convert the active region to a table. If every line contains at least one |
| 2159 | TAB character, the function assumes that the material is tab separated. | 2120 | TAB character, the function assumes that the material is tab separated. |
| 2160 | If every line contains a comma, comma-separated values (CSV) are assumed. | 2121 | If every line contains a comma, comma-separated values (CSV) are assumed. |
| 2161 | If not, lines are split at whitespace into fields. You can use a prefix | 2122 | If not, lines are split at whitespace into fields. You can use a prefix |
| 2162 | argument to force a specific separator: @kbd{C-u} forces CSV, @kbd{C-u | 2123 | argument to force a specific separator: @kbd{C-u} forces CSV, @kbd{C-u |
| 2163 | C-u} forces TAB, and a numeric argument N indicates that at least N | 2124 | C-u} forces TAB, @kbd{C-u C-u C-u} will prompt for a regular expression to |
| 2125 | match the separator, and a numeric argument N indicates that at least N | ||
| 2164 | consecutive spaces, or alternatively a TAB will be the separator. | 2126 | consecutive spaces, or alternatively a TAB will be the separator. |
| 2165 | @* | 2127 | @* |
| 2166 | If there is no active region, this command creates an empty Org | 2128 | If there is no active region, this command creates an empty Org |
| @@ -2171,7 +2133,10 @@ table. But it is easier just to start typing, like | |||
| 2171 | @orgcmd{C-c C-c,org-table-align} | 2133 | @orgcmd{C-c C-c,org-table-align} |
| 2172 | Re-align the table and don't move to another field. | 2134 | Re-align the table and don't move to another field. |
| 2173 | @c | 2135 | @c |
| 2174 | @orgcmd{<TAB>,org-table-next-field} | 2136 | @orgcmd{C-c SPC,org-table-blank-field} |
| 2137 | Blank the field at point. | ||
| 2138 | @c | ||
| 2139 | @orgcmd{TAB,org-table-next-field} | ||
| 2175 | Re-align the table, move to the next field. Creates a new row if | 2140 | Re-align the table, move to the next field. Creates a new row if |
| 2176 | necessary. | 2141 | necessary. |
| 2177 | @c | 2142 | @c |
| @@ -2224,8 +2189,10 @@ point is before the first column, you will be prompted for the sorting | |||
| 2224 | column. If there is an active region, the mark specifies the first line | 2189 | column. If there is an active region, the mark specifies the first line |
| 2225 | and the sorting column, while point should be in the last line to be | 2190 | and the sorting column, while point should be in the last line to be |
| 2226 | included into the sorting. The command prompts for the sorting type | 2191 | included into the sorting. The command prompts for the sorting type |
| 2227 | (alphabetically, numerically, or by time). When called with a prefix | 2192 | (alphabetically, numerically, or by time). You can sort in normal or |
| 2228 | argument, alphabetic sorting will be case-sensitive. | 2193 | reverse order. You can also supply your own key extraction and comparison |
| 2194 | functions. When called with a prefix argument, alphabetic sorting will be | ||
| 2195 | case-sensitive. | ||
| 2229 | 2196 | ||
| 2230 | @tsubheading{Regions} | 2197 | @tsubheading{Regions} |
| 2231 | @orgcmd{C-c C-x M-w,org-table-copy-region} | 2198 | @orgcmd{C-c C-x M-w,org-table-copy-region} |
| @@ -2322,7 +2289,7 @@ it off with | |||
| 2322 | @noindent Then the only table command that still works is | 2289 | @noindent Then the only table command that still works is |
| 2323 | @kbd{C-c C-c} to do a manual re-align. | 2290 | @kbd{C-c C-c} to do a manual re-align. |
| 2324 | 2291 | ||
| 2325 | @node Column width and alignment, Column groups, Built-in table editor, Tables | 2292 | @node Column width and alignment |
| 2326 | @section Column width and alignment | 2293 | @section Column width and alignment |
| 2327 | @cindex narrow columns in tables | 2294 | @cindex narrow columns in tables |
| 2328 | @cindex alignment in tables | 2295 | @cindex alignment in tables |
| @@ -2333,11 +2300,11 @@ of number-like versus non-number fields in the column. | |||
| 2333 | 2300 | ||
| 2334 | Sometimes a single field or a few fields need to carry more text, leading to | 2301 | Sometimes a single field or a few fields need to carry more text, leading to |
| 2335 | inconveniently wide columns. Or maybe you want to make a table with several | 2302 | inconveniently wide columns. Or maybe you want to make a table with several |
| 2336 | columns having a fixed width, regardless of content. To set@footnote{This | 2303 | columns having a fixed width, regardless of content. To set the width of |
| 2337 | feature does not work on XEmacs.} the width of a column, one field anywhere | 2304 | a column, one field anywhere in the column may contain just the string |
| 2338 | in the column may contain just the string @samp{<N>} where @samp{N} is an | 2305 | @samp{<N>} where @samp{N} is an integer specifying the width of the column in |
| 2339 | integer specifying the width of the column in characters. The next re-align | 2306 | characters. The next re-align will then set the width of this column to this |
| 2340 | will then set the width of this column to this value. | 2307 | value. |
| 2341 | 2308 | ||
| 2342 | @example | 2309 | @example |
| 2343 | @group | 2310 | @group |
| @@ -2374,7 +2341,7 @@ on a per-file basis with: | |||
| 2374 | @end example | 2341 | @end example |
| 2375 | 2342 | ||
| 2376 | If you would like to overrule the automatic alignment of number-rich columns | 2343 | If you would like to overrule the automatic alignment of number-rich columns |
| 2377 | to the right and of string-rich column to the left, you can use @samp{<r>}, | 2344 | to the right and of string-rich columns to the left, you can use @samp{<r>}, |
| 2378 | @samp{<c>}@footnote{Centering does not work inside Emacs, but it does have an | 2345 | @samp{<c>}@footnote{Centering does not work inside Emacs, but it does have an |
| 2379 | effect when exporting to HTML.} or @samp{<l>} in a similar fashion. You may | 2346 | effect when exporting to HTML.} or @samp{<l>} in a similar fashion. You may |
| 2380 | also combine alignment and field width like this: @samp{<r10>}. | 2347 | also combine alignment and field width like this: @samp{<r10>}. |
| @@ -2382,30 +2349,29 @@ also combine alignment and field width like this: @samp{<r10>}. | |||
| 2382 | Lines which only contain these formatting cookies will be removed | 2349 | Lines which only contain these formatting cookies will be removed |
| 2383 | automatically when exporting the document. | 2350 | automatically when exporting the document. |
| 2384 | 2351 | ||
| 2385 | @node Column groups, Orgtbl mode, Column width and alignment, Tables | 2352 | @node Column groups |
| 2386 | @section Column groups | 2353 | @section Column groups |
| 2387 | @cindex grouping columns in tables | 2354 | @cindex grouping columns in tables |
| 2388 | 2355 | ||
| 2389 | When Org exports tables, it does so by default without vertical | 2356 | When Org exports tables, it does so by default without vertical lines because |
| 2390 | lines because that is visually more satisfying in general. Occasionally | 2357 | that is visually more satisfying in general. Occasionally however, vertical |
| 2391 | however, vertical lines can be useful to structure a table into groups | 2358 | lines can be useful to structure a table into groups of columns, much like |
| 2392 | of columns, much like horizontal lines can do for groups of rows. In | 2359 | horizontal lines can do for groups of rows. In order to specify column |
| 2393 | order to specify column groups, you can use a special row where the | 2360 | groups, you can use a special row where the first field contains only |
| 2394 | first field contains only @samp{/}. The further fields can either | 2361 | @samp{/}. The further fields can either contain @samp{<} to indicate that |
| 2395 | contain @samp{<} to indicate that this column should start a group, | 2362 | this column should start a group, @samp{>} to indicate the end of a group, or |
| 2396 | @samp{>} to indicate the end of a column, or @samp{<>} (no space between @samp{<} | 2363 | @samp{<>} (no space between @samp{<} and @samp{>}) to make a column a group |
| 2397 | and @samp{>}) to make a column | 2364 | of its own. Boundaries between column groups will upon export be marked with |
| 2398 | a group of its own. Boundaries between column groups will upon export be | 2365 | vertical lines. Here is an example: |
| 2399 | marked with vertical lines. Here is an example: | 2366 | |
| 2400 | 2367 | @example | |
| 2401 | @example | 2368 | | N | N^2 | N^3 | N^4 | ~sqrt(n)~ | ~sqrt[4](N)~ | |
| 2402 | | N | N^2 | N^3 | N^4 | sqrt(n) | sqrt[4](N) | | 2369 | |---+-----+-----+-----+-----------+--------------| |
| 2403 | |---+-----+-----+-----+---------+------------| | 2370 | | / | < | | > | < | > | |
| 2404 | | / | < | | > | < | > | | 2371 | | 1 | 1 | 1 | 1 | 1 | 1 | |
| 2405 | | 1 | 1 | 1 | 1 | 1 | 1 | | 2372 | | 2 | 4 | 8 | 16 | 1.4142 | 1.1892 | |
| 2406 | | 2 | 4 | 8 | 16 | 1.4142 | 1.1892 | | 2373 | | 3 | 9 | 27 | 81 | 1.7321 | 1.3161 | |
| 2407 | | 3 | 9 | 27 | 81 | 1.7321 | 1.3161 | | 2374 | |---+-----+-----+-----+-----------+--------------| |
| 2408 | |---+-----+-----+-----+---------+------------| | ||
| 2409 | #+TBLFM: $2=$1^2::$3=$1^3::$4=$1^4::$5=sqrt($1)::$6=sqrt(sqrt(($1))) | 2375 | #+TBLFM: $2=$1^2::$3=$1^3::$4=$1^4::$5=sqrt($1)::$6=sqrt(sqrt(($1))) |
| 2410 | @end example | 2376 | @end example |
| 2411 | 2377 | ||
| @@ -2418,7 +2384,7 @@ every vertical line you would like to have: | |||
| 2418 | | / | < | | | < | | | 2384 | | / | < | | | < | | |
| 2419 | @end example | 2385 | @end example |
| 2420 | 2386 | ||
| 2421 | @node Orgtbl mode, The spreadsheet, Column groups, Tables | 2387 | @node Orgtbl mode |
| 2422 | @section The Orgtbl minor mode | 2388 | @section The Orgtbl minor mode |
| 2423 | @cindex Orgtbl mode | 2389 | @cindex Orgtbl mode |
| 2424 | @cindex minor mode for tables | 2390 | @cindex minor mode for tables |
| @@ -2439,7 +2405,7 @@ construct @LaTeX{} tables with the underlying ease and power of | |||
| 2439 | Orgtbl mode, including spreadsheet capabilities. For details, see | 2405 | Orgtbl mode, including spreadsheet capabilities. For details, see |
| 2440 | @ref{Tables in arbitrary syntax}. | 2406 | @ref{Tables in arbitrary syntax}. |
| 2441 | 2407 | ||
| 2442 | @node The spreadsheet, Org-Plot, Orgtbl mode, Tables | 2408 | @node The spreadsheet |
| 2443 | @section The spreadsheet | 2409 | @section The spreadsheet |
| 2444 | @cindex calculations, in tables | 2410 | @cindex calculations, in tables |
| 2445 | @cindex spreadsheet capabilities | 2411 | @cindex spreadsheet capabilities |
| @@ -2468,7 +2434,7 @@ formula, moving these references by arrow keys | |||
| 2468 | * Advanced features:: Field and column names, parameters and automatic recalc | 2434 | * Advanced features:: Field and column names, parameters and automatic recalc |
| 2469 | @end menu | 2435 | @end menu |
| 2470 | 2436 | ||
| 2471 | @node References, Formula syntax for Calc, The spreadsheet, The spreadsheet | 2437 | @node References |
| 2472 | @subsection References | 2438 | @subsection References |
| 2473 | @cindex references | 2439 | @cindex references |
| 2474 | 2440 | ||
| @@ -2554,7 +2520,7 @@ format at least for the first field (i.e the reference must start with | |||
| 2554 | @example | 2520 | @example |
| 2555 | $1..$3 @r{first three fields in the current row} | 2521 | $1..$3 @r{first three fields in the current row} |
| 2556 | $P..$Q @r{range, using column names (see under Advanced)} | 2522 | $P..$Q @r{range, using column names (see under Advanced)} |
| 2557 | $<<<..$>> @r{start in third column, continue to the one but last} | 2523 | $<<<..$>> @r{start in third column, continue to the last but one} |
| 2558 | @@2$1..@@4$3 @r{6 fields between these two fields (same as @code{A2..C4})} | 2524 | @@2$1..@@4$3 @r{6 fields between these two fields (same as @code{A2..C4})} |
| 2559 | @@-1$-2..@@-1 @r{3 fields in the row above, starting from 2 columns on the left} | 2525 | @@-1$-2..@@-1 @r{3 fields in the row above, starting from 2 columns on the left} |
| 2560 | @@I..II @r{between first and second hline, short for @code{@@I..@@II}} | 2526 | @@I..II @r{between first and second hline, short for @code{@@I..@@II}} |
| @@ -2572,21 +2538,28 @@ for Calc}. | |||
| 2572 | @cindex row, of field coordinates | 2538 | @cindex row, of field coordinates |
| 2573 | @cindex column, of field coordinates | 2539 | @cindex column, of field coordinates |
| 2574 | 2540 | ||
| 2575 | For Calc formulas and Lisp formulas @code{@@#} and @code{$#} can be used to | 2541 | One of the very first actions during evaluation of Calc formulas and Lisp |
| 2576 | get the row or column number of the field where the formula result goes. | 2542 | formulas is to substitute @code{@@#} and @code{$#} in the formula with the |
| 2577 | The traditional Lisp formula equivalents are @code{org-table-current-dline} | 2543 | row or column number of the field where the current result will go to. The |
| 2578 | and @code{org-table-current-column}. Examples: | 2544 | traditional Lisp formula equivalents are @code{org-table-current-dline} and |
| 2545 | @code{org-table-current-column}. Examples: | ||
| 2579 | 2546 | ||
| 2580 | @example | 2547 | @table @code |
| 2581 | if(@@# % 2, $#, string("")) @r{column number on odd lines only} | 2548 | @item if(@@# % 2, $#, string("")) |
| 2582 | $3 = remote(FOO, @@@@#$2) @r{copy column 2 from table FOO into} | 2549 | Insert column number on odd rows, set field to empty on even rows. |
| 2583 | @r{column 3 of the current table} | 2550 | @item $2 = '(identity remote(FOO, @@@@#$1)) |
| 2584 | @end example | 2551 | Copy text or values of each row of column 1 of the table named @code{FOO} |
| 2552 | into column 2 of the current table. | ||
| 2553 | @item @@3 = 2 * remote(FOO, @@1$$#) | ||
| 2554 | Insert the doubled value of each column of row 1 of the table named | ||
| 2555 | @code{FOO} into row 3 of the current table. | ||
| 2556 | @end table | ||
| 2585 | 2557 | ||
| 2586 | @noindent For the second example, table FOO must have at least as many rows | 2558 | @noindent For the second/third example, the table named @code{FOO} must have |
| 2587 | as the current table. Note that this is inefficient@footnote{The computation time scales as | 2559 | at least as many rows/columns as the current table. Note that this is |
| 2588 | O(N^2) because table FOO is parsed for each field to be copied.} for large | 2560 | inefficient@footnote{The computation time scales as O(N^2) because the table |
| 2589 | number of rows. | 2561 | named @code{FOO} is parsed for each field to be read.} for large number of |
| 2562 | rows/columns. | ||
| 2590 | 2563 | ||
| 2591 | @subsubheading Named references | 2564 | @subsubheading Named references |
| 2592 | @cindex named references | 2565 | @cindex named references |
| @@ -2608,7 +2581,7 @@ line like | |||
| 2608 | @noindent | 2581 | @noindent |
| 2609 | @vindex constants-unit-system | 2582 | @vindex constants-unit-system |
| 2610 | @pindex constants.el | 2583 | @pindex constants.el |
| 2611 | Also properties (@pxref{Properties and Columns}) can be used as | 2584 | Also properties (@pxref{Properties and columns}) can be used as |
| 2612 | constants in table formulas: for a property @samp{:Xyz:} use the name | 2585 | constants in table formulas: for a property @samp{:Xyz:} use the name |
| 2613 | @samp{$PROP_Xyz}, and the property will be searched in the current | 2586 | @samp{$PROP_Xyz}, and the property will be searched in the current |
| 2614 | outline entry and in the hierarchy above it. If you have the | 2587 | outline entry and in the hierarchy above it. If you have the |
| @@ -2647,7 +2620,13 @@ table in that entry. REF is an absolute field or range reference as | |||
| 2647 | described above for example @code{@@3$3} or @code{$somename}, valid in the | 2620 | described above for example @code{@@3$3} or @code{$somename}, valid in the |
| 2648 | referenced table. | 2621 | referenced table. |
| 2649 | 2622 | ||
| 2650 | @node Formula syntax for Calc, Formula syntax for Lisp, References, The spreadsheet | 2623 | Indirection of NAME-OR-ID: When NAME-OR-ID has the format @code{@@ROW$COLUMN} |
| 2624 | it will be substituted with the name or ID found in this field of the current | ||
| 2625 | table. For example @code{remote($1, @@>$2)} => @code{remote(year_2013, | ||
| 2626 | @@>$1)}. The format @code{B3} is not supported because it can not be | ||
| 2627 | distinguished from a plain table name or ID. | ||
| 2628 | |||
| 2629 | @node Formula syntax for Calc | ||
| 2651 | @subsection Formula syntax for Calc | 2630 | @subsection Formula syntax for Calc |
| 2652 | @cindex formula syntax, Calc | 2631 | @cindex formula syntax, Calc |
| 2653 | @cindex syntax, of formulas | 2632 | @cindex syntax, of formulas |
| @@ -2762,7 +2741,7 @@ should be padded with 0 to the full size. | |||
| 2762 | You can add your own Calc functions defined in Emacs Lisp with @code{defmath} | 2741 | You can add your own Calc functions defined in Emacs Lisp with @code{defmath} |
| 2763 | and use them in formula syntax for Calc. | 2742 | and use them in formula syntax for Calc. |
| 2764 | 2743 | ||
| 2765 | @node Formula syntax for Lisp, Durations and time values, Formula syntax for Calc, The spreadsheet | 2744 | @node Formula syntax for Lisp |
| 2766 | @subsection Emacs Lisp forms as formulas | 2745 | @subsection Emacs Lisp forms as formulas |
| 2767 | @cindex Lisp forms, as table formulas | 2746 | @cindex Lisp forms, as table formulas |
| 2768 | 2747 | ||
| @@ -2798,7 +2777,7 @@ Add columns 1 and 2, equivalent to Calc's @code{$1+$2}. | |||
| 2798 | Compute the sum of columns 1 to 4, like Calc's @code{vsum($1..$4)}. | 2777 | Compute the sum of columns 1 to 4, like Calc's @code{vsum($1..$4)}. |
| 2799 | @end table | 2778 | @end table |
| 2800 | 2779 | ||
| 2801 | @node Durations and time values, Field and range formulas, Formula syntax for Lisp, The spreadsheet | 2780 | @node Durations and time values |
| 2802 | @subsection Durations and time values | 2781 | @subsection Durations and time values |
| 2803 | @cindex Duration, computing | 2782 | @cindex Duration, computing |
| 2804 | @cindex Time, computing | 2783 | @cindex Time, computing |
| @@ -2817,7 +2796,7 @@ formulas or Elisp formulas: | |||
| 2817 | @end group | 2796 | @end group |
| 2818 | @end example | 2797 | @end example |
| 2819 | 2798 | ||
| 2820 | Input duration values must be of the form @code{[HH:MM[:SS]}, where seconds | 2799 | Input duration values must be of the form @code{HH:MM[:SS]}, where seconds |
| 2821 | are optional. With the @code{T} flag, computed durations will be displayed | 2800 | are optional. With the @code{T} flag, computed durations will be displayed |
| 2822 | as @code{HH:MM:SS} (see the first formula above). With the @code{t} flag, | 2801 | as @code{HH:MM:SS} (see the first formula above). With the @code{t} flag, |
| 2823 | computed durations will be displayed according to the value of the option | 2802 | computed durations will be displayed according to the value of the option |
| @@ -2828,7 +2807,7 @@ example above). | |||
| 2828 | Negative duration values can be manipulated as well, and integers will be | 2807 | Negative duration values can be manipulated as well, and integers will be |
| 2829 | considered as seconds in addition and subtraction. | 2808 | considered as seconds in addition and subtraction. |
| 2830 | 2809 | ||
| 2831 | @node Field and range formulas, Column formulas, Durations and time values, The spreadsheet | 2810 | @node Field and range formulas |
| 2832 | @subsection Field and range formulas | 2811 | @subsection Field and range formulas |
| 2833 | @cindex field formula | 2812 | @cindex field formula |
| 2834 | @cindex range formula | 2813 | @cindex range formula |
| @@ -2845,13 +2824,13 @@ current field will be replaced with the result. | |||
| 2845 | Formulas are stored in a special line starting with @samp{#+TBLFM:} directly | 2824 | Formulas are stored in a special line starting with @samp{#+TBLFM:} directly |
| 2846 | below the table. If you type the equation in the 4th field of the 3rd data | 2825 | below the table. If you type the equation in the 4th field of the 3rd data |
| 2847 | line in the table, the formula will look like @samp{@@3$4=$1+$2}. When | 2826 | line in the table, the formula will look like @samp{@@3$4=$1+$2}. When |
| 2848 | inserting/deleting/swapping column and rows with the appropriate commands, | 2827 | inserting/deleting/swapping columns and rows with the appropriate commands, |
| 2849 | @i{absolute references} (but not relative ones) in stored formulas are | 2828 | @i{absolute references} (but not relative ones) in stored formulas are |
| 2850 | modified in order to still reference the same field. To avoid this from | 2829 | modified in order to still reference the same field. To avoid this, in |
| 2851 | happening, in particular in range references, anchor ranges at the table | 2830 | particular in range references, anchor ranges at the table borders (using |
| 2852 | borders (using @code{@@<}, @code{@@>}, @code{$<}, @code{$>}), or at hlines | 2831 | @code{@@<}, @code{@@>}, @code{$<}, @code{$>}), or at hlines using the |
| 2853 | using the @code{@@I} notation. Automatic adaptation of field references does | 2832 | @code{@@I} notation. Automatic adaptation of field references does of course |
| 2854 | of course not happen if you edit the table structure with normal editing | 2833 | not happen if you edit the table structure with normal editing |
| 2855 | commands---then you must fix the equations yourself. | 2834 | commands---then you must fix the equations yourself. |
| 2856 | 2835 | ||
| 2857 | Instead of typing an equation into the field, you may also use the following | 2836 | Instead of typing an equation into the field, you may also use the following |
| @@ -2884,7 +2863,7 @@ can also be used to assign a formula to some but not all fields in a row. | |||
| 2884 | Named field, see @ref{Advanced features}. | 2863 | Named field, see @ref{Advanced features}. |
| 2885 | @end table | 2864 | @end table |
| 2886 | 2865 | ||
| 2887 | @node Column formulas, Lookup functions, Field and range formulas, The spreadsheet | 2866 | @node Column formulas |
| 2888 | @subsection Column formulas | 2867 | @subsection Column formulas |
| 2889 | @cindex column formula | 2868 | @cindex column formula |
| 2890 | @cindex formula, for table column | 2869 | @cindex formula, for table column |
| @@ -2908,7 +2887,7 @@ and the current field replaced with the result. If the field contains only | |||
| 2908 | @samp{=}, the previously stored formula for this column is used. For each | 2887 | @samp{=}, the previously stored formula for this column is used. For each |
| 2909 | column, Org will only remember the most recently used formula. In the | 2888 | column, Org will only remember the most recently used formula. In the |
| 2910 | @samp{#+TBLFM:} line, column formulas will look like @samp{$4=$1+$2}. The | 2889 | @samp{#+TBLFM:} line, column formulas will look like @samp{$4=$1+$2}. The |
| 2911 | left-hand side of a column formula can not be the name of column, it must be | 2890 | left-hand side of a column formula cannot be the name of column, it must be |
| 2912 | the numeric column reference or @code{$>}. | 2891 | the numeric column reference or @code{$>}. |
| 2913 | 2892 | ||
| 2914 | Instead of typing an equation into the field, you may also use the | 2893 | Instead of typing an equation into the field, you may also use the |
| @@ -2923,7 +2902,7 @@ stores it. With a numeric prefix argument(e.g., @kbd{C-5 C-c =}) the command | |||
| 2923 | will apply it to that many consecutive fields in the current column. | 2902 | will apply it to that many consecutive fields in the current column. |
| 2924 | @end table | 2903 | @end table |
| 2925 | 2904 | ||
| 2926 | @node Lookup functions, Editing and debugging formulas, Column formulas, The spreadsheet | 2905 | @node Lookup functions |
| 2927 | @subsection Lookup functions | 2906 | @subsection Lookup functions |
| 2928 | @cindex lookup functions in tables | 2907 | @cindex lookup functions in tables |
| 2929 | @cindex table lookup functions | 2908 | @cindex table lookup functions |
| @@ -2967,7 +2946,7 @@ matching cells, rank results, group data etc. For practical examples | |||
| 2967 | see @uref{http://orgmode.org/worg/org-tutorials/org-lookups.html, this | 2946 | see @uref{http://orgmode.org/worg/org-tutorials/org-lookups.html, this |
| 2968 | tutorial on Worg}. | 2947 | tutorial on Worg}. |
| 2969 | 2948 | ||
| 2970 | @node Editing and debugging formulas, Updating the table, Lookup functions, The spreadsheet | 2949 | @node Editing and debugging formulas |
| 2971 | @subsection Editing and debugging formulas | 2950 | @subsection Editing and debugging formulas |
| 2972 | @cindex formula editing | 2951 | @cindex formula editing |
| 2973 | @cindex editing, of table formulas | 2952 | @cindex editing, of table formulas |
| @@ -3026,7 +3005,9 @@ a Lisp formula, format the formula according to Emacs Lisp rules. | |||
| 3026 | Another @key{TAB} collapses the formula back again. In the open | 3005 | Another @key{TAB} collapses the formula back again. In the open |
| 3027 | formula, @key{TAB} re-indents just like in Emacs Lisp mode. | 3006 | formula, @key{TAB} re-indents just like in Emacs Lisp mode. |
| 3028 | @orgcmd{M-@key{TAB},lisp-complete-symbol} | 3007 | @orgcmd{M-@key{TAB},lisp-complete-symbol} |
| 3029 | Complete Lisp symbols, just like in Emacs Lisp mode. | 3008 | Complete Lisp symbols, just like in Emacs Lisp mode.@footnote{Many desktops |
| 3009 | intercept @kbd{M-@key{TAB}} to switch windows. Use @kbd{C-M-i} or | ||
| 3010 | @kbd{@key{ESC} @key{TAB}} instead for completion (@pxref{Completion}).} | ||
| 3030 | @kindex S-@key{up} | 3011 | @kindex S-@key{up} |
| 3031 | @kindex S-@key{down} | 3012 | @kindex S-@key{down} |
| 3032 | @kindex S-@key{left} | 3013 | @kindex S-@key{left} |
| @@ -3118,7 +3099,7 @@ turn on formula debugging in the @code{Tbl} menu and repeat the | |||
| 3118 | calculation, for example by pressing @kbd{C-u C-u C-c = @key{RET}} in a | 3099 | calculation, for example by pressing @kbd{C-u C-u C-c = @key{RET}} in a |
| 3119 | field. Detailed information will be displayed. | 3100 | field. Detailed information will be displayed. |
| 3120 | 3101 | ||
| 3121 | @node Updating the table, Advanced features, Editing and debugging formulas, The spreadsheet | 3102 | @node Updating the table |
| 3122 | @subsection Updating the table | 3103 | @subsection Updating the table |
| 3123 | @cindex recomputing table fields | 3104 | @cindex recomputing table fields |
| 3124 | @cindex updating, table | 3105 | @cindex updating, table |
| @@ -3155,7 +3136,7 @@ Iterate all tables in the current buffer, in order to converge table-to-table | |||
| 3155 | dependencies. | 3136 | dependencies. |
| 3156 | @end table | 3137 | @end table |
| 3157 | 3138 | ||
| 3158 | @node Advanced features, , Updating the table, The spreadsheet | 3139 | @node Advanced features |
| 3159 | @subsection Advanced features | 3140 | @subsection Advanced features |
| 3160 | 3141 | ||
| 3161 | If you want the recalculation of fields to happen automatically, or if you | 3142 | If you want the recalculation of fields to happen automatically, or if you |
| @@ -3260,17 +3241,23 @@ functions. | |||
| 3260 | @end group | 3241 | @end group |
| 3261 | @end example | 3242 | @end example |
| 3262 | 3243 | ||
| 3263 | @node Org-Plot, , The spreadsheet, Tables | 3244 | @node Org-Plot |
| 3264 | @section Org-Plot | 3245 | @section Org-Plot |
| 3265 | @cindex graph, in tables | 3246 | @cindex graph, in tables |
| 3266 | @cindex plot tables using Gnuplot | 3247 | @cindex plot tables using Gnuplot |
| 3267 | @cindex #+PLOT | 3248 | @cindex #+PLOT |
| 3268 | 3249 | ||
| 3269 | Org-Plot can produce 2D and 3D graphs of information stored in org tables | 3250 | Org-Plot can produce graphs of information stored in org tables, either |
| 3270 | using @file{Gnuplot} @uref{http://www.gnuplot.info/} and @file{gnuplot-mode} | 3251 | graphically or in ASCII-art. |
| 3252 | |||
| 3253 | @subheading Graphical plots using @file{Gnuplot} | ||
| 3254 | |||
| 3255 | Org-Plot produces 2D and 3D graphs using @file{Gnuplot} | ||
| 3256 | @uref{http://www.gnuplot.info/} and @file{gnuplot-mode} | ||
| 3271 | @uref{http://xafs.org/BruceRavel/GnuplotMode}. To see this in action, ensure | 3257 | @uref{http://xafs.org/BruceRavel/GnuplotMode}. To see this in action, ensure |
| 3272 | that you have both Gnuplot and Gnuplot mode installed on your system, then | 3258 | that you have both Gnuplot and Gnuplot mode installed on your system, then |
| 3273 | call @code{org-plot/gnuplot} on the following table. | 3259 | call @kbd{C-c " g} or @kbd{M-x org-plot/gnuplot @key{RET}} on the following |
| 3260 | table. | ||
| 3274 | 3261 | ||
| 3275 | @example | 3262 | @example |
| 3276 | @group | 3263 | @group |
| @@ -3288,8 +3275,8 @@ call @code{org-plot/gnuplot} on the following table. | |||
| 3288 | Notice that Org Plot is smart enough to apply the table's headers as labels. | 3275 | Notice that Org Plot is smart enough to apply the table's headers as labels. |
| 3289 | Further control over the labels, type, content, and appearance of plots can | 3276 | Further control over the labels, type, content, and appearance of plots can |
| 3290 | be exercised through the @code{#+PLOT:} lines preceding a table. See below | 3277 | be exercised through the @code{#+PLOT:} lines preceding a table. See below |
| 3291 | for a complete list of Org-plot options. For more information and examples | 3278 | for a complete list of Org-plot options. The @code{#+PLOT:} lines are |
| 3292 | see the Org-plot tutorial at | 3279 | optional. For more information and examples see the Org-plot tutorial at |
| 3293 | @uref{http://orgmode.org/worg/org-tutorials/org-plot.html}. | 3280 | @uref{http://orgmode.org/worg/org-tutorials/org-plot.html}. |
| 3294 | 3281 | ||
| 3295 | @subsubheading Plot Options | 3282 | @subsubheading Plot Options |
| @@ -3345,7 +3332,48 @@ may still want to specify the plot type, as that can impact the content of | |||
| 3345 | the data file. | 3332 | the data file. |
| 3346 | @end table | 3333 | @end table |
| 3347 | 3334 | ||
| 3348 | @node Hyperlinks, TODO Items, Tables, Top | 3335 | @subheading ASCII bar plots |
| 3336 | |||
| 3337 | While the cursor is on a column, typing @kbd{C-c " a} or | ||
| 3338 | @kbd{M-x orgtbl-ascii-plot @key{RET}} create a new column containing an | ||
| 3339 | ASCII-art bars plot. The plot is implemented through a regular column | ||
| 3340 | formula. When the source column changes, the bar plot may be updated by | ||
| 3341 | refreshing the table, for example typing @kbd{C-u C-c *}. | ||
| 3342 | |||
| 3343 | @example | ||
| 3344 | @group | ||
| 3345 | | Sede | Max cites | | | ||
| 3346 | |---------------+-----------+--------------| | ||
| 3347 | | Chile | 257.72 | WWWWWWWWWWWW | | ||
| 3348 | | Leeds | 165.77 | WWWWWWWh | | ||
| 3349 | | Sao Paolo | 71.00 | WWW; | | ||
| 3350 | | Stockholm | 134.19 | WWWWWW: | | ||
| 3351 | | Morelia | 257.56 | WWWWWWWWWWWH | | ||
| 3352 | | Rochefourchat | 0.00 | | | ||
| 3353 | #+TBLFM: $3='(orgtbl-ascii-draw $2 0.0 257.72 12) | ||
| 3354 | @end group | ||
| 3355 | @end example | ||
| 3356 | |||
| 3357 | The formula is an elisp call: | ||
| 3358 | @lisp | ||
| 3359 | (orgtbl-ascii-draw COLUMN MIN MAX WIDTH) | ||
| 3360 | @end lisp | ||
| 3361 | |||
| 3362 | @table @code | ||
| 3363 | @item COLUMN | ||
| 3364 | is a reference to the source column. | ||
| 3365 | |||
| 3366 | @item MIN MAX | ||
| 3367 | are the minimal and maximal values displayed. Sources values | ||
| 3368 | outside this range are displayed as @samp{too small} | ||
| 3369 | or @samp{too large}. | ||
| 3370 | |||
| 3371 | @item WIDTH | ||
| 3372 | is the width in characters of the bar-plot. It defaults to @samp{12}. | ||
| 3373 | |||
| 3374 | @end table | ||
| 3375 | |||
| 3376 | @node Hyperlinks | ||
| 3349 | @chapter Hyperlinks | 3377 | @chapter Hyperlinks |
| 3350 | @cindex hyperlinks | 3378 | @cindex hyperlinks |
| 3351 | 3379 | ||
| @@ -3363,7 +3391,7 @@ other files, Usenet articles, emails, and much more. | |||
| 3363 | * Custom searches:: When the default search is not enough | 3391 | * Custom searches:: When the default search is not enough |
| 3364 | @end menu | 3392 | @end menu |
| 3365 | 3393 | ||
| 3366 | @node Link format, Internal links, Hyperlinks, Hyperlinks | 3394 | @node Link format |
| 3367 | @section Link format | 3395 | @section Link format |
| 3368 | @cindex link format | 3396 | @cindex link format |
| 3369 | @cindex format, of links | 3397 | @cindex format, of links |
| @@ -3394,7 +3422,7 @@ missing bracket hides the link internals again. To show the | |||
| 3394 | internal structure of all links, use the menu entry | 3422 | internal structure of all links, use the menu entry |
| 3395 | @code{Org->Hyperlinks->Literal links}. | 3423 | @code{Org->Hyperlinks->Literal links}. |
| 3396 | 3424 | ||
| 3397 | @node Internal links, External links, Link format, Hyperlinks | 3425 | @node Internal links |
| 3398 | @section Internal links | 3426 | @section Internal links |
| 3399 | @cindex internal links | 3427 | @cindex internal links |
| 3400 | @cindex links, internal | 3428 | @cindex links, internal |
| @@ -3419,8 +3447,8 @@ a @i{dedicated target}: the same string in double angular brackets, like | |||
| 3419 | @cindex #+NAME | 3447 | @cindex #+NAME |
| 3420 | If no dedicated target exists, the link will then try to match the exact name | 3448 | If no dedicated target exists, the link will then try to match the exact name |
| 3421 | of an element within the buffer. Naming is done with the @code{#+NAME} | 3449 | of an element within the buffer. Naming is done with the @code{#+NAME} |
| 3422 | keyword, which has to be put the line before the element it refers to, as in | 3450 | keyword, which has to be put in the line before the element it refers to, as |
| 3423 | the following example | 3451 | in the following example |
| 3424 | 3452 | ||
| 3425 | @example | 3453 | @example |
| 3426 | #+NAME: My Target | 3454 | #+NAME: My Target |
| @@ -3465,7 +3493,7 @@ earlier. | |||
| 3465 | * Radio targets:: Make targets trigger links in plain text | 3493 | * Radio targets:: Make targets trigger links in plain text |
| 3466 | @end menu | 3494 | @end menu |
| 3467 | 3495 | ||
| 3468 | @node Radio targets, , Internal links, Internal links | 3496 | @node Radio targets |
| 3469 | @subsection Radio targets | 3497 | @subsection Radio targets |
| 3470 | @cindex radio targets | 3498 | @cindex radio targets |
| 3471 | @cindex targets, radio | 3499 | @cindex targets, radio |
| @@ -3481,7 +3509,7 @@ for radio targets only when the file is first loaded into Emacs. To | |||
| 3481 | update the target list during editing, press @kbd{C-c C-c} with the | 3509 | update the target list during editing, press @kbd{C-c C-c} with the |
| 3482 | cursor on or at a target. | 3510 | cursor on or at a target. |
| 3483 | 3511 | ||
| 3484 | @node External links, Handling links, Internal links, Hyperlinks | 3512 | @node External links |
| 3485 | @section External links | 3513 | @section External links |
| 3486 | @cindex links, external | 3514 | @cindex links, external |
| 3487 | @cindex external links | 3515 | @cindex external links |
| @@ -3504,42 +3532,44 @@ string followed by a colon. There can be no space after the colon. The | |||
| 3504 | following list shows examples for each link type. | 3532 | following list shows examples for each link type. |
| 3505 | 3533 | ||
| 3506 | @example | 3534 | @example |
| 3507 | http://www.astro.uva.nl/~dominik @r{on the web} | 3535 | http://www.astro.uva.nl/~dominik @r{on the web} |
| 3508 | doi:10.1000/182 @r{DOI for an electronic resource} | 3536 | doi:10.1000/182 @r{DOI for an electronic resource} |
| 3509 | file:/home/dominik/images/jupiter.jpg @r{file, absolute path} | 3537 | file:/home/dominik/images/jupiter.jpg @r{file, absolute path} |
| 3510 | /home/dominik/images/jupiter.jpg @r{same as above} | 3538 | /home/dominik/images/jupiter.jpg @r{same as above} |
| 3511 | file:papers/last.pdf @r{file, relative path} | 3539 | file:papers/last.pdf @r{file, relative path} |
| 3512 | ./papers/last.pdf @r{same as above} | 3540 | ./papers/last.pdf @r{same as above} |
| 3513 | file:/myself@@some.where:papers/last.pdf @r{file, path on remote machine} | 3541 | file:/ssh:myself@@some.where:papers/last.pdf @r{file, path on remote machine} |
| 3514 | /myself@@some.where:papers/last.pdf @r{same as above} | 3542 | /ssh:myself@@some.where:papers/last.pdf @r{same as above} |
| 3515 | file:sometextfile::NNN @r{file, jump to line number} | 3543 | file:sometextfile::NNN @r{file, jump to line number} |
| 3516 | file:projects.org @r{another Org file} | 3544 | file:projects.org @r{another Org file} |
| 3517 | file:projects.org::some words @r{text search in Org file}@footnote{ | 3545 | file:projects.org::some words @r{text search in Org file}@footnote{ |
| 3518 | The actual behavior of the search will depend on the value of | 3546 | The actual behavior of the search will depend on the value of |
| 3519 | the option @code{org-link-search-must-match-exact-headline}. If its value | 3547 | the option @code{org-link-search-must-match-exact-headline}. If its value |
| 3520 | is @code{nil}, then a fuzzy text search will be done. If it is t, then only the | 3548 | is @code{nil}, then a fuzzy text search will be done. If it is @code{t}, then only |
| 3521 | exact headline will be matched. If the value is @code{'query-to-create}, | 3549 | the exact headline will be matched, ignoring spaces and cookies. If the |
| 3522 | then an exact headline will be searched; if it is not found, then the user | 3550 | value is @code{query-to-create}, then an exact headline will be searched; if |
| 3523 | will be queried to create it.} | 3551 | it is not found, then the user will be queried to create it.} |
| 3524 | file:projects.org::*task title @r{heading search in Org file} | 3552 | file:projects.org::*task title @r{heading search in Org file}@footnote{ |
| 3525 | file+sys:/path/to/file @r{open via OS, like double-click} | 3553 | Headline searches always match the exact headline, ignoring |
| 3526 | file+emacs:/path/to/file @r{force opening by Emacs} | 3554 | spaces and cookies. If the headline is not found and the value of the option |
| 3527 | docview:papers/last.pdf::NNN @r{open in doc-view mode at page} | 3555 | @code{org-link-search-must-match-exact-headline} is @code{query-to-create}, |
| 3528 | id:B7423F4D-2E8A-471B-8810-C40F074717E9 @r{Link to heading by ID} | 3556 | then the user will be queried to create it.} |
| 3529 | news:comp.emacs @r{Usenet link} | 3557 | docview:papers/last.pdf::NNN @r{open in doc-view mode at page} |
| 3530 | mailto:adent@@galaxy.net @r{Mail link} | 3558 | id:B7423F4D-2E8A-471B-8810-C40F074717E9 @r{Link to heading by ID} |
| 3531 | mhe:folder @r{MH-E folder link} | 3559 | news:comp.emacs @r{Usenet link} |
| 3532 | mhe:folder#id @r{MH-E message link} | 3560 | mailto:adent@@galaxy.net @r{Mail link} |
| 3533 | rmail:folder @r{RMAIL folder link} | 3561 | mhe:folder @r{MH-E folder link} |
| 3534 | rmail:folder#id @r{RMAIL message link} | 3562 | mhe:folder#id @r{MH-E message link} |
| 3535 | gnus:group @r{Gnus group link} | 3563 | rmail:folder @r{RMAIL folder link} |
| 3536 | gnus:group#id @r{Gnus article link} | 3564 | rmail:folder#id @r{RMAIL message link} |
| 3537 | bbdb:R.*Stallman @r{BBDB link (with regexp)} | 3565 | gnus:group @r{Gnus group link} |
| 3538 | irc:/irc.com/#emacs/bob @r{IRC link} | 3566 | gnus:group#id @r{Gnus article link} |
| 3539 | info:org#External links @r{Info node link} | 3567 | bbdb:R.*Stallman @r{BBDB link (with regexp)} |
| 3540 | shell:ls *.org @r{A shell command} | 3568 | irc:/irc.com/#emacs/bob @r{IRC link} |
| 3541 | elisp:org-agenda @r{Interactive Elisp command} | 3569 | info:org#External links @r{Info node or index link} |
| 3542 | elisp:(find-file-other-frame "Elisp.org") @r{Elisp form to evaluate} | 3570 | shell:ls *.org @r{A shell command} |
| 3571 | elisp:org-agenda @r{Interactive Elisp command} | ||
| 3572 | elisp:(find-file-other-frame "Elisp.org") @r{Elisp form to evaluate} | ||
| 3543 | @end example | 3573 | @end example |
| 3544 | 3574 | ||
| 3545 | @cindex VM links | 3575 | @cindex VM links |
| @@ -3550,13 +3580,13 @@ to VM or Wanderlust messages are available when you load the corresponding | |||
| 3550 | libraries from the @code{contrib/} directory: | 3580 | libraries from the @code{contrib/} directory: |
| 3551 | 3581 | ||
| 3552 | @example | 3582 | @example |
| 3553 | vm:folder @r{VM folder link} | 3583 | vm:folder @r{VM folder link} |
| 3554 | vm:folder#id @r{VM message link} | 3584 | vm:folder#id @r{VM message link} |
| 3555 | vm://myself@@some.where.org/folder#id @r{VM on remote machine} | 3585 | vm://myself@@some.where.org/folder#id @r{VM on remote machine} |
| 3556 | vm-imap:account:folder @r{VM IMAP folder link} | 3586 | vm-imap:account:folder @r{VM IMAP folder link} |
| 3557 | vm-imap:account:folder#id @r{VM IMAP message link} | 3587 | vm-imap:account:folder#id @r{VM IMAP message link} |
| 3558 | wl:folder @r{WANDERLUST folder link} | 3588 | wl:folder @r{WANDERLUST folder link} |
| 3559 | wl:folder#id @r{WANDERLUST message link} | 3589 | wl:folder#id @r{WANDERLUST message link} |
| 3560 | @end example | 3590 | @end example |
| 3561 | 3591 | ||
| 3562 | For customizing Org to add new link types @ref{Adding hyperlink types}. | 3592 | For customizing Org to add new link types @ref{Adding hyperlink types}. |
| @@ -3582,7 +3612,7 @@ as links. If spaces must be part of the link (for example in | |||
| 3582 | @samp{bbdb:Richard Stallman}), or if you need to remove ambiguities | 3612 | @samp{bbdb:Richard Stallman}), or if you need to remove ambiguities |
| 3583 | about the end of the link, enclose them in square brackets. | 3613 | about the end of the link, enclose them in square brackets. |
| 3584 | 3614 | ||
| 3585 | @node Handling links, Using links outside Org, External links, Hyperlinks | 3615 | @node Handling links |
| 3586 | @section Handling links | 3616 | @section Handling links |
| 3587 | @cindex links, handling | 3617 | @cindex links, handling |
| 3588 | 3618 | ||
| @@ -3614,9 +3644,9 @@ will be stored. In addition or alternatively (depending on the value of | |||
| 3614 | be created and/or used to construct a link@footnote{The library | 3644 | be created and/or used to construct a link@footnote{The library |
| 3615 | @file{org-id.el} must first be loaded, either through @code{org-customize} by | 3645 | @file{org-id.el} must first be loaded, either through @code{org-customize} by |
| 3616 | enabling @code{org-id} in @code{org-modules}, or by adding @code{(require | 3646 | enabling @code{org-id} in @code{org-modules}, or by adding @code{(require |
| 3617 | 'org-id)} in your @file{.emacs}.}. So using this command in Org buffers will | 3647 | 'org-id)} in your Emacs init file.}. So using this command in Org buffers |
| 3618 | potentially create two links: a human-readable from the custom ID, and one | 3648 | will potentially create two links: a human-readable from the custom ID, and |
| 3619 | that is globally unique and works even if the entry is moved from file to | 3649 | one that is globally unique and works even if the entry is moved from file to |
| 3620 | file. Later, when inserting the link, you need to decide which one to use. | 3650 | file. Later, when inserting the link, you need to decide which one to use. |
| 3621 | 3651 | ||
| 3622 | @b{Email/News clients: VM, Rmail, Wanderlust, MH-E, Gnus}@* | 3652 | @b{Email/News clients: VM, Rmail, Wanderlust, MH-E, Gnus}@* |
| @@ -3624,7 +3654,7 @@ Pretty much all Emacs mail clients are supported. The link will point to the | |||
| 3624 | current article, or, in some GNUS buffers, to the group. The description is | 3654 | current article, or, in some GNUS buffers, to the group. The description is |
| 3625 | constructed from the author and the subject. | 3655 | constructed from the author and the subject. |
| 3626 | 3656 | ||
| 3627 | @b{Web browsers: W3 and W3M}@* | 3657 | @b{Web browsers: Eww, W3 and W3M}@* |
| 3628 | Here the link will be the current URL, with the page title as description. | 3658 | Here the link will be the current URL, with the page title as description. |
| 3629 | 3659 | ||
| 3630 | @b{Contacts: BBDB}@* | 3660 | @b{Contacts: BBDB}@* |
| @@ -3656,7 +3686,8 @@ entry referenced by the current line. | |||
| 3656 | @cindex completion, of links | 3686 | @cindex completion, of links |
| 3657 | @cindex inserting links | 3687 | @cindex inserting links |
| 3658 | @vindex org-keep-stored-link-after-insertion | 3688 | @vindex org-keep-stored-link-after-insertion |
| 3659 | Insert a link@footnote{ Note that you don't have to use this command to | 3689 | @vindex org-link-parameters |
| 3690 | Insert a link@footnote{Note that you don't have to use this command to | ||
| 3660 | insert a link. Links in Org are plain text, and you can type or paste them | 3691 | insert a link. Links in Org are plain text, and you can type or paste them |
| 3661 | straight into the buffer. By using this command, the links are automatically | 3692 | straight into the buffer. By using this command, the links are automatically |
| 3662 | enclosed in double brackets, and you will be asked for the optional | 3693 | enclosed in double brackets, and you will be asked for the optional |
| @@ -3679,11 +3710,12 @@ them with @key{up} and @key{down} (or @kbd{M-p/n}). | |||
| 3679 | valid link prefixes like @samp{http:} or @samp{ftp:}, including the prefixes | 3710 | valid link prefixes like @samp{http:} or @samp{ftp:}, including the prefixes |
| 3680 | defined through link abbreviations (@pxref{Link abbreviations}). If you | 3711 | defined through link abbreviations (@pxref{Link abbreviations}). If you |
| 3681 | press @key{RET} after inserting only the @var{prefix}, Org will offer | 3712 | press @key{RET} after inserting only the @var{prefix}, Org will offer |
| 3682 | specific completion support for some link types@footnote{This works by | 3713 | specific completion support for some link types@footnote{This works if |
| 3683 | calling a special function @code{org-PREFIX-complete-link}.} For | 3714 | a completion function is defined in the @samp{:complete} property of a link |
| 3684 | example, if you type @kbd{file @key{RET}}, file name completion (alternative | 3715 | in @code{org-link-parameters}.} For example, if you type @kbd{file |
| 3685 | access: @kbd{C-u C-c C-l}, see below) will be offered, and after @kbd{bbdb | 3716 | @key{RET}}, file name completion (alternative access: @kbd{C-u C-c C-l}, see |
| 3686 | @key{RET}} you can complete contact names. | 3717 | below) will be offered, and after @kbd{bbdb @key{RET}} you can complete |
| 3718 | contact names. | ||
| 3687 | @orgkey C-u C-c C-l | 3719 | @orgkey C-u C-c C-l |
| 3688 | @cindex file name completion | 3720 | @cindex file name completion |
| 3689 | @cindex completion, of file names | 3721 | @cindex completion, of file names |
| @@ -3729,8 +3761,8 @@ the link at point. | |||
| 3729 | @kindex mouse-1 | 3761 | @kindex mouse-1 |
| 3730 | @item mouse-2 | 3762 | @item mouse-2 |
| 3731 | @itemx mouse-1 | 3763 | @itemx mouse-1 |
| 3732 | On links, @kbd{mouse-2} will open the link just as @kbd{C-c C-o} | 3764 | On links, @kbd{mouse-1} and @kbd{mouse-2} will open the link just as @kbd{C-c |
| 3733 | would. Under Emacs 22 and later, @kbd{mouse-1} will also follow a link. | 3765 | C-o} would. |
| 3734 | @c | 3766 | @c |
| 3735 | @kindex mouse-3 | 3767 | @kindex mouse-3 |
| 3736 | @item mouse-3 | 3768 | @item mouse-3 |
| @@ -3778,7 +3810,7 @@ to @kbd{C-n} and @kbd{C-p} | |||
| 3778 | @end lisp | 3810 | @end lisp |
| 3779 | @end table | 3811 | @end table |
| 3780 | 3812 | ||
| 3781 | @node Using links outside Org, Link abbreviations, Handling links, Hyperlinks | 3813 | @node Using links outside Org |
| 3782 | @section Using links outside Org | 3814 | @section Using links outside Org |
| 3783 | 3815 | ||
| 3784 | You can insert and follow links that have Org syntax not only in | 3816 | You can insert and follow links that have Org syntax not only in |
| @@ -3791,7 +3823,7 @@ yourself): | |||
| 3791 | (global-set-key "\C-c o" 'org-open-at-point-global) | 3823 | (global-set-key "\C-c o" 'org-open-at-point-global) |
| 3792 | @end lisp | 3824 | @end lisp |
| 3793 | 3825 | ||
| 3794 | @node Link abbreviations, Search options, Using links outside Org, Hyperlinks | 3826 | @node Link abbreviations |
| 3795 | @section Link abbreviations | 3827 | @section Link abbreviations |
| 3796 | @cindex link abbreviations | 3828 | @cindex link abbreviations |
| 3797 | @cindex abbreviation, links | 3829 | @cindex abbreviation, links |
| @@ -3830,8 +3862,8 @@ url-encode the tag (see the example above, where we need to encode | |||
| 3830 | the URL parameter.) Using @samp{%(my-function)} will pass the tag | 3862 | the URL parameter.) Using @samp{%(my-function)} will pass the tag |
| 3831 | to a custom function, and replace it by the resulting string. | 3863 | to a custom function, and replace it by the resulting string. |
| 3832 | 3864 | ||
| 3833 | If the replacement text don't contain any specifier, it will simply | 3865 | If the replacement text doesn't contain any specifier, the tag will simply be |
| 3834 | be appended to the string in order to create the link. | 3866 | appended in order to create the link. |
| 3835 | 3867 | ||
| 3836 | Instead of a string, you may also specify a function that will be | 3868 | Instead of a string, you may also specify a function that will be |
| 3837 | called with the tag as the only argument to create the link. | 3869 | called with the tag as the only argument to create the link. |
| @@ -3855,12 +3887,17 @@ can define them in the file with | |||
| 3855 | 3887 | ||
| 3856 | @noindent | 3888 | @noindent |
| 3857 | In-buffer completion (@pxref{Completion}) can be used after @samp{[} to | 3889 | In-buffer completion (@pxref{Completion}) can be used after @samp{[} to |
| 3858 | complete link abbreviations. You may also define a function | 3890 | complete link abbreviations. You may also define a function that implements |
| 3859 | @code{org-PREFIX-complete-link} that implements special (e.g., completion) | 3891 | special (e.g., completion) support for inserting such a link with @kbd{C-c |
| 3860 | support for inserting such a link with @kbd{C-c C-l}. Such a function should | 3892 | C-l}. Such a function should not accept any arguments, and return the full |
| 3861 | not accept any arguments, and return the full link with prefix. | 3893 | link with prefix. You can add a completion function to a link like this: |
| 3894 | |||
| 3895 | @lisp | ||
| 3896 | (org-link-set-parameters ``type'' :complete #'some-function) | ||
| 3897 | @end lisp | ||
| 3898 | |||
| 3862 | 3899 | ||
| 3863 | @node Search options, Custom searches, Link abbreviations, Hyperlinks | 3900 | @node Search options |
| 3864 | @section Search options in file links | 3901 | @section Search options in file links |
| 3865 | @cindex search option in file links | 3902 | @cindex search option in file links |
| 3866 | @cindex file links, searching | 3903 | @cindex file links, searching |
| @@ -3912,7 +3949,7 @@ to search the current file. For example, @code{[[file:::find me]]} does | |||
| 3912 | a search for @samp{find me} in the current file, just as | 3949 | a search for @samp{find me} in the current file, just as |
| 3913 | @samp{[[find me]]} would. | 3950 | @samp{[[find me]]} would. |
| 3914 | 3951 | ||
| 3915 | @node Custom searches, , Search options, Hyperlinks | 3952 | @node Custom searches |
| 3916 | @section Custom Searches | 3953 | @section Custom Searches |
| 3917 | @cindex custom search strings | 3954 | @cindex custom search strings |
| 3918 | @cindex search strings, custom | 3955 | @cindex search strings, custom |
| @@ -3936,7 +3973,7 @@ variables for more information. Org actually uses this mechanism | |||
| 3936 | for Bib@TeX{} database files, and you can use the corresponding code as | 3973 | for Bib@TeX{} database files, and you can use the corresponding code as |
| 3937 | an implementation example. See the file @file{org-bibtex.el}. | 3974 | an implementation example. See the file @file{org-bibtex.el}. |
| 3938 | 3975 | ||
| 3939 | @node TODO Items, Tags, Hyperlinks, Top | 3976 | @node TODO items |
| 3940 | @chapter TODO items | 3977 | @chapter TODO items |
| 3941 | @cindex TODO items | 3978 | @cindex TODO items |
| 3942 | 3979 | ||
| @@ -3961,7 +3998,7 @@ methods to give you an overview of all the things that you have to do. | |||
| 3961 | * Checkboxes:: Tick-off lists | 3998 | * Checkboxes:: Tick-off lists |
| 3962 | @end menu | 3999 | @end menu |
| 3963 | 4000 | ||
| 3964 | @node TODO basics, TODO extensions, TODO Items, TODO Items | 4001 | @node TODO basics |
| 3965 | @section Basic TODO functionality | 4002 | @section Basic TODO functionality |
| 3966 | 4003 | ||
| 3967 | Any headline becomes a TODO item when it starts with the word | 4004 | Any headline becomes a TODO item when it starts with the word |
| @@ -4022,7 +4059,7 @@ N, show the tree for the Nth keyword in the option @code{org-todo-keywords}. | |||
| 4022 | With two prefix arguments, find all TODO states, both un-done and done. | 4059 | With two prefix arguments, find all TODO states, both un-done and done. |
| 4023 | @orgcmd{C-c a t,org-todo-list} | 4060 | @orgcmd{C-c a t,org-todo-list} |
| 4024 | Show the global TODO list. Collects the TODO items (with not-DONE states) | 4061 | Show the global TODO list. Collects the TODO items (with not-DONE states) |
| 4025 | from all agenda files (@pxref{Agenda Views}) into a single buffer. The new | 4062 | from all agenda files (@pxref{Agenda views}) into a single buffer. The new |
| 4026 | buffer will be in @code{agenda-mode}, which provides commands to examine and | 4063 | buffer will be in @code{agenda-mode}, which provides commands to examine and |
| 4027 | manipulate the TODO entries from the new buffer (@pxref{Agenda commands}). | 4064 | manipulate the TODO entries from the new buffer (@pxref{Agenda commands}). |
| 4028 | @xref{Global TODO list}, for more information. | 4065 | @xref{Global TODO list}, for more information. |
| @@ -4035,7 +4072,7 @@ Insert a new TODO entry below the current one. | |||
| 4035 | Changing a TODO state can also trigger tag changes. See the docstring of the | 4072 | Changing a TODO state can also trigger tag changes. See the docstring of the |
| 4036 | option @code{org-todo-state-tags-triggers} for details. | 4073 | option @code{org-todo-state-tags-triggers} for details. |
| 4037 | 4074 | ||
| 4038 | @node TODO extensions, Progress logging, TODO basics, TODO Items | 4075 | @node TODO extensions |
| 4039 | @section Extended use of TODO keywords | 4076 | @section Extended use of TODO keywords |
| 4040 | @cindex extended TODO keywords | 4077 | @cindex extended TODO keywords |
| 4041 | 4078 | ||
| @@ -4059,7 +4096,7 @@ TODO items in particular (@pxref{Tags}). | |||
| 4059 | * TODO dependencies:: When one task needs to wait for others | 4096 | * TODO dependencies:: When one task needs to wait for others |
| 4060 | @end menu | 4097 | @end menu |
| 4061 | 4098 | ||
| 4062 | @node Workflow states, TODO types, TODO extensions, TODO extensions | 4099 | @node Workflow states |
| 4063 | @subsection TODO keywords as workflow states | 4100 | @subsection TODO keywords as workflow states |
| 4064 | @cindex TODO workflow | 4101 | @cindex TODO workflow |
| 4065 | @cindex workflow states as TODO keywords | 4102 | @cindex workflow states as TODO keywords |
| @@ -4090,7 +4127,7 @@ define many keywords, you can use in-buffer completion | |||
| 4090 | buffer. Changing a TODO state can be logged with a timestamp, see | 4127 | buffer. Changing a TODO state can be logged with a timestamp, see |
| 4091 | @ref{Tracking TODO state changes}, for more information. | 4128 | @ref{Tracking TODO state changes}, for more information. |
| 4092 | 4129 | ||
| 4093 | @node TODO types, Multiple sets in one file, Workflow states, TODO extensions | 4130 | @node TODO types |
| 4094 | @subsection TODO keywords as types | 4131 | @subsection TODO keywords as types |
| 4095 | @cindex TODO types | 4132 | @cindex TODO types |
| 4096 | @cindex names as TODO keywords | 4133 | @cindex names as TODO keywords |
| @@ -4122,7 +4159,7 @@ Lucy has to do, you would use @kbd{C-3 C-c / t}. To collect Lucy's items | |||
| 4122 | from all agenda files into a single buffer, you would use the numeric prefix | 4159 | from all agenda files into a single buffer, you would use the numeric prefix |
| 4123 | argument as well when creating the global TODO list: @kbd{C-3 C-c a t}. | 4160 | argument as well when creating the global TODO list: @kbd{C-3 C-c a t}. |
| 4124 | 4161 | ||
| 4125 | @node Multiple sets in one file, Fast access to TODO states, TODO types, TODO extensions | 4162 | @node Multiple sets in one file |
| 4126 | @subsection Multiple keyword sets in one file | 4163 | @subsection Multiple keyword sets in one file |
| 4127 | @cindex TODO keyword sets | 4164 | @cindex TODO keyword sets |
| 4128 | 4165 | ||
| @@ -4164,14 +4201,14 @@ These keys jump from one TODO subset to the next. In the above example, | |||
| 4164 | @kindex S-@key{left} | 4201 | @kindex S-@key{left} |
| 4165 | @item S-@key{right} | 4202 | @item S-@key{right} |
| 4166 | @itemx S-@key{left} | 4203 | @itemx S-@key{left} |
| 4167 | @kbd{S-@key{<left>}} and @kbd{S-@key{<right>}} and walk through @emph{all} | 4204 | @kbd{S-@key{left}} and @kbd{S-@key{right}} and walk through @emph{all} |
| 4168 | keywords from all sets, so for example @kbd{S-@key{<right>}} would switch | 4205 | keywords from all sets, so for example @kbd{S-@key{right}} would switch |
| 4169 | from @code{DONE} to @code{REPORT} in the example above. See also | 4206 | from @code{DONE} to @code{REPORT} in the example above. See also |
| 4170 | @ref{Conflicts}, for a discussion of the interaction with | 4207 | @ref{Conflicts}, for a discussion of the interaction with |
| 4171 | @code{shift-selection-mode}. | 4208 | @code{shift-selection-mode}. |
| 4172 | @end table | 4209 | @end table |
| 4173 | 4210 | ||
| 4174 | @node Fast access to TODO states, Per-file keywords, Multiple sets in one file, TODO extensions | 4211 | @node Fast access to TODO states |
| 4175 | @subsection Fast access to TODO states | 4212 | @subsection Fast access to TODO states |
| 4176 | 4213 | ||
| 4177 | If you would like to quickly change an entry to an arbitrary TODO state | 4214 | If you would like to quickly change an entry to an arbitrary TODO state |
| @@ -4196,7 +4233,7 @@ state through the tags interface (@pxref{Setting tags}), in case you like to | |||
| 4196 | mingle the two concepts. Note that this means you need to come up with | 4233 | mingle the two concepts. Note that this means you need to come up with |
| 4197 | unique keys across both sets of keywords.} | 4234 | unique keys across both sets of keywords.} |
| 4198 | 4235 | ||
| 4199 | @node Per-file keywords, Faces for TODO keywords, Fast access to TODO states, TODO extensions | 4236 | @node Per-file keywords |
| 4200 | @subsection Setting up keywords for individual files | 4237 | @subsection Setting up keywords for individual files |
| 4201 | @cindex keyword options | 4238 | @cindex keyword options |
| 4202 | @cindex per-file keywords | 4239 | @cindex per-file keywords |
| @@ -4205,11 +4242,10 @@ unique keys across both sets of keywords.} | |||
| 4205 | @cindex #+SEQ_TODO | 4242 | @cindex #+SEQ_TODO |
| 4206 | 4243 | ||
| 4207 | It can be very useful to use different aspects of the TODO mechanism in | 4244 | It can be very useful to use different aspects of the TODO mechanism in |
| 4208 | different files. For file-local settings, you need to add special lines | 4245 | different files. For file-local settings, you need to add special lines to |
| 4209 | to the file which set the keywords and interpretation for that file | 4246 | the file which set the keywords and interpretation for that file only. For |
| 4210 | only. For example, to set one of the two examples discussed above, you | 4247 | example, to set one of the two examples discussed above, you need one of the |
| 4211 | need one of the following lines, starting in column zero anywhere in the | 4248 | following lines anywhere in the file: |
| 4212 | file: | ||
| 4213 | 4249 | ||
| 4214 | @example | 4250 | @example |
| 4215 | #+TODO: TODO FEEDBACK VERIFY | DONE CANCELED | 4251 | #+TODO: TODO FEEDBACK VERIFY | DONE CANCELED |
| @@ -4243,7 +4279,7 @@ Org mode is activated after visiting a file. @kbd{C-c C-c} with the | |||
| 4243 | cursor in a line starting with @samp{#+} is simply restarting Org mode | 4279 | cursor in a line starting with @samp{#+} is simply restarting Org mode |
| 4244 | for the current buffer.}. | 4280 | for the current buffer.}. |
| 4245 | 4281 | ||
| 4246 | @node Faces for TODO keywords, TODO dependencies, Per-file keywords, TODO extensions | 4282 | @node Faces for TODO keywords |
| 4247 | @subsection Faces for TODO keywords | 4283 | @subsection Faces for TODO keywords |
| 4248 | @cindex faces, for TODO keywords | 4284 | @cindex faces, for TODO keywords |
| 4249 | 4285 | ||
| @@ -4271,10 +4307,11 @@ special face and use that. A string is interpreted as a color. The option | |||
| 4271 | @code{org-faces-easy-properties} determines if that color is interpreted as a | 4307 | @code{org-faces-easy-properties} determines if that color is interpreted as a |
| 4272 | foreground or a background color. | 4308 | foreground or a background color. |
| 4273 | 4309 | ||
| 4274 | @node TODO dependencies, , Faces for TODO keywords, TODO extensions | 4310 | @node TODO dependencies |
| 4275 | @subsection TODO dependencies | 4311 | @subsection TODO dependencies |
| 4276 | @cindex TODO dependencies | 4312 | @cindex TODO dependencies |
| 4277 | @cindex dependencies, of TODO states | 4313 | @cindex dependencies, of TODO states |
| 4314 | @cindex TODO dependencies, NOBLOCKING | ||
| 4278 | 4315 | ||
| 4279 | @vindex org-enforce-todo-dependencies | 4316 | @vindex org-enforce-todo-dependencies |
| 4280 | @cindex property, ORDERED | 4317 | @cindex property, ORDERED |
| @@ -4303,6 +4340,16 @@ example: | |||
| 4303 | ** TODO c, needs to wait for (a) and (b) | 4340 | ** TODO c, needs to wait for (a) and (b) |
| 4304 | @end example | 4341 | @end example |
| 4305 | 4342 | ||
| 4343 | You can ensure an entry is never blocked by using the @code{NOBLOCKING} | ||
| 4344 | property: | ||
| 4345 | |||
| 4346 | @example | ||
| 4347 | * This entry is never blocked | ||
| 4348 | :PROPERTIES: | ||
| 4349 | :NOBLOCKING: t | ||
| 4350 | :END: | ||
| 4351 | @end example | ||
| 4352 | |||
| 4306 | @table @kbd | 4353 | @table @kbd |
| 4307 | @orgcmd{C-c C-x o,org-toggle-ordered-property} | 4354 | @orgcmd{C-c C-x o,org-toggle-ordered-property} |
| 4308 | @vindex org-track-ordered-property-with-tag | 4355 | @vindex org-track-ordered-property-with-tag |
| @@ -4319,7 +4366,7 @@ Change TODO state, circumventing any state blocking. | |||
| 4319 | @vindex org-agenda-dim-blocked-tasks | 4366 | @vindex org-agenda-dim-blocked-tasks |
| 4320 | If you set the option @code{org-agenda-dim-blocked-tasks}, TODO entries | 4367 | If you set the option @code{org-agenda-dim-blocked-tasks}, TODO entries |
| 4321 | that cannot be closed because of such dependencies will be shown in a dimmed | 4368 | that cannot be closed because of such dependencies will be shown in a dimmed |
| 4322 | font or even made invisible in agenda views (@pxref{Agenda Views}). | 4369 | font or even made invisible in agenda views (@pxref{Agenda views}). |
| 4323 | 4370 | ||
| 4324 | @cindex checkboxes and TODO dependencies | 4371 | @cindex checkboxes and TODO dependencies |
| 4325 | @vindex org-enforce-todo-dependencies | 4372 | @vindex org-enforce-todo-dependencies |
| @@ -4333,7 +4380,7 @@ between entries in different trees or files, check out the contributed | |||
| 4333 | module @file{org-depend.el}. | 4380 | module @file{org-depend.el}. |
| 4334 | 4381 | ||
| 4335 | @page | 4382 | @page |
| 4336 | @node Progress logging, Priorities, TODO extensions, TODO Items | 4383 | @node Progress logging |
| 4337 | @section Progress logging | 4384 | @section Progress logging |
| 4338 | @cindex progress logging | 4385 | @cindex progress logging |
| 4339 | @cindex logging, of progress | 4386 | @cindex logging, of progress |
| @@ -4351,7 +4398,7 @@ work time}. | |||
| 4351 | * Tracking your habits:: How consistent have you been? | 4398 | * Tracking your habits:: How consistent have you been? |
| 4352 | @end menu | 4399 | @end menu |
| 4353 | 4400 | ||
| 4354 | @node Closing items, Tracking TODO state changes, Progress logging, Progress logging | 4401 | @node Closing items |
| 4355 | @subsection Closing items | 4402 | @subsection Closing items |
| 4356 | 4403 | ||
| 4357 | The most basic logging is to keep track of @emph{when} a certain TODO | 4404 | The most basic logging is to keep track of @emph{when} a certain TODO |
| @@ -4387,7 +4434,7 @@ In the timeline (@pxref{Timeline}) and in the agenda | |||
| 4387 | display the TODO items with a @samp{CLOSED} timestamp on each day, | 4434 | display the TODO items with a @samp{CLOSED} timestamp on each day, |
| 4388 | giving you an overview of what has been done. | 4435 | giving you an overview of what has been done. |
| 4389 | 4436 | ||
| 4390 | @node Tracking TODO state changes, Tracking your habits, Closing items, Progress logging | 4437 | @node Tracking TODO state changes |
| 4391 | @subsection Tracking TODO state changes | 4438 | @subsection Tracking TODO state changes |
| 4392 | @cindex drawer, for state change recording | 4439 | @cindex drawer, for state change recording |
| 4393 | 4440 | ||
| @@ -4470,7 +4517,7 @@ settings like @code{TODO(!)}. For example | |||
| 4470 | :END: | 4517 | :END: |
| 4471 | @end example | 4518 | @end example |
| 4472 | 4519 | ||
| 4473 | @node Tracking your habits, , Tracking TODO state changes, Progress logging | 4520 | @node Tracking your habits |
| 4474 | @subsection Tracking your habits | 4521 | @subsection Tracking your habits |
| 4475 | @cindex habits | 4522 | @cindex habits |
| 4476 | 4523 | ||
| @@ -4506,6 +4553,10 @@ actual habit with some history: | |||
| 4506 | @example | 4553 | @example |
| 4507 | ** TODO Shave | 4554 | ** TODO Shave |
| 4508 | SCHEDULED: <2009-10-17 Sat .+2d/4d> | 4555 | SCHEDULED: <2009-10-17 Sat .+2d/4d> |
| 4556 | :PROPERTIES: | ||
| 4557 | :STYLE: habit | ||
| 4558 | :LAST_REPEAT: [2009-10-19 Mon 00:36] | ||
| 4559 | :END: | ||
| 4509 | - State "DONE" from "TODO" [2009-10-15 Thu] | 4560 | - State "DONE" from "TODO" [2009-10-15 Thu] |
| 4510 | - State "DONE" from "TODO" [2009-10-12 Mon] | 4561 | - State "DONE" from "TODO" [2009-10-12 Mon] |
| 4511 | - State "DONE" from "TODO" [2009-10-10 Sat] | 4562 | - State "DONE" from "TODO" [2009-10-10 Sat] |
| @@ -4516,10 +4567,6 @@ actual habit with some history: | |||
| 4516 | - State "DONE" from "TODO" [2009-09-19 Sat] | 4567 | - State "DONE" from "TODO" [2009-09-19 Sat] |
| 4517 | - State "DONE" from "TODO" [2009-09-16 Wed] | 4568 | - State "DONE" from "TODO" [2009-09-16 Wed] |
| 4518 | - State "DONE" from "TODO" [2009-09-12 Sat] | 4569 | - State "DONE" from "TODO" [2009-09-12 Sat] |
| 4519 | :PROPERTIES: | ||
| 4520 | :STYLE: habit | ||
| 4521 | :LAST_REPEAT: [2009-10-19 Mon 00:36] | ||
| 4522 | :END: | ||
| 4523 | @end example | 4570 | @end example |
| 4524 | 4571 | ||
| 4525 | What this habit says is: I want to shave at most every 2 days (given by the | 4572 | What this habit says is: I want to shave at most every 2 days (given by the |
| @@ -4570,7 +4617,7 @@ temporarily be disabled and they won't appear at all. Press @kbd{K} again to | |||
| 4570 | bring them back. They are also subject to tag filtering, if you have habits | 4617 | bring them back. They are also subject to tag filtering, if you have habits |
| 4571 | which should only be done in certain contexts, for example. | 4618 | which should only be done in certain contexts, for example. |
| 4572 | 4619 | ||
| 4573 | @node Priorities, Breaking down tasks, Progress logging, TODO Items | 4620 | @node Priorities |
| 4574 | @section Priorities | 4621 | @section Priorities |
| 4575 | @cindex priorities | 4622 | @cindex priorities |
| 4576 | 4623 | ||
| @@ -4628,7 +4675,7 @@ priority): | |||
| 4628 | #+PRIORITIES: A C B | 4675 | #+PRIORITIES: A C B |
| 4629 | @end example | 4676 | @end example |
| 4630 | 4677 | ||
| 4631 | @node Breaking down tasks, Checkboxes, Priorities, TODO Items | 4678 | @node Breaking down tasks |
| 4632 | @section Breaking tasks down into subtasks | 4679 | @section Breaking tasks down into subtasks |
| 4633 | @cindex tasks, breaking down | 4680 | @cindex tasks, breaking down |
| 4634 | @cindex statistics, for TODO items | 4681 | @cindex statistics, for TODO items |
| @@ -4689,7 +4736,7 @@ Another possibility is the use of checkboxes to identify (a hierarchy of) a | |||
| 4689 | large number of subtasks (@pxref{Checkboxes}). | 4736 | large number of subtasks (@pxref{Checkboxes}). |
| 4690 | 4737 | ||
| 4691 | 4738 | ||
| 4692 | @node Checkboxes, , Breaking down tasks, TODO Items | 4739 | @node Checkboxes |
| 4693 | @section Checkboxes | 4740 | @section Checkboxes |
| 4694 | @cindex checkboxes | 4741 | @cindex checkboxes |
| 4695 | 4742 | ||
| @@ -4698,7 +4745,7 @@ Every item in a plain list@footnote{With the exception of description | |||
| 4698 | lists. But you can allow it by modifying @code{org-list-automatic-rules} | 4745 | lists. But you can allow it by modifying @code{org-list-automatic-rules} |
| 4699 | accordingly.} (@pxref{Plain lists}) can be made into a checkbox by starting | 4746 | accordingly.} (@pxref{Plain lists}) can be made into a checkbox by starting |
| 4700 | it with the string @samp{[ ]}. This feature is similar to TODO items | 4747 | it with the string @samp{[ ]}. This feature is similar to TODO items |
| 4701 | (@pxref{TODO Items}), but is more lightweight. Checkboxes are not included | 4748 | (@pxref{TODO items}), but is more lightweight. Checkboxes are not included |
| 4702 | in the global TODO list, so they are often great to split a task into a | 4749 | in the global TODO list, so they are often great to split a task into a |
| 4703 | number of simple steps. Or you can use them in a shopping list. To toggle a | 4750 | number of simple steps. Or you can use them in a shopping list. To toggle a |
| 4704 | checkbox, use @kbd{C-c C-c}, or use the mouse (thanks to Piotr Zielinski's | 4751 | checkbox, use @kbd{C-c C-c}, or use the mouse (thanks to Piotr Zielinski's |
| @@ -4755,11 +4802,12 @@ off a box while there are unchecked boxes above it. | |||
| 4755 | 4802 | ||
| 4756 | @table @kbd | 4803 | @table @kbd |
| 4757 | @orgcmd{C-c C-c,org-toggle-checkbox} | 4804 | @orgcmd{C-c C-c,org-toggle-checkbox} |
| 4758 | Toggle checkbox status or (with prefix arg) checkbox presence at point. | 4805 | Toggle checkbox status or (with prefix arg) checkbox presence at point. With |
| 4759 | With a single prefix argument, add an empty checkbox or remove the current | 4806 | a single prefix argument, add an empty checkbox or remove the current |
| 4760 | one@footnote{@kbd{C-u C-c C-c} on the @emph{first} item of a list with no checkbox | 4807 | one@footnote{@kbd{C-u C-c C-c} before the @emph{first} bullet in a list with |
| 4761 | will add checkboxes to the rest of the list.}. With a double prefix argument, set it to @samp{[-]}, which is | 4808 | no checkbox will add checkboxes to the rest of the list.}. With a double |
| 4762 | considered to be an intermediate state. | 4809 | prefix argument, set it to @samp{[-]}, which is considered to be an |
| 4810 | intermediate state. | ||
| 4763 | @orgcmd{C-c C-x C-b,org-toggle-checkbox} | 4811 | @orgcmd{C-c C-x C-b,org-toggle-checkbox} |
| 4764 | Toggle checkbox status or (with prefix arg) checkbox presence at point. With | 4812 | Toggle checkbox status or (with prefix arg) checkbox presence at point. With |
| 4765 | double prefix argument, set it to @samp{[-]}, which is considered to be an | 4813 | double prefix argument, set it to @samp{[-]}, which is considered to be an |
| @@ -4770,8 +4818,10 @@ If there is an active region, toggle the first checkbox in the region | |||
| 4770 | and set all remaining boxes to the same status as the first. With a prefix | 4818 | and set all remaining boxes to the same status as the first. With a prefix |
| 4771 | arg, add or remove the checkbox for all items in the region. | 4819 | arg, add or remove the checkbox for all items in the region. |
| 4772 | @item | 4820 | @item |
| 4773 | If the cursor is in a headline, toggle checkboxes in the region between | 4821 | If the cursor is in a headline, toggle the state of the first checkbox in the |
| 4774 | this headline and the next (so @emph{not} the entire subtree). | 4822 | region between this headline and the next---so @emph{not} the entire |
| 4823 | subtree---and propagate this new state to all other checkboxes in the same | ||
| 4824 | area. | ||
| 4775 | @item | 4825 | @item |
| 4776 | If there is no active region, just toggle the checkbox at point. | 4826 | If there is no active region, just toggle the checkbox at point. |
| 4777 | @end itemize | 4827 | @end itemize |
| @@ -4795,7 +4845,7 @@ changing TODO states. If you delete boxes/entries or add/change them by | |||
| 4795 | hand, use this command to get things back into sync. | 4845 | hand, use this command to get things back into sync. |
| 4796 | @end table | 4846 | @end table |
| 4797 | 4847 | ||
| 4798 | @node Tags, Properties and Columns, TODO Items, Top | 4848 | @node Tags |
| 4799 | @chapter Tags | 4849 | @chapter Tags |
| 4800 | @cindex tags | 4850 | @cindex tags |
| 4801 | @cindex headline tagging | 4851 | @cindex headline tagging |
| @@ -4819,11 +4869,11 @@ You may specify special faces for specific tags using the option | |||
| 4819 | @menu | 4869 | @menu |
| 4820 | * Tag inheritance:: Tags use the tree structure of the outline | 4870 | * Tag inheritance:: Tags use the tree structure of the outline |
| 4821 | * Setting tags:: How to assign tags to a headline | 4871 | * Setting tags:: How to assign tags to a headline |
| 4822 | * Tag groups:: Use one tag to search for several tags | 4872 | * Tag hierarchy:: Create a hierarchy of tags |
| 4823 | * Tag searches:: Searching for combinations of tags | 4873 | * Tag searches:: Searching for combinations of tags |
| 4824 | @end menu | 4874 | @end menu |
| 4825 | 4875 | ||
| 4826 | @node Tag inheritance, Setting tags, Tags, Tags | 4876 | @node Tag inheritance |
| 4827 | @section Tag inheritance | 4877 | @section Tag inheritance |
| 4828 | @cindex tag inheritance | 4878 | @cindex tag inheritance |
| 4829 | @cindex inheritance, of tags | 4879 | @cindex inheritance, of tags |
| @@ -4842,11 +4892,11 @@ well. For example, in the list | |||
| 4842 | @noindent | 4892 | @noindent |
| 4843 | the final heading will have the tags @samp{:work:}, @samp{:boss:}, | 4893 | the final heading will have the tags @samp{:work:}, @samp{:boss:}, |
| 4844 | @samp{:notes:}, and @samp{:action:} even though the final heading is not | 4894 | @samp{:notes:}, and @samp{:action:} even though the final heading is not |
| 4845 | explicitly marked with those tags. You can also set tags that all entries in | 4895 | explicitly marked with all those tags. You can also set tags that all |
| 4846 | a file should inherit just as if these tags were defined in a hypothetical | 4896 | entries in a file should inherit just as if these tags were defined in |
| 4847 | level zero that surrounds the entire file. Use a line like this@footnote{As | 4897 | a hypothetical level zero that surrounds the entire file. Use a line like |
| 4848 | with all these in-buffer settings, pressing @kbd{C-c C-c} activates any | 4898 | this@footnote{As with all these in-buffer settings, pressing @kbd{C-c C-c} |
| 4849 | changes in the line.}: | 4899 | activates any changes in the line.}: |
| 4850 | 4900 | ||
| 4851 | @cindex #+FILETAGS | 4901 | @cindex #+FILETAGS |
| 4852 | @example | 4902 | @example |
| @@ -4877,7 +4927,7 @@ with inherited tags. Set @code{org-agenda-use-tag-inheritance} to control | |||
| 4877 | this: the default value includes all agenda types, but setting this to @code{nil} | 4927 | this: the default value includes all agenda types, but setting this to @code{nil} |
| 4878 | can really speed up agenda generation. | 4928 | can really speed up agenda generation. |
| 4879 | 4929 | ||
| 4880 | @node Setting tags, Tag groups, Tag inheritance, Tags | 4930 | @node Setting tags |
| 4881 | @section Setting tags | 4931 | @section Setting tags |
| 4882 | @cindex setting tags | 4932 | @cindex setting tags |
| 4883 | @cindex tags, setting | 4933 | @cindex tags, setting |
| @@ -4939,10 +4989,10 @@ By default Org mode uses the standard minibuffer completion facilities for | |||
| 4939 | entering tags. However, it also implements another, quicker, tag selection | 4989 | entering tags. However, it also implements another, quicker, tag selection |
| 4940 | method called @emph{fast tag selection}. This allows you to select and | 4990 | method called @emph{fast tag selection}. This allows you to select and |
| 4941 | deselect tags with just a single key press. For this to work well you should | 4991 | deselect tags with just a single key press. For this to work well you should |
| 4942 | assign unique letters to most of your commonly used tags. You can do this | 4992 | assign unique, case-sensitive, letters to most of your commonly used tags. |
| 4943 | globally by configuring the variable @code{org-tag-alist} in your | 4993 | You can do this globally by configuring the variable @code{org-tag-alist} in |
| 4944 | @file{.emacs} file. For example, you may find the need to tag many items in | 4994 | your Emacs init file. For example, you may find the need to tag many items |
| 4945 | different files with @samp{:@@home:}. In this case you can set something | 4995 | in different files with @samp{:@@home:}. In this case you can set something |
| 4946 | like: | 4996 | like: |
| 4947 | 4997 | ||
| 4948 | @lisp | 4998 | @lisp |
| @@ -5004,14 +5054,15 @@ If at least one tag has a selection key then pressing @kbd{C-c C-c} will | |||
| 5004 | automatically present you with a special interface, listing inherited tags, | 5054 | automatically present you with a special interface, listing inherited tags, |
| 5005 | the tags of the current headline, and a list of all valid tags with | 5055 | the tags of the current headline, and a list of all valid tags with |
| 5006 | corresponding keys@footnote{Keys will automatically be assigned to tags which | 5056 | corresponding keys@footnote{Keys will automatically be assigned to tags which |
| 5007 | have no configured keys.}. In this interface, you can use the following | 5057 | have no configured keys.}. |
| 5008 | keys: | 5058 | |
| 5059 | Pressing keys assigned to tags will add or remove them from the list of tags | ||
| 5060 | in the current line. Selecting a tag in a group of mutually exclusive tags | ||
| 5061 | will turn off any other tags from that group. | ||
| 5062 | |||
| 5063 | In this interface, you can also use the following special keys: | ||
| 5009 | 5064 | ||
| 5010 | @table @kbd | 5065 | @table @kbd |
| 5011 | @item a-z... | ||
| 5012 | Pressing keys assigned to tags will add or remove them from the list of | ||
| 5013 | tags in the current line. Selecting a tag in a group of mutually | ||
| 5014 | exclusive tags will turn off any other tags from that group. | ||
| 5015 | @kindex @key{TAB} | 5066 | @kindex @key{TAB} |
| 5016 | @item @key{TAB} | 5067 | @item @key{TAB} |
| 5017 | Enter a tag in the minibuffer, even if the tag is not in the predefined | 5068 | Enter a tag in the minibuffer, even if the tag is not in the predefined |
| @@ -5021,16 +5072,21 @@ You can also add several tags: just separate them with a comma. | |||
| 5021 | @kindex @key{SPC} | 5072 | @kindex @key{SPC} |
| 5022 | @item @key{SPC} | 5073 | @item @key{SPC} |
| 5023 | Clear all tags for this line. | 5074 | Clear all tags for this line. |
| 5075 | |||
| 5024 | @kindex @key{RET} | 5076 | @kindex @key{RET} |
| 5025 | @item @key{RET} | 5077 | @item @key{RET} |
| 5026 | Accept the modified set. | 5078 | Accept the modified set. |
| 5079 | |||
| 5027 | @item C-g | 5080 | @item C-g |
| 5028 | Abort without installing changes. | 5081 | Abort without installing changes. |
| 5082 | |||
| 5029 | @item q | 5083 | @item q |
| 5030 | If @kbd{q} is not assigned to a tag, it aborts like @kbd{C-g}. | 5084 | If @kbd{q} is not assigned to a tag, it aborts like @kbd{C-g}. |
| 5085 | |||
| 5031 | @item ! | 5086 | @item ! |
| 5032 | Turn off groups of mutually exclusive tags. Use this to (as an | 5087 | Turn off groups of mutually exclusive tags. Use this to (as an |
| 5033 | exception) assign several tags from such a group. | 5088 | exception) assign several tags from such a group. |
| 5089 | |||
| 5034 | @item C-c | 5090 | @item C-c |
| 5035 | Toggle auto-exit after the next change (see below). | 5091 | Toggle auto-exit after the next change (see below). |
| 5036 | If you are using expert mode, the first @kbd{C-c} will display the | 5092 | If you are using expert mode, the first @kbd{C-c} will display the |
| @@ -5058,41 +5114,104 @@ instead of @kbd{C-c C-c}). If you set the variable to the value | |||
| 5058 | @code{expert}, the special window is not even shown for single-key tag | 5114 | @code{expert}, the special window is not even shown for single-key tag |
| 5059 | selection, it comes up only when you press an extra @kbd{C-c}. | 5115 | selection, it comes up only when you press an extra @kbd{C-c}. |
| 5060 | 5116 | ||
| 5061 | @node Tag groups, Tag searches, Setting tags, Tags | 5117 | @node Tag hierarchy |
| 5062 | @section Tag groups | 5118 | @section Tag hierarchy |
| 5063 | 5119 | ||
| 5064 | @cindex group tags | 5120 | @cindex group tags |
| 5065 | @cindex tags, groups | 5121 | @cindex tags, groups |
| 5066 | In a set of mutually exclusive tags, the first tag can be defined as a | 5122 | @cindex tag hierarchy |
| 5067 | @emph{group tag}. When you search for a group tag, it will return matches | 5123 | Tags can be defined in hierarchies. A tag can be defined as a @emph{group |
| 5068 | for all members in the group. In an agenda view, filtering by a group tag | 5124 | tag} for a set of other tags. The group tag can be seen as the ``broader |
| 5069 | will display headlines tagged with at least one of the members of the | 5125 | term'' for its set of tags. Defining multiple @emph{group tags} and nesting |
| 5070 | group. This makes tag searches and filters even more flexible. | 5126 | them creates a tag hierarchy. |
| 5127 | |||
| 5128 | One use-case is to create a taxonomy of terms (tags) that can be used to | ||
| 5129 | classify nodes in a document or set of documents. | ||
| 5130 | |||
| 5131 | When you search for a group tag, it will return matches for all members in | ||
| 5132 | the group and its subgroups. In an agenda view, filtering by a group tag | ||
| 5133 | will display or hide headlines tagged with at least one of the members of the | ||
| 5134 | group or any of its subgroups. This makes tag searches and filters even more | ||
| 5135 | flexible. | ||
| 5136 | |||
| 5137 | You can set group tags by using brackets and inserting a colon between the | ||
| 5138 | group tag and its related tags---beware that all whitespaces are mandatory so | ||
| 5139 | that Org can parse this line correctly: | ||
| 5140 | |||
| 5141 | @example | ||
| 5142 | #+TAGS: [ GTD : Control Persp ] | ||
| 5143 | @end example | ||
| 5071 | 5144 | ||
| 5072 | You can set group tags by inserting a colon between the group tag and other | 5145 | In this example, @samp{GTD} is the @emph{group tag} and it is related to two |
| 5073 | tags---beware that all whitespaces are mandatory so that Org can parse this | 5146 | other tags: @samp{Control}, @samp{Persp}. Defining @samp{Control} and |
| 5074 | line correctly: | 5147 | @samp{Persp} as group tags creates an hierarchy of tags: |
| 5075 | 5148 | ||
| 5076 | @example | 5149 | @example |
| 5077 | #+TAGS: @{ @@read : @@read_book @@read_ebook @} | 5150 | #+TAGS: [ Control : Context Task ] |
| 5151 | #+TAGS: [ Persp : Vision Goal AOF Project ] | ||
| 5078 | @end example | 5152 | @end example |
| 5079 | 5153 | ||
| 5080 | In this example, @samp{@@read} is a @emph{group tag} for a set of three | 5154 | That can conceptually be seen as a hierarchy of tags: |
| 5081 | tags: @samp{@@read}, @samp{@@read_book} and @samp{@@read_ebook}. | 5155 | |
| 5156 | @example | ||
| 5157 | - GTD | ||
| 5158 | - Persp | ||
| 5159 | - Vision | ||
| 5160 | - Goal | ||
| 5161 | - AOF | ||
| 5162 | - Project | ||
| 5163 | - Control | ||
| 5164 | - Context | ||
| 5165 | - Task | ||
| 5166 | @end example | ||
| 5082 | 5167 | ||
| 5083 | You can also use the @code{:grouptags} keyword directly when setting | 5168 | You can use the @code{:startgrouptag}, @code{:grouptags} and |
| 5084 | @code{org-tag-alist}: | 5169 | @code{:endgrouptag} keyword directly when setting @code{org-tag-alist} |
| 5170 | directly: | ||
| 5085 | 5171 | ||
| 5086 | @lisp | 5172 | @lisp |
| 5087 | (setq org-tag-alist '((:startgroup . nil) | 5173 | (setq org-tag-alist '((:startgrouptag) |
| 5088 | ("@@read" . nil) | 5174 | ("GTD") |
| 5089 | (:grouptags . nil) | 5175 | (:grouptags) |
| 5090 | ("@@read_book" . nil) | 5176 | ("Control") |
| 5091 | ("@@read_ebook" . nil) | 5177 | ("Persp") |
| 5092 | (:endgroup . nil))) | 5178 | (:endgrouptag) |
| 5179 | (:startgrouptag) | ||
| 5180 | ("Control") | ||
| 5181 | (:grouptags) | ||
| 5182 | ("Context") | ||
| 5183 | ("Task") | ||
| 5184 | (:endgrouptag))) | ||
| 5093 | @end lisp | 5185 | @end lisp |
| 5094 | 5186 | ||
| 5095 | You cannot nest group tags or use a group tag as a tag in another group. | 5187 | The tags in a group can be mutually exclusive if using the same group syntax |
| 5188 | as is used for grouping mutually exclusive tags together; using curly | ||
| 5189 | brackets. | ||
| 5190 | |||
| 5191 | @example | ||
| 5192 | #+TAGS: @{ Context : @@Home @@Work @@Call @} | ||
| 5193 | @end example | ||
| 5194 | |||
| 5195 | When setting @code{org-tag-alist} you can use @code{:startgroup} & | ||
| 5196 | @code{:endgroup} instead of @code{:startgrouptag} & @code{:endgrouptag} to | ||
| 5197 | make the tags mutually exclusive. | ||
| 5198 | |||
| 5199 | Furthermore, the members of a @emph{group tag} can also be regular | ||
| 5200 | expressions, creating the possibility of a more dynamic and rule-based | ||
| 5201 | tag structure. The regular expressions in the group must be specified | ||
| 5202 | within @{ @}. Here is an expanded example: | ||
| 5203 | |||
| 5204 | @example | ||
| 5205 | #+TAGS: [ Vision : @{V@@@.+@} ] | ||
| 5206 | #+TAGS: [ Goal : @{G@@@.+@} ] | ||
| 5207 | #+TAGS: [ AOF : @{AOF@@@.+@} ] | ||
| 5208 | #+TAGS: [ Project : @{P@@@.+@} ] | ||
| 5209 | @end example | ||
| 5210 | |||
| 5211 | Searching for the tag @samp{Project} will now list all tags also including | ||
| 5212 | regular expression matches for @samp{P@@@.+}, and similarly for tag searches on | ||
| 5213 | @samp{Vision}, @samp{Goal} and @samp{AOF}. For example, this would work well | ||
| 5214 | for a project tagged with a common project-identifier, e.g. @samp{P@@2014_OrgTags}. | ||
| 5096 | 5215 | ||
| 5097 | @kindex C-c C-x q | 5216 | @kindex C-c C-x q |
| 5098 | @vindex org-group-tags | 5217 | @vindex org-group-tags |
| @@ -5100,7 +5219,7 @@ If you want to ignore group tags temporarily, toggle group tags support | |||
| 5100 | with @command{org-toggle-tags-groups}, bound to @kbd{C-c C-x q}. If you | 5219 | with @command{org-toggle-tags-groups}, bound to @kbd{C-c C-x q}. If you |
| 5101 | want to disable tag groups completely, set @code{org-group-tags} to @code{nil}. | 5220 | want to disable tag groups completely, set @code{org-group-tags} to @code{nil}. |
| 5102 | 5221 | ||
| 5103 | @node Tag searches, , Tag groups, Tags | 5222 | @node Tag searches |
| 5104 | @section Tag searches | 5223 | @section Tag searches |
| 5105 | @cindex tag searches | 5224 | @cindex tag searches |
| 5106 | @cindex searching for tags | 5225 | @cindex searching for tags |
| @@ -5126,13 +5245,13 @@ only TODO items and force checking subitems (see the option | |||
| 5126 | These commands all prompt for a match string which allows basic Boolean logic | 5245 | These commands all prompt for a match string which allows basic Boolean logic |
| 5127 | like @samp{+boss+urgent-project1}, to find entries with tags @samp{boss} and | 5246 | like @samp{+boss+urgent-project1}, to find entries with tags @samp{boss} and |
| 5128 | @samp{urgent}, but not @samp{project1}, or @samp{Kathy|Sally} to find entries | 5247 | @samp{urgent}, but not @samp{project1}, or @samp{Kathy|Sally} to find entries |
| 5129 | which are tagged, like @samp{Kathy} or @samp{Sally}. The full syntax of the search | 5248 | tagged as @samp{Kathy} or @samp{Sally}. The full syntax of the search string |
| 5130 | string is rich and allows also matching against TODO keywords, entry levels | 5249 | is rich and allows also matching against TODO keywords, entry levels and |
| 5131 | and properties. For a complete description with many examples, see | 5250 | properties. For a complete description with many examples, see @ref{Matching |
| 5132 | @ref{Matching tags and properties}. | 5251 | tags and properties}. |
| 5133 | 5252 | ||
| 5134 | 5253 | ||
| 5135 | @node Properties and Columns, Dates and Times, Tags, Top | 5254 | @node Properties and columns |
| 5136 | @chapter Properties and columns | 5255 | @chapter Properties and columns |
| 5137 | @cindex properties | 5256 | @cindex properties |
| 5138 | 5257 | ||
| @@ -5162,16 +5281,18 @@ Properties can be conveniently edited and viewed in column view | |||
| 5162 | * Property API:: Properties for Lisp programmers | 5281 | * Property API:: Properties for Lisp programmers |
| 5163 | @end menu | 5282 | @end menu |
| 5164 | 5283 | ||
| 5165 | @node Property syntax, Special properties, Properties and Columns, Properties and Columns | 5284 | @node Property syntax |
| 5166 | @section Property syntax | 5285 | @section Property syntax |
| 5167 | @cindex property syntax | 5286 | @cindex property syntax |
| 5168 | @cindex drawer, for properties | 5287 | @cindex drawer, for properties |
| 5169 | 5288 | ||
| 5170 | Properties are key-value pairs. When they are associated with a single entry | 5289 | Properties are key-value pairs. When they are associated with a single entry |
| 5171 | or with a tree they need to be inserted into a special | 5290 | or with a tree they need to be inserted into a special drawer |
| 5172 | drawer (@pxref{Drawers}) with the name @code{PROPERTIES}. Each property | 5291 | (@pxref{Drawers}) with the name @code{PROPERTIES}, which has to be located |
| 5173 | is specified on a single line, with the key (surrounded by colons) | 5292 | right below a headline, and its planning line (@pxref{Deadlines and |
| 5174 | first, and the value after it. Here is an example: | 5293 | scheduling}) when applicable. Each property is specified on a single line, |
| 5294 | with the key (surrounded by colons) first, and the value after it. Keys are | ||
| 5295 | case-insensitives. Here is an example: | ||
| 5175 | 5296 | ||
| 5176 | @example | 5297 | @example |
| 5177 | * CD collection | 5298 | * CD collection |
| @@ -5187,7 +5308,7 @@ first, and the value after it. Here is an example: | |||
| 5187 | @end example | 5308 | @end example |
| 5188 | 5309 | ||
| 5189 | Depending on the value of @code{org-use-property-inheritance}, a property set | 5310 | Depending on the value of @code{org-use-property-inheritance}, a property set |
| 5190 | this way will either be associated with a single entry, or the sub-tree | 5311 | this way will either be associated with a single entry, or the subtree |
| 5191 | defined by the entry, see @ref{Property inheritance}. | 5312 | defined by the entry, see @ref{Property inheritance}. |
| 5192 | 5313 | ||
| 5193 | You may define the allowed values for a particular property @samp{:Xyz:} | 5314 | You may define the allowed values for a particular property @samp{:Xyz:} |
| @@ -5215,7 +5336,7 @@ file, use a line like | |||
| 5215 | @end example | 5336 | @end example |
| 5216 | 5337 | ||
| 5217 | Contrary to properties set from a special drawer, you have to refresh the | 5338 | Contrary to properties set from a special drawer, you have to refresh the |
| 5218 | buffer with @kbd{C-c C-c} to activate this changes. | 5339 | buffer with @kbd{C-c C-c} to activate this change. |
| 5219 | 5340 | ||
| 5220 | If you want to add to the value of an existing property, append a @code{+} to | 5341 | If you want to add to the value of an existing property, append a @code{+} to |
| 5221 | the property name. The following results in the property @code{var} having | 5342 | the property name. The following results in the property @code{var} having |
| @@ -5284,58 +5405,52 @@ Compute the property at point, using the operator and scope from the | |||
| 5284 | nearest column format definition. | 5405 | nearest column format definition. |
| 5285 | @end table | 5406 | @end table |
| 5286 | 5407 | ||
| 5287 | @node Special properties, Property searches, Property syntax, Properties and Columns | 5408 | @node Special properties |
| 5288 | @section Special properties | 5409 | @section Special properties |
| 5289 | @cindex properties, special | 5410 | @cindex properties, special |
| 5290 | 5411 | ||
| 5291 | Special properties provide an alternative access method to Org mode features, | 5412 | Special properties provide an alternative access method to Org mode features, |
| 5292 | like the TODO state or the priority of an entry, discussed in the previous | 5413 | like the TODO state or the priority of an entry, discussed in the previous |
| 5293 | chapters. This interface exists so that you can include these states in a | 5414 | chapters. This interface exists so that you can include these states in |
| 5294 | column view (@pxref{Column view}), or to use them in queries. The following | 5415 | a column view (@pxref{Column view}), or to use them in queries. The |
| 5295 | property names are special and (except for @code{:CATEGORY:}) should not be | 5416 | following property names are special and should not be used as keys in the |
| 5296 | used as keys in the properties drawer: | 5417 | properties drawer: |
| 5297 | 5418 | ||
| 5298 | @cindex property, special, ID | ||
| 5299 | @cindex property, special, TODO | ||
| 5300 | @cindex property, special, TAGS | ||
| 5301 | @cindex property, special, ALLTAGS | 5419 | @cindex property, special, ALLTAGS |
| 5302 | @cindex property, special, CATEGORY | 5420 | @cindex property, special, BLOCKED |
| 5303 | @cindex property, special, PRIORITY | 5421 | @cindex property, special, CLOCKSUM |
| 5422 | @cindex property, special, CLOCKSUM_T | ||
| 5423 | @cindex property, special, CLOSED | ||
| 5304 | @cindex property, special, DEADLINE | 5424 | @cindex property, special, DEADLINE |
| 5425 | @cindex property, special, FILE | ||
| 5426 | @cindex property, special, ITEM | ||
| 5427 | @cindex property, special, PRIORITY | ||
| 5305 | @cindex property, special, SCHEDULED | 5428 | @cindex property, special, SCHEDULED |
| 5306 | @cindex property, special, CLOSED | 5429 | @cindex property, special, TAGS |
| 5307 | @cindex property, special, TIMESTAMP | 5430 | @cindex property, special, TIMESTAMP |
| 5308 | @cindex property, special, TIMESTAMP_IA | 5431 | @cindex property, special, TIMESTAMP_IA |
| 5309 | @cindex property, special, CLOCKSUM | 5432 | @cindex property, special, TODO |
| 5310 | @cindex property, special, CLOCKSUM_T | ||
| 5311 | @cindex property, special, BLOCKED | ||
| 5312 | @c guessing that ITEM is needed in this area; also, should this list be sorted? | ||
| 5313 | @cindex property, special, ITEM | ||
| 5314 | @cindex property, special, FILE | ||
| 5315 | @example | 5433 | @example |
| 5316 | ID @r{A globally unique ID used for synchronization during} | ||
| 5317 | @r{iCalendar or MobileOrg export.} | ||
| 5318 | TODO @r{The TODO keyword of the entry.} | ||
| 5319 | TAGS @r{The tags defined directly in the headline.} | ||
| 5320 | ALLTAGS @r{All tags, including inherited ones.} | 5434 | ALLTAGS @r{All tags, including inherited ones.} |
| 5321 | CATEGORY @r{The category of an entry.} | 5435 | BLOCKED @r{"t" if task is currently blocked by children or siblings.} |
| 5322 | PRIORITY @r{The priority of the entry, a string with a single letter.} | ||
| 5323 | DEADLINE @r{The deadline time string, without the angular brackets.} | ||
| 5324 | SCHEDULED @r{The scheduling timestamp, without the angular brackets.} | ||
| 5325 | CLOSED @r{When was this entry closed?} | ||
| 5326 | TIMESTAMP @r{The first keyword-less timestamp in the entry.} | ||
| 5327 | TIMESTAMP_IA @r{The first inactive timestamp in the entry.} | ||
| 5328 | CLOCKSUM @r{The sum of CLOCK intervals in the subtree. @code{org-clock-sum}} | 5436 | CLOCKSUM @r{The sum of CLOCK intervals in the subtree. @code{org-clock-sum}} |
| 5329 | @r{must be run first to compute the values in the current buffer.} | 5437 | @r{must be run first to compute the values in the current buffer.} |
| 5330 | CLOCKSUM_T @r{The sum of CLOCK intervals in the subtree for today.} | 5438 | CLOCKSUM_T @r{The sum of CLOCK intervals in the subtree for today.} |
| 5331 | @r{@code{org-clock-sum-today} must be run first to compute the} | 5439 | @r{@code{org-clock-sum-today} must be run first to compute the} |
| 5332 | @r{values in the current buffer.} | 5440 | @r{values in the current buffer.} |
| 5333 | BLOCKED @r{"t" if task is currently blocked by children or siblings} | 5441 | CLOSED @r{When was this entry closed?} |
| 5334 | ITEM @r{The headline of the entry.} | 5442 | DEADLINE @r{The deadline time string, without the angular brackets.} |
| 5335 | FILE @r{The filename the entry is located in.} | 5443 | FILE @r{The filename the entry is located in.} |
| 5444 | ITEM @r{The headline of the entry.} | ||
| 5445 | PRIORITY @r{The priority of the entry, a string with a single letter.} | ||
| 5446 | SCHEDULED @r{The scheduling timestamp, without the angular brackets.} | ||
| 5447 | TAGS @r{The tags defined directly in the headline.} | ||
| 5448 | TIMESTAMP @r{The first keyword-less timestamp in the entry.} | ||
| 5449 | TIMESTAMP_IA @r{The first inactive timestamp in the entry.} | ||
| 5450 | TODO @r{The TODO keyword of the entry.} | ||
| 5336 | @end example | 5451 | @end example |
| 5337 | 5452 | ||
| 5338 | @node Property searches, Property inheritance, Special properties, Properties and Columns | 5453 | @node Property searches |
| 5339 | @section Property searches | 5454 | @section Property searches |
| 5340 | @cindex properties, searching | 5455 | @cindex properties, searching |
| 5341 | @cindex searching, of properties | 5456 | @cindex searching, of properties |
| @@ -5372,7 +5487,7 @@ value. If you enclose the value in curly braces, it is interpreted as | |||
| 5372 | a regular expression and matched against the property values. | 5487 | a regular expression and matched against the property values. |
| 5373 | @end table | 5488 | @end table |
| 5374 | 5489 | ||
| 5375 | @node Property inheritance, Column view, Property searches, Properties and Columns | 5490 | @node Property inheritance |
| 5376 | @section Property Inheritance | 5491 | @section Property Inheritance |
| 5377 | @cindex properties, inheritance | 5492 | @cindex properties, inheritance |
| 5378 | @cindex inheritance, of properties | 5493 | @cindex inheritance, of properties |
| @@ -5416,7 +5531,7 @@ The LOGGING property may define logging settings for an entry or a | |||
| 5416 | subtree (@pxref{Tracking TODO state changes}). | 5531 | subtree (@pxref{Tracking TODO state changes}). |
| 5417 | @end table | 5532 | @end table |
| 5418 | 5533 | ||
| 5419 | @node Column view, Property API, Property inheritance, Properties and Columns | 5534 | @node Column view |
| 5420 | @section Column view | 5535 | @section Column view |
| 5421 | 5536 | ||
| 5422 | A great way to view and edit properties in an outline tree is | 5537 | A great way to view and edit properties in an outline tree is |
| @@ -5430,7 +5545,7 @@ view (@kbd{S-@key{TAB} S-@key{TAB}}, or simply @kbd{c} while column view | |||
| 5430 | is active), but you can still open, read, and edit the entry below each | 5545 | is active), but you can still open, read, and edit the entry below each |
| 5431 | headline. Or, you can switch to column view after executing a sparse | 5546 | headline. Or, you can switch to column view after executing a sparse |
| 5432 | tree command and in this way get a table only for the selected items. | 5547 | tree command and in this way get a table only for the selected items. |
| 5433 | Column view also works in agenda buffers (@pxref{Agenda Views}) where | 5548 | Column view also works in agenda buffers (@pxref{Agenda views}) where |
| 5434 | queries have collected selected items, possibly from a number of files. | 5549 | queries have collected selected items, possibly from a number of files. |
| 5435 | 5550 | ||
| 5436 | @menu | 5551 | @menu |
| @@ -5439,7 +5554,7 @@ queries have collected selected items, possibly from a number of files. | |||
| 5439 | * Capturing column view:: A dynamic block for column view | 5554 | * Capturing column view:: A dynamic block for column view |
| 5440 | @end menu | 5555 | @end menu |
| 5441 | 5556 | ||
| 5442 | @node Defining columns, Using column view, Column view, Column view | 5557 | @node Defining columns |
| 5443 | @subsection Defining columns | 5558 | @subsection Defining columns |
| 5444 | @cindex column view, for properties | 5559 | @cindex column view, for properties |
| 5445 | @cindex properties, column view | 5560 | @cindex properties, column view |
| @@ -5452,7 +5567,7 @@ done by defining a column format line. | |||
| 5452 | * Column attributes:: Appearance and content of a column | 5567 | * Column attributes:: Appearance and content of a column |
| 5453 | @end menu | 5568 | @end menu |
| 5454 | 5569 | ||
| 5455 | @node Scope of column definitions, Column attributes, Defining columns, Defining columns | 5570 | @node Scope of column definitions |
| 5456 | @subsubsection Scope of column definitions | 5571 | @subsubsection Scope of column definitions |
| 5457 | 5572 | ||
| 5458 | To define a column format for an entire file, use a line like | 5573 | To define a column format for an entire file, use a line like |
| @@ -5479,7 +5594,7 @@ you can define columns on level 1 that are general enough for all | |||
| 5479 | sublevels, and more specific columns further down, when you edit a | 5594 | sublevels, and more specific columns further down, when you edit a |
| 5480 | deeper part of the tree. | 5595 | deeper part of the tree. |
| 5481 | 5596 | ||
| 5482 | @node Column attributes, , Scope of column definitions, Defining columns | 5597 | @node Column attributes |
| 5483 | @subsubsection Column attributes | 5598 | @subsubsection Column attributes |
| 5484 | A column definition sets the attributes of a column. The general | 5599 | A column definition sets the attributes of a column. The general |
| 5485 | definition looks like this: | 5600 | definition looks like this: |
| @@ -5501,38 +5616,45 @@ optional. The individual parts have the following meaning: | |||
| 5501 | @var{title} @r{The header text for the column. If omitted, the property} | 5616 | @var{title} @r{The header text for the column. If omitted, the property} |
| 5502 | @r{name is used.} | 5617 | @r{name is used.} |
| 5503 | @{@var{summary-type}@} @r{The summary type. If specified, the column values for} | 5618 | @{@var{summary-type}@} @r{The summary type. If specified, the column values for} |
| 5504 | @r{parent nodes are computed from the children.} | 5619 | @r{parent nodes are computed from the children@footnote{If |
| 5620 | more than one summary type apply to the property, the parent | ||
| 5621 | values are computed according to the first of them.}.} | ||
| 5505 | @r{Supported summary types are:} | 5622 | @r{Supported summary types are:} |
| 5506 | @{+@} @r{Sum numbers in this column.} | 5623 | @{+@} @r{Sum numbers in this column.} |
| 5507 | @{+;%.1f@} @r{Like @samp{+}, but format result with @samp{%.1f}.} | 5624 | @{+;%.1f@} @r{Like @samp{+}, but format result with @samp{%.1f}.} |
| 5508 | @{$@} @r{Currency, short for @samp{+;%.2f}.} | 5625 | @{$@} @r{Currency, short for @samp{+;%.2f}.} |
| 5509 | @{:@} @r{Sum times, HH:MM, plain numbers are hours.} | ||
| 5510 | @{X@} @r{Checkbox status, @samp{[X]} if all children are @samp{[X]}.} | ||
| 5511 | @{X/@} @r{Checkbox status, @samp{[n/m]}.} | ||
| 5512 | @{X%@} @r{Checkbox status, @samp{[n%]}.} | ||
| 5513 | @{min@} @r{Smallest number in column.} | 5626 | @{min@} @r{Smallest number in column.} |
| 5514 | @{max@} @r{Largest number.} | 5627 | @{max@} @r{Largest number.} |
| 5515 | @{mean@} @r{Arithmetic mean of numbers.} | 5628 | @{mean@} @r{Arithmetic mean of numbers.} |
| 5629 | @{X@} @r{Checkbox status, @samp{[X]} if all children are @samp{[X]}.} | ||
| 5630 | @{X/@} @r{Checkbox status, @samp{[n/m]}.} | ||
| 5631 | @{X%@} @r{Checkbox status, @samp{[n%]}.} | ||
| 5632 | @{:@} @r{Sum times, HH:MM, plain numbers are | ||
| 5633 | hours@footnote{A time can also be a duration, using effort | ||
| 5634 | modifiers defined in @code{org-effort-durations}, e.g., | ||
| 5635 | @samp{3d 1h}. If any value in the column is as such, the | ||
| 5636 | summary will also be an effort duration.}.} | ||
| 5516 | @{:min@} @r{Smallest time value in column.} | 5637 | @{:min@} @r{Smallest time value in column.} |
| 5517 | @{:max@} @r{Largest time value.} | 5638 | @{:max@} @r{Largest time value.} |
| 5518 | @{:mean@} @r{Arithmetic mean of time values.} | 5639 | @{:mean@} @r{Arithmetic mean of time values.} |
| 5519 | @{@@min@} @r{Minimum age (in days/hours/mins/seconds).} | 5640 | @{@@min@} @r{Minimum age@footnote{An age is defined as |
| 5641 | a duration since a given time-stamp (@pxref{Timestamps}). It | ||
| 5642 | can also be expressed as days, hours, minutes and seconds, | ||
| 5643 | identified by @samp{d}, @samp{h}, @samp{m} and @samp{s} | ||
| 5644 | suffixes, all mandatory, e.g., @samp{0d 13h 0m 10s}.} (in | ||
| 5645 | days/hours/mins/seconds).} | ||
| 5520 | @{@@max@} @r{Maximum age (in days/hours/mins/seconds).} | 5646 | @{@@max@} @r{Maximum age (in days/hours/mins/seconds).} |
| 5521 | @{@@mean@} @r{Arithmetic mean of ages (in days/hours/mins/seconds).} | 5647 | @{@@mean@} @r{Arithmetic mean of ages (in days/hours/mins/seconds).} |
| 5522 | @{est+@} @r{Add low-high estimates.} | 5648 | @{est+@} @r{Add @samp{low-high} estimates.} |
| 5523 | @end example | 5649 | @end example |
| 5524 | 5650 | ||
| 5525 | @noindent | ||
| 5526 | Be aware that you can only have one summary type for any property you | ||
| 5527 | include. Subsequent columns referencing the same property will all display the | ||
| 5528 | same summary information. | ||
| 5529 | |||
| 5530 | The @code{est+} summary type requires further explanation. It is used for | 5651 | The @code{est+} summary type requires further explanation. It is used for |
| 5531 | combining estimates, expressed as low-high ranges. For example, instead | 5652 | combining estimates, expressed as @samp{low-high} ranges or plain numbers. |
| 5532 | of estimating a particular task will take 5 days, you might estimate it as | 5653 | For example, instead of estimating a particular task will take 5 days, you |
| 5533 | 5--6 days if you're fairly confident you know how much work is required, or | 5654 | might estimate it as 5--6 days if you're fairly confident you know how much |
| 5534 | 1--10 days if you don't really know what needs to be done. Both ranges | 5655 | work is required, or 1--10 days if you don't really know what needs to be |
| 5535 | average at 5.5 days, but the first represents a more predictable delivery. | 5656 | done. Both ranges average at 5.5 days, but the first represents a more |
| 5657 | predictable delivery. | ||
| 5536 | 5658 | ||
| 5537 | When combining a set of such estimates, simply adding the lows and highs | 5659 | When combining a set of such estimates, simply adding the lows and highs |
| 5538 | produces an unrealistically wide result. Instead, @code{est+} adds the | 5660 | produces an unrealistically wide result. Instead, @code{est+} adds the |
| @@ -5546,6 +5668,10 @@ full job more realistically, at 10--15 days. | |||
| 5546 | Numbers are right-aligned when a format specifier with an explicit width like | 5668 | Numbers are right-aligned when a format specifier with an explicit width like |
| 5547 | @code{%5d} or @code{%5.1f} is used. | 5669 | @code{%5d} or @code{%5.1f} is used. |
| 5548 | 5670 | ||
| 5671 | @vindex org-columns-summary-types | ||
| 5672 | You can also define custom summary types by setting | ||
| 5673 | @code{org-columns-summary-types}, which see. | ||
| 5674 | |||
| 5549 | Here is an example for a complete columns definition, along with allowed | 5675 | Here is an example for a complete columns definition, along with allowed |
| 5550 | values. | 5676 | values. |
| 5551 | 5677 | ||
| @@ -5574,7 +5700,7 @@ an @samp{[X]} status if all children have been checked. The | |||
| 5574 | sums of CLOCK intervals in the subtree, either for all clocks or just for | 5700 | sums of CLOCK intervals in the subtree, either for all clocks or just for |
| 5575 | today. | 5701 | today. |
| 5576 | 5702 | ||
| 5577 | @node Using column view, Capturing column view, Defining columns, Column view | 5703 | @node Using column view |
| 5578 | @subsection Using column view | 5704 | @subsection Using column view |
| 5579 | 5705 | ||
| 5580 | @table @kbd | 5706 | @table @kbd |
| @@ -5582,14 +5708,15 @@ today. | |||
| 5582 | @orgcmd{C-c C-x C-c,org-columns} | 5708 | @orgcmd{C-c C-x C-c,org-columns} |
| 5583 | @vindex org-columns-default-format | 5709 | @vindex org-columns-default-format |
| 5584 | Turn on column view. If the cursor is before the first headline in the file, | 5710 | Turn on column view. If the cursor is before the first headline in the file, |
| 5585 | column view is turned on for the entire file, using the @code{#+COLUMNS} | 5711 | or the function called with the universal prefix argument, column view is |
| 5586 | definition. If the cursor is somewhere inside the outline, this command | 5712 | turned on for the entire file, using the @code{#+COLUMNS} definition. If the |
| 5587 | searches the hierarchy, up from point, for a @code{:COLUMNS:} property that | 5713 | cursor is somewhere inside the outline, this command searches the hierarchy, |
| 5588 | defines a format. When one is found, the column view table is established | 5714 | up from point, for a @code{:COLUMNS:} property that defines a format. When |
| 5589 | for the tree starting at the entry that contains the @code{:COLUMNS:} | 5715 | one is found, the column view table is established for the tree starting at |
| 5590 | property. If no such property is found, the format is taken from the | 5716 | the entry that contains the @code{:COLUMNS:} property. If no such property |
| 5591 | @code{#+COLUMNS} line or from the variable @code{org-columns-default-format}, | 5717 | is found, the format is taken from the @code{#+COLUMNS} line or from the |
| 5592 | and column view is established for the current entry and its subtree. | 5718 | variable @code{org-columns-default-format}, and column view is established |
| 5719 | for the current entry and its subtree. | ||
| 5593 | @orgcmd{r,org-columns-redo} | 5720 | @orgcmd{r,org-columns-redo} |
| 5594 | Recreate the column view, to include recent changes made in the buffer. | 5721 | Recreate the column view, to include recent changes made in the buffer. |
| 5595 | @orgcmd{g,org-columns-redo} | 5722 | @orgcmd{g,org-columns-redo} |
| @@ -5620,7 +5747,7 @@ View the full value of this property. This is useful if the width of | |||
| 5620 | the column is smaller than that of the value. | 5747 | the column is smaller than that of the value. |
| 5621 | @orgcmd{a,org-columns-edit-allowed} | 5748 | @orgcmd{a,org-columns-edit-allowed} |
| 5622 | Edit the list of allowed values for this property. If the list is found | 5749 | Edit the list of allowed values for this property. If the list is found |
| 5623 | in the hierarchy, the modified values is stored there. If no list is | 5750 | in the hierarchy, the modified value is stored there. If no list is |
| 5624 | found, the new value is stored in the first entry that is part of the | 5751 | found, the new value is stored in the first entry that is part of the |
| 5625 | current column view. | 5752 | current column view. |
| 5626 | @tsubheading{Modifying the table structure} | 5753 | @tsubheading{Modifying the table structure} |
| @@ -5632,7 +5759,7 @@ Insert a new column, to the left of the current column. | |||
| 5632 | Delete the current column. | 5759 | Delete the current column. |
| 5633 | @end table | 5760 | @end table |
| 5634 | 5761 | ||
| 5635 | @node Capturing column view, , Using column view, Column view | 5762 | @node Capturing column view |
| 5636 | @subsection Capturing column view | 5763 | @subsection Capturing column view |
| 5637 | 5764 | ||
| 5638 | Since column view is just an overlay over a buffer, it cannot be | 5765 | Since column view is just an overlay over a buffer, it cannot be |
| @@ -5677,6 +5804,8 @@ When set to a number, don't capture entries below this level. | |||
| 5677 | @item :skip-empty-rows | 5804 | @item :skip-empty-rows |
| 5678 | When set to @code{t}, skip rows where the only non-empty specifier of the | 5805 | When set to @code{t}, skip rows where the only non-empty specifier of the |
| 5679 | column view is @code{ITEM}. | 5806 | column view is @code{ITEM}. |
| 5807 | @item :indent | ||
| 5808 | When non-@code{nil}, indent each @code{ITEM} field according to its level. | ||
| 5680 | 5809 | ||
| 5681 | @end table | 5810 | @end table |
| 5682 | 5811 | ||
| @@ -5709,7 +5838,7 @@ distributed with the main distribution of Org (visit | |||
| 5709 | properties from entries in a certain scope, and arbitrary Lisp expressions to | 5838 | properties from entries in a certain scope, and arbitrary Lisp expressions to |
| 5710 | process these values before inserting them into a table or a dynamic block. | 5839 | process these values before inserting them into a table or a dynamic block. |
| 5711 | 5840 | ||
| 5712 | @node Property API, , Column view, Properties and Columns | 5841 | @node Property API |
| 5713 | @section The Property API | 5842 | @section The Property API |
| 5714 | @cindex properties, API | 5843 | @cindex properties, API |
| 5715 | @cindex API, for properties | 5844 | @cindex API, for properties |
| @@ -5719,7 +5848,7 @@ be used by Emacs Lisp programs to work with properties and to implement | |||
| 5719 | features based on them. For more information see @ref{Using the | 5848 | features based on them. For more information see @ref{Using the |
| 5720 | property API}. | 5849 | property API}. |
| 5721 | 5850 | ||
| 5722 | @node Dates and Times, Capture - Refile - Archive, Properties and Columns, Top | 5851 | @node Dates and times |
| 5723 | @chapter Dates and times | 5852 | @chapter Dates and times |
| 5724 | @cindex dates | 5853 | @cindex dates |
| 5725 | @cindex times | 5854 | @cindex times |
| @@ -5729,7 +5858,7 @@ property API}. | |||
| 5729 | To assist project planning, TODO items can be labeled with a date and/or | 5858 | To assist project planning, TODO items can be labeled with a date and/or |
| 5730 | a time. The specially formatted string carrying the date and time | 5859 | a time. The specially formatted string carrying the date and time |
| 5731 | information is called a @emph{timestamp} in Org mode. This may be a | 5860 | information is called a @emph{timestamp} in Org mode. This may be a |
| 5732 | little confusing because timestamp is often used as indicating when | 5861 | little confusing because timestamp is often used to indicate when |
| 5733 | something was created or last changed. However, in Org mode this term | 5862 | something was created or last changed. However, in Org mode this term |
| 5734 | is used in a much wider sense. | 5863 | is used in a much wider sense. |
| 5735 | 5864 | ||
| @@ -5739,12 +5868,11 @@ is used in a much wider sense. | |||
| 5739 | * Deadlines and scheduling:: Planning your work | 5868 | * Deadlines and scheduling:: Planning your work |
| 5740 | * Clocking work time:: Tracking how long you spend on a task | 5869 | * Clocking work time:: Tracking how long you spend on a task |
| 5741 | * Effort estimates:: Planning work effort in advance | 5870 | * Effort estimates:: Planning work effort in advance |
| 5742 | * Relative timer:: Notes with a running timer | 5871 | * Timers:: Notes with a running timer |
| 5743 | * Countdown timer:: Starting a countdown timer for a task | ||
| 5744 | @end menu | 5872 | @end menu |
| 5745 | 5873 | ||
| 5746 | 5874 | ||
| 5747 | @node Timestamps, Creating timestamps, Dates and Times, Dates and Times | 5875 | @node Timestamps |
| 5748 | @section Timestamps, deadlines, and scheduling | 5876 | @section Timestamps, deadlines, and scheduling |
| 5749 | @cindex timestamps | 5877 | @cindex timestamps |
| 5750 | @cindex ranges, time | 5878 | @cindex ranges, time |
| @@ -5795,10 +5923,10 @@ following will show up in the agenda every Wednesday: | |||
| 5795 | For more complex date specifications, Org mode supports using the special | 5923 | For more complex date specifications, Org mode supports using the special |
| 5796 | sexp diary entries implemented in the Emacs calendar/diary | 5924 | sexp diary entries implemented in the Emacs calendar/diary |
| 5797 | package@footnote{When working with the standard diary sexp functions, you | 5925 | package@footnote{When working with the standard diary sexp functions, you |
| 5798 | need to be very careful with the order of the arguments. That order depend | 5926 | need to be very careful with the order of the arguments. That order depends |
| 5799 | evilly on the variable @code{calendar-date-style} (or, for older Emacs | 5927 | evilly on the variable @code{calendar-date-style} (or, for older Emacs |
| 5800 | versions, @code{european-calendar-style}). For example, to specify a date | 5928 | versions, @code{european-calendar-style}). For example, to specify a date |
| 5801 | December 12, 2005, the call might look like @code{(diary-date 12 1 2005)} or | 5929 | December 1, 2005, the call might look like @code{(diary-date 12 1 2005)} or |
| 5802 | @code{(diary-date 1 12 2005)} or @code{(diary-date 2005 12 1)}, depending on | 5930 | @code{(diary-date 1 12 2005)} or @code{(diary-date 2005 12 1)}, depending on |
| 5803 | the settings. This has been the source of much confusion. Org mode users | 5931 | the settings. This has been the source of much confusion. Org mode users |
| 5804 | can resort to special versions of these functions like @code{org-date} or | 5932 | can resort to special versions of these functions like @code{org-date} or |
| @@ -5838,7 +5966,7 @@ angular ones. These timestamps are inactive in the sense that they do | |||
| 5838 | 5966 | ||
| 5839 | @end table | 5967 | @end table |
| 5840 | 5968 | ||
| 5841 | @node Creating timestamps, Deadlines and scheduling, Timestamps, Dates and Times | 5969 | @node Creating timestamps |
| 5842 | @section Creating timestamps | 5970 | @section Creating timestamps |
| 5843 | @cindex creating timestamps | 5971 | @cindex creating timestamps |
| 5844 | @cindex timestamps, creating | 5972 | @cindex timestamps, creating |
| @@ -5909,7 +6037,7 @@ the following column). | |||
| 5909 | * Custom time format:: Making dates look different | 6037 | * Custom time format:: Making dates look different |
| 5910 | @end menu | 6038 | @end menu |
| 5911 | 6039 | ||
| 5912 | @node The date/time prompt, Custom time format, Creating timestamps, Creating timestamps | 6040 | @node The date/time prompt |
| 5913 | @subsection The date/time prompt | 6041 | @subsection The date/time prompt |
| 5914 | @cindex date, reading in minibuffer | 6042 | @cindex date, reading in minibuffer |
| 5915 | @cindex time, reading in minibuffer | 6043 | @cindex time, reading in minibuffer |
| @@ -5948,7 +6076,7 @@ feb 15 @result{} @b{2007}-02-15 | |||
| 5948 | sep 12 9 @result{} 2009-09-12 | 6076 | sep 12 9 @result{} 2009-09-12 |
| 5949 | 12:45 @result{} @b{2006}-@b{06}-@b{13} 12:45 | 6077 | 12:45 @result{} @b{2006}-@b{06}-@b{13} 12:45 |
| 5950 | 22 sept 0:34 @result{} @b{2006}-09-22 00:34 | 6078 | 22 sept 0:34 @result{} @b{2006}-09-22 00:34 |
| 5951 | w4 @result{} ISO week for of the current year @b{2006} | 6079 | w4 @result{} ISO week four of the current year @b{2006} |
| 5952 | 2012 w4 fri @result{} Friday of ISO week 4 in 2012 | 6080 | 2012 w4 fri @result{} Friday of ISO week 4 in 2012 |
| 5953 | 2012-w04-5 @result{} Same as above | 6081 | 2012-w04-5 @result{} Same as above |
| 5954 | @end example | 6082 | @end example |
| @@ -6017,14 +6145,18 @@ from the minibuffer: | |||
| 6017 | @kindex M-S-@key{right} | 6145 | @kindex M-S-@key{right} |
| 6018 | @kindex M-S-@key{left} | 6146 | @kindex M-S-@key{left} |
| 6019 | @kindex @key{RET} | 6147 | @kindex @key{RET} |
| 6148 | @kindex M-S-@key{down} | ||
| 6149 | @kindex M-S-@key{up} | ||
| 6150 | |||
| 6020 | @example | 6151 | @example |
| 6021 | @key{RET} @r{Choose date at cursor in calendar.} | 6152 | @key{RET} @r{Choose date at cursor in calendar.} |
| 6022 | mouse-1 @r{Select date by clicking on it.} | 6153 | mouse-1 @r{Select date by clicking on it.} |
| 6023 | S-@key{right}/@key{left} @r{One day forward/backward.} | 6154 | S-@key{right}/@key{left} @r{One day forward/backward.} |
| 6024 | S-@key{down}/@key{up} @r{One week forward/backward.} | 6155 | S-@key{down}/@key{up} @r{One week forward/backward.} |
| 6025 | M-S-@key{right}/@key{left} @r{One month forward/backward.} | 6156 | M-S-@key{right}/@key{left} @r{One month forward/backward.} |
| 6026 | > / < @r{Scroll calendar forward/backward by one month.} | 6157 | > / < @r{Scroll calendar forward/backward by one month.} |
| 6027 | M-v / C-v @r{Scroll calendar forward/backward by 3 months.} | 6158 | M-v / C-v @r{Scroll calendar forward/backward by 3 months.} |
| 6159 | M-S-@key{down}/@key{up} @r{Scroll calendar forward/backward by one year.} | ||
| 6028 | @end example | 6160 | @end example |
| 6029 | 6161 | ||
| 6030 | @vindex org-read-date-display-live | 6162 | @vindex org-read-date-display-live |
| @@ -6035,7 +6167,7 @@ on, the current interpretation of your input will be displayed live in the | |||
| 6035 | minibuffer@footnote{If you find this distracting, turn the display off with | 6167 | minibuffer@footnote{If you find this distracting, turn the display off with |
| 6036 | @code{org-read-date-display-live}.}. | 6168 | @code{org-read-date-display-live}.}. |
| 6037 | 6169 | ||
| 6038 | @node Custom time format, , The date/time prompt, Creating timestamps | 6170 | @node Custom time format |
| 6039 | @subsection Custom time format | 6171 | @subsection Custom time format |
| 6040 | @cindex custom date/time format | 6172 | @cindex custom date/time format |
| 6041 | @cindex time format, custom | 6173 | @cindex time format, custom |
| @@ -6083,10 +6215,12 @@ format is shorter, things do work as expected. | |||
| 6083 | @end itemize | 6215 | @end itemize |
| 6084 | 6216 | ||
| 6085 | 6217 | ||
| 6086 | @node Deadlines and scheduling, Clocking work time, Creating timestamps, Dates and Times | 6218 | @node Deadlines and scheduling |
| 6087 | @section Deadlines and scheduling | 6219 | @section Deadlines and scheduling |
| 6088 | 6220 | ||
| 6089 | A timestamp may be preceded by special keywords to facilitate planning: | 6221 | A timestamp may be preceded by special keywords to facilitate planning. Both |
| 6222 | the timestamp and the keyword have to be positioned immediatly after the task | ||
| 6223 | they refer to. | ||
| 6090 | 6224 | ||
| 6091 | @table @var | 6225 | @table @var |
| 6092 | @item DEADLINE | 6226 | @item DEADLINE |
| @@ -6110,9 +6244,9 @@ until the entry is marked DONE@. An example: | |||
| 6110 | @end example | 6244 | @end example |
| 6111 | 6245 | ||
| 6112 | You can specify a different lead time for warnings for a specific | 6246 | You can specify a different lead time for warnings for a specific |
| 6113 | deadlines using the following syntax. Here is an example with a warning | 6247 | deadline using the following syntax. Here is an example with a warning |
| 6114 | period of 5 days @code{DEADLINE: <2004-02-29 Sun -5d>}. This warning is | 6248 | period of 5 days @code{DEADLINE: <2004-02-29 Sun -5d>}. This warning is |
| 6115 | deactivated if the task get scheduled and you set | 6249 | deactivated if the task gets scheduled and you set |
| 6116 | @code{org-agenda-skip-deadline-prewarning-if-scheduled} to @code{t}. | 6250 | @code{org-agenda-skip-deadline-prewarning-if-scheduled} to @code{t}. |
| 6117 | 6251 | ||
| 6118 | @item SCHEDULED | 6252 | @item SCHEDULED |
| @@ -6172,28 +6306,25 @@ sexp entry matches. | |||
| 6172 | * Repeated tasks:: Items that show up again and again | 6306 | * Repeated tasks:: Items that show up again and again |
| 6173 | @end menu | 6307 | @end menu |
| 6174 | 6308 | ||
| 6175 | @node Inserting deadline/schedule, Repeated tasks, Deadlines and scheduling, Deadlines and scheduling | 6309 | @node Inserting deadline/schedule |
| 6176 | @subsection Inserting deadlines or schedules | 6310 | @subsection Inserting deadlines or schedules |
| 6177 | 6311 | ||
| 6178 | The following commands allow you to quickly insert@footnote{The @samp{SCHEDULED} and | 6312 | The following commands allow you to quickly insert a deadline or to schedule |
| 6179 | @samp{DEADLINE} dates are inserted on the line right below the headline. Don't put | ||
| 6180 | any text between this line and the headline.} a deadline or to schedule | ||
| 6181 | an item: | 6313 | an item: |
| 6182 | 6314 | ||
| 6183 | @table @kbd | 6315 | @table @kbd |
| 6184 | @c | 6316 | @c |
| 6185 | @orgcmd{C-c C-d,org-deadline} | 6317 | @orgcmd{C-c C-d,org-deadline} |
| 6186 | Insert @samp{DEADLINE} keyword along with a stamp. The insertion will happen | 6318 | Insert @samp{DEADLINE} keyword along with a stamp. Any CLOSED timestamp will |
| 6187 | in the line directly following the headline. Any CLOSED timestamp will be | 6319 | be removed. When called with a prefix arg, an existing deadline will be |
| 6188 | removed. When called with a prefix arg, an existing deadline will be removed | 6320 | removed from the entry. Depending on the variable |
| 6189 | from the entry. Depending on the variable @code{org-log-redeadline}@footnote{with corresponding | 6321 | @code{org-log-redeadline}@footnote{with corresponding @code{#+STARTUP} |
| 6190 | @code{#+STARTUP} keywords @code{logredeadline}, @code{lognoteredeadline}, | 6322 | keywords @code{logredeadline}, @code{lognoteredeadline}, and |
| 6191 | and @code{nologredeadline}}, a note will be taken when changing an existing | 6323 | @code{nologredeadline}}, a note will be taken when changing an existing |
| 6192 | deadline. | 6324 | deadline. |
| 6193 | 6325 | ||
| 6194 | @orgcmd{C-c C-s,org-schedule} | 6326 | @orgcmd{C-c C-s,org-schedule} |
| 6195 | Insert @samp{SCHEDULED} keyword along with a stamp. The insertion will | 6327 | Insert @samp{SCHEDULED} keyword along with a stamp. Any CLOSED timestamp |
| 6196 | happen in the line directly following the headline. Any CLOSED timestamp | ||
| 6197 | will be removed. When called with a prefix argument, remove the scheduling | 6328 | will be removed. When called with a prefix argument, remove the scheduling |
| 6198 | date from the entry. Depending on the variable | 6329 | date from the entry. Depending on the variable |
| 6199 | @code{org-log-reschedule}@footnote{with corresponding @code{#+STARTUP} | 6330 | @code{org-log-reschedule}@footnote{with corresponding @code{#+STARTUP} |
| @@ -6201,14 +6332,6 @@ keywords @code{logreschedule}, @code{lognotereschedule}, and | |||
| 6201 | @code{nologreschedule}}, a note will be taken when changing an existing | 6332 | @code{nologreschedule}}, a note will be taken when changing an existing |
| 6202 | scheduling time. | 6333 | scheduling time. |
| 6203 | @c | 6334 | @c |
| 6204 | @orgcmd{C-c C-x C-k,org-mark-entry-for-agenda-action} | ||
| 6205 | @kindex k a | ||
| 6206 | @kindex k s | ||
| 6207 | Mark the current entry for agenda action. After you have marked the entry | ||
| 6208 | like this, you can open the agenda or the calendar to find an appropriate | ||
| 6209 | date. With the cursor on the selected date, press @kbd{k s} or @kbd{k d} to | ||
| 6210 | schedule the marked item. | ||
| 6211 | @c | ||
| 6212 | @orgcmd{C-c / d,org-check-deadlines} | 6335 | @orgcmd{C-c / d,org-check-deadlines} |
| 6213 | @cindex sparse tree, for deadlines | 6336 | @cindex sparse tree, for deadlines |
| 6214 | @vindex org-deadline-warning-days | 6337 | @vindex org-deadline-warning-days |
| @@ -6230,7 +6353,7 @@ setting the date by indicating a relative time: e.g., +1d will set | |||
| 6230 | the date to the next day after today, and --1w will set the date | 6353 | the date to the next day after today, and --1w will set the date |
| 6231 | to the previous week before any current timestamp. | 6354 | to the previous week before any current timestamp. |
| 6232 | 6355 | ||
| 6233 | @node Repeated tasks, , Inserting deadline/schedule, Deadlines and scheduling | 6356 | @node Repeated tasks |
| 6234 | @subsection Repeated tasks | 6357 | @subsection Repeated tasks |
| 6235 | @cindex tasks, repeated | 6358 | @cindex tasks, repeated |
| 6236 | @cindex repeated tasks | 6359 | @cindex repeated tasks |
| @@ -6271,6 +6394,9 @@ switch the date like this: | |||
| 6271 | DEADLINE: <2005-11-01 Tue +1m> | 6394 | DEADLINE: <2005-11-01 Tue +1m> |
| 6272 | @end example | 6395 | @end example |
| 6273 | 6396 | ||
| 6397 | To mark a task with a repeater as @code{DONE}, use @kbd{C-- 1 C-c C-t} | ||
| 6398 | (i.e., @code{org-todo} with a numeric prefix argument of -1.) | ||
| 6399 | |||
| 6274 | @vindex org-log-repeat | 6400 | @vindex org-log-repeat |
| 6275 | A timestamp@footnote{You can change this using the option | 6401 | A timestamp@footnote{You can change this using the option |
| 6276 | @code{org-log-repeat}, or the @code{#+STARTUP} options @code{logrepeat}, | 6402 | @code{org-log-repeat}, or the @code{#+STARTUP} options @code{logrepeat}, |
| @@ -6299,6 +6425,13 @@ special repeaters @samp{++} and @samp{.+}. For example: | |||
| 6299 | but also by as many weeks as it takes to get this date into | 6425 | but also by as many weeks as it takes to get this date into |
| 6300 | the future. However, it stays on a Sunday, even if you called | 6426 | the future. However, it stays on a Sunday, even if you called |
| 6301 | and marked it done on Saturday. | 6427 | and marked it done on Saturday. |
| 6428 | ** TODO Empty kitchen trash | ||
| 6429 | DEADLINE: <2008-02-08 Fri 20:00 ++1d> | ||
| 6430 | Marking this DONE will shift the date by at least one day, and | ||
| 6431 | also by as many days as it takes to get the timestamp into the | ||
| 6432 | future. Since there is a time in the timestamp, the next | ||
| 6433 | deadline in the future will be on today's date if you | ||
| 6434 | complete the task before 20:00. | ||
| 6302 | ** TODO Check the batteries in the smoke detectors | 6435 | ** TODO Check the batteries in the smoke detectors |
| 6303 | DEADLINE: <2005-11-01 Tue .+1m> | 6436 | DEADLINE: <2005-11-01 Tue .+1m> |
| 6304 | Marking this DONE will shift the date to one month after | 6437 | Marking this DONE will shift the date to one month after |
| @@ -6310,7 +6443,9 @@ You may have both scheduling and deadline information for a specific task. | |||
| 6310 | If the repeater is set for the scheduling information only, you probably want | 6443 | If the repeater is set for the scheduling information only, you probably want |
| 6311 | the repeater to be ignored after the deadline. If so, set the variable | 6444 | the repeater to be ignored after the deadline. If so, set the variable |
| 6312 | @code{org-agenda-skip-scheduled-if-deadline-is-shown} to | 6445 | @code{org-agenda-skip-scheduled-if-deadline-is-shown} to |
| 6313 | @code{repeated-after-deadline}. If you want both scheduling and deadline | 6446 | @code{repeated-after-deadline}. However, any scheduling information without |
| 6447 | a repeater is no longer relevant once the task is done, and thus, removed | ||
| 6448 | upon repeating the task. If you want both scheduling and deadline | ||
| 6314 | information to repeat after the same interval, set the same repeater for both | 6449 | information to repeat after the same interval, set the same repeater for both |
| 6315 | timestamps. | 6450 | timestamps. |
| 6316 | 6451 | ||
| @@ -6319,7 +6454,7 @@ subtree, with dates shifted in each copy. The command @kbd{C-c C-x c} was | |||
| 6319 | created for this purpose, it is described in @ref{Structure editing}. | 6454 | created for this purpose, it is described in @ref{Structure editing}. |
| 6320 | 6455 | ||
| 6321 | 6456 | ||
| 6322 | @node Clocking work time, Effort estimates, Deadlines and scheduling, Dates and Times | 6457 | @node Clocking work time |
| 6323 | @section Clocking work time | 6458 | @section Clocking work time |
| 6324 | @cindex clocking time | 6459 | @cindex clocking time |
| 6325 | @cindex time clocking | 6460 | @cindex time clocking |
| @@ -6330,10 +6465,9 @@ you stop working on that task, or when you mark the task done, the clock is | |||
| 6330 | stopped and the corresponding time interval is recorded. It also computes | 6465 | stopped and the corresponding time interval is recorded. It also computes |
| 6331 | the total time spent on each subtree@footnote{Clocking only works if all | 6466 | the total time spent on each subtree@footnote{Clocking only works if all |
| 6332 | headings are indented with less than 30 stars. This is a hardcoded | 6467 | headings are indented with less than 30 stars. This is a hardcoded |
| 6333 | limitation of @code{lmax} in @code{org-clock-sum}.} of a project. And it | 6468 | limitation of @code{lmax} in @code{org-clock-sum}.} of a project. |
| 6334 | remembers a | 6469 | And it remembers a history or tasks recently clocked, so that you can jump |
| 6335 | history or tasks recently clocked, to that you can jump quickly between a | 6470 | quickly between a number of tasks absorbing your time. |
| 6336 | number of tasks absorbing your time. | ||
| 6337 | 6471 | ||
| 6338 | To save the clock history across Emacs sessions, use | 6472 | To save the clock history across Emacs sessions, use |
| 6339 | @lisp | 6473 | @lisp |
| @@ -6352,7 +6486,7 @@ what to do with it. | |||
| 6352 | * Resolving idle time:: Resolving time when you've been idle | 6486 | * Resolving idle time:: Resolving time when you've been idle |
| 6353 | @end menu | 6487 | @end menu |
| 6354 | 6488 | ||
| 6355 | @node Clocking commands, The clock table, Clocking work time, Clocking work time | 6489 | @node Clocking commands |
| 6356 | @subsection Clocking commands | 6490 | @subsection Clocking commands |
| 6357 | 6491 | ||
| 6358 | @table @kbd | 6492 | @table @kbd |
| @@ -6387,7 +6521,7 @@ reset of the task @footnote{as recorded by the @code{LAST_REPEAT} property} | |||
| 6387 | will be shown. More control over what time is shown can be exercised with | 6521 | will be shown. More control over what time is shown can be exercised with |
| 6388 | the @code{CLOCK_MODELINE_TOTAL} property. It may have the values | 6522 | the @code{CLOCK_MODELINE_TOTAL} property. It may have the values |
| 6389 | @code{current} to show only the current clocking instance, @code{today} to | 6523 | @code{current} to show only the current clocking instance, @code{today} to |
| 6390 | show all time clocked on this tasks today (see also the variable | 6524 | show all time clocked on this task today (see also the variable |
| 6391 | @code{org-extend-today-until}), @code{all} to include all time, or | 6525 | @code{org-extend-today-until}), @code{all} to include all time, or |
| 6392 | @code{auto} which is the default@footnote{See also the variable | 6526 | @code{auto} which is the default@footnote{See also the variable |
| 6393 | @code{org-clock-modeline-total}.}.@* Clicking with @kbd{mouse-1} onto the | 6527 | @code{org-clock-modeline-total}.}.@* Clicking with @kbd{mouse-1} onto the |
| @@ -6397,7 +6531,7 @@ mode line entry will pop up a menu with clocking options. | |||
| 6397 | @vindex org-log-note-clock-out | 6531 | @vindex org-log-note-clock-out |
| 6398 | Stop the clock (clock-out). This inserts another timestamp at the same | 6532 | Stop the clock (clock-out). This inserts another timestamp at the same |
| 6399 | location where the clock was last started. It also directly computes | 6533 | location where the clock was last started. It also directly computes |
| 6400 | the resulting time in inserts it after the time range as @samp{=> | 6534 | the resulting time and inserts it after the time range as @samp{=> |
| 6401 | HH:MM}. See the variable @code{org-log-note-clock-out} for the | 6535 | HH:MM}. See the variable @code{org-log-note-clock-out} for the |
| 6402 | possibility to record an additional note together with the clock-out | 6536 | possibility to record an additional note together with the clock-out |
| 6403 | timestamp@footnote{The corresponding in-buffer setting is: | 6537 | timestamp@footnote{The corresponding in-buffer setting is: |
| @@ -6449,10 +6583,10 @@ the agenda (@pxref{Weekly/daily agenda}) to show which tasks have been | |||
| 6449 | worked on or closed during a day. | 6583 | worked on or closed during a day. |
| 6450 | 6584 | ||
| 6451 | @strong{Important:} note that both @code{org-clock-out} and | 6585 | @strong{Important:} note that both @code{org-clock-out} and |
| 6452 | @code{org-clock-in-last} can have a global keybinding and will not | 6586 | @code{org-clock-in-last} can have a global key binding and will not |
| 6453 | modify the window disposition. | 6587 | modify the window disposition. |
| 6454 | 6588 | ||
| 6455 | @node The clock table, Resolving idle time, Clocking commands, Clocking work time | 6589 | @node The clock table |
| 6456 | @subsection The clock table | 6590 | @subsection The clock table |
| 6457 | @cindex clocktable, dynamic block | 6591 | @cindex clocktable, dynamic block |
| 6458 | @cindex report, of clocked time | 6592 | @cindex report, of clocked time |
| @@ -6492,7 +6626,7 @@ buffer with the @kbd{C-c C-x C-r} command: | |||
| 6492 | @end example | 6626 | @end example |
| 6493 | @noindent | 6627 | @noindent |
| 6494 | @vindex org-clocktable-defaults | 6628 | @vindex org-clocktable-defaults |
| 6495 | The @samp{BEGIN} line and specify a number of options to define the scope, | 6629 | The @samp{BEGIN} line specifies a number of options to define the scope, |
| 6496 | structure, and formatting of the report. Defaults for all these options can | 6630 | structure, and formatting of the report. Defaults for all these options can |
| 6497 | be configured in the variable @code{org-clocktable-defaults}. | 6631 | be configured in the variable @code{org-clocktable-defaults}. |
| 6498 | 6632 | ||
| @@ -6512,7 +6646,7 @@ be selected: | |||
| 6512 | file-with-archives @r{current file and its archives} | 6646 | file-with-archives @r{current file and its archives} |
| 6513 | agenda-with-archives @r{all agenda files, including archives} | 6647 | agenda-with-archives @r{all agenda files, including archives} |
| 6514 | :block @r{The time block to consider. This block is specified either} | 6648 | :block @r{The time block to consider. This block is specified either} |
| 6515 | @r{absolute, or relative to the current time and may be any of} | 6649 | @r{absolutely, or relative to the current time and may be any of} |
| 6516 | @r{these formats:} | 6650 | @r{these formats:} |
| 6517 | 2007-12-31 @r{New year eve 2007} | 6651 | 2007-12-31 @r{New year eve 2007} |
| 6518 | 2007-12 @r{December 2007} | 6652 | 2007-12 @r{December 2007} |
| @@ -6523,6 +6657,7 @@ be selected: | |||
| 6523 | thisweek, lastweek, thisweek-@var{N} @r{a relative week} | 6657 | thisweek, lastweek, thisweek-@var{N} @r{a relative week} |
| 6524 | thismonth, lastmonth, thismonth-@var{N} @r{a relative month} | 6658 | thismonth, lastmonth, thismonth-@var{N} @r{a relative month} |
| 6525 | thisyear, lastyear, thisyear-@var{N} @r{a relative year} | 6659 | thisyear, lastyear, thisyear-@var{N} @r{a relative year} |
| 6660 | untilnow | ||
| 6526 | @r{Use @kbd{S-@key{left}/@key{right}} keys to shift the time interval.} | 6661 | @r{Use @kbd{S-@key{left}/@key{right}} keys to shift the time interval.} |
| 6527 | :tstart @r{A time string specifying when to start considering times.} | 6662 | :tstart @r{A time string specifying when to start considering times.} |
| 6528 | @r{Relative times like @code{"<-2w>"} can also be used. See} | 6663 | @r{Relative times like @code{"<-2w>"} can also be used. See} |
| @@ -6541,7 +6676,7 @@ be selected: | |||
| 6541 | @r{@ref{Matching tags and properties} for the match syntax.} | 6676 | @r{@ref{Matching tags and properties} for the match syntax.} |
| 6542 | @end example | 6677 | @end example |
| 6543 | 6678 | ||
| 6544 | Then there are options which determine the formatting of the table. There | 6679 | Then there are options which determine the formatting of the table. These |
| 6545 | options are interpreted by the function @code{org-clocktable-write-default}, | 6680 | options are interpreted by the function @code{org-clocktable-write-default}, |
| 6546 | but you can specify your own function using the @code{:formatter} parameter. | 6681 | but you can specify your own function using the @code{:formatter} parameter. |
| 6547 | @example | 6682 | @example |
| @@ -6555,6 +6690,8 @@ but you can specify your own function using the @code{:formatter} parameter. | |||
| 6555 | :tcolumns @r{Number of columns to be used for times. If this is smaller} | 6690 | :tcolumns @r{Number of columns to be used for times. If this is smaller} |
| 6556 | @r{than @code{:maxlevel}, lower levels will be lumped into one column.} | 6691 | @r{than @code{:maxlevel}, lower levels will be lumped into one column.} |
| 6557 | :level @r{Should a level number column be included?} | 6692 | :level @r{Should a level number column be included?} |
| 6693 | :sort @r{A cons cell like containing the column to sort and a sorting type.} | ||
| 6694 | @r{E.g., @code{:sort (1 . ?a)} sorts the first column alphabetically.} | ||
| 6558 | :compact @r{Abbreviation for @code{:level nil :indent t :narrow 40! :tcolumns 1}} | 6695 | :compact @r{Abbreviation for @code{:level nil :indent t :narrow 40! :tcolumns 1}} |
| 6559 | @r{All are overwritten except if there is an explicit @code{:narrow}} | 6696 | @r{All are overwritten except if there is an explicit @code{:narrow}} |
| 6560 | :timestamp @r{A timestamp for the entry, when available. Look for SCHEDULED,} | 6697 | :timestamp @r{A timestamp for the entry, when available. Look for SCHEDULED,} |
| @@ -6600,7 +6737,7 @@ would be | |||
| 6600 | #+END: clocktable | 6737 | #+END: clocktable |
| 6601 | @end example | 6738 | @end example |
| 6602 | 6739 | ||
| 6603 | @node Resolving idle time, , The clock table, Clocking work time | 6740 | @node Resolving idle time |
| 6604 | @subsection Resolving idle time and continuous clocking | 6741 | @subsection Resolving idle time and continuous clocking |
| 6605 | 6742 | ||
| 6606 | @subsubheading Resolving idle time | 6743 | @subsubheading Resolving idle time |
| @@ -6616,7 +6753,7 @@ applying it to another one. | |||
| 6616 | @vindex org-clock-idle-time | 6753 | @vindex org-clock-idle-time |
| 6617 | By customizing the variable @code{org-clock-idle-time} to some integer, such | 6754 | By customizing the variable @code{org-clock-idle-time} to some integer, such |
| 6618 | as 10 or 15, Emacs can alert you when you get back to your computer after | 6755 | as 10 or 15, Emacs can alert you when you get back to your computer after |
| 6619 | being idle for that many minutes@footnote{On computers using macOS, | 6756 | being idle for that many minutes@footnote{On computers using Mac OS X, |
| 6620 | idleness is based on actual user idleness, not just Emacs' idle time. For | 6757 | idleness is based on actual user idleness, not just Emacs' idle time. For |
| 6621 | X11, you can install a utility program @file{x11idle.c}, available in the | 6758 | X11, you can install a utility program @file{x11idle.c}, available in the |
| 6622 | @code{contrib/scripts} directory of the Org git distribution, or install the | 6759 | @code{contrib/scripts} directory of the Org git distribution, or install the |
| @@ -6685,20 +6822,18 @@ last clocked entry for this session, and start the new clock from there. | |||
| 6685 | If you only want this from time to time, use three universal prefix arguments | 6822 | If you only want this from time to time, use three universal prefix arguments |
| 6686 | with @code{org-clock-in} and two @kbd{C-u C-u} with @code{org-clock-in-last}. | 6823 | with @code{org-clock-in} and two @kbd{C-u C-u} with @code{org-clock-in-last}. |
| 6687 | 6824 | ||
| 6688 | @node Effort estimates, Relative timer, Clocking work time, Dates and Times | 6825 | @node Effort estimates |
| 6689 | @section Effort estimates | 6826 | @section Effort estimates |
| 6690 | @cindex effort estimates | 6827 | @cindex effort estimates |
| 6691 | 6828 | ||
| 6692 | @cindex property, Effort | 6829 | @cindex property, Effort |
| 6693 | @vindex org-effort-property | ||
| 6694 | If you want to plan your work in a very detailed way, or if you need to | 6830 | If you want to plan your work in a very detailed way, or if you need to |
| 6695 | produce offers with quotations of the estimated work effort, you may want to | 6831 | produce offers with quotations of the estimated work effort, you may want to |
| 6696 | assign effort estimates to entries. If you are also clocking your work, you | 6832 | assign effort estimates to entries. If you are also clocking your work, you |
| 6697 | may later want to compare the planned effort with the actual working time, a | 6833 | may later want to compare the planned effort with the actual working time, |
| 6698 | great way to improve planning estimates. Effort estimates are stored in a | 6834 | a great way to improve planning estimates. Effort estimates are stored in |
| 6699 | special property @samp{Effort}@footnote{You may change the property being | 6835 | a special property @code{EFFORT}. You can set the effort for an entry with |
| 6700 | used with the variable @code{org-effort-property}.}. You can set the effort | 6836 | the following commands: |
| 6701 | for an entry with the following commands: | ||
| 6702 | 6837 | ||
| 6703 | @table @kbd | 6838 | @table @kbd |
| 6704 | @orgcmd{C-c C-x e,org-set-effort} | 6839 | @orgcmd{C-c C-x e,org-set-effort} |
| @@ -6748,61 +6883,57 @@ with the @kbd{/} key in the agenda (@pxref{Agenda commands}). If you have | |||
| 6748 | these estimates defined consistently, two or three key presses will narrow | 6883 | these estimates defined consistently, two or three key presses will narrow |
| 6749 | down the list to stuff that fits into an available time slot. | 6884 | down the list to stuff that fits into an available time slot. |
| 6750 | 6885 | ||
| 6751 | @node Relative timer, Countdown timer, Effort estimates, Dates and Times | 6886 | @node Timers |
| 6752 | @section Taking notes with a relative timer | 6887 | @section Taking notes with a timer |
| 6753 | @cindex relative timer | 6888 | @cindex relative timer |
| 6889 | @cindex countdown timer | ||
| 6890 | @kindex ; | ||
| 6891 | |||
| 6892 | Org provides two types of timers. There is a relative timer that counts up, | ||
| 6893 | which can be useful when taking notes during, for example, a meeting or | ||
| 6894 | a video viewing. There is also a countdown timer. | ||
| 6754 | 6895 | ||
| 6755 | When taking notes during, for example, a meeting or a video viewing, it can | 6896 | The relative and countdown are started with separate commands. |
| 6756 | be useful to have access to times relative to a starting time. Org provides | 6897 | |
| 6757 | such a relative timer and make it easy to create timed notes. | 6898 | @table @kbd |
| 6899 | @orgcmd{C-c C-x 0,org-timer-start} | ||
| 6900 | Start or reset the relative timer. By default, the timer is set to 0. When | ||
| 6901 | called with a @kbd{C-u} prefix, prompt the user for a starting offset. If | ||
| 6902 | there is a timer string at point, this is taken as the default, providing a | ||
| 6903 | convenient way to restart taking notes after a break in the process. When | ||
| 6904 | called with a double prefix argument @kbd{C-u C-u}, change all timer strings | ||
| 6905 | in the active region by a certain amount. This can be used to fix timer | ||
| 6906 | strings if the timer was not started at exactly the right moment. | ||
| 6907 | @orgcmd{C-c C-x ;,org-timer-set-timer} | ||
| 6908 | Start a countdown timer. The user is prompted for a duration. | ||
| 6909 | @code{org-timer-default-timer} sets the default countdown value. Giving | ||
| 6910 | a numeric prefix argument overrides this default value. This command is | ||
| 6911 | available as @kbd{;} in agenda buffers. | ||
| 6912 | @end table | ||
| 6913 | |||
| 6914 | Once started, relative and countdown timers are controlled with the same | ||
| 6915 | commands. | ||
| 6758 | 6916 | ||
| 6759 | @table @kbd | 6917 | @table @kbd |
| 6760 | @orgcmd{C-c C-x .,org-timer} | 6918 | @orgcmd{C-c C-x .,org-timer} |
| 6761 | Insert a relative time into the buffer. The first time you use this, the | 6919 | Insert the value of the current relative or countdown timer into the buffer. |
| 6762 | timer will be started. When called with a prefix argument, the timer is | 6920 | If no timer is running, the relative timer will be started. When called with |
| 6763 | restarted. | 6921 | a prefix argument, the relative timer is restarted. |
| 6764 | @orgcmd{C-c C-x -,org-timer-item} | 6922 | @orgcmd{C-c C-x -,org-timer-item} |
| 6765 | Insert a description list item with the current relative time. With a prefix | 6923 | Insert a description list item with the value of the current relative or |
| 6766 | argument, first reset the timer to 0. | 6924 | countdown timer. With a prefix argument, first reset the relative timer to |
| 6925 | 0. | ||
| 6767 | @orgcmd{M-@key{RET},org-insert-heading} | 6926 | @orgcmd{M-@key{RET},org-insert-heading} |
| 6768 | Once the timer list is started, you can also use @kbd{M-@key{RET}} to insert | 6927 | Once the timer list is started, you can also use @kbd{M-@key{RET}} to insert |
| 6769 | new timer items. | 6928 | new timer items. |
| 6770 | @c for key sequences with a comma, command name macros fail :( | 6929 | @orgcmd{C-c C-x @comma{},org-timer-pause-or-continue} |
| 6771 | @kindex C-c C-x , | 6930 | Pause the timer, or continue it if it is already paused. |
| 6772 | @item C-c C-x , | 6931 | @orgcmd{C-c C-x _,org-timer-stop} |
| 6773 | Pause the timer, or continue it if it is already paused | ||
| 6774 | (@command{org-timer-pause-or-continue}). | ||
| 6775 | @c removed the sentence because it is redundant to the following item | ||
| 6776 | @kindex C-u C-c C-x , | ||
| 6777 | @item C-u C-c C-x , | ||
| 6778 | Stop the timer. After this, you can only start a new timer, not continue the | 6932 | Stop the timer. After this, you can only start a new timer, not continue the |
| 6779 | old one. This command also removes the timer from the mode line. | 6933 | old one. This command also removes the timer from the mode line. |
| 6780 | @orgcmd{C-c C-x 0,org-timer-start} | ||
| 6781 | Reset the timer without inserting anything into the buffer. By default, the | ||
| 6782 | timer is reset to 0. When called with a @kbd{C-u} prefix, reset the timer to | ||
| 6783 | specific starting offset. The user is prompted for the offset, with a | ||
| 6784 | default taken from a timer string at point, if any, So this can be used to | ||
| 6785 | restart taking notes after a break in the process. When called with a double | ||
| 6786 | prefix argument @kbd{C-u C-u}, change all timer strings in the active region | ||
| 6787 | by a certain amount. This can be used to fix timer strings if the timer was | ||
| 6788 | not started at exactly the right moment. | ||
| 6789 | @end table | 6934 | @end table |
| 6790 | 6935 | ||
| 6791 | @node Countdown timer, , Relative timer, Dates and Times | 6936 | @node Capture - Refile - Archive |
| 6792 | @section Countdown timer | ||
| 6793 | @cindex Countdown timer | ||
| 6794 | @kindex C-c C-x ; | ||
| 6795 | @kindex ; | ||
| 6796 | |||
| 6797 | Calling @code{org-timer-set-timer} from an Org mode buffer runs a countdown | ||
| 6798 | timer. Use @kbd{;} from agenda buffers, @key{C-c C-x ;} everywhere else. | ||
| 6799 | |||
| 6800 | @code{org-timer-set-timer} prompts the user for a duration and displays a | ||
| 6801 | countdown timer in the modeline. @code{org-timer-default-timer} sets the | ||
| 6802 | default countdown value. Giving a prefix numeric argument overrides this | ||
| 6803 | default value. | ||
| 6804 | |||
| 6805 | @node Capture - Refile - Archive, Agenda Views, Dates and Times, Top | ||
| 6806 | @chapter Capture - Refile - Archive | 6937 | @chapter Capture - Refile - Archive |
| 6807 | @cindex capture | 6938 | @cindex capture |
| 6808 | 6939 | ||
| @@ -6816,13 +6947,13 @@ trees to an archive file keeps the system compact and fast. | |||
| 6816 | @menu | 6947 | @menu |
| 6817 | * Capture:: Capturing new stuff | 6948 | * Capture:: Capturing new stuff |
| 6818 | * Attachments:: Add files to tasks | 6949 | * Attachments:: Add files to tasks |
| 6819 | * RSS Feeds:: Getting input from RSS feeds | 6950 | * RSS feeds:: Getting input from RSS feeds |
| 6820 | * Protocols:: External (e.g., Browser) access to Emacs and Org | 6951 | * Protocols:: External (e.g., Browser) access to Emacs and Org |
| 6821 | * Refile and copy:: Moving/copying a tree from one place to another | 6952 | * Refile and copy:: Moving/copying a tree from one place to another |
| 6822 | * Archiving:: What to do with finished projects | 6953 | * Archiving:: What to do with finished projects |
| 6823 | @end menu | 6954 | @end menu |
| 6824 | 6955 | ||
| 6825 | @node Capture, Attachments, Capture - Refile - Archive, Capture - Refile - Archive | 6956 | @node Capture |
| 6826 | @section Capture | 6957 | @section Capture |
| 6827 | @cindex capture | 6958 | @cindex capture |
| 6828 | 6959 | ||
| @@ -6849,7 +6980,7 @@ customization. | |||
| 6849 | * Capture templates:: Define the outline of different note types | 6980 | * Capture templates:: Define the outline of different note types |
| 6850 | @end menu | 6981 | @end menu |
| 6851 | 6982 | ||
| 6852 | @node Setting up capture, Using capture, Capture, Capture | 6983 | @node Setting up capture |
| 6853 | @subsection Setting up capture | 6984 | @subsection Setting up capture |
| 6854 | 6985 | ||
| 6855 | The following customization sets a default target file for notes, and defines | 6986 | The following customization sets a default target file for notes, and defines |
| @@ -6864,12 +6995,12 @@ suggestion.} for capturing new material. | |||
| 6864 | @end group | 6995 | @end group |
| 6865 | @end smalllisp | 6996 | @end smalllisp |
| 6866 | 6997 | ||
| 6867 | @node Using capture, Capture templates, Setting up capture, Capture | 6998 | @node Using capture |
| 6868 | @subsection Using capture | 6999 | @subsection Using capture |
| 6869 | 7000 | ||
| 6870 | @table @kbd | 7001 | @table @kbd |
| 6871 | @orgcmd{C-c c,org-capture} | 7002 | @orgcmd{C-c c,org-capture} |
| 6872 | Call the command @code{org-capture}. Note that this keybinding is global and | 7003 | Call the command @code{org-capture}. Note that this key binding is global and |
| 6873 | not active by default: you need to install it. If you have templates | 7004 | not active by default: you need to install it. If you have templates |
| 6874 | @cindex date tree | 7005 | @cindex date tree |
| 6875 | defined @pxref{Capture templates}, it will offer these templates for | 7006 | defined @pxref{Capture templates}, it will offer these templates for |
| @@ -6921,7 +7052,7 @@ automatically be created unless you set @code{org-capture-bookmark} to | |||
| 6921 | To insert the capture at point in an Org buffer, call @code{org-capture} with | 7052 | To insert the capture at point in an Org buffer, call @code{org-capture} with |
| 6922 | a @code{C-0} prefix argument. | 7053 | a @code{C-0} prefix argument. |
| 6923 | 7054 | ||
| 6924 | @node Capture templates, , Using capture, Capture | 7055 | @node Capture templates |
| 6925 | @subsection Capture templates | 7056 | @subsection Capture templates |
| 6926 | @cindex templates, for Capture | 7057 | @cindex templates, for Capture |
| 6927 | 7058 | ||
| @@ -6980,7 +7111,7 @@ like this: | |||
| 6980 | * Templates in contexts:: Only show a template in a specific context | 7111 | * Templates in contexts:: Only show a template in a specific context |
| 6981 | @end menu | 7112 | @end menu |
| 6982 | 7113 | ||
| 6983 | @node Template elements, Template expansion, Capture templates, Capture templates | 7114 | @node Template elements |
| 6984 | @subsubsection Template elements | 7115 | @subsubsection Template elements |
| 6985 | 7116 | ||
| 6986 | Now lets look at the elements of a template definition. Each entry in | 7117 | Now lets look at the elements of a template definition. Each entry in |
| @@ -7032,7 +7163,9 @@ files, targets usually define a node. Entries will become children of this | |||
| 7032 | node. Other types will be added to the table or list in the body of this | 7163 | node. Other types will be added to the table or list in the body of this |
| 7033 | node. Most target specifications contain a file name. If that file name is | 7164 | node. Most target specifications contain a file name. If that file name is |
| 7034 | the empty string, it defaults to @code{org-default-notes-file}. A file can | 7165 | the empty string, it defaults to @code{org-default-notes-file}. A file can |
| 7035 | also be given as a variable, function, or Emacs Lisp form. | 7166 | also be given as a variable or as a function called with no argument. When |
| 7167 | an absolute path is not specified for a target, it is taken as relative to | ||
| 7168 | @code{org-directory}. | ||
| 7036 | 7169 | ||
| 7037 | Valid values are: | 7170 | Valid values are: |
| 7038 | 7171 | ||
| @@ -7061,6 +7194,13 @@ one matched.}. | |||
| 7061 | @item (file+datetree+prompt "path/to/file") | 7194 | @item (file+datetree+prompt "path/to/file") |
| 7062 | Will create a heading in a date tree, but will prompt for the date. | 7195 | Will create a heading in a date tree, but will prompt for the date. |
| 7063 | 7196 | ||
| 7197 | @item (file+weektree "path/to/file") | ||
| 7198 | Will create a heading in a week tree for today's date. Week trees are sorted | ||
| 7199 | by week and not by month unlike datetrees. | ||
| 7200 | |||
| 7201 | @item (file+weektree+prompt "path/to/file") | ||
| 7202 | Will create a heading in a week tree, but will prompt for the date. | ||
| 7203 | |||
| 7064 | @item (file+function "path/to/file" function-finding-location) | 7204 | @item (file+function "path/to/file" function-finding-location) |
| 7065 | A function to find the right location in the file. | 7205 | A function to find the right location in the file. |
| 7066 | 7206 | ||
| @@ -7068,8 +7208,8 @@ A function to find the right location in the file. | |||
| 7068 | File to the entry that is currently being clocked. | 7208 | File to the entry that is currently being clocked. |
| 7069 | 7209 | ||
| 7070 | @item (function function-finding-location) | 7210 | @item (function function-finding-location) |
| 7071 | Most general way, write your own function to find both | 7211 | Most general way: write your own function which both visits |
| 7072 | file and location. | 7212 | the file and moves point to the right location. |
| 7073 | @end table | 7213 | @end table |
| 7074 | 7214 | ||
| 7075 | @item template | 7215 | @item template |
| @@ -7117,9 +7257,10 @@ narrow it so that you only see the new material. | |||
| 7117 | 7257 | ||
| 7118 | @item :table-line-pos | 7258 | @item :table-line-pos |
| 7119 | Specification of the location in the table where the new line should be | 7259 | Specification of the location in the table where the new line should be |
| 7120 | inserted. It should be a string like @code{"II-3"} meaning that the new | 7260 | inserted. It can be a string, a variable holding a string or a function |
| 7121 | line should become the third line before the second horizontal separator | 7261 | returning a string. The string should look like @code{"II-3"} meaning that |
| 7122 | line. | 7262 | the new line should become the third line before the second horizontal |
| 7263 | separator line. | ||
| 7123 | 7264 | ||
| 7124 | @item :kill-buffer | 7265 | @item :kill-buffer |
| 7125 | If the target file was not yet visited when capture was invoked, kill the | 7266 | If the target file was not yet visited when capture was invoked, kill the |
| @@ -7127,7 +7268,7 @@ buffer again after capture is completed. | |||
| 7127 | @end table | 7268 | @end table |
| 7128 | @end table | 7269 | @end table |
| 7129 | 7270 | ||
| 7130 | @node Template expansion, Templates in contexts, Template elements, Capture templates | 7271 | @node Template expansion |
| 7131 | @subsubsection Template expansion | 7272 | @subsubsection Template expansion |
| 7132 | 7273 | ||
| 7133 | In the template itself, special @kbd{%}-escapes@footnote{If you need one of | 7274 | In the template itself, special @kbd{%}-escapes@footnote{If you need one of |
| @@ -7169,7 +7310,7 @@ dynamic insertion of content. The templates are expanded in the order given her | |||
| 7169 | @r{You may specify a default value and a completion table with} | 7310 | @r{You may specify a default value and a completion table with} |
| 7170 | @r{%^@{prompt|default|completion2|completion3...@}.} | 7311 | @r{%^@{prompt|default|completion2|completion3...@}.} |
| 7171 | @r{The arrow keys access a prompt-specific history.} | 7312 | @r{The arrow keys access a prompt-specific history.} |
| 7172 | %\n @r{Insert the text entered at the nth %^@{@var{prompt}@}, where @code{n} is} | 7313 | %\1 @dots{} %\N @r{Insert the text entered at the Nth %^@{@var{prompt}@}, where @code{N} is} |
| 7173 | @r{a number, starting from 1.} | 7314 | @r{a number, starting from 1.} |
| 7174 | %? @r{After completing the template, position cursor here.} | 7315 | %? @r{After completing the template, position cursor here.} |
| 7175 | @end smallexample | 7316 | @end smallexample |
| @@ -7187,15 +7328,15 @@ Link type | Available keywords | |||
| 7187 | ---------------------------------+---------------------------------------------- | 7328 | ---------------------------------+---------------------------------------------- |
| 7188 | bbdb | %:name %:company | 7329 | bbdb | %:name %:company |
| 7189 | irc | %:server %:port %:nick | 7330 | irc | %:server %:port %:nick |
| 7190 | vm, vm-imap, wl, mh, mew, rmail | %:type %:subject %:message-id | 7331 | vm, vm-imap, wl, mh, mew, rmail, | %:type %:subject %:message-id |
| 7191 | | %:from %:fromname %:fromaddress | 7332 | gnus, notmuch | %:from %:fromname %:fromaddress |
| 7192 | | %:to %:toname %:toaddress | 7333 | | %:to %:toname %:toaddress |
| 7193 | | %:date @r{(message date header field)} | 7334 | | %:date @r{(message date header field)} |
| 7194 | | %:date-timestamp @r{(date as active timestamp)} | 7335 | | %:date-timestamp @r{(date as active timestamp)} |
| 7195 | | %:date-timestamp-inactive @r{(date as inactive timestamp)} | 7336 | | %:date-timestamp-inactive @r{(date as inactive timestamp)} |
| 7196 | | %:fromto @r{(either "to NAME" or "from NAME")@footnote{This will always be the other, not the user. See the variable @code{org-from-is-user-regexp}.}} | 7337 | | %:fromto @r{(either "to NAME" or "from NAME")@footnote{This will always be the other, not the user. See the variable @code{org-from-is-user-regexp}.}} |
| 7197 | gnus | %:group, @r{for messages also all email fields} | 7338 | gnus | %:group, @r{for messages also all email fields} |
| 7198 | w3, w3m | %:url | 7339 | eww, w3, w3m | %:url |
| 7199 | info | %:file %:node | 7340 | info | %:file %:node |
| 7200 | calendar | %:date | 7341 | calendar | %:date |
| 7201 | @end smallexample | 7342 | @end smallexample |
| @@ -7207,7 +7348,7 @@ To place the cursor after template expansion use: | |||
| 7207 | %? @r{After completing the template, position cursor here.} | 7348 | %? @r{After completing the template, position cursor here.} |
| 7208 | @end smallexample | 7349 | @end smallexample |
| 7209 | 7350 | ||
| 7210 | @node Templates in contexts, , Template expansion, Capture templates | 7351 | @node Templates in contexts |
| 7211 | @subsubsection Templates in contexts | 7352 | @subsubsection Templates in contexts |
| 7212 | 7353 | ||
| 7213 | @vindex org-capture-templates-contexts | 7354 | @vindex org-capture-templates-contexts |
| @@ -7231,7 +7372,7 @@ template. In that case, add this command key like this: | |||
| 7231 | 7372 | ||
| 7232 | See the docstring of the variable for more information. | 7373 | See the docstring of the variable for more information. |
| 7233 | 7374 | ||
| 7234 | @node Attachments, RSS Feeds, Capture, Capture - Refile - Archive | 7375 | @node Attachments |
| 7235 | @section Attachments | 7376 | @section Attachments |
| 7236 | @cindex attachments | 7377 | @cindex attachments |
| 7237 | 7378 | ||
| @@ -7319,7 +7460,7 @@ same directory for attachments as the parent does. | |||
| 7319 | @end table | 7460 | @end table |
| 7320 | @end table | 7461 | @end table |
| 7321 | 7462 | ||
| 7322 | @node RSS Feeds, Protocols, Attachments, Capture - Refile - Archive | 7463 | @node RSS feeds |
| 7323 | @section RSS feeds | 7464 | @section RSS feeds |
| 7324 | @cindex RSS feeds | 7465 | @cindex RSS feeds |
| 7325 | @cindex Atom feeds | 7466 | @cindex Atom feeds |
| @@ -7357,17 +7498,12 @@ Prompt for a feed name and go to the inbox configured for this feed. | |||
| 7357 | 7498 | ||
| 7358 | Under the same headline, Org will create a drawer @samp{FEEDSTATUS} in which | 7499 | Under the same headline, Org will create a drawer @samp{FEEDSTATUS} in which |
| 7359 | it will store information about the status of items in the feed, to avoid | 7500 | it will store information about the status of items in the feed, to avoid |
| 7360 | adding the same item several times. You should add @samp{FEEDSTATUS} to the | 7501 | adding the same item several times. |
| 7361 | list of drawers in that file: | ||
| 7362 | |||
| 7363 | @example | ||
| 7364 | #+DRAWERS: LOGBOOK PROPERTIES FEEDSTATUS | ||
| 7365 | @end example | ||
| 7366 | 7502 | ||
| 7367 | For more information, including how to read atom feeds, see | 7503 | For more information, including how to read atom feeds, see |
| 7368 | @file{org-feed.el} and the docstring of @code{org-feed-alist}. | 7504 | @file{org-feed.el} and the docstring of @code{org-feed-alist}. |
| 7369 | 7505 | ||
| 7370 | @node Protocols, Refile and copy, RSS Feeds, Capture - Refile - Archive | 7506 | @node Protocols |
| 7371 | @section Protocols for external access | 7507 | @section Protocols for external access |
| 7372 | @cindex protocols, for external access | 7508 | @cindex protocols, for external access |
| 7373 | @cindex emacsserver | 7509 | @cindex emacsserver |
| @@ -7381,7 +7517,7 @@ a remote website you are looking at with the browser. See | |||
| 7381 | @uref{http://orgmode.org/worg/org-contrib/org-protocol.php} for detailed | 7517 | @uref{http://orgmode.org/worg/org-contrib/org-protocol.php} for detailed |
| 7382 | documentation and setup instructions. | 7518 | documentation and setup instructions. |
| 7383 | 7519 | ||
| 7384 | @node Refile and copy, Archiving, Protocols, Capture - Refile - Archive | 7520 | @node Refile and copy |
| 7385 | @section Refile and copy | 7521 | @section Refile and copy |
| 7386 | @cindex refiling notes | 7522 | @cindex refiling notes |
| 7387 | @cindex copying notes | 7523 | @cindex copying notes |
| @@ -7438,7 +7574,7 @@ setting @code{org-refile-use-cache}. To make the command see new possible | |||
| 7438 | targets, you have to clear the cache with this command. | 7574 | targets, you have to clear the cache with this command. |
| 7439 | @end table | 7575 | @end table |
| 7440 | 7576 | ||
| 7441 | @node Archiving, , Refile and copy, Capture - Refile - Archive | 7577 | @node Archiving |
| 7442 | @section Archiving | 7578 | @section Archiving |
| 7443 | @cindex archiving | 7579 | @cindex archiving |
| 7444 | 7580 | ||
| @@ -7459,7 +7595,7 @@ Archive the current entry using the command specified in the variable | |||
| 7459 | * Internal archiving:: Switch off a tree but keep it in the file | 7595 | * Internal archiving:: Switch off a tree but keep it in the file |
| 7460 | @end menu | 7596 | @end menu |
| 7461 | 7597 | ||
| 7462 | @node Moving subtrees, Internal archiving, Archiving, Archiving | 7598 | @node Moving subtrees |
| 7463 | @subsection Moving a tree to the archive file | 7599 | @subsection Moving a tree to the archive file |
| 7464 | @cindex external archiving | 7600 | @cindex external archiving |
| 7465 | 7601 | ||
| @@ -7477,6 +7613,10 @@ the archive. To do this, each subtree is checked for open TODO entries. | |||
| 7477 | If none are found, the command offers to move it to the archive | 7613 | If none are found, the command offers to move it to the archive |
| 7478 | location. If the cursor is @emph{not} on a headline when this command | 7614 | location. If the cursor is @emph{not} on a headline when this command |
| 7479 | is invoked, the level 1 trees will be checked. | 7615 | is invoked, the level 1 trees will be checked. |
| 7616 | @orgkey{C-u C-u C-c C-x C-s} | ||
| 7617 | As above, but check subtree for timestamps instead of TODO entries. The | ||
| 7618 | command will offer to archive the subtree if it @emph{does} contain a | ||
| 7619 | timestamp, and that timestamp is in the past. | ||
| 7480 | @end table | 7620 | @end table |
| 7481 | 7621 | ||
| 7482 | @cindex archive locations | 7622 | @cindex archive locations |
| @@ -7488,14 +7628,7 @@ For information and examples on how to specify the file and the heading, | |||
| 7488 | see the documentation string of the variable | 7628 | see the documentation string of the variable |
| 7489 | @code{org-archive-location}. | 7629 | @code{org-archive-location}. |
| 7490 | 7630 | ||
| 7491 | There is also an in-buffer option for setting this variable, for | 7631 | There is also an in-buffer option for setting this variable, for example: |
| 7492 | example@footnote{For backward compatibility, the following also works: | ||
| 7493 | If there are several such lines in a file, each specifies the archive | ||
| 7494 | location for the text below it. The first such line also applies to any | ||
| 7495 | text before its definition. However, using this method is | ||
| 7496 | @emph{strongly} deprecated as it is incompatible with the outline | ||
| 7497 | structure of the document. The correct method for setting multiple | ||
| 7498 | archive locations in a buffer is using properties.}: | ||
| 7499 | 7632 | ||
| 7500 | @cindex #+ARCHIVE | 7633 | @cindex #+ARCHIVE |
| 7501 | @example | 7634 | @example |
| @@ -7506,7 +7639,7 @@ archive locations in a buffer is using properties.}: | |||
| 7506 | @noindent | 7639 | @noindent |
| 7507 | If you would like to have a special ARCHIVE location for a single entry | 7640 | If you would like to have a special ARCHIVE location for a single entry |
| 7508 | or a (sub)tree, give the entry an @code{:ARCHIVE:} property with the | 7641 | or a (sub)tree, give the entry an @code{:ARCHIVE:} property with the |
| 7509 | location as the value (@pxref{Properties and Columns}). | 7642 | location as the value (@pxref{Properties and columns}). |
| 7510 | 7643 | ||
| 7511 | @vindex org-archive-save-context-info | 7644 | @vindex org-archive-save-context-info |
| 7512 | When a subtree is moved, it receives a number of special properties that | 7645 | When a subtree is moved, it receives a number of special properties that |
| @@ -7516,14 +7649,15 @@ outline path the archiving time etc. Configure the variable | |||
| 7516 | added. | 7649 | added. |
| 7517 | 7650 | ||
| 7518 | 7651 | ||
| 7519 | @node Internal archiving, , Moving subtrees, Archiving | 7652 | @node Internal archiving |
| 7520 | @subsection Internal archiving | 7653 | @subsection Internal archiving |
| 7521 | 7654 | ||
| 7522 | If you want to just switch off (for agenda views) certain subtrees without | 7655 | @cindex archive tag |
| 7523 | moving them to a different file, you can use the @code{ARCHIVE tag}. | 7656 | If you want to just switch off---for agenda views---certain subtrees without |
| 7657 | moving them to a different file, you can use the archive tag. | ||
| 7524 | 7658 | ||
| 7525 | A headline that is marked with the ARCHIVE tag (@pxref{Tags}) stays at | 7659 | A headline that is marked with the @samp{:ARCHIVE:} tag (@pxref{Tags}) stays |
| 7526 | its location in the outline tree, but behaves in the following way: | 7660 | at its location in the outline tree, but behaves in the following way: |
| 7527 | @itemize @minus | 7661 | @itemize @minus |
| 7528 | @item | 7662 | @item |
| 7529 | @vindex org-cycle-open-archived-trees | 7663 | @vindex org-cycle-open-archived-trees |
| @@ -7539,7 +7673,7 @@ archived subtrees are not exposed, unless you configure the option | |||
| 7539 | @code{org-sparse-tree-open-archived-trees}. | 7673 | @code{org-sparse-tree-open-archived-trees}. |
| 7540 | @item | 7674 | @item |
| 7541 | @vindex org-agenda-skip-archived-trees | 7675 | @vindex org-agenda-skip-archived-trees |
| 7542 | During agenda view construction (@pxref{Agenda Views}), the content of | 7676 | During agenda view construction (@pxref{Agenda views}), the content of |
| 7543 | archived trees is ignored unless you configure the option | 7677 | archived trees is ignored unless you configure the option |
| 7544 | @code{org-agenda-skip-archived-trees}, in which case these trees will always | 7678 | @code{org-agenda-skip-archived-trees}, in which case these trees will always |
| 7545 | be included. In the agenda you can press @kbd{v a} to get archives | 7679 | be included. In the agenda you can press @kbd{v a} to get archives |
| @@ -7579,7 +7713,7 @@ outline. | |||
| 7579 | @end table | 7713 | @end table |
| 7580 | 7714 | ||
| 7581 | 7715 | ||
| 7582 | @node Agenda Views, Markup, Capture - Refile - Archive, Top | 7716 | @node Agenda views |
| 7583 | @chapter Agenda views | 7717 | @chapter Agenda views |
| 7584 | @cindex agenda views | 7718 | @cindex agenda views |
| 7585 | 7719 | ||
| @@ -7622,6 +7756,15 @@ buffer}. This buffer is read-only, but provides commands to visit the | |||
| 7622 | corresponding locations in the original Org files, and even to | 7756 | corresponding locations in the original Org files, and even to |
| 7623 | edit these files remotely. | 7757 | edit these files remotely. |
| 7624 | 7758 | ||
| 7759 | @vindex org-agenda-skip-comment-trees | ||
| 7760 | @vindex org-agenda-skip-archived-trees | ||
| 7761 | @cindex commented entries, in agenda views | ||
| 7762 | @cindex archived entries, in agenda views | ||
| 7763 | By default, the report ignores commented (@pxref{Comment lines}) and archived | ||
| 7764 | (@pxref{Internal archiving}) entries. You can override this by setting | ||
| 7765 | @code{org-agenda-skip-comment-trees} and | ||
| 7766 | @code{org-agenda-skip-archived-trees} to @code{nil}. | ||
| 7767 | |||
| 7625 | @vindex org-agenda-window-setup | 7768 | @vindex org-agenda-window-setup |
| 7626 | @vindex org-agenda-restore-windows-after-quit | 7769 | @vindex org-agenda-restore-windows-after-quit |
| 7627 | Two variables control how the agenda buffer is displayed and whether the | 7770 | Two variables control how the agenda buffer is displayed and whether the |
| @@ -7636,11 +7779,11 @@ window configuration is restored when the agenda exits: | |||
| 7636 | * Presentation and sorting:: How agenda items are prepared for display | 7779 | * Presentation and sorting:: How agenda items are prepared for display |
| 7637 | * Agenda commands:: Remote editing of Org trees | 7780 | * Agenda commands:: Remote editing of Org trees |
| 7638 | * Custom agenda views:: Defining special searches and views | 7781 | * Custom agenda views:: Defining special searches and views |
| 7639 | * Exporting Agenda Views:: Writing a view to a file | 7782 | * Exporting agenda views:: Writing a view to a file |
| 7640 | * Agenda column view:: Using column view for collected entries | 7783 | * Agenda column view:: Using column view for collected entries |
| 7641 | @end menu | 7784 | @end menu |
| 7642 | 7785 | ||
| 7643 | @node Agenda files, Agenda dispatcher, Agenda Views, Agenda Views | 7786 | @node Agenda files |
| 7644 | @section Agenda files | 7787 | @section Agenda files |
| 7645 | @cindex agenda files | 7788 | @cindex agenda files |
| 7646 | @cindex files for agenda | 7789 | @cindex files for agenda |
| @@ -7717,7 +7860,7 @@ effect immediately. | |||
| 7717 | Lift the restriction. | 7860 | Lift the restriction. |
| 7718 | @end table | 7861 | @end table |
| 7719 | 7862 | ||
| 7720 | @node Agenda dispatcher, Built-in agenda views, Agenda files, Agenda Views | 7863 | @node Agenda dispatcher |
| 7721 | @section The agenda dispatcher | 7864 | @section The agenda dispatcher |
| 7722 | @cindex agenda dispatcher | 7865 | @cindex agenda dispatcher |
| 7723 | @cindex dispatching agenda commands | 7866 | @cindex dispatching agenda commands |
| @@ -7763,15 +7906,17 @@ current region/subtree.}. After pressing @kbd{< <}, you still need to press the | |||
| 7763 | character selecting the command. | 7906 | character selecting the command. |
| 7764 | 7907 | ||
| 7765 | @item * | 7908 | @item * |
| 7909 | @cindex agenda, sticky | ||
| 7766 | @vindex org-agenda-sticky | 7910 | @vindex org-agenda-sticky |
| 7767 | Toggle sticky agenda views. By default, Org maintains only a single agenda | 7911 | Toggle sticky agenda views. By default, Org maintains only a single agenda |
| 7768 | buffer and rebuilds it each time you change the view, to make sure everything | 7912 | buffer and rebuilds it each time you change the view, to make sure everything |
| 7769 | is always up to date. If you switch between views often and the build time | 7913 | is always up to date. If you often switch between agenda views and the build |
| 7770 | bothers you, you can turn on sticky agenda buffers (make this the default by | 7914 | time bothers you, you can turn on sticky agenda buffers or make this the |
| 7771 | customizing the variable @code{org-agenda-sticky}). With sticky agendas, the | 7915 | default by customizing the variable @code{org-agenda-sticky}. With sticky |
| 7772 | dispatcher only switches to the selected view, you need to update it by hand | 7916 | agendas, the agenda dispatcher will not recreate agenda views from scratch, |
| 7773 | with @kbd{r} or @kbd{g}. You can toggle sticky agenda view any time with | 7917 | it will only switch to the selected one, and you need to update the agenda by |
| 7774 | @code{org-toggle-sticky-agenda}. | 7918 | hand with @kbd{r} or @kbd{g} when needed. You can toggle sticky agenda view |
| 7919 | any time with @code{org-toggle-sticky-agenda}. | ||
| 7775 | @end table | 7920 | @end table |
| 7776 | 7921 | ||
| 7777 | You can also define custom commands that will be accessible through the | 7922 | You can also define custom commands that will be accessible through the |
| @@ -7780,7 +7925,7 @@ possibility to create extended agenda buffers that contain several | |||
| 7780 | blocks together, for example the weekly agenda, the global TODO list and | 7925 | blocks together, for example the weekly agenda, the global TODO list and |
| 7781 | a number of special tags matches. @xref{Custom agenda views}. | 7926 | a number of special tags matches. @xref{Custom agenda views}. |
| 7782 | 7927 | ||
| 7783 | @node Built-in agenda views, Presentation and sorting, Agenda dispatcher, Agenda Views | 7928 | @node Built-in agenda views |
| 7784 | @section The built-in agenda views | 7929 | @section The built-in agenda views |
| 7785 | 7930 | ||
| 7786 | In this section we describe the built-in views. | 7931 | In this section we describe the built-in views. |
| @@ -7794,7 +7939,7 @@ In this section we describe the built-in views. | |||
| 7794 | * Stuck projects:: Find projects you need to review | 7939 | * Stuck projects:: Find projects you need to review |
| 7795 | @end menu | 7940 | @end menu |
| 7796 | 7941 | ||
| 7797 | @node Weekly/daily agenda, Global TODO list, Built-in agenda views, Built-in agenda views | 7942 | @node Weekly/daily agenda |
| 7798 | @subsection The weekly/daily agenda | 7943 | @subsection The weekly/daily agenda |
| 7799 | @cindex agenda | 7944 | @cindex agenda |
| 7800 | @cindex weekly agenda | 7945 | @cindex weekly agenda |
| @@ -7872,10 +8017,16 @@ the following segment of an Org file will be processed and entries | |||
| 7872 | will be made in the agenda: | 8017 | will be made in the agenda: |
| 7873 | 8018 | ||
| 7874 | @example | 8019 | @example |
| 7875 | * Birthdays and similar stuff | 8020 | * Holidays |
| 7876 | #+CATEGORY: Holiday | 8021 | :PROPERTIES: |
| 8022 | :CATEGORY: Holiday | ||
| 8023 | :END: | ||
| 7877 | %%(org-calendar-holiday) ; special function for holiday names | 8024 | %%(org-calendar-holiday) ; special function for holiday names |
| 7878 | #+CATEGORY: Ann | 8025 | |
| 8026 | * Birthdays | ||
| 8027 | :PROPERTIES: | ||
| 8028 | :CATEGORY: Ann | ||
| 8029 | :END: | ||
| 7879 | %%(org-anniversary 1956 5 14)@footnote{@code{org-anniversary} is just like @code{diary-anniversary}, but the argument order is always according to ISO and therefore independent of the value of @code{calendar-date-style}.} Arthur Dent is %d years old | 8030 | %%(org-anniversary 1956 5 14)@footnote{@code{org-anniversary} is just like @code{diary-anniversary}, but the argument order is always according to ISO and therefore independent of the value of @code{calendar-date-style}.} Arthur Dent is %d years old |
| 7880 | %%(org-anniversary 1869 10 2) Mahatma Gandhi would be %d years old | 8031 | %%(org-anniversary 1869 10 2) Mahatma Gandhi would be %d years old |
| 7881 | @end example | 8032 | @end example |
| @@ -7919,6 +8070,20 @@ hash with anniversaries. However, from then on things will be very fast---much | |||
| 7919 | faster in fact than a long list of @samp{%%(diary-anniversary)} entries | 8070 | faster in fact than a long list of @samp{%%(diary-anniversary)} entries |
| 7920 | in an Org or Diary file. | 8071 | in an Org or Diary file. |
| 7921 | 8072 | ||
| 8073 | If you would like to see upcoming anniversaries with a bit of forewarning, | ||
| 8074 | you can use the following instead: | ||
| 8075 | |||
| 8076 | @example | ||
| 8077 | * Anniversaries | ||
| 8078 | :PROPERTIES: | ||
| 8079 | :CATEGORY: Anniv | ||
| 8080 | :END: | ||
| 8081 | %%(org-bbdb-anniversaries-future 3) | ||
| 8082 | @end example | ||
| 8083 | |||
| 8084 | That will give you three days' warning: on the anniversary date itself and the | ||
| 8085 | two days prior. The argument is optional: if omitted, it defaults to 7. | ||
| 8086 | |||
| 7922 | @subsubheading Appointment reminders | 8087 | @subsubheading Appointment reminders |
| 7923 | @cindex @file{appt.el} | 8088 | @cindex @file{appt.el} |
| 7924 | @cindex appointment reminders | 8089 | @cindex appointment reminders |
| @@ -7933,7 +8098,7 @@ It also reads a @code{APPT_WARNTIME} property which will then override the | |||
| 7933 | value of @code{appt-message-warning-time} for this appointment. See the | 8098 | value of @code{appt-message-warning-time} for this appointment. See the |
| 7934 | docstring for details. | 8099 | docstring for details. |
| 7935 | 8100 | ||
| 7936 | @node Global TODO list, Matching tags and properties, Weekly/daily agenda, Built-in agenda views | 8101 | @node Global TODO list |
| 7937 | @subsection The global TODO list | 8102 | @subsection The global TODO list |
| 7938 | @cindex global TODO list | 8103 | @cindex global TODO list |
| 7939 | @cindex TODO list, global | 8104 | @cindex TODO list, global |
| @@ -7944,7 +8109,7 @@ collected into a single place. | |||
| 7944 | @table @kbd | 8109 | @table @kbd |
| 7945 | @orgcmd{C-c a t,org-todo-list} | 8110 | @orgcmd{C-c a t,org-todo-list} |
| 7946 | Show the global TODO list. This collects the TODO items from all agenda | 8111 | Show the global TODO list. This collects the TODO items from all agenda |
| 7947 | files (@pxref{Agenda Views}) into a single buffer. By default, this lists | 8112 | files (@pxref{Agenda views}) into a single buffer. By default, this lists |
| 7948 | items with a state the is not a DONE state. The buffer is in | 8113 | items with a state the is not a DONE state. The buffer is in |
| 7949 | @code{agenda-mode}, so there are commands to examine and manipulate the TODO | 8114 | @code{agenda-mode}, so there are commands to examine and manipulate the TODO |
| 7950 | entries directly from that buffer (@pxref{Agenda commands}). | 8115 | entries directly from that buffer (@pxref{Agenda commands}). |
| @@ -7994,7 +8159,7 @@ and omit the sublevels from the global list. Configure the variable | |||
| 7994 | @code{org-agenda-todo-list-sublevels} to get this behavior. | 8159 | @code{org-agenda-todo-list-sublevels} to get this behavior. |
| 7995 | @end itemize | 8160 | @end itemize |
| 7996 | 8161 | ||
| 7997 | @node Matching tags and properties, Timeline, Global TODO list, Built-in agenda views | 8162 | @node Matching tags and properties |
| 7998 | @subsection Matching tags and properties | 8163 | @subsection Matching tags and properties |
| 7999 | @cindex matching, of tags | 8164 | @cindex matching, of tags |
| 8000 | @cindex matching, of properties | 8165 | @cindex matching, of properties |
| @@ -8002,7 +8167,7 @@ and omit the sublevels from the global list. Configure the variable | |||
| 8002 | @cindex match view | 8167 | @cindex match view |
| 8003 | 8168 | ||
| 8004 | If headlines in the agenda files are marked with @emph{tags} (@pxref{Tags}), | 8169 | If headlines in the agenda files are marked with @emph{tags} (@pxref{Tags}), |
| 8005 | or have properties (@pxref{Properties and Columns}), you can select headlines | 8170 | or have properties (@pxref{Properties and columns}), you can select headlines |
| 8006 | based on this metadata and collect them into an agenda buffer. The match | 8171 | based on this metadata and collect them into an agenda buffer. The match |
| 8007 | syntax described here also applies when creating sparse trees with @kbd{C-c / | 8172 | syntax described here also applies when creating sparse trees with @kbd{C-c / |
| 8008 | m}. | 8173 | m}. |
| @@ -8063,31 +8228,29 @@ braces. For example, | |||
| 8063 | @samp{:work:} and any tag @i{starting} with @samp{boss}. | 8228 | @samp{:work:} and any tag @i{starting} with @samp{boss}. |
| 8064 | 8229 | ||
| 8065 | @cindex group tags, as regular expressions | 8230 | @cindex group tags, as regular expressions |
| 8066 | Group tags (@pxref{Tag groups}) are expanded as regular expressions. E.g., | 8231 | Group tags (@pxref{Tag hierarchy}) are expanded as regular expressions. E.g., |
| 8067 | if @samp{:work:} is a group tag for the group @samp{:work:lab:conf:}, then | 8232 | if @samp{:work:} is a group tag for the group @samp{:work:lab:conf:}, then |
| 8068 | searching for @samp{work} will search for @samp{@{\(?:work\|lab\|conf\)@}} | 8233 | searching for @samp{work} will search for @samp{@{\(?:work\|lab\|conf\)@}} |
| 8069 | and searching for @samp{-work} will search for all headlines but those with | 8234 | and searching for @samp{-work} will search for all headlines but those with |
| 8070 | one of the tag in the group (i.e., @samp{-@{\(?:work\|lab\|conf\)@}}). | 8235 | one of the tags in the group (i.e., @samp{-@{\(?:work\|lab\|conf\)@}}). |
| 8071 | 8236 | ||
| 8072 | @cindex TODO keyword matching, with tags search | 8237 | @cindex TODO keyword matching, with tags search |
| 8073 | @cindex level, require for tags/property match | 8238 | @cindex level, require for tags/property match |
| 8074 | @cindex category, require for tags/property match | 8239 | @cindex category, require for tags/property match |
| 8075 | @vindex org-odd-levels-only | 8240 | @vindex org-odd-levels-only |
| 8076 | You may also test for properties (@pxref{Properties and Columns}) at the same | 8241 | You may also test for properties (@pxref{Properties and columns}) at the same |
| 8077 | time as matching tags. The properties may be real properties, or special | 8242 | time as matching tags. The properties may be real properties, or special |
| 8078 | properties that represent other metadata (@pxref{Special properties}). For | 8243 | properties that represent other metadata (@pxref{Special properties}). For |
| 8079 | example, the ``property'' @code{TODO} represents the TODO keyword of the | 8244 | example, the ``property'' @code{TODO} represents the TODO keyword of the |
| 8080 | entry and the ``property'' @code{PRIORITY} represents the PRIORITY keyword of | 8245 | entry and the ``property'' @code{PRIORITY} represents the PRIORITY keyword of |
| 8081 | the entry. The ITEM special property cannot currently be used in tags/property | 8246 | the entry. |
| 8082 | searches@footnote{But @pxref{x-agenda-skip-entry-regexp, | ||
| 8083 | ,skipping entries based on regexp}.}. | ||
| 8084 | 8247 | ||
| 8085 | Except the @pxref{Special properties}, one other ``property'' can also be | 8248 | In addition to the properties mentioned above, @code{LEVEL} represents the |
| 8086 | used. @code{LEVEL} represents the level of an entry. So a search | 8249 | level of an entry. So a search @samp{+LEVEL=3+boss-TODO="DONE"} lists all |
| 8087 | @samp{+LEVEL=3+boss-TODO="DONE"} lists all level three headlines that have | 8250 | level three headlines that have the tag @samp{boss} and are @emph{not} marked |
| 8088 | the tag @samp{boss} and are @emph{not} marked with the TODO keyword DONE@. | 8251 | with the TODO keyword DONE@. In buffers with @code{org-odd-levels-only} set, |
| 8089 | In buffers with @code{org-odd-levels-only} set, @samp{LEVEL} does not count | 8252 | @samp{LEVEL} does not count the number of stars, but @samp{LEVEL=2} will |
| 8090 | the number of stars, but @samp{LEVEL=2} will correspond to 3 stars etc. | 8253 | correspond to 3 stars etc. |
| 8091 | 8254 | ||
| 8092 | Here are more examples: | 8255 | Here are more examples: |
| 8093 | 8256 | ||
| @@ -8141,11 +8304,6 @@ property that is numerically smaller than 2, a @samp{:With:} property that is | |||
| 8141 | matched by the regular expression @samp{Sarah\|Denny}, and that are scheduled | 8304 | matched by the regular expression @samp{Sarah\|Denny}, and that are scheduled |
| 8142 | on or after October 11, 2008. | 8305 | on or after October 11, 2008. |
| 8143 | 8306 | ||
| 8144 | Accessing TODO, LEVEL, and CATEGORY during a search is fast. Accessing any | ||
| 8145 | other properties will slow down the search. However, once you have paid the | ||
| 8146 | price by accessing one property, testing additional properties is cheap | ||
| 8147 | again. | ||
| 8148 | |||
| 8149 | You can configure Org mode to use property inheritance during a search, but | 8307 | You can configure Org mode to use property inheritance during a search, but |
| 8150 | beware that this can slow down searches considerably. See @ref{Property | 8308 | beware that this can slow down searches considerably. See @ref{Property |
| 8151 | inheritance}, for details. | 8309 | inheritance}, for details. |
| @@ -8174,7 +8332,7 @@ Select @samp{:work:}-tagged TODO lines that are either @samp{WAITING} or | |||
| 8174 | @samp{NEXT}. | 8332 | @samp{NEXT}. |
| 8175 | @end table | 8333 | @end table |
| 8176 | 8334 | ||
| 8177 | @node Timeline, Search view, Matching tags and properties, Built-in agenda views | 8335 | @node Timeline |
| 8178 | @subsection Timeline for a single file | 8336 | @subsection Timeline for a single file |
| 8179 | @cindex timeline, single file | 8337 | @cindex timeline, single file |
| 8180 | @cindex time-sorted view | 8338 | @cindex time-sorted view |
| @@ -8194,7 +8352,7 @@ When called with a @kbd{C-u} prefix, all unfinished TODO entries | |||
| 8194 | The commands available in the timeline buffer are listed in | 8352 | The commands available in the timeline buffer are listed in |
| 8195 | @ref{Agenda commands}. | 8353 | @ref{Agenda commands}. |
| 8196 | 8354 | ||
| 8197 | @node Search view, Stuck projects, Timeline, Built-in agenda views | 8355 | @node Search view |
| 8198 | @subsection Search view | 8356 | @subsection Search view |
| 8199 | @cindex search view | 8357 | @cindex search view |
| 8200 | @cindex text search | 8358 | @cindex text search |
| @@ -8224,7 +8382,7 @@ the docstring of the command @code{org-search-view}. | |||
| 8224 | Note that in addition to the agenda files, this command will also search | 8382 | Note that in addition to the agenda files, this command will also search |
| 8225 | the files listed in @code{org-agenda-text-search-extra-files}. | 8383 | the files listed in @code{org-agenda-text-search-extra-files}. |
| 8226 | 8384 | ||
| 8227 | @node Stuck projects, , Search view, Built-in agenda views | 8385 | @node Stuck projects |
| 8228 | @subsection Stuck projects | 8386 | @subsection Stuck projects |
| 8229 | @pindex GTD, Getting Things Done | 8387 | @pindex GTD, Getting Things Done |
| 8230 | 8388 | ||
| @@ -8272,7 +8430,7 @@ correct customization for this is | |||
| 8272 | Note that if a project is identified as non-stuck, the subtree of this entry | 8430 | Note that if a project is identified as non-stuck, the subtree of this entry |
| 8273 | will still be searched for stuck projects. | 8431 | will still be searched for stuck projects. |
| 8274 | 8432 | ||
| 8275 | @node Presentation and sorting, Agenda commands, Built-in agenda views, Agenda Views | 8433 | @node Presentation and sorting |
| 8276 | @section Presentation and sorting | 8434 | @section Presentation and sorting |
| 8277 | @cindex presentation, of agenda items | 8435 | @cindex presentation, of agenda items |
| 8278 | 8436 | ||
| @@ -8294,21 +8452,14 @@ associated with the item. | |||
| 8294 | * Filtering/limiting agenda items:: Dynamically narrow the agenda | 8452 | * Filtering/limiting agenda items:: Dynamically narrow the agenda |
| 8295 | @end menu | 8453 | @end menu |
| 8296 | 8454 | ||
| 8297 | @node Categories, Time-of-day specifications, Presentation and sorting, Presentation and sorting | 8455 | @node Categories |
| 8298 | @subsection Categories | 8456 | @subsection Categories |
| 8299 | 8457 | ||
| 8300 | @cindex category | 8458 | @cindex category |
| 8301 | @cindex #+CATEGORY | 8459 | @cindex #+CATEGORY |
| 8302 | The category is a broad label assigned to each agenda item. By default, | 8460 | The category is a broad label assigned to each agenda item. By default, the |
| 8303 | the category is simply derived from the file name, but you can also | 8461 | category is simply derived from the file name, but you can also specify it |
| 8304 | specify it with a special line in the buffer, like this@footnote{For | 8462 | with a special line in the buffer, like this: |
| 8305 | backward compatibility, the following also works: if there are several | ||
| 8306 | such lines in a file, each specifies the category for the text below it. | ||
| 8307 | The first category also applies to any text before the first CATEGORY | ||
| 8308 | line. However, using this method is @emph{strongly} deprecated as it is | ||
| 8309 | incompatible with the outline structure of the document. The correct | ||
| 8310 | method for setting multiple categories in a buffer is using a | ||
| 8311 | property.}: | ||
| 8312 | 8463 | ||
| 8313 | @example | 8464 | @example |
| 8314 | #+CATEGORY: Thesis | 8465 | #+CATEGORY: Thesis |
| @@ -8328,7 +8479,7 @@ longer than 10 characters. | |||
| 8328 | You can set up icons for category by customizing the | 8479 | You can set up icons for category by customizing the |
| 8329 | @code{org-agenda-category-icon-alist} variable. | 8480 | @code{org-agenda-category-icon-alist} variable. |
| 8330 | 8481 | ||
| 8331 | @node Time-of-day specifications, Sorting agenda items, Categories, Presentation and sorting | 8482 | @node Time-of-day specifications |
| 8332 | @subsection Time-of-day specifications | 8483 | @subsection Time-of-day specifications |
| 8333 | @cindex time-of-day specification | 8484 | @cindex time-of-day specification |
| 8334 | 8485 | ||
| @@ -8379,7 +8530,7 @@ The time grid can be turned on and off with the variable | |||
| 8379 | @code{org-agenda-use-time-grid}, and can be configured with | 8530 | @code{org-agenda-use-time-grid}, and can be configured with |
| 8380 | @code{org-agenda-time-grid}. | 8531 | @code{org-agenda-time-grid}. |
| 8381 | 8532 | ||
| 8382 | @node Sorting agenda items, Filtering/limiting agenda items, Time-of-day specifications, Presentation and sorting | 8533 | @node Sorting agenda items |
| 8383 | @subsection Sorting agenda items | 8534 | @subsection Sorting agenda items |
| 8384 | @cindex sorting, of agenda items | 8535 | @cindex sorting, of agenda items |
| 8385 | @cindex priorities, of agenda items | 8536 | @cindex priorities, of agenda items |
| @@ -8413,14 +8564,14 @@ Sorting can be customized using the variable | |||
| 8413 | @code{org-agenda-sorting-strategy}, and may also include criteria based on | 8564 | @code{org-agenda-sorting-strategy}, and may also include criteria based on |
| 8414 | the estimated effort of an entry (@pxref{Effort estimates}). | 8565 | the estimated effort of an entry (@pxref{Effort estimates}). |
| 8415 | 8566 | ||
| 8416 | @node Filtering/limiting agenda items, , Sorting agenda items, Presentation and sorting | 8567 | @node Filtering/limiting agenda items |
| 8417 | @subsection Filtering/limiting agenda items | 8568 | @subsection Filtering/limiting agenda items |
| 8418 | 8569 | ||
| 8419 | Agenda built-in or customized commands are statically defined. Agenda | 8570 | Agenda built-in or customized commands are statically defined. Agenda |
| 8420 | filters and limits provide two ways of dynamically narrowing down the list of | 8571 | filters and limits provide two ways of dynamically narrowing down the list of |
| 8421 | agenda entries: @emph{fitlers} and @emph{limits}. Filters only act on the | 8572 | agenda entries: @emph{filters} and @emph{limits}. Filters only act on the |
| 8422 | display of the items, while limits take effect before the list of agenda | 8573 | display of the items, while limits take effect before the list of agenda |
| 8423 | entries is built. Filter are more often used interactively, while limits are | 8574 | entries is built. Filters are more often used interactively, while limits are |
| 8424 | mostly useful when defined as local variables within custom agenda commands. | 8575 | mostly useful when defined as local variables within custom agenda commands. |
| 8425 | 8576 | ||
| 8426 | @subsubheading Filtering in the agenda | 8577 | @subsubheading Filtering in the agenda |
| @@ -8444,34 +8595,14 @@ refreshes and more secondary filtering. The filter is a global property of | |||
| 8444 | the entire agenda view---in a block agenda, you should only set this in the | 8595 | the entire agenda view---in a block agenda, you should only set this in the |
| 8445 | global options section, not in the section of an individual block.} | 8596 | global options section, not in the section of an individual block.} |
| 8446 | 8597 | ||
| 8447 | You will be prompted for a tag selection letter; @key{SPC} will mean any tag at | 8598 | You will be prompted for a tag selection letter; @key{SPC} will mean any tag |
| 8448 | all. Pressing @key{TAB} at that prompt will offer use completion to select a | 8599 | at all. Pressing @key{TAB} at that prompt will offer use completion to |
| 8449 | tag (including any tags that do not have a selection character). The command | 8600 | select a tag (including any tags that do not have a selection character). |
| 8450 | then hides all entries that do not contain or inherit this tag. When called | 8601 | The command then hides all entries that do not contain or inherit this tag. |
| 8451 | with prefix arg, remove the entries that @emph{do} have the tag. A second | 8602 | When called with prefix arg, remove the entries that @emph{do} have the tag. |
| 8452 | @kbd{/} at the prompt will turn off the filter and unhide any hidden entries. | 8603 | A second @kbd{/} at the prompt will turn off the filter and unhide any hidden |
| 8453 | If the first key you press is either @kbd{+} or @kbd{-}, the previous filter | 8604 | entries. Pressing @kbd{+} or @kbd{-} switches between filtering and |
| 8454 | will be narrowed by requiring or forbidding the selected additional tag. | 8605 | excluding the next tag. |
| 8455 | Instead of pressing @kbd{+} or @kbd{-} after @kbd{/}, you can also | ||
| 8456 | immediately use the @kbd{\} command. | ||
| 8457 | |||
| 8458 | @vindex org-sort-agenda-noeffort-is-high | ||
| 8459 | In order to filter for effort estimates, you should set up allowed | ||
| 8460 | efforts globally, for example | ||
| 8461 | @lisp | ||
| 8462 | (setq org-global-properties | ||
| 8463 | '(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00"))) | ||
| 8464 | @end lisp | ||
| 8465 | You can then filter for an effort by first typing an operator, one of | ||
| 8466 | @kbd{<}, @kbd{>}, and @kbd{=}, and then the one-digit index of an effort | ||
| 8467 | estimate in your array of allowed values, where @kbd{0} means the 10th value. | ||
| 8468 | The filter will then restrict to entries with effort smaller-or-equal, equal, | ||
| 8469 | or larger-or-equal than the selected value. If the digits 0--9 are not used | ||
| 8470 | as fast access keys to tags, you can also simply press the index digit | ||
| 8471 | directly without an operator. In this case, @kbd{<} will be assumed. For | ||
| 8472 | application of the operator, entries without a defined effort will be treated | ||
| 8473 | according to the value of @code{org-sort-agenda-noeffort-is-high}. To filter | ||
| 8474 | for tasks without effort definition, press @kbd{?} as the operator. | ||
| 8475 | 8606 | ||
| 8476 | Org also supports automatic, context-aware tag filtering. If the variable | 8607 | Org also supports automatic, context-aware tag filtering. If the variable |
| 8477 | @code{org-agenda-auto-exclude-function} is set to a user-defined function, | 8608 | @code{org-agenda-auto-exclude-function} is set to a user-defined function, |
| @@ -8499,12 +8630,6 @@ Internet, and outside of business hours, with something like this: | |||
| 8499 | @end group | 8630 | @end group |
| 8500 | @end smalllisp | 8631 | @end smalllisp |
| 8501 | 8632 | ||
| 8502 | @orgcmd{\\,org-agenda-filter-by-tag-refine} | ||
| 8503 | Narrow the current agenda filter by an additional condition. When called with | ||
| 8504 | prefix arg, remove the entries that @emph{do} have the tag, or that do match | ||
| 8505 | the effort criterion. You can achieve the same effect by pressing @kbd{+} or | ||
| 8506 | @kbd{-} as the first key after the @kbd{/} command. | ||
| 8507 | |||
| 8508 | @c | 8633 | @c |
| 8509 | @kindex [ | 8634 | @kindex [ |
| 8510 | @kindex ] | 8635 | @kindex ] |
| @@ -8525,9 +8650,12 @@ selected. | |||
| 8525 | @vindex org-agenda-category-filter-preset | 8650 | @vindex org-agenda-category-filter-preset |
| 8526 | 8651 | ||
| 8527 | Filter the current agenda view with respect to the category of the item at | 8652 | Filter the current agenda view with respect to the category of the item at |
| 8528 | point. Pressing @code{<} another time will remove this filter. You can add | 8653 | point. Pressing @code{<} another time will remove this filter. When called |
| 8529 | a filter preset through the option @code{org-agenda-category-filter-preset} | 8654 | with a prefix argument exclude the category of the item at point from the |
| 8530 | (see below.) | 8655 | agenda. |
| 8656 | |||
| 8657 | You can add a filter preset in custom agenda commands through the option | ||
| 8658 | @code{org-agenda-category-filter-preset}. @xref{Setting options}. | ||
| 8531 | 8659 | ||
| 8532 | @orgcmd{^,org-agenda-filter-by-top-headline} | 8660 | @orgcmd{^,org-agenda-filter-by-top-headline} |
| 8533 | Filter the current agenda view and only display the siblings and the parent | 8661 | Filter the current agenda view and only display the siblings and the parent |
| @@ -8540,8 +8668,34 @@ Filter the agenda view by a regular expression: only show agenda entries | |||
| 8540 | matching the regular expression the user entered. When called with a prefix | 8668 | matching the regular expression the user entered. When called with a prefix |
| 8541 | argument, it will filter @emph{out} entries matching the regexp. With two | 8669 | argument, it will filter @emph{out} entries matching the regexp. With two |
| 8542 | universal prefix arguments, it will remove all the regexp filters, which can | 8670 | universal prefix arguments, it will remove all the regexp filters, which can |
| 8543 | be accumulated. You can add a filter preset through the option | 8671 | be accumulated. |
| 8544 | @code{org-agenda-category-filter-preset} (see below.) | 8672 | |
| 8673 | You can add a filter preset in custom agenda commands through the option | ||
| 8674 | @code{org-agenda-regexp-filter-preset}. @xref{Setting options}. | ||
| 8675 | |||
| 8676 | @orgcmd{_,org-agenda-filter-by-effort} | ||
| 8677 | @vindex org-agenda-effort-filter-preset | ||
| 8678 | @vindex org-sort-agenda-noeffort-is-high | ||
| 8679 | Filter the agenda view with respect to effort estimates. | ||
| 8680 | You first need to set up allowed efforts globally, for example | ||
| 8681 | @lisp | ||
| 8682 | (setq org-global-properties | ||
| 8683 | '(("Effort_ALL". "0 0:10 0:30 1:00 2:00 3:00 4:00"))) | ||
| 8684 | @end lisp | ||
| 8685 | You can then filter for an effort by first typing an operator, one of | ||
| 8686 | @kbd{<}, @kbd{>}, and @kbd{=}, and then the one-digit index of an effort | ||
| 8687 | estimate in your array of allowed values, where @kbd{0} means the 10th value. | ||
| 8688 | The filter will then restrict to entries with effort smaller-or-equal, equal, | ||
| 8689 | or larger-or-equal than the selected value. For application of the operator, | ||
| 8690 | entries without a defined effort will be treated according to the value of | ||
| 8691 | @code{org-sort-agenda-noeffort-is-high}. | ||
| 8692 | |||
| 8693 | When called with a prefix argument, it will remove entries matching the | ||
| 8694 | condition. With two universal prefix arguments, it will clear effort | ||
| 8695 | filters, which can be accumulated. | ||
| 8696 | |||
| 8697 | You can add a filter preset in custom agenda commands through the option | ||
| 8698 | @code{org-agenda-effort-filter-preset}. @xref{Setting options}. | ||
| 8545 | 8699 | ||
| 8546 | @orgcmd{|,org-agenda-filter-remove-all} | 8700 | @orgcmd{|,org-agenda-filter-remove-all} |
| 8547 | Remove all filters in the current agenda view. | 8701 | Remove all filters in the current agenda view. |
| @@ -8555,9 +8709,9 @@ Remove all filters in the current agenda view. | |||
| 8555 | @vindex org-agenda-max-tags | 8709 | @vindex org-agenda-max-tags |
| 8556 | 8710 | ||
| 8557 | Here is a list of options that you can set, either globally, or locally in | 8711 | Here is a list of options that you can set, either globally, or locally in |
| 8558 | your custom agenda views@pxref{Custom agenda views}. | 8712 | your custom agenda views (@pxref{Custom agenda views}). |
| 8559 | 8713 | ||
| 8560 | @table @var | 8714 | @table @code |
| 8561 | @item org-agenda-max-entries | 8715 | @item org-agenda-max-entries |
| 8562 | Limit the number of entries. | 8716 | Limit the number of entries. |
| 8563 | @item org-agenda-max-effort | 8717 | @item org-agenda-max-effort |
| @@ -8570,7 +8724,7 @@ Limit the number of tagged entries. | |||
| 8570 | 8724 | ||
| 8571 | When set to a positive integer, each option will exclude entries from other | 8725 | When set to a positive integer, each option will exclude entries from other |
| 8572 | categories: for example, @code{(setq org-agenda-max-effort 100)} will limit | 8726 | categories: for example, @code{(setq org-agenda-max-effort 100)} will limit |
| 8573 | the agenda to 100 minutes of effort and exclude any entry that as no effort | 8727 | the agenda to 100 minutes of effort and exclude any entry that has no effort |
| 8574 | property. If you want to include entries with no effort property, use a | 8728 | property. If you want to include entries with no effort property, use a |
| 8575 | negative value for @code{org-agenda-max-effort}. | 8729 | negative value for @code{org-agenda-max-effort}. |
| 8576 | 8730 | ||
| @@ -8588,15 +8742,15 @@ Once you mark one of these five entry as @code{DONE}, rebuilding the agenda | |||
| 8588 | will again the next five entries again, including the first entry that was | 8742 | will again the next five entries again, including the first entry that was |
| 8589 | excluded so far. | 8743 | excluded so far. |
| 8590 | 8744 | ||
| 8591 | You can also dynamically set temporary limits@footnote{Those temporary limits | 8745 | You can also dynamically set temporary limits, which will be lost when |
| 8592 | are lost when rebuilding the agenda.}: | 8746 | rebuilding the agenda: |
| 8593 | 8747 | ||
| 8594 | @table @kbd | 8748 | @table @kbd |
| 8595 | @orgcmd{~,org-agenda-limit-interactively} | 8749 | @orgcmd{~,org-agenda-limit-interactively} |
| 8596 | This prompts for the type of limit to apply and its value. | 8750 | This prompts for the type of limit to apply and its value. |
| 8597 | @end table | 8751 | @end table |
| 8598 | 8752 | ||
| 8599 | @node Agenda commands, Custom agenda views, Presentation and sorting, Agenda Views | 8753 | @node Agenda commands |
| 8600 | @section Commands in the agenda buffer | 8754 | @section Commands in the agenda buffer |
| 8601 | @cindex commands, in agenda buffer | 8755 | @cindex commands, in agenda buffer |
| 8602 | 8756 | ||
| @@ -8617,11 +8771,14 @@ the other commands, the cursor needs to be in the desired line. | |||
| 8617 | Next line (same as @key{down} and @kbd{C-n}). | 8771 | Next line (same as @key{down} and @kbd{C-n}). |
| 8618 | @orgcmd{p,org-agenda-previous-line} | 8772 | @orgcmd{p,org-agenda-previous-line} |
| 8619 | Previous line (same as @key{up} and @kbd{C-p}). | 8773 | Previous line (same as @key{up} and @kbd{C-p}). |
| 8774 | @orgcmd{N,org-agenda-next-item} | ||
| 8775 | Next item: same as next line, but only consider items. | ||
| 8776 | @orgcmd{P,org-agenda-previous-item} | ||
| 8777 | Previous item: same as previous line, but only consider items. | ||
| 8620 | @tsubheading{View/Go to Org file} | 8778 | @tsubheading{View/Go to Org file} |
| 8621 | @orgcmdkkc{@key{SPC},mouse-3,org-agenda-show-and-scroll-up} | 8779 | @orgcmdkkc{@key{SPC},mouse-3,org-agenda-show-and-scroll-up} |
| 8622 | Display the original location of the item in another window. | 8780 | Display the original location of the item in another window. With prefix |
| 8623 | With prefix arg, make sure that the entire entry is made visible in the | 8781 | arg, make sure that drawers stay folded. |
| 8624 | outline, not only the heading. | ||
| 8625 | @c | 8782 | @c |
| 8626 | @orgcmd{L,org-agenda-recenter} | 8783 | @orgcmd{L,org-agenda-recenter} |
| 8627 | Display original location and recenter that window. | 8784 | Display original location and recenter that window. |
| @@ -8719,6 +8876,7 @@ agenda and timeline views. | |||
| 8719 | @c | 8876 | @c |
| 8720 | @orgcmd{v a,org-agenda-archives-mode} | 8877 | @orgcmd{v a,org-agenda-archives-mode} |
| 8721 | @xorgcmd{v A,org-agenda-archives-mode 'files} | 8878 | @xorgcmd{v A,org-agenda-archives-mode 'files} |
| 8879 | @cindex Archives mode | ||
| 8722 | Toggle Archives mode. In Archives mode, trees that are marked | 8880 | Toggle Archives mode. In Archives mode, trees that are marked |
| 8723 | @code{ARCHIVED} are also scanned when producing the agenda. When you use the | 8881 | @code{ARCHIVED} are also scanned when producing the agenda. When you use the |
| 8724 | capital @kbd{A}, even all archive files are included. To exit archives mode, | 8882 | capital @kbd{A}, even all archive files are included. To exit archives mode, |
| @@ -8789,35 +8947,25 @@ file or subtree (@pxref{Agenda files}). | |||
| 8789 | 8947 | ||
| 8790 | @tsubheading{Secondary filtering and query editing} | 8948 | @tsubheading{Secondary filtering and query editing} |
| 8791 | 8949 | ||
| 8792 | For a detailed description of these commands, see @pxref{Filtering/limiting | 8950 | For a detailed description of these commands, @pxref{Filtering/limiting |
| 8793 | agenda items}. | 8951 | agenda items}. |
| 8794 | 8952 | ||
| 8795 | @orgcmd{/,org-agenda-filter-by-tag} | 8953 | @orgcmd{/,org-agenda-filter-by-tag} |
| 8796 | @vindex org-agenda-tag-filter-preset | ||
| 8797 | Filter the agenda view with respect to a tag and/or effort estimates. | 8954 | Filter the agenda view with respect to a tag and/or effort estimates. |
| 8798 | 8955 | ||
| 8799 | @orgcmd{\\,org-agenda-filter-by-tag-refine} | ||
| 8800 | Narrow the current agenda filter by an additional condition. | ||
| 8801 | |||
| 8802 | @orgcmd{<,org-agenda-filter-by-category} | 8956 | @orgcmd{<,org-agenda-filter-by-category} |
| 8803 | @vindex org-agenda-category-filter-preset | ||
| 8804 | |||
| 8805 | Filter the current agenda view with respect to the category of the item at | 8957 | Filter the current agenda view with respect to the category of the item at |
| 8806 | point. Pressing @code{<} another time will remove this filter. | 8958 | point. |
| 8807 | 8959 | ||
| 8808 | @orgcmd{^,org-agenda-filter-by-top-headline} | 8960 | @orgcmd{^,org-agenda-filter-by-top-headline} |
| 8809 | Filter the current agenda view and only display the siblings and the parent | 8961 | Filter the current agenda view and only display the siblings and the parent |
| 8810 | headline of the one at point. | 8962 | headline of the one at point. |
| 8811 | 8963 | ||
| 8812 | @orgcmd{=,org-agenda-filter-by-regexp} | 8964 | @orgcmd{=,org-agenda-filter-by-regexp} |
| 8813 | @vindex org-agenda-regexp-filter-preset | 8965 | Filter the agenda view by a regular expression. |
| 8814 | 8966 | ||
| 8815 | Filter the agenda view by a regular expression: only show agenda entries | 8967 | @orgcmd{_,org-agenda-filter-by-effort} |
| 8816 | matching the regular expression the user entered. When called with a prefix | 8968 | Filter the agenda view with respect to effort estimates. |
| 8817 | argument, it will filter @emph{out} entries matching the regexp. With two | ||
| 8818 | universal prefix arguments, it will remove all the regexp filters, which can | ||
| 8819 | be accumulated. You can add a filter preset through the option | ||
| 8820 | @code{org-agenda-category-filter-preset} (see below.) | ||
| 8821 | 8969 | ||
| 8822 | @orgcmd{|,org-agenda-filter-remove-all} | 8970 | @orgcmd{|,org-agenda-filter-remove-all} |
| 8823 | Remove all filters in the current agenda view. | 8971 | Remove all filters in the current agenda view. |
| @@ -8996,8 +9144,8 @@ Bulk action: act on all marked entries in the agenda. This will prompt for | |||
| 8996 | another key to select the action to be applied. The prefix arg to @kbd{B} | 9144 | another key to select the action to be applied. The prefix arg to @kbd{B} |
| 8997 | will be passed through to the @kbd{s} and @kbd{d} commands, to bulk-remove | 9145 | will be passed through to the @kbd{s} and @kbd{d} commands, to bulk-remove |
| 8998 | these special timestamps. By default, marks are removed after the bulk. If | 9146 | these special timestamps. By default, marks are removed after the bulk. If |
| 8999 | you want them to persist, set @code{org-agenda-bulk-persistent-marks} to | 9147 | you want them to persist, set @code{org-agenda-persistent-marks} to @code{t} |
| 9000 | @code{t} or hit @kbd{p} at the prompt. | 9148 | or hit @kbd{p} at the prompt. |
| 9001 | 9149 | ||
| 9002 | @table @kbd | 9150 | @table @kbd |
| 9003 | @item * | 9151 | @item * |
| @@ -9124,7 +9272,7 @@ visit Org files will not be removed. | |||
| 9124 | @end table | 9272 | @end table |
| 9125 | 9273 | ||
| 9126 | 9274 | ||
| 9127 | @node Custom agenda views, Exporting Agenda Views, Agenda commands, Agenda Views | 9275 | @node Custom agenda views |
| 9128 | @section Custom agenda views | 9276 | @section Custom agenda views |
| 9129 | @cindex custom agenda views | 9277 | @cindex custom agenda views |
| 9130 | @cindex agenda views, custom | 9278 | @cindex agenda views, custom |
| @@ -9137,10 +9285,10 @@ dispatcher (@pxref{Agenda dispatcher}), just like the default commands. | |||
| 9137 | @menu | 9285 | @menu |
| 9138 | * Storing searches:: Type once, use often | 9286 | * Storing searches:: Type once, use often |
| 9139 | * Block agenda:: All the stuff you need in a single buffer | 9287 | * Block agenda:: All the stuff you need in a single buffer |
| 9140 | * Setting Options:: Changing the rules | 9288 | * Setting options:: Changing the rules |
| 9141 | @end menu | 9289 | @end menu |
| 9142 | 9290 | ||
| 9143 | @node Storing searches, Block agenda, Custom agenda views, Custom agenda views | 9291 | @node Storing searches |
| 9144 | @subsection Storing searches | 9292 | @subsection Storing searches |
| 9145 | 9293 | ||
| 9146 | The first application of custom searches is the definition of keyboard | 9294 | The first application of custom searches is the definition of keyboard |
| @@ -9162,7 +9310,7 @@ buffer). | |||
| 9162 | Custom commands are configured in the variable | 9310 | Custom commands are configured in the variable |
| 9163 | @code{org-agenda-custom-commands}. You can customize this variable, for | 9311 | @code{org-agenda-custom-commands}. You can customize this variable, for |
| 9164 | example by pressing @kbd{C-c a C}. You can also directly set it with Emacs | 9312 | example by pressing @kbd{C-c a C}. You can also directly set it with Emacs |
| 9165 | Lisp in @file{.emacs}. The following example contains all valid agenda | 9313 | Lisp in the Emacs init file. The following example contains all valid agenda |
| 9166 | views: | 9314 | views: |
| 9167 | 9315 | ||
| 9168 | @lisp | 9316 | @lisp |
| @@ -9232,7 +9380,7 @@ Peter, or Kim) as additional tag to match. | |||
| 9232 | Note that the @code{*-tree} agenda views need to be called from an | 9380 | Note that the @code{*-tree} agenda views need to be called from an |
| 9233 | Org buffer as they operate on the current buffer only. | 9381 | Org buffer as they operate on the current buffer only. |
| 9234 | 9382 | ||
| 9235 | @node Block agenda, Setting Options, Storing searches, Custom agenda views | 9383 | @node Block agenda |
| 9236 | @subsection Block agenda | 9384 | @subsection Block agenda |
| 9237 | @cindex block agenda | 9385 | @cindex block agenda |
| 9238 | @cindex agenda, with block views | 9386 | @cindex agenda, with block views |
| @@ -9266,7 +9414,7 @@ your agenda for the current week, all TODO items that carry the tag | |||
| 9266 | @samp{home}, and also all lines tagged with @samp{garden}. Finally the | 9414 | @samp{home}, and also all lines tagged with @samp{garden}. Finally the |
| 9267 | command @kbd{C-c a o} provides a similar view for office tasks. | 9415 | command @kbd{C-c a o} provides a similar view for office tasks. |
| 9268 | 9416 | ||
| 9269 | @node Setting Options, , Block agenda, Custom agenda views | 9417 | @node Setting options |
| 9270 | @subsection Setting options for custom commands | 9418 | @subsection Setting options for custom commands |
| 9271 | @cindex options, for custom agenda views | 9419 | @cindex options, for custom agenda views |
| 9272 | 9420 | ||
| @@ -9285,8 +9433,7 @@ right spot in @code{org-agenda-custom-commands}. For example: | |||
| 9285 | ((org-agenda-sorting-strategy '(priority-down)) | 9433 | ((org-agenda-sorting-strategy '(priority-down)) |
| 9286 | (org-agenda-prefix-format " Mixed: "))) | 9434 | (org-agenda-prefix-format " Mixed: "))) |
| 9287 | ("U" tags-tree "+boss-urgent" | 9435 | ("U" tags-tree "+boss-urgent" |
| 9288 | ((org-show-following-heading nil) | 9436 | ((org-show-context-detail 'minimal))) |
| 9289 | (org-show-hierarchy-above nil))) | ||
| 9290 | ("N" search "" | 9437 | ("N" search "" |
| 9291 | ((org-agenda-files '("~org/notes.org")) | 9438 | ((org-agenda-files '("~org/notes.org")) |
| 9292 | (org-agenda-text-search-extra-files nil))))) | 9439 | (org-agenda-text-search-extra-files nil))))) |
| @@ -9340,7 +9487,7 @@ yourself. | |||
| 9340 | @vindex org-agenda-custom-commands-contexts | 9487 | @vindex org-agenda-custom-commands-contexts |
| 9341 | To control whether an agenda command should be accessible from a specific | 9488 | To control whether an agenda command should be accessible from a specific |
| 9342 | context, you can customize @code{org-agenda-custom-commands-contexts}. Let's | 9489 | context, you can customize @code{org-agenda-custom-commands-contexts}. Let's |
| 9343 | say for example that you have an agenda commands @code{"o"} displaying a view | 9490 | say for example that you have an agenda command @code{"o"} displaying a view |
| 9344 | that you only need when reading emails. Then you would configure this option | 9491 | that you only need when reading emails. Then you would configure this option |
| 9345 | like this: | 9492 | like this: |
| 9346 | 9493 | ||
| @@ -9359,8 +9506,8 @@ command key @code{"r"}. In that case, add this command key like this: | |||
| 9359 | 9506 | ||
| 9360 | See the docstring of the variable for more information. | 9507 | See the docstring of the variable for more information. |
| 9361 | 9508 | ||
| 9362 | @node Exporting Agenda Views, Agenda column view, Custom agenda views, Agenda Views | 9509 | @node Exporting agenda views |
| 9363 | @section Exporting Agenda Views | 9510 | @section Exporting agenda views |
| 9364 | @cindex agenda views, exporting | 9511 | @cindex agenda views, exporting |
| 9365 | 9512 | ||
| 9366 | If you are away from your computer, it can be very useful to have a printed | 9513 | If you are away from your computer, it can be very useful to have a printed |
| @@ -9498,7 +9645,7 @@ processing by other programs. See @ref{Extracting agenda information}, for | |||
| 9498 | more information. | 9645 | more information. |
| 9499 | 9646 | ||
| 9500 | 9647 | ||
| 9501 | @node Agenda column view, , Exporting Agenda Views, Agenda Views | 9648 | @node Agenda column view |
| 9502 | @section Using column view in the agenda | 9649 | @section Using column view in the agenda |
| 9503 | @cindex column view, in agenda | 9650 | @cindex column view, in agenda |
| 9504 | @cindex agenda, column view | 9651 | @cindex agenda, column view |
| @@ -9524,11 +9671,12 @@ This causes the following issues: | |||
| 9524 | Org needs to make a decision which @code{COLUMNS} format to use. Since the | 9671 | Org needs to make a decision which @code{COLUMNS} format to use. Since the |
| 9525 | entries in the agenda are collected from different files, and different files | 9672 | entries in the agenda are collected from different files, and different files |
| 9526 | may have different @code{COLUMNS} formats, this is a non-trivial problem. | 9673 | may have different @code{COLUMNS} formats, this is a non-trivial problem. |
| 9527 | Org first checks if the variable @code{org-agenda-overriding-columns-format} is | 9674 | Org first checks if the variable @code{org-agenda-overriding-columns-format} |
| 9528 | currently set, and if so, takes the format from there. Otherwise it takes | 9675 | is currently set, and if so, takes the format from there. Otherwise it takes |
| 9529 | the format associated with the first item in the agenda, or, if that item | 9676 | the format associated with the first item in the agenda, or, if that item |
| 9530 | does not have a specific format (defined in a property, or in its file), it | 9677 | does not have a specific format---defined in a property, or in its file---it |
| 9531 | uses @code{org-columns-default-format}. | 9678 | uses @code{org-columns-default-format}. |
| 9679 | |||
| 9532 | @item | 9680 | @item |
| 9533 | @cindex property, special, CLOCKSUM | 9681 | @cindex property, special, CLOCKSUM |
| 9534 | If any of the columns has a summary type defined (@pxref{Column attributes}), | 9682 | If any of the columns has a summary type defined (@pxref{Column attributes}), |
| @@ -9537,11 +9685,12 @@ make sure that the computations of this property are up to date. This is | |||
| 9537 | also true for the special @code{CLOCKSUM} property. Org will then sum the | 9685 | also true for the special @code{CLOCKSUM} property. Org will then sum the |
| 9538 | values displayed in the agenda. In the daily/weekly agenda, the sums will | 9686 | values displayed in the agenda. In the daily/weekly agenda, the sums will |
| 9539 | cover a single day; in all other views they cover the entire block. It is | 9687 | cover a single day; in all other views they cover the entire block. It is |
| 9540 | vital to realize that the agenda may show the same entry @emph{twice} (for | 9688 | vital to realize that the agenda may show the same entry @emph{twice}---for |
| 9541 | example as scheduled and as a deadline), and it may show two entries from the | 9689 | example as scheduled and as a deadline---and it may show two entries from the |
| 9542 | same hierarchy (for example a @emph{parent} and its @emph{child}). In these | 9690 | same hierarchy---for example a @emph{parent} and its @emph{child}. In these |
| 9543 | cases, the summation in the agenda will lead to incorrect results because | 9691 | cases, the summation in the agenda will lead to incorrect results because |
| 9544 | some values will count double. | 9692 | some values will count double. |
| 9693 | |||
| 9545 | @item | 9694 | @item |
| 9546 | When the column view in the agenda shows the @code{CLOCKSUM}, that is always | 9695 | When the column view in the agenda shows the @code{CLOCKSUM}, that is always |
| 9547 | the entire clocked time for this item. So even in the daily/weekly agenda, | 9696 | the entire clocked time for this item. So even in the daily/weekly agenda, |
| @@ -9555,149 +9704,46 @@ the agenda). | |||
| 9555 | @item | 9704 | @item |
| 9556 | @cindex property, special, CLOCKSUM_T | 9705 | @cindex property, special, CLOCKSUM_T |
| 9557 | When the column view in the agenda shows the @code{CLOCKSUM_T}, that is | 9706 | When the column view in the agenda shows the @code{CLOCKSUM_T}, that is |
| 9558 | always today's clocked time for this item. So even in the weekly agenda, | 9707 | always today's clocked time for this item. So even in the weekly agenda, the |
| 9559 | the clocksum listed in column view only originates from today. This lets | 9708 | clocksum listed in column view only originates from today. This lets you |
| 9560 | you compare the time you spent on a task for today, with the time already | 9709 | compare the time you spent on a task for today, with the time already |
| 9561 | spent (via @code{CLOCKSUM}) and with the planned total effort for it. | 9710 | spent ---via @code{CLOCKSUM}---and with the planned total effort for it. |
| 9562 | @end enumerate | 9711 | @end enumerate |
| 9563 | 9712 | ||
| 9564 | 9713 | ||
| 9565 | @node Markup, Exporting, Agenda Views, Top | 9714 | @node Markup |
| 9566 | @chapter Markup for rich export | 9715 | @chapter Markup for rich export |
| 9567 | 9716 | ||
| 9568 | When exporting Org mode documents, the exporter tries to reflect the | 9717 | When exporting Org mode documents, the exporter tries to reflect the |
| 9569 | structure of the document as accurately as possible in the back-end. Since | 9718 | structure of the document as accurately as possible in the back-end. Since |
| 9570 | export targets like HTML, @LaTeX{} allow much richer formatting, Org mode has | 9719 | export targets like HTML and @LaTeX{} allow much richer formatting, Org mode has |
| 9571 | rules on how to prepare text for rich export. This section summarizes the | 9720 | rules on how to prepare text for rich export. This section summarizes the |
| 9572 | markup rules used in an Org mode buffer. | 9721 | markup rules used in an Org mode buffer. |
| 9573 | 9722 | ||
| 9574 | @menu | 9723 | @menu |
| 9575 | * Structural markup elements:: The basic structure as seen by the exporter | 9724 | * Paragraphs:: The basic unit of text |
| 9725 | * Emphasis and monospace:: Bold, italic, etc. | ||
| 9726 | * Horizontal rules:: Make a line | ||
| 9576 | * Images and tables:: Images, tables and caption mechanism | 9727 | * Images and tables:: Images, tables and caption mechanism |
| 9577 | * Literal examples:: Source code examples with special formatting | 9728 | * Literal examples:: Source code examples with special formatting |
| 9578 | * Include files:: Include additional files into a document | 9729 | * Special symbols:: Greek letters and other symbols |
| 9579 | * Index entries:: Making an index | 9730 | * Subscripts and superscripts:: Simple syntax for raising/lowering text |
| 9580 | * Macro replacement:: Use macros to create templates | ||
| 9581 | * Embedded @LaTeX{}:: LaTeX can be freely used inside Org documents | 9731 | * Embedded @LaTeX{}:: LaTeX can be freely used inside Org documents |
| 9582 | * Special blocks:: Containers targeted at export back-ends | ||
| 9583 | @end menu | ||
| 9584 | |||
| 9585 | @node Structural markup elements, Images and tables, Markup, Markup | ||
| 9586 | @section Structural markup elements | ||
| 9587 | |||
| 9588 | @menu | ||
| 9589 | * Document title:: Where the title is taken from | ||
| 9590 | * Headings and sections:: The document structure as seen by the exporter | ||
| 9591 | * Table of contents:: The if and where of the table of contents | ||
| 9592 | * Lists:: Lists | ||
| 9593 | * Paragraphs:: Paragraphs | ||
| 9594 | * Footnote markup:: Footnotes | ||
| 9595 | * Emphasis and monospace:: Bold, italic, etc. | ||
| 9596 | * Horizontal rules:: Make a line | ||
| 9597 | * Comment lines:: What will *not* be exported | ||
| 9598 | @end menu | 9732 | @end menu |
| 9599 | 9733 | ||
| 9600 | @node Document title, Headings and sections, Structural markup elements, Structural markup elements | 9734 | @node Paragraphs |
| 9601 | @subheading Document title | 9735 | @section Paragraphs, line breaks, and quoting |
| 9602 | @cindex document title, markup rules | ||
| 9603 | |||
| 9604 | @noindent | ||
| 9605 | The title of the exported document is taken from the special line | ||
| 9606 | |||
| 9607 | @cindex #+TITLE | ||
| 9608 | @example | ||
| 9609 | #+TITLE: This is the title of the document | ||
| 9610 | @end example | ||
| 9611 | |||
| 9612 | @noindent | ||
| 9613 | If this line does not exist, the title will be the name of the file | ||
| 9614 | associated to buffer, without extension, or the buffer name. | ||
| 9615 | |||
| 9616 | @cindex property, EXPORT_TITLE | ||
| 9617 | If you are exporting only a subtree, its heading will become the title of the | ||
| 9618 | document. If the subtree has a property @code{EXPORT_TITLE}, that will take | ||
| 9619 | precedence. | ||
| 9620 | |||
| 9621 | @node Headings and sections, Table of contents, Document title, Structural markup elements | ||
| 9622 | @subheading Headings and sections | ||
| 9623 | @cindex headings and sections, markup rules | ||
| 9624 | |||
| 9625 | @vindex org-export-headline-levels | ||
| 9626 | The outline structure of the document as described in @ref{Document | ||
| 9627 | Structure}, forms the basis for defining sections of the exported document. | ||
| 9628 | However, since the outline structure is also used for (for example) lists of | ||
| 9629 | tasks, only the first three outline levels will be used as headings. Deeper | ||
| 9630 | levels will become itemized lists. You can change the location of this | ||
| 9631 | switch globally by setting the variable @code{org-export-headline-levels}, or on a | ||
| 9632 | per-file basis with a line | ||
| 9633 | |||
| 9634 | @cindex #+OPTIONS | ||
| 9635 | @example | ||
| 9636 | #+OPTIONS: H:4 | ||
| 9637 | @end example | ||
| 9638 | |||
| 9639 | @node Table of contents, Lists, Headings and sections, Structural markup elements | ||
| 9640 | @subheading Table of contents | ||
| 9641 | @cindex table of contents, markup rules | ||
| 9642 | |||
| 9643 | @cindex #+TOC | ||
| 9644 | @vindex org-export-with-toc | ||
| 9645 | The table of contents is normally inserted directly before the first headline | ||
| 9646 | of the file. The depth of the table is by default the same as the number of | ||
| 9647 | headline levels, but you can choose a smaller number, or turn off the table | ||
| 9648 | of contents entirely, by configuring the variable @code{org-export-with-toc}, | ||
| 9649 | or on a per-file basis with a line like | ||
| 9650 | |||
| 9651 | @example | ||
| 9652 | #+OPTIONS: toc:2 (only to two levels in TOC) | ||
| 9653 | #+OPTIONS: toc:nil (no default TOC at all) | ||
| 9654 | @end example | ||
| 9655 | |||
| 9656 | If you would like to move the table of contents to a different location, you | ||
| 9657 | should turn off the default table using @code{org-export-with-toc} or | ||
| 9658 | @code{#+OPTIONS} and insert @code{#+TOC: headlines N} at the desired | ||
| 9659 | location(s). | ||
| 9660 | |||
| 9661 | @example | ||
| 9662 | #+OPTIONS: toc:nil (no default TOC) | ||
| 9663 | ... | ||
| 9664 | #+TOC: headlines 2 (insert TOC here, with two headline levels) | ||
| 9665 | @end example | ||
| 9666 | |||
| 9667 | Multiple @code{#+TOC: headline} lines are allowed. The same @code{TOC} | ||
| 9668 | keyword can also generate a list of all tables (resp.@: all listings) with a | ||
| 9669 | caption in the buffer. | ||
| 9670 | |||
| 9671 | @example | ||
| 9672 | #+TOC: listings (build a list of listings) | ||
| 9673 | #+TOC: tables (build a list of tables) | ||
| 9674 | @end example | ||
| 9675 | |||
| 9676 | @cindex property, ALT_TITLE | ||
| 9677 | The headline's title usually determines its corresponding entry in a table of | ||
| 9678 | contents. However, it is possible to specify an alternative title by | ||
| 9679 | setting @code{ALT_TITLE} property accordingly. It will then be used when | ||
| 9680 | building the table. | ||
| 9681 | |||
| 9682 | @node Lists, Paragraphs, Table of contents, Structural markup elements | ||
| 9683 | @subheading Lists | ||
| 9684 | @cindex lists, markup rules | ||
| 9685 | |||
| 9686 | Plain lists as described in @ref{Plain lists}, are translated to the back-end's | ||
| 9687 | syntax for such lists. Most back-ends support unordered, ordered, and | ||
| 9688 | description lists. | ||
| 9689 | |||
| 9690 | @node Paragraphs, Footnote markup, Lists, Structural markup elements | ||
| 9691 | @subheading Paragraphs, line breaks, and quoting | ||
| 9692 | @cindex paragraphs, markup rules | 9736 | @cindex paragraphs, markup rules |
| 9693 | 9737 | ||
| 9694 | Paragraphs are separated by at least one empty line. If you need to enforce | 9738 | Paragraphs are separated by at least one empty line. If you need to enforce |
| 9695 | a line break within a paragraph, use @samp{\\} at the end of a line. | 9739 | a line break within a paragraph, use @samp{\\} at the end of a line. |
| 9696 | 9740 | ||
| 9697 | To keep the line breaks in a region, but otherwise use normal formatting, you | 9741 | To preserve the line breaks, indentation and blank lines in a region, but |
| 9698 | can use this construct, which can also be used to format poetry. | 9742 | otherwise use normal formatting, you can use this construct, which can also |
| 9743 | be used to format poetry. | ||
| 9699 | 9744 | ||
| 9700 | @cindex #+BEGIN_VERSE | 9745 | @cindex #+BEGIN_VERSE |
| 9746 | @cindex verse blocks | ||
| 9701 | @example | 9747 | @example |
| 9702 | #+BEGIN_VERSE | 9748 | #+BEGIN_VERSE |
| 9703 | Great clouds overhead | 9749 | Great clouds overhead |
| @@ -9713,6 +9759,7 @@ as a paragraph that is indented on both the left and the right margin. You | |||
| 9713 | can include quotations in Org mode documents like this: | 9759 | can include quotations in Org mode documents like this: |
| 9714 | 9760 | ||
| 9715 | @cindex #+BEGIN_QUOTE | 9761 | @cindex #+BEGIN_QUOTE |
| 9762 | @cindex quote blocks | ||
| 9716 | @example | 9763 | @example |
| 9717 | #+BEGIN_QUOTE | 9764 | #+BEGIN_QUOTE |
| 9718 | Everything should be made as simple as possible, | 9765 | Everything should be made as simple as possible, |
| @@ -9722,6 +9769,7 @@ but not any simpler -- Albert Einstein | |||
| 9722 | 9769 | ||
| 9723 | If you would like to center some text, do it like this: | 9770 | If you would like to center some text, do it like this: |
| 9724 | @cindex #+BEGIN_CENTER | 9771 | @cindex #+BEGIN_CENTER |
| 9772 | @cindex center blocks | ||
| 9725 | @example | 9773 | @example |
| 9726 | #+BEGIN_CENTER | 9774 | #+BEGIN_CENTER |
| 9727 | Everything should be made as simple as possible, \\ | 9775 | Everything should be made as simple as possible, \\ |
| @@ -9729,18 +9777,8 @@ but not any simpler | |||
| 9729 | #+END_CENTER | 9777 | #+END_CENTER |
| 9730 | @end example | 9778 | @end example |
| 9731 | 9779 | ||
| 9732 | 9780 | @node Emphasis and monospace | |
| 9733 | @node Footnote markup, Emphasis and monospace, Paragraphs, Structural markup elements | 9781 | @section Emphasis and monospace |
| 9734 | @subheading Footnote markup | ||
| 9735 | @cindex footnotes, markup rules | ||
| 9736 | @cindex @file{footnote.el} | ||
| 9737 | |||
| 9738 | Footnotes defined in the way described in @ref{Footnotes}, will be exported | ||
| 9739 | by all back-ends. Org allows multiple references to the same note, and | ||
| 9740 | multiple footnotes side by side. | ||
| 9741 | |||
| 9742 | @node Emphasis and monospace, Horizontal rules, Footnote markup, Structural markup elements | ||
| 9743 | @subheading Emphasis and monospace | ||
| 9744 | 9782 | ||
| 9745 | @cindex underlined text, markup rules | 9783 | @cindex underlined text, markup rules |
| 9746 | @cindex bold text, markup rules | 9784 | @cindex bold text, markup rules |
| @@ -9764,32 +9802,13 @@ can tweak @code{org-emphasis-regexp-components}. Beware that changing one of | |||
| 9764 | the above variables will no take effect until you reload Org, for which you | 9802 | the above variables will no take effect until you reload Org, for which you |
| 9765 | may need to restart Emacs. | 9803 | may need to restart Emacs. |
| 9766 | 9804 | ||
| 9767 | @node Horizontal rules, Comment lines, Emphasis and monospace, Structural markup elements | 9805 | @node Horizontal rules |
| 9768 | @subheading Horizontal rules | 9806 | @section Horizontal rules |
| 9769 | @cindex horizontal rules, markup rules | 9807 | @cindex horizontal rules, markup rules |
| 9770 | A line consisting of only dashes, and at least 5 of them, will be exported as | 9808 | A line consisting of only dashes, and at least 5 of them, will be exported as |
| 9771 | a horizontal line. | 9809 | a horizontal line. |
| 9772 | 9810 | ||
| 9773 | @node Comment lines, , Horizontal rules, Structural markup elements | 9811 | @node Images and tables |
| 9774 | @subheading Comment lines | ||
| 9775 | @cindex comment lines | ||
| 9776 | @cindex exporting, not | ||
| 9777 | @cindex #+BEGIN_COMMENT | ||
| 9778 | |||
| 9779 | Lines starting with zero or more whitespace characters followed by one | ||
| 9780 | @samp{#} and a whitespace are treated as comments and will never be exported. | ||
| 9781 | Also entire subtrees starting with the word @samp{COMMENT} will never be | ||
| 9782 | exported. Finally, regions surrounded by @samp{#+BEGIN_COMMENT} | ||
| 9783 | ... @samp{#+END_COMMENT} will not be exported. | ||
| 9784 | |||
| 9785 | @table @kbd | ||
| 9786 | @kindex C-c ; | ||
| 9787 | @item C-c ; | ||
| 9788 | Toggle the COMMENT keyword at the beginning of an entry. | ||
| 9789 | @end table | ||
| 9790 | |||
| 9791 | |||
| 9792 | @node Images and tables, Literal examples, Structural markup elements, Markup | ||
| 9793 | @section Images and Tables | 9812 | @section Images and Tables |
| 9794 | 9813 | ||
| 9795 | @cindex tables, markup rules | 9814 | @cindex tables, markup rules |
| @@ -9837,7 +9856,7 @@ the same caption mechanism can apply to many others (e.g., @LaTeX{} | |||
| 9837 | equations, source code blocks). Depending on the export back-end, those may | 9856 | equations, source code blocks). Depending on the export back-end, those may |
| 9838 | or may not be handled. | 9857 | or may not be handled. |
| 9839 | 9858 | ||
| 9840 | @node Literal examples, Include files, Images and tables, Markup | 9859 | @node Literal examples |
| 9841 | @section Literal examples | 9860 | @section Literal examples |
| 9842 | @cindex literal examples, markup rules | 9861 | @cindex literal examples, markup rules |
| 9843 | @cindex code line references, markup rules | 9862 | @cindex code line references, markup rules |
| @@ -9865,20 +9884,25 @@ Here is an example | |||
| 9865 | @end example | 9884 | @end example |
| 9866 | 9885 | ||
| 9867 | @cindex formatting source code, markup rules | 9886 | @cindex formatting source code, markup rules |
| 9887 | @vindex org-latex-listings | ||
| 9868 | If the example is source code from a programming language, or any other text | 9888 | If the example is source code from a programming language, or any other text |
| 9869 | that can be marked up by font-lock in Emacs, you can ask for the example to | 9889 | that can be marked up by font-lock in Emacs, you can ask for the example to |
| 9870 | look like the fontified Emacs buffer@footnote{This works automatically for | 9890 | look like the fontified Emacs buffer@footnote{This works automatically for |
| 9871 | the HTML back-end (it requires version 1.34 of the @file{htmlize.el} package, | 9891 | the HTML back-end (it requires version 1.34 of the @file{htmlize.el} package, |
| 9872 | which is distributed with Org). Fontified code chunks in @LaTeX{} can be | 9892 | which is distributed with Org). Fontified code chunks in @LaTeX{} can be |
| 9873 | achieved using either the listings or the | 9893 | achieved using either the |
| 9874 | @url{http://code.google.com/p/minted, minted,} package. Refer to | 9894 | @url{https://www.ctan.org/tex-archive/macros/latex/contrib/listings/?lang=en, listings,} |
| 9875 | @code{org-latex-listings} documentation for details.}. This is done | 9895 | or the |
| 9876 | with the @samp{src} block, where you also need to specify the name of the | 9896 | @url{https://github.com/gpoore/minted, minted,} package. |
| 9877 | major mode that should be used to fontify the example@footnote{Code in | 9897 | If you use minted or listing, you must load the packages manually, for |
| 9878 | @samp{src} blocks may also be evaluated either interactively or on export. | 9898 | example by adding the desired package to |
| 9879 | See @pxref{Working With Source Code} for more information on evaluating code | 9899 | @code{org-latex-packages-alist}. Refer to @code{org-latex-listings} |
| 9880 | blocks.}, see @ref{Easy Templates} for shortcuts to easily insert code | 9900 | for details.}. This is done with the @samp{src} block, where you also need |
| 9881 | blocks. | 9901 | to specify the name of the major mode that should be used to fontify the |
| 9902 | example@footnote{Code in @samp{src} blocks may also be evaluated either | ||
| 9903 | interactively or on export. @xref{Working with source code}, for more | ||
| 9904 | information on evaluating code blocks.}, see @ref{Easy templates} for | ||
| 9905 | shortcuts to easily insert code blocks. | ||
| 9882 | @cindex #+BEGIN_SRC | 9906 | @cindex #+BEGIN_SRC |
| 9883 | 9907 | ||
| 9884 | @example | 9908 | @example |
| @@ -9891,13 +9915,29 @@ blocks. | |||
| 9891 | 9915 | ||
| 9892 | Both in @code{example} and in @code{src} snippets, you can add a @code{-n} | 9916 | Both in @code{example} and in @code{src} snippets, you can add a @code{-n} |
| 9893 | switch to the end of the @code{BEGIN} line, to get the lines of the example | 9917 | switch to the end of the @code{BEGIN} line, to get the lines of the example |
| 9894 | numbered. If you use a @code{+n} switch, the numbering from the previous | 9918 | numbered. The @code{-n} takes an optional numeric argument specifying the |
| 9895 | numbered snippet will be continued in the current one. In literal examples, | 9919 | starting line number of the block. If you use a @code{+n} switch, the |
| 9896 | Org will interpret strings like @samp{(ref:name)} as labels, and use them as | 9920 | numbering from the previous numbered snippet will be continued in the current |
| 9897 | targets for special hyperlinks like @code{[[(name)]]} (i.e., the reference name | 9921 | one. The @code{+n} can also take a numeric argument. The value of the |
| 9898 | enclosed in single parenthesis). In HTML, hovering the mouse over such a | 9922 | argument will be added to the last line of the previous block to determine |
| 9899 | link will remote-highlight the corresponding code line, which is kind of | 9923 | the starting line number. |
| 9900 | cool. | 9924 | |
| 9925 | @example | ||
| 9926 | #+BEGIN_SRC emacs-lisp -n 20 | ||
| 9927 | ;; this will export with line number 20 | ||
| 9928 | (message "This is line 21") | ||
| 9929 | #+END_SRC | ||
| 9930 | #+BEGIN_SRC emacs-lisp +n 10 | ||
| 9931 | ;; This will be listed as line 31 | ||
| 9932 | (message "This is line 32") | ||
| 9933 | #+END_SRC | ||
| 9934 | @end example | ||
| 9935 | |||
| 9936 | In literal examples, Org will interpret strings like @samp{(ref:name)} as | ||
| 9937 | labels, and use them as targets for special hyperlinks like @code{[[(name)]]} | ||
| 9938 | (i.e., the reference name enclosed in single parenthesis). In HTML, hovering | ||
| 9939 | the mouse over such a link will remote-highlight the corresponding code line, | ||
| 9940 | which is kind of cool. | ||
| 9901 | 9941 | ||
| 9902 | You can also add a @code{-r} switch which @i{removes} the labels from the | 9942 | You can also add a @code{-r} switch which @i{removes} the labels from the |
| 9903 | source code@footnote{Adding @code{-k} to @code{-n -r} will @i{keep} the | 9943 | source code@footnote{Adding @code{-k} to @code{-n -r} will @i{keep} the |
| @@ -9916,6 +9956,10 @@ In line [[(sc)]] we remember the current position. [[(jump)][Line (jump)]] | |||
| 9916 | jumps to point-min. | 9956 | jumps to point-min. |
| 9917 | @end example | 9957 | @end example |
| 9918 | 9958 | ||
| 9959 | @cindex indentation, in source blocks | ||
| 9960 | Finally, you can use @code{-i} to preserve the indentation of a specific code | ||
| 9961 | block (@pxref{Editing source code}). | ||
| 9962 | |||
| 9919 | @vindex org-coderef-label-format | 9963 | @vindex org-coderef-label-format |
| 9920 | If the syntax for the label format conflicts with the language syntax, use a | 9964 | If the syntax for the label format conflicts with the language syntax, use a |
| 9921 | @code{-l} switch to change the format, for example @samp{#+BEGIN_SRC pascal | 9965 | @code{-l} switch to change the format, for example @samp{#+BEGIN_SRC pascal |
| @@ -9925,8 +9969,8 @@ HTML export also allows examples to be published as text areas (@pxref{Text | |||
| 9925 | areas in HTML export}). | 9969 | areas in HTML export}). |
| 9926 | 9970 | ||
| 9927 | Because the @code{#+BEGIN_...} and @code{#+END_...} patterns need to be added | 9971 | Because the @code{#+BEGIN_...} and @code{#+END_...} patterns need to be added |
| 9928 | so often, shortcuts are provided using the Easy Templates facility | 9972 | so often, shortcuts are provided using the Easy templates facility |
| 9929 | (@pxref{Easy Templates}). | 9973 | (@pxref{Easy templates}). |
| 9930 | 9974 | ||
| 9931 | @table @kbd | 9975 | @table @kbd |
| 9932 | @kindex C-c ' | 9976 | @kindex C-c ' |
| @@ -9952,157 +9996,44 @@ formatting like @samp{(ref:label)} at the end of the current line. Then the | |||
| 9952 | label is stored as a link @samp{(label)}, for retrieval with @kbd{C-c C-l}. | 9996 | label is stored as a link @samp{(label)}, for retrieval with @kbd{C-c C-l}. |
| 9953 | @end table | 9997 | @end table |
| 9954 | 9998 | ||
| 9955 | 9999 | @node Special symbols | |
| 9956 | @node Include files, Index entries, Literal examples, Markup | 10000 | @section Special symbols |
| 9957 | @section Include files | 10001 | @cindex Org entities |
| 9958 | @cindex include files, markup rules | ||
| 9959 | |||
| 9960 | During export, you can include the content of another file. For example, to | ||
| 9961 | include your @file{.emacs} file, you could use: | ||
| 9962 | @cindex #+INCLUDE | ||
| 9963 | |||
| 9964 | @example | ||
| 9965 | #+INCLUDE: "~/.emacs" src emacs-lisp | ||
| 9966 | @end example | ||
| 9967 | |||
| 9968 | @noindent | ||
| 9969 | The optional second and third parameter are the markup (i.e., @samp{example} | ||
| 9970 | or @samp{src}), and, if the markup is @samp{src}, the language for formatting | ||
| 9971 | the contents. The markup is optional; if it is not given, the text will be | ||
| 9972 | assumed to be in Org mode format and will be processed normally. | ||
| 9973 | |||
| 9974 | Contents of the included file will belong to the same structure (headline, | ||
| 9975 | item) containing the @code{INCLUDE} keyword. In particular, headlines within | ||
| 9976 | the file will become children of the current section. That behavior can be | ||
| 9977 | changed by providing an additional keyword parameter, @code{:minlevel}. In | ||
| 9978 | that case, all headlines in the included file will be shifted so the one with | ||
| 9979 | the lowest level reaches that specified level. For example, to make a file | ||
| 9980 | become a sibling of the current top-level headline, use | ||
| 9981 | |||
| 9982 | @example | ||
| 9983 | #+INCLUDE: "~/my-book/chapter2.org" :minlevel 1 | ||
| 9984 | @end example | ||
| 9985 | |||
| 9986 | You can also include a portion of a file by specifying a lines range using | ||
| 9987 | the @code{:lines} parameter. The line at the upper end of the range will not | ||
| 9988 | be included. The start and/or the end of the range may be omitted to use the | ||
| 9989 | obvious defaults. | ||
| 9990 | |||
| 9991 | @example | ||
| 9992 | #+INCLUDE: "~/.emacs" :lines "5-10" @r{Include lines 5 to 10, 10 excluded} | ||
| 9993 | #+INCLUDE: "~/.emacs" :lines "-10" @r{Include lines 1 to 10, 10 excluded} | ||
| 9994 | #+INCLUDE: "~/.emacs" :lines "10-" @r{Include lines from 10 to EOF} | ||
| 9995 | @end example | ||
| 9996 | |||
| 9997 | @table @kbd | ||
| 9998 | @kindex C-c ' | ||
| 9999 | @item C-c ' | ||
| 10000 | Visit the include file at point. | ||
| 10001 | @end table | ||
| 10002 | |||
| 10003 | @node Index entries, Macro replacement, Include files, Markup | ||
| 10004 | @section Index entries | ||
| 10005 | @cindex index entries, for publishing | ||
| 10006 | |||
| 10007 | You can specify entries that will be used for generating an index during | ||
| 10008 | publishing. This is done by lines starting with @code{#+INDEX}. An entry | ||
| 10009 | the contains an exclamation mark will create a sub item. See @ref{Generating | ||
| 10010 | an index} for more information. | ||
| 10011 | |||
| 10012 | @example | ||
| 10013 | * Curriculum Vitae | ||
| 10014 | #+INDEX: CV | ||
| 10015 | #+INDEX: Application!CV | ||
| 10016 | @end example | ||
| 10017 | |||
| 10018 | |||
| 10019 | |||
| 10020 | |||
| 10021 | @node Macro replacement, Embedded @LaTeX{}, Index entries, Markup | ||
| 10022 | @section Macro replacement | ||
| 10023 | @cindex macro replacement, during export | ||
| 10024 | @cindex #+MACRO | ||
| 10025 | |||
| 10026 | You can define text snippets with | ||
| 10027 | |||
| 10028 | @example | ||
| 10029 | #+MACRO: name replacement text $1, $2 are arguments | ||
| 10030 | @end example | ||
| 10031 | |||
| 10032 | @noindent which can be referenced in | ||
| 10033 | paragraphs, verse blocks, table cells and some keywords with | ||
| 10034 | @code{@{@{@{name(arg1,arg2)@}@}@}}@footnote{Since commas separate arguments, | ||
| 10035 | commas within arguments have to be escaped with a backslash character. | ||
| 10036 | Conversely, backslash characters before a comma, and only them, need to be | ||
| 10037 | escaped with another backslash character.}. In addition to defined macros, | ||
| 10038 | @code{@{@{@{title@}@}@}}, @code{@{@{@{author@}@}@}}, etc., will reference | ||
| 10039 | information set by the @code{#+TITLE:}, @code{#+AUTHOR:}, and similar lines. | ||
| 10040 | Also, @code{@{@{@{time(@var{FORMAT})@}@}@}} and | ||
| 10041 | @code{@{@{@{modification-time(@var{FORMAT})@}@}@}} refer to current date time | ||
| 10042 | and to the modification time of the file being exported, respectively. | ||
| 10043 | @var{FORMAT} should be a format string understood by | ||
| 10044 | @code{format-time-string}. | ||
| 10045 | |||
| 10046 | Macro expansion takes place during export. | ||
| 10047 | |||
| 10048 | |||
| 10049 | @node Embedded @LaTeX{}, Special blocks, Macro replacement, Markup | ||
| 10050 | @section Embedded @LaTeX{} | ||
| 10051 | @cindex @TeX{} interpretation | ||
| 10052 | @cindex @LaTeX{} interpretation | ||
| 10053 | |||
| 10054 | Plain ASCII is normally sufficient for almost all note taking. Exceptions | ||
| 10055 | include scientific notes, which often require mathematical symbols and the | ||
| 10056 | occasional formula. @LaTeX{}@footnote{@LaTeX{} is a macro system based on | ||
| 10057 | Donald E. Knuth's @TeX{} system. Many of the features described here as | ||
| 10058 | ``@LaTeX{}'' are really from @TeX{}, but for simplicity I am blurring this | ||
| 10059 | distinction.} is widely used to typeset scientific documents. Org mode | ||
| 10060 | supports embedding @LaTeX{} code into its files, because many academics are | ||
| 10061 | used to writing and reading @LaTeX{} source code, and because it can be | ||
| 10062 | readily processed to produce pretty output for a number of export back-ends. | ||
| 10063 | |||
| 10064 | @menu | ||
| 10065 | * Special symbols:: Greek letters and other symbols | ||
| 10066 | * Subscripts and superscripts:: Simple syntax for raising/lowering text | ||
| 10067 | * @LaTeX{} fragments:: Complex formulas made easy | ||
| 10068 | * Previewing @LaTeX{} fragments:: What will this snippet look like? | ||
| 10069 | * CDLaTeX mode:: Speed up entering of formulas | ||
| 10070 | @end menu | ||
| 10071 | |||
| 10072 | @node Special symbols, Subscripts and superscripts, Embedded @LaTeX{}, Embedded @LaTeX{} | ||
| 10073 | @subsection Special symbols | ||
| 10074 | @cindex math symbols | 10002 | @cindex math symbols |
| 10075 | @cindex special symbols | 10003 | @cindex special symbols |
| 10076 | @cindex @TeX{} macros | ||
| 10077 | @cindex @LaTeX{} fragments, markup rules | ||
| 10078 | @cindex HTML entities | 10004 | @cindex HTML entities |
| 10079 | @cindex @LaTeX{} entities | 10005 | @cindex @LaTeX{} entities |
| 10080 | 10006 | ||
| 10081 | You can use @LaTeX{}-like syntax to insert special symbols like @samp{\alpha} | 10007 | You can use @LaTeX{}-like syntax to insert special symbols---named |
| 10082 | to indicate the Greek letter, or @samp{\to} to indicate an arrow. Completion | 10008 | entities---like @samp{\alpha} to indicate the Greek letter, or @samp{\to} to |
| 10083 | for these symbols is available, just type @samp{\} and maybe a few letters, | 10009 | indicate an arrow. Completion for these symbols is available, just type |
| 10084 | and press @kbd{M-@key{TAB}} to see possible completions. Unlike @LaTeX{} | 10010 | @samp{\} and maybe a few letters, and press @kbd{M-@key{TAB}} to see possible |
| 10085 | code, Org mode allows these symbols to be present without surrounding math | 10011 | completions. If you need such a symbol inside a word, terminate it with |
| 10086 | delimiters, for example: | 10012 | a pair of curly brackets. For example |
| 10087 | 10013 | ||
| 10088 | @example | 10014 | @example |
| 10089 | Angles are written as Greek letters \alpha, \beta and \gamma. | 10015 | Protip: Given a circle \Gamma of diameter d, the length of its circumference |
| 10016 | is \pi@{@}d. | ||
| 10090 | @end example | 10017 | @end example |
| 10091 | 10018 | ||
| 10092 | @vindex org-entities | 10019 | @findex org-entities-help |
| 10093 | During export, these symbols will be transformed into the native format of | 10020 | @vindex org-entities-user |
| 10094 | the exporter back-end. Strings like @code{\alpha} will be exported as | ||
| 10095 | @code{α} in the HTML output, and as @code{$\alpha$} in the @LaTeX{} | ||
| 10096 | output. Similarly, @code{\nbsp} will become @code{ } in HTML and | ||
| 10097 | @code{~} in @LaTeX{}. If you need such a symbol inside a word, terminate it | ||
| 10098 | like this: @samp{\Aacute@{@}stor}. | ||
| 10099 | |||
| 10100 | A large number of entities is provided, with names taken from both HTML and | 10021 | A large number of entities is provided, with names taken from both HTML and |
| 10101 | @LaTeX{}; see the variable @code{org-entities} for the complete list. | 10022 | @LaTeX{}; you can comfortably browse the complete list from a dedicated |
| 10102 | @samp{\-} is treated as a shy hyphen, and @samp{--}, @samp{---}, and | 10023 | buffer using the command @code{org-entities-help}. It is also possible to |
| 10103 | @samp{...} are all converted into special commands creating hyphens of | 10024 | provide your own special symbols in the variable @code{org-entities-user}. |
| 10104 | different lengths or a compact set of dots. | 10025 | |
| 10026 | During export, these symbols are transformed into the native format of the | ||
| 10027 | exporter back-end. Strings like @code{\alpha} are exported as @code{α} | ||
| 10028 | in the HTML output, and as @code{\(\alpha\)} in the @LaTeX{} output. | ||
| 10029 | Similarly, @code{\nbsp} becomes @code{ } in HTML and @code{~} in | ||
| 10030 | @LaTeX{}. | ||
| 10031 | |||
| 10032 | @cindex escaping characters | ||
| 10033 | Entities may also be used as a may to escape markup in an Org document, e.g., | ||
| 10034 | @samp{\under@{@}not underlined\under} exports as @samp{_not underlined_}. | ||
| 10105 | 10035 | ||
| 10036 | @cindex special symbols, in-buffer display | ||
| 10106 | If you would like to see entities displayed as UTF-8 characters, use the | 10037 | If you would like to see entities displayed as UTF-8 characters, use the |
| 10107 | following command@footnote{You can turn this on by default by setting the | 10038 | following command@footnote{You can turn this on by default by setting the |
| 10108 | variable @code{org-pretty-entities}, or on a per-file base with the | 10039 | variable @code{org-pretty-entities}, or on a per-file base with the |
| @@ -10117,20 +10048,28 @@ buffer content which remains plain ASCII, but it overlays the UTF-8 character | |||
| 10117 | for display purposes only. | 10048 | for display purposes only. |
| 10118 | @end table | 10049 | @end table |
| 10119 | 10050 | ||
| 10120 | @node Subscripts and superscripts, @LaTeX{} fragments, Special symbols, Embedded @LaTeX{} | 10051 | @cindex shy hyphen, special symbol |
| 10121 | @subsection Subscripts and superscripts | 10052 | @cindex dash, special symbol |
| 10053 | @cindex ellipsis, special symbol | ||
| 10054 | In addition to regular entities defined above, Org exports in a special | ||
| 10055 | way@footnote{This behaviour can be disabled with @code{-} export setting | ||
| 10056 | (@pxref{Export settings}).} the following commonly used character | ||
| 10057 | combinations: @samp{\-} is treated as a shy hyphen, @samp{--} and @samp{---} | ||
| 10058 | are converted into dashes, and @samp{...} becomes a compact set of dots. | ||
| 10059 | |||
| 10060 | @node Subscripts and superscripts | ||
| 10061 | @section Subscripts and superscripts | ||
| 10122 | @cindex subscript | 10062 | @cindex subscript |
| 10123 | @cindex superscript | 10063 | @cindex superscript |
| 10124 | 10064 | ||
| 10125 | Just like in @LaTeX{}, @samp{^} and @samp{_} are used to indicate super- and | 10065 | @samp{^} and @samp{_} are used to indicate super- and subscripts. To |
| 10126 | subscripts. Again, these can be used without embedding them in math-mode | 10066 | increase the readability of ASCII text, it is not necessary---but OK---to |
| 10127 | delimiters. To increase the readability of ASCII text, it is not necessary | 10067 | surround multi-character sub- and superscripts with curly braces. Those are, |
| 10128 | (but OK) to surround multi-character sub- and superscripts with curly braces. | 10068 | however, mandatory, when more than one word is involved. For example |
| 10129 | For example | ||
| 10130 | 10069 | ||
| 10131 | @example | 10070 | @example |
| 10132 | The mass of the sun is M_sun = 1.989 x 10^30 kg. The radius of | 10071 | The radius of the sun is R_sun = 6.96 x 10^8 m. On the other hand, the |
| 10133 | the sun is R_@{sun@} = 6.96 x 10^8 m. | 10072 | radius of Alpha Centauri is R_@{Alpha Centauri@} = 1.28 x R_@{sun@}. |
| 10134 | @end example | 10073 | @end example |
| 10135 | 10074 | ||
| 10136 | @vindex org-use-sub-superscripts | 10075 | @vindex org-use-sub-superscripts |
| @@ -10147,46 +10086,58 @@ In addition to showing entities as UTF-8 characters, this command will also | |||
| 10147 | format sub- and superscripts in a WYSIWYM way. | 10086 | format sub- and superscripts in a WYSIWYM way. |
| 10148 | @end table | 10087 | @end table |
| 10149 | 10088 | ||
| 10150 | @node @LaTeX{} fragments, Previewing @LaTeX{} fragments, Subscripts and superscripts, Embedded @LaTeX{} | 10089 | @node Embedded @LaTeX{} |
| 10090 | @section Embedded @LaTeX{} | ||
| 10091 | @cindex @TeX{} interpretation | ||
| 10092 | @cindex @LaTeX{} interpretation | ||
| 10093 | |||
| 10094 | Plain ASCII is normally sufficient for almost all note taking. Exceptions | ||
| 10095 | include scientific notes, which often require mathematical symbols and the | ||
| 10096 | occasional formula. @LaTeX{}@footnote{@LaTeX{} is a macro system based on | ||
| 10097 | Donald E. Knuth's @TeX{} system. Many of the features described here as | ||
| 10098 | ``@LaTeX{}'' are really from @TeX{}, but for simplicity I am blurring this | ||
| 10099 | distinction.} is widely used to typeset scientific documents. Org mode | ||
| 10100 | supports embedding @LaTeX{} code into its files, because many academics are | ||
| 10101 | used to writing and reading @LaTeX{} source code, and because it can be | ||
| 10102 | readily processed to produce pretty output for a number of export back-ends. | ||
| 10103 | |||
| 10104 | @menu | ||
| 10105 | * @LaTeX{} fragments:: Complex formulas made easy | ||
| 10106 | * Previewing @LaTeX{} fragments:: What will this snippet look like? | ||
| 10107 | * CDLaTeX mode:: Speed up entering of formulas | ||
| 10108 | @end menu | ||
| 10109 | |||
| 10110 | @node @LaTeX{} fragments | ||
| 10151 | @subsection @LaTeX{} fragments | 10111 | @subsection @LaTeX{} fragments |
| 10152 | @cindex @LaTeX{} fragments | 10112 | @cindex @LaTeX{} fragments |
| 10153 | 10113 | ||
| 10154 | @vindex org-format-latex-header | 10114 | @vindex org-format-latex-header |
| 10155 | Going beyond symbols and sub- and superscripts, a full formula language is | 10115 | Org mode can contain @LaTeX{} math fragments, and it supports ways to process |
| 10156 | needed. Org mode can contain @LaTeX{} math fragments, and it supports ways | 10116 | these for several export back-ends. When exporting to @LaTeX{}, the code is |
| 10157 | to process these for several export back-ends. When exporting to @LaTeX{}, | 10117 | left as it is. When exporting to HTML, Org can use either |
| 10158 | the code is obviously left as it is. When exporting to HTML, Org invokes the | 10118 | @uref{http://www.mathjax.org, MathJax} (@pxref{Math formatting in HTML |
| 10159 | @uref{http://www.mathjax.org, MathJax library} (@pxref{Math formatting in | 10119 | export}) or transcode the math into images (see @pxref{Previewing @LaTeX{} |
| 10160 | HTML export}) to process and display the math@footnote{If you plan to use | 10120 | fragments}). |
| 10161 | this regularly or on pages with significant page views, you should install | ||
| 10162 | @file{MathJax} on your own server in order to limit the load of our server.}. | ||
| 10163 | Finally, it can also process the mathematical expressions into | ||
| 10164 | images@footnote{For this to work you need to be on a system with a working | ||
| 10165 | @LaTeX{} installation. You also need the @file{dvipng} program or the | ||
| 10166 | @file{convert}, respectively available at | ||
| 10167 | @url{http://sourceforge.net/projects/dvipng/} and from the @file{imagemagick} | ||
| 10168 | suite. The @LaTeX{} header that will be used when processing a fragment can | ||
| 10169 | be configured with the variable @code{org-format-latex-header}.} that can be | ||
| 10170 | displayed in a browser. | ||
| 10171 | 10121 | ||
| 10172 | @LaTeX{} fragments don't need any special marking at all. The following | 10122 | @LaTeX{} fragments don't need any special marking at all. The following |
| 10173 | snippets will be identified as @LaTeX{} source code: | 10123 | snippets will be identified as @LaTeX{} source code: |
| 10174 | @itemize @bullet | 10124 | @itemize @bullet |
| 10175 | @item | 10125 | @item |
| 10176 | Environments of any kind@footnote{When @file{MathJax} is used, only the | 10126 | Environments of any kind@footnote{When MathJax is used, only the |
| 10177 | environments recognized by @file{MathJax} will be processed. When | 10127 | environments recognized by MathJax will be processed. When |
| 10178 | @file{dvipng} program or @file{imagemagick} suite is used to create images, | 10128 | @file{dvipng} program, @file{dvisvgm} program or @file{imagemagick} suite is |
| 10179 | any @LaTeX{} environment will be handled.}. The only requirement is that the | 10129 | used to create images, any @LaTeX{} environment will be handled.}. The only |
| 10180 | @code{\begin} and @code{\end} statements appear on a new line, at the | 10130 | requirement is that the @code{\begin} statement appears on a new line, at the |
| 10181 | beginning of the line or after whitespaces only. | 10131 | beginning of the line or after whitespaces only. |
| 10182 | @item | 10132 | @item |
| 10183 | Text within the usual @LaTeX{} math delimiters. To avoid conflicts with | 10133 | Text within the usual @LaTeX{} math delimiters. To avoid conflicts with |
| 10184 | currency specifications, single @samp{$} characters are only recognized as | 10134 | currency specifications, single @samp{$} characters are only recognized as |
| 10185 | math delimiters if the enclosed text contains at most two line breaks, is | 10135 | math delimiters if the enclosed text contains at most two line breaks, is |
| 10186 | directly attached to the @samp{$} characters with no whitespace in between, | 10136 | directly attached to the @samp{$} characters with no whitespace in between, |
| 10187 | and if the closing @samp{$} is followed by whitespace, punctuation or a dash. | 10137 | and if the closing @samp{$} is followed by whitespace or punctuation |
| 10188 | For the other delimiters, there is no such restriction, so when in doubt, use | 10138 | (parentheses and quotes are considered to be punctuation in this |
| 10189 | @samp{\(...\)} as inline math delimiters. | 10139 | context). For the other delimiters, there is no such restriction, so when in |
| 10140 | doubt, use @samp{\(...\)} as inline math delimiters. | ||
| 10190 | @end itemize | 10141 | @end itemize |
| 10191 | 10142 | ||
| 10192 | @noindent For example: | 10143 | @noindent For example: |
| @@ -10210,7 +10161,7 @@ either $$ a=+\sqrt@{2@} $$ or \[ a=-\sqrt@{2@} \]. | |||
| 10210 | @vindex org-export-with-latex | 10161 | @vindex org-export-with-latex |
| 10211 | @LaTeX{} processing can be configured with the variable | 10162 | @LaTeX{} processing can be configured with the variable |
| 10212 | @code{org-export-with-latex}. The default setting is @code{t} which means | 10163 | @code{org-export-with-latex}. The default setting is @code{t} which means |
| 10213 | @file{MathJax} for HTML, and no processing for ASCII and @LaTeX{} back-ends. | 10164 | MathJax for HTML, and no processing for ASCII and @LaTeX{} back-ends. |
| 10214 | You can also set this variable on a per-file basis using one of these | 10165 | You can also set this variable on a per-file basis using one of these |
| 10215 | lines: | 10166 | lines: |
| 10216 | 10167 | ||
| @@ -10220,16 +10171,26 @@ lines: | |||
| 10220 | #+OPTIONS: tex:verbatim @r{Verbatim export, for jsMath or so} | 10171 | #+OPTIONS: tex:verbatim @r{Verbatim export, for jsMath or so} |
| 10221 | @end example | 10172 | @end example |
| 10222 | 10173 | ||
| 10223 | @node Previewing @LaTeX{} fragments, CDLaTeX mode, @LaTeX{} fragments, Embedded @LaTeX{} | 10174 | @node Previewing @LaTeX{} fragments |
| 10224 | @subsection Previewing @LaTeX{} fragments | 10175 | @subsection Previewing @LaTeX{} fragments |
| 10225 | @cindex @LaTeX{} fragments, preview | 10176 | @cindex @LaTeX{} fragments, preview |
| 10226 | 10177 | ||
| 10227 | @vindex org-latex-create-formula-image-program | 10178 | @vindex org-preview-latex-default-process |
| 10228 | If you have @file{dvipng} or @file{imagemagick} installed@footnote{Choose the | 10179 | If you have a working @LaTeX{} installation and @file{dvipng}, @file{dvisvgm} |
| 10229 | converter by setting the variable | 10180 | or @file{convert} installed@footnote{These are respectively available at |
| 10230 | @code{org-latex-create-formula-image-program} accordingly.}, @LaTeX{} | 10181 | @url{http://sourceforge.net/projects/dvipng/}, @url{http://dvisvgm.bplaced.net/} |
| 10231 | fragments can be processed to produce preview images of the typeset | 10182 | and from the @file{imagemagick} suite. Choose the converter by setting the |
| 10232 | expressions: | 10183 | variable @code{org-preview-latex-default-process} accordingly.}, @LaTeX{} |
| 10184 | fragments can be processed to produce images of the typeset expressions to be | ||
| 10185 | used for inclusion while exporting to HTML (see @pxref{@LaTeX{} fragments}), | ||
| 10186 | or for inline previewing within Org mode. | ||
| 10187 | |||
| 10188 | @vindex org-format-latex-options | ||
| 10189 | @vindex org-format-latex-header | ||
| 10190 | You can customize the variables @code{org-format-latex-options} and | ||
| 10191 | @code{org-format-latex-header} to influence some aspects of the preview. In | ||
| 10192 | particular, the @code{:scale} (and for HTML export, @code{:html-scale}) | ||
| 10193 | property of the former can be used to adjust the size of the preview images. | ||
| 10233 | 10194 | ||
| 10234 | @table @kbd | 10195 | @table @kbd |
| 10235 | @kindex C-c C-x C-l | 10196 | @kindex C-c C-x C-l |
| @@ -10245,12 +10206,6 @@ process the entire buffer. | |||
| 10245 | Remove the overlay preview images. | 10206 | Remove the overlay preview images. |
| 10246 | @end table | 10207 | @end table |
| 10247 | 10208 | ||
| 10248 | @vindex org-format-latex-options | ||
| 10249 | You can customize the variable @code{org-format-latex-options} to influence | ||
| 10250 | some aspects of the preview. In particular, the @code{:scale} (and for HTML | ||
| 10251 | export, @code{:html-scale}) property can be used to adjust the size of the | ||
| 10252 | preview images. | ||
| 10253 | |||
| 10254 | @vindex org-startup-with-latex-preview | 10209 | @vindex org-startup-with-latex-preview |
| 10255 | You can turn on the previewing of all @LaTeX{} fragments in a file with | 10210 | You can turn on the previewing of all @LaTeX{} fragments in a file with |
| 10256 | 10211 | ||
| @@ -10264,7 +10219,7 @@ To disable it, simply use | |||
| 10264 | #+STARTUP: nolatexpreview | 10219 | #+STARTUP: nolatexpreview |
| 10265 | @end example | 10220 | @end example |
| 10266 | 10221 | ||
| 10267 | @node CDLaTeX mode, , Previewing @LaTeX{} fragments, Embedded @LaTeX{} | 10222 | @node CDLaTeX mode |
| 10268 | @subsection Using CD@LaTeX{} to enter math | 10223 | @subsection Using CD@LaTeX{} to enter math |
| 10269 | @cindex CD@LaTeX{} | 10224 | @cindex CD@LaTeX{} |
| 10270 | 10225 | ||
| @@ -10325,252 +10280,233 @@ modification will work only inside @LaTeX{} fragments; outside the quote | |||
| 10325 | is normal. | 10280 | is normal. |
| 10326 | @end itemize | 10281 | @end itemize |
| 10327 | 10282 | ||
| 10328 | @node Special blocks, , Embedded @LaTeX{}, Markup | 10283 | @node Exporting |
| 10329 | @section Special blocks | 10284 | @chapter Exporting |
| 10330 | @cindex Special blocks | 10285 | @cindex exporting |
| 10331 | 10286 | ||
| 10332 | Org syntax includes pre-defined blocks (@pxref{Paragraphs} and @ref{Literal | 10287 | Sometimes, you may want to pretty print your notes, publish them on the web |
| 10333 | examples}). It is also possible to create blocks containing raw code | 10288 | or even share them with people not using Org. In these cases, the Org export |
| 10334 | targeted at a specific back-ends (e.g., @samp{#+BEGIN_LATEX}). | 10289 | facilities can be used to convert your documents to a variety of other |
| 10290 | formats, while retaining as much structure (@pxref{Document structure}) and | ||
| 10291 | markup (@pxref{Markup}) as possible. | ||
| 10335 | 10292 | ||
| 10336 | Any other block is a @emph{special block}. | 10293 | @cindex export back-end |
| 10294 | Libraries responsible for such translation are called back-ends. Org ships | ||
| 10295 | with the following ones | ||
| 10337 | 10296 | ||
| 10338 | For example, @samp{#+BEGIN_ABSTRACT} and @samp{#+BEGIN_VIDEO} are special | 10297 | @itemize |
| 10339 | blocks. The first one is useful when exporting to @LaTeX{}, the second one | 10298 | @item ascii (ASCII format) |
| 10340 | when exporting to HTML5. | 10299 | @item beamer (@LaTeX{} Beamer format) |
| 10300 | @item html (HTML format) | ||
| 10301 | @item icalendar (iCalendar format) | ||
| 10302 | @item latex (@LaTeX{} format) | ||
| 10303 | @item md (Markdown format) | ||
| 10304 | @item odt (OpenDocument Text format) | ||
| 10305 | @item org (Org format) | ||
| 10306 | @item texinfo (Texinfo format) | ||
| 10307 | @item man (Man page format) | ||
| 10308 | @end itemize | ||
| 10341 | 10309 | ||
| 10342 | Each export back-end decides if they should be exported, and how. When the | 10310 | @noindent Org also uses additional libraries located in @code{contrib/} |
| 10343 | block is ignored, its contents are still exported, as if the opening and | 10311 | directory (@pxref{Installation}). Users can install additional export |
| 10344 | closing block lines were not there. For example, when exporting a | 10312 | libraries for additional formats from the Emacs packaging system. For easy |
| 10345 | @samp{#+BEGIN_TEST} block, HTML back-end wraps its contents within a | 10313 | discovery, these packages have a common naming scheme: @file{ox-NAME}, where |
| 10346 | @samp{<div name="test">} tag. | 10314 | NAME is one of the formats. For example, @file{ox-koma-letter} for |
| 10315 | @code{koma-letter} back-end. | ||
| 10347 | 10316 | ||
| 10348 | Refer to back-end specific documentation for more information. | 10317 | @vindex org-export-backends |
| 10318 | Org loads back-ends for the following formats by default: @code{ascii}, | ||
| 10319 | @code{html}, @code{icalendar}, @code{latex} and @code{odt}. | ||
| 10349 | 10320 | ||
| 10350 | @node Exporting, Publishing, Markup, Top | 10321 | Org can load additional back-ends either of two ways: through the |
| 10351 | @chapter Exporting | 10322 | @code{org-export-backends} variable configuration; or, by requiring the |
| 10352 | @cindex exporting | 10323 | library in the Emacs init file like this: |
| 10353 | 10324 | ||
| 10354 | The Org mode export facilities can be used to export Org documents or parts | 10325 | @lisp |
| 10355 | of Org documents to a variety of other formats. In addition, these | 10326 | (require 'ox-md) |
| 10356 | facilities can be used with @code{orgtbl-mode} and/or @code{orgstruct-mode} | 10327 | @end lisp |
| 10357 | in foreign buffers so you can author tables and lists in Org syntax and | ||
| 10358 | convert them in place to the target language. | ||
| 10359 | |||
| 10360 | ASCII export produces a readable and simple version of an Org file for | ||
| 10361 | printing and sharing notes. HTML export allows you to easily publish notes | ||
| 10362 | on the web, or to build full-fledged websites. @LaTeX{} export lets you use | ||
| 10363 | Org mode and its structured editing functions to create arbitrarily complex | ||
| 10364 | @LaTeX{} files for any kind of document. OpenDocument Text (ODT) export | ||
| 10365 | allows seamless collaboration across organizational boundaries. Markdown | ||
| 10366 | export lets you seamlessly collaborate with other developers. Finally, iCal | ||
| 10367 | export can extract entries with deadlines or appointments to produce a file | ||
| 10368 | in the iCalendar format. | ||
| 10369 | 10328 | ||
| 10370 | @menu | 10329 | @menu |
| 10371 | * The Export Dispatcher:: The main exporter interface | 10330 | * The export dispatcher:: The main interface |
| 10372 | * Export back-ends:: Built-in export formats | 10331 | * Export settings:: Common export settings |
| 10373 | * Export settings:: Generic export settings | 10332 | * Table of contents:: The if and where of the table of contents |
| 10333 | * Include files:: Include additional files into a document | ||
| 10334 | * Macro replacement:: Use macros to create templates | ||
| 10335 | * Comment lines:: What will not be exported | ||
| 10374 | * ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding | 10336 | * ASCII/Latin-1/UTF-8 export:: Exporting to flat files with encoding |
| 10375 | * Beamer export:: Exporting as a Beamer presentation | 10337 | * Beamer export:: Exporting as a Beamer presentation |
| 10376 | * HTML export:: Exporting to HTML | 10338 | * HTML export:: Exporting to HTML |
| 10377 | * @LaTeX{} and PDF export:: Exporting to @LaTeX{}, and processing to PDF | 10339 | * @LaTeX{} export:: Exporting to @LaTeX{}, and processing to PDF |
| 10378 | * Markdown export:: Exporting to Markdown | 10340 | * Markdown export:: Exporting to Markdown |
| 10379 | * OpenDocument Text export:: Exporting to OpenDocument Text | 10341 | * OpenDocument Text export:: Exporting to OpenDocument Text |
| 10380 | * Org export:: Exporting to Org | 10342 | * Org export:: Exporting to Org |
| 10381 | * Texinfo export:: Exporting to Texinfo | 10343 | * Texinfo export:: Exporting to Texinfo |
| 10382 | * iCalendar export:: Exporting to iCalendar | 10344 | * iCalendar export:: Exporting to iCalendar |
| 10383 | * Other built-in back-ends:: Exporting to a man page | 10345 | * Other built-in back-ends:: Exporting to a man page |
| 10384 | * Export in foreign buffers:: Author tables and lists in Org syntax | ||
| 10385 | * Advanced configuration:: Fine-tuning the export output | 10346 | * Advanced configuration:: Fine-tuning the export output |
| 10347 | * Export in foreign buffers:: Author tables and lists in Org syntax | ||
| 10386 | @end menu | 10348 | @end menu |
| 10387 | 10349 | ||
| 10388 | @node The Export Dispatcher, Export back-ends, Exporting, Exporting | 10350 | @node The export dispatcher |
| 10389 | @section The Export Dispatcher | 10351 | @section The export dispatcher |
| 10390 | @vindex org-export-dispatch-use-expert-ui | 10352 | @vindex org-export-dispatch-use-expert-ui |
| 10391 | @cindex Export, dispatcher | 10353 | @cindex Export, dispatcher |
| 10392 | 10354 | ||
| 10393 | The main entry point for export related tasks is the dispatcher, a | 10355 | The export dispatcher is the main interface for Org's exports. A |
| 10394 | hierarchical menu from which it is possible to select an export format and | 10356 | hierarchical menu presents the currently configured export formats. Options |
| 10395 | toggle export options@footnote{It is also possible to use a less intrusive | 10357 | are shown as easy toggle switches on the same screen. |
| 10396 | interface by setting @code{org-export-dispatch-use-expert-ui} to a | 10358 | |
| 10397 | non-@code{nil} value. In that case, only a prompt is visible from the | 10359 | Org also has a minimal prompt interface for the export dispatcher. When the |
| 10398 | minibuffer. From there one can still switch back to regular menu by pressing | 10360 | variable @code{org-export-dispatch-use-expert-ui} is set to a non-@code{nil} |
| 10399 | @key{?}.} from which it is possible to select an export format and to toggle | 10361 | value, Org prompts in the minibuffer. To switch back to the hierarchical |
| 10400 | export options. | 10362 | menu, press @key{?}. |
| 10401 | 10363 | ||
| 10402 | @c @quotation | ||
| 10403 | @table @asis | 10364 | @table @asis |
| 10404 | @orgcmd{C-c C-e,org-export-dispatch} | 10365 | @orgcmd{C-c C-e,org-export-dispatch} |
| 10405 | 10366 | ||
| 10406 | Dispatch for export and publishing commands. When called with a @kbd{C-u} | 10367 | Invokes the export dispatcher interface. The options show default settings. |
| 10407 | prefix argument, repeat the last export command on the current buffer while | 10368 | The @kbd{C-u} prefix argument preserves options from the previous export, |
| 10408 | preserving toggled options. If the current buffer hasn't changed and subtree | 10369 | including any sub-tree selections. |
| 10409 | export was activated, the command will affect that same subtree. | 10370 | |
| 10410 | @end table | 10371 | @end table |
| 10411 | @c @end quotation | ||
| 10412 | 10372 | ||
| 10413 | Normally the entire buffer is exported, but if there is an active region | 10373 | Org exports the entire buffer by default. If the Org buffer has an active |
| 10414 | only that part of the buffer will be exported. | 10374 | region, then Org exports just that region. |
| 10415 | 10375 | ||
| 10416 | Several export options (@pxref{Export settings}) can be toggled from the | 10376 | These are the export options, the key combinations that toggle them |
| 10417 | export dispatcher with the following key combinations: | 10377 | (@pxref{Export settings}): |
| 10418 | 10378 | ||
| 10419 | @table @kbd | 10379 | @table @kbd |
| 10420 | @item C-a | 10380 | @item C-a |
| 10421 | @vindex org-export-async-init-file | 10381 | @vindex org-export-async-init-file |
| 10422 | Toggle asynchronous export. Asynchronous export uses an external Emacs | 10382 | Toggles asynchronous export. Asynchronous export uses an external Emacs |
| 10423 | process that is configured with a specified initialization file. | 10383 | process with a specially configured initialization file to complete the |
| 10384 | exporting process in the background thereby releasing the current interface. | ||
| 10385 | This is particularly useful when exporting long documents. | ||
| 10424 | 10386 | ||
| 10425 | While exporting asynchronously, the output is not displayed, but stored in | 10387 | Output from an asynchronous export is saved on the ``the export stack''. To |
| 10426 | a place called ``the export stack''. This stack can be displayed by calling | 10388 | view this stack, call the export dispatcher with a double @kbd{C-u} prefix |
| 10427 | the dispatcher with a double @kbd{C-u} prefix argument, or with @kbd{&} key | 10389 | argument. If already in the export dispatcher menu, @kbd{&} displays the |
| 10428 | from the dispatcher menu. | 10390 | stack. |
| 10429 | 10391 | ||
| 10430 | @vindex org-export-in-background | 10392 | @vindex org-export-in-background |
| 10431 | To make this behavior the default, customize the variable | 10393 | To make the background export process the default, customize the variable, |
| 10432 | @code{org-export-in-background}. | 10394 | @code{org-export-in-background}. |
| 10433 | 10395 | ||
| 10434 | @item C-b | 10396 | @item C-b |
| 10435 | Toggle body-only export. Its effect depends on the back-end used. | 10397 | Toggle body-only export. Useful for excluding headers and footers in the |
| 10436 | Typically, if the back-end has a header section (like @code{<head>...</head>} | 10398 | export. Affects only those back-end formats that have such sections---like |
| 10437 | in the HTML back-end), a body-only export will not include this header. | 10399 | @code{<head>...</head>} in HTML. |
| 10438 | 10400 | ||
| 10439 | @item C-s | 10401 | @item C-s |
| 10440 | @vindex org-export-initial-scope | 10402 | @vindex org-export-initial-scope |
| 10441 | Toggle subtree export. The top heading becomes the document title. | 10403 | Toggle sub-tree export. When turned on, Org exports only the sub-tree starting |
| 10404 | from the cursor position at the time the export dispatcher was invoked. Org | ||
| 10405 | uses the top heading of this sub-tree as the document's title. If the cursor | ||
| 10406 | is not on a heading, Org uses the nearest enclosing header. If the cursor is | ||
| 10407 | in the document preamble, Org signals an error and aborts export. | ||
| 10442 | 10408 | ||
| 10443 | You can change the default state of this option by setting | 10409 | To make the sub-tree export the default, customize the variable, |
| 10444 | @code{org-export-initial-scope}. | 10410 | @code{org-export-initial-scope}. |
| 10445 | 10411 | ||
| 10446 | @item C-v | 10412 | @item C-v |
| 10447 | Toggle visible-only export. Only export the text that is currently | 10413 | Toggle visible-only export. Useful for exporting only visible parts of an |
| 10448 | visible, i.e., not hidden by outline visibility in the buffer. | 10414 | Org document by adjusting outline visibility settings. |
| 10449 | |||
| 10450 | @end table | 10415 | @end table |
| 10451 | 10416 | ||
| 10452 | @vindex org-export-copy-to-kill-ring | 10417 | @node Export settings |
| 10453 | With the exception of asynchronous export, a successful export process writes | ||
| 10454 | its output to the kill-ring. You can configure this behavior by altering the | ||
| 10455 | option @code{org-export-copy-to-kill-ring}. | ||
| 10456 | |||
| 10457 | @node Export back-ends, Export settings, The Export Dispatcher, Exporting | ||
| 10458 | @section Export back-ends | ||
| 10459 | @cindex Export, back-ends | ||
| 10460 | |||
| 10461 | An export back-end is a library that translates Org syntax into a foreign | ||
| 10462 | format. An export format is not available until the proper back-end has been | ||
| 10463 | loaded. | ||
| 10464 | |||
| 10465 | @vindex org-export-backends | ||
| 10466 | By default, the following four back-ends are loaded: @code{ascii}, | ||
| 10467 | @code{html}, @code{icalendar} and @code{latex}. It is possible to add more | ||
| 10468 | (or remove some) by customizing @code{org-export-backends}. | ||
| 10469 | |||
| 10470 | Built-in back-ends include: | ||
| 10471 | |||
| 10472 | @itemize | ||
| 10473 | @item ascii (ASCII format) | ||
| 10474 | @item beamer (@LaTeX{} Beamer format) | ||
| 10475 | @item html (HTML format) | ||
| 10476 | @item icalendar (iCalendar format) | ||
| 10477 | @item latex (@LaTeX{} format) | ||
| 10478 | @item man (Man page format) | ||
| 10479 | @item md (Markdown format) | ||
| 10480 | @item odt (OpenDocument Text format) | ||
| 10481 | @item org (Org format) | ||
| 10482 | @item texinfo (Texinfo format) | ||
| 10483 | @end itemize | ||
| 10484 | |||
| 10485 | Other back-ends might be found in the @code{contrib/} directory | ||
| 10486 | (@pxref{Installation}). | ||
| 10487 | |||
| 10488 | @node Export settings, ASCII/Latin-1/UTF-8 export, Export back-ends, Exporting | ||
| 10489 | @section Export settings | 10418 | @section Export settings |
| 10490 | @cindex Export, settings | 10419 | @cindex Export, settings |
| 10491 | 10420 | ||
| 10421 | @cindex #+OPTIONS | ||
| 10492 | Export options can be set: globally with variables; for an individual file by | 10422 | Export options can be set: globally with variables; for an individual file by |
| 10493 | making variables buffer-local with in-buffer settings (@pxref{In-buffer | 10423 | making variables buffer-local with in-buffer settings (@pxref{In-buffer |
| 10494 | settings}), by setting individual keywords, or by specifying them in a | 10424 | settings}), by setting individual keywords, or by specifying them in a |
| 10495 | compact form with the @code{#+OPTIONS} keyword; or for a tree by setting | 10425 | compact form with the @code{#+OPTIONS} keyword; or for a tree by setting |
| 10496 | properties (@pxref{Properties and Columns}). Options set at a specific level | 10426 | properties (@pxref{Properties and columns}). Options set at a specific level |
| 10497 | override options set at a more general level. | 10427 | override options set at a more general level. |
| 10498 | 10428 | ||
| 10499 | @cindex #+SETUPFILE | 10429 | @cindex #+SETUPFILE |
| 10500 | In-buffer settings may appear anywhere in the file, either directly or | 10430 | In-buffer settings may appear anywhere in the file, either directly or |
| 10501 | indirectly through a file included using @samp{#+SETUPFILE: filename} syntax. | 10431 | indirectly through a file included using @samp{#+SETUPFILE: filename} syntax. |
| 10502 | Option keyword sets tailored to a particular back-end can be inserted from | 10432 | Option keyword sets tailored to a particular back-end can be inserted from |
| 10503 | the export dispatcher (@pxref{The Export Dispatcher}) using the @code{Insert | 10433 | the export dispatcher (@pxref{The export dispatcher}) using the @code{Insert |
| 10504 | template} command by pressing @key{#}. To insert keywords individually, | 10434 | template} command by pressing @key{#}. To insert keywords individually, |
| 10505 | a good way to make sure the keyword is correct is to type @code{#+} and then | 10435 | a good way to make sure the keyword is correct is to type @code{#+} and then |
| 10506 | to use @kbd{M-<TAB>} for completion. | 10436 | to use @kbd{M-@key{TAB}}@footnote{Many desktops intercept @kbd{M-TAB} to |
| 10437 | switch windows. Use @kbd{C-M-i} or @kbd{@key{ESC} @key{TAB}} instead.} for | ||
| 10438 | completion. | ||
| 10507 | 10439 | ||
| 10508 | The export keywords available for every back-end, and their equivalent global | 10440 | The export keywords available for every back-end, and their equivalent global |
| 10509 | variables, include: | 10441 | variables, include: |
| 10510 | 10442 | ||
| 10511 | @table @samp | 10443 | @table @samp |
| 10512 | @item AUTHOR | 10444 | @item AUTHOR |
| 10445 | @cindex #+AUTHOR | ||
| 10513 | @vindex user-full-name | 10446 | @vindex user-full-name |
| 10514 | The document author (@code{user-full-name}). | 10447 | The document author (@code{user-full-name}). |
| 10515 | 10448 | ||
| 10516 | @item CREATOR | 10449 | @item CREATOR |
| 10450 | @cindex #+CREATOR | ||
| 10517 | @vindex org-export-creator-string | 10451 | @vindex org-export-creator-string |
| 10518 | Entity responsible for output generation (@code{org-export-creator-string}). | 10452 | Entity responsible for output generation (@code{org-export-creator-string}). |
| 10519 | 10453 | ||
| 10520 | @item DATE | 10454 | @item DATE |
| 10455 | @cindex #+DATE | ||
| 10521 | @vindex org-export-date-timestamp-format | 10456 | @vindex org-export-date-timestamp-format |
| 10522 | A date or a time-stamp@footnote{The variable | 10457 | A date or a time-stamp@footnote{The variable |
| 10523 | @code{org-export-date-timestamp-format} defines how this time-stamp will be | 10458 | @code{org-export-date-timestamp-format} defines how this time-stamp will be |
| 10524 | exported.}. | 10459 | exported.}. |
| 10525 | 10460 | ||
| 10526 | @item DESCRIPTION | ||
| 10527 | The document description. Back-ends handle it as they see fit (e.g., for the | ||
| 10528 | XHTML meta tag), if at all. You can use several such keywords for long | ||
| 10529 | descriptions. | ||
| 10530 | |||
| 10531 | @item EMAIL | 10461 | @item EMAIL |
| 10462 | @cindex #+EMAIL | ||
| 10532 | @vindex user-mail-address | 10463 | @vindex user-mail-address |
| 10533 | The email address (@code{user-mail-address}). | 10464 | The email address (@code{user-mail-address}). |
| 10534 | 10465 | ||
| 10535 | @item KEYWORDS | ||
| 10536 | The keywords defining the contents of the document. Back-ends handle it as | ||
| 10537 | they see fit (e.g., for the XHTML meta tag), if at all. You can use several | ||
| 10538 | such keywords if the list is long. | ||
| 10539 | |||
| 10540 | @item LANGUAGE | 10466 | @item LANGUAGE |
| 10467 | @cindex #+LANGUAGE | ||
| 10541 | @vindex org-export-default-language | 10468 | @vindex org-export-default-language |
| 10542 | The language used for translating some strings | 10469 | Language to use for translating certain strings |
| 10543 | (@code{org-export-default-language}). E.g., @samp{#+LANGUAGE: fr} will tell | 10470 | (@code{org-export-default-language}). With @samp{#+LANGUAGE: fr}, for |
| 10544 | Org to translate @emph{File} (english) into @emph{Fichier} (french) in the | 10471 | example, Org translates @emph{Table of contents} to the French @emph{Table |
| 10545 | clocktable. | 10472 | des matières}. |
| 10546 | 10473 | ||
| 10547 | @item SELECT_TAGS | 10474 | @item SELECT_TAGS |
| 10475 | @cindex #+SELECT_TAGS | ||
| 10548 | @vindex org-export-select-tags | 10476 | @vindex org-export-select-tags |
| 10549 | The tags that select a tree for export (@code{org-export-select-tags}). The | 10477 | The default value is @code{:export:}. When a tree is tagged with |
| 10550 | default value is @code{:export:}. Within a subtree tagged with | 10478 | @code{:export:} (@code{org-export-select-tags}), Org selects that tree and |
| 10551 | @code{:export:}, you can still exclude entries with @code{:noexport:} (see | 10479 | its sub-trees for export. Org excludes trees with @code{:noexport:} tags, |
| 10552 | below). When headlines are selectively exported with @code{:export:} | 10480 | see below. When selectively exporting files with @code{:export:} tags set, |
| 10553 | anywhere in a file, text before the first headline is ignored. | 10481 | Org does not export any text that appears before the first headline. |
| 10554 | 10482 | ||
| 10555 | @item EXCLUDE_TAGS | 10483 | @item EXCLUDE_TAGS |
| 10556 | The tags that exclude a tree from export (@code{org-export-exclude-tags}). | 10484 | @cindex #+EXCLUDE_TAGS |
| 10557 | The default value is @code{:noexport:}. Entries with the @code{:noexport:} | 10485 | @vindex org-export-exclude-tags |
| 10558 | tag will be unconditionally excluded from the export, even if they have an | 10486 | The default value is @code{:noexport:}. When a tree is tagged with |
| 10559 | @code{:export:} tag. | 10487 | @code{:noexport:} (@code{org-export-exclude-tags}), Org excludes that tree |
| 10488 | and its sub-trees from export. Entries tagged with @code{:noexport:} will be | ||
| 10489 | unconditionally excluded from the export, even if they have an | ||
| 10490 | @code{:export:} tag. Even if a sub-tree is not exported, Org will execute any | ||
| 10491 | code blocks contained in them. | ||
| 10560 | 10492 | ||
| 10561 | @item TITLE | 10493 | @item TITLE |
| 10562 | The title to be shown (otherwise derived from buffer's name). You can use | 10494 | @cindex #+TITLE |
| 10563 | several such keywords for long titles. | 10495 | @cindex document title |
| 10496 | Org displays this title. For long titles, use multiple @code{#+TITLE} lines. | ||
| 10564 | @end table | 10497 | @end table |
| 10565 | 10498 | ||
| 10566 | The @code{#+OPTIONS} keyword is a compact@footnote{If you want to configure | 10499 | The @code{#+OPTIONS} keyword is a compact form. To configure multiple |
| 10567 | many options this way, you can use several @code{#+OPTIONS} lines.} form that | 10500 | options, use several @code{#+OPTIONS} lines. @code{#+OPTIONS} recognizes the |
| 10568 | recognizes the following arguments: | 10501 | following arguments. |
| 10569 | 10502 | ||
| 10570 | @table @code | 10503 | @table @code |
| 10571 | @item ': | 10504 | @item ': |
| 10572 | @vindex org-export-with-smart-quotes | 10505 | @vindex org-export-with-smart-quotes |
| 10573 | Toggle smart quotes (@code{org-export-with-smart-quotes}). | 10506 | Toggle smart quotes (@code{org-export-with-smart-quotes}). Depending on the |
| 10507 | language used, when activated, Org treats pairs of double quotes as primary | ||
| 10508 | quotes, pairs of single quotes as secondary quotes, and single quote marks as | ||
| 10509 | apostrophes. | ||
| 10574 | 10510 | ||
| 10575 | @item *: | 10511 | @item *: |
| 10576 | Toggle emphasized text (@code{org-export-with-emphasize}). | 10512 | Toggle emphasized text (@code{org-export-with-emphasize}). |
| @@ -10587,12 +10523,12 @@ Toggle fixed-width sections | |||
| 10587 | 10523 | ||
| 10588 | @item <: | 10524 | @item <: |
| 10589 | @vindex org-export-with-timestamps | 10525 | @vindex org-export-with-timestamps |
| 10590 | Toggle inclusion of any time/date active/inactive stamps | 10526 | Toggle inclusion of time/date active/inactive stamps |
| 10591 | (@code{org-export-with-timestamps}). | 10527 | (@code{org-export-with-timestamps}). |
| 10592 | 10528 | ||
| 10593 | @item : | 10529 | @item \n: |
| 10594 | @vindex org-export-preserve-breaks | 10530 | @vindex org-export-preserve-breaks |
| 10595 | Toggle line-break-preservation (@code{org-export-preserve-breaks}). | 10531 | Toggles whether to preserve line breaks (@code{org-export-preserve-breaks}). |
| 10596 | 10532 | ||
| 10597 | @item ^: | 10533 | @item ^: |
| 10598 | @vindex org-export-with-sub-superscripts | 10534 | @vindex org-export-with-sub-superscripts |
| @@ -10602,8 +10538,8 @@ it is (@code{org-export-with-sub-superscripts}). | |||
| 10602 | 10538 | ||
| 10603 | @item arch: | 10539 | @item arch: |
| 10604 | @vindex org-export-with-archived-trees | 10540 | @vindex org-export-with-archived-trees |
| 10605 | Configure export of archived trees. Can be set to @code{headline} to only | 10541 | Configure how archived trees are exported. When set to @code{headline}, the |
| 10606 | process the headline, skipping its contents | 10542 | export process skips the contents and processes only the headlines |
| 10607 | (@code{org-export-with-archived-trees}). | 10543 | (@code{org-export-with-archived-trees}). |
| 10608 | 10544 | ||
| 10609 | @item author: | 10545 | @item author: |
| @@ -10611,19 +10547,29 @@ process the headline, skipping its contents | |||
| 10611 | Toggle inclusion of author name into exported file | 10547 | Toggle inclusion of author name into exported file |
| 10612 | (@code{org-export-with-author}). | 10548 | (@code{org-export-with-author}). |
| 10613 | 10549 | ||
| 10550 | @item broken-links: | ||
| 10551 | @vindex org-export-with-broken-links | ||
| 10552 | Toggles if Org should continue exporting upon finding a broken internal link. | ||
| 10553 | When set to @code{mark}, Org clearly marks the problem link in the output | ||
| 10554 | (@code{org-export-with-broken-links}). | ||
| 10555 | |||
| 10614 | @item c: | 10556 | @item c: |
| 10615 | @vindex org-export-with-clocks | 10557 | @vindex org-export-with-clocks |
| 10616 | Toggle inclusion of CLOCK keywords (@code{org-export-with-clocks}). | 10558 | Toggle inclusion of CLOCK keywords (@code{org-export-with-clocks}). |
| 10617 | 10559 | ||
| 10618 | @item creator: | 10560 | @item creator: |
| 10619 | @vindex org-export-with-creator | 10561 | @vindex org-export-with-creator |
| 10620 | Configure inclusion of creator info into exported file. It may be set to | 10562 | Toggle inclusion of creator information in the exported file |
| 10621 | @code{comment} (@code{org-export-with-creator}). | 10563 | (@code{org-export-with-creator}). |
| 10622 | 10564 | ||
| 10623 | @item d: | 10565 | @item d: |
| 10624 | @vindex org-export-with-drawers | 10566 | @vindex org-export-with-drawers |
| 10625 | Toggle inclusion of drawers, or list drawers to include | 10567 | Toggles inclusion of drawers, or list of drawers to include, or list of |
| 10626 | (@code{org-export-with-drawers}). | 10568 | drawers to exclude (@code{org-export-with-drawers}). |
| 10569 | |||
| 10570 | @item date: | ||
| 10571 | @vindex org-export-with-date | ||
| 10572 | Toggle inclusion of a date into exported file (@code{org-export-with-date}). | ||
| 10627 | 10573 | ||
| 10628 | @item e: | 10574 | @item e: |
| 10629 | @vindex org-export-with-entities | 10575 | @vindex org-export-with-entities |
| @@ -10650,20 +10596,28 @@ Toggle inclusion of inlinetasks (@code{org-export-with-inlinetasks}). | |||
| 10650 | 10596 | ||
| 10651 | @item num: | 10597 | @item num: |
| 10652 | @vindex org-export-with-section-numbers | 10598 | @vindex org-export-with-section-numbers |
| 10653 | Toggle section-numbers (@code{org-export-with-section-numbers}). It can also | 10599 | @cindex property, UNNUMBERED |
| 10654 | be set to a number @samp{n}, so only headlines at that level or above will be | 10600 | Toggle section-numbers (@code{org-export-with-section-numbers}). When set to |
| 10655 | numbered. | 10601 | number @samp{n}, Org numbers only those headlines at level @samp{n} or above. |
| 10602 | Set @code{UNNUMBERED} property to non-@code{nil} to disable numbering of | ||
| 10603 | heading and subheadings entirely. | ||
| 10656 | 10604 | ||
| 10657 | @item p: | 10605 | @item p: |
| 10658 | @vindex org-export-with-planning | 10606 | @vindex org-export-with-planning |
| 10659 | Toggle export of planning information (@code{org-export-with-planning}). | 10607 | Toggle export of planning information (@code{org-export-with-planning}). |
| 10660 | ``Planning information'' is the line containing the @code{SCHEDULED:}, the | 10608 | ``Planning information'' comes from lines located right after the headline |
| 10661 | @code{DEADLINE:} or the @code{CLOSED:} cookies or a combination of them. | 10609 | and contain any combination of these cookies: @code{SCHEDULED:}, |
| 10610 | @code{DEADLINE:}, or @code{CLOSED:}. | ||
| 10662 | 10611 | ||
| 10663 | @item pri: | 10612 | @item pri: |
| 10664 | @vindex org-export-with-priority | 10613 | @vindex org-export-with-priority |
| 10665 | Toggle inclusion of priority cookies (@code{org-export-with-priority}). | 10614 | Toggle inclusion of priority cookies (@code{org-export-with-priority}). |
| 10666 | 10615 | ||
| 10616 | @item prop: | ||
| 10617 | @vindex org-export-with-properties | ||
| 10618 | Toggle inclusion of property drawers, or list the properties to include | ||
| 10619 | (@code{org-export-with-properties}). | ||
| 10620 | |||
| 10667 | @item stat: | 10621 | @item stat: |
| 10668 | @vindex org-export-with-statistics-cookies | 10622 | @vindex org-export-with-statistics-cookies |
| 10669 | Toggle inclusion of statistics cookies | 10623 | Toggle inclusion of statistics cookies |
| @@ -10676,20 +10630,24 @@ Toggle inclusion of tags, may also be @code{not-in-toc} | |||
| 10676 | 10630 | ||
| 10677 | @item tasks: | 10631 | @item tasks: |
| 10678 | @vindex org-export-with-tasks | 10632 | @vindex org-export-with-tasks |
| 10679 | Toggle inclusion of tasks (TODO items), can be @code{nil} to remove all | 10633 | Toggle inclusion of tasks (TODO items); or @code{nil} to remove all tasks; or |
| 10680 | tasks, @code{todo} to remove DONE tasks, or a list of keywords to keep | 10634 | @code{todo} to remove DONE tasks; or list the keywords to keep |
| 10681 | (@code{org-export-with-tasks}). | 10635 | (@code{org-export-with-tasks}). |
| 10682 | 10636 | ||
| 10683 | @item tex: | 10637 | @item tex: |
| 10684 | @vindex org-export-with-latex | 10638 | @vindex org-export-with-latex |
| 10685 | Configure export of @LaTeX{} fragments and environments. It may be set to | 10639 | @code{nil} does not export; @code{t} exports; @code{verbatim} keeps |
| 10686 | @code{verbatim} (@code{org-export-with-latex}). | 10640 | everything in verbatim (@code{org-export-with-latex}). |
| 10687 | 10641 | ||
| 10688 | @item timestamp: | 10642 | @item timestamp: |
| 10689 | @vindex org-export-time-stamp-file | 10643 | @vindex org-export-time-stamp-file |
| 10690 | Toggle inclusion of the creation time into exported file | 10644 | Toggle inclusion of the creation time in the exported file |
| 10691 | (@code{org-export-time-stamp-file}). | 10645 | (@code{org-export-time-stamp-file}). |
| 10692 | 10646 | ||
| 10647 | @item title: | ||
| 10648 | @vindex org-export-with-title | ||
| 10649 | Toggle inclusion of title (@code{org-export-with-title}). | ||
| 10650 | |||
| 10693 | @item toc: | 10651 | @item toc: |
| 10694 | @vindex org-export-with-toc | 10652 | @vindex org-export-with-toc |
| 10695 | Toggle inclusion of the table of contents, or set the level limit | 10653 | Toggle inclusion of the table of contents, or set the level limit |
| @@ -10703,255 +10661,589 @@ Toggle inclusion of TODO keywords into exported text | |||
| 10703 | @item |: | 10661 | @item |: |
| 10704 | @vindex org-export-with-tables | 10662 | @vindex org-export-with-tables |
| 10705 | Toggle inclusion of tables (@code{org-export-with-tables}). | 10663 | Toggle inclusion of tables (@code{org-export-with-tables}). |
| 10664 | |||
| 10706 | @end table | 10665 | @end table |
| 10707 | 10666 | ||
| 10708 | When exporting only a subtree, each of the previous keywords@footnote{With | 10667 | When exporting sub-trees, special node properties in them can override the |
| 10709 | the exception of @samp{SETUPFILE}.} can be overridden locally by special node | 10668 | above keywords. They are special because they have an @samp{EXPORT_} prefix. |
| 10710 | properties. These begin with @samp{EXPORT_}, followed by the name of the | 10669 | For example, @samp{DATE} and @samp{OPTIONS} keywords become, respectively, |
| 10711 | keyword they supplant. For example, @samp{DATE} and @samp{OPTIONS} keywords | 10670 | @samp{EXPORT_DATE} and @samp{EXPORT_OPTIONS}. Except for @samp{SETUPFILE}, |
| 10712 | become, respectively, @samp{EXPORT_DATE} and @samp{EXPORT_OPTIONS} | 10671 | all other keywords listed above have an @samp{EXPORT_} equivalent. |
| 10713 | properties. | ||
| 10714 | 10672 | ||
| 10715 | @cindex #+BIND | 10673 | @cindex #+BIND |
| 10716 | @vindex org-export-allow-bind-keywords | 10674 | @vindex org-export-allow-bind-keywords |
| 10717 | If @code{org-export-allow-bind-keywords} is non-@code{nil}, Emacs variables | 10675 | If @code{org-export-allow-bind-keywords} is non-@code{nil}, Emacs variables |
| 10718 | can become buffer-local during export by using the BIND keyword. Its syntax | 10676 | can become buffer-local during export by using the BIND keyword. Its syntax |
| 10719 | is @samp{#+BIND: variable value}. This is particularly useful for in-buffer | 10677 | is @samp{#+BIND: variable value}. This is particularly useful for in-buffer |
| 10720 | settings that cannot be changed using specific keywords. | 10678 | settings that cannot be changed using keywords. |
| 10721 | 10679 | ||
| 10722 | @cindex property, EXPORT_FILE_NAME | 10680 | @cindex property, EXPORT_FILE_NAME |
| 10723 | The name of the output file to be generated is taken from the file associated | 10681 | Normally Org generates the file name based on the buffer name and the |
| 10724 | to the buffer, when possible, or asked to you otherwise. For subtree export, | 10682 | extension based on the back-end format. For sub-trees, Org can export to a |
| 10725 | you can also set @samp{EXPORT_FILE_NAME} property. In all cases, only the | 10683 | file name as specified in the @code{EXPORT_FILE_NAME} property. |
| 10726 | base name of the file is retained, and a back-end specific extension is | 10684 | |
| 10727 | added. | 10685 | @node Table of contents |
| 10686 | @section Table of contents | ||
| 10687 | @cindex table of contents | ||
| 10688 | @cindex list of tables | ||
| 10689 | @cindex list of listings | ||
| 10690 | |||
| 10691 | @cindex #+TOC | ||
| 10692 | @vindex org-export-with-toc | ||
| 10693 | Org normally inserts the table of contents directly before the first headline | ||
| 10694 | of the file. Org sets the TOC depth the same as the headline levels in the | ||
| 10695 | file. Use a lower number for lower TOC depth. To turn off TOC entirely, use | ||
| 10696 | @code{nil}. This is configured in the @code{org-export-with-toc} variable or | ||
| 10697 | as keywords in an Org file as: | ||
| 10698 | |||
| 10699 | @example | ||
| 10700 | #+OPTIONS: toc:2 @r{only include two levels in TOC} | ||
| 10701 | #+OPTIONS: toc:nil @r{no default TOC at all} | ||
| 10702 | @end example | ||
| 10703 | |||
| 10704 | To move the table of contents to a different location, first turn off the | ||
| 10705 | default with @code{org-export-with-toc} variable or with @code{#+OPTIONS: | ||
| 10706 | toc:nil}. Then insert @code{#+TOC: headlines N} at the desired location(s). | ||
| 10707 | |||
| 10708 | @example | ||
| 10709 | #+OPTIONS: toc:nil @r{no default TOC} | ||
| 10710 | ... | ||
| 10711 | #+TOC: headlines 2 @r{insert TOC here, with two headline levels} | ||
| 10712 | @end example | ||
| 10713 | |||
| 10714 | To adjust the TOC depth for a specific section of the Org document, append an | ||
| 10715 | additional @samp{local} parameter. This parameter becomes a relative depth | ||
| 10716 | for the current level. | ||
| 10728 | 10717 | ||
| 10729 | @node ASCII/Latin-1/UTF-8 export, Beamer export, Export settings, Exporting | 10718 | Note that for this feature to work properly in @LaTeX{} export, the Org file |
| 10719 | requires the inclusion of the @code{titletoc} package. Because of | ||
| 10720 | compatibility issues, @code{titletoc} has to be loaded @emph{before} | ||
| 10721 | @code{hyperref}. Customize the @code{org-latex-default-packages-alist} | ||
| 10722 | variable. | ||
| 10723 | |||
| 10724 | @example | ||
| 10725 | * Section #+TOC: headlines 1 local @r{insert local TOC, with direct children | ||
| 10726 | only} | ||
| 10727 | @end example | ||
| 10728 | |||
| 10729 | Use the @code{TOC} keyword to generate list of tables (resp.@: all listings) | ||
| 10730 | with captions. | ||
| 10731 | |||
| 10732 | @example | ||
| 10733 | #+TOC: listings @r{build a list of listings} | ||
| 10734 | #+TOC: tables @r{build a list of tables} | ||
| 10735 | @end example | ||
| 10736 | |||
| 10737 | @cindex property, ALT_TITLE | ||
| 10738 | Normally Org uses the headline for its entry in the table of contents. But | ||
| 10739 | with @code{ALT_TITLE} property, a different entry can be specified for the | ||
| 10740 | table of contents. | ||
| 10741 | |||
| 10742 | @node Include files | ||
| 10743 | @section Include files | ||
| 10744 | @cindex include files, during export | ||
| 10745 | Include other files during export. For example, to include your @file{.emacs} | ||
| 10746 | file, you could use: | ||
| 10747 | @cindex #+INCLUDE | ||
| 10748 | |||
| 10749 | @example | ||
| 10750 | #+INCLUDE: "~/.emacs" src emacs-lisp | ||
| 10751 | @end example | ||
| 10752 | |||
| 10753 | @noindent | ||
| 10754 | The first parameter is the file name to include. The optional second | ||
| 10755 | parameter specifies the block type: @samp{example}, @samp{export} or | ||
| 10756 | @samp{src}. The optional third parameter specifies the source code language | ||
| 10757 | to use for formatting the contents. This is relevant to both @samp{export} | ||
| 10758 | and @samp{src} block types. | ||
| 10759 | |||
| 10760 | If an include file is specified as having a markup language, Org neither | ||
| 10761 | checks for valid syntax nor changes the contents in any way. For | ||
| 10762 | @samp{example} and @samp{src} blocks, Org code-escapes the contents before | ||
| 10763 | inclusion. | ||
| 10764 | |||
| 10765 | If an include file is not specified as having any markup language, Org | ||
| 10766 | assumes it be in Org format and proceeds as usual with a few exceptions. Org | ||
| 10767 | makes the footnote labels (@pxref{Footnotes}) in the included file local to | ||
| 10768 | that file. The contents of the included file will belong to the same | ||
| 10769 | structure---headline, item---containing the @code{INCLUDE} keyword. In | ||
| 10770 | particular, headlines within the file will become children of the current | ||
| 10771 | section. That behavior can be changed by providing an additional keyword | ||
| 10772 | parameter, @code{:minlevel}. It shifts the headlines in the included file to | ||
| 10773 | become the lowest level. For example, this syntax makes the included file | ||
| 10774 | a sibling of the current top-level headline: | ||
| 10775 | |||
| 10776 | @example | ||
| 10777 | #+INCLUDE: "~/my-book/chapter2.org" :minlevel 1 | ||
| 10778 | @end example | ||
| 10779 | |||
| 10780 | Inclusion of only portions of files are specified using ranges parameter with | ||
| 10781 | @code{:lines} keyword. The line at the upper end of the range will not be | ||
| 10782 | included. The start and/or the end of the range may be omitted to use the | ||
| 10783 | obvious defaults. | ||
| 10784 | |||
| 10785 | @example | ||
| 10786 | #+INCLUDE: "~/.emacs" :lines "5-10" @r{Include lines 5 to 10, 10 excluded} | ||
| 10787 | #+INCLUDE: "~/.emacs" :lines "-10" @r{Include lines 1 to 10, 10 excluded} | ||
| 10788 | #+INCLUDE: "~/.emacs" :lines "10-" @r{Include lines from 10 to EOF} | ||
| 10789 | @end example | ||
| 10790 | |||
| 10791 | Inclusions may specify a file-link to extract an object matched by | ||
| 10792 | @code{org-link-search}@footnote{Note that | ||
| 10793 | @code{org-link-search-must-match-exact-headline} is locally bound to | ||
| 10794 | non-@code{nil}. Therefore, @code{org-link-search} only matches headlines and | ||
| 10795 | named elements.} (@pxref{Search options}). | ||
| 10796 | |||
| 10797 | To extract only the contents of the matched object, set @code{:only-contents} | ||
| 10798 | property to non-@code{nil}. This will omit any planning lines or property | ||
| 10799 | drawers. The ranges for @code{:lines} keyword are relative to the requested | ||
| 10800 | element. Some examples: | ||
| 10801 | |||
| 10802 | @example | ||
| 10803 | #+INCLUDE: "./paper.org::#theory" :only-contents t | ||
| 10804 | @r{Include the body of the heading with the custom id @samp{theory}} | ||
| 10805 | #+INCLUDE: "./paper.org::mytable" @r{Include named element.} | ||
| 10806 | #+INCLUDE: "./paper.org::*conclusion" :lines 1-20 | ||
| 10807 | @r{Include the first 20 lines of the headline named @samp{conclusion}.} | ||
| 10808 | @end example | ||
| 10809 | |||
| 10810 | @table @kbd | ||
| 10811 | @kindex C-c ' | ||
| 10812 | @item C-c ' | ||
| 10813 | Visit the include file at point. | ||
| 10814 | @end table | ||
| 10815 | |||
| 10816 | @node Macro replacement | ||
| 10817 | @section Macro replacement | ||
| 10818 | @cindex macro replacement, during export | ||
| 10819 | @cindex #+MACRO | ||
| 10820 | |||
| 10821 | Macros replace text snippets during export. This is a macro definition in | ||
| 10822 | Org: | ||
| 10823 | |||
| 10824 | @example | ||
| 10825 | #+MACRO: name replacement text $1, $2 are arguments | ||
| 10826 | @end example | ||
| 10827 | |||
| 10828 | @noindent which can be referenced using | ||
| 10829 | @code{@{@{@{name(arg1, arg2)@}@}@}}@footnote{Since commas separate the | ||
| 10830 | arguments, commas within arguments have to be escaped with the backslash | ||
| 10831 | character. So only those backslash characters before a comma need escaping | ||
| 10832 | with another backslash character.}. | ||
| 10833 | |||
| 10834 | Org recognizes macro references in following Org markup areas: paragraphs, | ||
| 10835 | headlines, verse blocks, tables cells and lists. Org also recognizes macro | ||
| 10836 | references in keywords, such as @code{#+CAPTION}, @code{#+TITLE}, | ||
| 10837 | @code{#+AUTHOR}, @code{#+DATE}, and for some back-end specific export | ||
| 10838 | options. | ||
| 10839 | |||
| 10840 | Org comes with following pre-defined macros: | ||
| 10841 | |||
| 10842 | @table @code | ||
| 10843 | @item @{@{@{title@}@}@} | ||
| 10844 | @itemx @{@{@{author@}@}@} | ||
| 10845 | @itemx @{@{@{email@}@}@} | ||
| 10846 | @cindex title, macro | ||
| 10847 | @cindex author, macro | ||
| 10848 | @cindex email, macro | ||
| 10849 | Org replaces these macro references with available information at the time of | ||
| 10850 | export. | ||
| 10851 | |||
| 10852 | @item @{@{@{date@}@}@} | ||
| 10853 | @itemx @{@{@{date(@var{FORMAT})@}@}@} | ||
| 10854 | @cindex date, macro | ||
| 10855 | This macro refers to the @code{#+DATE} keyword. @var{FORMAT} is an optional | ||
| 10856 | argument to the @code{@{@{@{date@}@}@}} macro that will be used only if | ||
| 10857 | @code{#+DATE} is a single timestamp. @var{FORMAT} should be a format string | ||
| 10858 | understood by @code{format-time-string}. | ||
| 10859 | |||
| 10860 | @item @{@{@{time(@var{FORMAT})@}@}@} | ||
| 10861 | @itemx @{@{@{modification-time(@var{FORMAT}, @var{VC})@}@}@} | ||
| 10862 | @cindex time, macro | ||
| 10863 | @cindex modification time, macro | ||
| 10864 | These macros refer to the document's date and time of export and date and | ||
| 10865 | time of modification. @var{FORMAT} is a string understood by | ||
| 10866 | @code{format-time-string}. If the second argument to the | ||
| 10867 | @code{modification-time} macro is non-@code{nil}, Org uses @file{vc.el} to | ||
| 10868 | retrieve the document's modification time from the version control | ||
| 10869 | system. Otherwise Org reads the file attributes. | ||
| 10870 | |||
| 10871 | @item @{@{@{input-file@}@}@} | ||
| 10872 | @cindex input file, macro | ||
| 10873 | This macro refers to the filename of the exported file. | ||
| 10874 | |||
| 10875 | @item @{@{@{property(@var{PROPERTY-NAME})@}@}@} | ||
| 10876 | @itemx @{@{@{property(@var{PROPERTY-NAME},@var{SEARCH-OPTION})@}@}@} | ||
| 10877 | @cindex property, macro | ||
| 10878 | This macro returns the value of property @var{PROPERTY-NAME} in the current | ||
| 10879 | entry. If @var{SEARCH-OPTION} (@pxref{Search options}) refers to a remote | ||
| 10880 | entry, that will be used instead. | ||
| 10881 | @end table | ||
| 10882 | |||
| 10883 | The surrounding brackets can be made invisible by setting | ||
| 10884 | @code{org-hide-macro-markers} non-@code{nil}. | ||
| 10885 | |||
| 10886 | Org expands macros at the very beginning of the export process. | ||
| 10887 | |||
| 10888 | @node Comment lines | ||
| 10889 | @section Comment lines | ||
| 10890 | @cindex exporting, not | ||
| 10891 | |||
| 10892 | @cindex comment lines | ||
| 10893 | Lines starting with zero or more whitespace characters followed by one | ||
| 10894 | @samp{#} and a whitespace are treated as comments and, as such, are not | ||
| 10895 | exported. | ||
| 10896 | |||
| 10897 | @cindex #+BEGIN_COMMENT | ||
| 10898 | Likewise, regions surrounded by @samp{#+BEGIN_COMMENT} | ||
| 10899 | ... @samp{#+END_COMMENT} are not exported. | ||
| 10900 | |||
| 10901 | @cindex comment trees | ||
| 10902 | Finally, a @samp{COMMENT} keyword at the beginning of an entry, but after any | ||
| 10903 | other keyword or priority cookie, comments out the entire subtree. In this | ||
| 10904 | case, the subtree is not exported and no code block within it is executed | ||
| 10905 | either@footnote{For a less drastic behavior, consider using a select tag | ||
| 10906 | (@pxref{Export settings}) instead.}. The command below helps changing the | ||
| 10907 | comment status of a headline. | ||
| 10908 | |||
| 10909 | @table @kbd | ||
| 10910 | @kindex C-c ; | ||
| 10911 | @item C-c ; | ||
| 10912 | Toggle the @samp{COMMENT} keyword at the beginning of an entry. | ||
| 10913 | @end table | ||
| 10914 | |||
| 10915 | @node ASCII/Latin-1/UTF-8 export | ||
| 10730 | @section ASCII/Latin-1/UTF-8 export | 10916 | @section ASCII/Latin-1/UTF-8 export |
| 10731 | @cindex ASCII export | 10917 | @cindex ASCII export |
| 10732 | @cindex Latin-1 export | 10918 | @cindex Latin-1 export |
| 10733 | @cindex UTF-8 export | 10919 | @cindex UTF-8 export |
| 10734 | 10920 | ||
| 10735 | ASCII export produces a simple and very readable version of an Org mode | 10921 | ASCII export produces an output file containing only plain ASCII characters. |
| 10736 | file, containing only plain ASCII@. Latin-1 and UTF-8 export augment the file | 10922 | This is the most simplest and direct text output. It does not contain any |
| 10737 | with special characters and symbols available in these encodings. | 10923 | Org markup either. Latin-1 and UTF-8 export use additional characters and |
| 10924 | symbols available in these encoding standards. All three of these export | ||
| 10925 | formats offer the most basic of text output for maximum portability. | ||
| 10926 | |||
| 10927 | @vindex org-ascii-text-width | ||
| 10928 | On export, Org fills and justifies text according to the text width set in | ||
| 10929 | @code{org-ascii-text-width}. | ||
| 10738 | 10930 | ||
| 10739 | @vindex org-ascii-links-to-notes | 10931 | @vindex org-ascii-links-to-notes |
| 10740 | Links are exported in a footnote-like style, with the descriptive part in the | 10932 | Org exports links using a footnote-like style where the descriptive part is |
| 10741 | text and the link in a note before the next heading. See the variable | 10933 | in the text and the link is in a note before the next heading. See the |
| 10742 | @code{org-ascii-links-to-notes} for details and other options. | 10934 | variable @code{org-ascii-links-to-notes} for details. |
| 10743 | 10935 | ||
| 10744 | @subheading ASCII export commands | 10936 | @subheading ASCII export commands |
| 10745 | 10937 | ||
| 10746 | @table @kbd | 10938 | @table @kbd |
| 10747 | @orgcmd{C-c C-e t a/l/u,org-ascii-export-to-ascii} | 10939 | @orgcmd{C-c C-e t a/l/u,org-ascii-export-to-ascii} |
| 10748 | Export as an ASCII file. For an Org file, @file{myfile.org}, the ASCII file | 10940 | Export as an ASCII file with a @file{.txt} extension. For @file{myfile.org}, |
| 10749 | will be @file{myfile.txt}. The file will be overwritten without warning. | 10941 | Org exports to @file{myfile.txt}, overwriting without warning. For |
| 10750 | When the original file is @file{myfile.txt}, the resulting file becomes | 10942 | @file{myfile.txt}, Org exports to @file{myfile.txt.txt} in order to prevent |
| 10751 | @file{myfile.txt.txt} in order to prevent data loss. | 10943 | data loss. |
| 10752 | @orgcmd{C-c C-e t A/L/U,org-ascii-export-as-ascii} | 10944 | @orgcmd{C-c C-e t A/L/U,org-ascii-export-as-ascii} |
| 10753 | Export to a temporary buffer. Do not create a file. | 10945 | Export to a temporary buffer. Does not create a file. |
| 10946 | @end table | ||
| 10947 | |||
| 10948 | @subheading ASCII specific export settings | ||
| 10949 | The ASCII export back-end has one extra keyword for customizing ASCII output. | ||
| 10950 | Setting this keyword works similar to the general options (@pxref{Export | ||
| 10951 | settings}). | ||
| 10952 | |||
| 10953 | @table @samp | ||
| 10954 | @item SUBTITLE | ||
| 10955 | @cindex #+SUBTITLE (ASCII) | ||
| 10956 | The document subtitle. For long subtitles, use multiple @code{#+SUBTITLE} | ||
| 10957 | lines in the Org file. Org prints them on one continuous line, wrapping into | ||
| 10958 | multiple lines if necessary. | ||
| 10754 | @end table | 10959 | @end table |
| 10755 | 10960 | ||
| 10756 | @subheading Header and sectioning structure | 10961 | @subheading Header and sectioning structure |
| 10757 | 10962 | ||
| 10758 | In the exported version, the first three outline levels become headlines, | 10963 | Org converts the first three outline levels into headlines for ASCII export. |
| 10759 | defining a general document structure. Additional levels are exported as | 10964 | The remaining levels are turned into lists. To change this cut-off point |
| 10760 | lists. The transition can also occur at a different level (@pxref{Export | 10965 | where levels become lists, @pxref{Export settings}. |
| 10761 | settings}). | ||
| 10762 | 10966 | ||
| 10763 | @subheading Quoting ASCII text | 10967 | @subheading Quoting ASCII text |
| 10764 | 10968 | ||
| 10765 | You can insert text that will only appear when using @code{ASCII} back-end | 10969 | To insert text within the Org file by the ASCII back-end, use one the |
| 10766 | with the following constructs: | 10970 | following constructs, inline, keyword, or export block: |
| 10767 | 10971 | ||
| 10768 | @cindex #+ASCII | 10972 | @cindex #+ASCII |
| 10769 | @cindex #+BEGIN_ASCII | 10973 | @cindex #+BEGIN_EXPORT ascii |
| 10770 | @example | 10974 | @example |
| 10771 | Text @@@@ascii:and additional text@@@@ within a paragraph. | 10975 | Inline text @@@@ascii:and additional text@@@@ within a paragraph. |
| 10772 | 10976 | ||
| 10773 | #+ASCII: Some text | 10977 | #+ASCII: Some text |
| 10774 | 10978 | ||
| 10775 | #+BEGIN_ASCII | 10979 | #+BEGIN_EXPORT ascii |
| 10776 | All lines in this block will appear only when using this back-end. | 10980 | Org exports text in this block only when using ASCII back-end. |
| 10777 | #+END_ASCII | 10981 | #+END_EXPORT |
| 10778 | @end example | 10982 | @end example |
| 10779 | 10983 | ||
| 10780 | @subheading ASCII specific attributes | 10984 | @subheading ASCII specific attributes |
| 10781 | @cindex #+ATTR_ASCII | 10985 | @cindex #+ATTR_ASCII |
| 10782 | @cindex horizontal rules, in ASCII export | 10986 | @cindex horizontal rules, in ASCII export |
| 10783 | 10987 | ||
| 10784 | @code{ASCII} back-end only understands one attribute, @code{:width}, which | 10988 | ASCII back-end recognizes only one attribute, @code{:width}, which specifies |
| 10785 | specifies the length, in characters, of a given horizontal rule. It must be | 10989 | the width of an horizontal rule in number of characters. The keyword and |
| 10786 | specified using an @code{ATTR_ASCII} line, directly preceding the rule. | 10990 | syntax for specifying widths is: |
| 10787 | 10991 | ||
| 10788 | @example | 10992 | @example |
| 10789 | #+ATTR_ASCII: :width 10 | 10993 | #+ATTR_ASCII: :width 10 |
| 10790 | ----- | 10994 | ----- |
| 10791 | @end example | 10995 | @end example |
| 10792 | 10996 | ||
| 10793 | @node Beamer export, HTML export, ASCII/Latin-1/UTF-8 export, Exporting | 10997 | @subheading ASCII special blocks |
| 10998 | @cindex special blocks, in ASCII export | ||
| 10999 | @cindex #+BEGIN_JUSTIFYLEFT | ||
| 11000 | @cindex #+BEGIN_JUSTIFYRIGHT | ||
| 11001 | |||
| 11002 | Besides @code{#+BEGIN_CENTER} blocks (@pxref{Paragraphs}), ASCII back-end has | ||
| 11003 | these two left and right justification blocks: | ||
| 11004 | |||
| 11005 | @example | ||
| 11006 | #+BEGIN_JUSTIFYLEFT | ||
| 11007 | It's just a jump to the left... | ||
| 11008 | #+END_JUSTIFYLEFT | ||
| 11009 | |||
| 11010 | #+BEGIN_JUSTIFYRIGHT | ||
| 11011 | ...and then a step to the right. | ||
| 11012 | #+END_JUSTIFYRIGHT | ||
| 11013 | @end example | ||
| 11014 | |||
| 11015 | @node Beamer export | ||
| 10794 | @section Beamer export | 11016 | @section Beamer export |
| 10795 | @cindex Beamer export | 11017 | @cindex Beamer export |
| 10796 | 11018 | ||
| 10797 | The @LaTeX{} class @emph{Beamer} allows production of high quality | 11019 | Org uses @emph{Beamer} export to convert an Org file tree structure into a |
| 10798 | presentations using @LaTeX{} and pdf processing. Org mode has special | 11020 | high-quality interactive slides for presentations. @emph{Beamer} is a |
| 10799 | support for turning an Org mode file or tree into a Beamer presentation. | 11021 | @LaTeX{} document class for creating presentations in PDF, HTML, and other |
| 11022 | popular display formats. | ||
| 10800 | 11023 | ||
| 10801 | @subheading Beamer export commands | 11024 | @menu |
| 11025 | * Beamer export commands:: For creating Beamer documents. | ||
| 11026 | * Beamer specific export settings:: For customizing Beamer export. | ||
| 11027 | * Sectioning Frames and Blocks in Beamer:: For composing Beamer slides. | ||
| 11028 | * Beamer specific syntax:: For using in Org documents. | ||
| 11029 | * Editing support:: For using helper functions. | ||
| 11030 | * A Beamer example:: A complete presentation. | ||
| 11031 | @end menu | ||
| 11032 | |||
| 11033 | @node Beamer export commands | ||
| 11034 | @subsection Beamer export commands | ||
| 10802 | 11035 | ||
| 10803 | @table @kbd | 11036 | @table @kbd |
| 10804 | @orgcmd{C-c C-e l b,org-beamer-export-to-latex} | 11037 | @orgcmd{C-c C-e l b,org-beamer-export-to-latex} |
| 10805 | Export as a @LaTeX{} file. For an Org file @file{myfile.org}, the @LaTeX{} | 11038 | Export as @LaTeX{} file with a @file{.tex} extension. For @file{myfile.org}, |
| 10806 | file will be @file{myfile.tex}. The file will be overwritten without | 11039 | Org exports to @file{myfile.tex}, overwriting without warning. |
| 10807 | warning. | ||
| 10808 | @orgcmd{C-c C-e l B,org-beamer-export-as-latex} | 11040 | @orgcmd{C-c C-e l B,org-beamer-export-as-latex} |
| 10809 | Export to a temporary buffer. Do not create a file. | 11041 | Export to a temporary buffer. Does not create a file. |
| 10810 | @orgcmd{C-c C-e l P,org-beamer-export-to-pdf} | 11042 | @orgcmd{C-c C-e l P,org-beamer-export-to-pdf} |
| 10811 | Export as @LaTeX{} and then process to PDF. | 11043 | Export as @LaTeX{} file and then convert it to PDF format. |
| 10812 | @item C-c C-e l O | 11044 | @item C-c C-e l O |
| 10813 | Export as @LaTeX{} and then process to PDF, then open the resulting PDF file. | 11045 | Export as @LaTeX{} file, convert it to PDF format, and then open the PDF |
| 11046 | file. | ||
| 11047 | @end table | ||
| 11048 | |||
| 11049 | @node Beamer specific export settings | ||
| 11050 | @subsection Beamer specific export settings | ||
| 11051 | |||
| 11052 | Beamer export back-end has several additional keywords for customizing Beamer | ||
| 11053 | output. These keywords work similar to the general options settings | ||
| 11054 | (@pxref{Export settings}). | ||
| 11055 | |||
| 11056 | @table @samp | ||
| 11057 | @item BEAMER_THEME | ||
| 11058 | @cindex #+BEAMER_THEME | ||
| 11059 | @vindex org-beamer-theme | ||
| 11060 | The Beamer layout theme (@code{org-beamer-theme}). Use square brackets for | ||
| 11061 | options. For example: | ||
| 11062 | @smallexample | ||
| 11063 | #+BEAMER_THEME: Rochester [height=20pt] | ||
| 11064 | @end smallexample | ||
| 11065 | |||
| 11066 | @item BEAMER_FONT_THEME | ||
| 11067 | @cindex #+BEAMER_FONT_THEME | ||
| 11068 | The Beamer font theme. | ||
| 11069 | |||
| 11070 | @item BEAMER_INNER_THEME | ||
| 11071 | @cindex #+BEAMER_INNER_THEME | ||
| 11072 | The Beamer inner theme. | ||
| 11073 | |||
| 11074 | @item BEAMER_OUTER_THEME | ||
| 11075 | @cindex #+BEAMER_OUTER_THEME | ||
| 11076 | The Beamer outer theme. | ||
| 11077 | |||
| 11078 | @item BEAMER_HEADER | ||
| 11079 | @cindex #+BEAMER_HEADER | ||
| 11080 | Arbitrary lines inserted in the preamble, just before the @samp{hyperref} | ||
| 11081 | settings. | ||
| 11082 | |||
| 11083 | @item DESCRIPTION | ||
| 11084 | @cindex #+DESCRIPTION (Beamer) | ||
| 11085 | The document description. For long descriptions, use multiple | ||
| 11086 | @code{#+DESCRIPTION} keywords. By default, @samp{hyperref} inserts | ||
| 11087 | @code{#+DESCRIPTION} as metadata. Use @code{org-latex-hyperref-template} to | ||
| 11088 | configure document metadata. Use @code{org-latex-title-command} to configure | ||
| 11089 | typesetting of description as part of front matter. | ||
| 11090 | |||
| 11091 | @item KEYWORDS | ||
| 11092 | @cindex #+KEYWORDS (Beamer) | ||
| 11093 | The keywords for defining the contents of the document. Use multiple | ||
| 11094 | @code{#+KEYWORDS} lines if necessary. By default, @samp{hyperref} inserts | ||
| 11095 | @code{#+KEYWORDS} as metadata. Use @code{org-latex-hyperref-template} to | ||
| 11096 | configure document metadata. Use @code{org-latex-title-command} to configure | ||
| 11097 | typesetting of keywords as part of front matter. | ||
| 11098 | |||
| 11099 | @item SUBTITLE | ||
| 11100 | @cindex #+SUBTITLE (Beamer) | ||
| 11101 | @vindex org-beamer-subtitle-format | ||
| 11102 | Document's subtitle. For typesetting, use @code{org-beamer-subtitle-format} | ||
| 11103 | string. Use @code{org-latex-hyperref-template} to configure document | ||
| 11104 | metadata. Use @code{org-latex-title-command} to configure typesetting of | ||
| 11105 | subtitle as part of front matter. | ||
| 10814 | @end table | 11106 | @end table |
| 10815 | 11107 | ||
| 10816 | @subheading Sectioning, Frames and Blocks | 11108 | @node Sectioning Frames and Blocks in Beamer |
| 11109 | @subsection Sectioning, Frames and Blocks in Beamer | ||
| 10817 | 11110 | ||
| 10818 | Any tree with not-too-deep level nesting should in principle be exportable as | 11111 | Org transforms heading levels into Beamer's sectioning elements, frames and |
| 10819 | a Beamer presentation. Headlines fall into three categories: sectioning | 11112 | blocks. Any Org tree with a not-too-deep-level nesting should in principle |
| 10820 | elements, frames and blocks. | 11113 | be exportable as a Beamer presentation. |
| 10821 | 11114 | ||
| 10822 | @itemize @minus | 11115 | @itemize @minus |
| 10823 | @item | 11116 | @item |
| 10824 | @vindex org-beamer-frame-level | 11117 | @vindex org-beamer-frame-level |
| 10825 | Headlines become frames when their level is equal to | 11118 | Org headlines become Beamer frames when the heading level in Org is equal to |
| 10826 | @code{org-beamer-frame-level} or @code{H} value in an @code{OPTIONS} line | 11119 | @code{org-beamer-frame-level} or @code{H} value in an @code{OPTIONS} line |
| 10827 | (@pxref{Export settings}). | 11120 | (@pxref{Export settings}). |
| 10828 | 11121 | ||
| 10829 | @cindex property, BEAMER_ENV | 11122 | @cindex property, BEAMER_ENV |
| 10830 | Though, if a headline in the current tree has a @code{BEAMER_ENV} property | 11123 | Org overrides headlines to frames conversion for the current tree of an Org |
| 10831 | set to either to @code{frame} or @code{fullframe}, its level overrides the | 11124 | file if it encounters the @code{BEAMER_ENV} property set to @code{frame} or |
| 10832 | variable. A @code{fullframe} is a frame with an empty (ignored) title. | 11125 | @code{fullframe}. Org ignores whatever @code{org-beamer-frame-level} happens |
| 11126 | to be for that headline level in the Org tree. In Beamer terminology, a | ||
| 11127 | @code{fullframe} is a frame without its title. | ||
| 10833 | 11128 | ||
| 10834 | @item | 11129 | @item |
| 10835 | @vindex org-beamer-environments-default | 11130 | @vindex org-beamer-environments-default |
| 10836 | @vindex org-beamer-environments-extra | 11131 | @vindex org-beamer-environments-extra |
| 10837 | All frame's children become @code{block} environments. Special block types | 11132 | Org exports a Beamer frame's objects as @code{block} environments. Org can |
| 10838 | can be enforced by setting headline's @code{BEAMER_ENV} property@footnote{If | 11133 | enforce wrapping in special block types when @code{BEAMER_ENV} property is |
| 10839 | this property is set, the entry will also get a @code{:B_environment:} tag to | 11134 | set@footnote{If @code{BEAMER_ENV} is set, Org export adds |
| 10840 | make this visible. This tag has no semantic meaning, it is only a visual | 11135 | @code{:B_environment:} tag to make it visible. The tag serves as a visual |
| 10841 | aid.} to an appropriate value (see @code{org-beamer-environments-default} for | 11136 | aid and has no semantic relevance.}. For valid values see |
| 10842 | supported values and @code{org-beamer-environments-extra} for adding more). | 11137 | @code{org-beamer-environments-default}. To add more values, see |
| 11138 | @code{org-beamer-environments-extra}. | ||
| 10843 | 11139 | ||
| 10844 | @item | 11140 | @item |
| 10845 | @cindex property, BEAMER_REF | 11141 | @cindex property, BEAMER_REF |
| 10846 | As a special case, if the @code{BEAMER_ENV} property is set to either | 11142 | If @code{BEAMER_ENV} is set to @code{appendix}, Org exports the entry as an |
| 10847 | @code{appendix}, @code{note}, @code{noteNH} or @code{againframe}, the | 11143 | appendix. When set to @code{note}, Org exports the entry as a note within |
| 10848 | headline will become, respectively, an appendix, a note (within frame or | 11144 | the frame or between frames, depending on the entry's heading level. When |
| 10849 | between frame, depending on its level), a note with its title ignored or an | 11145 | set to @code{noteNH}, Org exports the entry as a note without its title. |
| 10850 | @code{\againframe} command. In the latter case, a @code{BEAMER_REF} property | 11146 | When set to @code{againframe}, Org exports the entry with @code{\againframe} |
| 10851 | is mandatory in order to refer to the frame being resumed, and contents are | 11147 | command, which makes setting the @code{BEAMER_REF} property mandatory because |
| 10852 | ignored. | 11148 | @code{\againframe} needs frame to resume. |
| 10853 | 11149 | ||
| 10854 | Also, a headline with an @code{ignoreheading} environment will have its | 11150 | When @code{ignoreheading} is set, Org export ignores the entry's headline but |
| 10855 | contents only inserted in the output. This special value is useful to have | 11151 | not its content. This is useful for inserting content between frames. It is |
| 10856 | data between frames, or to properly close a @code{column} environment. | 11152 | also useful for properly closing a @code{column} environment. |
| 10857 | @end itemize | 11153 | @end itemize |
| 10858 | 11154 | ||
| 10859 | @cindex property, BEAMER_ACT | 11155 | @cindex property, BEAMER_ACT |
| 10860 | @cindex property, BEAMER_OPT | 11156 | @cindex property, BEAMER_OPT |
| 10861 | Headlines also support @code{BEAMER_ACT} and @code{BEAMER_OPT} properties. | 11157 | When @code{BEAMER_ACT} is set for a headline, Org export translates that |
| 10862 | The former is translated as an overlay/action specification, or a default | 11158 | headline as an overlay or action specification. When enclosed in square |
| 10863 | overlay specification when enclosed within square brackets. The latter | 11159 | brackets, Org export makes the overlay specification a default. Use |
| 10864 | specifies options@footnote{The @code{fragile} option is added automatically | 11160 | @code{BEAMER_OPT} to set any options applicable to the current Beamer frame |
| 10865 | if it contains code that requires a verbatim environment, though.} for the | 11161 | or block. The Beamer export back-end wraps with appropriate angular or |
| 10866 | current frame or block. The export back-end will automatically wrap | 11162 | square brackets. It also adds the @code{fragile} option for any code that may |
| 10867 | properties within angular or square brackets when appropriate. | 11163 | require a verbatim block. |
| 10868 | 11164 | ||
| 10869 | @cindex property, BEAMER_COL | 11165 | @cindex property, BEAMER_COL |
| 10870 | Moreover, headlines handle the @code{BEAMER_COL} property. Its value should | 11166 | To create a column on the Beamer slide, use the @code{BEAMER_COL} property |
| 10871 | be a decimal number representing the width of the column as a fraction of the | 11167 | for its headline in the Org file. Set the value of @code{BEAMER_COL} to a |
| 10872 | total text width. If the headline has no specific environment, its title | 11168 | decimal number representing the fraction of the total text width. Beamer |
| 10873 | will be ignored and its contents will fill the column created. Otherwise, | 11169 | export uses this value to set the column's width and fills the column with |
| 10874 | the block will fill the whole column and the title will be preserved. Two | 11170 | the contents of the Org entry. If the Org entry has no specific environment |
| 10875 | contiguous headlines with a non-@code{nil} @code{BEAMER_COL} value share the same | 11171 | defined, Beamer export ignores the heading. If the Org entry has a defined |
| 10876 | @code{columns} @LaTeX{} environment. It will end before the next headline | 11172 | environment, Beamer export uses the heading as title. Behind the scenes, |
| 10877 | without such a property. This environment is generated automatically. | 11173 | Beamer export automatically handles @LaTeX{} column separations for |
| 10878 | Although, it can also be explicitly created, with a special @code{columns} | 11174 | contiguous headlines. To manually adjust them for any unique configurations |
| 10879 | value for @code{BEAMER_ENV} property (if it needs to be set up with some | 11175 | needs, use the @code{BEAMER_ENV} property. |
| 10880 | specific options, for example). | 11176 | |
| 10881 | 11177 | @node Beamer specific syntax | |
| 10882 | @subheading Beamer specific syntax | 11178 | @subsection Beamer specific syntax |
| 10883 | 11179 | Since Org's Beamer export back-end is an extension of the @LaTeX{} back-end, | |
| 10884 | Beamer back-end is an extension of @LaTeX{} back-end. As such, all @LaTeX{} | 11180 | it recognizes other @LaTeX{} specific syntax---for example, @samp{#+LATEX:} |
| 10885 | specific syntax (e.g., @samp{#+LATEX:} or @samp{#+ATTR_LATEX:}) is | 11181 | or @samp{#+ATTR_LATEX:}. @xref{@LaTeX{} export}, for details. |
| 10886 | recognized. See @ref{@LaTeX{} and PDF export} for more information. | 11182 | |
| 10887 | 11183 | Beamer export wraps the table of contents generated with @code{toc:t} | |
| 10888 | @cindex #+BEAMER_THEME | 11184 | @code{OPTION} keyword in a @code{frame} environment. Beamer export does not |
| 10889 | @cindex #+BEAMER_COLOR_THEME | 11185 | wrap the table of contents generated with @code{TOC} keyword (@pxref{Table of |
| 10890 | @cindex #+BEAMER_FONT_THEME | 11186 | contents}). Use square brackets for specifying options. |
| 10891 | @cindex #+BEAMER_INNER_THEME | ||
| 10892 | @cindex #+BEAMER_OUTER_THEME | ||
| 10893 | Beamer export introduces a number of keywords to insert code in the | ||
| 10894 | document's header. Four control appearance of the presentation: | ||
| 10895 | @code{#+BEAMER_THEME}, @code{#+BEAMER_COLOR_THEME}, | ||
| 10896 | @code{#+BEAMER_FONT_THEME}, @code{#+BEAMER_INNER_THEME} and | ||
| 10897 | @code{#+BEAMER_OUTER_THEME}. All of them accept optional arguments | ||
| 10898 | within square brackets. The last one, @code{#+BEAMER_HEADER}, is more | ||
| 10899 | generic and allows you to append any line of code in the header. | ||
| 10900 | |||
| 10901 | @example | ||
| 10902 | #+BEAMER_THEME: Rochester [height=20pt] | ||
| 10903 | #+BEAMER_COLOR_THEME: spruce | ||
| 10904 | @end example | ||
| 10905 | |||
| 10906 | Table of contents generated from @code{toc:t} @code{OPTION} keyword are | ||
| 10907 | wrapped within a @code{frame} environment. Those generated from a @code{TOC} | ||
| 10908 | keyword (@pxref{Table of contents}) are not. In that case, it is also | ||
| 10909 | possible to specify options, enclosed within square brackets. | ||
| 10910 | 11187 | ||
| 10911 | @example | 11188 | @example |
| 10912 | #+TOC: headlines [currentsection] | 11189 | #+TOC: headlines [currentsection] |
| 10913 | @end example | 11190 | @end example |
| 10914 | 11191 | ||
| 10915 | Beamer specific code can be inserted with the following constructs: | 11192 | Insert Beamer-specific code using the following constructs: |
| 10916 | 11193 | ||
| 10917 | @cindex #+BEAMER | 11194 | @cindex #+BEAMER |
| 10918 | @cindex #+BEGIN_BEAMER | 11195 | @cindex #+BEGIN_EXPORT beamer |
| 10919 | @example | 11196 | @example |
| 10920 | #+BEAMER: \pause | 11197 | #+BEAMER: \pause |
| 10921 | 11198 | ||
| 10922 | #+BEGIN_BEAMER | 11199 | #+BEGIN_EXPORT beamer |
| 10923 | All lines in this block will appear only when using this back-end. | 11200 | Only Beamer export back-end will export this line. |
| 10924 | #+END_BEAMER | 11201 | #+END_BEAMER |
| 10925 | 11202 | ||
| 10926 | Text @@@@beamer:some code@@@@ within a paragraph. | 11203 | Text @@@@beamer:some code@@@@ within a paragraph. |
| 10927 | @end example | 11204 | @end example |
| 10928 | 11205 | ||
| 10929 | In particular, this last example can be used to add overlay specifications to | 11206 | Inline constructs, such as the last one above, are useful for adding overlay |
| 10930 | objects whose type is among @code{bold}, @code{item}, @code{link}, | 11207 | specifications to objects with @code{bold}, @code{item}, @code{link}, |
| 10931 | @code{radio-target} and @code{target}, when the value is enclosed within | 11208 | @code{radio-target} and @code{target} types. Enclose the value in angular |
| 10932 | angular brackets and put at the beginning the object. | 11209 | brackets and place the specification at the beginning the object as shown in |
| 11210 | this example: | ||
| 10933 | 11211 | ||
| 10934 | @example | 11212 | @example |
| 10935 | A *@@@@beamer:<2->@@@@useful* feature | 11213 | A *@@@@beamer:<2->@@@@useful* feature |
| 10936 | @end example | 11214 | @end example |
| 10937 | 11215 | ||
| 10938 | @cindex #+ATTR_BEAMER | 11216 | @cindex #+ATTR_BEAMER |
| 10939 | Eventually, every plain list has support for @code{:environment}, | 11217 | Beamer export recognizes the @code{ATTR_BEAMER} keyword with the following |
| 10940 | @code{:overlay} and @code{:options} attributes through | 11218 | attributes from Beamer configurations: @code{:environment} for changing local |
| 10941 | @code{ATTR_BEAMER} affiliated keyword. The first one allows the use | 11219 | Beamer environment, @code{:overlay} for specifying Beamer overlays in angular |
| 10942 | of a different environment, the second sets overlay specifications and | 11220 | or square brackets, and @code{:options} for inserting optional arguments. |
| 10943 | the last one inserts optional arguments in current list environment. | ||
| 10944 | 11221 | ||
| 10945 | @example | 11222 | @example |
| 10946 | #+ATTR_BEAMER: :overlay +- | 11223 | #+ATTR_BEAMER: :environment nonindentlist |
| 11224 | - item 1, not indented | ||
| 11225 | - item 2, not indented | ||
| 11226 | - item 3, not indented | ||
| 11227 | @end example | ||
| 11228 | |||
| 11229 | @example | ||
| 11230 | #+ATTR_BEAMER: :overlay <+-> | ||
| 10947 | - item 1 | 11231 | - item 1 |
| 10948 | - item 2 | 11232 | - item 2 |
| 10949 | @end example | 11233 | @end example |
| 10950 | 11234 | ||
| 10951 | @subheading Editing support | 11235 | @example |
| 11236 | #+ATTR_BEAMER: :options [Lagrange] | ||
| 11237 | Let $G$ be a finite group, and let $H$ be | ||
| 11238 | a subgroup of $G$. Then the order of $H$ divides the order of $G$. | ||
| 11239 | @end example | ||
| 10952 | 11240 | ||
| 10953 | You can turn on a special minor mode @code{org-beamer-mode} for faster | 11241 | @node Editing support |
| 10954 | editing with: | 11242 | @subsection Editing support |
| 11243 | |||
| 11244 | |||
| 11245 | The @code{org-beamer-mode} is a special minor mode for faster editing of | ||
| 11246 | Beamer documents. | ||
| 10955 | 11247 | ||
| 10956 | @example | 11248 | @example |
| 10957 | #+STARTUP: beamer | 11249 | #+STARTUP: beamer |
| @@ -10959,23 +11251,19 @@ editing with: | |||
| 10959 | 11251 | ||
| 10960 | @table @kbd | 11252 | @table @kbd |
| 10961 | @orgcmd{C-c C-b,org-beamer-select-environment} | 11253 | @orgcmd{C-c C-b,org-beamer-select-environment} |
| 10962 | In @code{org-beamer-mode}, this key offers fast selection of a Beamer | 11254 | The @code{org-beamer-mode} provides this key for quicker selections in Beamer |
| 10963 | environment or the @code{BEAMER_COL} property. | 11255 | normal environments, and for selecting the @code{BEAMER_COL} property. |
| 10964 | @end table | 11256 | @end table |
| 10965 | 11257 | ||
| 10966 | Also, a template for useful in-buffer settings or properties can be inserted | 11258 | @node A Beamer example |
| 10967 | into the buffer with @kbd{M-x org-beamer-insert-options-template}. Among | 11259 | @subsection A Beamer example |
| 10968 | other things, this will install a column view format which is very handy for | ||
| 10969 | editing special properties used by Beamer. | ||
| 10970 | 11260 | ||
| 10971 | @subheading An example | 11261 | Here is an example of an Org document ready for Beamer export. |
| 10972 | 11262 | ||
| 10973 | Here is a simple example Org document that is intended for Beamer export. | 11263 | @example |
| 10974 | |||
| 10975 | @smallexample | ||
| 10976 | #+TITLE: Example Presentation | 11264 | #+TITLE: Example Presentation |
| 10977 | #+AUTHOR: Carsten Dominik | 11265 | #+AUTHOR: Carsten Dominik |
| 10978 | #+OPTIONS: H:2 | 11266 | #+OPTIONS: H:2 toc:t num:t |
| 10979 | #+LATEX_CLASS: beamer | 11267 | #+LATEX_CLASS: beamer |
| 10980 | #+LATEX_CLASS_OPTIONS: [presentation] | 11268 | #+LATEX_CLASS_OPTIONS: [presentation] |
| 10981 | #+BEAMER_THEME: Madrid | 11269 | #+BEAMER_THEME: Madrid |
| @@ -10984,91 +11272,148 @@ Here is a simple example Org document that is intended for Beamer export. | |||
| 10984 | * This is the first structural section | 11272 | * This is the first structural section |
| 10985 | 11273 | ||
| 10986 | ** Frame 1 | 11274 | ** Frame 1 |
| 10987 | *** Thanks to Eric Fraga :B_block:BMCOL: | 11275 | *** Thanks to Eric Fraga :B_block: |
| 10988 | :PROPERTIES: | 11276 | :PROPERTIES: |
| 10989 | :BEAMER_COL: 0.48 | 11277 | :BEAMER_COL: 0.48 |
| 10990 | :BEAMER_ENV: block | 11278 | :BEAMER_ENV: block |
| 10991 | :END: | 11279 | :END: |
| 10992 | for the first viable Beamer setup in Org | 11280 | for the first viable Beamer setup in Org |
| 10993 | *** Thanks to everyone else :B_block:BMCOL: | 11281 | *** Thanks to everyone else :B_block: |
| 10994 | :PROPERTIES: | 11282 | :PROPERTIES: |
| 10995 | :BEAMER_COL: 0.48 | 11283 | :BEAMER_COL: 0.48 |
| 10996 | :BEAMER_ACT: <2-> | 11284 | :BEAMER_ACT: <2-> |
| 10997 | :BEAMER_ENV: block | 11285 | :BEAMER_ENV: block |
| 10998 | :END: | 11286 | :END: |
| 10999 | for contributing to the discussion | 11287 | for contributing to the discussion |
| 11000 | **** This will be formatted as a beamer note :B_note: | 11288 | **** This will be formatted as a beamer note :B_note: |
| 11001 | :PROPERTIES: | 11289 | :PROPERTIES: |
| 11002 | :BEAMER_env: note | 11290 | :BEAMER_env: note |
| 11003 | :END: | 11291 | :END: |
| 11004 | ** Frame 2 (where we will not use columns) | 11292 | ** Frame 2 (where we will not use columns) |
| 11005 | *** Request | 11293 | *** Request |
| 11006 | Please test this stuff! | 11294 | Please test this stuff! |
| 11007 | @end smallexample | 11295 | @end example |
| 11008 | 11296 | ||
| 11009 | @node HTML export, @LaTeX{} and PDF export, Beamer export, Exporting | 11297 | @node HTML export |
| 11010 | @section HTML export | 11298 | @section HTML export |
| 11011 | @cindex HTML export | 11299 | @cindex HTML export |
| 11012 | 11300 | ||
| 11013 | Org mode contains an HTML (XHTML 1.0 strict) exporter with extensive | 11301 | Org mode contains an HTML exporter with extensive HTML formatting compatible |
| 11014 | HTML formatting, in ways similar to John Gruber's @emph{markdown} | 11302 | with XHTML 1.0 strict standard. |
| 11015 | language, but with additional support for tables. | ||
| 11016 | 11303 | ||
| 11017 | @menu | 11304 | @menu |
| 11018 | * HTML Export commands:: How to invoke HTML export | 11305 | * HTML Export commands:: Invoking HTML export |
| 11019 | * HTML doctypes:: Org can export to various (X)HTML flavors | 11306 | * HTML Specific export settings:: Settings for HTML export |
| 11020 | * HTML preamble and postamble:: How to insert a preamble and a postamble | 11307 | * HTML doctypes:: Exporting various (X)HTML flavors |
| 11021 | * Quoting HTML tags:: Using direct HTML in Org mode | 11308 | * HTML preamble and postamble:: Inserting preamble and postamble |
| 11022 | * Links in HTML export:: How links will be interpreted and formatted | 11309 | * Quoting HTML tags:: Using direct HTML in Org files |
| 11023 | * Tables in HTML export:: How to modify the formatting of tables | 11310 | * Links in HTML export:: Interpreting and formatting links |
| 11024 | * Images in HTML export:: How to insert figures into HTML output | 11311 | * Tables in HTML export:: Formatting and modifying tables |
| 11025 | * Math formatting in HTML export:: Beautiful math also on the web | 11312 | * Images in HTML export:: Inserting figures with HTML output |
| 11026 | * Text areas in HTML export:: An alternative way to show an example | 11313 | * Math formatting in HTML export:: Handling math equations |
| 11027 | * CSS support:: Changing the appearance of the output | 11314 | * Text areas in HTML export:: Showing an alternate approach, an example |
| 11028 | * JavaScript support:: Info and Folding in a web browser | 11315 | * CSS support:: Styling HTML output |
| 11316 | * JavaScript support:: Folding scripting in the web browser | ||
| 11029 | @end menu | 11317 | @end menu |
| 11030 | 11318 | ||
| 11031 | @node HTML Export commands, HTML doctypes, HTML export, HTML export | 11319 | |
| 11320 | @node HTML Export commands | ||
| 11032 | @subsection HTML export commands | 11321 | @subsection HTML export commands |
| 11033 | 11322 | ||
| 11034 | @table @kbd | 11323 | @table @kbd |
| 11035 | @orgcmd{C-c C-e h h,org-html-export-to-html} | 11324 | @orgcmd{C-c C-e h h,org-html-export-to-html} |
| 11036 | Export as an HTML file. For an Org file @file{myfile.org}, | 11325 | Export as HTML file with a @file{.html} extension. For @file{myfile.org}, |
| 11037 | the HTML file will be @file{myfile.html}. The file will be overwritten | 11326 | Org exports to @file{myfile.html}, overwriting without warning. @kbd{C-c C-e |
| 11038 | without warning. | 11327 | h o} Exports to HTML and opens it in a web browser. |
| 11039 | @kbd{C-c C-e h o} | 11328 | |
| 11040 | Export as an HTML file and immediately open it with a browser. | ||
| 11041 | @orgcmd{C-c C-e h H,org-html-export-as-html} | 11329 | @orgcmd{C-c C-e h H,org-html-export-as-html} |
| 11042 | Export to a temporary buffer. Do not create a file. | 11330 | Exports to a temporary buffer. Does not create a file. |
| 11043 | @end table | 11331 | @end table |
| 11044 | 11332 | ||
| 11045 | @c FIXME Exporting sublevels | 11333 | @node HTML Specific export settings |
| 11046 | @c @cindex headline levels, for exporting | 11334 | @subsection HTML Specific export settings |
| 11047 | @c In the exported version, the first 3 outline levels will become headlines, | 11335 | HTML export has a number of keywords, similar to the general options settings |
| 11048 | @c defining a general document structure. Additional levels will be exported as | 11336 | described in @ref{Export settings}. |
| 11049 | @c itemized lists. If you want that transition to occur at a different level, | ||
| 11050 | @c specify it with a numeric prefix argument. For example, | ||
| 11051 | 11337 | ||
| 11052 | @c @example | 11338 | @table @samp |
| 11053 | @c @kbd{C-2 C-c C-e b} | 11339 | @item DESCRIPTION |
| 11054 | @c @end example | 11340 | @cindex #+DESCRIPTION (HTML) |
| 11341 | This is the document's description, which the HTML exporter inserts it as a | ||
| 11342 | HTML meta tag in the HTML file. For long descriptions, use multiple | ||
| 11343 | @code{#+DESCRIPTION} lines. The exporter takes care of wrapping the lines | ||
| 11344 | properly. | ||
| 11345 | |||
| 11346 | @item HTML_DOCTYPE | ||
| 11347 | @cindex #+HTML_DOCTYPE | ||
| 11348 | @vindex org-html-doctype | ||
| 11349 | Specify the document type, for example: HTML5 (@code{org-html-doctype}). | ||
| 11055 | 11350 | ||
| 11056 | @c @noindent | 11351 | @item HTML_CONTAINER |
| 11057 | @c creates two levels of headings and does the rest as items. | 11352 | @cindex #+HTML_CONTAINER |
| 11353 | @vindex org-html-container-element | ||
| 11354 | Specify the HTML container, such as @samp{div}, for wrapping sections and | ||
| 11355 | elements (@code{org-html-container-element}). | ||
| 11356 | |||
| 11357 | @item HTML_LINK_HOME | ||
| 11358 | @cindex #+HTML_LINK_HOME | ||
| 11359 | @vindex org-html-link-home | ||
| 11360 | The URL for home link (@code{org-html-link-home}). | ||
| 11361 | |||
| 11362 | @item HTML_LINK_UP | ||
| 11363 | @cindex #+HTML_LINK_UP | ||
| 11364 | @vindex org-html-link-up | ||
| 11365 | The URL for the up link of exported HTML pages (@code{org-html-link-up}). | ||
| 11366 | |||
| 11367 | @item HTML_MATHJAX | ||
| 11368 | @cindex #+HTML_MATHJAX | ||
| 11369 | @vindex org-html-mathjax-options | ||
| 11370 | Options for MathJax (@code{org-html-mathjax-options}). MathJax is used to | ||
| 11371 | typeset @LaTeX{} math in HTML documents. @xref{Math formatting in HTML | ||
| 11372 | export}, for an example. | ||
| 11373 | |||
| 11374 | @item HTML_HEAD | ||
| 11375 | @cindex #+HTML_HEAD | ||
| 11376 | @vindex org-html-head | ||
| 11377 | Arbitrary lines for appending to the HTML document's head | ||
| 11378 | (@code{org-html-head}). | ||
| 11058 | 11379 | ||
| 11059 | @node HTML doctypes, HTML preamble and postamble, HTML Export commands, HTML export | 11380 | @item HTML_HEAD_EXTRA |
| 11381 | @cindex #+HTML_HEAD_EXTRA | ||
| 11382 | @vindex org-html-head-extra | ||
| 11383 | More arbitrary lines for appending to the HTML document's head | ||
| 11384 | (@code{org-html-head-extra}). | ||
| 11385 | |||
| 11386 | @item KEYWORDS | ||
| 11387 | @cindex #+KEYWORDS (HTML) | ||
| 11388 | Keywords to describe the document's content. HTML exporter inserts these | ||
| 11389 | keywords as HTML meta tags. For long keywords, use multiple | ||
| 11390 | @code{#+KEYWORDS} lines. | ||
| 11391 | |||
| 11392 | @item LATEX_HEADER | ||
| 11393 | @cindex #+LATEX_HEADER (HTML) | ||
| 11394 | Arbitrary lines for appending to the preamble; HTML exporter appends when | ||
| 11395 | transcoding @LaTeX{} fragments to images (@pxref{Math formatting in HTML | ||
| 11396 | export}). | ||
| 11397 | |||
| 11398 | @item SUBTITLE | ||
| 11399 | @cindex #+SUBTILE (HTML) | ||
| 11400 | The document's subtitle. HTML exporter formats subtitle if document type is | ||
| 11401 | @samp{HTML5} and the CSS has a @samp{subtitle} class. | ||
| 11402 | @end table | ||
| 11403 | |||
| 11404 | Some of these keywords are explained in more detail in the following sections | ||
| 11405 | of the manual. | ||
| 11406 | |||
| 11407 | @node HTML doctypes | ||
| 11060 | @subsection HTML doctypes | 11408 | @subsection HTML doctypes |
| 11061 | @vindex org-html-doctype | ||
| 11062 | @vindex org-html-doctype-alist | ||
| 11063 | 11409 | ||
| 11064 | Org can export to various (X)HTML flavors. | 11410 | Org can export to various (X)HTML flavors. |
| 11065 | 11411 | ||
| 11066 | Setting the variable @code{org-html-doctype} allows you to export to different | 11412 | @vindex org-html-doctype |
| 11067 | (X)HTML variants. The exported HTML will be adjusted according to the syntax | 11413 | @vindex org-html-doctype-alist |
| 11068 | requirements of that variant. You can either set this variable to a doctype | 11414 | Set the @code{org-html-doctype} variable for different (X)HTML variants. |
| 11069 | string directly, in which case the exporter will try to adjust the syntax | 11415 | Depending on the variant, the HTML exporter adjusts the syntax of HTML |
| 11070 | automatically, or you can use a ready-made doctype. The ready-made options | 11416 | conversion accordingly. Org includes the following ready-made variants: |
| 11071 | are: | ||
| 11072 | 11417 | ||
| 11073 | @itemize | 11418 | @itemize |
| 11074 | @item | 11419 | @item |
| @@ -11091,23 +11436,21 @@ are: | |||
| 11091 | ``xhtml5'' | 11436 | ``xhtml5'' |
| 11092 | @end itemize | 11437 | @end itemize |
| 11093 | 11438 | ||
| 11094 | See the variable @code{org-html-doctype-alist} for details. The default is | 11439 | @noindent See the variable @code{org-html-doctype-alist} for details. |
| 11095 | ``xhtml-strict''. | 11440 | The default is ``xhtml-strict''. |
| 11096 | 11441 | ||
| 11097 | @subsubheading Fancy HTML5 export | ||
| 11098 | @vindex org-html-html5-fancy | 11442 | @vindex org-html-html5-fancy |
| 11099 | @vindex org-html-html5-elements | 11443 | @cindex HTML5, export new elements |
| 11100 | 11444 | Org's HTML exporter does not by default enable new block elements introduced | |
| 11101 | HTML5 introduces several new element types. By default, Org will not make | 11445 | with the HTML5 standard. To enable them, set @code{org-html-html5-fancy} to |
| 11102 | use of these element types, but you can set @code{org-html-html5-fancy} to | 11446 | non-@code{nil}. Or use an @code{OPTIONS} line in the file to set |
| 11103 | @code{t} (or set @code{html5-fancy} item in an @code{OPTIONS} line), to | 11447 | @code{html5-fancy}. HTML5 documents can now have arbitrary #+BEGIN and #+END |
| 11104 | enable a few new block-level elements. These are created using arbitrary | 11448 | blocks. For example: |
| 11105 | #+BEGIN and #+END blocks. For instance: | ||
| 11106 | 11449 | ||
| 11107 | @example | 11450 | @example |
| 11108 | #+BEGIN_ASIDE | 11451 | #+BEGIN_aside |
| 11109 | Lorem ipsum | 11452 | Lorem ipsum |
| 11110 | #+END_ASIDE | 11453 | #+END_aside |
| 11111 | @end example | 11454 | @end example |
| 11112 | 11455 | ||
| 11113 | Will export to: | 11456 | Will export to: |
| @@ -11122,14 +11465,14 @@ While this: | |||
| 11122 | 11465 | ||
| 11123 | @example | 11466 | @example |
| 11124 | #+ATTR_HTML: :controls controls :width 350 | 11467 | #+ATTR_HTML: :controls controls :width 350 |
| 11125 | #+BEGIN_VIDEO | 11468 | #+BEGIN_video |
| 11126 | #+HTML: <source src="movie.mp4" type="video/mp4"> | 11469 | #+HTML: <source src="movie.mp4" type="video/mp4"> |
| 11127 | #+HTML: <source src="movie.ogg" type="video/ogg"> | 11470 | #+HTML: <source src="movie.ogg" type="video/ogg"> |
| 11128 | Your browser does not support the video tag. | 11471 | Your browser does not support the video tag. |
| 11129 | #+END_VIDEO | 11472 | #+END_video |
| 11130 | @end example | 11473 | @end example |
| 11131 | 11474 | ||
| 11132 | Becomes: | 11475 | Exports to: |
| 11133 | 11476 | ||
| 11134 | @example | 11477 | @example |
| 11135 | <video controls="controls" width="350"> | 11478 | <video controls="controls" width="350"> |
| @@ -11139,15 +11482,17 @@ Becomes: | |||
| 11139 | </video> | 11482 | </video> |
| 11140 | @end example | 11483 | @end example |
| 11141 | 11484 | ||
| 11142 | Special blocks that do not correspond to HTML5 elements (see | 11485 | @vindex org-html-html5-elements |
| 11143 | @code{org-html-html5-elements}) will revert to the usual behavior, i.e., | 11486 | When special blocks do not have a corresponding HTML5 element, the HTML |
| 11144 | @code{#+BEGIN_LEDERHOSEN} will still export to @samp{<div class="lederhosen">}. | 11487 | exporter reverts to standard translation (see |
| 11488 | @code{org-html-html5-elements}). For example, @code{#+BEGIN_lederhosen} | ||
| 11489 | exports to @samp{<div class="lederhosen">}. | ||
| 11145 | 11490 | ||
| 11146 | Headlines cannot appear within special blocks. To wrap a headline and its | 11491 | Special blocks cannot have headlines. For the HTML exporter to wrap the |
| 11147 | contents in e.g., @samp{<section>} or @samp{<article>} tags, set the | 11492 | headline and its contents in @samp{<section>} or @samp{<article>} tags, set |
| 11148 | @code{HTML_CONTAINER} property on the headline itself. | 11493 | the @code{HTML_CONTAINER} property for the headline. |
| 11149 | 11494 | ||
| 11150 | @node HTML preamble and postamble, Quoting HTML tags, HTML doctypes, HTML export | 11495 | @node HTML preamble and postamble |
| 11151 | @subsection HTML preamble and postamble | 11496 | @subsection HTML preamble and postamble |
| 11152 | @vindex org-html-preamble | 11497 | @vindex org-html-preamble |
| 11153 | @vindex org-html-postamble | 11498 | @vindex org-html-postamble |
| @@ -11157,69 +11502,77 @@ contents in e.g., @samp{<section>} or @samp{<article>} tags, set the | |||
| 11157 | @vindex org-export-creator-string | 11502 | @vindex org-export-creator-string |
| 11158 | @vindex org-export-time-stamp-file | 11503 | @vindex org-export-time-stamp-file |
| 11159 | 11504 | ||
| 11160 | The HTML exporter lets you define a preamble and a postamble. | 11505 | The HTML exporter has delineations for preamble and postamble. The default |
| 11161 | 11506 | value for @code{org-html-preamble} is @code{t}, which makes the HTML exporter | |
| 11162 | The default value for @code{org-html-preamble} is @code{t}, which means | 11507 | insert the preamble. See the variable @code{org-html-preamble-format} for |
| 11163 | that the preamble is inserted depending on the relevant format string in | 11508 | the format string. |
| 11164 | @code{org-html-preamble-format}. | 11509 | |
| 11165 | 11510 | Set @code{org-html-preamble} to a string to override the default format | |
| 11166 | Setting @code{org-html-preamble} to a string will override the default format | 11511 | string. If the string is a function, the HTML exporter expects the function |
| 11167 | string. If you set it to a function, it will insert the output of the | 11512 | to return a string upon execution. The HTML exporter inserts this string in |
| 11168 | function, which must be a string. Setting to @code{nil} will not insert any | 11513 | the preamble. The HTML exporter will not insert a preamble if |
| 11169 | preamble. | 11514 | @code{org-html-preamble} is set @code{nil}. |
| 11170 | 11515 | ||
| 11171 | The default value for @code{org-html-postamble} is @code{'auto}, which means | 11516 | The default value for @code{org-html-postamble} is @code{auto}, which makes |
| 11172 | that the HTML exporter will look for information about the author, the email, | 11517 | the HTML exporter build a postamble from looking up author's name, email |
| 11173 | the creator and the date, and build the postamble from these values. Setting | 11518 | address, creator's name, and date. Set @code{org-html-postamble} to @code{t} |
| 11174 | @code{org-html-postamble} to @code{t} will insert the postamble from the | 11519 | to insert the postamble in the format specified in the |
| 11175 | relevant format string found in @code{org-html-postamble-format}. Setting it | 11520 | @code{org-html-postamble-format} variable. The HTML exporter will not insert |
| 11176 | to @code{nil} will not insert any postamble. | 11521 | a postamble if @code{org-html-postamble} is set to @code{nil}. |
| 11177 | 11522 | ||
| 11178 | @node Quoting HTML tags, Links in HTML export, HTML preamble and postamble, HTML export | 11523 | @node Quoting HTML tags |
| 11179 | @subsection Quoting HTML tags | 11524 | @subsection Quoting HTML tags |
| 11180 | 11525 | ||
| 11181 | Plain @samp{<} and @samp{>} are always transformed to @samp{<} and | 11526 | The HTML export back-end transforms @samp{<} and @samp{>} to @samp{<} and |
| 11182 | @samp{>} in HTML export. If you want to include raw HTML code, which | 11527 | @samp{>}. To include raw HTML code in the Org file so the HTML export |
| 11183 | should only appear in HTML export, mark it with @samp{@@@@html:} as in | 11528 | back-end can insert that HTML code in the output, use this inline syntax: |
| 11184 | @samp{@@@@html:<b>@@@@bold text@@@@html:</b>@@@@}. For more extensive HTML | 11529 | @samp{@@@@html:}. For example: @samp{@@@@html:<b>@@@@bold |
| 11185 | that should be copied verbatim to the exported file use either | 11530 | text@@@@html:</b>@@@@}. For larger raw HTML code blocks, use these HTML |
| 11531 | export code blocks: | ||
| 11186 | 11532 | ||
| 11187 | @cindex #+HTML | 11533 | @cindex #+HTML |
| 11188 | @cindex #+BEGIN_HTML | 11534 | @cindex #+BEGIN_EXPORT html |
| 11189 | @example | 11535 | @example |
| 11190 | #+HTML: Literal HTML code for export | 11536 | #+HTML: Literal HTML code for export |
| 11191 | @end example | 11537 | @end example |
| 11192 | 11538 | ||
| 11193 | @noindent or | 11539 | @noindent or |
| 11194 | @cindex #+BEGIN_HTML | 11540 | @cindex #+BEGIN_EXPORT html |
| 11195 | 11541 | ||
| 11196 | @example | 11542 | @example |
| 11197 | #+BEGIN_HTML | 11543 | #+BEGIN_EXPORT html |
| 11198 | All lines between these markers are exported literally | 11544 | All lines between these markers are exported literally |
| 11199 | #+END_HTML | 11545 | #+END_EXPORT |
| 11200 | @end example | 11546 | @end example |
| 11201 | 11547 | ||
| 11202 | 11548 | ||
| 11203 | @node Links in HTML export, Tables in HTML export, Quoting HTML tags, HTML export | 11549 | @node Links in HTML export |
| 11204 | @subsection Links in HTML export | 11550 | @subsection Links in HTML export |
| 11205 | 11551 | ||
| 11206 | @cindex links, in HTML export | 11552 | @cindex links, in HTML export |
| 11207 | @cindex internal links, in HTML export | 11553 | @cindex internal links, in HTML export |
| 11208 | @cindex external links, in HTML export | 11554 | @cindex external links, in HTML export |
| 11209 | Internal links (@pxref{Internal links}) will continue to work in HTML@. This | 11555 | @vindex org-html-link-org-files-as-html |
| 11210 | includes automatic links created by radio targets (@pxref{Radio | 11556 | The HTML export back-end transforms Org's internal links (@pxref{Internal |
| 11211 | targets}). Links to external files will still work if the target file is on | 11557 | links}) to equivalent HTML links in the output. The back-end similarly |
| 11212 | the same @i{relative} path as the published Org file. Links to other | 11558 | handles Org's automatic links created by radio targets (@pxref{Radio |
| 11213 | @file{.org} files will be translated into HTML links under the assumption | 11559 | targets}) similarly. For Org links to external files, the back-end |
| 11214 | that an HTML version also exists of the linked file, at the same relative | 11560 | transforms the links to @emph{relative} paths. |
| 11215 | path. @samp{id:} links can then be used to jump to specific entries across | 11561 | |
| 11216 | files. For information related to linking files while publishing them to a | 11562 | For Org links to other @file{.org} files, the back-end automatically changes |
| 11217 | publishing directory see @ref{Publishing links}. | 11563 | the file extension to @file{.html} and makes file paths relative. If the |
| 11218 | 11564 | @file{.org} files have an equivalent @file{.html} version at the same | |
| 11219 | If you want to specify attributes for links, you can do so using a special | 11565 | location, then the converted links should work without any further manual |
| 11220 | @code{#+ATTR_HTML} line to define attributes that will be added to the | 11566 | intervention. However, to disable this automatic path translation, set |
| 11221 | @code{<a>} or @code{<img>} tags. Here is an example that sets @code{title} | 11567 | @code{org-html-link-org-files-as-html} to @code{nil}. When disabled, the |
| 11222 | and @code{style} attributes for a link: | 11568 | HTML export back-end substitutes the @samp{id:}-based links in the HTML |
| 11569 | output. For more about linking files when publishing to a directory, | ||
| 11570 | @pxref{Publishing links}. | ||
| 11571 | |||
| 11572 | Org files can also have special directives to the HTML export back-end. For | ||
| 11573 | example, by using @code{#+ATTR_HTML} lines to specify new format attributes | ||
| 11574 | to @code{<a>} or @code{<img>} tags. This example shows changing the link's | ||
| 11575 | @code{title} and @code{style}: | ||
| 11223 | 11576 | ||
| 11224 | @cindex #+ATTR_HTML | 11577 | @cindex #+ATTR_HTML |
| 11225 | @example | 11578 | @example |
| @@ -11227,15 +11580,15 @@ and @code{style} attributes for a link: | |||
| 11227 | [[http://orgmode.org]] | 11580 | [[http://orgmode.org]] |
| 11228 | @end example | 11581 | @end example |
| 11229 | 11582 | ||
| 11230 | @node Tables in HTML export, Images in HTML export, Links in HTML export, HTML export | 11583 | @node Tables in HTML export |
| 11231 | @subsection Tables | 11584 | @subsection Tables in HTML export |
| 11232 | @cindex tables, in HTML | 11585 | @cindex tables, in HTML |
| 11233 | @vindex org-html-table-default-attributes | 11586 | @vindex org-html-table-default-attributes |
| 11234 | 11587 | ||
| 11235 | Org mode tables are exported to HTML using the table attributes defined in | 11588 | The HTML export back-end uses @code{org-html-table-default-attributes} when |
| 11236 | @code{org-html-table-default-attributes}. The default setting makes tables | 11589 | exporting Org tables to HTML. By default, the exporter does not draw frames |
| 11237 | without cell borders and frame. If you would like to change this for | 11590 | and cell borders. To change for this for a table, use the following lines |
| 11238 | individual tables, place something like the following before the table: | 11591 | before the table in the Org file: |
| 11239 | 11592 | ||
| 11240 | @cindex #+CAPTION | 11593 | @cindex #+CAPTION |
| 11241 | @cindex #+ATTR_HTML | 11594 | @cindex #+ATTR_HTML |
| @@ -11244,36 +11597,72 @@ individual tables, place something like the following before the table: | |||
| 11244 | #+ATTR_HTML: :border 2 :rules all :frame border | 11597 | #+ATTR_HTML: :border 2 :rules all :frame border |
| 11245 | @end example | 11598 | @end example |
| 11246 | 11599 | ||
| 11600 | The HTML export back-end preserves column groupings in Org tables | ||
| 11601 | (@pxref{Column groups}) when exporting to HTML. | ||
| 11602 | |||
| 11603 | Additional options for customizing tables for HTML export. | ||
| 11604 | |||
| 11605 | @table @code | ||
| 11606 | @vindex org-html-table-align-individual-fields | ||
| 11607 | @item org-html-table-align-individual-fields | ||
| 11608 | Non-@code{nil} attaches style attributes for alignment to each table field. | ||
| 11609 | |||
| 11610 | @vindex org-html-table-caption-above | ||
| 11611 | @item org-html-table-caption-above | ||
| 11612 | Non-@code{nil} places caption string at the beginning of the table. | ||
| 11613 | |||
| 11614 | @vindex org-html-table-data-tags | ||
| 11615 | @item org-html-table-data-tags | ||
| 11616 | Opening and ending tags for table data fields. | ||
| 11617 | |||
| 11618 | @vindex org-html-table-default-attributes | ||
| 11619 | @item org-html-table-default-attributes | ||
| 11620 | Default attributes and values for table tags. | ||
| 11621 | |||
| 11622 | @vindex org-html-table-header-tags | ||
| 11623 | @item org-html-table-header-tags | ||
| 11624 | Opening and ending tags for table's header fields. | ||
| 11625 | |||
| 11247 | @vindex org-html-table-row-tags | 11626 | @vindex org-html-table-row-tags |
| 11248 | You can also modify the default tags used for each row by setting | 11627 | @item org-html-table-row-tags |
| 11249 | @code{org-html-table-row-tags}. See the docstring for an example on | 11628 | Opening and ending tags for table rows. |
| 11250 | how to use this option. | 11629 | |
| 11630 | @vindex org-html-table-use-header-tags-for-first-column | ||
| 11631 | @item org-html-table-use-header-tags-for-first-column | ||
| 11632 | Non-@code{nil} formats column one in tables with header tags. | ||
| 11633 | @end table | ||
| 11251 | 11634 | ||
| 11252 | @node Images in HTML export, Math formatting in HTML export, Tables in HTML export, HTML export | 11635 | @node Images in HTML export |
| 11253 | @subsection Images in HTML export | 11636 | @subsection Images in HTML export |
| 11254 | 11637 | ||
| 11255 | @cindex images, inline in HTML | 11638 | @cindex images, inline in HTML |
| 11256 | @cindex inlining images in HTML | 11639 | @cindex inlining images in HTML |
| 11257 | @vindex org-html-inline-images | 11640 | @vindex org-html-inline-images |
| 11258 | HTML export can inline images given as links in the Org file, and | 11641 | |
| 11259 | it can make an image the clickable part of a link. By | 11642 | The HTML export back-end has features to convert Org image links to HTML |
| 11260 | default@footnote{But see the variable | 11643 | inline images and HTML clickable image links. |
| 11261 | @code{org-html-inline-images}.}, images are inlined if a link does | 11644 | |
| 11262 | not have a description. So @samp{[[file:myimg.jpg]]} will be inlined, | 11645 | When the link in the Org file has no description, the HTML export back-end by |
| 11263 | while @samp{[[file:myimg.jpg][the image]]} will just produce a link | 11646 | default in-lines that image. For example: @samp{[[file:myimg.jpg]]} is |
| 11264 | @samp{the image} that points to the image. If the description part | 11647 | in-lined, while @samp{[[file:myimg.jpg][the image]]} links to the text, |
| 11265 | itself is a @code{file:} link or a @code{http:} URL pointing to an | 11648 | @samp{the image}. |
| 11266 | image, this image will be inlined and activated so that clicking on the | 11649 | |
| 11267 | image will activate the link. For example, to include a thumbnail that | 11650 | For more details, see the variable @code{org-html-inline-images}. |
| 11268 | will link to a high resolution version of the image, you could use: | 11651 | |
| 11652 | On the other hand, if the description part of the Org link is itself another | ||
| 11653 | link, such as @code{file:} or @code{http:} URL pointing to an image, the HTML | ||
| 11654 | export back-end in-lines this image and links to the main image. This Org | ||
| 11655 | syntax enables the back-end to link low-resolution thumbnail to the | ||
| 11656 | high-resolution version of the image, as shown in this example: | ||
| 11269 | 11657 | ||
| 11270 | @example | 11658 | @example |
| 11271 | [[file:highres.jpg][file:thumb.jpg]] | 11659 | [[file:highres.jpg][file:thumb.jpg]] |
| 11272 | @end example | 11660 | @end example |
| 11273 | 11661 | ||
| 11274 | If you need to add attributes to an inlined image, use a @code{#+ATTR_HTML}. | 11662 | To change attributes of in-lined images, use @code{#+ATTR_HTML} lines in the |
| 11275 | In the example below we specify the @code{alt} and @code{title} attributes to | 11663 | Org file. This example shows realignment to right, and adds @code{alt} and |
| 11276 | support text viewers and accessibility, and align it to the right. | 11664 | @code{title} attributes in support of text viewers and modern web accessibility |
| 11665 | standards. | ||
| 11277 | 11666 | ||
| 11278 | @cindex #+CAPTION | 11667 | @cindex #+CAPTION |
| 11279 | @cindex #+ATTR_HTML | 11668 | @cindex #+ATTR_HTML |
| @@ -11284,63 +11673,72 @@ support text viewers and accessibility, and align it to the right. | |||
| 11284 | @end example | 11673 | @end example |
| 11285 | 11674 | ||
| 11286 | @noindent | 11675 | @noindent |
| 11287 | You could use @code{http} addresses just as well. | 11676 | The HTML export back-end copies the @code{http} links from the Org file as |
| 11677 | is. | ||
| 11288 | 11678 | ||
| 11289 | @node Math formatting in HTML export, Text areas in HTML export, Images in HTML export, HTML export | 11679 | @node Math formatting in HTML export |
| 11290 | @subsection Math formatting in HTML export | 11680 | @subsection Math formatting in HTML export |
| 11291 | @cindex MathJax | 11681 | @cindex MathJax |
| 11292 | @cindex dvipng | 11682 | @cindex dvipng |
| 11683 | @cindex dvisvgm | ||
| 11293 | @cindex imagemagick | 11684 | @cindex imagemagick |
| 11294 | 11685 | ||
| 11295 | @LaTeX{} math snippets (@pxref{@LaTeX{} fragments}) can be displayed in two | 11686 | @LaTeX{} math snippets (@pxref{@LaTeX{} fragments}) can be displayed in two |
| 11296 | different ways on HTML pages. The default is to use the | 11687 | different ways on HTML pages. The default is to use |
| 11297 | @uref{http://www.mathjax.org, MathJax system} which should work out of the | 11688 | @uref{http://www.mathjax.org, MathJax} which should work out of the box with |
| 11298 | box with Org mode installation because @uref{http://orgmode.org} serves | 11689 | Org@footnote{By default Org loads MathJax from @uref{https://cdnjs.com, cdnjs.com} as |
| 11299 | @file{MathJax} for Org mode users for small applications and for testing | 11690 | recommended by @uref{http://www.mathjax.org, MathJax}.}. Some MathJax display |
| 11300 | purposes. @b{If you plan to use this regularly or on pages with significant | 11691 | options can be configured via @code{org-html-mathjax-options}, or in the |
| 11301 | page views, you should install@footnote{Installation instructions can be | 11692 | buffer. For example, with the following settings, |
| 11302 | found on the MathJax website, see | 11693 | @smallexample |
| 11303 | @uref{http://www.mathjax.org/resources/docs/?installation.html}.} MathJax on | 11694 | #+HTML_MATHJAX: align: left indent: 5em tagside: left font: Neo-Euler |
| 11304 | your own server in order to limit the load of our server.} To configure | 11695 | @end smallexample |
| 11305 | @file{MathJax}, use the variable @code{org-html-mathjax-options} or | 11696 | equation labels will be displayed on the left marign and equations will be |
| 11306 | insert something like the following into the buffer: | 11697 | five ems from the left margin. |
| 11307 | |||
| 11308 | @example | ||
| 11309 | #+HTML_MATHJAX: align:"left" mathml:t path:"/MathJax/MathJax.js" | ||
| 11310 | @end example | ||
| 11311 | 11698 | ||
| 11312 | @noindent See the docstring of the variable | 11699 | @noindent See the docstring of |
| 11313 | @code{org-html-mathjax-options} for the meaning of the parameters in | 11700 | @code{org-html-mathjax-options} for all supported variables. The MathJax |
| 11314 | this line. | 11701 | template can be configure via @code{org-html-mathjax-template}. |
| 11315 | 11702 | ||
| 11316 | If you prefer, you can also request that @LaTeX{} fragments are processed | 11703 | If you prefer, you can also request that @LaTeX{} fragments are processed |
| 11317 | into small images that will be inserted into the browser page. Before the | 11704 | into small images that will be inserted into the browser page. Before the |
| 11318 | availability of MathJax, this was the default method for Org files. This | 11705 | availability of MathJax, this was the default method for Org files. This |
| 11319 | method requires that the @file{dvipng} program or @file{imagemagick} suite is | 11706 | method requires that the @file{dvipng} program, @file{dvisvgm} or |
| 11320 | available on your system. You can still get this processing with | 11707 | @file{imagemagick} suite is available on your system. You can still get |
| 11708 | this processing with | ||
| 11321 | 11709 | ||
| 11322 | @example | 11710 | @example |
| 11323 | #+OPTIONS: tex:dvipng | 11711 | #+OPTIONS: tex:dvipng |
| 11324 | @end example | 11712 | @end example |
| 11325 | 11713 | ||
| 11714 | @example | ||
| 11715 | #+OPTIONS: tex:dvisvgm | ||
| 11716 | @end example | ||
| 11717 | |||
| 11326 | or: | 11718 | or: |
| 11327 | 11719 | ||
| 11328 | @example | 11720 | @example |
| 11329 | #+OPTIONS: tex:imagemagick | 11721 | #+OPTIONS: tex:imagemagick |
| 11330 | @end example | 11722 | @end example |
| 11331 | 11723 | ||
| 11332 | @node Text areas in HTML export, CSS support, Math formatting in HTML export, HTML export | 11724 | @node Text areas in HTML export |
| 11333 | @subsection Text areas in HTML export | 11725 | @subsection Text areas in HTML export |
| 11334 | 11726 | ||
| 11335 | @cindex text areas, in HTML | 11727 | @cindex text areas, in HTML |
| 11336 | An alternative way to publish literal code examples in HTML is to use text | 11728 | Before Org mode's Babel, one popular approach to publishing code in HTML was |
| 11337 | areas, where the example can even be edited before pasting it into an | 11729 | by using @code{:textarea}. The advantage of this approach was that copying |
| 11338 | application. It is triggered by @code{:textarea} attribute at an | 11730 | and pasting was built into browsers with simple JavaScript commands. Even |
| 11339 | @code{example} or @code{src} block. | 11731 | editing before pasting was made simple. |
| 11732 | |||
| 11733 | The HTML export back-end can create such text areas. It requires an | ||
| 11734 | @code{#+ATTR_HTML:} line as shown in the example below with the | ||
| 11735 | @code{:textarea} option. This must be followed by either an | ||
| 11736 | @code{example} or a @code{src} code block. Other Org block types will not | ||
| 11737 | honor the @code{:textarea} option. | ||
| 11340 | 11738 | ||
| 11341 | You may also use @code{:height} and @code{:width} attributes to specify the | 11739 | By default, the HTML export back-end creates a text area 80 characters wide |
| 11342 | height and width of the text area, which default to the number of lines in | 11740 | and height just enough to fit the content. Override these defaults with |
| 11343 | the example, and 80, respectively. For example | 11741 | @code{:width} and @code{:height} options on the @code{#+ATTR_HTML:} line. |
| 11344 | 11742 | ||
| 11345 | @example | 11743 | @example |
| 11346 | #+ATTR_HTML: :textarea t :width 40 | 11744 | #+ATTR_HTML: :textarea t :width 40 |
| @@ -11352,7 +11750,7 @@ the example, and 80, respectively. For example | |||
| 11352 | @end example | 11750 | @end example |
| 11353 | 11751 | ||
| 11354 | 11752 | ||
| 11355 | @node CSS support, JavaScript support, Text areas in HTML export, HTML export | 11753 | @node CSS support |
| 11356 | @subsection CSS support | 11754 | @subsection CSS support |
| 11357 | @cindex CSS, for HTML export | 11755 | @cindex CSS, for HTML export |
| 11358 | @cindex HTML export, CSS | 11756 | @cindex HTML export, CSS |
| @@ -11371,6 +11769,7 @@ p.author @r{author information, including email} | |||
| 11371 | p.date @r{publishing date} | 11769 | p.date @r{publishing date} |
| 11372 | p.creator @r{creator info, about org mode version} | 11770 | p.creator @r{creator info, about org mode version} |
| 11373 | .title @r{document title} | 11771 | .title @r{document title} |
| 11772 | .subtitle @r{document subtitle} | ||
| 11374 | .todo @r{TODO keywords, all not-done states} | 11773 | .todo @r{TODO keywords, all not-done states} |
| 11375 | .done @r{the DONE keywords, all states that count as done} | 11774 | .done @r{the DONE keywords, all states that count as done} |
| 11376 | .WAITING @r{each TODO keyword also uses a class named after itself} | 11775 | .WAITING @r{each TODO keyword also uses a class named after itself} |
| @@ -11388,7 +11787,7 @@ div.outline-text-N @r{extra div for text at outline level N} | |||
| 11388 | .figure-number @r{label like "Figure 1:"} | 11787 | .figure-number @r{label like "Figure 1:"} |
| 11389 | .table-number @r{label like "Table 1:"} | 11788 | .table-number @r{label like "Table 1:"} |
| 11390 | .listing-number @r{label like "Listing 1:"} | 11789 | .listing-number @r{label like "Listing 1:"} |
| 11391 | div.figure @r{how to format an inlined image} | 11790 | div.figure @r{how to format an in-lined image} |
| 11392 | pre.src @r{formatted source code} | 11791 | pre.src @r{formatted source code} |
| 11393 | pre.example @r{normal example} | 11792 | pre.example @r{normal example} |
| 11394 | p.verse @r{verse paragraph} | 11793 | p.verse @r{verse paragraph} |
| @@ -11396,6 +11795,7 @@ div.footnotes @r{footnote section headline} | |||
| 11396 | p.footnote @r{footnote definition paragraph, containing a footnote} | 11795 | p.footnote @r{footnote definition paragraph, containing a footnote} |
| 11397 | .footref @r{a footnote reference number (always a <sup>)} | 11796 | .footref @r{a footnote reference number (always a <sup>)} |
| 11398 | .footnum @r{footnote number in footnote definition (always <sup>)} | 11797 | .footnum @r{footnote number in footnote definition (always <sup>)} |
| 11798 | .org-svg @r{default class for a linked @file{.svg} image} | ||
| 11399 | @end example | 11799 | @end example |
| 11400 | 11800 | ||
| 11401 | @vindex org-html-style-default | 11801 | @vindex org-html-style-default |
| @@ -11403,15 +11803,10 @@ p.footnote @r{footnote definition paragraph, containing a footnote} | |||
| 11403 | @vindex org-html-head | 11803 | @vindex org-html-head |
| 11404 | @vindex org-html-head-extra | 11804 | @vindex org-html-head-extra |
| 11405 | @cindex #+HTML_INCLUDE_STYLE | 11805 | @cindex #+HTML_INCLUDE_STYLE |
| 11406 | Each exported file contains a compact default style that defines these | 11806 | The HTML export back-end includes a compact default style in each exported |
| 11407 | classes in a basic way@footnote{This style is defined in the constant | 11807 | HTML file. To override the default style with another style, use these |
| 11408 | @code{org-html-style-default}, which you should not modify. To turn | 11808 | keywords in the Org file. They will replace the global defaults the HTML |
| 11409 | inclusion of these defaults off, customize | 11809 | exporter uses. |
| 11410 | @code{org-html-head-include-default-style} or set @code{html-style} to | ||
| 11411 | @code{nil} in an @code{OPTIONS} line.}. You may overwrite these settings, or | ||
| 11412 | add to them by using the variables @code{org-html-head} and | ||
| 11413 | @code{org-html-head-extra}. You can override the global values of these | ||
| 11414 | variables for each file by using these keywords: | ||
| 11415 | 11810 | ||
| 11416 | @cindex #+HTML_HEAD | 11811 | @cindex #+HTML_HEAD |
| 11417 | @cindex #+HTML_HEAD_EXTRA | 11812 | @cindex #+HTML_HEAD_EXTRA |
| @@ -11420,38 +11815,49 @@ variables for each file by using these keywords: | |||
| 11420 | #+HTML_HEAD_EXTRA: <link rel="alternate stylesheet" type="text/css" href="style2.css" /> | 11815 | #+HTML_HEAD_EXTRA: <link rel="alternate stylesheet" type="text/css" href="style2.css" /> |
| 11421 | @end example | 11816 | @end example |
| 11422 | 11817 | ||
| 11818 | To just turn off the default style, customize | ||
| 11819 | @code{org-html-head-include-default-style} variable, or use this option line in | ||
| 11820 | the Org file. | ||
| 11821 | |||
| 11822 | @example | ||
| 11823 | #+OPTIONS: html-style:nil | ||
| 11824 | @end example | ||
| 11825 | |||
| 11423 | @noindent | 11826 | @noindent |
| 11424 | For longer style definitions, you can use several such lines. You could also | 11827 | For longer style definitions, either use several @code{#+HTML_HEAD} and |
| 11425 | directly write a @code{<style>} @code{</style>} section in this way, without | 11828 | @code{#+HTML_HEAD_EXTRA} lines, or use @code{<style>} @code{</style>} blocks |
| 11426 | referring to an external file. | 11829 | around them. Both of these approaches can avoid referring to an external |
| 11830 | file. | ||
| 11427 | 11831 | ||
| 11428 | In order to add styles to a subtree, use the @code{:HTML_CONTAINER_CLASS:} | 11832 | In order to add styles to a sub-tree, use the @code{:HTML_CONTAINER_CLASS:} |
| 11429 | property to assign a class to the tree. In order to specify CSS styles for a | 11833 | property to assign a class to the tree. In order to specify CSS styles for a |
| 11430 | particular headline, you can use the id specified in a @code{:CUSTOM_ID:} | 11834 | particular headline, you can use the id specified in a @code{:CUSTOM_ID:} |
| 11431 | property. | 11835 | property. |
| 11432 | 11836 | ||
| 11837 | Never change the @code{org-html-style-default} constant. Instead use other | ||
| 11838 | simpler ways of customizing as described above. | ||
| 11839 | |||
| 11840 | |||
| 11433 | @c FIXME: More about header and footer styles | 11841 | @c FIXME: More about header and footer styles |
| 11434 | @c FIXME: Talk about links and targets. | 11842 | @c FIXME: Talk about links and targets. |
| 11435 | 11843 | ||
| 11436 | @node JavaScript support, , CSS support, HTML export | 11844 | @node JavaScript support |
| 11437 | @subsection JavaScript supported display of web pages | 11845 | @subsection JavaScript supported display of web pages |
| 11438 | 11846 | ||
| 11439 | @cindex Rose, Sebastian | 11847 | @cindex Rose, Sebastian |
| 11440 | Sebastian Rose has written a JavaScript program especially designed to | 11848 | Sebastian Rose has written a JavaScript program especially designed to |
| 11441 | enhance the web viewing experience of HTML files created with Org. This | 11849 | enhance the web viewing experience of HTML files created with Org. This |
| 11442 | program allows you to view large files in two different ways. The first one | 11850 | program enhances large files in two different ways of viewing. One is an |
| 11443 | is an @emph{Info}-like mode where each section is displayed separately and | 11851 | @emph{Info}-like mode where each section is displayed separately and |
| 11444 | navigation can be done with the @kbd{n} and @kbd{p} keys (and some other keys | 11852 | navigation can be done with the @kbd{n} and @kbd{p} keys (and some other keys |
| 11445 | as well, press @kbd{?} for an overview of the available keys). The second | 11853 | as well, press @kbd{?} for an overview of the available keys). The second |
| 11446 | view type is a @emph{folding} view much like Org provides inside Emacs. The | 11854 | one has a @emph{folding} view, much like Org provides inside Emacs. The |
| 11447 | script is available at @url{http://orgmode.org/org-info.js} and you can find | 11855 | script is available at @url{http://orgmode.org/org-info.js} and the |
| 11448 | the documentation for it at @url{http://orgmode.org/worg/code/org-info-js/}. | 11856 | documentation at @url{http://orgmode.org/worg/code/org-info-js/}. The script |
| 11449 | We host the script at our site, but if you use it a lot, you might not want | 11857 | is hosted on @url{http://orgmode.org}, but for reliability, prefer installing |
| 11450 | to be dependent on @url{http://orgmode.org} and prefer to install a local | 11858 | it on your own web server. |
| 11451 | copy on your own web server. | ||
| 11452 | 11859 | ||
| 11453 | All it then takes to use this program is adding a single line to the Org | 11860 | To use this program, just add this line to the Org file: |
| 11454 | file: | ||
| 11455 | 11861 | ||
| 11456 | @cindex #+INFOJS_OPT | 11862 | @cindex #+INFOJS_OPT |
| 11457 | @example | 11863 | @example |
| @@ -11459,12 +11865,12 @@ file: | |||
| 11459 | @end example | 11865 | @end example |
| 11460 | 11866 | ||
| 11461 | @noindent | 11867 | @noindent |
| 11462 | If this line is found, the HTML header will automatically contain the code | 11868 | The HTML header now has the code needed to automatically invoke the script. |
| 11463 | needed to invoke the script. Using the line above, you can set the following | 11869 | For setting options, use the syntax from the above line for options described |
| 11464 | viewing options: | 11870 | below: |
| 11465 | 11871 | ||
| 11466 | @example | 11872 | @example |
| 11467 | path: @r{The path to the script. The default is to grab the script from} | 11873 | path: @r{The path to the script. The default grabs the script from} |
| 11468 | @r{@url{http://orgmode.org/org-info.js}, but you might want to have} | 11874 | @r{@url{http://orgmode.org/org-info.js}, but you might want to have} |
| 11469 | @r{a local copy and use a path like @samp{../scripts/org-info.js}.} | 11875 | @r{a local copy and use a path like @samp{../scripts/org-info.js}.} |
| 11470 | view: @r{Initial view when the website is first shown. Possible values are:} | 11876 | view: @r{Initial view when the website is first shown. Possible values are:} |
| @@ -11494,105 +11900,204 @@ buttons: @r{Should view-toggle buttons be everywhere? When @code{nil} (the} | |||
| 11494 | @vindex org-html-infojs-options | 11900 | @vindex org-html-infojs-options |
| 11495 | @vindex org-html-use-infojs | 11901 | @vindex org-html-use-infojs |
| 11496 | You can choose default values for these options by customizing the variable | 11902 | You can choose default values for these options by customizing the variable |
| 11497 | @code{org-html-infojs-options}. If you always want to apply the script to your | 11903 | @code{org-html-infojs-options}. If you want the script to always apply to |
| 11498 | pages, configure the variable @code{org-html-use-infojs}. | 11904 | your pages, configure the variable @code{org-html-use-infojs}. |
| 11499 | 11905 | ||
| 11500 | @node @LaTeX{} and PDF export, Markdown export, HTML export, Exporting | 11906 | @node @LaTeX{} export |
| 11501 | @section @LaTeX{} and PDF export | 11907 | @section @LaTeX{} export |
| 11502 | @cindex @LaTeX{} export | 11908 | @cindex @LaTeX{} export |
| 11503 | @cindex PDF export | 11909 | @cindex PDF export |
| 11504 | 11910 | ||
| 11505 | @LaTeX{} export can produce an arbitrarily complex LaTeX document of any | 11911 | The @LaTeX{} export back-end can handle complex documents, incorporate |
| 11506 | standard or custom document class. With further processing@footnote{The | 11912 | standard or custom @LaTeX{} document classes, generate documents using |
| 11507 | default @LaTeX{} output is designed for processing with @code{pdftex} or | 11913 | alternate @LaTeX{} engines, and produce fully linked PDF files with indexes, |
| 11508 | @LaTeX{}. It includes packages that are not compatible with @code{xetex} and | 11914 | bibliographies, and tables of contents, destined for interactive online |
| 11509 | possibly @code{luatex}. The @LaTeX{} exporter can be configured to support | 11915 | viewing or high-quality print publication. |
| 11510 | alternative TeX engines, see the options | 11916 | |
| 11511 | @code{org-latex-default-packages-alist} and @code{org-latex-packages-alist}.}, | 11917 | While the details are covered in-depth in this section, here are some quick |
| 11512 | which the @LaTeX{} exporter is able to control, this back-end is able to | 11918 | references to variables for the impatient: for engines, see |
| 11513 | produce PDF output. Because the @LaTeX{} exporter can be configured to use | 11919 | @code{org-latex-compiler}; for build sequences, see |
| 11514 | the @code{hyperref} package, the default setup produces fully-linked PDF | 11920 | @code{org-latex-pdf-process}; for packages, see |
| 11515 | output. | 11921 | @code{org-latex-default-packages-alist} and @code{org-latex-packages-alist}. |
| 11516 | 11922 | ||
| 11517 | As in @LaTeX{}, blank lines are meaningful for this back-end: a paragraph | 11923 | An important note about the @LaTeX{} export back-end: it is sensitive to |
| 11518 | will not be started if two contiguous syntactical elements are not separated | 11924 | blank lines in the Org document. That's because @LaTeX{} itself depends on |
| 11519 | by an empty line. | 11925 | blank lines to tell apart syntactical elements, such as paragraphs. |
| 11520 | |||
| 11521 | This back-end also offers enhanced support for footnotes. Thus, it handles | ||
| 11522 | nested footnotes, footnotes in tables and footnotes in a list item's | ||
| 11523 | description. | ||
| 11524 | 11926 | ||
| 11525 | @menu | 11927 | @menu |
| 11526 | * @LaTeX{} export commands:: How to export to LaTeX and PDF | 11928 | * @LaTeX{} export commands:: For producing @LaTeX{} and PDF documents. |
| 11527 | * Header and sectioning:: Setting up the export file structure | 11929 | * @LaTeX{} specific export settings:: Unique to this @LaTeX{} back-end. |
| 11528 | * Quoting @LaTeX{} code:: Incorporating literal @LaTeX{} code | 11930 | * @LaTeX{} header and sectioning:: For file structure. |
| 11529 | * @LaTeX{} specific attributes:: Controlling @LaTeX{} output | 11931 | * Quoting @LaTeX{} code:: Directly in the Org document. |
| 11932 | * Tables in @LaTeX{} export:: Attributes specific to tables. | ||
| 11933 | * Images in @LaTeX{} export:: Attributes specific to images. | ||
| 11934 | * Plain lists in @LaTeX{} export:: Attributes specific to lists. | ||
| 11935 | * Source blocks in @LaTeX{} export:: Attributes specific to source code blocks. | ||
| 11936 | * Example blocks in @LaTeX{} export:: Attributes specific to example blocks. | ||
| 11937 | * Special blocks in @LaTeX{} export:: Attributes specific to special blocks. | ||
| 11938 | * Horizontal rules in @LaTeX{} export:: Attributes specific to horizontal rules. | ||
| 11530 | @end menu | 11939 | @end menu |
| 11531 | 11940 | ||
| 11532 | @node @LaTeX{} export commands, Header and sectioning, @LaTeX{} and PDF export, @LaTeX{} and PDF export | 11941 | @node @LaTeX{} export commands |
| 11533 | @subsection @LaTeX{} export commands | 11942 | @subsection @LaTeX{} export commands |
| 11534 | 11943 | ||
| 11535 | @table @kbd | 11944 | @table @kbd |
| 11536 | @orgcmd{C-c C-e l l,org-latex-export-to-latex} | 11945 | @orgcmd{C-c C-e l l,org-latex-export-to-latex} |
| 11537 | Export as a @LaTeX{} file. For an Org file @file{myfile.org}, the @LaTeX{} | 11946 | Export as @LaTeX{} file with a @file{.tex} extension. For @file{myfile.org}, |
| 11538 | file will be @file{myfile.tex}. The file will be overwritten without | 11947 | Org exports to @file{myfile.tex}, overwriting without warning. @kbd{C-c C-e |
| 11539 | warning. | 11948 | l l} Exports to @LaTeX{} file. |
| 11949 | |||
| 11540 | @orgcmd{C-c C-e l L,org-latex-export-as-latex} | 11950 | @orgcmd{C-c C-e l L,org-latex-export-as-latex} |
| 11541 | Export to a temporary buffer. Do not create a file. | 11951 | Export to a temporary buffer. Do not create a file. |
| 11542 | @orgcmd{C-c C-e l p,org-latex-export-to-pdf} | 11952 | @orgcmd{C-c C-e l p,org-latex-export-to-pdf} |
| 11543 | Export as @LaTeX{} and then process to PDF. | 11953 | Export as @LaTeX{} file and convert it to PDF file. |
| 11544 | @item C-c C-e l o | 11954 | @item C-c C-e l o |
| 11545 | Export as @LaTeX{} and then process to PDF, then open the resulting PDF file. | 11955 | Export as @LaTeX{} file and convert it to PDF, then open the PDF using the default viewer. |
| 11956 | @end table | ||
| 11957 | |||
| 11958 | @vindex org-latex-compiler | ||
| 11959 | @vindex org-latex-bibtex-compiler | ||
| 11960 | @vindex org-latex-default-packages-alist | ||
| 11961 | The @LaTeX{} export back-end can use any of these @LaTeX{} engines: | ||
| 11962 | @samp{pdflatex}, @samp{xelatex}, and @samp{lualatex}. These engines compile | ||
| 11963 | @LaTeX{} files with different compilers, packages, and output options. The | ||
| 11964 | @LaTeX{} export back-end finds the compiler version to use from | ||
| 11965 | @code{org-latex-compiler} variable or the @code{#+LATEX_COMPILER} keyword in | ||
| 11966 | the Org file. See the docstring for the | ||
| 11967 | @code{org-latex-default-packages-alist} for loading packages with certain | ||
| 11968 | compilers. Also see @code{org-latex-bibtex-compiler} to set the bibliography | ||
| 11969 | compiler@footnote{This does not allow setting different bibliography | ||
| 11970 | compilers for different files. However, ``smart'' @LaTeX{} compilation | ||
| 11971 | systems, such as @samp{latexmk}, can select the correct bibliography | ||
| 11972 | compiler.}. | ||
| 11973 | |||
| 11974 | @node @LaTeX{} specific export settings | ||
| 11975 | @subsection @LaTeX{} specific export settings | ||
| 11976 | |||
| 11977 | The @LaTeX{} export back-end has several additional keywords for customizing | ||
| 11978 | @LaTeX{} output. Setting these keywords works similar to the general options | ||
| 11979 | (@pxref{Export settings}). | ||
| 11980 | |||
| 11981 | @table @samp | ||
| 11982 | @item DESCRIPTION | ||
| 11983 | @cindex #+DESCRIPTION (@LaTeX{}) | ||
| 11984 | The document's description. The description along with author name, | ||
| 11985 | keywords, and related file metadata are inserted in the output file by the | ||
| 11986 | @samp{hyperref} package. See @code{org-latex-hyperref-template} for | ||
| 11987 | customizing metadata items. See @code{org-latex-title-command} for | ||
| 11988 | typesetting description into the document's front matter. Use multiple | ||
| 11989 | @code{#+DESCRIPTION} lines for long descriptions. | ||
| 11990 | |||
| 11991 | @item LATEX_CLASS | ||
| 11992 | @cindex #+LATEX_CLASS | ||
| 11993 | @vindex org-latex-default-class | ||
| 11994 | @vindex org-latex-classes | ||
| 11995 | This is @LaTeX{} document class, such as @code{article}, @code{report}, | ||
| 11996 | @code{book}, and so on, which contain predefined preamble and headline level | ||
| 11997 | mapping that the @LaTeX{} export back-end needs. The back-end reads the | ||
| 11998 | default class name from the @code{org-latex-default-class} variable. Org has | ||
| 11999 | @code{article} as the default class. A valid default class must be an | ||
| 12000 | element of @code{org-latex-classes}. | ||
| 12001 | |||
| 12002 | @item LATEX_CLASS_OPTIONS | ||
| 12003 | @cindex #+LATEX_CLASS_OPTIONS | ||
| 12004 | Options the @LaTeX{} export back-end uses when calling the @LaTeX{} document | ||
| 12005 | class. | ||
| 12006 | |||
| 12007 | @item LATEX_COMPILER | ||
| 12008 | @cindex #+LATEX_COMPILER | ||
| 12009 | @vindex org-latex-compiler | ||
| 12010 | The compiler, such as @samp{pdflatex}, @samp{xelatex}, @samp{lualatex}, for | ||
| 12011 | producing the PDF (@code{org-latex-compiler}). | ||
| 12012 | |||
| 12013 | @item LATEX_HEADER | ||
| 12014 | @cindex #+LATEX_HEADER | ||
| 12015 | @vindex org-latex-classes | ||
| 12016 | Arbitrary lines to add to the document's preamble, before the @samp{hyperref} | ||
| 12017 | settings. See @code{org-latex-classes} for adjusting the structure and order | ||
| 12018 | of the @LaTeX{} headers. | ||
| 12019 | |||
| 12020 | @item LATEX_HEADER_EXTRA | ||
| 12021 | @cindex #+LATEX_HEADER_EXTRA | ||
| 12022 | @vindex org-latex-classes | ||
| 12023 | Arbitrary lines to add to the document's preamble, before the @samp{hyperref} | ||
| 12024 | settings. See @code{org-latex-classes} for adjusting the structure and order | ||
| 12025 | of the @LaTeX{} headers. | ||
| 12026 | |||
| 12027 | @item KEYWORDS | ||
| 12028 | @cindex #+KEYWORDS (@LaTeX{}) | ||
| 12029 | The keywords for the document. The description along with author name, | ||
| 12030 | keywords, and related file metadata are inserted in the output file by the | ||
| 12031 | @samp{hyperref} package. See @code{org-latex-hyperref-template} for | ||
| 12032 | customizing metadata items. See @code{org-latex-title-command} for | ||
| 12033 | typesetting description into the document's front matter. Use multiple | ||
| 12034 | @code{#+KEYWORDS} lines if necessary. | ||
| 12035 | |||
| 12036 | @item SUBTITLE | ||
| 12037 | @cindex #+SUBTITLE (@LaTeX{}) | ||
| 12038 | @vindex org-latex-subtitle-separate | ||
| 12039 | @vindex org-latex-subtitle-format | ||
| 12040 | The document's subtitle. It is typeset as per | ||
| 12041 | @code{org-latex-subtitle-format}. If @code{org-latex-subtitle-separate} is | ||
| 12042 | non-@code{nil}, it is typed as part of the @samp{\title}-macro. See | ||
| 12043 | @code{org-latex-hyperref-template} for customizing metadata items. See | ||
| 12044 | @code{org-latex-title-command} for typesetting description into the | ||
| 12045 | document's front matter. | ||
| 11546 | @end table | 12046 | @end table |
| 11547 | 12047 | ||
| 11548 | @node Header and sectioning, Quoting @LaTeX{} code, @LaTeX{} export commands, @LaTeX{} and PDF export | 12048 | The following sections have further details. |
| 11549 | @subsection Header and sectioning structure | 12049 | |
| 12050 | @node @LaTeX{} header and sectioning | ||
| 12051 | @subsection @LaTeX{} header and sectioning structure | ||
| 11550 | @cindex @LaTeX{} class | 12052 | @cindex @LaTeX{} class |
| 11551 | @cindex @LaTeX{} sectioning structure | 12053 | @cindex @LaTeX{} sectioning structure |
| 11552 | @cindex @LaTeX{} header | 12054 | @cindex @LaTeX{} header |
| 11553 | @cindex header, for @LaTeX{} files | 12055 | @cindex header, for @LaTeX{} files |
| 11554 | @cindex sectioning structure, for @LaTeX{} export | 12056 | @cindex sectioning structure, for @LaTeX{} export |
| 11555 | 12057 | ||
| 11556 | By default, the first three outline levels become headlines, defining a | 12058 | The @LaTeX{} export back-end converts the first three of Org's outline levels |
| 11557 | general document structure. Additional levels are exported as @code{itemize} | 12059 | into @LaTeX{} headlines. The remaining Org levels are exported as |
| 11558 | or @code{enumerate} lists. The transition can also occur at a different | 12060 | @code{itemize} or @code{enumerate} lists. To change this globally for the |
| 11559 | level (@pxref{Export settings}). | 12061 | cut-off point between levels and lists, (@pxref{Export settings}). |
| 11560 | 12062 | ||
| 11561 | By default, the @LaTeX{} output uses the class @code{article}. | 12063 | By default, the @LaTeX{} export back-end uses the @code{article} class. |
| 11562 | 12064 | ||
| 11563 | @vindex org-latex-default-class | 12065 | @vindex org-latex-default-class |
| 11564 | @vindex org-latex-classes | 12066 | @vindex org-latex-classes |
| 11565 | @vindex org-latex-default-packages-alist | 12067 | @vindex org-latex-default-packages-alist |
| 11566 | @vindex org-latex-packages-alist | 12068 | @vindex org-latex-packages-alist |
| 11567 | You can change this globally by setting a different value for | 12069 | To change the default class globally, edit @code{org-latex-default-class}. |
| 11568 | @code{org-latex-default-class} or locally by adding an option like | 12070 | To change the default class locally in an Org file, add option lines |
| 11569 | @code{#+LATEX_CLASS: myclass} in your file, or with | 12071 | @code{#+LATEX_CLASS: myclass}. To change the default class for just a part |
| 11570 | a @code{EXPORT_LATEX_CLASS} property that applies when exporting a region | 12072 | of the Org file, set a sub-tree property, @code{EXPORT_LATEX_CLASS}. The |
| 11571 | containing only this (sub)tree. The class must be listed in | 12073 | class name entered here must be valid member of @code{org-latex-classes}. |
| 11572 | @code{org-latex-classes}. This variable defines a header template for each | 12074 | This variable defines a header template for each class into which the |
| 11573 | class@footnote{Into which the values of | 12075 | exporter splices the values of @code{org-latex-default-packages-alist} and |
| 11574 | @code{org-latex-default-packages-alist} and @code{org-latex-packages-alist} | 12076 | @code{org-latex-packages-alist}. Use the same three variables to define |
| 11575 | are spliced.}, and allows you to define the sectioning structure for each | 12077 | custom sectioning or custom classes. |
| 11576 | class. You can also define your own classes there. | ||
| 11577 | 12078 | ||
| 11578 | @cindex #+LATEX_CLASS | 12079 | @cindex #+LATEX_CLASS |
| 11579 | @cindex #+LATEX_CLASS_OPTIONS | 12080 | @cindex #+LATEX_CLASS_OPTIONS |
| 11580 | @cindex property, EXPORT_LATEX_CLASS | 12081 | @cindex property, EXPORT_LATEX_CLASS |
| 11581 | @cindex property, EXPORT_LATEX_CLASS_OPTIONS | 12082 | @cindex property, EXPORT_LATEX_CLASS_OPTIONS |
| 11582 | The @code{LATEX_CLASS_OPTIONS} keyword or @code{EXPORT_LATEX_CLASS_OPTIONS} | 12083 | The @LaTeX{} export back-end sends the @code{LATEX_CLASS_OPTIONS} keyword and |
| 11583 | property can specify the options for the @code{\documentclass} macro. These | 12084 | @code{EXPORT_LATEX_CLASS_OPTIONS} property as options to the @LaTeX{} |
| 11584 | options have to be provided, as expected by @LaTeX{}, within square brackets. | 12085 | @code{\documentclass} macro. The options and the syntax for specifying them, |
| 12086 | including enclosing them in square brackets, follow @LaTeX{} conventions. | ||
| 12087 | |||
| 12088 | @example | ||
| 12089 | #+LATEX_CLASS_OPTIONS: [a4paper,11pt,twoside,twocolumn] | ||
| 12090 | @end example | ||
| 11585 | 12091 | ||
| 11586 | @cindex #+LATEX_HEADER | 12092 | @cindex #+LATEX_HEADER |
| 11587 | @cindex #+LATEX_HEADER_EXTRA | 12093 | @cindex #+LATEX_HEADER_EXTRA |
| 11588 | You can also use the @code{LATEX_HEADER} and | 12094 | The @LaTeX{} export back-end appends values from @code{LATEX_HEADER} and |
| 11589 | @code{LATEX_HEADER_EXTRA}@footnote{Unlike @code{LATEX_HEADER}, contents | 12095 | @code{LATEX_HEADER_EXTRA} keywords to the @LaTeX{} header. The docstring for |
| 11590 | from @code{LATEX_HEADER_EXTRA} keywords will not be loaded when previewing | 12096 | @code{org-latex-classes} explains in more detail. Also note that @LaTeX{} |
| 11591 | @LaTeX{} snippets (@pxref{Previewing @LaTeX{} fragments}).} keywords in order | 12097 | export back-end does not append @code{LATEX_HEADER_EXTRA} to the header when |
| 11592 | to add lines to the header. See the docstring of @code{org-latex-classes} for | 12098 | previewing @LaTeX{} snippets (@pxref{Previewing @LaTeX{} fragments}). |
| 11593 | more information. | ||
| 11594 | 12099 | ||
| 11595 | An example is shown below. | 12100 | A sample Org file with the above headers: |
| 11596 | 12101 | ||
| 11597 | @example | 12102 | @example |
| 11598 | #+LATEX_CLASS: article | 12103 | #+LATEX_CLASS: article |
| @@ -11601,103 +12106,117 @@ An example is shown below. | |||
| 11601 | 12106 | ||
| 11602 | * Headline 1 | 12107 | * Headline 1 |
| 11603 | some text | 12108 | some text |
| 12109 | * Headline 2 | ||
| 12110 | some more text | ||
| 11604 | @end example | 12111 | @end example |
| 11605 | 12112 | ||
| 11606 | @node Quoting @LaTeX{} code, @LaTeX{} specific attributes, Header and sectioning, @LaTeX{} and PDF export | 12113 | @node Quoting @LaTeX{} code |
| 11607 | @subsection Quoting @LaTeX{} code | 12114 | @subsection Quoting @LaTeX{} code |
| 11608 | 12115 | ||
| 11609 | Embedded @LaTeX{} as described in @ref{Embedded @LaTeX{}}, will be correctly | 12116 | The @LaTeX{} export back-end can insert any arbitrary @LaTeX{} code, |
| 11610 | inserted into the @LaTeX{} file. Furthermore, you can add special code that | 12117 | @pxref{Embedded @LaTeX{}}. There are three ways to embed such code in the |
| 11611 | should only be present in @LaTeX{} export with the following constructs: | 12118 | Org file and they all use different quoting syntax. |
| 11612 | 12119 | ||
| 11613 | @cindex #+LATEX | 12120 | Inserting in-line quoted with @ symbols: |
| 11614 | @cindex #+BEGIN_LATEX | 12121 | @cindex inline, in @LaTeX{} export |
| 11615 | @example | 12122 | @example |
| 11616 | Code within @@@@latex:some code@@@@ a paragraph. | 12123 | Code embedded in-line @@@@latex:any arbitrary LaTeX code@@@@ in a paragraph. |
| 11617 | |||
| 11618 | #+LATEX: Literal @LaTeX{} code for export | ||
| 11619 | |||
| 11620 | #+BEGIN_LATEX | ||
| 11621 | All lines between these markers are exported literally | ||
| 11622 | #+END_LATEX | ||
| 11623 | @end example | 12124 | @end example |
| 11624 | 12125 | ||
| 11625 | @node @LaTeX{} specific attributes, , Quoting @LaTeX{} code, @LaTeX{} and PDF export | 12126 | Inserting as one or more keyword lines in the Org file: |
| 11626 | @subsection @LaTeX{} specific attributes | 12127 | @cindex #+LATEX |
| 11627 | @cindex #+ATTR_LATEX | 12128 | @example |
| 12129 | #+LATEX: any arbitrary LaTeX code | ||
| 12130 | @end example | ||
| 11628 | 12131 | ||
| 11629 | @LaTeX{} understands attributes specified in an @code{ATTR_LATEX} line. They | 12132 | Inserting as an export block in the Org file, where the back-end exports any |
| 11630 | affect tables, images, plain lists, special blocks and source blocks. | 12133 | code between begin and end markers: |
| 12134 | @cindex #+BEGIN_EXPORT latex | ||
| 12135 | @example | ||
| 12136 | #+BEGIN_EXPORT latex | ||
| 12137 | any arbitrary LaTeX code | ||
| 12138 | #+END_EXPORT | ||
| 12139 | @end example | ||
| 11631 | 12140 | ||
| 11632 | @subsubheading Tables in @LaTeX{} export | 12141 | @node Tables in @LaTeX{} export |
| 12142 | @subsection Tables in @LaTeX{} export | ||
| 11633 | @cindex tables, in @LaTeX{} export | 12143 | @cindex tables, in @LaTeX{} export |
| 12144 | @cindex #+ATTR_LATEX, in tables | ||
| 11634 | 12145 | ||
| 11635 | For @LaTeX{} export of a table, you can specify a label and a caption | 12146 | The @LaTeX{} export back-end can pass several @LaTeX{} attributes for table |
| 11636 | (@pxref{Images and tables}). You can also use attributes to control table | 12147 | contents and layout. Besides specifying label and caption (@pxref{Images and |
| 11637 | layout and contents. Valid @LaTeX{} attributes include: | 12148 | tables}), the other valid @LaTeX{} attributes include: |
| 11638 | 12149 | ||
| 11639 | @table @code | 12150 | @table @code |
| 11640 | @item :mode | 12151 | @item :mode |
| 11641 | @vindex org-latex-default-table-mode | 12152 | @vindex org-latex-default-table-mode |
| 11642 | Nature of table's contents. It can be set to @code{table}, @code{math}, | 12153 | The @LaTeX{} export back-end wraps the table differently depending on the |
| 11643 | @code{inline-math} or @code{verbatim}. In particular, when in @code{math} or | 12154 | mode for accurate rendering of math symbols. Mode is either @code{table}, |
| 11644 | @code{inline-math} mode, every cell is exported as-is, horizontal rules are | 12155 | @code{math}, @code{inline-math} or @code{verbatim}. For @code{math} or |
| 11645 | ignored and the table will be wrapped in a math environment. Also, | 12156 | @code{inline-math} mode, @LaTeX{} export back-end wraps the table in a math |
| 11646 | contiguous tables sharing the same math mode will be wrapped within the same | 12157 | environment, but every cell in it is exported as-is. The @LaTeX{} export |
| 11647 | environment. Default mode is determined in | 12158 | back-end determines the default mode from |
| 11648 | @code{org-latex-default-table-mode}. | 12159 | @code{org-latex-default-table-mode}. For , The @LaTeX{} export back-end |
| 12160 | merges contiguous tables in the same mode into a single environment. | ||
| 11649 | @item :environment | 12161 | @item :environment |
| 11650 | @vindex org-latex-default-table-environment | 12162 | @vindex org-latex-default-table-environment |
| 11651 | Environment used for the table. It can be set to any @LaTeX{} table | 12163 | Set the default @LaTeX{} table environment for the @LaTeX{} export back-end |
| 11652 | environment, like @code{tabularx}@footnote{Requires adding the | 12164 | to use when exporting Org tables. Common @LaTeX{} table environments are |
| 11653 | @code{tabularx} package to @code{org-latex-packages-alist}.}, | 12165 | provided by these packages: @code{tabularx}, @code{longtable}, @code{array}, |
| 11654 | @code{longtable}, @code{array}, @code{tabu}@footnote{Requires adding the | 12166 | @code{tabu}, and @code{bmatrix}. For packages, such as @code{tabularx} and |
| 11655 | @code{tabu} package to @code{org-latex-packages-alist}.}, | 12167 | @code{tabu}, or any newer replacements, include them in the |
| 11656 | @code{bmatrix}@enddots{} It defaults to | 12168 | @code{org-latex-packages-alist} variable so the @LaTeX{} export back-end can |
| 11657 | @code{org-latex-default-table-environment} value. | 12169 | insert the appropriate load package headers in the converted @LaTeX{} file. |
| 12170 | Look in the docstring for the @code{org-latex-packages-alist} variable for | ||
| 12171 | configuring these packages for @LaTeX{} snippet previews, if any. | ||
| 11658 | @item :caption | 12172 | @item :caption |
| 11659 | @code{#+CAPTION} keyword is the simplest way to set a caption for a table | 12173 | Use @code{#+CAPTION} keyword to set a simple caption for a table |
| 11660 | (@pxref{Images and tables}). If you need more advanced commands for that | 12174 | (@pxref{Images and tables}). For custom captions, use @code{:caption} |
| 11661 | task, you can use @code{:caption} attribute instead. Its value should be raw | 12175 | attribute, which accepts raw @LaTeX{} code. @code{:caption} value overrides |
| 11662 | @LaTeX{} code. It has precedence over @code{#+CAPTION}. | 12176 | @code{#+CAPTION} value. |
| 11663 | @item :float | 12177 | @item :float |
| 11664 | @itemx :placement | 12178 | @itemx :placement |
| 11665 | Float environment for the table. Possible values are @code{sidewaystable}, | 12179 | The table environments by default are not floats in @LaTeX{}. To make them |
| 11666 | @code{multicolumn}, @code{t} and @code{nil}. When unspecified, a table with | 12180 | floating objects use @code{:float} with one of the following options: |
| 11667 | a caption will have a @code{table} environment. Moreover, @code{:placement} | 12181 | @code{sideways}, @code{multicolumn}, @code{t}, and @code{nil}. Note that |
| 11668 | attribute can specify the positioning of the float. | 12182 | @code{sidewaystable} has been deprecated since Org 8.3. @LaTeX{} floats can |
| 12183 | also have additional layout @code{:placement} attributes. These are the | ||
| 12184 | usual @code{[h t b p ! H]} permissions specified in square brackets. Note | ||
| 12185 | that for @code{:float sideways} tables, the @LaTeX{} export back-end ignores | ||
| 12186 | @code{:placement} attributes. | ||
| 11669 | @item :align | 12187 | @item :align |
| 11670 | @itemx :font | 12188 | @itemx :font |
| 11671 | @itemx :width | 12189 | @itemx :width |
| 11672 | Set, respectively, the alignment string of the table, its font size and its | 12190 | The @LaTeX{} export back-end uses these attributes for regular tables to set |
| 11673 | width. They only apply on regular tables. | 12191 | their alignments, fonts, and widths. |
| 11674 | @item :spread | 12192 | @item :spread |
| 11675 | Boolean specific to the @code{tabu} and @code{longtabu} environments, and | 12193 | When @code{:spread} is non-@code{nil}, the @LaTeX{} export back-end spreads |
| 11676 | only takes effect when used in conjunction with the @code{:width} attribute. | 12194 | or shrinks the table by the @code{:width} for @code{tabu} and @code{longtabu} |
| 11677 | When @code{:spread} is non-@code{nil}, the table will be spread or shrunk by the | 12195 | environments. @code{:spread} has no effect if @code{:width} is not set. |
| 11678 | value of @code{:width}. | ||
| 11679 | @item :booktabs | 12196 | @item :booktabs |
| 11680 | @itemx :center | 12197 | @itemx :center |
| 11681 | @itemx :rmlines | 12198 | @itemx :rmlines |
| 11682 | @vindex org-latex-tables-booktabs | 12199 | @vindex org-latex-tables-booktabs |
| 11683 | @vindex org-latex-tables-centered | 12200 | @vindex org-latex-tables-centered |
| 11684 | They toggle, respectively, @code{booktabs} usage (assuming the package is | 12201 | All three commands are toggles. @code{:booktabs} brings in modern |
| 11685 | properly loaded), table centering and removal of every horizontal rule but | 12202 | typesetting enhancements to regular tables. The @code{booktabs} package has |
| 11686 | the first one (in a "table.el" table only). In particular, | 12203 | to be loaded through @code{org-latex-packages-alist}. @code{:center} is for |
| 11687 | @code{org-latex-tables-booktabs} (respectively @code{org-latex-tables-centered}) | 12204 | centering the table. @code{:rmlines} removes all but the very first |
| 11688 | activates the first (respectively second) attribute globally. | 12205 | horizontal line made of ASCII characters from "table.el" tables only. |
| 11689 | @item :math-prefix | 12206 | @item :math-prefix |
| 11690 | @itemx :math-suffix | 12207 | @itemx :math-suffix |
| 11691 | @itemx :math-arguments | 12208 | @itemx :math-arguments |
| 11692 | A string that will be inserted, respectively, before the table within the | 12209 | The @LaTeX{} export back-end inserts @code{:math-prefix} string value in a |
| 11693 | math environment, after the table within the math environment, and between | 12210 | math environment before the table. The @LaTeX{} export back-end inserts |
| 11694 | the macro name and the contents of the table. The @code{:math-arguments} | 12211 | @code{:math-suffix} string value in a math environment after the table. The |
| 11695 | attribute is used for matrix macros that require more than one argument | 12212 | @LaTeX{} export back-end inserts @code{:math-arguments} string value between |
| 11696 | (e.g., @code{qbordermatrix}). | 12213 | the macro name and the table's contents. @code{:math-arguments} comes in use |
| 12214 | for matrix macros that require more than one argument, such as | ||
| 12215 | @code{qbordermatrix}. | ||
| 11697 | @end table | 12216 | @end table |
| 11698 | 12217 | ||
| 11699 | Thus, attributes can be used in a wide array of situations, like writing | 12218 | @LaTeX{} table attributes help formatting tables for a wide range of |
| 11700 | a table that will span over multiple pages, or a matrix product: | 12219 | situations, such as matrix product or spanning multiple pages: |
| 11701 | 12220 | ||
| 11702 | @example | 12221 | @example |
| 11703 | #+ATTR_LATEX: :environment longtable :align l|lp@{3cm@}r|l | 12222 | #+ATTR_LATEX: :environment longtable :align l|lp@{3cm@}r|l |
| @@ -11712,8 +12231,8 @@ a table that will span over multiple pages, or a matrix product: | |||
| 11712 | | 3 | 4 | | 12231 | | 3 | 4 | |
| 11713 | @end example | 12232 | @end example |
| 11714 | 12233 | ||
| 11715 | In the example below, @LaTeX{} command | 12234 | Set the caption with the @LaTeX{} command |
| 11716 | @code{\bicaption@{HeadingA@}@{HeadingB@}} will set the caption. | 12235 | @code{\bicaption@{HeadingA@}@{HeadingB@}}: |
| 11717 | 12236 | ||
| 11718 | @example | 12237 | @example |
| 11719 | #+ATTR_LATEX: :caption \bicaption@{HeadingA@}@{HeadingB@} | 12238 | #+ATTR_LATEX: :caption \bicaption@{HeadingA@}@{HeadingB@} |
| @@ -11722,128 +12241,203 @@ In the example below, @LaTeX{} command | |||
| 11722 | @end example | 12241 | @end example |
| 11723 | 12242 | ||
| 11724 | 12243 | ||
| 11725 | @subsubheading Images in @LaTeX{} export | 12244 | @node Images in @LaTeX{} export |
| 12245 | @subsection Images in @LaTeX{} export | ||
| 11726 | @cindex images, inline in @LaTeX{} | 12246 | @cindex images, inline in @LaTeX{} |
| 11727 | @cindex inlining images in @LaTeX{} | 12247 | @cindex inlining images in @LaTeX{} |
| 12248 | @cindex #+ATTR_LATEX, in images | ||
| 11728 | 12249 | ||
| 11729 | Images that are linked to without a description part in the link, like | 12250 | The @LaTeX{} export back-end processes image links in Org files that do not |
| 11730 | @samp{[[file:img.jpg]]} or @samp{[[./img.jpg]]} will be inserted into the PDF | 12251 | have descriptions, such as these links @samp{[[file:img.jpg]]} or |
| 11731 | output file resulting from @LaTeX{} processing. Org will use an | 12252 | @samp{[[./img.jpg]]}, as direct image insertions in the final PDF output. In |
| 11732 | @code{\includegraphics} macro to insert the image@footnote{In the case of | 12253 | the PDF, they are no longer links but actual images embedded on the page. |
| 11733 | TikZ (@url{http://sourceforge.net/projects/pgf/}) images, it will become an | 12254 | The @LaTeX{} export back-end uses @code{\includegraphics} macro to insert the |
| 11734 | @code{\input} macro wrapped within a @code{tikzpicture} environment.}. | 12255 | image. But for TikZ@footnote{@url{http://sourceforge.net/projects/pgf/}} |
| 12256 | images, the back-end uses an @code{\input} macro wrapped within | ||
| 12257 | a @code{tikzpicture} environment. | ||
| 11735 | 12258 | ||
| 11736 | You can specify specify image width or height with, respectively, | 12259 | For specifying image @code{:width}, @code{:height}, and other |
| 11737 | @code{:width} and @code{:height} attributes. It is also possible to add any | 12260 | @code{:options}, use this syntax: |
| 11738 | other option with the @code{:options} attribute, as shown in the following | ||
| 11739 | example: | ||
| 11740 | 12261 | ||
| 11741 | @example | 12262 | @example |
| 11742 | #+ATTR_LATEX: :width 5cm :options angle=90 | 12263 | #+ATTR_LATEX: :width 5cm :options angle=90 |
| 11743 | [[./img/sed-hr4049.pdf]] | 12264 | [[./img/sed-hr4049.pdf]] |
| 11744 | @end example | 12265 | @end example |
| 11745 | 12266 | ||
| 11746 | If you need a specific command for the caption, use @code{:caption} | 12267 | For custom commands for captions, use the @code{:caption} attribute. It will |
| 11747 | attribute. It will override standard @code{#+CAPTION} value, if any. | 12268 | override the default @code{#+CAPTION} value: |
| 11748 | 12269 | ||
| 11749 | @example | 12270 | @example |
| 11750 | #+ATTR_LATEX: :caption \bicaption@{HeadingA@}@{HeadingB@} | 12271 | #+ATTR_LATEX: :caption \bicaption@{HeadingA@}@{HeadingB@} |
| 11751 | [[./img/sed-hr4049.pdf]] | 12272 | [[./img/sed-hr4049.pdf]] |
| 11752 | @end example | 12273 | @end example |
| 11753 | 12274 | ||
| 11754 | If you have specified a caption as described in @ref{Images and tables}, the | 12275 | When captions follow the method as described in @ref{Images and tables}, the |
| 11755 | picture will be wrapped into a @code{figure} environment and thus become | 12276 | @LaTeX{} export back-end wraps the picture in a floating @code{figure} |
| 11756 | a floating element. You can also ask Org to export an image as a float | 12277 | environment. To float an image without specifying a caption, set the |
| 11757 | without specifying caption by setting the @code{:float} attribute. You may | 12278 | @code{:float} attribute to one of the following: |
| 11758 | also set it to: | ||
| 11759 | @itemize @minus | 12279 | @itemize @minus |
| 11760 | @item | 12280 | @item |
| 11761 | @code{t}: if you want to use the standard @samp{figure} environment. It is | 12281 | @code{t}: for a standard @samp{figure} environment; used by default whenever |
| 11762 | used by default if you provide a caption to the image. | 12282 | an image has a caption. |
| 11763 | @item | 12283 | @item |
| 11764 | @code{multicolumn}: if you wish to include an image which spans multiple | 12284 | @code{multicolumn}: to span the image across multiple columns of a page; the |
| 11765 | columns in a page. This will export the image wrapped in a @code{figure*} | 12285 | back-end wraps the image in a @code{figure*} environment. |
| 11766 | environment. | ||
| 11767 | @item | 12286 | @item |
| 11768 | @code{wrap}: if you would like to let text flow around the image. It will | 12287 | @code{wrap}: for text to flow around the image on the right; the figure |
| 11769 | make the figure occupy the left half of the page. | 12288 | occupies the left half of the page. |
| 11770 | @item | 12289 | @item |
| 11771 | @code{nil}: if you need to avoid any floating environment, even when | 12290 | @code{sideways}: for a new page with the image sideways, rotated ninety |
| 11772 | a caption is provided. | 12291 | degrees, in a @code{sidewaysfigure} environment; overrides @code{:placement} |
| 12292 | setting. | ||
| 12293 | @item | ||
| 12294 | @code{nil}: to avoid a @code{:float} even if using a caption. | ||
| 11773 | @end itemize | 12295 | @end itemize |
| 11774 | @noindent | 12296 | @noindent |
| 11775 | To modify the placement option of any floating environment, set the | 12297 | Use the @code{placement} attribute to modify a floating environment's placement. |
| 11776 | @code{placement} attribute. | ||
| 11777 | 12298 | ||
| 11778 | @example | 12299 | @example |
| 11779 | #+ATTR_LATEX: :float wrap :width 0.38\textwidth :placement @{r@}@{0.4\textwidth@} | 12300 | #+ATTR_LATEX: :float wrap :width 0.38\textwidth :placement |
| 11780 | [[./img/hst.png]] | 12301 | @{r@}@{0.4\textwidth@} [[./img/hst.png]] |
| 11781 | @end example | 12302 | @end example |
| 11782 | 12303 | ||
| 11783 | If the @code{:comment-include} attribute is set to a non-@code{nil} value, | 12304 | @vindex org-latex-images-centered |
| 11784 | the @LaTeX{} @code{\includegraphics} macro will be commented out. | 12305 | @cindex center image (@LaTeX{} export) |
| 12306 | @cindex image, centering (@LaTeX{} export) | ||
| 12307 | |||
| 12308 | The @LaTeX{} export back-end centers all images by default. Setting | ||
| 12309 | @code{:center} attribute to @code{nil} disables centering. To disable | ||
| 12310 | centering globally, set @code{org-latex-images-centered} to @code{t}. | ||
| 11785 | 12311 | ||
| 11786 | @subsubheading Plain lists in @LaTeX{} export | 12312 | Set the @code{:comment-include} attribute to non-@code{nil} value for the |
| 12313 | @LaTeX{} export back-end to comment out the @code{\includegraphics} macro. | ||
| 12314 | |||
| 12315 | @node Plain lists in @LaTeX{} export | ||
| 12316 | @subsection Plain lists in @LaTeX{} export | ||
| 11787 | @cindex plain lists, in @LaTeX{} export | 12317 | @cindex plain lists, in @LaTeX{} export |
| 12318 | @cindex #+ATTR_LATEX, in plain lists | ||
| 12319 | |||
| 12320 | The @LaTeX{} export back-end accepts the @code{:environment} and | ||
| 12321 | @code{:options} attributes for plain lists. Both attributes work together | ||
| 12322 | for customizing lists, as shown in the examples: | ||
| 12323 | |||
| 12324 | @example | ||
| 12325 | #+LATEX_HEADER: \usepackage[inline]@{enumitem@} | ||
| 12326 | Some ways to say "Hello": | ||
| 12327 | #+ATTR_LATEX: :environment itemize* | ||
| 12328 | #+ATTR_LATEX: :options [label=@{@}, itemjoin=@{,@}, itemjoin*=@{, and@}] | ||
| 12329 | - Hola | ||
| 12330 | - Bonjour | ||
| 12331 | - Guten Tag. | ||
| 12332 | @end example | ||
| 11788 | 12333 | ||
| 11789 | Plain lists accept two optional attributes: @code{:environment} and | 12334 | Since @LaTeX{} supports only four levels of nesting for lists, use an |
| 11790 | @code{:options}. The first one allows the use of a non-standard environment | 12335 | external package, such as @samp{enumitem} in @LaTeX{}, for levels deeper than |
| 11791 | (e.g., @samp{inparaenum}). The second one specifies additional arguments for | 12336 | four: |
| 11792 | that environment. | ||
| 11793 | 12337 | ||
| 11794 | @example | 12338 | @example |
| 11795 | #+ATTR_LATEX: :environment compactitem :options [$\circ$] | 12339 | #+LATEX_HEADER: \usepackage@{enumitem@} |
| 11796 | - you need ``paralist'' package to reproduce this example. | 12340 | #+LATEX_HEADER: \renewlist@{itemize@}@{itemize@}@{9@} |
| 12341 | #+LATEX_HEADER: \setlist[itemize]@{label=$\circ$@} | ||
| 12342 | - One | ||
| 12343 | - Two | ||
| 12344 | - Three | ||
| 12345 | - Four | ||
| 12346 | - Five | ||
| 11797 | @end example | 12347 | @end example |
| 11798 | 12348 | ||
| 11799 | @subsubheading Source blocks in @LaTeX{} export | 12349 | @node Source blocks in @LaTeX{} export |
| 12350 | @subsection Source blocks in @LaTeX{} export | ||
| 11800 | @cindex source blocks, in @LaTeX{} export | 12351 | @cindex source blocks, in @LaTeX{} export |
| 12352 | @cindex #+ATTR_LATEX, in source blocks | ||
| 12353 | |||
| 12354 | The @LaTeX{} export back-end can make source code blocks into floating | ||
| 12355 | objects through the attributes @code{:float} and @code{:options}. For | ||
| 12356 | @code{:float}: | ||
| 11801 | 12357 | ||
| 11802 | In addition to syntax defined in @ref{Literal examples}, names and captions | ||
| 11803 | (@pxref{Images and tables}), source blocks also accept a @code{:float} | ||
| 11804 | attribute. You may set it to: | ||
| 11805 | @itemize @minus | 12358 | @itemize @minus |
| 11806 | @item | 12359 | @item |
| 11807 | @code{t}: if you want to make the source block a float. It is the default | 12360 | @code{t}: makes a source block float; by default floats any source block with |
| 11808 | value when a caption is provided. | 12361 | a caption. |
| 11809 | @item | 12362 | @item |
| 11810 | @code{multicolumn}: if you wish to include a source block which spans multiple | 12363 | @code{multicolumn}: spans the source block across multiple columns of a page. |
| 11811 | columns in a page. | ||
| 11812 | @item | 12364 | @item |
| 11813 | @code{nil}: if you need to avoid any floating environment, even when a caption | 12365 | @code{nil}: avoids a @code{:float} even if using a caption; useful for |
| 11814 | is provided. It is useful for source code that may not fit in a single page. | 12366 | source code blocks that may not fit on a page. |
| 11815 | @end itemize | 12367 | @end itemize |
| 11816 | 12368 | ||
| 11817 | @example | 12369 | @example |
| 11818 | #+ATTR_LATEX: :float nil | 12370 | #+ATTR_LATEX: :float nil |
| 11819 | #+BEGIN_SRC emacs-lisp | 12371 | #+BEGIN_SRC emacs-lisp |
| 11820 | Code that may not fit in a single page. | 12372 | Lisp code that may not fit in a single page. |
| 11821 | #+END_SRC | 12373 | #+END_SRC |
| 11822 | @end example | 12374 | @end example |
| 11823 | 12375 | ||
| 11824 | @subsubheading Special blocks in @LaTeX{} export | 12376 | @vindex org-latex-listings-options |
| 12377 | @vindex org-latex-minted-options | ||
| 12378 | The @LaTeX{} export back-end passes string values in @code{:options} to | ||
| 12379 | @LaTeX{} packages for customization of that specific source block. In the | ||
| 12380 | example below, the @code{:options} are set for Minted. Minted is a source | ||
| 12381 | code highlighting @LaTeX{}package with many configurable options. | ||
| 12382 | |||
| 12383 | @example | ||
| 12384 | #+ATTR_LATEX: :options commentstyle=\bfseries | ||
| 12385 | #+BEGIN_SRC emacs-lisp | ||
| 12386 | (defun Fib (n) | ||
| 12387 | (if (< n 2) n (+ (Fib (- n 1)) (Fib (- n 2))))) | ||
| 12388 | #+END_SRC | ||
| 12389 | @end example | ||
| 12390 | |||
| 12391 | To apply similar configuration options for all source blocks in a file, use | ||
| 12392 | the @code{org-latex-listings-options} and @code{org-latex-minted-options} | ||
| 12393 | variables. | ||
| 12394 | |||
| 12395 | @node Example blocks in @LaTeX{} export | ||
| 12396 | @subsection Example blocks in @LaTeX{} export | ||
| 12397 | @cindex example blocks, in @LaTeX{} export | ||
| 12398 | @cindex verbatim blocks, in @LaTeX{} export | ||
| 12399 | @cindex #+ATTR_LATEX, in example blocks | ||
| 12400 | |||
| 12401 | The @LaTeX{} export back-end wraps the contents of example blocks in a | ||
| 12402 | @samp{verbatim} environment. To change this behavior to use another | ||
| 12403 | environment globally, specify an appropriate export filter (@pxref{Advanced | ||
| 12404 | configuration}). To change this behavior to use another environment for each | ||
| 12405 | block, use the @code{:environment} parameter to specify a custom environment. | ||
| 12406 | |||
| 12407 | @example | ||
| 12408 | #+ATTR_LATEX: :environment myverbatim | ||
| 12409 | #+BEGIN_EXAMPLE | ||
| 12410 | This sentence is false. | ||
| 12411 | #+END_EXAMPLE | ||
| 12412 | @end example | ||
| 12413 | |||
| 12414 | @node Special blocks in @LaTeX{} export | ||
| 12415 | @subsection Special blocks in @LaTeX{} export | ||
| 11825 | @cindex special blocks, in @LaTeX{} export | 12416 | @cindex special blocks, in @LaTeX{} export |
| 11826 | @cindex abstract, in @LaTeX{} export | 12417 | @cindex abstract, in @LaTeX{} export |
| 11827 | @cindex proof, in @LaTeX{} export | 12418 | @cindex proof, in @LaTeX{} export |
| 12419 | @cindex #+ATTR_LATEX, in special blocks | ||
| 11828 | 12420 | ||
| 11829 | In @LaTeX{} back-end, special blocks become environments of the same name. | 12421 | |
| 11830 | Value of @code{:options} attribute will be appended as-is to that | 12422 | For other special blocks in the Org file, the @LaTeX{} export back-end makes |
| 11831 | environment's opening string. For example: | 12423 | a special environment of the same name. The back-end also takes |
| 12424 | @code{:options}, if any, and appends as-is to that environment's opening | ||
| 12425 | string. For example: | ||
| 11832 | 12426 | ||
| 11833 | @example | 12427 | @example |
| 11834 | #+BEGIN_ABSTRACT | 12428 | #+BEGIN_abstract |
| 11835 | We demonstrate how to solve the Syracuse problem. | 12429 | We demonstrate how to solve the Syracuse problem. |
| 11836 | #+END_ABSTRACT | 12430 | #+END_abstract |
| 11837 | 12431 | ||
| 11838 | #+ATTR_LATEX: :options [Proof of important theorem] | 12432 | #+ATTR_LATEX: :options [Proof of important theorem] |
| 11839 | #+BEGIN_PROOF | 12433 | #+BEGIN_proof |
| 11840 | ... | 12434 | ... |
| 11841 | Therefore, any even number greater than 2 is the sum of two primes. | 12435 | Therefore, any even number greater than 2 is the sum of two primes. |
| 11842 | #+END_PROOF | 12436 | #+END_proof |
| 11843 | @end example | 12437 | @end example |
| 11844 | 12438 | ||
| 11845 | @noindent | 12439 | @noindent |
| 11846 | becomes | 12440 | exports to |
| 11847 | 12441 | ||
| 11848 | @example | 12442 | @example |
| 11849 | \begin@{abstract@} | 12443 | \begin@{abstract@} |
| @@ -11862,43 +12456,43 @@ example: | |||
| 11862 | 12456 | ||
| 11863 | @example | 12457 | @example |
| 11864 | #+ATTR_LATEX: :caption \MyCaption@{HeadingA@} | 12458 | #+ATTR_LATEX: :caption \MyCaption@{HeadingA@} |
| 11865 | #+BEGIN_PROOF | 12459 | #+BEGIN_proof |
| 11866 | ... | 12460 | ... |
| 11867 | #+END_PROOF | 12461 | #+END_proof |
| 11868 | @end example | 12462 | @end example |
| 11869 | 12463 | ||
| 11870 | @subsubheading Horizontal rules | 12464 | @node Horizontal rules in @LaTeX{} export |
| 12465 | @subsection Horizontal rules in @LaTeX{} export | ||
| 11871 | @cindex horizontal rules, in @LaTeX{} export | 12466 | @cindex horizontal rules, in @LaTeX{} export |
| 12467 | @cindex #+ATTR_LATEX, in horizontal rules | ||
| 11872 | 12468 | ||
| 11873 | Width and thickness of a given horizontal rule can be controlled with, | 12469 | The @LaTeX{} export back-end converts horizontal rules by the specified |
| 11874 | respectively, @code{:width} and @code{:thickness} attributes: | 12470 | @code{:width} and @code{:thickness} attributes. For example: |
| 11875 | 12471 | ||
| 11876 | @example | 12472 | @example |
| 11877 | #+ATTR_LATEX: :width .6\textwidth :thickness 0.8pt | 12473 | #+ATTR_LATEX: :width .6\textwidth :thickness 0.8pt |
| 11878 | ----- | 12474 | ----- |
| 11879 | @end example | 12475 | @end example |
| 11880 | 12476 | ||
| 11881 | @node Markdown export, OpenDocument Text export, @LaTeX{} and PDF export, Exporting | 12477 | @node Markdown export |
| 11882 | @section Markdown export | 12478 | @section Markdown export |
| 11883 | @cindex Markdown export | 12479 | @cindex Markdown export |
| 11884 | 12480 | ||
| 11885 | @code{md} export back-end generates Markdown syntax@footnote{Vanilla flavor, | 12481 | The Markdown export back-end, @code{md}, converts an Org file to a Markdown |
| 11886 | as defined at @url{http://daringfireball.net/projects/markdown/}.} for an Org | 12482 | format, as defined at @url{http://daringfireball.net/projects/markdown/}. |
| 11887 | mode buffer. | ||
| 11888 | 12483 | ||
| 11889 | It is built over HTML back-end: any construct not supported by Markdown | 12484 | Since @code{md} is built on top of the HTML back-end, any Org constructs not |
| 11890 | syntax (e.g., tables) will be controlled and translated by @code{html} | 12485 | supported by Markdown, such as tables, the underlying @code{html} back-end |
| 11891 | back-end (@pxref{HTML export}). | 12486 | (@pxref{HTML export}) converts them. |
| 11892 | 12487 | ||
| 11893 | @subheading Markdown export commands | 12488 | @subheading Markdown export commands |
| 11894 | 12489 | ||
| 11895 | @table @kbd | 12490 | @table @kbd |
| 11896 | @orgcmd{C-c C-e m m,org-md-export-to-markdown} | 12491 | @orgcmd{C-c C-e m m,org-md-export-to-markdown} |
| 11897 | Export as a text file written in Markdown syntax. For an Org file, | 12492 | Export to a text file with Markdown syntax. For @file{myfile.org}, Org |
| 11898 | @file{myfile.org}, the resulting file will be @file{myfile.md}. The file | 12493 | exports to @file{myfile.md}, overwritten without warning. |
| 11899 | will be overwritten without warning. | ||
| 11900 | @orgcmd{C-c C-e m M,org-md-export-as-markdown} | 12494 | @orgcmd{C-c C-e m M,org-md-export-as-markdown} |
| 11901 | Export to a temporary buffer. Do not create a file. | 12495 | Export to a temporary buffer. Does not create a file. |
| 11902 | @item C-c C-e m o | 12496 | @item C-c C-e m o |
| 11903 | Export as a text file with Markdown syntax, then open it. | 12497 | Export as a text file with Markdown syntax, then open it. |
| 11904 | @end table | 12498 | @end table |
| @@ -11906,54 +12500,52 @@ Export as a text file with Markdown syntax, then open it. | |||
| 11906 | @subheading Header and sectioning structure | 12500 | @subheading Header and sectioning structure |
| 11907 | 12501 | ||
| 11908 | @vindex org-md-headline-style | 12502 | @vindex org-md-headline-style |
| 11909 | Markdown export can generate both @code{atx} and @code{setext} types for | 12503 | Based on @code{org-md-headline-style}, markdown export can generate headlines |
| 11910 | headlines, according to @code{org-md-headline-style}. The former introduces | 12504 | of both @code{atx} and @code{setext} types. @code{atx} limits headline |
| 11911 | a hard limit of two levels, whereas the latter pushes it to six. Headlines | 12505 | levels to two. @code{setext} limits headline levels to six. Beyond these |
| 11912 | below that limit are exported as lists. You can also set a soft limit before | 12506 | limits, the export back-end converts headlines to lists. To set a limit to a |
| 11913 | that one (@pxref{Export settings}). | 12507 | level before the absolute limit (@pxref{Export settings}). |
| 11914 | 12508 | ||
| 11915 | @c begin opendocument | 12509 | @c begin opendocument |
| 11916 | 12510 | ||
| 11917 | @node OpenDocument Text export, Org export, Markdown export, Exporting | 12511 | @node OpenDocument Text export |
| 11918 | @section OpenDocument Text export | 12512 | @section OpenDocument Text export |
| 11919 | @cindex ODT | 12513 | @cindex ODT |
| 11920 | @cindex OpenDocument | 12514 | @cindex OpenDocument |
| 11921 | @cindex export, OpenDocument | 12515 | @cindex export, OpenDocument |
| 11922 | @cindex LibreOffice | 12516 | @cindex LibreOffice |
| 11923 | 12517 | ||
| 11924 | Org mode@footnote{Versions 7.8 or later} supports export to OpenDocument Text | 12518 | The ODT export back-end handles creating of OpenDocument Text (ODT) format |
| 11925 | (ODT) format. Documents created by this exporter use the | 12519 | files. The format complies with @cite{OpenDocument-v1.2 |
| 11926 | @cite{OpenDocument-v1.2 | ||
| 11927 | specification}@footnote{@url{http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html, | 12520 | specification}@footnote{@url{http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html, |
| 11928 | Open Document Format for Office Applications (OpenDocument) Version 1.2}} and | 12521 | Open Document Format for Office Applications (OpenDocument) Version 1.2}} and |
| 11929 | are compatible with LibreOffice 3.4. | 12522 | is compatible with LibreOffice 3.4. |
| 11930 | 12523 | ||
| 11931 | @menu | 12524 | @menu |
| 11932 | * Pre-requisites for ODT export:: What packages ODT exporter relies on | 12525 | * Pre-requisites for ODT export:: Required packages. |
| 11933 | * ODT export commands:: How to invoke ODT export | 12526 | * ODT export commands:: Invoking export. |
| 11934 | * Extending ODT export:: How to produce @samp{doc}, @samp{pdf} files | 12527 | * ODT specific export settings:: Configuration options. |
| 11935 | * Applying custom styles:: How to apply custom styles to the output | 12528 | * Extending ODT export:: Producing @file{.doc}, @file{.pdf} files. |
| 11936 | * Links in ODT export:: How links will be interpreted and formatted | 12529 | * Applying custom styles:: Styling the output. |
| 11937 | * Tables in ODT export:: How Tables are exported | 12530 | * Links in ODT export:: Handling and formatting links. |
| 11938 | * Images in ODT export:: How to insert images | 12531 | * Tables in ODT export:: Org table conversions. |
| 11939 | * Math formatting in ODT export:: How @LaTeX{} fragments are formatted | 12532 | * Images in ODT export:: Inserting images. |
| 11940 | * Labels and captions in ODT export:: How captions are rendered | 12533 | * Math formatting in ODT export:: Formatting @LaTeX{} fragments. |
| 11941 | * Literal examples in ODT export:: How source and example blocks are formatted | 12534 | * Labels and captions in ODT export:: Rendering objects. |
| 11942 | * Advanced topics in ODT export:: Read this if you are a power user | 12535 | * Literal examples in ODT export:: For source code and example blocks. |
| 12536 | * Advanced topics in ODT export:: For power users. | ||
| 11943 | @end menu | 12537 | @end menu |
| 11944 | 12538 | ||
| 11945 | @node Pre-requisites for ODT export, ODT export commands, OpenDocument Text export, OpenDocument Text export | 12539 | @node Pre-requisites for ODT export |
| 11946 | @subsection Pre-requisites for ODT export | 12540 | @subsection Pre-requisites for ODT export |
| 11947 | @cindex zip | 12541 | @cindex zip |
| 11948 | The ODT exporter relies on the @file{zip} program to create the final | 12542 | The ODT export back-end relies on the @file{zip} program to create the final |
| 11949 | output. Check the availability of this program before proceeding further. | 12543 | compressed ODT output. Check if @file{zip} is locally available and |
| 12544 | executable. Without @file{zip}, export cannot finish. | ||
| 11950 | 12545 | ||
| 11951 | @node ODT export commands, Extending ODT export, Pre-requisites for ODT export, OpenDocument Text export | 12546 | @node ODT export commands |
| 11952 | @subsection ODT export commands | 12547 | @subsection ODT export commands |
| 11953 | |||
| 11954 | @subsubheading Exporting to ODT | ||
| 11955 | @anchor{x-export-to-odt} | 12548 | @anchor{x-export-to-odt} |
| 11956 | |||
| 11957 | @cindex region, active | 12549 | @cindex region, active |
| 11958 | @cindex active region | 12550 | @cindex active region |
| 11959 | @cindex transient-mark-mode | 12551 | @cindex transient-mark-mode |
| @@ -11964,94 +12556,121 @@ output. Check the availability of this program before proceeding further. | |||
| 11964 | Export as OpenDocument Text file. | 12556 | Export as OpenDocument Text file. |
| 11965 | 12557 | ||
| 11966 | @vindex org-odt-preferred-output-format | 12558 | @vindex org-odt-preferred-output-format |
| 11967 | If @code{org-odt-preferred-output-format} is specified, automatically convert | 12559 | If @code{org-odt-preferred-output-format} is specified, the ODT export |
| 11968 | the exported file to that format. @xref{x-export-to-other-formats, , | 12560 | back-end automatically converts the exported file to that format. |
| 11969 | Automatically exporting to other formats}. | 12561 | @xref{x-export-to-other-formats, , Automatically exporting to other formats}. |
| 11970 | 12562 | ||
| 11971 | For an Org file @file{myfile.org}, the ODT file will be | 12563 | For @file{myfile.org}, Org exports to @file{myfile.odt}, overwriting without |
| 11972 | @file{myfile.odt}. The file will be overwritten without warning. If there | 12564 | warning. The ODT export back-end exports a region only if a region was |
| 11973 | is an active region,@footnote{This requires @code{transient-mark-mode} to be | 12565 | active. Note for exporting active regions, the @code{transient-mark-mode} |
| 11974 | turned on} only the region will be exported. If the selected region is a | 12566 | has to be turned on. |
| 11975 | single tree,@footnote{To select the current subtree, use @kbd{C-c @@}} the | 12567 | |
| 11976 | tree head will become the document title. If the tree head entry has, or | 12568 | If the selected region is a single tree, the ODT export back-end makes the |
| 11977 | inherits, an @code{EXPORT_FILE_NAME} property, that name will be used for the | 12569 | tree head the document title. Incidentally, @kbd{C-c @@} selects the current |
| 11978 | export. | 12570 | sub-tree. If the tree head entry has, or inherits, an |
| 12571 | @code{EXPORT_FILE_NAME} property, the ODT export back-end uses that for file | ||
| 12572 | name. | ||
| 11979 | 12573 | ||
| 11980 | @kbd{C-c C-e o O} | 12574 | @kbd{C-c C-e o O} |
| 11981 | Export as an OpenDocument Text file and open the resulting file. | 12575 | Export to an OpenDocument Text file format and open it. |
| 11982 | 12576 | ||
| 11983 | @vindex org-odt-preferred-output-format | 12577 | @vindex org-odt-preferred-output-format |
| 11984 | If @code{org-odt-preferred-output-format} is specified, open the converted | 12578 | When @code{org-odt-preferred-output-format} is specified, open the converted |
| 11985 | file instead. @xref{x-export-to-other-formats, , Automatically exporting to | 12579 | file instead. @xref{x-export-to-other-formats, , Automatically exporting to |
| 11986 | other formats}. | 12580 | other formats}. |
| 11987 | @end table | 12581 | @end table |
| 11988 | 12582 | ||
| 11989 | @node Extending ODT export, Applying custom styles, ODT export commands, OpenDocument Text export | 12583 | @node ODT specific export settings |
| 12584 | @subsection ODT specific export settings | ||
| 12585 | The ODT export back-end has several additional keywords for customizing ODT | ||
| 12586 | output. Setting these keywords works similar to the general options | ||
| 12587 | (@pxref{Export settings}). | ||
| 12588 | |||
| 12589 | @table @samp | ||
| 12590 | @item DESCRIPTION | ||
| 12591 | @cindex #+DESCRIPTION (ODT) | ||
| 12592 | This is the document's description, which the ODT export back-end inserts as | ||
| 12593 | document metadata. For long descriptions, use multiple @code{#+DESCRIPTION} | ||
| 12594 | lines. | ||
| 12595 | |||
| 12596 | @item KEYWORDS | ||
| 12597 | @cindex #+KEYWORDS (ODT) | ||
| 12598 | The keywords for the document. The ODT export back-end inserts the | ||
| 12599 | description along with author name, keywords, and related file metadata as | ||
| 12600 | metadata in the output file. Use multiple @code{#+KEYWORDS} lines if | ||
| 12601 | necessary. | ||
| 12602 | |||
| 12603 | @item ODT_STYLES_FILE | ||
| 12604 | @cindex ODT_STYLES_FILE | ||
| 12605 | @vindex org-odt-styles-file | ||
| 12606 | The ODT export back-end uses the @code{org-odt-styles-file} by default. See | ||
| 12607 | @ref{Applying custom styles} for details. | ||
| 12608 | |||
| 12609 | @item SUBTITLE | ||
| 12610 | @cindex SUBTITLE (ODT) | ||
| 12611 | The document subtitle. | ||
| 12612 | @end table | ||
| 12613 | |||
| 12614 | @node Extending ODT export | ||
| 11990 | @subsection Extending ODT export | 12615 | @subsection Extending ODT export |
| 11991 | 12616 | ||
| 11992 | The ODT exporter can interface with a variety of document | 12617 | The ODT export back-end can produce documents in other formats besides ODT |
| 11993 | converters and supports popular converters out of the box. As a result, you | 12618 | using a specialized ODT converter process. Its common interface works with |
| 11994 | can use it to export to formats like @samp{doc} or convert a document from | 12619 | popular converters to produce formats such as @samp{doc}, or convert a |
| 11995 | one format (say @samp{csv}) to another format (say @samp{ods} or @samp{xls}). | 12620 | document from one format, say @samp{csv}, to another format, say @samp{xls}. |
| 11996 | 12621 | ||
| 11997 | @cindex @file{unoconv} | 12622 | @cindex @file{unoconv} |
| 11998 | @cindex LibreOffice | 12623 | @cindex LibreOffice |
| 11999 | If you have a working installation of LibreOffice, a document converter is | 12624 | |
| 12000 | pre-configured for you and you can use it right away. If you would like to | 12625 | Customize @code{org-odt-convert-process} variable to point to @code{unoconv}, |
| 12001 | use @file{unoconv} as your preferred converter, customize the variable | 12626 | which is the ODT's preferred converter. Working installations of LibreOffice |
| 12002 | @code{org-odt-convert-process} to point to @code{unoconv}. You can | 12627 | would already have @code{unoconv} installed. Alternatively, other converters |
| 12003 | also use your own favorite converter or tweak the default settings of the | 12628 | may be substituted here. @xref{Configuring a document converter}. |
| 12004 | @file{LibreOffice} and @samp{unoconv} converters. @xref{Configuring a | 12629 | |
| 12005 | document converter}. | 12630 | @subsubheading Automatically exporting to other formats |
| 12006 | |||
| 12007 | @subsubsection Automatically exporting to other formats | ||
| 12008 | @anchor{x-export-to-other-formats} | 12631 | @anchor{x-export-to-other-formats} |
| 12009 | 12632 | ||
| 12010 | @vindex org-odt-preferred-output-format | 12633 | @vindex org-odt-preferred-output-format |
| 12011 | Very often, you will find yourself exporting to ODT format, only to | 12634 | If ODT format is just an intermediate step to get to other formats, such as |
| 12012 | immediately save the exported document to other formats like @samp{doc}, | 12635 | @samp{doc}, @samp{docx}, @samp{rtf}, or @samp{pdf}, etc., then extend the ODT |
| 12013 | @samp{docx}, @samp{rtf}, @samp{pdf} etc. In such cases, you can specify your | 12636 | export back-end to directly produce that format. Specify the final format in |
| 12014 | preferred output format by customizing the variable | 12637 | the @code{org-odt-preferred-output-format} variable. This is one way to |
| 12015 | @code{org-odt-preferred-output-format}. This way, the export commands | 12638 | extend (@pxref{x-export-to-odt,,Exporting to ODT}). |
| 12016 | (@pxref{x-export-to-odt,,Exporting to ODT}) can be extended to export to a | 12639 | |
| 12017 | format that is of immediate interest to you. | 12640 | @subsubheading Converting between document formats |
| 12018 | |||
| 12019 | @subsubsection Converting between document formats | ||
| 12020 | @anchor{x-convert-to-other-formats} | 12641 | @anchor{x-convert-to-other-formats} |
| 12021 | 12642 | ||
| 12022 | There are many document converters in the wild which support conversion to | 12643 | The Org export back-end is made to be inter-operable with a wide range of text |
| 12023 | and from various file formats, including, but not limited to the | 12644 | document format converters. Newer generation converters, such as LibreOffice |
| 12024 | ODT format. LibreOffice converter, mentioned above, is one such | 12645 | and Pandoc, can handle hundreds of formats at once. Org provides a |
| 12025 | converter. Once a converter is configured, you can interact with it using | 12646 | consistent interaction with whatever converter is installed. Here are some |
| 12026 | the following command. | 12647 | generic commands: |
| 12027 | 12648 | ||
| 12028 | @vindex org-odt-convert | 12649 | @vindex org-odt-convert |
| 12029 | @table @kbd | 12650 | @table @kbd |
| 12030 | 12651 | ||
| 12031 | @item M-x org-odt-convert RET | 12652 | @item M-x org-odt-convert RET |
| 12032 | Convert an existing document from one format to another. With a prefix | 12653 | Convert an existing document from one format to another. With a prefix |
| 12033 | argument, also open the newly produced file. | 12654 | argument, opens the newly produced file. |
| 12034 | @end table | 12655 | @end table |
| 12035 | 12656 | ||
| 12036 | @node Applying custom styles, Links in ODT export, Extending ODT export, OpenDocument Text export | 12657 | @node Applying custom styles |
| 12037 | @subsection Applying custom styles | 12658 | @subsection Applying custom styles |
| 12038 | @cindex styles, custom | 12659 | @cindex styles, custom |
| 12039 | @cindex template, custom | 12660 | @cindex template, custom |
| 12040 | 12661 | ||
| 12041 | The ODT exporter ships with a set of OpenDocument styles | 12662 | The ODT export back-end comes with many OpenDocument styles (@pxref{Working |
| 12042 | (@pxref{Working with OpenDocument style files}) that ensure a well-formatted | 12663 | with OpenDocument style files}). To expand or further customize these |
| 12043 | output. These factory styles, however, may not cater to your specific | 12664 | built-in style sheets, either edit the style sheets directly or generate them |
| 12044 | tastes. To customize the output, you can either modify the above styles | 12665 | using an application such as LibreOffice. The example here shows creating a |
| 12045 | files directly, or generate the required styles using an application like | 12666 | style using LibreOffice. |
| 12046 | LibreOffice. The latter method is suitable for expert and non-expert | ||
| 12047 | users alike, and is described here. | ||
| 12048 | 12667 | ||
| 12049 | @subsubsection Applying custom styles: the easy way | 12668 | @subsubheading Applying custom styles: the easy way |
| 12050 | 12669 | ||
| 12051 | @enumerate | 12670 | @enumerate |
| 12052 | @item | 12671 | @item |
| 12053 | Create a sample @file{example.org} file with the below settings and export it | 12672 | Create a sample @file{example.org} file with settings as shown below, and |
| 12054 | to ODT format. | 12673 | export it to ODT format. |
| 12055 | 12674 | ||
| 12056 | @example | 12675 | @example |
| 12057 | #+OPTIONS: H:10 num:t | 12676 | #+OPTIONS: H:10 num:t |
| @@ -12059,9 +12678,9 @@ to ODT format. | |||
| 12059 | 12678 | ||
| 12060 | @item | 12679 | @item |
| 12061 | Open the above @file{example.odt} using LibreOffice. Use the @file{Stylist} | 12680 | Open the above @file{example.odt} using LibreOffice. Use the @file{Stylist} |
| 12062 | to locate the target styles---these typically have the @samp{Org} prefix---and | 12681 | to locate the target styles, which typically have the @samp{Org} prefix. |
| 12063 | modify those to your taste. Save the modified file either as an | 12682 | Open one, modify, and save as either OpenDocument Text (@file{.odt}) or |
| 12064 | OpenDocument Text (@file{.odt}) or OpenDocument Template (@file{.ott}) file. | 12683 | OpenDocument Template (@file{.ott}) file. |
| 12065 | 12684 | ||
| 12066 | @item | 12685 | @item |
| 12067 | @cindex #+ODT_STYLES_FILE | 12686 | @cindex #+ODT_STYLES_FILE |
| @@ -12070,8 +12689,8 @@ Customize the variable @code{org-odt-styles-file} and point it to the | |||
| 12070 | newly created file. For additional configuration options | 12689 | newly created file. For additional configuration options |
| 12071 | @pxref{x-overriding-factory-styles,,Overriding factory styles}. | 12690 | @pxref{x-overriding-factory-styles,,Overriding factory styles}. |
| 12072 | 12691 | ||
| 12073 | If you would like to choose a style on a per-file basis, you can use the | 12692 | To apply and ODT style to a particular file, use the @code{#+ODT_STYLES_FILE} |
| 12074 | @code{#+ODT_STYLES_FILE} option. A typical setting will look like | 12693 | option as shown in the example below: |
| 12075 | 12694 | ||
| 12076 | @example | 12695 | @example |
| 12077 | #+ODT_STYLES_FILE: "/path/to/example.ott" | 12696 | #+ODT_STYLES_FILE: "/path/to/example.ott" |
| @@ -12085,51 +12704,48 @@ or | |||
| 12085 | 12704 | ||
| 12086 | @end enumerate | 12705 | @end enumerate |
| 12087 | 12706 | ||
| 12088 | @subsubsection Using third-party styles and templates | 12707 | @subsubheading Using third-party styles and templates |
| 12089 | 12708 | ||
| 12090 | You can use third-party styles and templates for customizing your output. | 12709 | The ODT export back-end relies on many templates and style names. Using |
| 12091 | This will produce the desired output only if the template provides all | 12710 | third-party styles and templates can lead to mismatches. Templates derived |
| 12092 | style names that the @samp{ODT} exporter relies on. Unless this condition is | 12711 | from built in ODT templates and styles seem to have fewer problems. |
| 12093 | met, the output is going to be less than satisfactory. So it is highly | ||
| 12094 | recommended that you only work with templates that are directly derived from | ||
| 12095 | the factory settings. | ||
| 12096 | 12712 | ||
| 12097 | @node Links in ODT export, Tables in ODT export, Applying custom styles, OpenDocument Text export | 12713 | @node Links in ODT export |
| 12098 | @subsection Links in ODT export | 12714 | @subsection Links in ODT export |
| 12099 | @cindex links, in ODT export | 12715 | @cindex links, in ODT export |
| 12100 | 12716 | ||
| 12101 | ODT exporter creates native cross-references for internal links. It creates | 12717 | ODT export back-end creates native cross-references for internal links and |
| 12102 | Internet-style links for all other links. | 12718 | Internet-style links for all other link types. |
| 12103 | 12719 | ||
| 12104 | A link with no description and destined to a regular (un-itemized) outline | 12720 | A link with no description and pointing to a regular---un-itemized---outline |
| 12105 | heading is replaced with a cross-reference and section number of the heading. | 12721 | heading is replaced with a cross-reference and section number of the heading. |
| 12106 | 12722 | ||
| 12107 | A @samp{\ref@{label@}}-style reference to an image, table etc.@: is replaced | 12723 | A @samp{\ref@{label@}}-style reference to an image, table etc.@: is replaced |
| 12108 | with a cross-reference and sequence number of the labeled entity. | 12724 | with a cross-reference and sequence number of the labeled entity. |
| 12109 | @xref{Labels and captions in ODT export}. | 12725 | @xref{Labels and captions in ODT export}. |
| 12110 | 12726 | ||
| 12111 | @node Tables in ODT export, Images in ODT export, Links in ODT export, OpenDocument Text export | 12727 | @node Tables in ODT export |
| 12112 | @subsection Tables in ODT export | 12728 | @subsection Tables in ODT export |
| 12113 | @cindex tables, in ODT export | 12729 | @cindex tables, in ODT export |
| 12114 | 12730 | ||
| 12115 | Export of native Org mode tables (@pxref{Tables}) and simple @file{table.el} | 12731 | The ODT export back-end handles native Org mode tables (@pxref{Tables}) and |
| 12116 | tables is supported. However, export of complex @file{table.el} tables---tables | 12732 | simple @file{table.el} tables. Complex @file{table.el} tables having column |
| 12117 | that have column or row spans---is not supported. Such tables are | 12733 | or row spans are not supported. Such tables are stripped from the exported |
| 12118 | stripped from the exported document. | 12734 | document. |
| 12119 | 12735 | ||
| 12120 | By default, a table is exported with top and bottom frames and with rules | 12736 | By default, the ODT export back-end exports a table with top and bottom |
| 12121 | separating row and column groups (@pxref{Column groups}). Furthermore, all | 12737 | frames and with ruled lines separating row and column groups (@pxref{Column |
| 12122 | tables are typeset to occupy the same width. If the table specifies | 12738 | groups}). All tables are typeset to occupy the same width. The ODT export |
| 12123 | alignment and relative width for its columns (@pxref{Column width and | 12739 | back-end honors any table alignments and relative widths for columns |
| 12124 | alignment}) then these are honored on export.@footnote{The column widths are | 12740 | (@pxref{Column width and alignment}). |
| 12125 | interpreted as weighted ratios with the default weight being 1} | 12741 | |
| 12742 | Note that the ODT export back-end interprets column widths as weighted | ||
| 12743 | ratios, the default weight being 1. | ||
| 12126 | 12744 | ||
| 12127 | @cindex #+ATTR_ODT | 12745 | @cindex #+ATTR_ODT |
| 12128 | You can control the width of the table by specifying @code{:rel-width} | ||
| 12129 | property using an @code{#+ATTR_ODT} line. | ||
| 12130 | 12746 | ||
| 12131 | For example, consider the following table which makes use of all the rules | 12747 | Specifying @code{:rel-width} property on an @code{#+ATTR_ODT} line controls |
| 12132 | mentioned above. | 12748 | the width of the table. For example: |
| 12133 | 12749 | ||
| 12134 | @example | 12750 | @example |
| 12135 | #+ATTR_ODT: :rel-width 50 | 12751 | #+ATTR_ODT: :rel-width 50 |
| @@ -12144,25 +12760,25 @@ mentioned above. | |||
| 12144 | | Sum | 16 | 123 | 2560 | 2699 | | 12760 | | Sum | 16 | 123 | 2560 | 2699 | |
| 12145 | @end example | 12761 | @end example |
| 12146 | 12762 | ||
| 12147 | On export, the table will occupy 50% of text area. The columns will be sized | 12763 | On export, the above table takes 50% of text width area. The exporter sizes |
| 12148 | (roughly) in the ratio of 13:5:5:5:6. The first column will be left-aligned | 12764 | the columns in the ratio: 13:5:5:5:6. The first column is left-aligned and |
| 12149 | and rest of the columns will be right-aligned. There will be vertical rules | 12765 | rest of the columns, right-aligned. Vertical rules separate the header and |
| 12150 | after separating the header and last columns from other columns. There will | 12766 | the last column. Horizontal rules separate the header and the last row. |
| 12151 | be horizontal rules separating the header and last rows from other rows. | ||
| 12152 | 12767 | ||
| 12153 | If you are not satisfied with the above formatting options, you can create | 12768 | For even more customization, create custom table styles and associate them |
| 12154 | custom table styles and associate them with a table using the | 12769 | with a table using the @code{#+ATTR_ODT} line. @xref{Customizing tables in |
| 12155 | @code{#+ATTR_ODT} line. @xref{Customizing tables in ODT export}. | 12770 | ODT export}. |
| 12156 | 12771 | ||
| 12157 | @node Images in ODT export, Math formatting in ODT export, Tables in ODT export, OpenDocument Text export | 12772 | @node Images in ODT export |
| 12158 | @subsection Images in ODT export | 12773 | @subsection Images in ODT export |
| 12159 | @cindex images, embedding in ODT | 12774 | @cindex images, embedding in ODT |
| 12160 | @cindex embedding images in ODT | 12775 | @cindex embedding images in ODT |
| 12161 | 12776 | ||
| 12162 | @subsubheading Embedding images | 12777 | @subsubheading Embedding images |
| 12163 | You can embed images within the exported document by providing a link to the | 12778 | The ODT export back-end processes image links in Org files that do not have |
| 12164 | desired image file with no link description. For example, to embed | 12779 | descriptions, such as these links @samp{[[file:img.jpg]]} or |
| 12165 | @samp{img.png} do either of the following: | 12780 | @samp{[[./img.jpg]]}, as direct image insertions in the final output. Either |
| 12781 | of these examples works: | ||
| 12166 | 12782 | ||
| 12167 | @example | 12783 | @example |
| 12168 | [[file:img.png]] | 12784 | [[file:img.png]] |
| @@ -12173,10 +12789,9 @@ desired image file with no link description. For example, to embed | |||
| 12173 | @end example | 12789 | @end example |
| 12174 | 12790 | ||
| 12175 | @subsubheading Embedding clickable images | 12791 | @subsubheading Embedding clickable images |
| 12176 | You can create clickable images by providing a link whose description is a | 12792 | For clickable images, provide a link whose description is another link to an |
| 12177 | link to an image file. For example, to embed a image | 12793 | image file. For example, to embed a image @file{org-mode-unicorn.png} which |
| 12178 | @file{org-mode-unicorn.png} which when clicked jumps to | 12794 | when clicked jumps to @uref{http://Orgmode.org} website, do the following |
| 12179 | @uref{http://Orgmode.org} website, do the following | ||
| 12180 | 12795 | ||
| 12181 | @example | 12796 | @example |
| 12182 | [[http://orgmode.org][./org-mode-unicorn.png]] | 12797 | [[http://orgmode.org][./org-mode-unicorn.png]] |
| @@ -12185,25 +12800,22 @@ link to an image file. For example, to embed a image | |||
| 12185 | @subsubheading Sizing and scaling of embedded images | 12800 | @subsubheading Sizing and scaling of embedded images |
| 12186 | 12801 | ||
| 12187 | @cindex #+ATTR_ODT | 12802 | @cindex #+ATTR_ODT |
| 12188 | You can control the size and scale of the embedded images using the | 12803 | Control the size and scale of the embedded images with the @code{#+ATTR_ODT} |
| 12189 | @code{#+ATTR_ODT} attribute. | 12804 | attribute. |
| 12190 | 12805 | ||
| 12191 | @cindex identify, ImageMagick | 12806 | @cindex identify, ImageMagick |
| 12192 | @vindex org-odt-pixels-per-inch | 12807 | @vindex org-odt-pixels-per-inch |
| 12193 | The exporter specifies the desired size of the image in the final document in | 12808 | The ODT export back-end starts with establishing the size of the image in the |
| 12194 | units of centimeters. In order to scale the embedded images, the exporter | 12809 | final document. The dimensions of this size is measured in centimeters. The |
| 12195 | queries for pixel dimensions of the images using one of a) ImageMagick's | 12810 | back-end then queries the image file for its dimensions measured in pixels. |
| 12196 | @file{identify} program or b) Emacs @code{create-image} and @code{image-size} | 12811 | For this measurement, the back-end relies on ImageMagick's @file{identify} |
| 12197 | APIs@footnote{Use of @file{ImageMagick} is only desirable. However, if you | 12812 | program or Emacs @code{create-image} and @code{image-size} API. ImageMagick |
| 12198 | routinely produce documents that have large images or you export your Org | 12813 | is the preferred choice for large file sizes or frequent batch operations. |
| 12199 | files that has images using a Emacs batch script, then the use of | 12814 | The back-end then converts the pixel dimensions using |
| 12200 | @file{ImageMagick} is mandatory.}. The pixel dimensions are subsequently | 12815 | @code{org-odt-pixels-per-inch} into the familiar 72 dpi or 96 dpi. The |
| 12201 | converted in to units of centimeters using | 12816 | default value for this is in @code{display-pixels-per-inch}, which can be |
| 12202 | @code{org-odt-pixels-per-inch}. The default value of this variable is | 12817 | tweaked for better results based on the capabilities of the output device. |
| 12203 | set to @code{display-pixels-per-inch}. You can tweak this variable to | 12818 | Here are some common image scaling operations: |
| 12204 | achieve the best results. | ||
| 12205 | |||
| 12206 | The examples below illustrate the various possibilities. | ||
| 12207 | 12819 | ||
| 12208 | @table @asis | 12820 | @table @asis |
| 12209 | @item Explicitly size the image | 12821 | @item Explicitly size the image |
| @@ -12244,38 +12856,37 @@ height:width ratio, do the following | |||
| 12244 | @subsubheading Anchoring of images | 12856 | @subsubheading Anchoring of images |
| 12245 | 12857 | ||
| 12246 | @cindex #+ATTR_ODT | 12858 | @cindex #+ATTR_ODT |
| 12247 | You can control the manner in which an image is anchored by setting the | 12859 | The ODT export back-end can anchor images to @samp{"as-char"}, |
| 12248 | @code{:anchor} property of it's @code{#+ATTR_ODT} line. You can specify one | 12860 | @samp{"paragraph"}, or @samp{"page"}. Set the preferred anchor using the |
| 12249 | of the following three values for the @code{:anchor} property: | 12861 | @code{:anchor} property of the @code{#+ATTR_ODT} line. |
| 12250 | @samp{"as-char"}, @samp{"paragraph"} and @samp{"page"}. | ||
| 12251 | 12862 | ||
| 12252 | To create an image that is anchored to a page, do the following: | 12863 | To create an image that is anchored to a page: |
| 12253 | @example | 12864 | @example |
| 12254 | #+ATTR_ODT: :anchor "page" | 12865 | #+ATTR_ODT: :anchor "page" |
| 12255 | [[./img.png]] | 12866 | [[./img.png]] |
| 12256 | @end example | 12867 | @end example |
| 12257 | 12868 | ||
| 12258 | @node Math formatting in ODT export, Labels and captions in ODT export, Images in ODT export, OpenDocument Text export | 12869 | @node Math formatting in ODT export |
| 12259 | @subsection Math formatting in ODT export | 12870 | @subsection Math formatting in ODT export |
| 12260 | 12871 | ||
| 12261 | The ODT exporter has special support for handling math. | 12872 | The ODT export back-end has special support built-in for handling math. |
| 12262 | 12873 | ||
| 12263 | @menu | 12874 | @menu |
| 12264 | * Working with @LaTeX{} math snippets:: How to embed @LaTeX{} math fragments | 12875 | * Working with @LaTeX{} math snippets:: Embedding in @LaTeX{} format. |
| 12265 | * Working with MathML or OpenDocument formula files:: How to embed equations in native format | 12876 | * Working with MathML or OpenDocument formula files:: Embedding in native format. |
| 12266 | @end menu | 12877 | @end menu |
| 12267 | 12878 | ||
| 12268 | @node Working with @LaTeX{} math snippets, Working with MathML or OpenDocument formula files, Math formatting in ODT export, Math formatting in ODT export | 12879 | @node Working with @LaTeX{} math snippets |
| 12269 | @subsubsection Working with @LaTeX{} math snippets | 12880 | @subsubheading Working with @LaTeX{} math snippets |
| 12270 | 12881 | ||
| 12271 | @LaTeX{} math snippets (@pxref{@LaTeX{} fragments}) can be embedded in the ODT | 12882 | @LaTeX{} math snippets (@pxref{@LaTeX{} fragments}) can be embedded in an ODT |
| 12272 | document in one of the following ways: | 12883 | document in one of the following ways: |
| 12273 | 12884 | ||
| 12274 | @cindex MathML | 12885 | @cindex MathML |
| 12275 | @enumerate | 12886 | @enumerate |
| 12276 | @item MathML | 12887 | @item MathML |
| 12277 | 12888 | ||
| 12278 | This option is activated on a per-file basis with | 12889 | Add this line to the Org file. This option is activated on a per-file basis. |
| 12279 | 12890 | ||
| 12280 | @example | 12891 | @example |
| 12281 | #+OPTIONS: LaTeX:t | 12892 | #+OPTIONS: LaTeX:t |
| @@ -12289,13 +12900,13 @@ the exported document. | |||
| 12289 | @vindex org-latex-to-mathml-convert-command | 12900 | @vindex org-latex-to-mathml-convert-command |
| 12290 | @vindex org-latex-to-mathml-jar-file | 12901 | @vindex org-latex-to-mathml-jar-file |
| 12291 | 12902 | ||
| 12292 | You can specify the @LaTeX{}-to-MathML converter by customizing the variables | 12903 | To specify the @LaTeX{}-to-MathML converter, customize the variables |
| 12293 | @code{org-latex-to-mathml-convert-command} and | 12904 | @code{org-latex-to-mathml-convert-command} and |
| 12294 | @code{org-latex-to-mathml-jar-file}. | 12905 | @code{org-latex-to-mathml-jar-file}. |
| 12295 | 12906 | ||
| 12296 | If you prefer to use @file{MathToWeb}@footnote{See | 12907 | To use MathToWeb@footnote{See |
| 12297 | @uref{http://www.mathtoweb.com/cgi-bin/mathtoweb_home.pl, MathToWeb}} as your | 12908 | @uref{http://www.mathtoweb.com/cgi-bin/mathtoweb_home.pl, MathToWeb}.} as the |
| 12298 | converter, you can configure the above variables as shown below. | 12909 | preferred converter, configure the above variables as |
| 12299 | 12910 | ||
| 12300 | @lisp | 12911 | @lisp |
| 12301 | (setq org-latex-to-mathml-convert-command | 12912 | (setq org-latex-to-mathml-convert-command |
| @@ -12303,9 +12914,14 @@ converter, you can configure the above variables as shown below. | |||
| 12303 | org-latex-to-mathml-jar-file | 12914 | org-latex-to-mathml-jar-file |
| 12304 | "/path/to/mathtoweb.jar") | 12915 | "/path/to/mathtoweb.jar") |
| 12305 | @end lisp | 12916 | @end lisp |
| 12917 | To use @LaTeX{}ML@footnote{See @uref{http://dlmf.nist.gov/LaTeXML/}.} use | ||
| 12918 | @lisp | ||
| 12919 | (setq org-latex-to-mathml-convert-command | ||
| 12920 | "latexmlmath \"%i\" --presentationmathml=%o") | ||
| 12921 | @end lisp | ||
| 12306 | 12922 | ||
| 12307 | You can use the following commands to quickly verify the reliability of | 12923 | To quickly verify the reliability of the @LaTeX{}-to-MathML converter, use |
| 12308 | the @LaTeX{}-to-MathML converter. | 12924 | the following commands: |
| 12309 | 12925 | ||
| 12310 | @table @kbd | 12926 | @table @kbd |
| 12311 | @item M-x org-odt-export-as-odf RET | 12927 | @item M-x org-odt-export-as-odf RET |
| @@ -12317,34 +12933,39 @@ and open the formula file with the system-registered application. | |||
| 12317 | @end table | 12933 | @end table |
| 12318 | 12934 | ||
| 12319 | @cindex dvipng | 12935 | @cindex dvipng |
| 12936 | @cindex dvisvgm | ||
| 12320 | @cindex imagemagick | 12937 | @cindex imagemagick |
| 12321 | @item PNG images | 12938 | @item PNG images |
| 12322 | 12939 | ||
| 12323 | This option is activated on a per-file basis with | 12940 | Add this line to the Org file. This option is activated on a per-file basis. |
| 12324 | 12941 | ||
| 12325 | @example | 12942 | @example |
| 12326 | #+OPTIONS: tex:dvipng | 12943 | #+OPTIONS: tex:dvipng |
| 12327 | @end example | 12944 | @end example |
| 12328 | 12945 | ||
| 12946 | @example | ||
| 12947 | #+OPTIONS: tex:dvisvgm | ||
| 12948 | @end example | ||
| 12949 | |||
| 12329 | or: | 12950 | or: |
| 12330 | 12951 | ||
| 12331 | @example | 12952 | @example |
| 12332 | #+OPTIONS: tex:imagemagick | 12953 | #+OPTIONS: tex:imagemagick |
| 12333 | @end example | 12954 | @end example |
| 12334 | 12955 | ||
| 12335 | With this option, @LaTeX{} fragments are processed into PNG images and the | 12956 | Under this option, @LaTeX{} fragments are processed into PNG or SVG images |
| 12336 | resulting images are embedded in the exported document. This method requires | 12957 | and the resulting images are embedded in the exported document. This method |
| 12337 | that the @file{dvipng} program or @file{imagemagick} suite be available on | 12958 | requires @file{dvipng} program, @file{dvisvgm} or @file{imagemagick} |
| 12338 | your system. | 12959 | programs. |
| 12339 | @end enumerate | 12960 | @end enumerate |
| 12340 | 12961 | ||
| 12341 | @node Working with MathML or OpenDocument formula files, , Working with @LaTeX{} math snippets, Math formatting in ODT export | 12962 | @node Working with MathML or OpenDocument formula files |
| 12342 | @subsubsection Working with MathML or OpenDocument formula files | 12963 | @subsubheading Working with MathML or OpenDocument formula files |
| 12343 | 12964 | ||
| 12344 | For various reasons, you may find embedding @LaTeX{} math snippets in an | 12965 | When embedding @LaTeX{} math snippets in ODT documents is not reliable, there |
| 12345 | ODT document less than reliable. In that case, you can embed a | 12966 | is one more option to try. Embed an equation by linking to its MathML |
| 12346 | math equation by linking to its MathML (@file{.mml}) source or its | 12967 | (@file{.mml}) source or its OpenDocument formula (@file{.odf}) file as shown |
| 12347 | OpenDocument formula (@file{.odf}) file as shown below: | 12968 | below: |
| 12348 | 12969 | ||
| 12349 | @example | 12970 | @example |
| 12350 | [[./equation.mml]] | 12971 | [[./equation.mml]] |
| @@ -12356,19 +12977,14 @@ or | |||
| 12356 | [[./equation.odf]] | 12977 | [[./equation.odf]] |
| 12357 | @end example | 12978 | @end example |
| 12358 | 12979 | ||
| 12359 | @node Labels and captions in ODT export, Literal examples in ODT export, Math formatting in ODT export, OpenDocument Text export | 12980 | @node Labels and captions in ODT export |
| 12360 | @subsection Labels and captions in ODT export | 12981 | @subsection Labels and captions in ODT export |
| 12361 | 12982 | ||
| 12362 | You can label and caption various category of objects---an inline image, a | 12983 | ODT format handles labeling and captioning of objects based on their |
| 12363 | table, a @LaTeX{} fragment or a Math formula---using @code{#+LABEL} and | 12984 | types. Inline images, tables, @LaTeX{} fragments, and Math formulas are |
| 12364 | @code{#+CAPTION} lines. @xref{Images and tables}. ODT exporter enumerates | 12985 | numbered and captioned separately. Each object also gets a unique sequence |
| 12365 | each labeled or captioned object of a given category separately. As a | 12986 | number based on its order of first appearance in the Org file. Each category |
| 12366 | result, each such object is assigned a sequence number based on order of it's | 12987 | has its own sequence. A caption is just a label applied to these objects. |
| 12367 | appearance in the Org file. | ||
| 12368 | |||
| 12369 | In the exported document, a user-provided caption is augmented with the | ||
| 12370 | category and sequence number. Consider the following inline image in an Org | ||
| 12371 | file. | ||
| 12372 | 12988 | ||
| 12373 | @example | 12989 | @example |
| 12374 | #+CAPTION: Bell curve | 12990 | #+CAPTION: Bell curve |
| @@ -12376,94 +12992,86 @@ file. | |||
| 12376 | [[./img/a.png]] | 12992 | [[./img/a.png]] |
| 12377 | @end example | 12993 | @end example |
| 12378 | 12994 | ||
| 12379 | It could be rendered as shown below in the exported document. | 12995 | When rendered, it may show as follows in the exported document: |
| 12380 | 12996 | ||
| 12381 | @example | 12997 | @example |
| 12382 | Figure 2: Bell curve | 12998 | Figure 2: Bell curve |
| 12383 | @end example | 12999 | @end example |
| 12384 | 13000 | ||
| 12385 | @vindex org-odt-category-map-alist | 13001 | @vindex org-odt-category-map-alist |
| 12386 | You can modify the category component of the caption by customizing the | 13002 | To modify the category component of the caption, customize the option |
| 12387 | option @code{org-odt-category-map-alist}. For example, to tag all embedded | 13003 | @code{org-odt-category-map-alist}. For example, to tag embedded images with |
| 12388 | images with the string @samp{Illustration} (instead of the default | 13004 | the string @samp{Illustration} instead of the default string @samp{Figure}, |
| 12389 | @samp{Figure}) use the following setting: | 13005 | use the following setting: |
| 12390 | 13006 | ||
| 12391 | @lisp | 13007 | @lisp |
| 12392 | (setq org-odt-category-map-alist | 13008 | (setq org-odt-category-map-alist |
| 12393 | (("__Figure__" "Illustration" "value" "Figure" org-odt--enumerable-image-p))) | 13009 | '(("__Figure__" "Illustration" "value" "Figure" org-odt--enumerable-image-p))) |
| 12394 | @end lisp | 13010 | @end lisp |
| 12395 | 13011 | ||
| 12396 | With this, previous image will be captioned as below in the exported | 13012 | With the above modification, the previous example changes to: |
| 12397 | document. | ||
| 12398 | 13013 | ||
| 12399 | @example | 13014 | @example |
| 12400 | Illustration 2: Bell curve | 13015 | Illustration 2: Bell curve |
| 12401 | @end example | 13016 | @end example |
| 12402 | 13017 | ||
| 12403 | @node Literal examples in ODT export, Advanced topics in ODT export, Labels and captions in ODT export, OpenDocument Text export | 13018 | @node Literal examples in ODT export |
| 12404 | @subsection Literal examples in ODT export | 13019 | @subsection Literal examples in ODT export |
| 12405 | 13020 | ||
| 12406 | Export of literal examples (@pxref{Literal examples}) with full fontification | 13021 | The ODT export back-end supports literal examples (@pxref{Literal examples}) |
| 12407 | is supported. Internally, the exporter relies on @file{htmlfontify.el} to | 13022 | with full fontification. Internally, the ODT export back-end relies on |
| 12408 | generate all style definitions needed for a fancy listing.@footnote{Your | 13023 | @file{htmlfontify.el} to generate the style definitions needed for fancy |
| 12409 | @file{htmlfontify.el} library must at least be at Emacs 24.1 levels for | 13024 | listings. The auto-generated styles get @samp{OrgSrc} prefix and inherit |
| 12410 | fontification to be turned on.} The auto-generated styles have @samp{OrgSrc} | 13025 | colors from the faces used by Emacs @code{font-lock} library for that source |
| 12411 | as prefix and inherit their color from the faces used by Emacs | 13026 | language. |
| 12412 | @code{font-lock} library for the source language. | ||
| 12413 | 13027 | ||
| 12414 | @vindex org-odt-fontify-srcblocks | 13028 | @vindex org-odt-fontify-srcblocks |
| 12415 | If you prefer to use your own custom styles for fontification, you can do | 13029 | For custom fontification styles, customize the |
| 12416 | so by customizing the option | 13030 | @code{org-odt-create-custom-styles-for-srcblocks} option. |
| 12417 | @code{org-odt-create-custom-styles-for-srcblocks}. | ||
| 12418 | 13031 | ||
| 12419 | @vindex org-odt-create-custom-styles-for-srcblocks | 13032 | @vindex org-odt-create-custom-styles-for-srcblocks |
| 12420 | You can turn off fontification of literal examples by customizing the | 13033 | To turn off fontification of literal examples, customize the |
| 12421 | option @code{org-odt-fontify-srcblocks}. | 13034 | @code{org-odt-fontify-srcblocks} option. |
| 12422 | 13035 | ||
| 12423 | @node Advanced topics in ODT export, , Literal examples in ODT export, OpenDocument Text export | 13036 | @node Advanced topics in ODT export |
| 12424 | @subsection Advanced topics in ODT export | 13037 | @subsection Advanced topics in ODT export |
| 12425 | 13038 | ||
| 12426 | If you rely heavily on ODT export, you may want to exploit the full | 13039 | The ODT export back-end has extensive features useful for power users and |
| 12427 | set of features that the exporter offers. This section describes features | 13040 | frequent uses of ODT formats. |
| 12428 | that would be of interest to power users. | ||
| 12429 | 13041 | ||
| 12430 | @menu | 13042 | @menu |
| 12431 | * Configuring a document converter:: How to register a document converter | 13043 | * Configuring a document converter:: Registering a document converter. |
| 12432 | * Working with OpenDocument style files:: Explore the internals | 13044 | * Working with OpenDocument style files:: Exploring internals. |
| 12433 | * Creating one-off styles:: How to produce custom highlighting etc | 13045 | * Creating one-off styles:: Customizing styles, highlighting. |
| 12434 | * Customizing tables in ODT export:: How to define and use Table templates | 13046 | * Customizing tables in ODT export:: Defining table templates. |
| 12435 | * Validating OpenDocument XML:: How to debug corrupt OpenDocument files | 13047 | * Validating OpenDocument XML:: Debugging corrupted OpenDocument files. |
| 12436 | @end menu | 13048 | @end menu |
| 12437 | 13049 | ||
| 12438 | @node Configuring a document converter, Working with OpenDocument style files, Advanced topics in ODT export, Advanced topics in ODT export | 13050 | @node Configuring a document converter |
| 12439 | @subsubsection Configuring a document converter | 13051 | @subsubheading Configuring a document converter |
| 12440 | @cindex convert | 13052 | @cindex convert |
| 12441 | @cindex doc, docx, rtf | 13053 | @cindex doc, docx, rtf |
| 12442 | @cindex converter | 13054 | @cindex converter |
| 12443 | 13055 | ||
| 12444 | The ODT exporter can work with popular converters with little or no | 13056 | The ODT export back-end works with popular converters with little or no extra |
| 12445 | extra configuration from your side. @xref{Extending ODT export}. | 13057 | configuration. @xref{Extending ODT export}. The following is for unsupported |
| 12446 | If you are using a converter that is not supported by default or if you would | 13058 | converters or tweaking existing defaults. |
| 12447 | like to tweak the default converter settings, proceed as below. | ||
| 12448 | 13059 | ||
| 12449 | @enumerate | 13060 | @enumerate |
| 12450 | @item Register the converter | 13061 | @item Register the converter |
| 12451 | 13062 | ||
| 12452 | @vindex org-odt-convert-processes | 13063 | @vindex org-odt-convert-processes |
| 12453 | Name your converter and add it to the list of known converters by | 13064 | Add the name of the converter to the @code{org-odt-convert-processes} |
| 12454 | customizing the option @code{org-odt-convert-processes}. Also specify how | 13065 | variable. Note that it also requires how the converter is invoked on the |
| 12455 | the converter can be invoked via command-line to effect the conversion. | 13066 | command line. See the variable's docstring for details. |
| 12456 | 13067 | ||
| 12457 | @item Configure its capabilities | 13068 | @item Configure its capabilities |
| 12458 | 13069 | ||
| 12459 | @vindex org-odt-convert-capabilities | 13070 | @vindex org-odt-convert-capabilities |
| 12460 | @anchor{x-odt-converter-capabilities} Specify the set of formats the | 13071 | @anchor{x-odt-converter-capabilities} Specify which formats the converter can |
| 12461 | converter can handle by customizing the variable | 13072 | handle by customizing the variable @code{org-odt-convert-capabilities}. Use |
| 12462 | @code{org-odt-convert-capabilities}. Use the default value for this | 13073 | the entry for the default values in this variable for configuring the new |
| 12463 | variable as a guide for configuring your converter. As suggested by the | 13074 | converter. Also see its docstring for details. |
| 12464 | default setting, you can specify the full set of formats supported by the | ||
| 12465 | converter and not limit yourself to specifying formats that are related to | ||
| 12466 | just the OpenDocument Text format. | ||
| 12467 | 13075 | ||
| 12468 | @item Choose the converter | 13076 | @item Choose the converter |
| 12469 | 13077 | ||
| @@ -12472,18 +13080,17 @@ Select the newly added converter as the preferred one by customizing the | |||
| 12472 | option @code{org-odt-convert-process}. | 13080 | option @code{org-odt-convert-process}. |
| 12473 | @end enumerate | 13081 | @end enumerate |
| 12474 | 13082 | ||
| 12475 | @node Working with OpenDocument style files, Creating one-off styles, Configuring a document converter, Advanced topics in ODT export | 13083 | @node Working with OpenDocument style files |
| 12476 | @subsubsection Working with OpenDocument style files | 13084 | @subsubheading Working with OpenDocument style files |
| 12477 | @cindex styles, custom | 13085 | @cindex styles, custom |
| 12478 | @cindex template, custom | 13086 | @cindex template, custom |
| 12479 | 13087 | ||
| 12480 | This section explores the internals of the ODT exporter and the | 13088 | This section explores the internals of the ODT exporter; the means by which |
| 12481 | means by which it produces styled documents. Read this section if you are | 13089 | it produces styled documents; the use of automatic and custom OpenDocument |
| 12482 | interested in exploring the automatic and custom OpenDocument styles used by | 13090 | styles. |
| 12483 | the exporter. | ||
| 12484 | 13091 | ||
| 12485 | @anchor{x-factory-styles} | 13092 | @anchor{x-factory-styles} |
| 12486 | @subsubheading Factory styles | 13093 | @subsubheading a) Factory styles |
| 12487 | 13094 | ||
| 12488 | The ODT exporter relies on two files for generating its output. | 13095 | The ODT exporter relies on two files for generating its output. |
| 12489 | These files are bundled with the distribution under the directory pointed to | 13096 | These files are bundled with the distribution under the directory pointed to |
| @@ -12524,25 +13131,25 @@ the exporter. | |||
| 12524 | 13131 | ||
| 12525 | @item | 13132 | @item |
| 12526 | It contains @samp{<text:sequence-decl>}@dots{}@samp{</text:sequence-decl>} | 13133 | It contains @samp{<text:sequence-decl>}@dots{}@samp{</text:sequence-decl>} |
| 12527 | elements that control how various entities---tables, images, equations, | 13134 | elements that control numbering of tables, images, equations, and similar |
| 12528 | etc.---are numbered. | 13135 | entities. |
| 12529 | @end enumerate | 13136 | @end enumerate |
| 12530 | @end itemize | 13137 | @end itemize |
| 12531 | 13138 | ||
| 12532 | @anchor{x-overriding-factory-styles} | 13139 | @anchor{x-overriding-factory-styles} |
| 12533 | @subsubheading Overriding factory styles | 13140 | @subsubheading b) Overriding factory styles |
| 12534 | The following two variables control the location from which the ODT | 13141 | The following two variables control the location from where the ODT exporter |
| 12535 | exporter picks up the custom styles and content template files. You can | 13142 | picks up the custom styles and content template files. Customize these |
| 12536 | customize these variables to override the factory styles used by the | 13143 | variables to override the factory styles used by the exporter. |
| 12537 | exporter. | ||
| 12538 | 13144 | ||
| 12539 | @itemize | 13145 | @itemize |
| 12540 | @anchor{x-org-odt-styles-file} | 13146 | @anchor{x-org-odt-styles-file} |
| 12541 | @item | 13147 | @item |
| 12542 | @code{org-odt-styles-file} | 13148 | @code{org-odt-styles-file} |
| 12543 | 13149 | ||
| 12544 | Use this variable to specify the @file{styles.xml} that will be used in the | 13150 | The ODT export back-end uses the file pointed to by this variable, such as |
| 12545 | final output. You can specify one of the following values: | 13151 | @file{styles.xml}, for the final output. It can take one of the following |
| 13152 | values: | ||
| 12546 | 13153 | ||
| 12547 | @enumerate | 13154 | @enumerate |
| 12548 | @item A @file{styles.xml} file | 13155 | @item A @file{styles.xml} file |
| @@ -12576,28 +13183,26 @@ Use this variable to specify the blank @file{content.xml} that will be used | |||
| 12576 | in the final output. | 13183 | in the final output. |
| 12577 | @end itemize | 13184 | @end itemize |
| 12578 | 13185 | ||
| 12579 | @node Creating one-off styles, Customizing tables in ODT export, Working with OpenDocument style files, Advanced topics in ODT export | 13186 | @node Creating one-off styles |
| 12580 | @subsubsection Creating one-off styles | 13187 | @subsubheading Creating one-off styles |
| 12581 | 13188 | ||
| 12582 | There are times when you would want one-off formatting in the exported | 13189 | The ODT export back-end can read embedded raw OpenDocument XML from the Org |
| 12583 | document. You can achieve this by embedding raw OpenDocument XML in the Org | 13190 | file. Such direct formatting are useful for one-off instances. |
| 12584 | file. The use of this feature is better illustrated with couple of examples. | ||
| 12585 | 13191 | ||
| 12586 | @enumerate | 13192 | @enumerate |
| 12587 | @item Embedding ODT tags as part of regular text | 13193 | @item Embedding ODT tags as part of regular text |
| 12588 | 13194 | ||
| 12589 | You can inline OpenDocument syntax by enclosing it within | 13195 | Enclose OpenDocument syntax in @samp{@@@@odt:...@@@@} for inline markup. For |
| 12590 | @samp{@@@@odt:...@@@@} markup. For example, to highlight a region of text do | 13196 | example, to highlight a region of text do the following: |
| 12591 | the following: | ||
| 12592 | 13197 | ||
| 12593 | @example | 13198 | @example |
| 12594 | @@@@odt:<text:span text:style-name="Highlight">This is a highlighted | 13199 | @@@@odt:<text:span text:style-name="Highlight">This is highlighted |
| 12595 | text</text:span>@@@@. But this is a regular text. | 13200 | text</text:span>@@@@. But this is regular text. |
| 12596 | @end example | 13201 | @end example |
| 12597 | 13202 | ||
| 12598 | @strong{Hint:} To see the above example in action, edit your | 13203 | @strong{Hint:} To see the above example in action, edit the @file{styles.xml} |
| 12599 | @file{styles.xml} (@pxref{x-orgodtstyles-xml,,Factory styles}) and add a | 13204 | (@pxref{x-orgodtstyles-xml,,Factory styles}) and add a custom |
| 12600 | custom @samp{Highlight} style as shown below. | 13205 | @samp{Highlight} style as shown below: |
| 12601 | 13206 | ||
| 12602 | @example | 13207 | @example |
| 12603 | <style:style style:name="Highlight" style:family="text"> | 13208 | <style:style style:name="Highlight" style:family="text"> |
| @@ -12607,8 +13212,8 @@ custom @samp{Highlight} style as shown below. | |||
| 12607 | 13212 | ||
| 12608 | @item Embedding a one-line OpenDocument XML | 13213 | @item Embedding a one-line OpenDocument XML |
| 12609 | 13214 | ||
| 12610 | You can add a simple OpenDocument one-liner using the @code{#+ODT:} | 13215 | The ODT export back-end can read one-liner options with @code{#+ODT:} |
| 12611 | directive. For example, to force a page break do the following: | 13216 | in the Org file. For example, to force a page break: |
| 12612 | 13217 | ||
| 12613 | @example | 13218 | @example |
| 12614 | #+ODT: <text:p text:style-name="PageBreak"/> | 13219 | #+ODT: <text:p text:style-name="PageBreak"/> |
| @@ -12627,41 +13232,40 @@ custom @samp{PageBreak} style as shown below. | |||
| 12627 | 13232 | ||
| 12628 | @item Embedding a block of OpenDocument XML | 13233 | @item Embedding a block of OpenDocument XML |
| 12629 | 13234 | ||
| 12630 | You can add a large block of OpenDocument XML using the | 13235 | The ODT export back-end can also read ODT export blocks for OpenDocument XML. |
| 12631 | @code{#+BEGIN_ODT}@dots{}@code{#+END_ODT} construct. | 13236 | Such blocks use the @code{#+BEGIN_EXPORT odt}@dots{}@code{#+END_EXPORT} |
| 13237 | constructs. | ||
| 12632 | 13238 | ||
| 12633 | For example, to create a one-off paragraph that uses bold text, do the | 13239 | For example, to create a one-off paragraph that uses bold text, do the |
| 12634 | following: | 13240 | following: |
| 12635 | 13241 | ||
| 12636 | @example | 13242 | @example |
| 12637 | #+BEGIN_ODT | 13243 | #+BEGIN_EXPORT odt |
| 12638 | <text:p text:style-name="Text_20_body_20_bold"> | 13244 | <text:p text:style-name="Text_20_body_20_bold"> |
| 12639 | This paragraph is specially formatted and uses bold text. | 13245 | This paragraph is specially formatted and uses bold text. |
| 12640 | </text:p> | 13246 | </text:p> |
| 12641 | #+END_ODT | 13247 | #+END_EXPORT |
| 12642 | @end example | 13248 | @end example |
| 12643 | 13249 | ||
| 12644 | @end enumerate | 13250 | @end enumerate |
| 12645 | 13251 | ||
| 12646 | @node Customizing tables in ODT export, Validating OpenDocument XML, Creating one-off styles, Advanced topics in ODT export | 13252 | @node Customizing tables in ODT export |
| 12647 | @subsubsection Customizing tables in ODT export | 13253 | @subsubheading Customizing tables in ODT export |
| 12648 | @cindex tables, in ODT export | 13254 | @cindex tables, in ODT export |
| 12649 | 13255 | ||
| 12650 | @cindex #+ATTR_ODT | 13256 | @cindex #+ATTR_ODT |
| 12651 | You can override the default formatting of the table by specifying a custom | 13257 | Override the default table format by specifying a custom table style with the |
| 12652 | table style with the @code{#+ATTR_ODT} line. For a discussion on default | 13258 | @code{#+ATTR_ODT} line. For a discussion on default formatting of tables |
| 12653 | formatting of tables @pxref{Tables in ODT export}. | 13259 | @pxref{Tables in ODT export}. |
| 12654 | 13260 | ||
| 12655 | This feature closely mimics the way table templates are defined in the | 13261 | This feature closely mimics the way table templates are defined in the |
| 12656 | OpenDocument-v1.2 | 13262 | OpenDocument-v1.2 |
| 12657 | specification.@footnote{@url{http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html, | 13263 | specification.@footnote{@url{http://docs.oasis-open.org/office/v1.2/OpenDocument-v1.2.html, |
| 12658 | OpenDocument-v1.2 Specification}} | 13264 | OpenDocument-v1.2 Specification}} |
| 12659 | 13265 | ||
| 12660 | @subsubheading Custom table styles: an illustration | ||
| 12661 | |||
| 12662 | @vindex org-odt-table-styles | 13266 | @vindex org-odt-table-styles |
| 12663 | To have a quick preview of this feature, install the below setting and | 13267 | For quick preview of this feature, install the settings below and export the |
| 12664 | export the table that follows: | 13268 | table that follows: |
| 12665 | 13269 | ||
| 12666 | @lisp | 13270 | @lisp |
| 12667 | (setq org-odt-table-styles | 13271 | (setq org-odt-table-styles |
| @@ -12675,22 +13279,20 @@ export the table that follows: | |||
| 12675 | @end lisp | 13279 | @end lisp |
| 12676 | 13280 | ||
| 12677 | @example | 13281 | @example |
| 12678 | #+ATTR_ODT: :style "TableWithHeaderRowAndColumn" | 13282 | #+ATTR_ODT: :style TableWithHeaderRowAndColumn |
| 12679 | | Name | Phone | Age | | 13283 | | Name | Phone | Age | |
| 12680 | | Peter | 1234 | 17 | | 13284 | | Peter | 1234 | 17 | |
| 12681 | | Anna | 4321 | 25 | | 13285 | | Anna | 4321 | 25 | |
| 12682 | @end example | 13286 | @end example |
| 12683 | 13287 | ||
| 12684 | In the above example, you used a template named @samp{Custom} and installed | 13288 | The example above used @samp{Custom} template and installed two table styles |
| 12685 | two table styles with the names @samp{TableWithHeaderRowAndColumn} and | 13289 | @samp{TableWithHeaderRowAndColumn} and @samp{TableWithFirstRowandLastRow}. |
| 12686 | @samp{TableWithFirstRowandLastRow}. (@strong{Important:} The OpenDocument | 13290 | @strong{Important:} The OpenDocument styles needed for producing the above |
| 12687 | styles needed for producing the above template have been pre-defined for | 13291 | template were pre-defined. They are available in the section marked |
| 12688 | you. These styles are available under the section marked @samp{Custom | 13292 | @samp{Custom Table Template} in @file{OrgOdtContentTemplate.xml} |
| 12689 | Table Template} in @file{OrgOdtContentTemplate.xml} | 13293 | (@pxref{x-orgodtcontenttemplate-xml,,Factory styles}. For adding new |
| 12690 | (@pxref{x-orgodtcontenttemplate-xml,,Factory styles}). If you need | 13294 | templates, define new styles here. |
| 12691 | additional templates you have to define these styles yourselves. | ||
| 12692 | 13295 | ||
| 12693 | @subsubheading Custom table styles: the nitty-gritty | ||
| 12694 | To use this feature proceed as follows: | 13296 | To use this feature proceed as follows: |
| 12695 | 13297 | ||
| 12696 | @enumerate | 13298 | @enumerate |
| @@ -12698,8 +13300,8 @@ To use this feature proceed as follows: | |||
| 12698 | Create a table template@footnote{See the @code{<table:table-template>} | 13300 | Create a table template@footnote{See the @code{<table:table-template>} |
| 12699 | element of the OpenDocument-v1.2 specification} | 13301 | element of the OpenDocument-v1.2 specification} |
| 12700 | 13302 | ||
| 12701 | A table template is nothing but a set of @samp{table-cell} and | 13303 | A table template is set of @samp{table-cell} and @samp{paragraph} styles for |
| 12702 | @samp{paragraph} styles for each of the following table cell categories: | 13304 | each of the following table cell categories: |
| 12703 | 13305 | ||
| 12704 | @itemize @minus | 13306 | @itemize @minus |
| 12705 | @item Body | 13307 | @item Body |
| @@ -12809,25 +13411,22 @@ the @code{ATTR_ODT} line as shown below. | |||
| 12809 | @end example | 13411 | @end example |
| 12810 | @end enumerate | 13412 | @end enumerate |
| 12811 | 13413 | ||
| 12812 | @node Validating OpenDocument XML, , Customizing tables in ODT export, Advanced topics in ODT export | 13414 | @node Validating OpenDocument XML |
| 12813 | @subsubsection Validating OpenDocument XML | 13415 | @subsubheading Validating OpenDocument XML |
| 12814 | |||
| 12815 | Occasionally, you will discover that the document created by the | ||
| 12816 | ODT exporter cannot be opened by your favorite application. One of | ||
| 12817 | the common reasons for this is that the @file{.odt} file is corrupt. In such | ||
| 12818 | cases, you may want to validate the document against the OpenDocument RELAX | ||
| 12819 | NG Compact Syntax (RNC) schema. | ||
| 12820 | 13416 | ||
| 12821 | For de-compressing the @file{.odt} file@footnote{@file{.odt} files are | 13417 | Sometimes ODT format files may not open due to @file{.odt} file corruption. |
| 12822 | nothing but @samp{zip} archives}: @inforef{File Archives,,emacs}. For | 13418 | To verify if the @file{.odt} file is corrupt, validate it against the |
| 12823 | general help with validation (and schema-sensitive editing) of XML files: | 13419 | OpenDocument RELAX NG Compact Syntax---RNC---schema. But first the |
| 13420 | @file{.odt} files have to be decompressed using @samp{zip}. Note that | ||
| 13421 | @file{.odt} files are @samp{zip} archives: @inforef{File Archives,,emacs}. | ||
| 13422 | The contents of @file{.odt} files are in @file{.xml}. For general help with | ||
| 13423 | validation---and schema-sensitive editing---of XML files: | ||
| 12824 | @inforef{Introduction,,nxml-mode}. | 13424 | @inforef{Introduction,,nxml-mode}. |
| 12825 | 13425 | ||
| 12826 | @vindex org-odt-schema-dir | 13426 | @vindex org-odt-schema-dir |
| 12827 | If you have ready access to OpenDocument @file{.rnc} files and the needed | 13427 | Customize @code{org-odt-schema-dir} to point to a directory with OpenDocument |
| 12828 | schema-locating rules in a single folder, you can customize the variable | 13428 | @file{.rnc} files and the needed schema-locating rules. The ODT export |
| 12829 | @code{org-odt-schema-dir} to point to that directory. The ODT exporter | 13429 | back-end takes care of updating the @code{rng-schema-locating-files}. |
| 12830 | will take care of updating the @code{rng-schema-locating-files} for you. | ||
| 12831 | 13430 | ||
| 12832 | @c end opendocument | 13431 | @c end opendocument |
| 12833 | 13432 | ||
| @@ -12836,102 +13435,146 @@ will take care of updating the @code{rng-schema-locating-files} for you. | |||
| 12836 | @cindex Org export | 13435 | @cindex Org export |
| 12837 | 13436 | ||
| 12838 | @code{org} export back-end creates a normalized version of the Org document | 13437 | @code{org} export back-end creates a normalized version of the Org document |
| 12839 | in current buffer. In particular, it evaluates Babel code (@pxref{Evaluating | 13438 | in current buffer. The exporter evaluates Babel code (@pxref{Evaluating code |
| 12840 | code blocks}) and removes other back-ends specific contents. | 13439 | blocks}) and removes content specific to other back-ends. |
| 12841 | 13440 | ||
| 12842 | @subheading Org export commands | 13441 | @subheading Org export commands |
| 12843 | 13442 | ||
| 12844 | @table @kbd | 13443 | @table @kbd |
| 12845 | @orgcmd{C-c C-e O o,org-org-export-to-org} | 13444 | @orgcmd{C-c C-e O o,org-org-export-to-org} |
| 12846 | Export as an Org document. For an Org file, @file{myfile.org}, the resulting | 13445 | Export as an Org file with a @file{.org} extension. For @file{myfile.org}, |
| 12847 | file will be @file{myfile.org.org}. The file will be overwritten without | 13446 | Org exports to @file{myfile.org.org}, overwriting without warning. |
| 12848 | warning. | 13447 | |
| 12849 | @orgcmd{C-c C-e O O,org-org-export-as-org} | 13448 | @orgcmd{C-c C-e O O,org-org-export-as-org} |
| 12850 | Export to a temporary buffer. Do not create a file. | 13449 | Export to a temporary buffer. Does not create a file. |
| 12851 | @item C-c C-e O v | 13450 | @item C-c C-e O v |
| 12852 | Export to an Org file, then open it. | 13451 | Export to an Org file, then open it. |
| 12853 | @end table | 13452 | @end table |
| 12854 | 13453 | ||
| 12855 | @node Texinfo export, iCalendar export, Org export, Exporting | 13454 | @node Texinfo export |
| 12856 | @section Texinfo export | 13455 | @section Texinfo export |
| 12857 | @cindex Texinfo export | 13456 | @cindex Texinfo export |
| 12858 | 13457 | ||
| 12859 | @samp{texinfo} export back-end generates Texinfo code and can compile it into | 13458 | The @samp{texinfo} export back-end generates documents with Texinfo code that |
| 12860 | an Info file. | 13459 | can compile to Info format. |
| 12861 | 13460 | ||
| 12862 | @menu | 13461 | @menu |
| 12863 | * Texinfo export commands:: How to invoke Texinfo export | 13462 | * Texinfo export commands:: Invoking commands. |
| 12864 | * Document preamble:: File header, title and copyright page | 13463 | * Texinfo specific export settings:: Setting the environment. |
| 12865 | * Headings and sectioning structure:: Building document structure | 13464 | * Texinfo file header:: Generating the header. |
| 12866 | * Indices:: Creating indices | 13465 | * Texinfo title and copyright page:: Creating preamble pages. |
| 12867 | * Quoting Texinfo code:: Incorporating literal Texinfo code | 13466 | * Info directory file:: Installing a manual in Info file hierarchy. |
| 12868 | * Texinfo specific attributes:: Controlling Texinfo output | 13467 | * Headings and sectioning structure:: Building document structure. |
| 12869 | * An example:: | 13468 | * Indices:: Creating indices. |
| 13469 | * Quoting Texinfo code:: Incorporating literal Texinfo code. | ||
| 13470 | * Plain lists in Texinfo export:: List attributes. | ||
| 13471 | * Tables in Texinfo export:: Table attributes. | ||
| 13472 | * Images in Texinfo export:: Image attributes. | ||
| 13473 | * Special blocks in Texinfo export:: Special block attributes. | ||
| 13474 | * A Texinfo example:: Processing Org to Texinfo. | ||
| 12870 | @end menu | 13475 | @end menu |
| 12871 | 13476 | ||
| 12872 | @node Texinfo export commands, Document preamble, Texinfo export, Texinfo export | 13477 | @node Texinfo export commands |
| 12873 | @subsection Texinfo export commands | 13478 | @subsection Texinfo export commands |
| 12874 | 13479 | ||
| 12875 | @vindex org-texinfo-info-process | 13480 | @vindex org-texinfo-info-process |
| 12876 | @table @kbd | 13481 | @table @kbd |
| 12877 | @orgcmd{C-c C-e i t,org-texinfo-export-to-texinfo} | 13482 | @orgcmd{C-c C-e i t,org-texinfo-export-to-texinfo} |
| 12878 | Export as a Texinfo file. For an Org file, @file{myfile.org}, the resulting | 13483 | Export as a Texinfo file with @file{.texi} extension. For @file{myfile.org}, |
| 12879 | file will be @file{myfile.texi}. The file will be overwritten without | 13484 | Org exports to @file{myfile.texi}, overwriting without warning. |
| 12880 | warning. | ||
| 12881 | @orgcmd{C-c C-e i i,org-texinfo-export-to-info} | 13485 | @orgcmd{C-c C-e i i,org-texinfo-export-to-info} |
| 12882 | Export to Texinfo and then process to an Info file@footnote{By setting | 13486 | Export to Texinfo format first and then process it to make an Info file. To |
| 12883 | @code{org-texinfo-info-process}, it is possible to generate other formats, | 13487 | generate other formats, such as DocBook, customize the |
| 12884 | including DocBook.}. | 13488 | @code{org-texinfo-info-process} variable. |
| 12885 | @end table | 13489 | @end table |
| 12886 | 13490 | ||
| 12887 | @node Document preamble, Headings and sectioning structure, Texinfo export commands, Texinfo export | 13491 | @node Texinfo specific export settings |
| 12888 | @subsection Document preamble | 13492 | @subsection Texinfo specific export settings |
| 13493 | The Texinfo export back-end has several additional keywords for customizing | ||
| 13494 | Texinfo output. Setting these keywords works similar to the general options | ||
| 13495 | (@pxref{Export settings}). | ||
| 13496 | |||
| 13497 | @table @samp | ||
| 12889 | 13498 | ||
| 12890 | When processing a document, @samp{texinfo} back-end generates a minimal file | 13499 | @item SUBTITLE |
| 12891 | header along with a title page, a copyright page, and a menu. You control | 13500 | @cindex #+SUBTITLE (Texinfo) |
| 12892 | the latter through the structure of the document (@pxref{Headings and | 13501 | The document subtitle. |
| 12893 | sectioning structure}). Various keywords allow you to tweak the other parts. | ||
| 12894 | It is also possible to give directions to install the document in the | ||
| 12895 | @samp{Top} node. | ||
| 12896 | 13502 | ||
| 12897 | @subsubheading File header | 13503 | @item SUBAUTHOR |
| 13504 | @cindex #+SUBAUTHOR | ||
| 13505 | The document subauthor. | ||
| 12898 | 13506 | ||
| 13507 | @item TEXINFO_FILENAME | ||
| 12899 | @cindex #+TEXINFO_FILENAME | 13508 | @cindex #+TEXINFO_FILENAME |
| 12900 | Upon creating the header of a Texinfo file, the back-end guesses a name for | 13509 | The Texinfo filename. |
| 12901 | the Info file to be compiled. This may not be a sensible choice, e.g., if | 13510 | |
| 12902 | you want to produce the final document in a different directory. Specify an | 13511 | @item TEXINFO_CLASS |
| 12903 | alternate path with @code{#+TEXINFO_FILENAME} keyword to override the default | 13512 | @cindex #+TEXINFO_CLASS |
| 12904 | destination. | 13513 | @vindex org-texinfo-default-class |
| 13514 | The default document class (@code{org-texinfo-default-class}), which must be | ||
| 13515 | a member of @code{org-texinfo-classes}. | ||
| 13516 | |||
| 13517 | @item TEXINFO_HEADER | ||
| 13518 | @cindex #+TEXINFO_HEADER | ||
| 13519 | Arbitrary lines inserted at the end of the header. | ||
| 13520 | |||
| 13521 | @item TEXINFO_POST_HEADER | ||
| 13522 | @cindex #+TEXINFO_POST_HEADER | ||
| 13523 | Arbitrary lines inserted after the end of the header. | ||
| 13524 | |||
| 13525 | @item TEXINFO_DIR_CATEGORY | ||
| 13526 | @cindex #+TEXINFO_DIR_CATEGORY | ||
| 13527 | The directory category of the document. | ||
| 13528 | |||
| 13529 | @item TEXINFO_DIR_TITLE | ||
| 13530 | @cindex #+TEXINFO_DIR_TITLE | ||
| 13531 | The directory title of the document. | ||
| 13532 | |||
| 13533 | @item TEXINFO_DIR_DESC | ||
| 13534 | @cindex #+TEXINFO_DIR_DESC | ||
| 13535 | The directory description of the document. | ||
| 13536 | |||
| 13537 | @item TEXINFO_PRINTED_TITLE | ||
| 13538 | @cindex #+TEXINFO_PRINTED_TITLE | ||
| 13539 | The printed title of the document. | ||
| 13540 | @end table | ||
| 13541 | |||
| 13542 | @node Texinfo file header | ||
| 13543 | @subsection Texinfo file header | ||
| 13544 | |||
| 13545 | @cindex #+TEXINFO_FILENAME | ||
| 13546 | After creating the header for a Texinfo file, the Texinfo back-end | ||
| 13547 | automatically generates a name and destination path for the Info file. To | ||
| 13548 | override this default with a more sensible path and name, specify the | ||
| 13549 | @code{#+TEXINFO_FILENAME} keyword. | ||
| 12905 | 13550 | ||
| 12906 | @vindex org-texinfo-coding-system | 13551 | @vindex org-texinfo-coding-system |
| 12907 | @vindex org-texinfo-classes | 13552 | @vindex org-texinfo-classes |
| 12908 | @cindex #+TEXINFO_HEADER | 13553 | @cindex #+TEXINFO_HEADER |
| 12909 | @cindex #+TEXINFO_CLASS | 13554 | @cindex #+TEXINFO_CLASS |
| 12910 | Along with the output file name, the header contains information about the | 13555 | Along with the output's file name, the Texinfo header also contains language |
| 12911 | language (@pxref{Export settings}) and current encoding used@footnote{See | 13556 | details (@pxref{Export settings}) and encoding system as set in the |
| 12912 | @code{org-texinfo-coding-system} for more information.}. Insert | 13557 | @code{org-texinfo-coding-system} variable. Insert @code{#+TEXINFO_HEADER} |
| 12913 | a @code{#+TEXINFO_HEADER} keyword for each additional command needed, e.g., | 13558 | keywords for each additional command in the header, for example: |
| 12914 | @@code@{@@synindex@}. | 13559 | @@code@{@@synindex@}. |
| 12915 | 13560 | ||
| 12916 | If you happen to regularly install the same set of commands, it may be easier | 13561 | Instead of repeatedly installing the same set of commands, define a class in |
| 12917 | to define your own class in @code{org-texinfo-classes}, which see. Set | 13562 | @code{org-texinfo-classes} once, and then activate it in the document by |
| 12918 | @code{#+TEXINFO_CLASS} keyword accordingly in your document to activate it. | 13563 | setting the @code{#+TEXINFO_CLASS} keyword to that class. |
| 12919 | 13564 | ||
| 12920 | @subsubheading Title and copyright page | 13565 | @node Texinfo title and copyright page |
| 13566 | @subsection Texinfo title and copyright page | ||
| 12921 | 13567 | ||
| 12922 | @cindex #+TEXINFO_PRINTED_TITLE | 13568 | @cindex #+TEXINFO_PRINTED_TITLE |
| 12923 | @cindex #+SUBTITLE | 13569 | The default template for hard copy output has a title page with |
| 12924 | The default template includes a title page for hard copy output. The title | 13570 | @code{#+TITLE} and @code{#+AUTHOR} (@pxref{Export settings}). To replace the |
| 12925 | and author displayed on this page are extracted from, respectively, | 13571 | regular @code{#+TITLE} with something different for the printed version, use |
| 12926 | @code{#+TITLE} and @code{#+AUTHOR} keywords (@pxref{Export settings}). It is | 13572 | the @code{#+TEXINFO_PRINTED_TITLE} and @code{#+SUBTITLE} keywords. Both |
| 12927 | also possible to print a different, more specific, title with | 13573 | expect raw Texinfo code for setting their values. |
| 12928 | @code{#+TEXINFO_PRINTED_TITLE} keyword, and add subtitles with | ||
| 12929 | @code{#+SUBTITLE} keyword. Both expect raw Texinfo code in their value. | ||
| 12930 | 13574 | ||
| 12931 | @cindex #+SUBAUTHOR | 13575 | @cindex #+SUBAUTHOR |
| 12932 | Likewise, information brought by @code{#+AUTHOR} may not be enough. You can | 13576 | If one @code{#+AUTHOR} is not sufficient, add multiple @code{#+SUBAUTHOR} |
| 12933 | include other authors with several @code{#+SUBAUTHOR} keywords. Values are | 13577 | keywords. They have to be set in raw Texinfo code. |
| 12934 | also expected to be written in Texinfo code. | ||
| 12935 | 13578 | ||
| 12936 | @example | 13579 | @example |
| 12937 | #+AUTHOR: Jane Smith | 13580 | #+AUTHOR: Jane Smith |
| @@ -12940,10 +13583,10 @@ also expected to be written in Texinfo code. | |||
| 12940 | @end example | 13583 | @end example |
| 12941 | 13584 | ||
| 12942 | @cindex property, COPYING | 13585 | @cindex property, COPYING |
| 12943 | Copying material is defined in a dedicated headline with a non-nil | 13586 | Copying material is defined in a dedicated headline with a non-@code{nil} |
| 12944 | @code{:COPYING:} property. The contents are inserted within | 13587 | @code{:COPYING:} property. The back-end inserts the contents within a |
| 12945 | a @code{@@copying} command at the beginning of the document whereas the | 13588 | @code{@@copying} command at the beginning of the document. The heading |
| 12946 | heading itself does not appear in the structure of the document. | 13589 | itself does not appear in the structure of the document. |
| 12947 | 13590 | ||
| 12948 | Copyright information is printed on the back of the title page. | 13591 | Copyright information is printed on the back of the title page. |
| 12949 | 13592 | ||
| @@ -12955,20 +13598,28 @@ Copyright information is printed on the back of the title page. | |||
| 12955 | 13598 | ||
| 12956 | This is a short example of a complete Texinfo file, version 1.0. | 13599 | This is a short example of a complete Texinfo file, version 1.0. |
| 12957 | 13600 | ||
| 12958 | Copyright \copy 2017 Free Software Foundation, Inc. | 13601 | Copyright \copy 2016 Free Software Foundation, Inc. |
| 12959 | @end example | 13602 | @end example |
| 12960 | 13603 | ||
| 12961 | @subsubheading The Top node | 13604 | @node Info directory file |
| 13605 | @subsection Info directory file | ||
| 13606 | @cindex @samp{dir} file, in Texinfo export | ||
| 13607 | @cindex Texinfo export, @samp{dir} file | ||
| 13608 | @cindex Info directory file, in Texinfo export | ||
| 13609 | @cindex Texinfo export, Info directory file | ||
| 13610 | @cindex @code{install-info} parameters, in Texinfo export | ||
| 13611 | @cindex Texinfo export, @code{install-info} parameters | ||
| 12962 | 13612 | ||
| 12963 | @cindex #+TEXINFO_DIR_CATEGORY | 13613 | @cindex #+TEXINFO_DIR_CATEGORY |
| 12964 | @cindex #+TEXINFO_DIR_TITLE | 13614 | @cindex #+TEXINFO_DIR_TITLE |
| 12965 | @cindex #+TEXINFO_DIR_DESC | 13615 | @cindex #+TEXINFO_DIR_DESC |
| 12966 | You may ultimately want to install your new Info file to your system. You | 13616 | The end result of the Texinfo export process is the creation of an Info file. |
| 12967 | can write an appropriate entry in the top level directory specifying its | 13617 | This Info file's metadata has variables for category, title, and description: |
| 12968 | category and title with, respectively, @code{#+TEXINFO_DIR_CATEGORY} and | 13618 | @code{#+TEXINFO_DIR_CATEGORY}, @code{#+TEXINFO_DIR_TITLE}, and |
| 12969 | @code{#+TEXINFO_DIR_TITLE}. Optionally, you can add a short description | 13619 | @code{#+TEXINFO_DIR_DESC} that establish where in the Info hierarchy the file |
| 12970 | using @code{#+TEXINFO_DIR_DESC}. The following example would write an entry | 13620 | fits. |
| 12971 | similar to Org's in the @samp{Top} node. | 13621 | |
| 13622 | Here is an example that writes to the Info directory file: | ||
| 12972 | 13623 | ||
| 12973 | @example | 13624 | @example |
| 12974 | #+TEXINFO_DIR_CATEGORY: Emacs | 13625 | #+TEXINFO_DIR_CATEGORY: Emacs |
| @@ -12976,34 +13627,38 @@ similar to Org's in the @samp{Top} node. | |||
| 12976 | #+TEXINFO_DIR_DESC: Outline-based notes management and organizer | 13627 | #+TEXINFO_DIR_DESC: Outline-based notes management and organizer |
| 12977 | @end example | 13628 | @end example |
| 12978 | 13629 | ||
| 12979 | @node Headings and sectioning structure, Indices, Document preamble, Texinfo export | 13630 | @node Headings and sectioning structure |
| 12980 | @subsection Headings and sectioning structure | 13631 | @subsection Headings and sectioning structure |
| 12981 | 13632 | ||
| 12982 | @vindex org-texinfo-classes | 13633 | @vindex org-texinfo-classes |
| 12983 | @vindex org-texinfo-default-class | 13634 | @vindex org-texinfo-default-class |
| 12984 | @cindex #+TEXINFO_CLASS | 13635 | @cindex #+TEXINFO_CLASS |
| 12985 | @samp{texinfo} uses a pre-defined scheme, or class, to convert headlines into | 13636 | The Texinfo export back-end uses a pre-defined scheme to convert Org |
| 12986 | Texinfo structuring commands. For example, a top level headline appears as | 13637 | headlines to an equivalent Texinfo structuring commands. A scheme like this |
| 12987 | @code{@@chapter} if it should be numbered or as @code{@@unnumbered} | 13638 | maps top-level headlines to numbered chapters tagged as @code{@@chapter} and |
| 12988 | otherwise. If you need to use a different set of commands, e.g., to start | 13639 | lower-level headlines to unnumbered chapters tagged as @code{@@unnumbered}. |
| 12989 | with @code{@@part} instead of @code{@@chapter}, install a new class in | 13640 | To override such mappings to introduce @code{@@part} or other Texinfo |
| 12990 | @code{org-texinfo-classes}, then activate it with @code{#+TEXINFO_CLASS} | 13641 | structuring commands, define a new class in @code{org-texinfo-classes}. |
| 12991 | keyword. Export process defaults to @code{org-texinfo-default-class} when | 13642 | Activate the new class with the @code{#+TEXINFO_CLASS} keyword. When no new |
| 12992 | there is no such keyword in the document. | 13643 | class is defined and activated, the Texinfo export back-end defaults to the |
| 12993 | 13644 | @code{org-texinfo-default-class}. | |
| 12994 | If a headline's level has no associated structuring command, or is below | 13645 | |
| 12995 | a certain threshold @pxref{Export settings}, that headline becomes a list in | 13646 | If an Org headline's level has no associated Texinfo structuring command, or |
| 12996 | Texinfo output. | 13647 | is below a certain threshold (@pxref{Export settings}), then the Texinfo |
| 13648 | export back-end makes it into a list item. | ||
| 12997 | 13649 | ||
| 12998 | @cindex property, APPENDIX | 13650 | @cindex property, APPENDIX |
| 12999 | As an exception, a headline with a non-nil @code{:APPENDIX:} property becomes | 13651 | The Texinfo export back-end makes any headline with a non-@code{nil} |
| 13000 | an appendix, independently on its level and the class used. | 13652 | @code{:APPENDIX:} property into an appendix. This happens independent of the |
| 13653 | Org headline level or the @code{#+TEXINFO_CLASS}. | ||
| 13001 | 13654 | ||
| 13002 | @cindex property, DESCRIPTION | 13655 | @cindex property, DESCRIPTION |
| 13003 | Each regular sectioning structure creates a menu entry, named after the | 13656 | The Texinfo export back-end creates a menu entry after the Org headline for |
| 13004 | heading. You can provide a different, e.g., shorter, title in | 13657 | each regular sectioning structure. To override this with a shorter menu |
| 13005 | @code{:ALT_TITLE:} property (@pxref{Table of contents}). Optionally, you can | 13658 | entry, use the @code{:ALT_TITLE:} property (@pxref{Table of contents}). |
| 13006 | specify a description for the item in @code{:DESCRIPTION:} property. E.g., | 13659 | Texinfo menu entries also have an option for a longer @code{:DESCRIPTION:} |
| 13660 | property. Here's an example that uses both to override the default menu | ||
| 13661 | entry: | ||
| 13007 | 13662 | ||
| 13008 | @example | 13663 | @example |
| 13009 | * Controlling Screen Display | 13664 | * Controlling Screen Display |
| @@ -13013,30 +13668,51 @@ specify a description for the item in @code{:DESCRIPTION:} property. E.g., | |||
| 13013 | :END: | 13668 | :END: |
| 13014 | @end example | 13669 | @end example |
| 13015 | 13670 | ||
| 13016 | @node Indices, Quoting Texinfo code, Headings and sectioning structure, Texinfo export | 13671 | @cindex The Top node, in Texinfo export |
| 13672 | @cindex Texinfo export, Top node | ||
| 13673 | The text before the first headline belongs to the @samp{Top} node, i.e., the | ||
| 13674 | node in which a reader enters an Info manual. As such, it is expected not to | ||
| 13675 | appear in printed output generated from the @file{.texi} file. @inforef{The | ||
| 13676 | Top Node,,texinfo}, for more information. | ||
| 13677 | |||
| 13678 | @node Indices | ||
| 13017 | @subsection Indices | 13679 | @subsection Indices |
| 13018 | 13680 | ||
| 13019 | @cindex #+CINDEX | 13681 | @cindex #+CINDEX |
| 13682 | @cindex concept index, in Texinfo export | ||
| 13683 | @cindex Texinfo export, index, concept | ||
| 13020 | @cindex #+FINDEX | 13684 | @cindex #+FINDEX |
| 13685 | @cindex function index, in Texinfo export | ||
| 13686 | @cindex Texinfo export, index, function | ||
| 13021 | @cindex #+KINDEX | 13687 | @cindex #+KINDEX |
| 13688 | @cindex keystroke index, in Texinfo export | ||
| 13689 | @cindex Texinfo export, keystroke index | ||
| 13022 | @cindex #+PINDEX | 13690 | @cindex #+PINDEX |
| 13691 | @cindex program index, in Texinfo export | ||
| 13692 | @cindex Texinfo export, program index | ||
| 13023 | @cindex #+TINDEX | 13693 | @cindex #+TINDEX |
| 13694 | @cindex data type index, in Texinfo export | ||
| 13695 | @cindex Texinfo export, data type index | ||
| 13024 | @cindex #+VINDEX | 13696 | @cindex #+VINDEX |
| 13025 | Index entries are created using dedicated keywords. @samp{texinfo} back-end | 13697 | @cindex variable index, in Texinfo export |
| 13026 | provides one for each predefined type: @code{#+CINDEX}, @code{#+FINDEX}, | 13698 | @cindex Texinfo export, variable index |
| 13027 | @code{#+KINDEX}, @code{#+PINDEX}, @code{#+TINDEX} and @code{#+VINDEX}. For | 13699 | The Texinfo export back-end recognizes these indexing keywords if used in the |
| 13028 | custom indices, you can write raw Texinfo code (@pxref{Quoting Texinfo | 13700 | Org file: @code{#+CINDEX}, @code{#+FINDEX}, @code{#+KINDEX}, @code{#+PINDEX}, |
| 13029 | code}). | 13701 | @code{#+TINDEX}, and @code{#+VINDEX}. Write their value as verbatim Texinfo |
| 13702 | code; in particular, @samp{@{}, @samp{@}} and @samp{@@} characters need to be | ||
| 13703 | escaped with @samp{@@} if they not belong to a Texinfo command. | ||
| 13030 | 13704 | ||
| 13031 | @example | 13705 | @example |
| 13032 | #+CINDEX: Defining indexing entries | 13706 | #+CINDEX: Defining indexing entries |
| 13033 | @end example | 13707 | @end example |
| 13034 | 13708 | ||
| 13035 | @cindex property, INDEX | 13709 | @cindex property, INDEX |
| 13036 | To generate an index, you need to set the @code{:INDEX:} property of | 13710 | For the back-end to generate an index entry for a headline, set the |
| 13037 | a headline to an appropriate abbreviation (e.g., @samp{cp} or @samp{vr}). | 13711 | @code{:INDEX:} property to @samp{cp} or @samp{vr}. These abbreviations come |
| 13038 | The headline is then exported as an unnumbered chapter or section command and | 13712 | from Texinfo that stand for concept index and variable index. The Texinfo |
| 13039 | the index is inserted after its contents. | 13713 | manual has abbreviations for all other kinds of indexes. The back-end |
| 13714 | exports the headline as an unnumbered chapter or section command, and then | ||
| 13715 | inserts the index after its contents. | ||
| 13040 | 13716 | ||
| 13041 | @example | 13717 | @example |
| 13042 | * Concept Index | 13718 | * Concept Index |
| @@ -13045,78 +13721,115 @@ the index is inserted after its contents. | |||
| 13045 | :END: | 13721 | :END: |
| 13046 | @end example | 13722 | @end example |
| 13047 | 13723 | ||
| 13048 | @node Quoting Texinfo code, Texinfo specific attributes, Indices, Texinfo export | 13724 | @node Quoting Texinfo code |
| 13049 | @subsection Quoting Texinfo code | 13725 | @subsection Quoting Texinfo code |
| 13050 | 13726 | ||
| 13051 | It is possible to insert raw Texinfo code using any of the following | 13727 | Use any of the following three methods to insert or escape raw Texinfo code: |
| 13052 | constructs | ||
| 13053 | 13728 | ||
| 13054 | @cindex #+TEXINFO | 13729 | @cindex #+TEXINFO |
| 13055 | @cindex #+BEGIN_TEXINFO | 13730 | @cindex #+BEGIN_EXPORT texinfo |
| 13056 | @example | 13731 | @example |
| 13057 | Richard @@@@texinfo:@@sc@{@@@@Stallman@@@@texinfo:@}@@@@ commence' GNU. | 13732 | Richard @@@@texinfo:@@sc@{@@@@Stallman@@@@texinfo:@}@@@@ commence' GNU. |
| 13058 | 13733 | ||
| 13059 | #+TEXINFO: @@need800 | 13734 | #+TEXINFO: @@need800 |
| 13060 | This paragraph is preceded by... | 13735 | This paragraph is preceded by... |
| 13061 | 13736 | ||
| 13062 | #+BEGIN_TEXINFO | 13737 | #+BEGIN_EXPORT texinfo |
| 13063 | @@auindex Johnson, Mark | 13738 | @@auindex Johnson, Mark |
| 13064 | @@auindex Lakoff, George | 13739 | @@auindex Lakoff, George |
| 13065 | #+END_TEXINFO | 13740 | #+END_EXPORT |
| 13066 | @end example | 13741 | @end example |
| 13067 | 13742 | ||
| 13068 | @node Texinfo specific attributes, An example, Quoting Texinfo code, Texinfo export | 13743 | @node Plain lists in Texinfo export |
| 13069 | @subsection Texinfo specific attributes | 13744 | @subsection Plain lists in Texinfo export |
| 13070 | 13745 | @cindex #+ATTR_TEXINFO, in plain lists | |
| 13071 | @cindex #+ATTR_TEXINFO | 13746 | The Texinfo export back-end by default converts description lists in the Org |
| 13072 | @samp{texinfo} back-end understands several attributes in plain lists and | 13747 | file using the default command @code{@@table}, which results in a table with |
| 13073 | tables. They must be specified using an @code{#+ATTR_TEXINFO} keyword, | 13748 | two columns. To change this behavior, specify @code{:table-type} with |
| 13074 | written just above the list or table. | 13749 | @code{@@ftable} or @code{@@vtable} attributes. For more information, |
| 13075 | 13750 | @inforef{Two-column Tables,,texinfo}. | |
| 13076 | @subsubheading Plain lists | ||
| 13077 | |||
| 13078 | In Texinfo output, description lists appear as two-column tables, using the | ||
| 13079 | default command @code{@@table}. You can use @code{@@ftable} or | ||
| 13080 | @code{@@vtable}@footnote{For more information, @inforef{Two-column | ||
| 13081 | Tables,,texinfo}.} instead with @code{:table-type} attribute. | ||
| 13082 | 13751 | ||
| 13083 | @vindex org-texinfo-def-table-markup | 13752 | @vindex org-texinfo-def-table-markup |
| 13084 | In any case, these constructs require a highlighting command for entries in | 13753 | The Texinfo export back-end by default also applies a text highlight based on |
| 13085 | the list. You can provide one with @code{:indic} attribute. If you do not, | 13754 | the defaults stored in @code{org-texinfo-def-table-markup}. To override the |
| 13086 | it defaults to the value stored in @code{org-texinfo-def-table-markup}, which | 13755 | default highlight command, specify another one with the @code{:indic} |
| 13087 | see. | 13756 | attribute as shown in this example: |
| 13088 | 13757 | ||
| 13089 | @example | 13758 | @example |
| 13090 | #+ATTR_TEXINFO: :indic @@asis | 13759 | #+ATTR_TEXINFO: :indic @@asis |
| 13091 | - foo :: This is the text for /foo/, with no highlighting. | 13760 | - foo :: This is the text for /foo/, with no highlighting. |
| 13092 | @end example | 13761 | @end example |
| 13093 | 13762 | ||
| 13094 | @subsubheading Tables | 13763 | @node Tables in Texinfo export |
| 13764 | @subsection Tables in Texinfo export | ||
| 13765 | @cindex #+ATTR_TEXINFO, in tables | ||
| 13095 | 13766 | ||
| 13096 | When exporting a table, column widths are deduced from the longest cell in | 13767 | When exporting tables, the Texinfo export back-end uses the widest cell width |
| 13097 | each column. You can also define them explicitly as fractions of the line | 13768 | in each column. To override this and instead specify as fractions of line |
| 13098 | length, using @code{:columns} attribute. | 13769 | length, use the @code{:columns} attribute. See example below. |
| 13099 | 13770 | ||
| 13100 | @example | 13771 | @example |
| 13101 | #+ATTR_TEXINFO: :columns .5 .5 | 13772 | #+ATTR_TEXINFO: :columns .5 .5 |
| 13102 | | a cell | another cell | | 13773 | | a cell | another cell | |
| 13103 | @end example | 13774 | @end example |
| 13104 | 13775 | ||
| 13105 | @node An example, , Texinfo specific attributes, Texinfo export | 13776 | @node Images in Texinfo export |
| 13106 | @subsection An example | 13777 | @subsection Images in Texinfo export |
| 13778 | @cindex #+ATTR_TEXINFO, in images | ||
| 13107 | 13779 | ||
| 13108 | Here is a thorough example, taken from @inforef{GNU Sample Texts,,texinfo}. | 13780 | Insert a file link to the image in the Org file, and the Texinfo export |
| 13781 | back-end inserts the image. These links must have the usual supported image | ||
| 13782 | extensions and no descriptions. To scale the image, use @code{:width} and | ||
| 13783 | @code{:height} attributes. For alternate text, use @code{:alt} and specify | ||
| 13784 | the text using Texinfo code, as shown in the example: | ||
| 13109 | 13785 | ||
| 13110 | @smallexample | 13786 | @example |
| 13111 | #+MACRO: version 2.0 | 13787 | #+ATTR_TEXINFO: :width 1in :alt Alternate @@i@{text@} |
| 13112 | #+MACRO: updated last updated 4 March 2014 | 13788 | [[ridt.pdf]] |
| 13789 | @end example | ||
| 13113 | 13790 | ||
| 13114 | #+OPTIONS: ':t toc:t author:t email:t | 13791 | @node Special blocks in Texinfo export |
| 13792 | @subsection Special blocks | ||
| 13793 | @cindex #+ATTR_TEXINFO, in special blocks | ||
| 13794 | |||
| 13795 | The Texinfo export back-end converts special blocks to commands with the same | ||
| 13796 | name. It also adds any @code{:options} attributes to the end of the command, | ||
| 13797 | as shown in this example: | ||
| 13798 | |||
| 13799 | @example | ||
| 13800 | #+ATTR_TEXINFO: :options org-org-export-to-org ... | ||
| 13801 | #+begin_defun | ||
| 13802 | A somewhat obsessive function. | ||
| 13803 | #+end_defun | ||
| 13804 | @end example | ||
| 13805 | |||
| 13806 | @noindent | ||
| 13807 | becomes | ||
| 13808 | |||
| 13809 | @example | ||
| 13810 | @@defun org-org-export-to-org ... | ||
| 13811 | A somewhat obsessive function. | ||
| 13812 | @@end defun | ||
| 13813 | @end example | ||
| 13814 | |||
| 13815 | @node A Texinfo example | ||
| 13816 | @subsection A Texinfo example | ||
| 13817 | |||
| 13818 | Here is a more detailed example Org file. @inforef{GNU Sample | ||
| 13819 | Texts,,texinfo} for an equivalent example using Texinfo code. | ||
| 13820 | |||
| 13821 | @example | ||
| 13115 | #+TITLE: GNU Sample @{@{@{version@}@}@} | 13822 | #+TITLE: GNU Sample @{@{@{version@}@}@} |
| 13823 | #+SUBTITLE: for version @{@{@{version@}@}@}, @{@{@{updated@}@}@} | ||
| 13116 | #+AUTHOR: A.U. Thor | 13824 | #+AUTHOR: A.U. Thor |
| 13117 | #+EMAIL: bug-sample@@gnu.org | 13825 | #+EMAIL: bug-sample@@gnu.org |
| 13826 | |||
| 13827 | #+OPTIONS: ':t toc:t author:t email:t | ||
| 13118 | #+LANGUAGE: en | 13828 | #+LANGUAGE: en |
| 13119 | 13829 | ||
| 13830 | #+MACRO: version 2.0 | ||
| 13831 | #+MACRO: updated last updated 4 March 2014 | ||
| 13832 | |||
| 13120 | #+TEXINFO_FILENAME: sample.info | 13833 | #+TEXINFO_FILENAME: sample.info |
| 13121 | #+TEXINFO_HEADER: @@syncodeindex pg cp | 13834 | #+TEXINFO_HEADER: @@syncodeindex pg cp |
| 13122 | 13835 | ||
| @@ -13125,7 +13838,9 @@ Here is a thorough example, taken from @inforef{GNU Sample Texts,,texinfo}. | |||
| 13125 | #+TEXINFO_DIR_DESC: Invoking sample | 13838 | #+TEXINFO_DIR_DESC: Invoking sample |
| 13126 | 13839 | ||
| 13127 | #+TEXINFO_PRINTED_TITLE: GNU Sample | 13840 | #+TEXINFO_PRINTED_TITLE: GNU Sample |
| 13128 | #+SUBTITLE: for version 2.0, last updated 4 March 2014 | 13841 | |
| 13842 | This manual is for GNU Sample (version @{@{@{version@}@}@}, | ||
| 13843 | @{@{@{updated@}@}@}). | ||
| 13129 | 13844 | ||
| 13130 | * Copying | 13845 | * Copying |
| 13131 | :PROPERTIES: | 13846 | :PROPERTIES: |
| @@ -13135,8 +13850,7 @@ Here is a thorough example, taken from @inforef{GNU Sample Texts,,texinfo}. | |||
| 13135 | This manual is for GNU Sample (version @{@{@{version@}@}@}, | 13850 | This manual is for GNU Sample (version @{@{@{version@}@}@}, |
| 13136 | @{@{@{updated@}@}@}), which is an example in the Texinfo documentation. | 13851 | @{@{@{updated@}@}@}), which is an example in the Texinfo documentation. |
| 13137 | 13852 | ||
| 13138 | Copyright @@@@texinfo:@@copyright@{@}@@@@ 2013 Free Software Foundation, | 13853 | Copyright \copy 2016 Free Software Foundation, Inc. |
| 13139 | Inc. | ||
| 13140 | 13854 | ||
| 13141 | #+BEGIN_QUOTE | 13855 | #+BEGIN_QUOTE |
| 13142 | Permission is granted to copy, distribute and/or modify this | 13856 | Permission is granted to copy, distribute and/or modify this |
| @@ -13167,9 +13881,9 @@ Here is a thorough example, taken from @inforef{GNU Sample Texts,,texinfo}. | |||
| 13167 | :PROPERTIES: | 13881 | :PROPERTIES: |
| 13168 | :INDEX: cp | 13882 | :INDEX: cp |
| 13169 | :END: | 13883 | :END: |
| 13170 | @end smallexample | 13884 | @end example |
| 13171 | 13885 | ||
| 13172 | @node iCalendar export, Other built-in back-ends, Texinfo export, Exporting | 13886 | @node iCalendar export |
| 13173 | @section iCalendar export | 13887 | @section iCalendar export |
| 13174 | @cindex iCalendar export | 13888 | @cindex iCalendar export |
| 13175 | 13889 | ||
| @@ -13178,49 +13892,51 @@ Here is a thorough example, taken from @inforef{GNU Sample Texts,,texinfo}. | |||
| 13178 | @vindex org-icalendar-use-scheduled | 13892 | @vindex org-icalendar-use-scheduled |
| 13179 | @vindex org-icalendar-categories | 13893 | @vindex org-icalendar-categories |
| 13180 | @vindex org-icalendar-alarm-time | 13894 | @vindex org-icalendar-alarm-time |
| 13181 | Some people use Org mode for keeping track of projects, but still prefer a | 13895 | A large part of Org mode's inter-operability success is its ability to easily |
| 13182 | standard calendar application for anniversaries and appointments. In this | 13896 | export to or import from external applications. The iCalendar export |
| 13183 | case it can be useful to show deadlines and other time-stamped items in Org | 13897 | back-end takes calendar data from Org files and exports to the standard |
| 13184 | files in the calendar application. Org mode can export calendar information | 13898 | iCalendar format. |
| 13185 | in the standard iCalendar format. If you also want to have TODO entries | 13899 | |
| 13186 | included in the export, configure the variable | 13900 | The iCalendar export back-end can also incorporate TODO entries based on the |
| 13187 | @code{org-icalendar-include-todo}. Plain timestamps are exported as VEVENT, | 13901 | configuration of the @code{org-icalendar-include-todo} variable. The |
| 13188 | and TODO items as VTODO@. It will also create events from deadlines that are | 13902 | back-end exports plain timestamps as VEVENT, TODO items as VTODO, and also |
| 13189 | in non-TODO items. Deadlines and scheduling dates in TODO items will be used | 13903 | create events from deadlines that are in non-TODO items. The back-end uses |
| 13190 | to set the start and due dates for the TODO entry@footnote{See the variables | 13904 | the deadlines and scheduling dates in Org TODO items for setting the start |
| 13191 | @code{org-icalendar-use-deadline} and @code{org-icalendar-use-scheduled}.}. | 13905 | and due dates for the iCalendar TODO entry. Consult the |
| 13192 | As categories, it will use the tags locally defined in the heading, and the | 13906 | @code{org-icalendar-use-deadline} and @code{org-icalendar-use-scheduled} |
| 13193 | file/tree category@footnote{To add inherited tags or the TODO state, | 13907 | variables for more details. |
| 13194 | configure the variable @code{org-icalendar-categories}.}. See the variable | 13908 | |
| 13195 | @code{org-icalendar-alarm-time} for a way to assign alarms to entries with a | 13909 | For tags on the headline, the iCalendar export back-end makes them into |
| 13196 | time. | 13910 | iCalendar categories. To tweak the inheritance of tags and TODO states, |
| 13911 | configure the variable @code{org-icalendar-categories}. To assign clock | ||
| 13912 | alarms based on time, configure the @code{org-icalendar-alarm-time} variable. | ||
| 13197 | 13913 | ||
| 13198 | @vindex org-icalendar-store-UID | 13914 | @vindex org-icalendar-store-UID |
| 13199 | @cindex property, ID | 13915 | @cindex property, ID |
| 13200 | The iCalendar standard requires each entry to have a globally unique | 13916 | The iCalendar format standard requires globally unique identifier---UID---for |
| 13201 | identifier (UID). Org creates these identifiers during export. If you set | 13917 | each entry. The iCalendar export back-end creates UIDs during export. To |
| 13202 | the variable @code{org-icalendar-store-UID}, the UID will be stored in the | 13918 | save a copy of the UID in the Org file set the variable |
| 13203 | @code{:ID:} property of the entry and re-used next time you report this | 13919 | @code{org-icalendar-store-UID}. The back-end looks for the @code{:ID:} |
| 13204 | entry. Since a single entry can give rise to multiple iCalendar entries (as | 13920 | property of the entry for re-using the same UID for subsequent exports. |
| 13205 | a timestamp, a deadline, a scheduled item, and as a TODO item), Org adds | 13921 | |
| 13206 | prefixes to the UID, depending on what triggered the inclusion of the entry. | 13922 | Since a single Org entry can result in multiple iCalendar entries---as |
| 13207 | In this way the UID remains unique, but a synchronization program can still | 13923 | timestamp, deadline, scheduled item, or TODO item---Org adds prefixes to the |
| 13208 | figure out from which entry all the different instances originate. | 13924 | UID, depending on which part of the Org entry triggered the creation of the |
| 13925 | iCalendar entry. Prefixing ensures UIDs remains unique, yet enable | ||
| 13926 | synchronization programs trace the connections. | ||
| 13209 | 13927 | ||
| 13210 | @table @kbd | 13928 | @table @kbd |
| 13211 | @orgcmd{C-c C-e c f,org-icalendar-export-to-ics} | 13929 | @orgcmd{C-c C-e c f,org-icalendar-export-to-ics} |
| 13212 | Create iCalendar entries for the current buffer and store them in the same | 13930 | Create iCalendar entries from the current Org buffer and store them in the |
| 13213 | directory, using a file extension @file{.ics}. | 13931 | same directory, using a file extension @file{.ics}. |
| 13214 | @orgcmd{C-c C-e c a, org-icalendar-export-agenda-files} | 13932 | @orgcmd{C-c C-e c a, org-icalendar-export-agenda-files} |
| 13215 | @vindex org-agenda-files | 13933 | @vindex org-agenda-files |
| 13216 | Like @kbd{C-c C-e c f}, but do this for all files in | 13934 | Create iCalendar entries from Org files in @code{org-agenda-files} and store |
| 13217 | @code{org-agenda-files}. For each of these files, a separate iCalendar | 13935 | in a separate iCalendar file for each Org file. |
| 13218 | file will be written. | ||
| 13219 | @orgcmd{C-c C-e c c,org-icalendar-combine-agenda-files} | 13936 | @orgcmd{C-c C-e c c,org-icalendar-combine-agenda-files} |
| 13220 | @vindex org-icalendar-combined-agenda-file | 13937 | @vindex org-icalendar-combined-agenda-file |
| 13221 | Create a single large iCalendar file from all files in | 13938 | Create a combined iCalendar file from Org files in @code{org-agenda-files} |
| 13222 | @code{org-agenda-files} and write it to the file given by | 13939 | and write it to @code{org-icalendar-combined-agenda-file} file name. |
| 13223 | @code{org-icalendar-combined-agenda-file}. | ||
| 13224 | @end table | 13940 | @end table |
| 13225 | 13941 | ||
| 13226 | @vindex org-use-property-inheritance | 13942 | @vindex org-use-property-inheritance |
| @@ -13228,72 +13944,54 @@ Create a single large iCalendar file from all files in | |||
| 13228 | @cindex property, SUMMARY | 13944 | @cindex property, SUMMARY |
| 13229 | @cindex property, DESCRIPTION | 13945 | @cindex property, DESCRIPTION |
| 13230 | @cindex property, LOCATION | 13946 | @cindex property, LOCATION |
| 13231 | The export will honor SUMMARY, DESCRIPTION and LOCATION@footnote{The LOCATION | 13947 | The iCalendar export back-end includes SUMMARY, DESCRIPTION and LOCATION |
| 13232 | property can be inherited from higher in the hierarchy if you configure | 13948 | properties from the Org entries when exporting. To force the back-end to |
| 13233 | @code{org-use-property-inheritance} accordingly.} properties if the selected | 13949 | inherit the LOCATION property, configure the |
| 13234 | entries have them. If not, the summary will be derived from the headline, | 13950 | @code{org-use-property-inheritance} variable. |
| 13235 | and the description from the body (limited to | 13951 | |
| 13236 | @code{org-icalendar-include-body} characters). | 13952 | When Org entries do not have SUMMARY, DESCRIPTION and LOCATION properties, |
| 13237 | 13953 | the iCalendar export back-end derives the summary from the headline, and | |
| 13238 | How this calendar is best read and updated, depends on the application | 13954 | derives the description from the body of the Org item. The |
| 13239 | you are using. The FAQ covers this issue. | 13955 | @code{org-icalendar-include-body} variable limits the maximum number of |
| 13240 | 13956 | characters of the content are turned into its description. | |
| 13241 | @node Other built-in back-ends, Export in foreign buffers, iCalendar export, Exporting | 13957 | |
| 13958 | Exporting to iCalendar format depends in large part on the capabilities of | ||
| 13959 | the destination application. Some are more lenient than others. Consult the | ||
| 13960 | Org mode FAQ for advice on specific applications. | ||
| 13961 | |||
| 13962 | @node Other built-in back-ends | ||
| 13242 | @section Other built-in back-ends | 13963 | @section Other built-in back-ends |
| 13243 | @cindex export back-ends, built-in | 13964 | @cindex export back-ends, built-in |
| 13244 | @vindex org-export-backends | 13965 | @vindex org-export-backends |
| 13245 | 13966 | ||
| 13246 | On top of the aforementioned back-ends, Org comes with other built-in ones: | 13967 | Other export back-ends included with Org are: |
| 13247 | 13968 | ||
| 13248 | @itemize | 13969 | @itemize |
| 13249 | @item @file{ox-man.el}: export to a man page. | 13970 | @item @file{ox-man.el}: export to a man page. |
| 13250 | @end itemize | 13971 | @end itemize |
| 13251 | 13972 | ||
| 13252 | To activate these export back-end, customize @code{org-export-backends} or | 13973 | To activate such back-ends, either customize @code{org-export-backends} or |
| 13253 | load them directly with e.g., @code{(require 'ox-man)}. This will add new | 13974 | load directly with @code{(require 'ox-man)}. On successful load, the |
| 13254 | keys in the export dispatcher (@pxref{The Export Dispatcher}). | 13975 | back-end adds new keys in the export dispatcher (@pxref{The export |
| 13255 | 13976 | dispatcher}). | |
| 13256 | See the comment section of these files for more information on how to use | ||
| 13257 | them. | ||
| 13258 | |||
| 13259 | @node Export in foreign buffers, Advanced configuration, Other built-in back-ends, Exporting | ||
| 13260 | @section Export in foreign buffers | ||
| 13261 | |||
| 13262 | Most built-in back-ends come with a command to convert the selected region | ||
| 13263 | into a selected format and replace this region by the exported output. Here | ||
| 13264 | is a list of such conversion commands: | ||
| 13265 | |||
| 13266 | @table @code | ||
| 13267 | @item org-html-convert-region-to-html | ||
| 13268 | Convert the selected region into HTML. | ||
| 13269 | @item org-latex-convert-region-to-latex | ||
| 13270 | Convert the selected region into @LaTeX{}. | ||
| 13271 | @item org-texinfo-convert-region-to-texinfo | ||
| 13272 | Convert the selected region into @code{Texinfo}. | ||
| 13273 | @item org-md-convert-region-to-md | ||
| 13274 | Convert the selected region into @code{MarkDown}. | ||
| 13275 | @end table | ||
| 13276 | 13977 | ||
| 13277 | This is particularly useful for converting tables and lists in foreign | 13978 | Follow the comment section of such files, for example, @file{ox-man.el}, for |
| 13278 | buffers. E.g., in an HTML buffer, you can turn on @code{orgstruct-mode}, then | 13979 | usage and configuration details. |
| 13279 | use Org commands for editing a list, and finally select and convert the list | ||
| 13280 | with @code{M-x org-html-convert-region-to-html RET}. | ||
| 13281 | 13980 | ||
| 13282 | @node Advanced configuration, , Export in foreign buffers, Exporting | 13981 | @node Advanced configuration |
| 13283 | @section Advanced configuration | 13982 | @section Advanced configuration |
| 13284 | 13983 | ||
| 13285 | @subheading Hooks | 13984 | @subheading Hooks |
| 13286 | 13985 | ||
| 13287 | @vindex org-export-before-processing-hook | 13986 | @vindex org-export-before-processing-hook |
| 13288 | @vindex org-export-before-parsing-hook | 13987 | @vindex org-export-before-parsing-hook |
| 13289 | Two hooks are run during the first steps of the export process. The first | 13988 | The export process executes two hooks before the actual exporting begins. |
| 13290 | one, @code{org-export-before-processing-hook} is called before expanding | 13989 | The first hook, @code{org-export-before-processing-hook}, runs before any |
| 13291 | macros, Babel code and include keywords in the buffer. The second one, | 13990 | expansions of macros, Babel code, and include keywords in the buffer. The |
| 13292 | @code{org-export-before-parsing-hook}, as its name suggests, happens just | 13991 | second hook, @code{org-export-before-parsing-hook}, runs before the buffer is |
| 13293 | before parsing the buffer. Their main use is for heavy duties, that is | 13992 | parsed. Both hooks are specified as functions, see example below. Their main |
| 13294 | duties involving structural modifications of the document. For example, one | 13993 | use is for heavy duty structural modifications of the Org content. For |
| 13295 | may want to remove every headline in the buffer during export. The following | 13994 | example, removing every headline in the buffer during export: |
| 13296 | code can achieve this: | ||
| 13297 | 13995 | ||
| 13298 | @lisp | 13996 | @lisp |
| 13299 | @group | 13997 | @group |
| @@ -13307,86 +14005,83 @@ BACKEND is the export back-end being used, as a symbol." | |||
| 13307 | @end group | 14005 | @end group |
| 13308 | @end lisp | 14006 | @end lisp |
| 13309 | 14007 | ||
| 13310 | Note that functions used in these hooks require a mandatory argument, | 14008 | Note that the hook function must have a mandatory argument that is a symbol |
| 13311 | a symbol representing the back-end used. | 14009 | for the back-end. |
| 13312 | 14010 | ||
| 13313 | @subheading Filters | 14011 | @subheading Filters |
| 13314 | 14012 | ||
| 13315 | @cindex Filters, exporting | 14013 | @cindex Filters, exporting |
| 13316 | Filters are lists of functions applied on a specific part of the output from | 14014 | The Org export process relies on filters to process specific parts of |
| 13317 | a given back-end. More explicitly, each time a back-end transforms an Org | 14015 | conversion process. Filters are just lists of functions to be applied to |
| 13318 | object or element into another language, all functions within a given filter | 14016 | certain parts for a given back-end. The output from the first function in |
| 13319 | type are called in turn on the string produced. The string returned by the | 14017 | the filter is passed on to the next function in the filter. The final output |
| 13320 | last function will be the one used in the final output. | 14018 | is the output from the final function in the filter. |
| 13321 | 14019 | ||
| 13322 | There are filters sets for each type of element or object, for plain text, | 14020 | The Org export process has many filter sets applicable to different types of |
| 13323 | for the parse tree, for the export options and for the final output. They | 14021 | objects, plain text, parse trees, export options, and final output formats. |
| 13324 | are all named after the same scheme: @code{org-export-filter-TYPE-functions}, | 14022 | The filters are named after the element type or object type: |
| 13325 | where @code{TYPE} is the type targeted by the filter. Valid types are: | 14023 | @code{org-export-filter-TYPE-functions}, where @code{TYPE} is the type |
| 14024 | targeted by the filter. Valid types are: | ||
| 13326 | 14025 | ||
| 13327 | @multitable @columnfractions .33 .33 .33 | 14026 | @multitable @columnfractions .33 .33 .33 |
| 13328 | @item bold | 14027 | @item body |
| 14028 | @tab bold | ||
| 13329 | @tab babel-call | 14029 | @tab babel-call |
| 13330 | @tab center-block | 14030 | @item center-block |
| 13331 | @item clock | 14031 | @tab clock |
| 13332 | @tab code | 14032 | @tab code |
| 13333 | @tab comment | 14033 | @item diary-sexp |
| 13334 | @item comment-block | ||
| 13335 | @tab diary-sexp | ||
| 13336 | @tab drawer | 14034 | @tab drawer |
| 13337 | @item dynamic-block | 14035 | @tab dynamic-block |
| 13338 | @tab entity | 14036 | @item entity |
| 13339 | @tab example-block | 14037 | @tab example-block |
| 13340 | @item export-block | 14038 | @tab export-block |
| 13341 | @tab export-snippet | 14039 | @item export-snippet |
| 13342 | @tab final-output | 14040 | @tab final-output |
| 13343 | @item fixed-width | 14041 | @tab fixed-width |
| 13344 | @tab footnote-definition | 14042 | @item footnote-definition |
| 13345 | @tab footnote-reference | 14043 | @tab footnote-reference |
| 13346 | @item headline | 14044 | @tab headline |
| 13347 | @tab horizontal-rule | 14045 | @item horizontal-rule |
| 13348 | @tab inline-babel-call | 14046 | @tab inline-babel-call |
| 13349 | @item inline-src-block | 14047 | @tab inline-src-block |
| 13350 | @tab inlinetask | 14048 | @item inlinetask |
| 13351 | @tab italic | 14049 | @tab italic |
| 13352 | @item item | 14050 | @tab item |
| 13353 | @tab keyword | 14051 | @item keyword |
| 13354 | @tab latex-environment | 14052 | @tab latex-environment |
| 13355 | @item latex-fragment | 14053 | @tab latex-fragment |
| 13356 | @tab line-break | 14054 | @item line-break |
| 13357 | @tab link | 14055 | @tab link |
| 13358 | @item node-property | 14056 | @tab node-property |
| 13359 | @tab options | 14057 | @item options |
| 13360 | @tab paragraph | 14058 | @tab paragraph |
| 13361 | @item parse-tree | 14059 | @tab parse-tree |
| 13362 | @tab plain-list | 14060 | @item plain-list |
| 13363 | @tab plain-text | 14061 | @tab plain-text |
| 13364 | @item planning | 14062 | @tab planning |
| 13365 | @tab property-drawer | 14063 | @item property-drawer |
| 13366 | @tab quote-block | 14064 | @tab quote-block |
| 13367 | @item quote-section | ||
| 13368 | @tab radio-target | 14065 | @tab radio-target |
| 13369 | @tab section | 14066 | @item section |
| 13370 | @item special-block | 14067 | @tab special-block |
| 13371 | @tab src-block | 14068 | @tab src-block |
| 13372 | @tab statistics-cookie | 14069 | @item statistics-cookie |
| 13373 | @item strike-through | 14070 | @tab strike-through |
| 13374 | @tab subscript | 14071 | @tab subscript |
| 13375 | @tab superscript | 14072 | @item superscript |
| 13376 | @item table | 14073 | @tab table |
| 13377 | @tab table-cell | 14074 | @tab table-cell |
| 13378 | @tab table-row | 14075 | @item table-row |
| 13379 | @item target | 14076 | @tab target |
| 13380 | @tab timestamp | 14077 | @tab timestamp |
| 13381 | @tab underline | 14078 | @item underline |
| 13382 | @item verbatim | 14079 | @tab verbatim |
| 13383 | @tab verse-block | 14080 | @tab verse-block |
| 13384 | @tab | ||
| 13385 | @end multitable | 14081 | @end multitable |
| 13386 | 14082 | ||
| 13387 | For example, the following snippet allows me to use non-breaking spaces in | 14083 | Here is an example filter that replaces non-breaking spaces @code{~} in the |
| 13388 | the Org buffer and get them translated into @LaTeX{} without using the | 14084 | Org buffer with @code{_} for the @LaTeX{} back-end. |
| 13389 | @code{\nbsp} macro (where @code{_} stands for the non-breaking space): | ||
| 13390 | 14085 | ||
| 13391 | @lisp | 14086 | @lisp |
| 13392 | @group | 14087 | @group |
| @@ -13400,33 +14095,49 @@ the Org buffer and get them translated into @LaTeX{} without using the | |||
| 13400 | @end group | 14095 | @end group |
| 13401 | @end lisp | 14096 | @end lisp |
| 13402 | 14097 | ||
| 13403 | Three arguments must be provided to a filter: the code being changed, the | 14098 | A filter requires three arguments: the code to be transformed, the name of |
| 13404 | back-end used, and some information about the export process. You can safely | 14099 | the back-end, and some optional information about the export process. The |
| 13405 | ignore the third argument for most purposes. Note the use of | 14100 | third argument can be safely ignored. Note the use of |
| 13406 | @code{org-export-derived-backend-p}, which ensures that the filter will only | 14101 | @code{org-export-derived-backend-p} predicate that tests for @code{latex} |
| 13407 | be applied when using @code{latex} back-end or any other back-end derived | 14102 | back-end or any other back-end, such as @code{beamer}, derived from |
| 13408 | from it (e.g., @code{beamer}). | 14103 | @code{latex}. |
| 13409 | 14104 | ||
| 13410 | @subheading Extending an existing back-end | 14105 | @subheading Defining filters for individual files |
| 14106 | |||
| 14107 | The Org export can filter not just for back-ends, but also for specific files | ||
| 14108 | through the @code{#+BIND} keyword. Here is an example with two filters; one | ||
| 14109 | removes brackets from time stamps, and the other removes strike-through text. | ||
| 14110 | The filter functions are defined in a @samp{src} code block in the same Org | ||
| 14111 | file, which is a handy location for debugging. | ||
| 14112 | |||
| 14113 | @example | ||
| 14114 | #+BIND: org-export-filter-timestamp-functions (tmp-f-timestamp) | ||
| 14115 | #+BIND: org-export-filter-strike-through-functions (tmp-f-strike-through) | ||
| 14116 | #+begin_src emacs-lisp :exports results :results none | ||
| 14117 | (defun tmp-f-timestamp (s backend info) | ||
| 14118 | (replace-regexp-in-string "&[lg]t;\\|[][]" "" s)) | ||
| 14119 | (defun tmp-f-strike-through (s backend info) "") | ||
| 14120 | #+end_src | ||
| 14121 | @end example | ||
| 13411 | 14122 | ||
| 13412 | This is obviously the most powerful customization, since the changes happen | 14123 | @subheading Extending an existing back-end |
| 13413 | at the parser level. Indeed, some export back-ends are built as extensions | ||
| 13414 | of other ones (e.g., Markdown back-end an extension of HTML back-end). | ||
| 13415 | 14124 | ||
| 13416 | Extending a back-end means that if an element type is not transcoded by the | 14125 | Some parts of the conversion process can be extended for certain elements so |
| 13417 | new back-end, it will be handled by the original one. Hence you can extend | 14126 | as to introduce a new or revised translation. That is how the HTML export |
| 13418 | specific parts of a back-end without too much work. | 14127 | back-end was extended to handle Markdown format. The extensions work |
| 14128 | seamlessly so any aspect of filtering not done by the extended back-end is | ||
| 14129 | handled by the original back-end. Of all the export customization in Org, | ||
| 14130 | extending is very powerful as it operates at the parser level. | ||
| 13419 | 14131 | ||
| 13420 | As an example, imagine we want the @code{ascii} back-end to display the | 14132 | For this example, make the @code{ascii} back-end display the language used in |
| 13421 | language used in a source block, when it is available, but only when some | 14133 | a source code block. Also make it display only when some attribute is |
| 13422 | attribute is non-@code{nil}, like the following: | 14134 | non-@code{nil}, like the following: |
| 13423 | 14135 | ||
| 13424 | @example | 14136 | @example |
| 13425 | #+ATTR_ASCII: :language t | 14137 | #+ATTR_ASCII: :language t |
| 13426 | @end example | 14138 | @end example |
| 13427 | 14139 | ||
| 13428 | Because that back-end is lacking in that area, we are going to create a new | 14140 | Then extend @code{ascii} back-end with a custom @code{my-ascii} back-end. |
| 13429 | back-end, @code{my-ascii} that will do the job. | ||
| 13430 | 14141 | ||
| 13431 | @lisp | 14142 | @lisp |
| 13432 | @group | 14143 | @group |
| @@ -13450,20 +14161,47 @@ channel." | |||
| 13450 | @end lisp | 14161 | @end lisp |
| 13451 | 14162 | ||
| 13452 | The @code{my-ascii-src-block} function looks at the attribute above the | 14163 | The @code{my-ascii-src-block} function looks at the attribute above the |
| 13453 | element. If it isn't true, it gives hand to the @code{ascii} back-end. | 14164 | current element. If not true, hands over to @code{ascii} back-end. If true, |
| 13454 | Otherwise, it creates a box around the code, leaving room for the language. | 14165 | which it is in this example, it creates a box around the code and leaves room |
| 13455 | A new back-end is then created. It only changes its behavior when | 14166 | for the inserting a string for language. The last form creates the new |
| 13456 | translating @code{src-block} type element. Now, all it takes to use the new | 14167 | back-end that springs to action only when translating @code{src-block} type |
| 13457 | back-end is calling the following from an Org buffer: | 14168 | elements. |
| 14169 | |||
| 14170 | To use the newly defined back-end, call the following from an Org buffer: | ||
| 13458 | 14171 | ||
| 13459 | @smalllisp | 14172 | @smalllisp |
| 13460 | (org-export-to-buffer 'my-ascii "*Org MY-ASCII Export*") | 14173 | (org-export-to-buffer 'my-ascii "*Org MY-ASCII Export*") |
| 13461 | @end smalllisp | 14174 | @end smalllisp |
| 13462 | 14175 | ||
| 13463 | It is obviously possible to write an interactive function for this, install | 14176 | Further steps to consider would be an interactive function, self-installing |
| 13464 | it in the export dispatcher menu, and so on. | 14177 | an item in the export dispatcher menu, and other user-friendly improvements. |
| 14178 | |||
| 14179 | @node Export in foreign buffers | ||
| 14180 | @section Export in foreign buffers | ||
| 14181 | |||
| 14182 | The export back-ends in Org often include commands to convert selected | ||
| 14183 | regions. A convenient feature of this in-place conversion is that the | ||
| 14184 | exported output replaces the original source. Here are such functions: | ||
| 14185 | |||
| 14186 | @table @code | ||
| 14187 | @item org-html-convert-region-to-html | ||
| 14188 | Convert the selected region into HTML. | ||
| 14189 | @item org-latex-convert-region-to-latex | ||
| 14190 | Convert the selected region into @LaTeX{}. | ||
| 14191 | @item org-texinfo-convert-region-to-texinfo | ||
| 14192 | Convert the selected region into @code{Texinfo}. | ||
| 14193 | @item org-md-convert-region-to-md | ||
| 14194 | Convert the selected region into @code{MarkDown}. | ||
| 14195 | @end table | ||
| 14196 | |||
| 14197 | In-place conversions are particularly handy for quick conversion of tables | ||
| 14198 | and lists in foreign buffers. For example, turn on the minor mode @code{M-x | ||
| 14199 | orgstruct-mode} in an HTML buffer, then use the convenient Org keyboard | ||
| 14200 | commands to create a list, select it, and covert it to HTML with @code{M-x | ||
| 14201 | org-html-convert-region-to-html RET}. | ||
| 14202 | |||
| 13465 | 14203 | ||
| 13466 | @node Publishing, Working With Source Code, Exporting, Top | 14204 | @node Publishing |
| 13467 | @chapter Publishing | 14205 | @chapter Publishing |
| 13468 | @cindex publishing | 14206 | @cindex publishing |
| 13469 | 14207 | ||
| @@ -13485,7 +14223,7 @@ Publishing has been contributed to Org by David O'Toole. | |||
| 13485 | * Triggering publication:: Publication commands | 14223 | * Triggering publication:: Publication commands |
| 13486 | @end menu | 14224 | @end menu |
| 13487 | 14225 | ||
| 13488 | @node Configuration, Uploading files, Publishing, Publishing | 14226 | @node Configuration |
| 13489 | @section Configuration | 14227 | @section Configuration |
| 13490 | 14228 | ||
| 13491 | Publishing needs significant configuration to specify files, destination | 14229 | Publishing needs significant configuration to specify files, destination |
| @@ -13502,7 +14240,7 @@ and many other properties of a project. | |||
| 13502 | * Generating an index:: An index that reaches across pages | 14240 | * Generating an index:: An index that reaches across pages |
| 13503 | @end menu | 14241 | @end menu |
| 13504 | 14242 | ||
| 13505 | @node Project alist, Sources and destinations, Configuration, Configuration | 14243 | @node Project alist |
| 13506 | @subsection The variable @code{org-publish-project-alist} | 14244 | @subsection The variable @code{org-publish-project-alist} |
| 13507 | @cindex org-publish-project-alist | 14245 | @cindex org-publish-project-alist |
| 13508 | @cindex projects, for publishing | 14246 | @cindex projects, for publishing |
| @@ -13529,7 +14267,7 @@ together files requiring different publishing options. When you publish such | |||
| 13529 | a ``meta-project'', all the components will also be published, in the | 14267 | a ``meta-project'', all the components will also be published, in the |
| 13530 | sequence given. | 14268 | sequence given. |
| 13531 | 14269 | ||
| 13532 | @node Sources and destinations, Selecting files, Project alist, Configuration | 14270 | @node Sources and destinations |
| 13533 | @subsection Sources and destinations for files | 14271 | @subsection Sources and destinations for files |
| 13534 | @cindex directories, for publishing | 14272 | @cindex directories, for publishing |
| 13535 | 14273 | ||
| @@ -13548,17 +14286,17 @@ use external tools to upload your website (@pxref{Uploading files}). | |||
| 13548 | @item @code{:preparation-function} | 14286 | @item @code{:preparation-function} |
| 13549 | @tab Function or list of functions to be called before starting the | 14287 | @tab Function or list of functions to be called before starting the |
| 13550 | publishing process, for example, to run @code{make} for updating files to be | 14288 | publishing process, for example, to run @code{make} for updating files to be |
| 13551 | published. The project property list is scoped into this call as the | 14289 | published. Each preparation function is called with a single argument, the |
| 13552 | variable @code{project-plist}. | 14290 | project property list. |
| 13553 | @item @code{:completion-function} | 14291 | @item @code{:completion-function} |
| 13554 | @tab Function or list of functions called after finishing the publishing | 14292 | @tab Function or list of functions called after finishing the publishing |
| 13555 | process, for example, to change permissions of the resulting files. The | 14293 | process, for example, to change permissions of the resulting files. Each |
| 13556 | project property list is scoped into this call as the variable | 14294 | completion function is called with a single argument, the project property |
| 13557 | @code{project-plist}. | 14295 | list. |
| 13558 | @end multitable | 14296 | @end multitable |
| 13559 | @noindent | 14297 | @noindent |
| 13560 | 14298 | ||
| 13561 | @node Selecting files, Publishing action, Sources and destinations, Configuration | 14299 | @node Selecting files |
| 13562 | @subsection Selecting files | 14300 | @subsection Selecting files |
| 13563 | @cindex files, selecting for publishing | 14301 | @cindex files, selecting for publishing |
| 13564 | 14302 | ||
| @@ -13584,7 +14322,7 @@ and @code{:exclude}. | |||
| 13584 | @tab non-@code{nil} means, check base-directory recursively for files to publish. | 14322 | @tab non-@code{nil} means, check base-directory recursively for files to publish. |
| 13585 | @end multitable | 14323 | @end multitable |
| 13586 | 14324 | ||
| 13587 | @node Publishing action, Publishing options, Selecting files, Configuration | 14325 | @node Publishing action |
| 13588 | @subsection Publishing action | 14326 | @subsection Publishing action |
| 13589 | @cindex action, for publishing | 14327 | @cindex action, for publishing |
| 13590 | 14328 | ||
| @@ -13623,46 +14361,26 @@ and the path to the publishing directory of the output file. It should take | |||
| 13623 | the specified file, make the necessary transformation (if any) and place the | 14361 | the specified file, make the necessary transformation (if any) and place the |
| 13624 | result into the destination folder. | 14362 | result into the destination folder. |
| 13625 | 14363 | ||
| 13626 | @node Publishing options, Publishing links, Publishing action, Configuration | 14364 | @node Publishing options |
| 13627 | @subsection Options for the exporters | 14365 | @subsection Options for the exporters |
| 13628 | @cindex options, for publishing | 14366 | @cindex options, for publishing |
| 13629 | 14367 | ||
| 13630 | The property list can be used to set many export options for the exporters. | 14368 | The property list can be used to set export options during the publishing |
| 13631 | In most cases, these properties correspond to user variables in Org. The | 14369 | process. In most cases, these properties correspond to user variables in |
| 13632 | first table below lists these properties along with the variable they belong | 14370 | Org. While some properties are available for all export back-ends, most of |
| 13633 | to. The second table list HTML specific properties. See the documentation | 14371 | them are back-end specific. The following sections list properties along |
| 13634 | string of these options for details. | 14372 | with the variable they belong to. See the documentation string of these |
| 14373 | options for details. | ||
| 13635 | 14374 | ||
| 13636 | @vindex org-display-custom-times | 14375 | @vindex org-publish-project-alist |
| 13637 | @vindex org-export-default-language | 14376 | When a property is given a value in @code{org-publish-project-alist}, its |
| 13638 | @vindex org-export-exclude-tags | 14377 | setting overrides the value of the corresponding user variable (if any) |
| 13639 | @vindex org-export-headline-levels | 14378 | during publishing. Options set within a file (@pxref{Export settings}), |
| 13640 | @vindex org-export-preserve-breaks | 14379 | however, override everything. |
| 13641 | @vindex org-export-publishing-directory | 14380 | |
| 13642 | @vindex org-export-select-tags | 14381 | @subsubheading Generic properties |
| 13643 | @vindex org-export-with-archived-trees | ||
| 13644 | @vindex org-export-with-author | ||
| 13645 | @vindex org-export-with-creator | ||
| 13646 | @vindex org-export-with-drawers | ||
| 13647 | @vindex org-export-with-email | ||
| 13648 | @vindex org-export-with-emphasize | ||
| 13649 | @vindex org-export-with-fixed-width | ||
| 13650 | @vindex org-export-with-footnotes | ||
| 13651 | @vindex org-export-with-latex | ||
| 13652 | @vindex org-export-with-planning | ||
| 13653 | @vindex org-export-with-priority | ||
| 13654 | @vindex org-export-with-section-numbers | ||
| 13655 | @vindex org-export-with-special-strings | ||
| 13656 | @vindex org-export-with-sub-superscripts | ||
| 13657 | @vindex org-export-with-tables | ||
| 13658 | @vindex org-export-with-tags | ||
| 13659 | @vindex org-export-with-tasks | ||
| 13660 | @vindex org-export-with-timestamps | ||
| 13661 | @vindex org-export-with-toc | ||
| 13662 | @vindex org-export-with-todo-keywords | ||
| 13663 | @vindex user-mail-address | ||
| 13664 | 14382 | ||
| 13665 | @multitable @columnfractions 0.32 0.68 | 14383 | @multitable {@code{:with-sub-superscript}} {@code{org-export-with-sub-superscripts}} |
| 13666 | @item @code{:archived-trees} @tab @code{org-export-with-archived-trees} | 14384 | @item @code{:archived-trees} @tab @code{org-export-with-archived-trees} |
| 13667 | @item @code{:exclude-tags} @tab @code{org-export-exclude-tags} | 14385 | @item @code{:exclude-tags} @tab @code{org-export-exclude-tags} |
| 13668 | @item @code{:headline-levels} @tab @code{org-export-headline-levels} | 14386 | @item @code{:headline-levels} @tab @code{org-export-headline-levels} |
| @@ -13671,7 +14389,10 @@ string of these options for details. | |||
| 13671 | @item @code{:section-numbers} @tab @code{org-export-with-section-numbers} | 14389 | @item @code{:section-numbers} @tab @code{org-export-with-section-numbers} |
| 13672 | @item @code{:select-tags} @tab @code{org-export-select-tags} | 14390 | @item @code{:select-tags} @tab @code{org-export-select-tags} |
| 13673 | @item @code{:with-author} @tab @code{org-export-with-author} | 14391 | @item @code{:with-author} @tab @code{org-export-with-author} |
| 14392 | @item @code{:with-broken-links} @tab @code{org-export-with-broken-links} | ||
| 14393 | @item @code{:with-clocks} @tab @code{org-export-with-clocks} | ||
| 13674 | @item @code{:with-creator} @tab @code{org-export-with-creator} | 14394 | @item @code{:with-creator} @tab @code{org-export-with-creator} |
| 14395 | @item @code{:with-date} @tab @code{org-export-with-date} | ||
| 13675 | @item @code{:with-drawers} @tab @code{org-export-with-drawers} | 14396 | @item @code{:with-drawers} @tab @code{org-export-with-drawers} |
| 13676 | @item @code{:with-email} @tab @code{org-export-with-email} | 14397 | @item @code{:with-email} @tab @code{org-export-with-email} |
| 13677 | @item @code{:with-emphasize} @tab @code{org-export-with-emphasize} | 14398 | @item @code{:with-emphasize} @tab @code{org-export-with-emphasize} |
| @@ -13680,83 +14401,225 @@ string of these options for details. | |||
| 13680 | @item @code{:with-latex} @tab @code{org-export-with-latex} | 14401 | @item @code{:with-latex} @tab @code{org-export-with-latex} |
| 13681 | @item @code{:with-planning} @tab @code{org-export-with-planning} | 14402 | @item @code{:with-planning} @tab @code{org-export-with-planning} |
| 13682 | @item @code{:with-priority} @tab @code{org-export-with-priority} | 14403 | @item @code{:with-priority} @tab @code{org-export-with-priority} |
| 14404 | @item @code{:with-properties} @tab @code{org-export-with-properties} | ||
| 13683 | @item @code{:with-special-strings} @tab @code{org-export-with-special-strings} | 14405 | @item @code{:with-special-strings} @tab @code{org-export-with-special-strings} |
| 13684 | @item @code{:with-sub-superscript} @tab @code{org-export-with-sub-superscripts} | 14406 | @item @code{:with-sub-superscript} @tab @code{org-export-with-sub-superscripts} |
| 13685 | @item @code{:with-tables} @tab @code{org-export-with-tables} | 14407 | @item @code{:with-tables} @tab @code{org-export-with-tables} |
| 13686 | @item @code{:with-tags} @tab @code{org-export-with-tags} | 14408 | @item @code{:with-tags} @tab @code{org-export-with-tags} |
| 13687 | @item @code{:with-tasks} @tab @code{org-export-with-tasks} | 14409 | @item @code{:with-tasks} @tab @code{org-export-with-tasks} |
| 13688 | @item @code{:with-timestamps} @tab @code{org-export-with-timestamps} | 14410 | @item @code{:with-timestamps} @tab @code{org-export-with-timestamps} |
| 14411 | @item @code{:with-title} @tab @code{org-export-with-title} | ||
| 13689 | @item @code{:with-toc} @tab @code{org-export-with-toc} | 14412 | @item @code{:with-toc} @tab @code{org-export-with-toc} |
| 13690 | @item @code{:with-todo-keywords} @tab @code{org-export-with-todo-keywords} | 14413 | @item @code{:with-todo-keywords} @tab @code{org-export-with-todo-keywords} |
| 13691 | @end multitable | 14414 | @end multitable |
| 13692 | 14415 | ||
| 13693 | @vindex org-html-doctype | 14416 | @subsubheading ASCII specific properties |
| 13694 | @vindex org-html-container-element | 14417 | |
| 13695 | @vindex org-html-html5-fancy | 14418 | @multitable {@code{:ascii-table-keep-all-vertical-lines}} {@code{org-ascii-table-keep-all-vertical-lines}} |
| 13696 | @vindex org-html-xml-declaration | 14419 | @item @code{:ascii-bullets} @tab @code{org-ascii-bullets} |
| 13697 | @vindex org-html-link-up | 14420 | @item @code{:ascii-caption-above} @tab @code{org-ascii-caption-above} |
| 13698 | @vindex org-html-link-home | 14421 | @item @code{:ascii-charset} @tab @code{org-ascii-charset} |
| 13699 | @vindex org-html-link-org-files-as-html | 14422 | @item @code{:ascii-global-margin} @tab @code{org-ascii-global-margin} |
| 13700 | @vindex org-html-link-use-abs-url | 14423 | @item @code{:ascii-format-drawer-function} @tab @code{org-ascii-format-drawer-function} |
| 13701 | @vindex org-html-head | 14424 | @item @code{:ascii-format-inlinetask-function} @tab @code{org-ascii-format-inlinetask-function} |
| 13702 | @vindex org-html-head-extra | 14425 | @item @code{:ascii-headline-spacing} @tab @code{org-ascii-headline-spacing} |
| 13703 | @vindex org-html-inline-images | 14426 | @item @code{:ascii-indented-line-width} @tab @code{org-ascii-indented-line-width} |
| 13704 | @vindex org-html-extension | 14427 | @item @code{:ascii-inlinetask-width} @tab @code{org-ascii-inlinetask-width} |
| 13705 | @vindex org-html-preamble | 14428 | @item @code{:ascii-inner-margin} @tab @code{org-ascii-inner-margin} |
| 13706 | @vindex org-html-postamble | 14429 | @item @code{:ascii-links-to-notes} @tab @code{org-ascii-links-to-notes} |
| 13707 | @vindex org-html-table-default-attributes | 14430 | @item @code{:ascii-list-margin} @tab @code{org-ascii-list-margin} |
| 13708 | @vindex org-html-table-row-tags | 14431 | @item @code{:ascii-paragraph-spacing} @tab @code{org-ascii-paragraph-spacing} |
| 13709 | @vindex org-html-head-include-default-style | 14432 | @item @code{:ascii-quote-margin} @tab @code{org-ascii-quote-margin} |
| 13710 | @vindex org-html-head-include-scripts | 14433 | @item @code{:ascii-table-keep-all-vertical-lines} @tab @code{org-ascii-table-keep-all-vertical-lines} |
| 13711 | @multitable @columnfractions 0.32 0.68 | 14434 | @item @code{:ascii-table-use-ascii-art} @tab @code{org-ascii-table-use-ascii-art} |
| 13712 | @item @code{:html-doctype} @tab @code{org-html-doctype} | 14435 | @item @code{:ascii-table-widen-columns} @tab @code{org-ascii-table-widen-columns} |
| 13713 | @item @code{:html-container} @tab @code{org-html-container-element} | 14436 | @item @code{:ascii-text-width} @tab @code{org-ascii-text-width} |
| 13714 | @item @code{:html-html5-fancy} @tab @code{org-html-html5-fancy} | 14437 | @item @code{:ascii-underline} @tab @code{org-ascii-underline} |
| 13715 | @item @code{:html-xml-declaration} @tab @code{org-html-xml-declaration} | 14438 | @item @code{:ascii-verbatim-format} @tab @code{org-ascii-verbatim-format} |
| 13716 | @item @code{:html-link-up} @tab @code{org-html-link-up} | 14439 | @end multitable |
| 13717 | @item @code{:html-link-home} @tab @code{org-html-link-home} | 14440 | |
| 13718 | @item @code{:html-link-org-as-html} @tab @code{org-html-link-org-files-as-html} | 14441 | @subsubheading Beamer specific properties |
| 13719 | @item @code{:html-link-use-abs-url} @tab @code{org-html-link-use-abs-url} | 14442 | |
| 13720 | @item @code{:html-head} @tab @code{org-html-head} | 14443 | @multitable {@code{:beamer-frame-default-options}} {@code{org-beamer-frame-default-options}} |
| 13721 | @item @code{:html-head-extra} @tab @code{org-html-head-extra} | 14444 | @item @code{:beamer-theme} @tab @code{org-beamer-theme} |
| 13722 | @item @code{:html-inline-images} @tab @code{org-html-inline-images} | 14445 | @item @code{:beamer-column-view-format} @tab @code{org-beamer-column-view-format} |
| 13723 | @item @code{:html-extension} @tab @code{org-html-extension} | 14446 | @item @code{:beamer-environments-extra} @tab @code{org-beamer-environments-extra} |
| 13724 | @item @code{:html-preamble} @tab @code{org-html-preamble} | 14447 | @item @code{:beamer-frame-default-options} @tab @code{org-beamer-frame-default-options} |
| 13725 | @item @code{:html-postamble} @tab @code{org-html-postamble} | 14448 | @item @code{:beamer-outline-frame-options} @tab @code{org-beamer-outline-frame-options} |
| 13726 | @item @code{:html-table-attributes} @tab @code{org-html-table-default-attributes} | 14449 | @item @code{:beamer-outline-frame-title} @tab @code{org-beamer-outline-frame-title} |
| 13727 | @item @code{:html-table-row-tags} @tab @code{org-html-table-row-tags} | 14450 | @item @code{:beamer-subtitle-format} @tab @code{org-beamer-subtitle-format} |
| 14451 | @end multitable | ||
| 14452 | |||
| 14453 | @subsubheading HTML specific properties | ||
| 14454 | |||
| 14455 | @multitable {@code{:html-table-use-header-tags-for-first-column}} {@code{org-html-table-use-header-tags-for-first-column}} | ||
| 14456 | @item @code{:html-allow-name-attribute-in-anchors} @tab @code{org-html-allow-name-attribute-in-anchors} | ||
| 14457 | @item @code{:html-checkbox-type} @tab @code{org-html-checkbox-type} | ||
| 14458 | @item @code{:html-container} @tab @code{org-html-container-element} | ||
| 14459 | @item @code{:html-divs} @tab @code{org-html-divs} | ||
| 14460 | @item @code{:html-doctype} @tab @code{org-html-doctype} | ||
| 14461 | @item @code{:html-extension} @tab @code{org-html-extension} | ||
| 14462 | @item @code{:html-footnote-format} @tab @code{org-html-footnote-format} | ||
| 14463 | @item @code{:html-footnote-separator} @tab @code{org-html-footnote-separator} | ||
| 14464 | @item @code{:html-footnotes-section} @tab @code{org-html-footnotes-section} | ||
| 14465 | @item @code{:html-format-drawer-function} @tab @code{org-html-format-drawer-function} | ||
| 14466 | @item @code{:html-format-headline-function} @tab @code{org-html-format-headline-function} | ||
| 14467 | @item @code{:html-format-inlinetask-function} @tab @code{org-html-format-inlinetask-function} | ||
| 14468 | @item @code{:html-head-extra} @tab @code{org-html-head-extra} | ||
| 13728 | @item @code{:html-head-include-default-style} @tab @code{org-html-head-include-default-style} | 14469 | @item @code{:html-head-include-default-style} @tab @code{org-html-head-include-default-style} |
| 13729 | @item @code{:html-head-include-scripts} @tab @code{org-html-head-include-scripts} | 14470 | @item @code{:html-head-include-scripts} @tab @code{org-html-head-include-scripts} |
| 14471 | @item @code{:html-head} @tab @code{org-html-head} | ||
| 14472 | @item @code{:html-home/up-format} @tab @code{org-html-home/up-format} | ||
| 14473 | @item @code{:html-html5-fancy} @tab @code{org-html-html5-fancy} | ||
| 14474 | @item @code{:html-indent} @tab @code{org-html-indent} | ||
| 14475 | @item @code{:html-infojs-options} @tab @code{org-html-infojs-options} | ||
| 14476 | @item @code{:html-infojs-template} @tab @code{org-html-infojs-template} | ||
| 14477 | @item @code{:html-inline-image-rules} @tab @code{org-html-inline-image-rules} | ||
| 14478 | @item @code{:html-inline-images} @tab @code{org-html-inline-images} | ||
| 14479 | @item @code{:html-link-home} @tab @code{org-html-link-home} | ||
| 14480 | @item @code{:html-link-org-files-as-html} @tab @code{org-html-link-org-files-as-html} | ||
| 14481 | @item @code{:html-link-up} @tab @code{org-html-link-up} | ||
| 14482 | @item @code{:html-link-use-abs-url} @tab @code{org-html-link-use-abs-url} | ||
| 14483 | @item @code{:html-mathjax-options} @tab @code{org-html-mathjax-options} | ||
| 14484 | @item @code{:html-mathjax-template} @tab @code{org-html-mathjax-template} | ||
| 14485 | @item @code{:html-metadata-timestamp-format} @tab @code{org-html-metadata-timestamp-format} | ||
| 14486 | @item @code{:html-postamble-format} @tab @code{org-html-postamble-format} | ||
| 14487 | @item @code{:html-postamble} @tab @code{org-html-postamble} | ||
| 14488 | @item @code{:html-preamble-format} @tab @code{org-html-preamble-format} | ||
| 14489 | @item @code{:html-preamble} @tab @code{org-html-preamble} | ||
| 14490 | @item @code{:html-table-align-individual-fields} @tab @code{org-html-table-align-individual-fields} | ||
| 14491 | @item @code{:html-table-attributes} @tab @code{org-html-table-default-attributes} | ||
| 14492 | @item @code{:html-table-caption-above} @tab @code{org-html-table-caption-above} | ||
| 14493 | @item @code{:html-table-data-tags} @tab @code{org-html-table-data-tags} | ||
| 14494 | @item @code{:html-table-header-tags} @tab @code{org-html-table-header-tags} | ||
| 14495 | @item @code{:html-table-row-tags} @tab @code{org-html-table-row-tags} | ||
| 14496 | @item @code{:html-table-use-header-tags-for-first-column} @tab @code{org-html-table-use-header-tags-for-first-column} | ||
| 14497 | @item @code{:html-tag-class-prefix} @tab @code{org-html-tag-class-prefix} | ||
| 14498 | @item @code{:html-text-markup-alist} @tab @code{org-html-text-markup-alist} | ||
| 14499 | @item @code{:html-todo-kwd-class-prefix} @tab @code{org-html-todo-kwd-class-prefix} | ||
| 14500 | @item @code{:html-toplevel-hlevel} @tab @code{org-html-toplevel-hlevel} | ||
| 14501 | @item @code{:html-use-infojs} @tab @code{org-html-use-infojs} | ||
| 14502 | @item @code{:html-validation-link} @tab @code{org-html-validation-link} | ||
| 14503 | @item @code{:html-viewport} @tab @code{org-html-viewport} | ||
| 14504 | @item @code{:html-xml-declaration} @tab @code{org-html-xml-declaration} | ||
| 13730 | @end multitable | 14505 | @end multitable |
| 13731 | 14506 | ||
| 13732 | Most of the @code{org-export-with-*} variables have the same effect in each | 14507 | @subsubheading @LaTeX{} specific properties |
| 13733 | exporter. | 14508 | |
| 14509 | @multitable {@code{:latex-link-with-unknown-path-format}} {@code{org-latex-link-with-unknown-path-format}} | ||
| 14510 | @item @code{:latex-active-timestamp-format} @tab @code{org-latex-active-timestamp-format} | ||
| 14511 | @item @code{:latex-caption-above} @tab @code{org-latex-caption-above} | ||
| 14512 | @item @code{:latex-classes} @tab @code{org-latex-classes} | ||
| 14513 | @item @code{:latex-class} @tab @code{org-latex-default-class} | ||
| 14514 | @item @code{:latex-compiler} @tab @code{org-latex-compiler} | ||
| 14515 | @item @code{:latex-default-figure-position} @tab @code{org-latex-default-figure-position} | ||
| 14516 | @item @code{:latex-default-table-environment} @tab @code{org-latex-default-table-environment} | ||
| 14517 | @item @code{:latex-default-table-mode} @tab @code{org-latex-default-table-mode} | ||
| 14518 | @item @code{:latex-diary-timestamp-format} @tab @code{org-latex-diary-timestamp-format} | ||
| 14519 | @item @code{:latex-footnote-defined-format} @tab @code{org-latex-footnote-defined-format} | ||
| 14520 | @item @code{:latex-footnote-separator} @tab @code{org-latex-footnote-separator} | ||
| 14521 | @item @code{:latex-format-drawer-function} @tab @code{org-latex-format-drawer-function} | ||
| 14522 | @item @code{:latex-format-headline-function} @tab @code{org-latex-format-headline-function} | ||
| 14523 | @item @code{:latex-format-inlinetask-function} @tab @code{org-latex-format-inlinetask-function} | ||
| 14524 | @item @code{:latex-hyperref-template} @tab @code{org-latex-hyperref-template} | ||
| 14525 | @item @code{:latex-image-default-height} @tab @code{org-latex-image-default-height} | ||
| 14526 | @item @code{:latex-image-default-option} @tab @code{org-latex-image-default-option} | ||
| 14527 | @item @code{:latex-image-default-width} @tab @code{org-latex-image-default-width} | ||
| 14528 | @item @code{:latex-images-centered} @tab @code{org-latex-images-centered} | ||
| 14529 | @item @code{:latex-inactive-timestamp-format} @tab @code{org-latex-inactive-timestamp-format} | ||
| 14530 | @item @code{:latex-inline-image-rules} @tab @code{org-latex-inline-image-rules} | ||
| 14531 | @item @code{:latex-link-with-unknown-path-format} @tab @code{org-latex-link-with-unknown-path-format} | ||
| 14532 | @item @code{:latex-listings-langs} @tab @code{org-latex-listings-langs} | ||
| 14533 | @item @code{:latex-listings-options} @tab @code{org-latex-listings-options} | ||
| 14534 | @item @code{:latex-listings} @tab @code{org-latex-listings} | ||
| 14535 | @item @code{:latex-minted-langs} @tab @code{org-latex-minted-langs} | ||
| 14536 | @item @code{:latex-minted-options} @tab @code{org-latex-minted-options} | ||
| 14537 | @item @code{:latex-prefer-user-labels} @tab @code{org-latex-prefer-user-labels} | ||
| 14538 | @item @code{:latex-subtitle-format} @tab @code{org-latex-subtitle-format} | ||
| 14539 | @item @code{:latex-subtitle-separate} @tab @code{org-latex-subtitle-separate} | ||
| 14540 | @item @code{:latex-table-scientific-notation} @tab @code{org-latex-table-scientific-notation} | ||
| 14541 | @item @code{:latex-tables-booktabs} @tab @code{org-latex-tables-booktabs} | ||
| 14542 | @item @code{:latex-tables-centered} @tab @code{org-latex-tables-centered} | ||
| 14543 | @item @code{:latex-text-markup-alist} @tab @code{org-latex-text-markup-alist} | ||
| 14544 | @item @code{:latex-title-command} @tab @code{org-latex-title-command} | ||
| 14545 | @item @code{:latex-toc-command} @tab @code{org-latex-toc-command} | ||
| 14546 | @end multitable | ||
| 13734 | 14547 | ||
| 13735 | @vindex org-publish-project-alist | 14548 | @subsubheading Markdown specific properties |
| 13736 | When a property is given a value in @code{org-publish-project-alist}, its | 14549 | |
| 13737 | setting overrides the value of the corresponding user variable (if any) | 14550 | @multitable {@code{:md-footnotes-section}} {@code{org-md-footnotes-section}} |
| 13738 | during publishing. Options set within a file (@pxref{Export settings}), | 14551 | @item @code{:md-footnote-format} @tab @code{org-md-footnote-format} |
| 13739 | however, override everything. | 14552 | @item @code{:md-footnotes-section} @tab @code{org-md-footnotes-section} |
| 14553 | @item @code{:md-headline-style} @tab @code{org-md-headline-style} | ||
| 14554 | @end multitable | ||
| 14555 | |||
| 14556 | @subsubheading ODT specific properties | ||
| 14557 | |||
| 14558 | @multitable {@code{:odt-format-inlinetask-function}} {@code{org-odt-format-inlinetask-function}} | ||
| 14559 | @item @code{:odt-content-template-file} @tab @code{org-odt-content-template-file} | ||
| 14560 | @item @code{:odt-display-outline-level} @tab @code{org-odt-display-outline-level} | ||
| 14561 | @item @code{:odt-fontify-srcblocks} @tab @code{org-odt-fontify-srcblocks} | ||
| 14562 | @item @code{:odt-format-drawer-function} @tab @code{org-odt-format-drawer-function} | ||
| 14563 | @item @code{:odt-format-headline-function} @tab @code{org-odt-format-headline-function} | ||
| 14564 | @item @code{:odt-format-inlinetask-function} @tab @code{org-odt-format-inlinetask-function} | ||
| 14565 | @item @code{:odt-inline-formula-rules} @tab @code{org-odt-inline-formula-rules} | ||
| 14566 | @item @code{:odt-inline-image-rules} @tab @code{org-odt-inline-image-rules} | ||
| 14567 | @item @code{:odt-pixels-per-inch} @tab @code{org-odt-pixels-per-inch} | ||
| 14568 | @item @code{:odt-styles-file} @tab @code{org-odt-styles-file} | ||
| 14569 | @item @code{:odt-table-styles} @tab @code{org-odt-table-styles} | ||
| 14570 | @item @code{:odt-use-date-fields} @tab @code{org-odt-use-date-fields} | ||
| 14571 | @end multitable | ||
| 14572 | |||
| 14573 | @subsubheading Texinfo specific properties | ||
| 14574 | |||
| 14575 | @multitable {@code{:texinfo-link-with-unknown-path-format}} {@code{org-texinfo-link-with-unknown-path-format}} | ||
| 14576 | @item @code{:texinfo-active-timestamp-format} @tab @code{org-texinfo-active-timestamp-format} | ||
| 14577 | @item @code{:texinfo-classes} @tab @code{org-texinfo-classes} | ||
| 14578 | @item @code{:texinfo-class} @tab @code{org-texinfo-default-class} | ||
| 14579 | @item @code{:texinfo-def-table-markup} @tab @code{org-texinfo-def-table-markup} | ||
| 14580 | @item @code{:texinfo-diary-timestamp-format} @tab @code{org-texinfo-diary-timestamp-format} | ||
| 14581 | @item @code{:texinfo-filename} @tab @code{org-texinfo-filename} | ||
| 14582 | @item @code{:texinfo-format-drawer-function} @tab @code{org-texinfo-format-drawer-function} | ||
| 14583 | @item @code{:texinfo-format-headline-function} @tab @code{org-texinfo-format-headline-function} | ||
| 14584 | @item @code{:texinfo-format-inlinetask-function} @tab @code{org-texinfo-format-inlinetask-function} | ||
| 14585 | @item @code{:texinfo-inactive-timestamp-format} @tab @code{org-texinfo-inactive-timestamp-format} | ||
| 14586 | @item @code{:texinfo-link-with-unknown-path-format} @tab @code{org-texinfo-link-with-unknown-path-format} | ||
| 14587 | @item @code{:texinfo-node-description-column} @tab @code{org-texinfo-node-description-column} | ||
| 14588 | @item @code{:texinfo-table-scientific-notation} @tab @code{org-texinfo-table-scientific-notation} | ||
| 14589 | @item @code{:texinfo-tables-verbatim} @tab @code{org-texinfo-tables-verbatim} | ||
| 14590 | @item @code{:texinfo-text-markup-alist} @tab @code{org-texinfo-text-markup-alist} | ||
| 14591 | @end multitable | ||
| 13740 | 14592 | ||
| 13741 | @node Publishing links, Sitemap, Publishing options, Configuration | 14593 | @node Publishing links |
| 13742 | @subsection Links between published files | 14594 | @subsection Links between published files |
| 13743 | @cindex links, publishing | 14595 | @cindex links, publishing |
| 13744 | 14596 | ||
| 13745 | To create a link from one Org file to another, you would use something like | 14597 | To create a link from one Org file to another, you would use something like |
| 13746 | @samp{[[file:foo.org][The foo]]} or simply @samp{file:foo.org.} | 14598 | @samp{[[file:foo.org][The foo]]} or simply @samp{file:foo.org} |
| 13747 | (@pxref{Hyperlinks}). When published, this link becomes a link to | 14599 | (@pxref{External links}). When published, this link becomes a link to |
| 13748 | @file{foo.html}. You can thus interlink the pages of your "org web" project | 14600 | @file{foo.html}. You can thus interlink the pages of your ``org web'' |
| 13749 | and the links will work as expected when you publish them to HTML@. If you | 14601 | project and the links will work as expected when you publish them to HTML. |
| 13750 | also publish the Org source file and want to link to it, use an @code{http:} | 14602 | If you also publish the Org source file and want to link to it, use an |
| 13751 | link instead of a @code{file:} link, because @code{file:} links are converted | 14603 | @code{http:} link instead of a @code{file:} link, because @code{file:} links |
| 13752 | to link to the corresponding @file{html} file. | 14604 | are converted to link to the corresponding @file{html} file. |
| 13753 | 14605 | ||
| 13754 | You may also link to related files, such as images. Provided you are careful | 14606 | You may also link to related files, such as images. Provided you are careful |
| 13755 | with relative file names, and provided you have also configured Org to upload | 14607 | with relative file names, and provided you have also configured Org to upload |
| 13756 | the related files, these links will work too. See @ref{Complex example}, for | 14608 | the related files, these links will work too. See @ref{Complex example}, for |
| 13757 | an example of this usage. | 14609 | an example of this usage. |
| 13758 | 14610 | ||
| 13759 | @node Sitemap, Generating an index, Publishing links, Configuration | 14611 | Eventually, links between published documents can contain some search options |
| 14612 | (@pxref{Search options}), which will be resolved to the appropriate location | ||
| 14613 | in the linked file. For example, once published to HTML, the following links | ||
| 14614 | all point to a dedicated anchor in @file{foo.html}. | ||
| 14615 | |||
| 14616 | @example | ||
| 14617 | [[file:foo.org::*heading]] | ||
| 14618 | [[file:foo.org::#custom-id]] | ||
| 14619 | [[file:foo.org::target]] | ||
| 14620 | @end example | ||
| 14621 | |||
| 14622 | @node Sitemap | ||
| 13760 | @subsection Generating a sitemap | 14623 | @subsection Generating a sitemap |
| 13761 | @cindex sitemap, of published pages | 14624 | @cindex sitemap, of published pages |
| 13762 | 14625 | ||
| @@ -13816,7 +14679,7 @@ Defaults to @code{nil}. | |||
| 13816 | 14679 | ||
| 13817 | @end multitable | 14680 | @end multitable |
| 13818 | 14681 | ||
| 13819 | @node Generating an index, , Sitemap, Configuration | 14682 | @node Generating an index |
| 13820 | @subsection Generating an index | 14683 | @subsection Generating an index |
| 13821 | @cindex index, in a publishing project | 14684 | @cindex index, in a publishing project |
| 13822 | 14685 | ||
| @@ -13833,7 +14696,17 @@ The file will be created when first publishing a project with the | |||
| 13833 | "theindex.inc"}. You can then build around this include statement by adding | 14696 | "theindex.inc"}. You can then build around this include statement by adding |
| 13834 | a title, style information, etc. | 14697 | a title, style information, etc. |
| 13835 | 14698 | ||
| 13836 | @node Uploading files, Sample configuration, Configuration, Publishing | 14699 | @cindex #+INDEX |
| 14700 | Index entries are specified with @code{#+INDEX} keyword. An entry that | ||
| 14701 | contains an exclamation mark will create a sub item. | ||
| 14702 | |||
| 14703 | @example | ||
| 14704 | * Curriculum Vitae | ||
| 14705 | #+INDEX: CV | ||
| 14706 | #+INDEX: Application!CV | ||
| 14707 | @end example | ||
| 14708 | |||
| 14709 | @node Uploading files | ||
| 13837 | @section Uploading files | 14710 | @section Uploading files |
| 13838 | @cindex rsync | 14711 | @cindex rsync |
| 13839 | @cindex unison | 14712 | @cindex unison |
| @@ -13866,7 +14739,7 @@ benefit of re-including any changed external files such as source example | |||
| 13866 | files you might include with @code{#+INCLUDE:}. The timestamp mechanism in | 14739 | files you might include with @code{#+INCLUDE:}. The timestamp mechanism in |
| 13867 | Org is not smart enough to detect if included files have been modified. | 14740 | Org is not smart enough to detect if included files have been modified. |
| 13868 | 14741 | ||
| 13869 | @node Sample configuration, Triggering publication, Uploading files, Publishing | 14742 | @node Sample configuration |
| 13870 | @section Sample configuration | 14743 | @section Sample configuration |
| 13871 | 14744 | ||
| 13872 | Below we provide two example configurations. The first one is a simple | 14745 | Below we provide two example configurations. The first one is a simple |
| @@ -13878,7 +14751,7 @@ more complex, with a multi-component project. | |||
| 13878 | * Complex example:: A multi-component publishing example | 14751 | * Complex example:: A multi-component publishing example |
| 13879 | @end menu | 14752 | @end menu |
| 13880 | 14753 | ||
| 13881 | @node Simple example, Complex example, Sample configuration, Sample configuration | 14754 | @node Simple example |
| 13882 | @subsection Example: simple publishing configuration | 14755 | @subsection Example: simple publishing configuration |
| 13883 | 14756 | ||
| 13884 | This example publishes a set of Org files to the @file{public_html} | 14757 | This example publishes a set of Org files to the @file{public_html} |
| @@ -13896,7 +14769,7 @@ directory on the local machine. | |||
| 13896 | type=\"text/css\"/>"))) | 14769 | type=\"text/css\"/>"))) |
| 13897 | @end lisp | 14770 | @end lisp |
| 13898 | 14771 | ||
| 13899 | @node Complex example, , Simple example, Sample configuration | 14772 | @node Complex example |
| 13900 | @subsection Example: complex publishing configuration | 14773 | @subsection Example: complex publishing configuration |
| 13901 | 14774 | ||
| 13902 | This more complicated example publishes an entire website, including | 14775 | This more complicated example publishes an entire website, including |
| @@ -13946,7 +14819,7 @@ right place on the web server, and publishing images to it. | |||
| 13946 | ("website" :components ("orgfiles" "images" "other")))) | 14819 | ("website" :components ("orgfiles" "images" "other")))) |
| 13947 | @end lisp | 14820 | @end lisp |
| 13948 | 14821 | ||
| 13949 | @node Triggering publication, , Sample configuration, Publishing | 14822 | @node Triggering publication |
| 13950 | @section Triggering publication | 14823 | @section Triggering publication |
| 13951 | 14824 | ||
| 13952 | Once properly configured, Org can publish with the following commands: | 14825 | Once properly configured, Org can publish with the following commands: |
| @@ -13970,17 +14843,20 @@ above, or by customizing the variable @code{org-publish-use-timestamps-flag}. | |||
| 13970 | This may be necessary in particular if files include other files via | 14843 | This may be necessary in particular if files include other files via |
| 13971 | @code{#+SETUPFILE:} or @code{#+INCLUDE:}. | 14844 | @code{#+SETUPFILE:} or @code{#+INCLUDE:}. |
| 13972 | 14845 | ||
| 13973 | @comment node-name, next, previous, up | ||
| 13974 | @comment Working With Source Code, Miscellaneous, Publishing, Top | ||
| 13975 | 14846 | ||
| 13976 | @node Working With Source Code, Miscellaneous, Publishing, Top | 14847 | @node Working with source code |
| 13977 | @chapter Working with source code | 14848 | @chapter Working with source code |
| 13978 | @cindex Schulte, Eric | 14849 | @cindex Schulte, Eric |
| 13979 | @cindex Davison, Dan | 14850 | @cindex Davison, Dan |
| 13980 | @cindex source code, working with | 14851 | @cindex source code, working with |
| 13981 | 14852 | ||
| 13982 | Source code can be included in Org mode documents using a @samp{src} block, | 14853 | Source code here refers to any code typed in Org mode documents. Org can |
| 13983 | e.g.: | 14854 | manage source code in any Org file once such code is tagged with begin and |
| 14855 | end markers. Working with source code begins with tagging source code | ||
| 14856 | blocks. Tagged @samp{src} code blocks are not restricted to the preamble or | ||
| 14857 | the end of an Org document; they can go anywhere---with a few exceptions, | ||
| 14858 | such as not inside comments and fixed width areas. Here's a sample | ||
| 14859 | @samp{src} code block in emacs-lisp: | ||
| 13984 | 14860 | ||
| 13985 | @example | 14861 | @example |
| 13986 | #+BEGIN_SRC emacs-lisp | 14862 | #+BEGIN_SRC emacs-lisp |
| @@ -13990,14 +14866,57 @@ e.g.: | |||
| 13990 | #+END_SRC | 14866 | #+END_SRC |
| 13991 | @end example | 14867 | @end example |
| 13992 | 14868 | ||
| 13993 | Org mode provides a number of features for working with live source code, | 14869 | Org can take the code in the block between the @samp{#+BEGIN_SRC} and |
| 13994 | including editing of code blocks in their native major-mode, evaluation of | 14870 | @samp{#+END_SRC} tags, and format, compile, execute, and show the results. |
| 13995 | code blocks, converting code blocks into source files (known as @dfn{tangling} | 14871 | Org can simplify many housekeeping tasks essential to modern code |
| 13996 | in literate programming), and exporting code blocks and their | 14872 | maintenance. That's why these blocks in Org mode literature are sometimes |
| 13997 | results in several formats. This functionality was contributed by Eric | 14873 | referred to as @samp{live code} blocks (as compared to the static text and |
| 13998 | Schulte and Dan Davison, and was originally named Org-babel. | 14874 | documentation around it). Users can control how @samp{live} they want each |
| 13999 | 14875 | block by tweaking the headers for compiling, execution, extraction. | |
| 14000 | The following sections describe Org mode's code block handling facilities. | 14876 | |
| 14877 | Org's @samp{src} code block type is one of many block types, such as quote, | ||
| 14878 | export, verse, latex, example, and verbatim. This section pertains to | ||
| 14879 | @samp{src} code blocks between @samp{#+BEGIN_SRC} and @samp{#+END_SRC} | ||
| 14880 | |||
| 14881 | For editing @samp{src} code blocks, Org provides native Emacs major-modes. | ||
| 14882 | That leverages the latest Emacs features for that source code language mode. | ||
| 14883 | |||
| 14884 | For exporting, Org can then extract @samp{src} code blocks into compilable | ||
| 14885 | source files (in a conversion process known as @dfn{tangling} in literate | ||
| 14886 | programming terminology). | ||
| 14887 | |||
| 14888 | For publishing, Org's back-ends can handle the @samp{src} code blocks and the | ||
| 14889 | text for output to a variety of formats with native syntax highlighting. | ||
| 14890 | |||
| 14891 | For executing the source code in the @samp{src} code blocks, Org provides | ||
| 14892 | facilities that glue the tasks of compiling, collecting the results of the | ||
| 14893 | execution, and inserting them back to the Org file. Besides text output, | ||
| 14894 | results may include links to other data types that Emacs can handle: audio, | ||
| 14895 | video, and graphics. | ||
| 14896 | |||
| 14897 | An important feature of Org's execution of the @samp{src} code blocks is | ||
| 14898 | passing variables, functions, and results between @samp{src} blocks. Such | ||
| 14899 | interoperability uses a common syntax even if these @samp{src} blocks are in | ||
| 14900 | different source code languages. The integration extends to linking the | ||
| 14901 | debugger's error messages to the line in the @samp{src} code block in the Org | ||
| 14902 | file. That should partly explain why this functionality by the original | ||
| 14903 | contributors, Eric Schulte and Dan Davison, was called @samp{Org Babel}. | ||
| 14904 | |||
| 14905 | In literate programming, the main appeal is code and documentation | ||
| 14906 | co-existing in one file. Org mode takes this several steps further. First | ||
| 14907 | by enabling execution, and then by inserting results of that execution back | ||
| 14908 | into the Org file. Along the way, Org provides extensive formatting | ||
| 14909 | features, including handling tables. Org handles multiple source code | ||
| 14910 | languages in one file, and provides a common syntax for passing variables, | ||
| 14911 | functions, and results between @samp{src} code blocks. | ||
| 14912 | |||
| 14913 | Org mode fulfills the promise of easy verification and maintenance of | ||
| 14914 | publishing reproducible research by keeping all these in the same file: text, | ||
| 14915 | data, code, configuration settings of the execution environment, the results | ||
| 14916 | of the execution, and associated narratives, claims, references, and internal | ||
| 14917 | and external links. | ||
| 14918 | |||
| 14919 | Details of Org's facilities for working with source code are shown next. | ||
| 14001 | 14920 | ||
| 14002 | @menu | 14921 | @menu |
| 14003 | * Structure of code blocks:: Code block syntax described | 14922 | * Structure of code blocks:: Code block syntax described |
| @@ -14014,19 +14933,18 @@ The following sections describe Org mode's code block handling facilities. | |||
| 14014 | * Batch execution:: Call functions from the command line | 14933 | * Batch execution:: Call functions from the command line |
| 14015 | @end menu | 14934 | @end menu |
| 14016 | 14935 | ||
| 14017 | @comment node-name, next, previous, up | ||
| 14018 | @comment Structure of code blocks, Editing source code, Working With Source Code, Working With Source Code | ||
| 14019 | 14936 | ||
| 14020 | @node Structure of code blocks, Editing source code, Working With Source Code, Working With Source Code | 14937 | @node Structure of code blocks |
| 14021 | @section Structure of code blocks | 14938 | @section Structure of code blocks |
| 14022 | @cindex code block, structure | 14939 | @cindex code block, structure |
| 14023 | @cindex source code, block structure | 14940 | @cindex source code, block structure |
| 14024 | @cindex #+NAME | 14941 | @cindex #+NAME |
| 14025 | @cindex #+BEGIN_SRC | 14942 | @cindex #+BEGIN_SRC |
| 14026 | 14943 | ||
| 14027 | Live code blocks can be specified with a @samp{src} block or | 14944 | Org offers two ways to structure source code in Org documents: in a |
| 14028 | inline.@footnote{Note that @samp{src} blocks may be inserted using Org mode's | 14945 | @samp{src} block, and directly inline. Both specifications are shown below. |
| 14029 | @ref{Easy Templates} system} The structure of a @samp{src} block is | 14946 | |
| 14947 | A @samp{src} block conforms to this structure: | ||
| 14030 | 14948 | ||
| 14031 | @example | 14949 | @example |
| 14032 | #+NAME: <name> | 14950 | #+NAME: <name> |
| @@ -14035,12 +14953,15 @@ inline.@footnote{Note that @samp{src} blocks may be inserted using Org mode's | |||
| 14035 | #+END_SRC | 14953 | #+END_SRC |
| 14036 | @end example | 14954 | @end example |
| 14037 | 14955 | ||
| 14038 | The @code{#+NAME:} line is optional, and can be used to name the code | 14956 | Org mode's templates system (@pxref{Easy templates}) speeds up creating |
| 14039 | block. Live code blocks require that a language be specified on the | 14957 | @samp{src} code blocks with just three keystrokes. Do not be put-off by |
| 14040 | @code{#+BEGIN_SRC} line. Switches and header arguments are optional. | 14958 | having to remember the source block syntax. Org also works with other |
| 14041 | @cindex source code, inline | 14959 | completion systems in Emacs, some of which predate Org and have custom |
| 14960 | domain-specific languages for defining templates. Regular use of templates | ||
| 14961 | reduces errors, increases accuracy, and maintains consistency. | ||
| 14042 | 14962 | ||
| 14043 | Live code blocks can also be specified inline using | 14963 | @cindex source code, inline |
| 14964 | An inline code block conforms to this structure: | ||
| 14044 | 14965 | ||
| 14045 | @example | 14966 | @example |
| 14046 | src_<language>@{<body>@} | 14967 | src_<language>@{<body>@} |
| @@ -14053,36 +14974,39 @@ src_<language>[<header arguments>]@{<body>@} | |||
| 14053 | @end example | 14974 | @end example |
| 14054 | 14975 | ||
| 14055 | @table @code | 14976 | @table @code |
| 14056 | @item <#+NAME: name> | 14977 | @item #+NAME: <name> |
| 14057 | This line associates a name with the code block. This is similar to the | 14978 | Optional. Names the @samp{src} block so it can be called, like a function, |
| 14058 | @code{#+NAME: Name} lines that can be used to name tables in Org mode | 14979 | from other @samp{src} blocks or inline blocks to evaluate or to capture the |
| 14059 | files. Referencing the name of a code block makes it possible to evaluate | 14980 | results. Code from other blocks, other files, and from table formulas |
| 14060 | the block from other places in the file, from other files, or from Org mode | 14981 | (@pxref{The spreadsheet}) can use the name to reference a @samp{src} block. |
| 14061 | table formulas (see @ref{The spreadsheet}). Names are assumed to be unique | 14982 | This naming serves the same purpose as naming Org tables. Org mode requires |
| 14062 | and the behavior of Org mode when two or more blocks share the same name is | 14983 | unique names. For duplicate names, Org mode's behavior is undefined. |
| 14063 | undefined. | ||
| 14064 | @cindex #+NAME | 14984 | @cindex #+NAME |
| 14985 | @item #+BEGIN_SRC | ||
| 14986 | @item #+END_SRC | ||
| 14987 | Mandatory. They mark the start and end of a block that Org requires. The | ||
| 14988 | @code{#+BEGIN_SRC} line takes additional arguments, as described next. | ||
| 14989 | @cindex begin block, end block | ||
| 14065 | @item <language> | 14990 | @item <language> |
| 14066 | The language of the code in the block (see @ref{Languages}). | 14991 | Mandatory for live code blocks. It is the identifier of the source code |
| 14992 | language in the block. @xref{Languages}, for identifiers of supported | ||
| 14993 | languages. | ||
| 14067 | @cindex source code, language | 14994 | @cindex source code, language |
| 14068 | @item <switches> | 14995 | @item <switches> |
| 14069 | Optional switches control code block export (see the discussion of switches in | 14996 | Optional. Switches provide finer control of the code execution, export, and |
| 14070 | @ref{Literal examples}) | 14997 | format (see the discussion of switches in @ref{Literal examples}) |
| 14071 | @cindex source code, switches | 14998 | @cindex source code, switches |
| 14072 | @item <header arguments> | 14999 | @item <header arguments> |
| 14073 | Optional header arguments control many aspects of evaluation, export and | 15000 | Optional. Heading arguments control many aspects of evaluation, export and |
| 14074 | tangling of code blocks (see @ref{Header arguments}). | 15001 | tangling of code blocks (@pxref{Header arguments}). Using Org's properties |
| 14075 | Header arguments can also be set on a per-buffer or per-subtree | 15002 | feature, header arguments can be selectively applied to the entire buffer or |
| 14076 | basis using properties. | 15003 | specific sub-trees of the Org document. |
| 14077 | @item source code, header arguments | 15004 | @item source code, header arguments |
| 14078 | @item <body> | 15005 | @item <body> |
| 14079 | Source code in the specified language. | 15006 | Source code in the dialect of the specified language identifier. |
| 14080 | @end table | 15007 | @end table |
| 14081 | 15008 | ||
| 14082 | @comment node-name, next, previous, up | 15009 | @node Editing source code |
| 14083 | @comment Editing source code, Exporting code blocks, Structure of code blocks, Working With Source Code | ||
| 14084 | |||
| 14085 | @node Editing source code, Exporting code blocks, Structure of code blocks, Working With Source Code | ||
| 14086 | @section Editing source code | 15010 | @section Editing source code |
| 14087 | @cindex code block, editing | 15011 | @cindex code block, editing |
| 14088 | @cindex source code, editing | 15012 | @cindex source code, editing |
| @@ -14090,116 +15014,150 @@ Source code in the specified language. | |||
| 14090 | @vindex org-edit-src-auto-save-idle-delay | 15014 | @vindex org-edit-src-auto-save-idle-delay |
| 14091 | @vindex org-edit-src-turn-on-auto-save | 15015 | @vindex org-edit-src-turn-on-auto-save |
| 14092 | @kindex C-c ' | 15016 | @kindex C-c ' |
| 14093 | Use @kbd{C-c '} to edit the current code block. This brings up a language | 15017 | @kbd{C-c '} for editing the current code block. It opens a new major-mode |
| 14094 | major-mode edit buffer containing the body of the code block. Manually | 15018 | edit buffer containing the body of the @samp{src} code block, ready for any |
| 14095 | saving this buffer with @key{C-x C-s} will write the contents back to the Org | 15019 | edits. @kbd{C-c '} again to close the buffer and return to the Org buffer. |
| 14096 | buffer. You can also set @code{org-edit-src-auto-save-idle-delay} to save the | 15020 | |
| 14097 | base buffer after some idle delay, or @code{org-edit-src-turn-on-auto-save} | 15021 | @key{C-x C-s} saves the buffer and updates the contents of the Org buffer. |
| 14098 | to auto-save this buffer into a separate file using @code{auto-save-mode}. | 15022 | |
| 14099 | Use @kbd{C-c '} again to exit. | 15023 | Set @code{org-edit-src-auto-save-idle-delay} to save the base buffer after |
| 14100 | 15024 | a certain idle delay time. | |
| 14101 | The @code{org-src-mode} minor mode will be active in the edit buffer. The | 15025 | |
| 14102 | following variables can be used to configure the behavior of the edit | 15026 | Set @code{org-edit-src-turn-on-auto-save} to auto-save this buffer into a |
| 14103 | buffer. See also the customization group @code{org-edit-structure} for | 15027 | separate file using @code{auto-save-mode}. |
| 14104 | further configuration options. | 15028 | |
| 15029 | @kbd{C-c '} to close the major-mode buffer and return back to the Org buffer. | ||
| 15030 | |||
| 15031 | While editing the source code in the major-mode, the @code{org-src-mode} | ||
| 15032 | minor mode remains active. It provides these customization variables as | ||
| 15033 | described below. For even more variables, look in the customization | ||
| 15034 | group @code{org-edit-structure}. | ||
| 14105 | 15035 | ||
| 14106 | @table @code | 15036 | @table @code |
| 14107 | @item org-src-lang-modes | 15037 | @item org-src-lang-modes |
| 14108 | If an Emacs major-mode named @code{<lang>-mode} exists, where | 15038 | If an Emacs major-mode named @code{<lang>-mode} exists, where @code{<lang>} |
| 14109 | @code{<lang>} is the language named in the header line of the code block, | 15039 | is the language identifier from code block's header line, then the edit |
| 14110 | then the edit buffer will be placed in that major-mode. This variable | 15040 | buffer uses that major-mode. Use this variable to arbitrarily map language |
| 14111 | can be used to map arbitrary language names to existing major modes. | 15041 | identifiers to major modes. |
| 14112 | @item org-src-window-setup | 15042 | @item org-src-window-setup |
| 14113 | Controls the way Emacs windows are rearranged when the edit buffer is created. | 15043 | For specifying Emacs window arrangement when the new edit buffer is created. |
| 14114 | @item org-src-preserve-indentation | 15044 | @item org-src-preserve-indentation |
| 14115 | By default, the value is @code{nil}, which means that when code blocks are | 15045 | @cindex indentation, in source blocks |
| 14116 | evaluated during export or tangled, they are re-inserted into the code block, | 15046 | Default is @code{nil}. Source code is indented. This indentation applies |
| 14117 | which may replace sequences of spaces with tab characters. When non-nil, | 15047 | during export or tangling, and depending on the context, may alter leading |
| 14118 | whitespace in code blocks will be preserved during export or tangling, | 15048 | spaces and tabs. When non-@code{nil}, source code is aligned with the |
| 14119 | exactly as it appears. This variable is especially useful for tangling | 15049 | leftmost column. No lines are modified during export or tangling, which is |
| 14120 | languages such as Python, in which whitespace indentation in the output is | 15050 | very useful for white-space sensitive languages, such as Python. |
| 14121 | critical. | ||
| 14122 | @item org-src-ask-before-returning-to-edit-buffer | 15051 | @item org-src-ask-before-returning-to-edit-buffer |
| 14123 | By default, Org will ask before returning to an open edit buffer. Set this | 15052 | When @code{nil}, Org returns to the edit buffer without further prompts. The |
| 14124 | variable to @code{nil} to switch without asking. | 15053 | default prompts for a confirmation. |
| 14125 | @end table | 15054 | @end table |
| 14126 | 15055 | ||
| 14127 | To turn on native code fontification in the @emph{Org} buffer, configure the | 15056 | Set @code{org-src-fontify-natively} to non-@code{nil} to turn on native code |
| 14128 | variable @code{org-src-fontify-natively}. | 15057 | fontification in the @emph{Org} buffer. Fontification of @samp{src} code |
| 15058 | blocks can give visual separation of text and code on the display page. To | ||
| 15059 | further customize the appearance of @code{org-block} for specific languages, | ||
| 15060 | customize @code{org-src-block-faces}. The following example shades the | ||
| 15061 | background of regular blocks, and colors source blocks only for Python and | ||
| 15062 | Emacs-Lisp languages. | ||
| 15063 | @lisp | ||
| 15064 | (require 'color) | ||
| 15065 | (set-face-attribute 'org-block nil :background | ||
| 15066 | (color-darken-name | ||
| 15067 | (face-attribute 'default :background) 3)) | ||
| 14129 | 15068 | ||
| 14130 | @comment node-name, next, previous, up | 15069 | (setq org-src-block-faces '(("emacs-lisp" (:background "#EEE2FF")) |
| 14131 | @comment Exporting code blocks, Extracting source code, Editing source code, Working With Source Code | 15070 | ("python" (:background "#E5FFB8")))) |
| 15071 | @end lisp | ||
| 14132 | 15072 | ||
| 14133 | @node Exporting code blocks, Extracting source code, Editing source code, Working With Source Code | 15073 | @node Exporting code blocks |
| 14134 | @section Exporting code blocks | 15074 | @section Exporting code blocks |
| 14135 | @cindex code block, exporting | 15075 | @cindex code block, exporting |
| 14136 | @cindex source code, exporting | 15076 | @cindex source code, exporting |
| 14137 | 15077 | ||
| 14138 | It is possible to export the @emph{code} of code blocks, the @emph{results} | 15078 | Org can flexibly export just the @emph{code} from the code blocks, just the |
| 14139 | of code block evaluation, @emph{both} the code and the results of code block | 15079 | @emph{results} of evaluation of the code block, @emph{both} the code and the |
| 14140 | evaluation, or @emph{none}. For most languages, the default exports code. | 15080 | results of the code block evaluation, or @emph{none}. Org defaults to |
| 14141 | However, for some languages (e.g., @code{ditaa}) the default exports the | 15081 | exporting @emph{code} for most languages. For some languages, such as |
| 14142 | results of code block evaluation. For information on exporting code block | 15082 | @code{ditaa}, Org defaults to @emph{results}. To export just the body of |
| 14143 | bodies, see @ref{Literal examples}. | 15083 | code blocks, @pxref{Literal examples}. To selectively export sub-trees of |
| 15084 | an Org document, @pxref{Exporting}. | ||
| 14144 | 15085 | ||
| 14145 | The @code{:exports} header argument can be used to specify export | 15086 | The @code{:exports} header arguments control exporting code blocks only and |
| 14146 | behavior: | 15087 | not inline code: |
| 14147 | 15088 | ||
| 14148 | @subsubheading Header arguments: | 15089 | @subsubheading Header arguments: |
| 14149 | 15090 | ||
| 14150 | @table @code | 15091 | @table @code |
| 15092 | @cindex @code{:exports}, src header argument | ||
| 14151 | @item :exports code | 15093 | @item :exports code |
| 14152 | The default in most languages. The body of the code block is exported, as | 15094 | This is the default for most languages where the body of the code block is |
| 14153 | described in @ref{Literal examples}. | 15095 | exported. See @ref{Literal examples} for more. |
| 14154 | @item :exports results | 15096 | @item :exports results |
| 14155 | The code block will be evaluated and the results will be placed in the | 15097 | On export, Org includes only the results and not the code block. After each |
| 14156 | Org mode buffer for export, either updating previous results of the code | 15098 | evaluation, Org inserts the results after the end of code block in the Org |
| 14157 | block located anywhere in the buffer or, if no previous results exist, | 15099 | buffer. By default, Org replaces any previous results. Org can also append |
| 14158 | placing the results immediately after the code block. The body of the code | 15100 | results. |
| 14159 | block will not be exported. | ||
| 14160 | @item :exports both | 15101 | @item :exports both |
| 14161 | Both the code block and its results will be exported. | 15102 | Org exports both the code block and the results. |
| 14162 | @item :exports none | 15103 | @item :exports none |
| 14163 | Neither the code block nor its results will be exported. | 15104 | Org does not export the code block nor the results. |
| 14164 | @end table | 15105 | @end table |
| 14165 | 15106 | ||
| 14166 | It is possible to inhibit the evaluation of code blocks during export. | 15107 | @vindex org-export-babel-evaluate |
| 14167 | Setting the @code{org-export-babel-evaluate} variable to @code{nil} will | 15108 | To stop Org from evaluating code blocks during export, set |
| 14168 | ensure that no code blocks are evaluated as part of the export process. This | 15109 | @code{org-export-babel-evaluate} variable to @code{nil}. |
| 14169 | can be useful in situations where potentially untrusted Org mode files are | 15110 | |
| 14170 | exported in an automated fashion, for example when Org mode is used as the | 15111 | Turning off evaluation comes in handy when batch processing. For example, |
| 14171 | markup language for a wiki. It is also possible to set this variable to | 15112 | markup languages for wikis, which have a high risk of untrusted code. |
| 14172 | @code{'inline-only}. In that case, only inline code blocks will be | 15113 | Stopping code block evaluation also stops evaluation of all header arguments |
| 14173 | evaluated, in order to insert their results. Non-inline code blocks are | 15114 | of the code block. This may not be desirable in some circumstances. So |
| 14174 | assumed to have their results already inserted in the buffer by manual | 15115 | during export, to allow evaluation of just the header arguments but not any |
| 14175 | evaluation. This setting is useful to avoid expensive recalculations during | 15116 | code evaluation in the source block, set @code{:eval never-export} |
| 14176 | export, not to provide security. | 15117 | (@pxref{eval}). |
| 14177 | 15118 | ||
| 14178 | @comment node-name, next, previous, up | 15119 | To evaluate just the inline code blocks, set @code{org-export-babel-evaluate} |
| 14179 | @comment Extracting source code, Evaluating code blocks, Exporting code blocks, Working With Source Code | 15120 | to @code{inline-only}. Isolating the option to allow inline evaluations |
| 14180 | @node Extracting source code, Evaluating code blocks, Exporting code blocks, Working With Source Code | 15121 | separate from @samp{src} code block evaluations during exports is not for |
| 15122 | security but for avoiding any delays due to recalculations, such as calls to | ||
| 15123 | a remote database. | ||
| 15124 | |||
| 15125 | Org never evaluates code blocks in commented sub-trees when exporting | ||
| 15126 | (@pxref{Comment lines}). On the other hand, Org does evaluate code blocks in | ||
| 15127 | sub-trees excluded from export (@pxref{Export settings}). | ||
| 15128 | |||
| 15129 | @node Extracting source code | ||
| 14181 | @section Extracting source code | 15130 | @section Extracting source code |
| 14182 | @cindex tangling | 15131 | @cindex tangling |
| 14183 | @cindex source code, extracting | 15132 | @cindex source code, extracting |
| 14184 | @cindex code block, extracting source code | 15133 | @cindex code block, extracting source code |
| 14185 | 15134 | ||
| 14186 | Creating pure source code files by extracting code from source blocks is | 15135 | Extracting source code from code blocks is a basic task in literate |
| 14187 | referred to as ``tangling''---a term adopted from the literate programming | 15136 | programming. Org has features to make this easy. In literate programming |
| 14188 | community. During ``tangling'' of code blocks their bodies are expanded | 15137 | parlance, documents on creation are @emph{woven} with code and documentation, |
| 14189 | using @code{org-babel-expand-src-block} which can expand both variable and | 15138 | and on export, the code is @emph{tangled} for execution by a computer. Org |
| 14190 | ``noweb'' style references (see @ref{Noweb reference syntax}). | 15139 | facilitates weaving and tangling for producing, maintaining, sharing, and |
| 15140 | exporting literate programming documents. Org provides extensive | ||
| 15141 | customization options for extracting source code. | ||
| 15142 | |||
| 15143 | When Org tangles @samp{src} code blocks, it expands, merges, and transforms | ||
| 15144 | them. Then Org recomposes them into one or more separate files, as | ||
| 15145 | configured through the options. During this @emph{tangling} process, Org | ||
| 15146 | expands variables in the source code, and resolves any ``noweb'' style | ||
| 15147 | references (@pxref{Noweb reference syntax}). | ||
| 14191 | 15148 | ||
| 14192 | @subsubheading Header arguments | 15149 | @subsubheading Header arguments |
| 14193 | 15150 | ||
| 14194 | @table @code | 15151 | @table @code |
| 15152 | @cindex @code{:tangle}, src header argument | ||
| 14195 | @item :tangle no | 15153 | @item :tangle no |
| 14196 | The default. The code block is not included in the tangled output. | 15154 | By default, Org does not tangle the @samp{src} code block on export. |
| 14197 | @item :tangle yes | 15155 | @item :tangle yes |
| 14198 | Include the code block in the tangled output. The output file name is the | 15156 | Org extracts the contents of the code block for the tangled output. By |
| 14199 | name of the org file with the extension @samp{.org} replaced by the extension | 15157 | default, the output file name is the same as the Org file but with a file |
| 14200 | for the block language. | 15158 | extension derived from the language identifier of the @samp{src} code block. |
| 14201 | @item :tangle filename | 15159 | @item :tangle filename |
| 14202 | Include the code block in the tangled output to file @samp{filename}. | 15160 | Override the default file name with this one for the tangled output. |
| 14203 | @end table | 15161 | @end table |
| 14204 | 15162 | ||
| 14205 | @kindex C-c C-v t | 15163 | @kindex C-c C-v t |
| @@ -14209,7 +15167,7 @@ Include the code block in the tangled output to file @samp{filename}. | |||
| 14209 | @item org-babel-tangle | 15167 | @item org-babel-tangle |
| 14210 | Tangle the current file. Bound to @kbd{C-c C-v t}. | 15168 | Tangle the current file. Bound to @kbd{C-c C-v t}. |
| 14211 | 15169 | ||
| 14212 | With prefix argument only tangle the current code block. | 15170 | With prefix argument only tangle the current @samp{src} code block. |
| 14213 | @item org-babel-tangle-file | 15171 | @item org-babel-tangle-file |
| 14214 | Choose a file to tangle. Bound to @kbd{C-c C-v f}. | 15172 | Choose a file to tangle. Bound to @kbd{C-c C-v f}. |
| 14215 | @end table | 15173 | @end table |
| @@ -14218,72 +15176,67 @@ Choose a file to tangle. Bound to @kbd{C-c C-v f}. | |||
| 14218 | 15176 | ||
| 14219 | @table @code | 15177 | @table @code |
| 14220 | @item org-babel-post-tangle-hook | 15178 | @item org-babel-post-tangle-hook |
| 14221 | This hook is run from within code files tangled by @code{org-babel-tangle}. | 15179 | This hook runs from within code tangled by @code{org-babel-tangle}, making it |
| 14222 | Example applications could include post-processing, compilation or evaluation | 15180 | suitable for post-processing, compilation, and evaluation of code in the |
| 14223 | of tangled code files. | 15181 | tangled files. |
| 14224 | @end table | 15182 | @end table |
| 14225 | 15183 | ||
| 14226 | @subsubheading Jumping between code and Org | 15184 | @subsubheading Jumping between code and Org |
| 14227 | 15185 | ||
| 14228 | When tangling code from an Org-mode buffer to a source code file, you'll | 15186 | Debuggers normally link errors and messages back to the source code. But for |
| 14229 | frequently find yourself viewing the file of tangled source code (e.g., many | 15187 | tangled files, we want to link back to the Org file, not to the tangled |
| 14230 | debuggers point to lines of the source code file). It is useful to be able | 15188 | source file. To make this extra jump, Org uses |
| 14231 | to navigate from the tangled source to the Org-mode buffer from which the | 15189 | @code{org-babel-tangle-jump-to-org} function with two additional source code |
| 14232 | code originated. | 15190 | block header arguments: One, set @code{padline} (@pxref{padline}) to true |
| 14233 | 15191 | (the default setting). Two, set @code{comments} (@pxref{comments}) to | |
| 14234 | The @code{org-babel-tangle-jump-to-org} function provides this jumping from | 15192 | @code{link}, which makes Org insert links to the Org file. |
| 14235 | code to Org-mode functionality. Two header arguments are required for | ||
| 14236 | jumping to work, first the @code{padline} (@ref{padline}) option must be set | ||
| 14237 | to true (the default setting), second the @code{comments} (@ref{comments}) | ||
| 14238 | header argument must be set to @code{links}, which will insert comments into | ||
| 14239 | the source code buffer which point back to the original Org-mode file. | ||
| 14240 | 15193 | ||
| 14241 | @node Evaluating code blocks, Library of Babel, Extracting source code, Working With Source Code | 15194 | @node Evaluating code blocks |
| 14242 | @section Evaluating code blocks | 15195 | @section Evaluating code blocks |
| 14243 | @cindex code block, evaluating | 15196 | @cindex code block, evaluating |
| 14244 | @cindex source code, evaluating | 15197 | @cindex source code, evaluating |
| 14245 | @cindex #+RESULTS | 15198 | @cindex #+RESULTS |
| 14246 | 15199 | ||
| 14247 | Code blocks can be evaluated@footnote{Whenever code is evaluated there is a | 15200 | A note about security: With code evaluation comes the risk of harm. Org |
| 14248 | potential for that code to do harm. Org mode provides safeguards to ensure | 15201 | safeguards by prompting for user's permission before executing any code in |
| 14249 | that code is only evaluated after explicit confirmation from the user. For | 15202 | the source block. To customize this safeguard (or disable it) see @ref{Code |
| 14250 | information on these safeguards (and on how to disable them) see @ref{Code | 15203 | evaluation security}. |
| 14251 | evaluation security}.} and the results of evaluation optionally placed in the | 15204 | |
| 14252 | Org mode buffer. The results of evaluation are placed following a line that | 15205 | Org captures the results of the @samp{src} code block evaluation and inserts |
| 14253 | begins by default with @code{#+RESULTS} and optionally a cache identifier | 15206 | them in the Org file, right after the @samp{src} code block. The insertion |
| 14254 | and/or the name of the evaluated code block. The default value of | 15207 | point is after a newline and the @code{#+RESULTS} label. Org creates the |
| 14255 | @code{#+RESULTS} can be changed with the customizable variable | 15208 | @code{#+RESULTS} label if one is not already there. |
| 14256 | @code{org-babel-results-keyword}. | 15209 | |
| 14257 | 15210 | By default, Org enables only @code{emacs-lisp} @samp{src} code blocks for | |
| 14258 | By default, the evaluation facility is only enabled for Lisp code blocks | 15211 | execution. See @ref{Languages} for identifiers to enable other languages. |
| 14259 | specified as @code{emacs-lisp}. However, source code blocks in many languages | ||
| 14260 | can be evaluated within Org mode (see @ref{Languages} for a list of supported | ||
| 14261 | languages and @ref{Structure of code blocks} for information on the syntax | ||
| 14262 | used to define a code block). | ||
| 14263 | 15212 | ||
| 14264 | @kindex C-c C-c | 15213 | @kindex C-c C-c |
| 14265 | There are a number of ways to evaluate code blocks. The simplest is to press | 15214 | Org provides many ways to execute @samp{src} code blocks. @kbd{C-c C-c} or |
| 14266 | @kbd{C-c C-c} or @kbd{C-c C-v e} with the point on a code block@footnote{The | 15215 | @kbd{C-c C-v e} with the point on a @samp{src} code block@footnote{The option |
| 14267 | option @code{org-babel-no-eval-on-ctrl-c-ctrl-c} can be used to remove code | 15216 | @code{org-babel-no-eval-on-ctrl-c-ctrl-c} can be used to remove code |
| 14268 | evaluation from the @kbd{C-c C-c} key binding.}. This will call the | 15217 | evaluation from the @kbd{C-c C-c} key binding.} calls the |
| 14269 | @code{org-babel-execute-src-block} function to evaluate the block and insert | 15218 | @code{org-babel-execute-src-block} function, which executes the code in the |
| 14270 | its results into the Org mode buffer. | 15219 | block, collects the results, and inserts them in the buffer. |
| 14271 | @cindex #+CALL | ||
| 14272 | 15220 | ||
| 14273 | It is also possible to evaluate named code blocks from anywhere in an Org | 15221 | @cindex #+CALL |
| 14274 | mode buffer or an Org mode table. Live code blocks located in the current | 15222 | By calling a named code block@footnote{Actually, the constructs call_<name>() |
| 14275 | Org mode buffer or in the ``Library of Babel'' (see @ref{Library of Babel}) | 15223 | and src_<lang>@{@} are not evaluated when they appear in a keyword line |
| 14276 | can be executed. Named code blocks can be executed with a separate | 15224 | (i.e. lines starting with @code{#+KEYWORD:}, @pxref{In-buffer settings}).} |
| 14277 | @code{#+CALL:} line or inline within a block of text. | 15225 | from an Org mode buffer or a table. Org can call the named @samp{src} code |
| 15226 | blocks from the current Org mode buffer or from the ``Library of Babel'' | ||
| 15227 | (@pxref{Library of Babel}). Whether inline syntax or the @code{#+CALL:} | ||
| 15228 | syntax is used, the result is wrapped based on the variable | ||
| 15229 | @code{org-babel-inline-result-wrap}, which by default is set to @code{"=%s="} | ||
| 15230 | to produce verbatim text suitable for markup. | ||
| 14278 | 15231 | ||
| 14279 | The syntax of the @code{#+CALL:} line is | 15232 | The syntax for @code{#+CALL:} is |
| 14280 | 15233 | ||
| 14281 | @example | 15234 | @example |
| 14282 | #+CALL: <name>(<arguments>) | 15235 | #+CALL: <name>(<arguments>) |
| 14283 | #+CALL: <name>[<inside header arguments>](<arguments>) <end header arguments> | 15236 | #+CALL: <name>[<inside header arguments>](<arguments>) <end header arguments> |
| 14284 | @end example | 15237 | @end example |
| 14285 | 15238 | ||
| 14286 | The syntax for inline evaluation of named code blocks is | 15239 | The syntax for inline named code block is |
| 14287 | 15240 | ||
| 14288 | @example | 15241 | @example |
| 14289 | ... call_<name>(<arguments>) ... | 15242 | ... call_<name>(<arguments>) ... |
| @@ -14292,98 +15245,88 @@ The syntax for inline evaluation of named code blocks is | |||
| 14292 | 15245 | ||
| 14293 | @table @code | 15246 | @table @code |
| 14294 | @item <name> | 15247 | @item <name> |
| 14295 | The name of the code block to be evaluated (see @ref{Structure of code blocks}). | 15248 | This is the name of the code block to be evaluated (@pxref{Structure of |
| 15249 | code blocks}). | ||
| 14296 | @item <arguments> | 15250 | @item <arguments> |
| 14297 | Arguments specified in this section will be passed to the code block. These | 15251 | Org passes arguments to the code block using standard function call syntax. |
| 14298 | arguments use standard function call syntax, rather than | 15252 | For example, a @code{#+CALL:} line that passes @samp{4} to a code block named |
| 14299 | header argument syntax. For example, a @code{#+CALL:} line that passes the | 15253 | @code{double}, which declares the header argument @code{:var n=2}, would be |
| 14300 | number four to a code block named @code{double}, which declares the header | 15254 | written as @code{#+CALL: double(n=4)}. Note how this function call syntax is |
| 14301 | argument @code{:var n=2}, would be written as @code{#+CALL: double(n=4)}. | 15255 | different from the header argument syntax. |
| 14302 | @item <inside header arguments> | 15256 | @item <inside header arguments> |
| 14303 | Inside header arguments are passed through and applied to the named code | 15257 | Org passes inside header arguments to the named @samp{src} code block using |
| 14304 | block. These arguments use header argument syntax rather than standard | 15258 | the header argument syntax. Inside header arguments apply to code block |
| 14305 | function call syntax. Inside header arguments affect how the code block is | 15259 | evaluation. For example, @code{[:results output]} collects results printed |
| 14306 | evaluated. For example, @code{[:results output]} will collect the results of | 15260 | to @code{STDOUT} during code execution of that block. Note how this header |
| 14307 | everything printed to @code{STDOUT} during execution of the code block. | 15261 | argument syntax is different from the function call syntax. |
| 14308 | @item <end header arguments> | 15262 | @item <end header arguments> |
| 14309 | End header arguments are applied to the calling instance and do not affect | 15263 | End header arguments affect the results returned by the code block. For |
| 14310 | evaluation of the named code block. They affect how the results are | 15264 | example, @code{:results html} wraps the results in a @code{BEGIN_EXPORT html} |
| 14311 | incorporated into the Org mode buffer and how the call line is exported. For | 15265 | block before inserting the results in the Org buffer. |
| 14312 | example, @code{:results html} will insert the results of the call line | 15266 | |
| 14313 | evaluation in the Org buffer, wrapped in a @code{BEGIN_HTML:} block. | 15267 | For more examples of header arguments for @code{#+CALL:} lines, |
| 14314 | 15268 | @pxref{Arguments in function calls}. | |
| 14315 | For more examples of passing header arguments to @code{#+CALL:} lines see | ||
| 14316 | @ref{Header arguments in function calls}. | ||
| 14317 | @end table | 15269 | @end table |
| 14318 | 15270 | ||
| 14319 | @node Library of Babel, Languages, Evaluating code blocks, Working With Source Code | 15271 | @node Library of Babel |
| 14320 | @section Library of Babel | 15272 | @section Library of Babel |
| 14321 | @cindex babel, library of | 15273 | @cindex babel, library of |
| 14322 | @cindex source code, library | 15274 | @cindex source code, library |
| 14323 | @cindex code block, library | 15275 | @cindex code block, library |
| 14324 | 15276 | ||
| 14325 | The ``Library of Babel'' consists of code blocks that can be called from any | 15277 | The ``Library of Babel'' is a collection of code blocks. Like a function |
| 14326 | Org mode file. Code blocks defined in the ``Library of Babel'' can be called | 15278 | library, these code blocks can be called from other Org files. This |
| 14327 | remotely as if they were in the current Org mode buffer (see @ref{Evaluating | 15279 | collection is in a repository file in Org mode format in the @samp{doc} |
| 14328 | code blocks} for information on the syntax of remote code block evaluation). | 15280 | directory of Org mode installation. For remote code block evaluation syntax, |
| 14329 | 15281 | @pxref{Evaluating code blocks}. | |
| 14330 | |||
| 14331 | The central repository of code blocks in the ``Library of Babel'' is housed | ||
| 14332 | in an Org mode file located in the @samp{contrib} directory of Org mode. | ||
| 14333 | |||
| 14334 | Users can add code blocks they believe to be generally useful to their | ||
| 14335 | ``Library of Babel.'' The code blocks can be stored in any Org mode file and | ||
| 14336 | then loaded into the library with @code{org-babel-lob-ingest}. | ||
| 14337 | |||
| 14338 | 15282 | ||
| 14339 | @kindex C-c C-v i | 15283 | @kindex C-c C-v i |
| 14340 | Code blocks located in any Org mode file can be loaded into the ``Library of | 15284 | For any user to add code to the library, first save the code in regular |
| 14341 | Babel'' with the @code{org-babel-lob-ingest} function, bound to @kbd{C-c C-v | 15285 | @samp{src} code blocks of an Org file, and then load the Org file with |
| 14342 | i}. | 15286 | @code{org-babel-lob-ingest}, which is bound to @kbd{C-c C-v i}. |
| 14343 | 15287 | ||
| 14344 | @node Languages, Header arguments, Library of Babel, Working With Source Code | 15288 | @node Languages |
| 14345 | @section Languages | 15289 | @section Languages |
| 14346 | @cindex babel, languages | 15290 | @cindex babel, languages |
| 14347 | @cindex source code, languages | 15291 | @cindex source code, languages |
| 14348 | @cindex code block, languages | 15292 | @cindex code block, languages |
| 14349 | 15293 | ||
| 14350 | Code blocks in the following languages are supported. | 15294 | Org supports the following languages for the @samp{src} code blocks: |
| 14351 | 15295 | ||
| 14352 | @multitable @columnfractions 0.28 0.3 0.22 0.2 | 15296 | @multitable @columnfractions 0.25 0.25 0.25 0.25 |
| 14353 | @item @b{Language} @tab @b{Identifier} @tab @b{Language} @tab @b{Identifier} | 15297 | @headitem @b{Language} @tab @b{Identifier} @tab @b{Language} @tab @b{Identifier} |
| 14354 | @item Asymptote @tab asymptote @tab Awk @tab awk | 15298 | @item Asymptote @tab asymptote @tab Awk @tab awk |
| 14355 | @item Emacs Calc @tab calc @tab C @tab C | 15299 | @item C @tab C @tab C++ @tab C++ |
| 14356 | @item C++ @tab C++ @tab Clojure @tab clojure | 15300 | @item Clojure @tab clojure @tab CSS @tab css |
| 14357 | @item CSS @tab css @tab ditaa @tab ditaa | 15301 | @item D @tab d @tab ditaa @tab ditaa |
| 14358 | @item Graphviz @tab dot @tab Emacs Lisp @tab emacs-lisp | 15302 | @item Graphviz @tab dot @tab Emacs Calc @tab calc |
| 15303 | @item Emacs Lisp @tab emacs-lisp @tab Fortran @tab fortran | ||
| 14359 | @item gnuplot @tab gnuplot @tab Haskell @tab haskell | 15304 | @item gnuplot @tab gnuplot @tab Haskell @tab haskell |
| 14360 | @item Java @tab java @tab @tab | 15305 | @item Java @tab java @tab Javascript @tab js |
| 14361 | @item Javascript @tab js @tab LaTeX @tab latex | 15306 | @item LaTeX @tab latex @tab Ledger @tab ledger |
| 14362 | @item Ledger @tab ledger @tab Lisp @tab lisp | 15307 | @item Lisp @tab lisp @tab Lilypond @tab lilypond |
| 14363 | @item Lilypond @tab lilypond @tab MATLAB @tab matlab | 15308 | @item Lua @tab lua @tab MATLAB @tab matlab |
| 14364 | @item Mscgen @tab mscgen @tab Objective Caml @tab ocaml | 15309 | @item Mscgen @tab mscgen @tab Objective Caml @tab ocaml |
| 14365 | @item Octave @tab octave @tab Org mode @tab org | 15310 | @item Octave @tab octave @tab Org mode @tab org |
| 14366 | @item Oz @tab oz @tab Perl @tab perl | 15311 | @item Oz @tab oz @tab Perl @tab perl |
| 14367 | @item Plantuml @tab plantuml @tab Python @tab python | 15312 | @item Plantuml @tab plantuml @tab Processing.js @tab processing |
| 14368 | @item R @tab R @tab Ruby @tab ruby | 15313 | @item Python @tab python @tab R @tab R |
| 14369 | @item Sass @tab sass @tab Scheme @tab scheme | 15314 | @item Ruby @tab ruby @tab Sass @tab sass |
| 14370 | @item GNU Screen @tab screen @tab shell @tab sh | 15315 | @item Scheme @tab scheme @tab GNU Screen @tab screen |
| 15316 | @item Sed @tab sed @tab shell @tab sh | ||
| 14371 | @item SQL @tab sql @tab SQLite @tab sqlite | 15317 | @item SQL @tab sql @tab SQLite @tab sqlite |
| 14372 | @end multitable | 15318 | @end multitable |
| 14373 | 15319 | ||
| 14374 | Language-specific documentation is available for some languages. If | 15320 | Additional documentation for some languages are at |
| 14375 | available, it can be found at | ||
| 14376 | @uref{http://orgmode.org/worg/org-contrib/babel/languages.html}. | 15321 | @uref{http://orgmode.org/worg/org-contrib/babel/languages.html}. |
| 14377 | 15322 | ||
| 14378 | The option @code{org-babel-load-languages} controls which languages are | 15323 | By default, only @code{emacs-lisp} is enabled for evaluation. To enable or |
| 14379 | enabled for evaluation (by default only @code{emacs-lisp} is enabled). This | 15324 | disable other languages, customize the @code{org-babel-load-languages} |
| 14380 | variable can be set using the customization interface or by adding code like | 15325 | variable either through the Emacs customization interface, or by adding code |
| 14381 | the following to your emacs configuration. | 15326 | to the init file as shown next: |
| 14382 | 15327 | ||
| 14383 | @quotation | 15328 | In this example, evaluation is disabled for @code{emacs-lisp}, and enabled |
| 14384 | The following disables @code{emacs-lisp} evaluation and enables evaluation of | 15329 | for @code{R}. |
| 14385 | @code{R} code blocks. | ||
| 14386 | @end quotation | ||
| 14387 | 15330 | ||
| 14388 | @lisp | 15331 | @lisp |
| 14389 | (org-babel-do-load-languages | 15332 | (org-babel-do-load-languages |
| @@ -14392,55 +15335,54 @@ The following disables @code{emacs-lisp} evaluation and enables evaluation of | |||
| 14392 | (R . t))) | 15335 | (R . t))) |
| 14393 | @end lisp | 15336 | @end lisp |
| 14394 | 15337 | ||
| 14395 | It is also possible to enable support for a language by loading the related | 15338 | Note that this is not the only way to enable a language. Org also enables |
| 14396 | elisp file with @code{require}. | 15339 | languages when loaded with @code{require} statement. For example, the |
| 14397 | 15340 | following enables execution of @code{clojure} code blocks: | |
| 14398 | @quotation | ||
| 14399 | The following adds support for evaluating @code{clojure} code blocks. | ||
| 14400 | @end quotation | ||
| 14401 | 15341 | ||
| 14402 | @lisp | 15342 | @lisp |
| 14403 | (require 'ob-clojure) | 15343 | (require 'ob-clojure) |
| 14404 | @end lisp | 15344 | @end lisp |
| 14405 | 15345 | ||
| 14406 | @node Header arguments, Results of evaluation, Languages, Working With Source Code | 15346 | @node Header arguments |
| 14407 | @section Header arguments | 15347 | @section Header arguments |
| 14408 | @cindex code block, header arguments | 15348 | @cindex code block, header arguments |
| 14409 | @cindex source code, block header arguments | 15349 | @cindex source code, block header arguments |
| 14410 | 15350 | ||
| 14411 | Code block functionality can be configured with header arguments. This | 15351 | Details of configuring header arguments are shown here. |
| 14412 | section provides an overview of the use of header arguments, and then | ||
| 14413 | describes each header argument in detail. | ||
| 14414 | 15352 | ||
| 14415 | @menu | 15353 | @menu |
| 14416 | * Using header arguments:: Different ways to set header arguments | 15354 | * Using header arguments:: Different ways to set header arguments |
| 14417 | * Specific header arguments:: List of header arguments | 15355 | * Specific header arguments:: List of header arguments |
| 14418 | @end menu | 15356 | @end menu |
| 14419 | 15357 | ||
| 14420 | @node Using header arguments, Specific header arguments, Header arguments, Header arguments | 15358 | @node Using header arguments |
| 14421 | @subsection Using header arguments | 15359 | @subsection Using header arguments |
| 14422 | 15360 | ||
| 14423 | The values of header arguments can be set in several way. When the header | 15361 | Since header arguments can be set in several ways, Org prioritizes them in |
| 14424 | arguments in each layer have been determined, they are combined in order from | 15362 | case of overlaps or conflicts by giving local settings a higher priority. |
| 14425 | the first, least specific (having the lowest priority) up to the last, most | 15363 | Header values in function calls, for example, override header values from |
| 14426 | specific (having the highest priority). A header argument with a higher | 15364 | global defaults. |
| 14427 | priority replaces the same header argument specified at lower priority. | ||
| 14428 | @menu | 15365 | @menu |
| 14429 | * System-wide header arguments:: Set global default values | 15366 | * System-wide header arguments:: Set globally, language-specific |
| 14430 | * Language-specific header arguments:: Set default values by language | 15367 | * Language-specific header arguments:: Set in the Org file's headers |
| 14431 | * Header arguments in Org mode properties:: Set default values for a buffer or heading | 15368 | * Header arguments in Org mode properties:: Set in the Org file |
| 14432 | * Language-specific header arguments in Org mode properties:: Set language-specific default values for a buffer or heading | 15369 | * Language-specific mode properties:: |
| 14433 | * Code block specific header arguments:: The most common way to set values | 15370 | * Code block specific header arguments:: The most commonly used method |
| 14434 | * Header arguments in function calls:: The most specific level | 15371 | * Arguments in function calls:: The most specific level, takes highest priority |
| 14435 | @end menu | 15372 | @end menu |
| 14436 | 15373 | ||
| 14437 | 15374 | ||
| 14438 | @node System-wide header arguments, Language-specific header arguments, Using header arguments, Using header arguments | 15375 | @node System-wide header arguments |
| 14439 | @subsubheading System-wide header arguments | 15376 | @subsubheading System-wide header arguments |
| 14440 | @vindex org-babel-default-header-args | 15377 | @vindex org-babel-default-header-args |
| 14441 | System-wide values of header arguments can be specified by adapting the | 15378 | System-wide values of header arguments can be specified by adapting the |
| 14442 | @code{org-babel-default-header-args} variable: | 15379 | @code{org-babel-default-header-args} variable: |
| 14443 | 15380 | ||
| 15381 | @cindex @code{:session}, src header argument | ||
| 15382 | @cindex @code{:results}, src header argument | ||
| 15383 | @cindex @code{:exports}, src header argument | ||
| 15384 | @cindex @code{:cache}, src header argument | ||
| 15385 | @cindex @code{:noweb}, src header argument | ||
| 14444 | @example | 15386 | @example |
| 14445 | :session => "none" | 15387 | :session => "none" |
| 14446 | :results => "replace" | 15388 | :results => "replace" |
| @@ -14449,10 +15391,8 @@ System-wide values of header arguments can be specified by adapting the | |||
| 14449 | :noweb => "no" | 15391 | :noweb => "no" |
| 14450 | @end example | 15392 | @end example |
| 14451 | 15393 | ||
| 14452 | For example, the following example could be used to set the default value of | 15394 | This example sets @code{:noweb} header arguments to @code{yes}, which makes |
| 14453 | @code{:noweb} header arguments to @code{yes}. This would have the effect of | 15395 | Org expand @code{:noweb} references by default. |
| 14454 | expanding @code{:noweb} references by default when evaluating source code | ||
| 14455 | blocks. | ||
| 14456 | 15396 | ||
| 14457 | @lisp | 15397 | @lisp |
| 14458 | (setq org-babel-default-header-args | 15398 | (setq org-babel-default-header-args |
| @@ -14460,48 +15400,40 @@ blocks. | |||
| 14460 | (assq-delete-all :noweb org-babel-default-header-args))) | 15400 | (assq-delete-all :noweb org-babel-default-header-args))) |
| 14461 | @end lisp | 15401 | @end lisp |
| 14462 | 15402 | ||
| 14463 | @node Language-specific header arguments, Header arguments in Org mode properties, System-wide header arguments, Using header arguments | 15403 | @node Language-specific header arguments |
| 14464 | @subsubheading Language-specific header arguments | 15404 | @subsubheading Language-specific header arguments |
| 14465 | Each language can define its own set of default header arguments in variable | 15405 | Each language can have separate default header arguments by customizing the |
| 14466 | @code{org-babel-default-header-args:<lang>}, where @code{<lang>} is the name | 15406 | variable @code{org-babel-default-header-args:<lang>}, where @code{<lang>} is |
| 14467 | of the language. See the language-specific documentation available online at | 15407 | the name of the language. For details, see the language-specific online |
| 14468 | @uref{http://orgmode.org/worg/org-contrib/babel}. | 15408 | documentation at @uref{http://orgmode.org/worg/org-contrib/babel}. |
| 14469 | 15409 | ||
| 14470 | @node Header arguments in Org mode properties, Language-specific header arguments in Org mode properties, Language-specific header arguments, Using header arguments | 15410 | @node Header arguments in Org mode properties |
| 14471 | @subsubheading Header arguments in Org mode properties | 15411 | @subsubheading Header arguments in Org mode properties |
| 14472 | 15412 | ||
| 14473 | Buffer-wide header arguments may be specified as properties through the use | 15413 | For header arguments applicable to the buffer, use @code{#+PROPERTY:} lines |
| 14474 | of @code{#+PROPERTY:} lines placed anywhere in an Org mode file (see | 15414 | anywhere in the Org mode file (@pxref{Property syntax}). |
| 14475 | @ref{Property syntax}). | ||
| 14476 | 15415 | ||
| 14477 | For example the following would set @code{session} to @code{*R*} (only for R | 15416 | The following example sets only for @samp{R} code blocks to @code{session}, |
| 14478 | code blocks), and @code{results} to @code{silent} for every code block in the | 15417 | making all the @samp{R} code blocks execute in the same session. Setting |
| 14479 | buffer, ensuring that all execution took place in the same session, and no | 15418 | @code{results} to @code{silent} ignores the results of executions for all |
| 14480 | results would be inserted into the buffer. | 15419 | blocks, not just @samp{R} code blocks; no results inserted for any block. |
| 14481 | 15420 | ||
| 14482 | @example | 15421 | @example |
| 14483 | #+PROPERTY: header-args:R :session *R* | 15422 | #+PROPERTY: header-args:R :session *R* |
| 14484 | #+PROPERTY: header-args :results silent | 15423 | #+PROPERTY: header-args :results silent |
| 14485 | @end example | 15424 | @end example |
| 14486 | 15425 | ||
| 14487 | Header arguments read from Org mode properties can also be set on a | ||
| 14488 | per-subtree basis using property drawers (see @ref{Property syntax}). | ||
| 14489 | @vindex org-use-property-inheritance | 15426 | @vindex org-use-property-inheritance |
| 14490 | When properties are used to set default header arguments, they are always | 15427 | Header arguments set through Org's property drawers (@pxref{Property syntax}) |
| 14491 | looked up with inheritance, regardless of the value of | 15428 | apply at the sub-tree level on down. Since these property drawers can appear |
| 14492 | @code{org-use-property-inheritance}. Properties are evaluated as seen by the | 15429 | anywhere in the file hierarchy, Org uses outermost call or source block to |
| 14493 | outermost call or source block.@footnote{The deprecated syntax for default | 15430 | resolve the values. Org ignores @code{org-use-property-inheritance} setting. |
| 14494 | header argument properties, using the name of the header argument as a | ||
| 14495 | property name directly, evaluates the property as seen by the corresponding | ||
| 14496 | source block definition. This behavior has been kept for backwards | ||
| 14497 | compatibility.} | ||
| 14498 | 15431 | ||
| 14499 | In the following example the value of | 15432 | In this example, @code{:cache} defaults to @code{yes} for all code blocks in |
| 14500 | the @code{:cache} header argument will default to @code{yes} in all code | 15433 | the sub-tree starting with @samp{sample header}. |
| 14501 | blocks in the subtree rooted at the following heading: | ||
| 14502 | 15434 | ||
| 14503 | @example | 15435 | @example |
| 14504 | * outline header | 15436 | * sample header |
| 14505 | :PROPERTIES: | 15437 | :PROPERTIES: |
| 14506 | :header-args: :cache yes | 15438 | :header-args: :cache yes |
| 14507 | :END: | 15439 | :END: |
| @@ -14509,17 +15441,16 @@ blocks in the subtree rooted at the following heading: | |||
| 14509 | 15441 | ||
| 14510 | @kindex C-c C-x p | 15442 | @kindex C-c C-x p |
| 14511 | @vindex org-babel-default-header-args | 15443 | @vindex org-babel-default-header-args |
| 14512 | Properties defined in this way override the properties set in | 15444 | Properties defined through @code{org-set-property} function, bound to |
| 14513 | @code{org-babel-default-header-args} and are applied for all activated | 15445 | @kbd{C-c C-x p}, apply to all active languages. They override properties set |
| 14514 | languages. It is convenient to use the @code{org-set-property} function | 15446 | in @code{org-babel-default-header-args}. |
| 14515 | bound to @kbd{C-c C-x p} to set properties in Org mode documents. | ||
| 14516 | 15447 | ||
| 14517 | @node Language-specific header arguments in Org mode properties, Code block specific header arguments, Header arguments in Org mode properties, Using header arguments | 15448 | @node Language-specific mode properties |
| 14518 | @subsubheading Language-specific header arguments in Org mode properties | 15449 | @subsubheading Language-specific mode properties |
| 14519 | 15450 | ||
| 14520 | Language-specific header arguments are also read from properties | 15451 | Language-specific header arguments are also read from properties |
| 14521 | @code{header-args:<lang>} where @code{<lang>} is the name of the language | 15452 | @code{header-args:<lang>} where @code{<lang>} is the language identifier. |
| 14522 | targeted. As an example | 15453 | For example, |
| 14523 | 15454 | ||
| 14524 | @example | 15455 | @example |
| 14525 | * Heading | 15456 | * Heading |
| @@ -14533,24 +15464,21 @@ targeted. As an example | |||
| 14533 | :END: | 15464 | :END: |
| 14534 | @end example | 15465 | @end example |
| 14535 | 15466 | ||
| 14536 | would independently set a default session header argument for R and clojure | 15467 | would force separate sessions for clojure blocks in Heading and Subheading, |
| 14537 | for calls and source blocks under subtree ``Heading'' and change to a | 15468 | but use the same session for all @samp{R} blocks. Blocks in Subheading |
| 14538 | different clojure setting for evaluations under subtree ``Subheading'', while | 15469 | inherit settings from Heading. |
| 14539 | the R session is inherited from ``Heading'' and therefore unchanged. | ||
| 14540 | 15470 | ||
| 14541 | @node Code block specific header arguments, Header arguments in function calls, Language-specific header arguments in Org mode properties, Using header arguments | 15471 | @node Code block specific header arguments |
| 14542 | @subsubheading Code block specific header arguments | 15472 | @subsubheading Code block specific header arguments |
| 14543 | 15473 | ||
| 14544 | The most common way to assign values to header arguments is at the | 15474 | Header arguments are most commonly set at the @samp{src} code block level, on |
| 14545 | code block level. This can be done by listing a sequence of header | 15475 | the @code{#+BEGIN_SRC} line. Arguments set at this level take precedence |
| 14546 | arguments and their values as part of the @code{#+BEGIN_SRC} line. | 15476 | over those set in the @code{org-babel-default-header-args} variable, and also |
| 14547 | Properties set in this way override both the values of | 15477 | those set as header properties. |
| 14548 | @code{org-babel-default-header-args} and header arguments specified as | 15478 | |
| 14549 | properties. In the following example, the @code{:results} header argument | 15479 | In the following example, setting @code{results} to @code{silent} makes it |
| 14550 | is set to @code{silent}, meaning the results of execution will not be | 15480 | ignore results of the code execution. Setting @code{:exports} to @code{code} |
| 14551 | inserted in the buffer, and the @code{:exports} header argument is set to | 15481 | exports only the body of the @samp{src} code block to HTML or @LaTeX{}.: |
| 14552 | @code{code}, meaning only the body of the code block will be | ||
| 14553 | preserved on export to HTML or @LaTeX{}. | ||
| 14554 | 15482 | ||
| 14555 | @example | 15483 | @example |
| 14556 | #+NAME: factorial | 15484 | #+NAME: factorial |
| @@ -14559,93 +15487,93 @@ fac 0 = 1 | |||
| 14559 | fac n = n * fac (n-1) | 15487 | fac n = n * fac (n-1) |
| 14560 | #+END_SRC | 15488 | #+END_SRC |
| 14561 | @end example | 15489 | @end example |
| 14562 | Similarly, it is possible to set header arguments for inline code blocks | 15490 | |
| 15491 | The same header arguments in an inline @samp{src} code block: | ||
| 14563 | 15492 | ||
| 14564 | @example | 15493 | @example |
| 14565 | src_haskell[:exports both]@{fac 5@} | 15494 | src_haskell[:exports both]@{fac 5@} |
| 14566 | @end example | 15495 | @end example |
| 14567 | 15496 | ||
| 14568 | Code block header arguments can span multiple lines using @code{#+HEADER:} or | 15497 | Code block header arguments can span multiple lines using @code{#+HEADER:} on |
| 14569 | @code{#+HEADERS:} lines preceding a code block or nested between the | 15498 | each line. Note that Org currently accepts the plural spelling of |
| 14570 | @code{#+NAME:} line and the @code{#+BEGIN_SRC} line of a named code block. | 15499 | @code{#+HEADER:} only as a convenience for backward-compatibility. It may be |
| 15500 | removed at some point. | ||
| 15501 | |||
| 14571 | @cindex #+HEADER: | 15502 | @cindex #+HEADER: |
| 14572 | @cindex #+HEADERS: | ||
| 14573 | 15503 | ||
| 14574 | Multi-line header arguments on an un-named code block: | 15504 | Multi-line header arguments on an unnamed @samp{src} code block: |
| 14575 | 15505 | ||
| 14576 | @example | 15506 | @example |
| 14577 | #+HEADERS: :var data1=1 | 15507 | #+HEADER: :var data1=1 |
| 14578 | #+BEGIN_SRC emacs-lisp :var data2=2 | 15508 | #+BEGIN_SRC emacs-lisp :var data2=2 |
| 14579 | (message "data1:%S, data2:%S" data1 data2) | 15509 | (message "data1:%S, data2:%S" data1 data2) |
| 14580 | #+END_SRC | 15510 | #+END_SRC |
| 14581 | 15511 | ||
| 14582 | #+RESULTS: | 15512 | #+RESULTS: |
| 14583 | : data1:1, data2:2 | 15513 | : data1:1, data2:2 |
| 14584 | @end example | 15514 | @end example |
| 14585 | 15515 | ||
| 14586 | Multi-line header arguments on a named code block: | 15516 | Multi-line header arguments on a named @samp{src} code block: |
| 14587 | 15517 | ||
| 14588 | @example | 15518 | @example |
| 14589 | #+NAME: named-block | 15519 | #+NAME: named-block |
| 14590 | #+HEADER: :var data=2 | 15520 | #+HEADER: :var data=2 |
| 14591 | #+BEGIN_SRC emacs-lisp | 15521 | #+BEGIN_SRC emacs-lisp |
| 14592 | (message "data:%S" data) | 15522 | (message "data:%S" data) |
| 14593 | #+END_SRC | 15523 | #+END_SRC |
| 14594 | 15524 | ||
| 14595 | #+RESULTS: named-block | 15525 | #+RESULTS: named-block |
| 14596 | : data:2 | 15526 | : data:2 |
| 14597 | @end example | 15527 | @end example |
| 14598 | 15528 | ||
| 14599 | @node Header arguments in function calls, , Code block specific header arguments, Using header arguments | 15529 | @node Arguments in function calls |
| 14600 | @comment node-name, next, previous, up | 15530 | @subsubheading Arguments in function calls |
| 14601 | @subsubheading Header arguments in function calls | ||
| 14602 | 15531 | ||
| 14603 | At the most specific level, header arguments for ``Library of Babel'' or | 15532 | Header arguments in function calls are the most specific and override all |
| 14604 | @code{#+CALL:} lines can be set as shown in the two examples below. For more | 15533 | other settings in case of an overlap. They get the highest priority. Two |
| 14605 | information on the structure of @code{#+CALL:} lines see @ref{Evaluating code | 15534 | @code{#+CALL:} examples are shown below. For the complete syntax of |
| 14606 | blocks}. | 15535 | @code{#+CALL:} lines, see @ref{Evaluating code blocks}. |
| 14607 | 15536 | ||
| 14608 | The following will apply the @code{:exports results} header argument to the | 15537 | In this example, @code{:exports results} header argument is applied to the |
| 14609 | evaluation of the @code{#+CALL:} line. | 15538 | evaluation of the @code{#+CALL:} line. |
| 14610 | 15539 | ||
| 14611 | @example | 15540 | @example |
| 14612 | #+CALL: factorial(n=5) :exports results | 15541 | #+CALL: factorial(n=5) :exports results |
| 14613 | @end example | 15542 | @end example |
| 14614 | 15543 | ||
| 14615 | The following will apply the @code{:session special} header argument to the | 15544 | In this example, @code{:session special} header argument is applied to the |
| 14616 | evaluation of the @code{factorial} code block. | 15545 | evaluation of @code{factorial} code block. |
| 14617 | 15546 | ||
| 14618 | @example | 15547 | @example |
| 14619 | #+CALL: factorial[:session special](n=5) | 15548 | #+CALL: factorial[:session special](n=5) |
| 14620 | @end example | 15549 | @end example |
| 14621 | 15550 | ||
| 14622 | @node Specific header arguments, , Using header arguments, Header arguments | 15551 | @node Specific header arguments |
| 14623 | @subsection Specific header arguments | 15552 | @subsection Specific header arguments |
| 14624 | Header arguments consist of an initial colon followed by the name of the | 15553 | Org comes with many header arguments common to all languages. New header |
| 14625 | argument in lowercase letters. The following header arguments are defined: | 15554 | arguments are added for specific languages as they become available for use |
| 15555 | in @samp{src} code blocks. A header argument is specified with an initial | ||
| 15556 | colon followed by the argument's name in lowercase. Common header arguments | ||
| 15557 | are: | ||
| 14626 | 15558 | ||
| 14627 | @menu | 15559 | @menu |
| 14628 | * var:: Pass arguments to code blocks | 15560 | * var:: Pass arguments to @samp{src} code blocks |
| 14629 | * results:: Specify the type of results and how they will | 15561 | * results:: Specify results type; how to collect |
| 14630 | be collected and handled | 15562 | * file:: Specify a path for output file |
| 14631 | * file:: Specify a path for file output | ||
| 14632 | * file-desc:: Specify a description for file results | 15563 | * file-desc:: Specify a description for file results |
| 14633 | * dir:: Specify the default (possibly remote) | 15564 | * file-ext:: Specify an extension for file output |
| 14634 | directory for code block execution | 15565 | * output-dir:: Specify a directory for output file |
| 14635 | * exports:: Export code and/or results | 15566 | * dir:: Specify the default directory for code block execution |
| 14636 | * tangle:: Toggle tangling and specify file name | 15567 | * exports:: Specify exporting code, results, both, none |
| 14637 | * mkdirp:: Toggle creation of parent directories of target | 15568 | * tangle:: Toggle tangling; or specify file name |
| 14638 | files during tangling | 15569 | * mkdirp:: Toggle for parent directory creation for target files during tangling |
| 14639 | * comments:: Toggle insertion of comments in tangled | 15570 | * comments:: Toggle insertion of comments in tangled code files |
| 14640 | code files | 15571 | * padline:: Control insertion of padding lines in tangled code files |
| 14641 | * padline:: Control insertion of padding lines in tangled | 15572 | * no-expand:: Turn off variable assignment and noweb expansion during tangling |
| 14642 | code files | ||
| 14643 | * no-expand:: Turn off variable assignment and noweb | ||
| 14644 | expansion during tangling | ||
| 14645 | * session:: Preserve the state of code evaluation | 15573 | * session:: Preserve the state of code evaluation |
| 14646 | * noweb:: Toggle expansion of noweb references | 15574 | * noweb:: Toggle expansion of noweb references |
| 14647 | * noweb-ref:: Specify block's noweb reference resolution target | 15575 | * noweb-ref:: Specify block's noweb reference resolution target |
| 14648 | * noweb-sep:: String used to separate noweb references | 15576 | * noweb-sep:: String to separate noweb references |
| 14649 | * cache:: Avoid re-evaluating unchanged code blocks | 15577 | * cache:: Avoid re-evaluating unchanged code blocks |
| 14650 | * sep:: Delimiter for writing tabular results outside Org | 15578 | * sep:: Delimiter for writing tabular results outside Org |
| 14651 | * hlines:: Handle horizontal lines in tables | 15579 | * hlines:: Handle horizontal lines in tables |
| @@ -14655,45 +15583,46 @@ argument in lowercase letters. The following header arguments are defined: | |||
| 14655 | * tangle-mode:: Set permission of tangled files | 15583 | * tangle-mode:: Set permission of tangled files |
| 14656 | * eval:: Limit evaluation of specific code blocks | 15584 | * eval:: Limit evaluation of specific code blocks |
| 14657 | * wrap:: Mark source block evaluation results | 15585 | * wrap:: Mark source block evaluation results |
| 14658 | * post:: Post processing of code block results | 15586 | * post:: Post processing of results of code block evaluation |
| 14659 | * prologue:: Text to prepend to code block body | 15587 | * prologue:: Text to prepend to body of code block |
| 14660 | * epilogue:: Text to append to code block body | 15588 | * epilogue:: Text to append to body of code block |
| 14661 | @end menu | 15589 | @end menu |
| 14662 | 15590 | ||
| 14663 | Additional header arguments are defined on a language-specific basis, see | 15591 | For language-specific header arguments, see @ref{Languages}. |
| 14664 | @ref{Languages}. | ||
| 14665 | 15592 | ||
| 14666 | @node var, results, Specific header arguments, Specific header arguments | 15593 | @node var |
| 14667 | @subsubsection @code{:var} | 15594 | @subsubsection @code{:var} |
| 14668 | The @code{:var} header argument is used to pass arguments to code blocks. | 15595 | @cindex @code{:var}, src header argument |
| 14669 | The specifics of how arguments are included in a code block vary by language; | 15596 | Use @code{:var} for passing arguments to @samp{src} code blocks. The |
| 14670 | these are addressed in the language-specific documentation. However, the | 15597 | specifics of variables in @samp{src} code blocks vary by the source language |
| 14671 | syntax used to specify arguments is the same across all languages. In every | 15598 | and are covered in the language-specific documentation. The syntax for |
| 14672 | case, variables require a default value when they are declared. | 15599 | @code{:var}, however, is the same for all languages. This includes declaring |
| 15600 | a variable, and assigning a default value. | ||
| 14673 | 15601 | ||
| 14674 | The values passed to arguments can either be literal values, references, or | 15602 | Arguments can take values as literals, or as references, or even as Emacs |
| 14675 | Emacs Lisp code (see @ref{var, Emacs Lisp evaluation of variables}). | 15603 | Lisp code (@pxref{var, Emacs Lisp evaluation of variables}). References are |
| 14676 | References include anything in the Org mode file that takes a @code{#+NAME:} | 15604 | names from the Org file from the lines @code{#+NAME:} or @code{#+RESULTS:}. |
| 14677 | or @code{#+RESULTS:} line: tables, lists, @code{#+BEGIN_EXAMPLE} blocks, | 15605 | References can also refer to tables, lists, @code{#+BEGIN_EXAMPLE} blocks, |
| 14678 | other code blocks and the results of other code blocks. | 15606 | other types of @samp{src} code blocks, or the results of execution of |
| 15607 | @samp{src} code blocks. | ||
| 14679 | 15608 | ||
| 14680 | Note: When a reference is made to another code block, the referenced block | 15609 | For better performance, Org can cache results of evaluations. But caching |
| 14681 | will be evaluated unless it has current cached results (see @ref{cache}). | 15610 | comes with severe limitations (@pxref{cache}). |
| 14682 | 15611 | ||
| 14683 | Argument values can be indexed in a manner similar to arrays (see @ref{var, | 15612 | Argument values are indexed like arrays (@pxref{var, Indexable variable |
| 14684 | Indexable variable values}). | 15613 | values}). |
| 14685 | 15614 | ||
| 14686 | The following syntax is used to pass arguments to code blocks using the | 15615 | The following syntax is used to pass arguments to @samp{src} code blocks |
| 14687 | @code{:var} header argument. | 15616 | using the @code{:var} header argument. |
| 14688 | 15617 | ||
| 14689 | @example | 15618 | @example |
| 14690 | :var name=assign | 15619 | :var name=assign |
| 14691 | @end example | 15620 | @end example |
| 14692 | 15621 | ||
| 14693 | The argument, @code{assign}, can either be a literal value, such as a string | 15622 | The @code{assign} is a literal value, such as a string @samp{"string"}, a |
| 14694 | @samp{"string"} or a number @samp{9}, or a reference to a table, a list, a | 15623 | number @samp{9}, a reference to a table, a list, a literal example, another |
| 14695 | literal example, another code block (with or without arguments), or the | 15624 | code block (with or without arguments), or the results from evaluating a code |
| 14696 | results of evaluating another code block. | 15625 | block. |
| 14697 | 15626 | ||
| 14698 | Here are examples of passing values by reference: | 15627 | Here are examples of passing values by reference: |
| 14699 | 15628 | ||
| @@ -14719,8 +15648,8 @@ an Org mode table named with either a @code{#+NAME:} line | |||
| 14719 | @end example | 15648 | @end example |
| 14720 | 15649 | ||
| 14721 | @item list | 15650 | @item list |
| 14722 | a simple list named with a @code{#+NAME:} line (note that nesting is not | 15651 | a simple list named with a @code{#+NAME:} line. Note that only the top level |
| 14723 | carried through to the source code block) | 15652 | list items are passed along. Nested list items are ignored. |
| 14724 | 15653 | ||
| 14725 | @example | 15654 | @example |
| 14726 | #+NAME: example-list | 15655 | #+NAME: example-list |
| @@ -14751,9 +15680,9 @@ optionally followed by parentheses | |||
| 14751 | @end example | 15680 | @end example |
| 14752 | 15681 | ||
| 14753 | @item code block with arguments | 15682 | @item code block with arguments |
| 14754 | a code block name, as assigned by @code{#+NAME:}, followed by parentheses and | 15683 | a @samp{src} code block name, as assigned by @code{#+NAME:}, followed by |
| 14755 | optional arguments passed within the parentheses following the | 15684 | parentheses and optional arguments passed within the parentheses following |
| 14756 | code block name using standard function call syntax | 15685 | the @samp{src} code block name using standard function call syntax |
| 14757 | 15686 | ||
| 14758 | @example | 15687 | @example |
| 14759 | #+NAME: double | 15688 | #+NAME: double |
| @@ -14765,7 +15694,7 @@ code block name using standard function call syntax | |||
| 14765 | : 16 | 15694 | : 16 |
| 14766 | 15695 | ||
| 14767 | #+NAME: squared | 15696 | #+NAME: squared |
| 14768 | #+BEGIN_SRC emacs-lisp :var input=double(input=1) | 15697 | #+BEGIN_SRC emacs-lisp :var input=double(input=2) |
| 14769 | (* input input) | 15698 | (* input input) |
| 14770 | #+END_SRC | 15699 | #+END_SRC |
| 14771 | 15700 | ||
| @@ -14797,14 +15726,14 @@ on two lines | |||
| 14797 | @end table | 15726 | @end table |
| 14798 | 15727 | ||
| 14799 | @subsubheading Indexable variable values | 15728 | @subsubheading Indexable variable values |
| 14800 | It is possible to reference portions of variable values by ``indexing'' into | 15729 | Indexing variable values enables referencing portions of a variable. Indexes |
| 14801 | the variables. Indexes are 0 based with negative values counting back from | 15730 | are 0 based with negative values counting backwards from the end. If an |
| 14802 | the end. If an index is separated by @code{,}s then each subsequent section | 15731 | index is separated by @code{,}s then each subsequent section will index as |
| 14803 | will index into the next deepest nesting or dimension of the value. Note | 15732 | the next dimension. Note that this indexing occurs @emph{before} other |
| 14804 | that this indexing occurs @emph{before} other table related header arguments | 15733 | table-related header arguments are applied, such as @code{:hlines}, |
| 14805 | like @code{:hlines}, @code{:colnames} and @code{:rownames} are applied. The | 15734 | @code{:colnames} and @code{:rownames}. The following example assigns the |
| 14806 | following example assigns the last cell of the first row the table | 15735 | last cell of the first row the table @code{example-table} to the variable |
| 14807 | @code{example-table} to the variable @code{data}: | 15736 | @code{data}: |
| 14808 | 15737 | ||
| 14809 | @example | 15738 | @example |
| 14810 | #+NAME: example-table | 15739 | #+NAME: example-table |
| @@ -14844,10 +15773,9 @@ to @code{data}. | |||
| 14844 | | 4 | d | | 15773 | | 4 | d | |
| 14845 | @end example | 15774 | @end example |
| 14846 | 15775 | ||
| 14847 | Additionally, an empty index, or the single character @code{*}, are both | 15776 | To pick the entire range, use an empty index, or the single character |
| 14848 | interpreted to mean the entire range and as such are equivalent to | 15777 | @code{*}. @code{0:-1} does the same thing. Example below shows how to |
| 14849 | @code{0:-1}, as shown in the following example in which the entire first | 15778 | reference the first column only. |
| 14850 | column is referenced. | ||
| 14851 | 15779 | ||
| 14852 | @example | 15780 | @example |
| 14853 | #+NAME: example-table | 15781 | #+NAME: example-table |
| @@ -14864,9 +15792,9 @@ column is referenced. | |||
| 14864 | | 1 | 2 | 3 | 4 | | 15792 | | 1 | 2 | 3 | 4 | |
| 14865 | @end example | 15793 | @end example |
| 14866 | 15794 | ||
| 14867 | It is possible to index into the results of code blocks as well as tables. | 15795 | Index referencing can be used for tables and code blocks. Index referencing |
| 14868 | Any number of dimensions can be indexed. Dimensions are separated from one | 15796 | can handle any number of dimensions. Commas delimit multiple dimensions, as |
| 14869 | another by commas, as shown in the following example. | 15797 | shown below. |
| 14870 | 15798 | ||
| 14871 | @example | 15799 | @example |
| 14872 | #+NAME: 3D | 15800 | #+NAME: 3D |
| @@ -14886,14 +15814,13 @@ another by commas, as shown in the following example. | |||
| 14886 | 15814 | ||
| 14887 | @subsubheading Emacs Lisp evaluation of variables | 15815 | @subsubheading Emacs Lisp evaluation of variables |
| 14888 | 15816 | ||
| 14889 | Emacs lisp code can be used to initialize variable values. When a variable | 15817 | Emacs lisp code can set the values for variables. To differentiate a value |
| 14890 | value starts with @code{(}, @code{[}, @code{'} or @code{`} it will be | 15818 | from lisp code, Org interprets any value starting with @code{(}, @code{[}, |
| 14891 | evaluated as Emacs Lisp and the result of the evaluation will be assigned as | 15819 | @code{'} or @code{`} as Emacs Lisp code. The result of evaluating that code |
| 14892 | the variable value. The following example demonstrates use of this | 15820 | is then assigned to the value of that variable. The following example shows |
| 14893 | evaluation to reliably pass the file-name of the Org mode buffer to a code | 15821 | how to reliably query and pass file name of the Org mode buffer to a code |
| 14894 | block---note that evaluation of header arguments is guaranteed to take place | 15822 | block using headers. We need reliability here because the file's name could |
| 14895 | in the original Org mode file, while there is no such guarantee for | 15823 | change once the code in the block starts executing. |
| 14896 | evaluation of the code block body. | ||
| 14897 | 15824 | ||
| 14898 | @example | 15825 | @example |
| 14899 | #+BEGIN_SRC sh :var filename=(buffer-file-name) :exports both | 15826 | #+BEGIN_SRC sh :var filename=(buffer-file-name) :exports both |
| @@ -14901,14 +15828,14 @@ evaluation of the code block body. | |||
| 14901 | #+END_SRC | 15828 | #+END_SRC |
| 14902 | @end example | 15829 | @end example |
| 14903 | 15830 | ||
| 14904 | Note that values read from tables and lists will not be evaluated as | 15831 | Note that values read from tables and lists will not be mistakenly evaluated |
| 14905 | Emacs Lisp, as shown in the following example. | 15832 | as Emacs Lisp code, as illustrated in the following example. |
| 14906 | 15833 | ||
| 14907 | @example | 15834 | @example |
| 14908 | #+NAME: table | 15835 | #+NAME: table |
| 14909 | | (a b c) | | 15836 | | (a b c) | |
| 14910 | 15837 | ||
| 14911 | #+HEADERS: :var data=table[0,0] | 15838 | #+HEADER: :var data=table[0,0] |
| 14912 | #+BEGIN_SRC perl | 15839 | #+BEGIN_SRC perl |
| 14913 | $data | 15840 | $data |
| 14914 | #+END_SRC | 15841 | #+END_SRC |
| @@ -14917,167 +15844,171 @@ Emacs Lisp, as shown in the following example. | |||
| 14917 | : (a b c) | 15844 | : (a b c) |
| 14918 | @end example | 15845 | @end example |
| 14919 | 15846 | ||
| 14920 | @node results, file, var, Specific header arguments | 15847 | @node results |
| 14921 | @subsubsection @code{:results} | 15848 | @subsubsection @code{:results} |
| 15849 | @cindex @code{:results}, src header argument | ||
| 14922 | 15850 | ||
| 14923 | There are four classes of @code{:results} header argument. Only one option | 15851 | There are four classes of @code{:results} header arguments. Each @samp{src} |
| 14924 | per class may be supplied per code block. | 15852 | code block can take only one option per class. |
| 14925 | 15853 | ||
| 14926 | @itemize @bullet | 15854 | @itemize @bullet |
| 14927 | @item | 15855 | @item |
| 14928 | @b{collection} header arguments specify how the results should be collected | 15856 | @b{collection} for how the results should be collected from the @samp{src} |
| 14929 | from the code block | 15857 | code block |
| 14930 | @item | 15858 | @item |
| 14931 | @b{type} header arguments specify what type of result the code block will | 15859 | @b{type} for which type of result the code block will return; affects how Org |
| 14932 | return---which has implications for how they will be processed before | 15860 | processes and inserts results in the Org buffer |
| 14933 | insertion into the Org mode buffer | ||
| 14934 | @item | 15861 | @item |
| 14935 | @b{format} header arguments specify what type of result the code block will | 15862 | @b{format} for the result; affects how Org processes and inserts results in |
| 14936 | return---which has implications for how they will be inserted into the | 15863 | the Org buffer |
| 14937 | Org mode buffer | ||
| 14938 | @item | 15864 | @item |
| 14939 | @b{handling} header arguments specify how the results of evaluating the code | 15865 | @b{handling} for processing results after evaluation of the @samp{src} code |
| 14940 | block should be handled. | 15866 | block |
| 14941 | @end itemize | 15867 | @end itemize |
| 14942 | 15868 | ||
| 14943 | @subsubheading Collection | 15869 | @subsubheading Collection |
| 14944 | The following options are mutually exclusive, and specify how the results | 15870 | Collection options specify the results. Choose one of the options; they are |
| 14945 | should be collected from the code block. | 15871 | mutually exclusive. |
| 14946 | 15872 | ||
| 14947 | @itemize @bullet | 15873 | @itemize @bullet |
| 14948 | @item @code{value} | 15874 | @item @code{value} |
| 14949 | This is the default. The result is the value of the last statement in the | 15875 | Default. Functional mode. Result is the value returned by the last |
| 14950 | code block. This header argument places the evaluation in functional | 15876 | statement in the @samp{src} code block. Languages like Python may require an |
| 14951 | mode. Note that in some languages, e.g., Python, use of this result type | 15877 | explicit @code{return} statement in the @samp{src} code block. Usage |
| 14952 | requires that a @code{return} statement be included in the body of the source | 15878 | example: @code{:results value}. |
| 14953 | code block. E.g., @code{:results value}. | ||
| 14954 | @item @code{output} | 15879 | @item @code{output} |
| 14955 | The result is the collection of everything printed to STDOUT during the | 15880 | Scripting mode. Result is collected from STDOUT during execution of the code |
| 14956 | execution of the code block. This header argument places the | 15881 | in the @samp{src} code block. Usage example: @code{:results output}. |
| 14957 | evaluation in scripting mode. E.g., @code{:results output}. | ||
| 14958 | @end itemize | 15882 | @end itemize |
| 14959 | 15883 | ||
| 14960 | @subsubheading Type | 15884 | @subsubheading Type |
| 14961 | 15885 | Type tells what result types to expect from the execution of the code | |
| 14962 | The following options are mutually exclusive and specify what type of results | 15886 | block. Choose one of the options; they are mutually exclusive. The default |
| 14963 | the code block will return. By default, results are inserted as either a | 15887 | behavior is to automatically determine the result type. |
| 14964 | table or scalar depending on their value. | ||
| 14965 | 15888 | ||
| 14966 | @itemize @bullet | 15889 | @itemize @bullet |
| 14967 | @item @code{table}, @code{vector} | 15890 | @item @code{table}, @code{vector} |
| 14968 | The results should be interpreted as an Org mode table. If a single value is | 15891 | Interpret the results as an Org table. If the result is a single value, |
| 14969 | returned, it will be converted into a table with one row and one column. | 15892 | create a table with one row and one column. Usage example: @code{:results |
| 14970 | E.g., @code{:results value table}. | 15893 | value table}. |
| 14971 | @item @code{list} | 15894 | @item @code{list} |
| 14972 | The results should be interpreted as an Org mode list. If a single scalar | 15895 | Interpret the results as an Org list. If the result is a single value, |
| 14973 | value is returned it will be converted into a list with only one element. | 15896 | create a list of one element. |
| 14974 | @item @code{scalar}, @code{verbatim} | 15897 | @item @code{scalar}, @code{verbatim} |
| 14975 | The results should be interpreted literally---they will not be | 15898 | Interpret literally and insert as quoted text. Do not create a table. Usage |
| 14976 | converted into a table. The results will be inserted into the Org mode | 15899 | example: @code{:results value verbatim}. |
| 14977 | buffer as quoted text. E.g., @code{:results value verbatim}. | ||
| 14978 | @item @code{file} | 15900 | @item @code{file} |
| 14979 | The results will be interpreted as the path to a file, and will be inserted | 15901 | Interpret as path to a file. Inserts a link to the file. Usage example: |
| 14980 | into the Org mode buffer as a file link. E.g., @code{:results value file}. | 15902 | @code{:results value file}. |
| 14981 | @end itemize | 15903 | @end itemize |
| 14982 | 15904 | ||
| 14983 | @subsubheading Format | 15905 | @subsubheading Format |
| 14984 | 15906 | Format pertains to the type of the result returned by the @samp{src} code | |
| 14985 | The following options are mutually exclusive and specify what type of results | 15907 | block. Choose one of the options; they are mutually exclusive. The default |
| 14986 | the code block will return. By default, results are inserted according to the | 15908 | follows from the type specified above. |
| 14987 | type as specified above. | ||
| 14988 | 15909 | ||
| 14989 | @itemize @bullet | 15910 | @itemize @bullet |
| 14990 | @item @code{raw} | 15911 | @item @code{raw} |
| 14991 | The results are interpreted as raw Org mode code and are inserted directly | 15912 | Interpreted as raw Org mode. Inserted directly into the buffer. Aligned if |
| 14992 | into the buffer. If the results look like a table they will be aligned as | 15913 | it is a table. Usage example: @code{:results value raw}. |
| 14993 | such by Org mode. E.g., @code{:results value raw}. | ||
| 14994 | @item @code{org} | 15914 | @item @code{org} |
| 14995 | The results are will be enclosed in a @code{BEGIN_SRC org} block. | 15915 | Results enclosed in a @code{BEGIN_SRC org} block. For comma-escape, either |
| 14996 | They are not comma-escaped by default but they will be if you hit @kbd{TAB} | 15916 | @kbd{TAB} in the block, or export the file. Usage example: @code{:results |
| 14997 | in the block and/or if you export the file. E.g., @code{:results value org}. | 15917 | value org}. |
| 14998 | @item @code{html} | 15918 | @item @code{html} |
| 14999 | Results are assumed to be HTML and will be enclosed in a @code{BEGIN_HTML} | 15919 | Results enclosed in a @code{BEGIN_EXPORT html} block. Usage example: |
| 15000 | block. E.g., @code{:results value html}. | 15920 | @code{:results value html}. |
| 15001 | @item @code{latex} | 15921 | @item @code{latex} |
| 15002 | Results assumed to be @LaTeX{} and are enclosed in a @code{BEGIN_LaTeX} block. | 15922 | Results enclosed in a @code{BEGIN_EXPORT latex} block. Usage example: |
| 15003 | E.g., @code{:results value latex}. | 15923 | @code{:results value latex}. |
| 15004 | @item @code{code} | 15924 | @item @code{code} |
| 15005 | Result are assumed to be parsable code and are enclosed in a code block. | 15925 | Result enclosed in a @samp{src} code block. Useful for parsing. Usage |
| 15006 | E.g., @code{:results value code}. | 15926 | example: @code{:results value code}. |
| 15007 | @item @code{pp} | 15927 | @item @code{pp} |
| 15008 | The result is converted to pretty-printed code and is enclosed in a code | 15928 | Result converted to pretty-print source code. Enclosed in a @samp{src} code |
| 15009 | block. This option currently supports Emacs Lisp, Python, and Ruby. E.g., | 15929 | block. Languages supported: Emacs Lisp, Python, and Ruby. Usage example: |
| 15010 | @code{:results value pp}. | 15930 | @code{:results value pp}. |
| 15011 | @item @code{drawer} | 15931 | @item @code{drawer} |
| 15012 | The result is wrapped in a RESULTS drawer. This can be useful for | 15932 | Result wrapped in a RESULTS drawer. Useful for containing @code{raw} or |
| 15013 | inserting @code{raw} or @code{org} syntax results in such a way that their | 15933 | @code{org} results for later scripting and automated processing. Usage |
| 15014 | extent is known and they can be automatically removed or replaced. | 15934 | example: @code{:results value drawer}. |
| 15015 | @end itemize | 15935 | @end itemize |
| 15016 | 15936 | ||
| 15017 | @subsubheading Handling | 15937 | @subsubheading Handling |
| 15018 | The following results options indicate what happens with the | 15938 | Handling options after collecting the results. |
| 15019 | results once they are collected. | ||
| 15020 | 15939 | ||
| 15021 | @itemize @bullet | 15940 | @itemize @bullet |
| 15022 | @item @code{silent} | 15941 | @item @code{silent} |
| 15023 | The results will be echoed in the minibuffer but will not be inserted into | 15942 | Do not insert results in the Org mode buffer, but echo them in the |
| 15024 | the Org mode buffer. E.g., @code{:results output silent}. | 15943 | minibuffer. Usage example: @code{:results output silent}. |
| 15025 | @item @code{replace} | 15944 | @item @code{replace} |
| 15026 | The default value. Any existing results will be removed, and the new results | 15945 | Default. Insert results in the Org buffer. Remove previous results. Usage |
| 15027 | will be inserted into the Org mode buffer in their place. E.g., | 15946 | example: @code{:results output replace}. |
| 15028 | @code{:results output replace}. | ||
| 15029 | @item @code{append} | 15947 | @item @code{append} |
| 15030 | If there are pre-existing results of the code block then the new results will | 15948 | Append results to the Org buffer. Latest results are at the bottom. Does |
| 15031 | be appended to the existing results. Otherwise the new results will be | 15949 | not remove previous results. Usage example: @code{:results output append}. |
| 15032 | inserted as with @code{replace}. | ||
| 15033 | @item @code{prepend} | 15950 | @item @code{prepend} |
| 15034 | If there are pre-existing results of the code block then the new results will | 15951 | Prepend results to the Org buffer. Latest results are at the top. Does not |
| 15035 | be prepended to the existing results. Otherwise the new results will be | 15952 | remove previous results. Usage example: @code{:results output prepend}. |
| 15036 | inserted as with @code{replace}. | ||
| 15037 | @end itemize | 15953 | @end itemize |
| 15038 | 15954 | ||
| 15039 | @node file, file-desc, results, Specific header arguments | 15955 | @node file |
| 15040 | @subsubsection @code{:file} | 15956 | @subsubsection @code{:file} |
| 15957 | @cindex @code{:file}, src header argument | ||
| 15958 | |||
| 15959 | An external @code{:file} that saves the results of execution of the code | ||
| 15960 | block. The @code{:file} is either a file name or two strings, where the | ||
| 15961 | first is the file name and the second is the description. A link to the file | ||
| 15962 | is inserted. It uses an Org mode style @code{[[file:]]} link (@pxref{Link | ||
| 15963 | format}). Some languages, such as @samp{R}, @samp{dot}, @samp{ditaa}, and | ||
| 15964 | @samp{gnuplot}, automatically wrap the source code in additional boilerplate | ||
| 15965 | code. Such code wrapping helps recreate the output, especially graphics | ||
| 15966 | output, by executing just the @code{:file} contents. | ||
| 15967 | |||
| 15968 | @node file-desc | ||
| 15969 | @subsubsection @code{:file-desc} | ||
| 15041 | 15970 | ||
| 15042 | The header argument @code{:file} is used to specify an external file in which | 15971 | A description of the results file. Org uses this description for the link |
| 15043 | to save code block results. After code block evaluation an Org mode style | 15972 | (see @ref{Link format}) it inserts in the Org file. If the @code{:file-desc} |
| 15044 | @code{[[file:]]} link (see @ref{Link format}) to the file will be inserted | 15973 | has no value, Org will use file name for both the ``link'' and the |
| 15045 | into the Org mode buffer. Some languages including R, gnuplot, dot, and | 15974 | ``description'' portion of the Org mode link. |
| 15046 | ditaa provide special handling of the @code{:file} header argument | ||
| 15047 | automatically wrapping the code block body in the boilerplate code required | ||
| 15048 | to save output to the specified file. This is often useful for saving | ||
| 15049 | graphical output of a code block to the specified file. | ||
| 15050 | 15975 | ||
| 15051 | The argument to @code{:file} should be either a string specifying the path to | 15976 | @node file-ext |
| 15052 | a file, or a list of two strings in which case the first element of the list | 15977 | @subsubsection @code{:file-ext} |
| 15053 | should be the path to a file and the second a description for the link. | 15978 | @cindex @code{:file-ext}, src header argument |
| 15054 | 15979 | ||
| 15055 | @node file-desc, dir, file, Specific header arguments | 15980 | File name extension for the output file. Org generates the file's complete |
| 15056 | @subsubsection @code{:file-desc} | 15981 | name, and extension by combining @code{:file-ext}, @code{#+NAME:} of the |
| 15982 | source block, and the @ref{output-dir} header argument. To override this | ||
| 15983 | auto generated file name, use the @code{:file} header argument. | ||
| 15057 | 15984 | ||
| 15058 | The value of the @code{:file-desc} header argument is used to provide a | 15985 | @node output-dir |
| 15059 | description for file code block results which are inserted as Org mode links | 15986 | @subsubsection @code{:output-dir} |
| 15060 | (see @ref{Link format}). If the @code{:file-desc} header argument is given | 15987 | @cindex @code{:output-dir}, src header argument |
| 15061 | with no value the link path will be placed in both the ``link'' and the | 15988 | |
| 15062 | ``description'' portion of the Org mode link. | 15989 | Specifies the @code{:output-dir} for the results file. Org accepts an |
| 15990 | absolute path (beginning with @code{/}) or a relative directory (without | ||
| 15991 | @code{/}). The value can be combined with @code{#+NAME:} of the source block | ||
| 15992 | and @ref{file} or @ref{file-ext} header arguments. | ||
| 15063 | 15993 | ||
| 15064 | @node dir, exports, file-desc, Specific header arguments | 15994 | @node dir |
| 15065 | @subsubsection @code{:dir} and remote execution | 15995 | @subsubsection @code{:dir} and remote execution |
| 15996 | @cindex @code{:dir}, src header argument | ||
| 15066 | 15997 | ||
| 15067 | While the @code{:file} header argument can be used to specify the path to the | 15998 | While the @code{:file} header argument can be used to specify the path to the |
| 15068 | output file, @code{:dir} specifies the default directory during code block | 15999 | output file, @code{:dir} specifies the default directory during @samp{src} |
| 15069 | execution. If it is absent, then the directory associated with the current | 16000 | code block execution. If it is absent, then the directory associated with |
| 15070 | buffer is used. In other words, supplying @code{:dir path} temporarily has | 16001 | the current buffer is used. In other words, supplying @code{:dir path} |
| 15071 | the same effect as changing the current directory with @kbd{M-x cd path RET}, and | 16002 | temporarily has the same effect as changing the current directory with |
| 15072 | then not supplying @code{:dir}. Under the surface, @code{:dir} simply sets | 16003 | @kbd{M-x cd path RET}, and then not supplying @code{:dir}. Under the |
| 15073 | the value of the Emacs variable @code{default-directory}. | 16004 | surface, @code{:dir} simply sets the value of the Emacs variable |
| 16005 | @code{default-directory}. | ||
| 15074 | 16006 | ||
| 15075 | When using @code{:dir}, you should supply a relative path for file output | 16007 | When using @code{:dir}, relative paths (for example, @code{:file myfile.jpg} |
| 15076 | (e.g., @code{:file myfile.jpg} or @code{:file results/myfile.jpg}) in which | 16008 | or @code{:file results/myfile.jpg}) become relative to the default directory. |
| 15077 | case that path will be interpreted relative to the default directory. | ||
| 15078 | 16009 | ||
| 15079 | In other words, if you want your plot to go into a folder called @file{Work} | 16010 | For example, to save the plot file in the @samp{Work} folder of the home |
| 15080 | in your home directory, you could use | 16011 | directory (notice tilde is expanded): |
| 15081 | 16012 | ||
| 15082 | @example | 16013 | @example |
| 15083 | #+BEGIN_SRC R :file myplot.png :dir ~/Work | 16014 | #+BEGIN_SRC R :file myplot.png :dir ~/Work |
| @@ -15086,8 +16017,8 @@ matplot(matrix(rnorm(100), 10), type="l") | |||
| 15086 | @end example | 16017 | @end example |
| 15087 | 16018 | ||
| 15088 | @subsubheading Remote execution | 16019 | @subsubheading Remote execution |
| 15089 | A directory on a remote machine can be specified using tramp file syntax, in | 16020 | To evaluate the @samp{src} code block on a remote machine, supply a remote s |
| 15090 | which case the code will be evaluated on the remote machine. An example is | 16021 | directory name using @samp{Tramp} syntax. For example: |
| 15091 | 16022 | ||
| 15092 | @example | 16023 | @example |
| 15093 | #+BEGIN_SRC R :file plot.png :dir /scp:dand@@yakuba.princeton.edu: | 16024 | #+BEGIN_SRC R :file plot.png :dir /scp:dand@@yakuba.princeton.edu: |
| @@ -15095,189 +16026,196 @@ plot(1:10, main=system("hostname", intern=TRUE)) | |||
| 15095 | #+END_SRC | 16026 | #+END_SRC |
| 15096 | @end example | 16027 | @end example |
| 15097 | 16028 | ||
| 15098 | Text results will be returned to the local Org mode buffer as usual, and file | 16029 | Org first captures the text results as usual for insertion in the Org file. |
| 15099 | output will be created on the remote machine with relative paths interpreted | 16030 | Then Org also inserts a link to the remote file, thanks to Emacs |
| 15100 | relative to the remote directory. An Org mode link to the remote file will be | 16031 | @samp{Tramp}. Org constructs the remote path to the file name from |
| 15101 | created. | 16032 | @code{:dir} and @code{default-directory}, as illustrated here: |
| 15102 | |||
| 15103 | So, in the above example a plot will be created on the remote machine, | ||
| 15104 | and a link of the following form will be inserted in the org buffer: | ||
| 15105 | 16033 | ||
| 15106 | @example | 16034 | @example |
| 15107 | [[file:/scp:dand@@yakuba.princeton.edu:/home/dand/plot.png][plot.png]] | 16035 | [[file:/scp:dand@@yakuba.princeton.edu:/home/dand/plot.png][plot.png]] |
| 15108 | @end example | 16036 | @end example |
| 15109 | 16037 | ||
| 15110 | Most of this functionality follows immediately from the fact that @code{:dir} | ||
| 15111 | sets the value of the Emacs variable @code{default-directory}, thanks to | ||
| 15112 | tramp. Those using XEmacs, or GNU Emacs prior to version 23 may need to | ||
| 15113 | install tramp separately in order for these features to work correctly. | ||
| 15114 | 16038 | ||
| 15115 | @subsubheading Further points | 16039 | @subsubheading Some more warnings |
| 15116 | 16040 | ||
| 15117 | @itemize @bullet | 16041 | @itemize @bullet |
| 15118 | @item | 16042 | @item |
| 15119 | If @code{:dir} is used in conjunction with @code{:session}, although it will | 16043 | When @code{:dir} is used with @code{:session}, Org sets the starting |
| 15120 | determine the starting directory for a new session as expected, no attempt is | 16044 | directory for a new session. But Org will not alter the directory of an |
| 15121 | currently made to alter the directory associated with an existing session. | 16045 | already existing session. |
| 15122 | @item | 16046 | @item |
| 15123 | @code{:dir} should typically not be used to create files during export with | 16047 | Do not use @code{:dir} with @code{:exports results} or with @code{:exports |
| 15124 | @code{:exports results} or @code{:exports both}. The reason is that, in order | 16048 | both} to avoid Org inserting incorrect links to remote files. That is because |
| 15125 | to retain portability of exported material between machines, during export | 16049 | Org does not expand @code{default directory} to avoid some underlying |
| 15126 | links inserted into the buffer will @emph{not} be expanded against @code{default | 16050 | portability issues. |
| 15127 | directory}. Therefore, if @code{default-directory} is altered using | ||
| 15128 | @code{:dir}, it is probable that the file will be created in a location to | ||
| 15129 | which the link does not point. | ||
| 15130 | @end itemize | 16051 | @end itemize |
| 15131 | 16052 | ||
| 15132 | @node exports, tangle, dir, Specific header arguments | 16053 | @node exports |
| 15133 | @subsubsection @code{:exports} | 16054 | @subsubsection @code{:exports} |
| 16055 | @cindex @code{:exports}, src header argument | ||
| 15134 | 16056 | ||
| 15135 | The @code{:exports} header argument specifies what should be included in HTML | 16057 | The @code{:exports} header argument is to specify if that part of the Org |
| 15136 | or @LaTeX{} exports of the Org mode file. | 16058 | file is exported to, say, HTML or @LaTeX{} formats. Note that |
| 16059 | @code{:exports} affects only @samp{src} code blocks and not inline code. | ||
| 15137 | 16060 | ||
| 15138 | @itemize @bullet | 16061 | @itemize @bullet |
| 15139 | @item @code{code} | 16062 | @item @code{code} |
| 15140 | The default. The body of code is included into the exported file. E.g., | 16063 | The default. The body of code is included into the exported file. Example: |
| 15141 | @code{:exports code}. | 16064 | @code{:exports code}. |
| 15142 | @item @code{results} | 16065 | @item @code{results} |
| 15143 | The result of evaluating the code is included in the exported file. E.g., | 16066 | The results of evaluation of the code is included in the exported file. |
| 15144 | @code{:exports results}. | 16067 | Example: @code{:exports results}. |
| 15145 | @item @code{both} | 16068 | @item @code{both} |
| 15146 | Both the code and results are included in the exported file. E.g., | 16069 | Both the code and results of evaluation are included in the exported file. |
| 15147 | @code{:exports both}. | 16070 | Example: @code{:exports both}. |
| 15148 | @item @code{none} | 16071 | @item @code{none} |
| 15149 | Nothing is included in the exported file. E.g., @code{:exports none}. | 16072 | Neither the code nor the results of evaluation is included in the exported |
| 16073 | file. Whether the code is evaluated at all depends on other | ||
| 16074 | options. Example: @code{:exports none}. | ||
| 15150 | @end itemize | 16075 | @end itemize |
| 15151 | 16076 | ||
| 15152 | @node tangle, mkdirp, exports, Specific header arguments | 16077 | @node tangle |
| 15153 | @subsubsection @code{:tangle} | 16078 | @subsubsection @code{:tangle} |
| 16079 | @cindex @code{:tangle}, src header argument | ||
| 15154 | 16080 | ||
| 15155 | The @code{:tangle} header argument specifies whether or not the code | 16081 | The @code{:tangle} header argument specifies if the @samp{src} code block is |
| 15156 | block should be included in tangled extraction of source code files. | 16082 | exported to source file(s). |
| 15157 | 16083 | ||
| 15158 | @itemize @bullet | 16084 | @itemize @bullet |
| 15159 | @item @code{tangle} | 16085 | @item @code{tangle} |
| 15160 | The code block is exported to a source code file named after the full path | 16086 | Export the @samp{src} code block to source file. The file name for the |
| 15161 | (including the directory) and file name (w/o extension) of the Org mode file. | 16087 | source file is derived from the name of the Org file, and the file extension |
| 15162 | E.g., @code{:tangle yes}. | 16088 | is derived from the source code language identifier. Example: @code{:tangle |
| 16089 | yes}. | ||
| 15163 | @item @code{no} | 16090 | @item @code{no} |
| 15164 | The default. The code block is not exported to a source code file. | 16091 | The default. Do not extract the code a source code file. Example: |
| 15165 | E.g., @code{:tangle no}. | 16092 | @code{:tangle no}. |
| 15166 | @item other | 16093 | @item other |
| 15167 | Any other string passed to the @code{:tangle} header argument is interpreted | 16094 | Export the @samp{src} code block to source file whose file name is derived |
| 15168 | as a path (directory and file name relative to the directory of the Org mode | 16095 | from any string passed to the @code{:tangle} header argument. Org derives |
| 15169 | file) to which the block will be exported. E.g., @code{:tangle path}. | 16096 | the file name as being relative to the directory of the Org file's location. |
| 16097 | Example: @code{:tangle path}. | ||
| 15170 | @end itemize | 16098 | @end itemize |
| 15171 | 16099 | ||
| 15172 | @node mkdirp, comments, tangle, Specific header arguments | 16100 | @node mkdirp |
| 15173 | @subsubsection @code{:mkdirp} | 16101 | @subsubsection @code{:mkdirp} |
| 16102 | @cindex @code{:mkdirp}, src header argument | ||
| 15174 | 16103 | ||
| 15175 | The @code{:mkdirp} header argument can be used to create parent directories | 16104 | The @code{:mkdirp} header argument creates parent directories for tangled |
| 15176 | of tangled files when missing. This can be set to @code{yes} to enable | 16105 | files if the directory does not exist. @code{yes} enables directory creation |
| 15177 | directory creation or to @code{no} to inhibit directory creation. | 16106 | and @code{no} inhibits directory creation. |
| 15178 | 16107 | ||
| 15179 | @node comments, padline, mkdirp, Specific header arguments | 16108 | @node comments |
| 15180 | @subsubsection @code{:comments} | 16109 | @subsubsection @code{:comments} |
| 15181 | By default code blocks are tangled to source-code files without any insertion | 16110 | @cindex @code{:comments}, src header argument |
| 15182 | of comments beyond those which may already exist in the body of the code | 16111 | Controls inserting comments into tangled files. These are above and beyond |
| 15183 | block. The @code{:comments} header argument can be set as follows to control | 16112 | whatever comments may already exist in the @samp{src} code block. |
| 15184 | the insertion of extra comments into the tangled code file. | ||
| 15185 | 16113 | ||
| 15186 | @itemize @bullet | 16114 | @itemize @bullet |
| 15187 | @item @code{no} | 16115 | @item @code{no} |
| 15188 | The default. No extra comments are inserted during tangling. | 16116 | The default. Do not insert any extra comments during tangling. |
| 15189 | @item @code{link} | 16117 | @item @code{link} |
| 15190 | The code block is wrapped in comments which contain pointers back to the | 16118 | Wrap the @samp{src} code block in comments. Include links pointing back to |
| 15191 | original Org file from which the code was tangled. | 16119 | the place in the Org file from where the code was tangled. |
| 15192 | @item @code{yes} | 16120 | @item @code{yes} |
| 15193 | A synonym for ``link'' to maintain backwards compatibility. | 16121 | Kept for backward compatibility; same as ``link''. |
| 15194 | @item @code{org} | 16122 | @item @code{org} |
| 15195 | Include text from the Org mode file as a comment. | 16123 | Nearest headline text from Org file is inserted as comment. The exact text |
| 15196 | The text is picked from the leading context of the tangled code and is | 16124 | that is inserted is picked from the leading context of the source block. |
| 15197 | limited by the nearest headline or source block as the case may be. | ||
| 15198 | @item @code{both} | 16125 | @item @code{both} |
| 15199 | Turns on both the ``link'' and ``org'' comment options. | 16126 | Includes both ``link'' and ``org'' comment options. |
| 15200 | @item @code{noweb} | 16127 | @item @code{noweb} |
| 15201 | Turns on the ``link'' comment option, and additionally wraps expanded noweb | 16128 | Includes ``link'' comment option, expands noweb references, and wraps them in |
| 15202 | references in the code block body in link comments. | 16129 | link comments inside the body of the @samp{src} code block. |
| 15203 | @end itemize | 16130 | @end itemize |
| 15204 | 16131 | ||
| 15205 | @node padline, no-expand, comments, Specific header arguments | 16132 | @node padline |
| 15206 | @subsubsection @code{:padline} | 16133 | @subsubsection @code{:padline} |
| 15207 | Control in insertion of padding lines around code block bodies in tangled | 16134 | @cindex @code{:padline}, src header argument |
| 15208 | code files. The default value is @code{yes} which results in insertion of | 16135 | Control insertion of newlines to pad @samp{src} code blocks in the tangled |
| 15209 | newlines before and after each tangled code block. The following arguments | 16136 | file. |
| 15210 | are accepted. | ||
| 15211 | |||
| 15212 | @itemize @bullet | 16137 | @itemize @bullet |
| 15213 | @item @code{yes} | 16138 | @item @code{yes} |
| 15214 | Insert newlines before and after each code block body in tangled code files. | 16139 | Default. Insert a newline before and after each @samp{src} code block in the |
| 16140 | tangled file. | ||
| 15215 | @item @code{no} | 16141 | @item @code{no} |
| 15216 | Do not insert any newline padding in tangled output. | 16142 | Do not insert newlines to pad the tangled @samp{src} code blocks. |
| 15217 | @end itemize | 16143 | @end itemize |
| 15218 | 16144 | ||
| 15219 | @node no-expand, session, padline, Specific header arguments | 16145 | @node no-expand |
| 15220 | @subsubsection @code{:no-expand} | 16146 | @subsubsection @code{:no-expand} |
| 15221 | 16147 | @cindex @code{:no-expand}, src header argument | |
| 15222 | By default, code blocks are expanded with @code{org-babel-expand-src-block} | 16148 | |
| 15223 | during tangling. This has the effect of assigning values to variables | 16149 | By default Org expands @samp{src} code blocks during tangling. The |
| 15224 | specified with @code{:var} (see @ref{var}), and of replacing ``noweb'' | 16150 | @code{:no-expand} header argument turns off such expansions. Note that one |
| 15225 | references (see @ref{Noweb reference syntax}) with their targets. The | 16151 | side-effect of expansion by @code{org-babel-expand-src-block} also assigns |
| 15226 | @code{:no-expand} header argument can be used to turn off this behavior. | 16152 | values to @code{:var} (@pxref{var}) variables. Expansions also replace |
| 15227 | 16153 | ``noweb'' references with their targets (@pxref{Noweb reference syntax}). | |
| 15228 | @node session, noweb, no-expand, Specific header arguments | 16154 | Some of these expansions may cause premature assignment, hence this option. |
| 16155 | This option makes a difference only for tangling. It has no effect when | ||
| 16156 | exporting since @samp{src} code blocks for execution have to be expanded | ||
| 16157 | anyway. | ||
| 16158 | |||
| 16159 | @node session | ||
| 15229 | @subsubsection @code{:session} | 16160 | @subsubsection @code{:session} |
| 16161 | @cindex @code{:session}, src header argument | ||
| 15230 | 16162 | ||
| 15231 | The @code{:session} header argument starts a session for an interpreted | 16163 | The @code{:session} header argument is for running multiple source code |
| 15232 | language where state is preserved. | 16164 | blocks under one session. Org runs @samp{src} code blocks with the same |
| 15233 | 16165 | session name in the same interpreter process. | |
| 15234 | By default, a session is not started. | ||
| 15235 | 16166 | ||
| 15236 | A string passed to the @code{:session} header argument will give the session | 16167 | @itemize @bullet |
| 15237 | a name. This makes it possible to run concurrent sessions for each | 16168 | @item @code{none} |
| 15238 | interpreted language. | 16169 | Default. Each @samp{src} code block gets a new interpreter process to |
| 16170 | execute. The process terminates once the block is evaluated. | ||
| 16171 | @item @code{other} | ||
| 16172 | Any string besides @code{none} turns that string into the name of that | ||
| 16173 | session. For example, @code{:session mysession} names it @samp{mysession}. | ||
| 16174 | If @code{:session} has no argument, then the session name is derived from the | ||
| 16175 | source language identifier. Subsequent blocks with the same source code | ||
| 16176 | language use the same session. Depending on the language, state variables, | ||
| 16177 | code from other blocks, and the overall interpreted environment may be | ||
| 16178 | shared. Some interpreted languages support concurrent sessions when | ||
| 16179 | subsequent source code language blocks change session names. | ||
| 16180 | @end itemize | ||
| 15239 | 16181 | ||
| 15240 | @node noweb, noweb-ref, session, Specific header arguments | 16182 | @node noweb |
| 15241 | @subsubsection @code{:noweb} | 16183 | @subsubsection @code{:noweb} |
| 16184 | @cindex @code{:noweb}, src header argument | ||
| 15242 | 16185 | ||
| 15243 | The @code{:noweb} header argument controls expansion of ``noweb'' syntax | 16186 | The @code{:noweb} header argument controls expansion of ``noweb'' syntax |
| 15244 | references (see @ref{Noweb reference syntax}) when the code block is | 16187 | references (@pxref{Noweb reference syntax}). Expansions occur when source |
| 15245 | evaluated, tangled, or exported. The @code{:noweb} header argument can have | 16188 | code blocks are evaluated, tangled, or exported. |
| 15246 | one of the five values: @code{no}, @code{yes}, @code{tangle}, or | ||
| 15247 | @code{no-export} @code{strip-export}. | ||
| 15248 | 16189 | ||
| 15249 | @itemize @bullet | 16190 | @itemize @bullet |
| 15250 | @item @code{no} | 16191 | @item @code{no} |
| 15251 | The default. ``Noweb'' syntax references in the body of the code block will | 16192 | Default. No expansion of ``Noweb'' syntax references in the body of the code |
| 15252 | not be expanded before the code block is evaluated, tangled or exported. | 16193 | when evaluating, tangling, or exporting. |
| 15253 | @item @code{yes} | 16194 | @item @code{yes} |
| 15254 | ``Noweb'' syntax references in the body of the code block will be | 16195 | Expansion of ``Noweb'' syntax references in the body of the @samp{src} code |
| 15255 | expanded before the code block is evaluated, tangled or exported. | 16196 | block when evaluating, tangling, or exporting. |
| 15256 | @item @code{tangle} | 16197 | @item @code{tangle} |
| 15257 | ``Noweb'' syntax references in the body of the code block will be expanded | 16198 | Expansion of ``Noweb'' syntax references in the body of the @samp{src} code |
| 15258 | before the code block is tangled. However, ``noweb'' syntax references will | 16199 | block when tangling. No expansion when evaluating or exporting. |
| 15259 | not be expanded when the code block is evaluated or exported. | ||
| 15260 | @item @code{no-export} | 16200 | @item @code{no-export} |
| 15261 | ``Noweb'' syntax references in the body of the code block will be expanded | 16201 | Expansion of ``Noweb'' syntax references in the body of the @samp{src} code |
| 15262 | before the block is evaluated or tangled. However, ``noweb'' syntax | 16202 | block when evaluating or tangling. No expansion when exporting. |
| 15263 | references will not be expanded when the code block is exported. | ||
| 15264 | @item @code{strip-export} | 16203 | @item @code{strip-export} |
| 15265 | ``Noweb'' syntax references in the body of the code block will be expanded | 16204 | Expansion of ``Noweb'' syntax references in the body of the @samp{src} code |
| 15266 | before the block is evaluated or tangled. However, ``noweb'' syntax | 16205 | block when expanding prior to evaluating or tangling. Removes ``noweb'' |
| 15267 | references will be removed when the code block is exported. | 16206 | syntax references when exporting. |
| 15268 | @item @code{eval} | 16207 | @item @code{eval} |
| 15269 | ``Noweb'' syntax references in the body of the code block will only be | 16208 | Expansion of ``Noweb'' syntax references in the body of the @samp{src} code |
| 15270 | expanded before the block is evaluated. | 16209 | block only before evaluating. |
| 15271 | @end itemize | 16210 | @end itemize |
| 15272 | 16211 | ||
| 15273 | @subsubheading Noweb prefix lines | 16212 | @subsubheading Noweb prefix lines |
| 15274 | Noweb insertions are now placed behind the line prefix of the | 16213 | Noweb insertions now honor prefix characters that appear before |
| 15275 | @code{<<reference>>}. | 16214 | @code{<<reference>>}. This behavior is illustrated in the following example. |
| 15276 | This behavior is illustrated in the following example. Because the | 16215 | Because the @code{<<example>>} noweb reference appears behind the SQL comment |
| 15277 | @code{<<example>>} noweb reference appears behind the SQL comment syntax, | 16216 | syntax, each line of the expanded noweb reference will be commented. |
| 15278 | each line of the expanded noweb reference will be commented. | ||
| 15279 | 16217 | ||
| 15280 | This code block: | 16218 | This @samp{src} code block: |
| 15281 | 16219 | ||
| 15282 | @example | 16220 | @example |
| 15283 | -- <<example>> | 16221 | -- <<example>> |
| @@ -15290,23 +16228,20 @@ expands to: | |||
| 15290 | -- multi-line body of example | 16228 | -- multi-line body of example |
| 15291 | @end example | 16229 | @end example |
| 15292 | 16230 | ||
| 15293 | Note that noweb replacement text that does not contain any newlines will not | 16231 | Since this change will not affect noweb replacement text without newlines in |
| 15294 | be affected by this change, so it is still possible to use inline noweb | 16232 | them, inline noweb references are acceptable. |
| 15295 | references. | ||
| 15296 | 16233 | ||
| 15297 | @node noweb-ref, noweb-sep, noweb, Specific header arguments | 16234 | @node noweb-ref |
| 15298 | @subsubsection @code{:noweb-ref} | 16235 | @subsubsection @code{:noweb-ref} |
| 15299 | When expanding ``noweb'' style references the bodies of all code block with | 16236 | @cindex @code{:noweb-ref}, src header argument |
| 15300 | @emph{either} a block name matching the reference name @emph{or} a | ||
| 15301 | @code{:noweb-ref} header argument matching the reference name will be | ||
| 15302 | concatenated together to form the replacement text. | ||
| 15303 | 16237 | ||
| 15304 | By setting this header argument at the sub-tree or file level, simple code | 16238 | When expanding ``noweb'' style references, Org concatenates @samp{src} code |
| 15305 | block concatenation may be achieved. For example, when tangling the | 16239 | blocks by matching the reference name to either the block name or the |
| 15306 | following Org mode file, the bodies of code blocks will be concatenated into | 16240 | @code{:noweb-ref} header argument. |
| 15307 | the resulting pure code file@footnote{(The example needs property inheritance | 16241 | |
| 15308 | to be turned on for the @code{noweb-ref} property, see @ref{Property | 16242 | For simple concatenation, set this @code{:noweb-ref} header argument at the |
| 15309 | inheritance}).}. | 16243 | sub-tree or file level. In the example Org file shown next, the body of the |
| 16244 | source code in each block is extracted for concatenation to a pure code file. | ||
| 15310 | 16245 | ||
| 15311 | @example | 16246 | @example |
| 15312 | #+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh | 16247 | #+BEGIN_SRC sh :tangle yes :noweb yes :shebang #!/bin/sh |
| @@ -15314,7 +16249,7 @@ inheritance}).}. | |||
| 15314 | #+END_SRC | 16249 | #+END_SRC |
| 15315 | * the mount point of the fullest disk | 16250 | * the mount point of the fullest disk |
| 15316 | :PROPERTIES: | 16251 | :PROPERTIES: |
| 15317 | :noweb-ref: fullest-disk | 16252 | :header-args: :noweb-ref fullest-disk |
| 15318 | :END: | 16253 | :END: |
| 15319 | 16254 | ||
| 15320 | ** query all mounted disks | 16255 | ** query all mounted disks |
| @@ -15333,45 +16268,60 @@ inheritance}).}. | |||
| 15333 | #+END_SRC | 16268 | #+END_SRC |
| 15334 | @end example | 16269 | @end example |
| 15335 | 16270 | ||
| 15336 | The @code{:noweb-sep} (see @ref{noweb-sep}) header argument holds the string | 16271 | @node noweb-sep |
| 15337 | used to separate accumulate noweb references like those above. By default a | ||
| 15338 | newline is used. | ||
| 15339 | |||
| 15340 | @node noweb-sep, cache, noweb-ref, Specific header arguments | ||
| 15341 | @subsubsection @code{:noweb-sep} | 16272 | @subsubsection @code{:noweb-sep} |
| 16273 | @cindex @code{:noweb-sep}, src header argument | ||
| 15342 | 16274 | ||
| 15343 | The @code{:noweb-sep} header argument holds the string used to separate | 16275 | By default a newline separates each noweb reference concatenation. To change |
| 15344 | accumulate noweb references (see @ref{noweb-ref}). By default a newline is | 16276 | this newline separator, edit the @code{:noweb-sep} (@pxref{noweb-sep}) header |
| 15345 | used. | 16277 | argument. |
| 15346 | 16278 | ||
| 15347 | @node cache, sep, noweb-sep, Specific header arguments | 16279 | @node cache |
| 15348 | @subsubsection @code{:cache} | 16280 | @subsubsection @code{:cache} |
| 15349 | 16281 | @cindex @code{:cache}, src header argument | |
| 15350 | The @code{:cache} header argument controls the use of in-buffer caching of | 16282 | |
| 15351 | the results of evaluating code blocks. It can be used to avoid re-evaluating | 16283 | The @code{:cache} header argument is for caching results of evaluating code |
| 15352 | unchanged code blocks. Note that the @code{:cache} header argument will not | 16284 | blocks. Caching results can avoid re-evaluating @samp{src} code blocks that |
| 15353 | attempt to cache results when the @code{:session} header argument is used, | 16285 | have not changed since the previous run. To benefit from the cache and avoid |
| 15354 | because the results of the code block execution may be stored in the session | 16286 | redundant evaluations, the source block must have a result already present in |
| 15355 | outside of the Org mode buffer. The @code{:cache} header argument can have | 16287 | the buffer, and neither the header arguments (including the value of |
| 15356 | one of two values: @code{yes} or @code{no}. | 16288 | @code{:var} references) nor the text of the block itself has changed since |
| 16289 | the result was last computed. This feature greatly helps avoid long-running | ||
| 16290 | calculations. For some edge cases, however, the cached results may not be | ||
| 16291 | reliable. | ||
| 16292 | |||
| 16293 | The caching feature is best for when @samp{src} blocks are pure functions, | ||
| 16294 | that is functions that return the same value for the same input arguments | ||
| 16295 | (@pxref{var}), and that do not have side effects, and do not rely on external | ||
| 16296 | variables other than the input arguments. Functions that depend on a timer, | ||
| 16297 | file system objects, and random number generators are clearly unsuitable for | ||
| 16298 | caching. | ||
| 16299 | |||
| 16300 | A note of warning: when @code{:cache} is used for a @code{:session}, caching | ||
| 16301 | may cause unexpected results. | ||
| 16302 | |||
| 16303 | When the caching mechanism tests for any source code changes, it will not | ||
| 16304 | expand ``noweb'' style references (@pxref{Noweb reference syntax}). For | ||
| 16305 | reasons why, see @uref{http://thread.gmane.org/gmane.emacs.orgmode/79046}. | ||
| 16306 | |||
| 16307 | The @code{:cache} header argument can have one of two values: @code{yes} or | ||
| 16308 | @code{no}. | ||
| 15357 | 16309 | ||
| 15358 | @itemize @bullet | 16310 | @itemize @bullet |
| 15359 | @item @code{no} | 16311 | @item @code{no} |
| 15360 | The default. No caching takes place, and the code block will be evaluated | 16312 | Default. No caching of results; @samp{src} code block evaluated every time. |
| 15361 | every time it is called. | ||
| 15362 | @item @code{yes} | 16313 | @item @code{yes} |
| 15363 | Every time the code block is run a SHA1 hash of the code and arguments | 16314 | Whether to run the code or return the cached results is determined by |
| 15364 | passed to the block will be generated. This hash is packed into the | 16315 | comparing the SHA1 hash value of the combined @samp{src} code block and |
| 15365 | @code{#+RESULTS:} line and will be checked on subsequent | 16316 | arguments passed to it. This hash value is packed on the @code{#+RESULTS:} |
| 15366 | executions of the code block. If the code block has not | 16317 | line from previous evaluation. When hash values match, Org does not evaluate |
| 15367 | changed since the last time it was evaluated, it will not be re-evaluated. | 16318 | the @samp{src} code block. When hash values mismatch, Org evaluates the |
| 16319 | @samp{src} code block, inserts the results, recalculates the hash value, and | ||
| 16320 | updates @code{#+RESULTS:} line. | ||
| 15368 | @end itemize | 16321 | @end itemize |
| 15369 | 16322 | ||
| 15370 | Code block caches notice if the value of a variable argument | 16323 | In this example, both functions are cached. But @code{caller} runs only if |
| 15371 | to the code block has changed. If this is the case, the cache is | 16324 | the result from @code{random} has changed since the last run. |
| 15372 | invalidated and the code block is re-run. In the following example, | ||
| 15373 | @code{caller} will not be re-run unless the results of @code{random} have | ||
| 15374 | changed since it was last run. | ||
| 15375 | 16325 | ||
| 15376 | @example | 16326 | @example |
| 15377 | #+NAME: random | 16327 | #+NAME: random |
| @@ -15391,32 +16341,31 @@ changed since it was last run. | |||
| 15391 | 0.254227238707244 | 16341 | 0.254227238707244 |
| 15392 | @end example | 16342 | @end example |
| 15393 | 16343 | ||
| 15394 | @node sep, hlines, cache, Specific header arguments | 16344 | @node sep |
| 15395 | @subsubsection @code{:sep} | 16345 | @subsubsection @code{:sep} |
| 16346 | @cindex @code{:sep}, src header argument | ||
| 15396 | 16347 | ||
| 15397 | The @code{:sep} header argument can be used to control the delimiter used | 16348 | The @code{:sep} header argument is the delimiter for saving results as tables |
| 15398 | when writing tabular results out to files external to Org mode. This is used | 16349 | to files (@pxref{file}) external to Org mode. Org defaults to tab delimited |
| 15399 | either when opening tabular results of a code block by calling the | 16350 | output. The function, @code{org-open-at-point}, which is bound to @kbd{C-c |
| 15400 | @code{org-open-at-point} function bound to @kbd{C-c C-o} on the code block, | 16351 | C-o}, also uses @code{:sep} for opening tabular results. |
| 15401 | or when writing code block results to an external file (see @ref{file}) | ||
| 15402 | header argument. | ||
| 15403 | 16352 | ||
| 15404 | By default, when @code{:sep} is not specified output tables are tab | 16353 | @node hlines |
| 15405 | delimited. | ||
| 15406 | |||
| 15407 | @node hlines, colnames, sep, Specific header arguments | ||
| 15408 | @subsubsection @code{:hlines} | 16354 | @subsubsection @code{:hlines} |
| 16355 | @cindex @code{:hlines}, src header argument | ||
| 15409 | 16356 | ||
| 15410 | Tables are frequently represented with one or more horizontal lines, or | 16357 | In-between each table row or below the table headings, sometimes results have |
| 15411 | hlines. The @code{:hlines} argument to a code block accepts the | 16358 | horizontal lines, which are also known as hlines. The @code{:hlines} |
| 15412 | values @code{yes} or @code{no}, with a default value of @code{no}. | 16359 | argument with the value @code{yes} accepts such lines. The default is |
| 16360 | @code{no}. | ||
| 15413 | 16361 | ||
| 15414 | @itemize @bullet | 16362 | @itemize @bullet |
| 15415 | @item @code{no} | 16363 | @item @code{no} |
| 15416 | Strips horizontal lines from the input table. In most languages this is the | 16364 | Strips horizontal lines from the input table. For most code, this is |
| 15417 | desired effect because an @code{hline} symbol is interpreted as an unbound | 16365 | desirable, or else those @code{hline} symbols raise unbound variable errors. |
| 15418 | variable and raises an error. Setting @code{:hlines no} or relying on the | 16366 | |
| 15419 | default value yields the following results. | 16367 | The default is @code{:hlines no}. The example shows hlines removed from the |
| 16368 | input table. | ||
| 15420 | 16369 | ||
| 15421 | @example | 16370 | @example |
| 15422 | #+NAME: many-cols | 16371 | #+NAME: many-cols |
| @@ -15438,7 +16387,7 @@ default value yields the following results. | |||
| 15438 | @end example | 16387 | @end example |
| 15439 | 16388 | ||
| 15440 | @item @code{yes} | 16389 | @item @code{yes} |
| 15441 | Leaves hlines in the table. Setting @code{:hlines yes} has this effect. | 16390 | For @code{:hlines yes}, the example shows hlines unchanged. |
| 15442 | 16391 | ||
| 15443 | @example | 16392 | @example |
| 15444 | #+NAME: many-cols | 16393 | #+NAME: many-cols |
| @@ -15462,20 +16411,20 @@ Leaves hlines in the table. Setting @code{:hlines yes} has this effect. | |||
| 15462 | @end example | 16411 | @end example |
| 15463 | @end itemize | 16412 | @end itemize |
| 15464 | 16413 | ||
| 15465 | @node colnames, rownames, hlines, Specific header arguments | 16414 | @node colnames |
| 15466 | @subsubsection @code{:colnames} | 16415 | @subsubsection @code{:colnames} |
| 16416 | @cindex @code{:colnames}, src header argument | ||
| 15467 | 16417 | ||
| 15468 | The @code{:colnames} header argument accepts the values @code{yes}, | 16418 | The @code{:colnames} header argument accepts @code{yes}, @code{no}, or |
| 15469 | @code{no}, or @code{nil} for unassigned. The default value is @code{nil}. | 16419 | @code{nil} values. The default value is @code{nil}, which is unassigned. |
| 15470 | Note that the behavior of the @code{:colnames} header argument may differ | 16420 | But this header argument behaves differently depending on the source code |
| 15471 | across languages. | 16421 | language. |
| 15472 | 16422 | ||
| 15473 | @itemize @bullet | 16423 | @itemize @bullet |
| 15474 | @item @code{nil} | 16424 | @item @code{nil} |
| 15475 | If an input table looks like it has column names | 16425 | If an input table has column names (because the second row is an hline), then |
| 15476 | (because its second row is an hline), then the column | 16426 | Org removes the column names, processes the table, puts back the column |
| 15477 | names will be removed from the table before | 16427 | names, and then writes the table to the results block. |
| 15478 | processing, then reapplied to the results. | ||
| 15479 | 16428 | ||
| 15480 | @example | 16429 | @example |
| 15481 | #+NAME: less-cols | 16430 | #+NAME: less-cols |
| @@ -15496,33 +16445,36 @@ processing, then reapplied to the results. | |||
| 15496 | | c* | | 16445 | | c* | |
| 15497 | @end example | 16446 | @end example |
| 15498 | 16447 | ||
| 15499 | Please note that column names are not removed before the table is indexed | 16448 | Note that column names have to accounted for when using variable indexing |
| 15500 | using variable indexing @xref{var, Indexable variable values}. | 16449 | (@pxref{var, Indexable variable values}) because column names are not removed |
| 16450 | for indexing. | ||
| 15501 | 16451 | ||
| 15502 | @item @code{no} | 16452 | @item @code{no} |
| 15503 | No column name pre-processing takes place | 16453 | Do not pre-process column names. |
| 15504 | 16454 | ||
| 15505 | @item @code{yes} | 16455 | @item @code{yes} |
| 15506 | Column names are removed and reapplied as with @code{nil} even if the table | 16456 | For an input table that has no hlines, process it like the @code{nil} |
| 15507 | does not ``look like'' it has column names (i.e., the second row is not an | 16457 | value. That is, Org removes the column names, processes the table, puts back |
| 15508 | hline) | 16458 | the column names, and then writes the table to the results block. |
| 15509 | @end itemize | 16459 | @end itemize |
| 15510 | 16460 | ||
| 15511 | @node rownames, shebang, colnames, Specific header arguments | 16461 | @node rownames |
| 15512 | @subsubsection @code{:rownames} | 16462 | @subsubsection @code{:rownames} |
| 16463 | @cindex @code{:rownames}, src header argument | ||
| 15513 | 16464 | ||
| 15514 | The @code{:rownames} header argument can take on the values @code{yes} or | 16465 | The @code{:rownames} header argument can take on values @code{yes} or |
| 15515 | @code{no}, with a default value of @code{no}. Note that Emacs Lisp code | 16466 | @code{no} values. The default is @code{no}. Note that @code{emacs-lisp} |
| 15516 | blocks ignore the @code{:rownames} header argument entirely given the ease | 16467 | code blocks ignore @code{:rownames} header argument because of the ease of |
| 15517 | with which tables with row names may be handled directly in Emacs Lisp. | 16468 | table-handling in Emacs. |
| 15518 | 16469 | ||
| 15519 | @itemize @bullet | 16470 | @itemize @bullet |
| 15520 | @item @code{no} | 16471 | @item @code{no} |
| 15521 | No row name pre-processing will take place. | 16472 | Org will not pre-process row names. |
| 15522 | 16473 | ||
| 15523 | @item @code{yes} | 16474 | @item @code{yes} |
| 15524 | The first column of the table is removed from the table before processing, | 16475 | If an input table has row names, then Org removes the row names, processes |
| 15525 | and is then reapplied to the results. | 16476 | the table, puts back the row names, and then writes the table to the results |
| 16477 | block. | ||
| 15526 | 16478 | ||
| 15527 | @example | 16479 | @example |
| 15528 | #+NAME: with-rownames | 16480 | #+NAME: with-rownames |
| @@ -15539,82 +16491,88 @@ and is then reapplied to the results. | |||
| 15539 | | two | 16 | 17 | 18 | 19 | 20 | | 16491 | | two | 16 | 17 | 18 | 19 | 20 | |
| 15540 | @end example | 16492 | @end example |
| 15541 | 16493 | ||
| 15542 | Please note that row names are not removed before the table is indexed using | 16494 | Note that row names have to accounted for when using variable indexing |
| 15543 | variable indexing @xref{var, Indexable variable values}. | 16495 | (@pxref{var, Indexable variable values}) because row names are not removed |
| 16496 | for indexing. | ||
| 15544 | 16497 | ||
| 15545 | @end itemize | 16498 | @end itemize |
| 15546 | 16499 | ||
| 15547 | @node shebang, tangle-mode, rownames, Specific header arguments | 16500 | @node shebang |
| 15548 | @subsubsection @code{:shebang} | 16501 | @subsubsection @code{:shebang} |
| 16502 | @cindex @code{:shebang}, src header argument | ||
| 15549 | 16503 | ||
| 15550 | Setting the @code{:shebang} header argument to a string value | 16504 | This header argument can turn results into executable script files. By |
| 15551 | (e.g., @code{:shebang "#!/bin/bash"}) causes the string to be inserted as the | 16505 | setting the @code{:shebang} header argument to a string value (for example, |
| 15552 | first line of any tangled file holding the code block, and the file | 16506 | @code{:shebang "#!/bin/bash"}), Org inserts that string as the first line of |
| 15553 | permissions of the tangled file are set to make it executable. | 16507 | the tangled file that the @samp{src} code block is extracted to. Org then |
| 15554 | 16508 | turns on the tangled file's executable permission. | |
| 15555 | 16509 | ||
| 15556 | @node tangle-mode, eval, shebang, Specific header arguments | 16510 | @node tangle-mode |
| 15557 | @subsubsection @code{:tangle-mode} | 16511 | @subsubsection @code{:tangle-mode} |
| 16512 | @cindex @code{:tangle-mode}, src header argument | ||
| 16513 | |||
| 16514 | The @code{tangle-mode} header argument specifies what permissions to set for | ||
| 16515 | tangled files by @code{set-file-modes}. For example, to make read-only | ||
| 16516 | tangled file, use @code{:tangle-mode (identity #o444)}. To make it | ||
| 16517 | executable, use @code{:tangle-mode (identity #o755)}. | ||
| 16518 | |||
| 16519 | On @samp{src} code blocks with @code{shebang} (@pxref{shebang}) header | ||
| 16520 | argument, Org will automatically set the tangled file to executable | ||
| 16521 | permissions. But this can be overridden with custom permissions using | ||
| 16522 | @code{tangle-mode} header argument. | ||
| 15558 | 16523 | ||
| 15559 | The @code{tangle-mode} header argument controls the permission set on tangled | 16524 | When multiple @samp{src} code blocks tangle to a single file with different |
| 15560 | files. The value of this header argument will be passed to | 16525 | and conflicting @code{tangle-mode} header arguments, Org's behavior is |
| 15561 | @code{set-file-modes}. For example, to set a tangled file as read only use | 16526 | undefined. |
| 15562 | @code{:tangle-mode (identity #o444)}, or to set a tangled file as executable | 16527 | |
| 15563 | use @code{:tangle-mode (identity #o755)}. Blocks with @code{shebang} | 16528 | @node eval |
| 15564 | (@ref{shebang}) header arguments will automatically be made executable unless | ||
| 15565 | the @code{tangle-mode} header argument is also used. The behavior is | ||
| 15566 | undefined if multiple code blocks with different values for the | ||
| 15567 | @code{tangle-mode} header argument are tangled to the same file. | ||
| 15568 | |||
| 15569 | @node eval, wrap, tangle-mode, Specific header arguments | ||
| 15570 | @subsubsection @code{:eval} | 16529 | @subsubsection @code{:eval} |
| 15571 | The @code{:eval} header argument can be used to limit the evaluation of | 16530 | @cindex @code{:eval}, src header argument |
| 15572 | specific code blocks. The @code{:eval} header argument can be useful for | 16531 | The @code{:eval} header argument can limit evaluation of specific code |
| 15573 | protecting against the evaluation of dangerous code blocks or to ensure that | 16532 | blocks. It is useful for protection against evaluating untrusted @samp{src} |
| 15574 | evaluation will require a query regardless of the value of the | 16533 | code blocks by prompting for a confirmation. This protection is independent |
| 15575 | @code{org-confirm-babel-evaluate} variable. The possible values of | 16534 | of the @code{org-confirm-babel-evaluate} setting. |
| 15576 | @code{:eval} and their effects are shown below. | ||
| 15577 | 16535 | ||
| 15578 | @table @code | 16536 | @table @code |
| 15579 | @item never or no | 16537 | @item never or no |
| 15580 | The code block will not be evaluated under any circumstances. | 16538 | Org will never evaluate this @samp{src} code block. |
| 15581 | @item query | 16539 | @item query |
| 15582 | Evaluation of the code block will require a query. | 16540 | Org prompts the user for permission to evaluate this @samp{src} code block. |
| 15583 | @item never-export or no-export | 16541 | @item never-export or no-export |
| 15584 | The code block will not be evaluated during export but may still be called | 16542 | Org will not evaluate this @samp{src} code block when exporting, yet the user |
| 15585 | interactively. | 16543 | can evaluate this source block interactively. |
| 15586 | @item query-export | 16544 | @item query-export |
| 15587 | Evaluation of the code block during export will require a query. | 16545 | Org prompts the user for permission to export this @samp{src} code block. |
| 15588 | @end table | 16546 | @end table |
| 15589 | 16547 | ||
| 15590 | If this header argument is not set then evaluation is determined by the value | 16548 | If @code{:eval} header argument is not set for a source block, then Org |
| 15591 | of the @code{org-confirm-babel-evaluate} variable see @ref{Code evaluation | 16549 | determines whether to evaluate from the @code{org-confirm-babel-evaluate} |
| 15592 | security}. | 16550 | variable (@pxref{Code evaluation security}). |
| 15593 | 16551 | ||
| 15594 | @node wrap, post, eval, Specific header arguments | 16552 | @node wrap |
| 15595 | @subsubsection @code{:wrap} | 16553 | @subsubsection @code{:wrap} |
| 15596 | The @code{:wrap} header argument is used to mark the results of source block | 16554 | @cindex @code{:wrap}, src header argument |
| 15597 | evaluation. The header argument can be passed a string that will be appended | 16555 | The @code{:wrap} header argument marks the results block by appending strings |
| 15598 | to @code{#+BEGIN_} and @code{#+END_}, which will then be used to wrap the | 16556 | to @code{#+BEGIN_} and @code{#+END_}. If no string is specified, Org wraps |
| 15599 | results. If not string is specified then the results will be wrapped in a | 16557 | the results in a @code{#+BEGIN/END_RESULTS} block. |
| 15600 | @code{#+BEGIN/END_RESULTS} block. | ||
| 15601 | 16558 | ||
| 15602 | @node post, prologue, wrap, Specific header arguments | 16559 | @node post |
| 15603 | @subsubsection @code{:post} | 16560 | @subsubsection @code{:post} |
| 15604 | The @code{:post} header argument is used to post-process the results of a | 16561 | @cindex @code{:post}, src header argument |
| 15605 | code block execution. When a post argument is given, the results of the code | 16562 | The @code{:post} header argument is for post-processing results from |
| 15606 | block will temporarily be bound to the @code{*this*} variable. This variable | 16563 | @samp{src} block evaluation. When @code{:post} has any value, Org binds the |
| 15607 | may then be included in header argument forms such as those used in @ref{var} | 16564 | results to @code{*this*} variable for easy passing to @ref{var} header |
| 15608 | header argument specifications allowing passing of results to other code | 16565 | argument specifications. That makes results available to other @samp{src} |
| 15609 | blocks, or direct execution via Emacs Lisp. | 16566 | code blocks, or for even direct Emacs Lisp code execution. |
| 15610 | 16567 | ||
| 15611 | The following example illustrates the usage of the @code{:post} header | 16568 | The following two examples illustrate @code{:post} header argument in action. |
| 15612 | argument. | 16569 | The first one shows how to attach @code{#+ATTR_LATEX:} line using |
| 16570 | @code{:post}. | ||
| 15613 | 16571 | ||
| 15614 | @example | 16572 | @example |
| 15615 | #+name: attr_wrap | 16573 | #+name: attr_wrap |
| 15616 | #+begin_src sh :var data="" :var width="\\textwidth" :results output | 16574 | #+begin_src sh :var data="" :var width="\\textwidth" :results output |
| 15617 | echo "#+ATTR_LATEX :width $width" | 16575 | echo "#+ATTR_LATEX: :width $width" |
| 15618 | echo "$data" | 16576 | echo "$data" |
| 15619 | #+end_src | 16577 | #+end_src |
| 15620 | 16578 | ||
| @@ -15634,33 +16592,65 @@ argument. | |||
| 15634 | :END: | 16592 | :END: |
| 15635 | @end example | 16593 | @end example |
| 15636 | 16594 | ||
| 15637 | @node prologue, epilogue, post, Specific header arguments | 16595 | The second example shows use of @code{:colnames} in @code{:post} to pass |
| 16596 | data between @samp{src} code blocks. | ||
| 16597 | |||
| 16598 | @example | ||
| 16599 | #+name: round-tbl | ||
| 16600 | #+begin_src emacs-lisp :var tbl="" fmt="%.3f" | ||
| 16601 | (mapcar (lambda (row) | ||
| 16602 | (mapcar (lambda (cell) | ||
| 16603 | (if (numberp cell) | ||
| 16604 | (format fmt cell) | ||
| 16605 | cell)) | ||
| 16606 | row)) | ||
| 16607 | tbl) | ||
| 16608 | #+end_src | ||
| 16609 | |||
| 16610 | #+begin_src R :colnames yes :post round-tbl[:colnames yes](*this*) | ||
| 16611 | set.seed(42) | ||
| 16612 | data.frame(foo=rnorm(1)) | ||
| 16613 | #+end_src | ||
| 16614 | |||
| 16615 | #+RESULTS: | ||
| 16616 | | foo | | ||
| 16617 | |-------| | ||
| 16618 | | 1.371 | | ||
| 16619 | @end example | ||
| 16620 | |||
| 16621 | @node prologue | ||
| 15638 | @subsubsection @code{:prologue} | 16622 | @subsubsection @code{:prologue} |
| 15639 | The value of the @code{prologue} header argument will be prepended to the | 16623 | @cindex @code{:prologue}, src header argument |
| 15640 | code block body before execution. For example, @code{:prologue "reset"} may | 16624 | The @code{prologue} header argument is for appending to the top of the code |
| 15641 | be used to reset a gnuplot session before execution of a particular code | 16625 | block for execution. For example, a clear or reset code at the start of new |
| 15642 | block, or the following configuration may be used to do this for all gnuplot | 16626 | execution of a @samp{src} code block. A @code{reset} for @samp{gnuplot}: |
| 15643 | code blocks. Also see @ref{epilogue}. | 16627 | @code{:prologue "reset"}. See also @ref{epilogue}. |
| 15644 | 16628 | ||
| 15645 | @lisp | 16629 | @lisp |
| 15646 | (add-to-list 'org-babel-default-header-args:gnuplot | 16630 | (add-to-list 'org-babel-default-header-args:gnuplot |
| 15647 | '((:prologue . "reset"))) | 16631 | '((:prologue . "reset"))) |
| 15648 | @end lisp | 16632 | @end lisp |
| 15649 | 16633 | ||
| 15650 | @node epilogue, , prologue, Specific header arguments | 16634 | @node epilogue |
| 15651 | @subsubsection @code{:epilogue} | 16635 | @subsubsection @code{:epilogue} |
| 15652 | The value of the @code{epilogue} header argument will be appended to the code | 16636 | @cindex @code{:epilogue}, src header argument |
| 15653 | block body before execution. Also see @ref{prologue}. | 16637 | The value of the @code{epilogue} header argument is for appending to the end |
| 16638 | of the code block for execution. See also @ref{prologue}. | ||
| 15654 | 16639 | ||
| 15655 | @node Results of evaluation, Noweb reference syntax, Header arguments, Working With Source Code | 16640 | @node Results of evaluation |
| 15656 | @section Results of evaluation | 16641 | @section Results of evaluation |
| 15657 | @cindex code block, results of evaluation | 16642 | @cindex code block, results of evaluation |
| 15658 | @cindex source code, results of evaluation | 16643 | @cindex source code, results of evaluation |
| 15659 | 16644 | ||
| 15660 | The way in which results are handled depends on whether a session is invoked, | 16645 | How Org handles results of a code block execution depends on many header |
| 15661 | as well as on whether @code{:results value} or @code{:results output} is | 16646 | arguments working together. Here is only a summary of these. For an |
| 15662 | used. The following table shows the table possibilities. For a full listing | 16647 | enumeration of all the header arguments that affect results, see |
| 15663 | of the possible results header arguments see @ref{results}. | 16648 | @ref{results}. |
| 16649 | |||
| 16650 | The primary determinant is the execution context. Is it in a @code{:session} | ||
| 16651 | or not? Orthogonal to that is if the expected result is a @code{:results | ||
| 16652 | value} or @code{:results output}, which is a concatenation of output from | ||
| 16653 | start to finish of the @samp{src} code block's evaluation. | ||
| 15664 | 16654 | ||
| 15665 | @multitable @columnfractions 0.26 0.33 0.41 | 16655 | @multitable @columnfractions 0.26 0.33 0.41 |
| 15666 | @item @tab @b{Non-session} @tab @b{Session} | 16656 | @item @tab @b{Non-session} @tab @b{Session} |
| @@ -15668,51 +16658,54 @@ of the possible results header arguments see @ref{results}. | |||
| 15668 | @item @code{:results output} @tab contents of STDOUT @tab concatenation of interpreter output | 16658 | @item @code{:results output} @tab contents of STDOUT @tab concatenation of interpreter output |
| 15669 | @end multitable | 16659 | @end multitable |
| 15670 | 16660 | ||
| 15671 | Note: With @code{:results value}, the result in both @code{:session} and | 16661 | For @code{:session} and non-session, the @code{:results value} turns the |
| 15672 | non-session is returned to Org mode as a table (a one- or two-dimensional | 16662 | results into an Org mode table format. Single values are wrapped in a one |
| 15673 | vector of strings or numbers) when appropriate. | 16663 | dimensional vector. Rows and columns of a table are wrapped in a |
| 16664 | two-dimensional vector. | ||
| 15674 | 16665 | ||
| 15675 | @subsection Non-session | 16666 | @subsection Non-session |
| 15676 | @subsubsection @code{:results value} | 16667 | @subsubsection @code{:results value} |
| 15677 | This is the default. Internally, the value is obtained by wrapping the code | 16668 | @cindex @code{:results}, src header argument |
| 15678 | in a function definition in the external language, and evaluating that | 16669 | Default. Org gets the value by wrapping the code in a function definition in |
| 15679 | function. Therefore, code should be written as if it were the body of such a | 16670 | the language of the @samp{src} block. That is why when using @code{:results |
| 15680 | function. In particular, note that Python does not automatically return a | 16671 | value}, code should execute like a function and return a value. For |
| 15681 | value from a function unless a @code{return} statement is present, and so a | 16672 | languages like Python, an explicit @code{return} statement is mandatory when |
| 15682 | @samp{return} statement will usually be required in Python. | 16673 | using @code{:results value}. |
| 15683 | 16674 | ||
| 15684 | This is the only one of the four evaluation contexts in which the code is | 16675 | This is one of four evaluation contexts where Org automatically wraps the |
| 15685 | automatically wrapped in a function definition. | 16676 | code in a function definition. |
| 15686 | 16677 | ||
| 15687 | @subsubsection @code{:results output} | 16678 | @subsubsection @code{:results output} |
| 15688 | The code is passed to the interpreter as an external process, and the | 16679 | @cindex @code{:results}, src header argument |
| 15689 | contents of the standard output stream are returned as text. (In certain | 16680 | For @code{:results output}, the code is passed to an external process running |
| 15690 | languages this also contains the error output stream; this is an area for | 16681 | the interpreter. Org returns the contents of the standard output stream as |
| 15691 | future work.) | 16682 | as text results. |
| 15692 | 16683 | ||
| 15693 | @subsection Session | 16684 | @subsection Session |
| 15694 | @subsubsection @code{:results value} | 16685 | @subsubsection @code{:results value} |
| 15695 | The code is passed to an interpreter running as an interactive Emacs inferior | 16686 | @cindex @code{:results}, src header argument |
| 15696 | process. Only languages which provide tools for interactive evaluation of | 16687 | For @code{:results value} from a @code{:session}, Org passes the code to an |
| 15697 | code have session support, so some language (e.g., C and ditaa) do not | 16688 | interpreter running as an interactive Emacs inferior process. So only |
| 15698 | support the @code{:session} header argument, and in other languages (e.g., | 16689 | languages that provide interactive evaluation can have session support. Not |
| 15699 | Python and Haskell) which have limitations on the code which may be entered | 16690 | all languages provide this support, such as @samp{C} and @samp{ditaa}. Even |
| 15700 | into interactive sessions, those limitations apply to the code in code blocks | 16691 | those that do support, such as @samp{Python} and @samp{Haskell}, they impose |
| 15701 | using the @code{:session} header argument as well. | 16692 | limitations on allowable language constructs that can run interactively. Org |
| 15702 | 16693 | inherits those limitations for those @samp{src} code blocks running in a | |
| 15703 | Unless the @code{:results output} option is supplied (see below) the result | 16694 | @code{:session}. |
| 15704 | returned is the result of the last evaluation performed by the | 16695 | |
| 15705 | interpreter. (This is obtained in a language-specific manner: the value of | 16696 | Org gets the value from the source code interpreter's last statement |
| 15706 | the variable @code{_} in Python and Ruby, and the value of @code{.Last.value} | 16697 | output. Org has to use language-specific methods to obtain the value. For |
| 15707 | in R). | 16698 | example, from the variable @code{_} in @samp{Python} and @samp{Ruby}, and the |
| 16699 | value of @code{.Last.value} in @samp{R}). | ||
| 15708 | 16700 | ||
| 15709 | @subsubsection @code{:results output} | 16701 | @subsubsection @code{:results output} |
| 15710 | The code is passed to the interpreter running as an interactive Emacs | 16702 | @cindex @code{:results}, src header argument |
| 15711 | inferior process. The result returned is the concatenation of the sequence of | 16703 | For @code{:results output}, Org passes the code to the interpreter running as |
| 15712 | (text) output from the interactive interpreter. Notice that this is not | 16704 | an interactive Emacs inferior process. Org concatenates whatever text output |
| 15713 | necessarily the same as what would be sent to @code{STDOUT} if the same code | 16705 | emitted by the interpreter to return the collection as a result. Note that |
| 15714 | were passed to a non-interactive interpreter running as an external | 16706 | this collection is not the same as collected from @code{STDOUT} of a |
| 15715 | process. For example, compare the following two blocks: | 16707 | non-interactive interpreter running as an external process. Compare for |
| 16708 | example these two blocks: | ||
| 15716 | 16709 | ||
| 15717 | @example | 16710 | @example |
| 15718 | #+BEGIN_SRC python :results output | 16711 | #+BEGIN_SRC python :results output |
| @@ -15726,7 +16719,8 @@ process. For example, compare the following two blocks: | |||
| 15726 | : bye | 16719 | : bye |
| 15727 | @end example | 16720 | @end example |
| 15728 | 16721 | ||
| 15729 | In non-session mode, the ``2'' is not printed and does not appear. | 16722 | In the above non-session mode, the ``2'' is not printed; so does not appear |
| 16723 | in results. | ||
| 15730 | 16724 | ||
| 15731 | @example | 16725 | @example |
| 15732 | #+BEGIN_SRC python :results output :session | 16726 | #+BEGIN_SRC python :results output :session |
| @@ -15741,60 +16735,61 @@ In non-session mode, the ``2'' is not printed and does not appear. | |||
| 15741 | : bye | 16735 | : bye |
| 15742 | @end example | 16736 | @end example |
| 15743 | 16737 | ||
| 15744 | But in @code{:session} mode, the interactive interpreter receives input ``2'' | 16738 | In the above @code{:session} mode, the interactive interpreter receives and |
| 15745 | and prints out its value, ``2''. (Indeed, the other print statements are | 16739 | prints ``2''. Results show that. |
| 15746 | unnecessary here). | ||
| 15747 | 16740 | ||
| 15748 | @node Noweb reference syntax, Key bindings and useful functions, Results of evaluation, Working With Source Code | 16741 | @node Noweb reference syntax |
| 15749 | @section Noweb reference syntax | 16742 | @section Noweb reference syntax |
| 15750 | @cindex code block, noweb reference | 16743 | @cindex code block, noweb reference |
| 15751 | @cindex syntax, noweb | 16744 | @cindex syntax, noweb |
| 15752 | @cindex source code, noweb reference | 16745 | @cindex source code, noweb reference |
| 15753 | 16746 | ||
| 15754 | The ``noweb'' (see @uref{http://www.cs.tufts.edu/~nr/noweb/}) Literate | 16747 | Org supports named blocks in ``noweb'' style syntax. For ``noweb'' literate |
| 15755 | Programming system allows named blocks of code to be referenced by using the | 16748 | programming details, see @uref{http://www.cs.tufts.edu/~nr/noweb/}). |
| 15756 | familiar Noweb syntax: | ||
| 15757 | 16749 | ||
| 15758 | @example | 16750 | @example |
| 15759 | <<code-block-name>> | 16751 | <<code-block-name>> |
| 15760 | @end example | 16752 | @end example |
| 15761 | 16753 | ||
| 15762 | When a code block is tangled or evaluated, whether or not ``noweb'' | 16754 | For the header argument @code{:noweb yes}, Org expands ``noweb'' style |
| 15763 | references are expanded depends upon the value of the @code{:noweb} header | 16755 | references in the @samp{src} code block before evaluation. |
| 15764 | argument. If @code{:noweb yes}, then a Noweb reference is expanded before | 16756 | |
| 15765 | evaluation. If @code{:noweb no}, the default, then the reference is not | 16757 | For the header argument @code{:noweb no}, Org does not expand ``noweb'' style |
| 15766 | expanded before evaluation. See the @ref{noweb-ref} header argument for | 16758 | references in the @samp{src} code block before evaluation. |
| 15767 | a more flexible way to resolve noweb references. | 16759 | |
| 16760 | The default is @code{:noweb no}. | ||
| 16761 | |||
| 16762 | Org offers a more flexible way to resolve ``noweb'' style references | ||
| 16763 | (@pxref{noweb-ref}). | ||
| 16764 | |||
| 16765 | Org can handle naming of @emph{results} block, rather than the body of the | ||
| 16766 | @samp{src} code block, using ``noweb'' style references. | ||
| 15768 | 16767 | ||
| 15769 | It is possible to include the @emph{results} of a code block rather than the | 16768 | For ``noweb'' style reference, append parenthesis to the code block name for |
| 15770 | body. This is done by appending parenthesis to the code block name which may | 16769 | arguments, as shown in this example: |
| 15771 | optionally contain arguments to the code block as shown below. | ||
| 15772 | 16770 | ||
| 15773 | @example | 16771 | @example |
| 15774 | <<code-block-name(optional arguments)>> | 16772 | <<code-block-name(optional arguments)>> |
| 15775 | @end example | 16773 | @end example |
| 15776 | 16774 | ||
| 15777 | Note: the default value, @code{:noweb no}, was chosen to ensure that | 16775 | Note: Org defaults to @code{:noweb no} so as not to cause errors in languages |
| 15778 | correct code is not broken in a language, such as Ruby, where | 16776 | such as @samp{Ruby} where ``noweb'' syntax is equally valid characters. For |
| 15779 | @code{<<arg>>} is a syntactically valid construct. If @code{<<arg>>} is not | 16777 | example, @code{<<arg>>}. Change Org's default to @code{:noweb yes} for |
| 15780 | syntactically valid in languages that you use, then please consider setting | 16778 | languages where there is no risk of confusion. |
| 15781 | the default value. | ||
| 15782 | 16779 | ||
| 15783 | Note: if noweb tangling is slow in large Org mode files consider setting the | 16780 | For faster tangling of large Org mode files, set |
| 15784 | @code{org-babel-use-quick-and-dirty-noweb-expansion} variable to @code{t}. | 16781 | @code{org-babel-use-quick-and-dirty-noweb-expansion} variable to @code{t}. |
| 15785 | This will result in faster noweb reference resolution at the expense of not | 16782 | The speedup comes at the expense of not correctly resolving inherited values |
| 15786 | correctly resolving inherited values of the @code{:noweb-ref} header | 16783 | of the @code{:noweb-ref} header argument. |
| 15787 | argument. | 16784 | |
| 15788 | 16785 | ||
| 15789 | @node Key bindings and useful functions, Batch execution, Noweb reference syntax, Working With Source Code | 16786 | @node Key bindings and useful functions |
| 15790 | @section Key bindings and useful functions | 16787 | @section Key bindings and useful functions |
| 15791 | @cindex code block, key bindings | 16788 | @cindex code block, key bindings |
| 15792 | 16789 | ||
| 15793 | Many common Org mode key sequences are re-bound depending on | 16790 | Many common Org mode key sequences are re-bound depending on the context. |
| 15794 | the context. | ||
| 15795 | 16791 | ||
| 15796 | Within a code block, the following key bindings | 16792 | Active key bindings in code blocks: |
| 15797 | are active: | ||
| 15798 | 16793 | ||
| 15799 | @multitable @columnfractions 0.25 0.75 | 16794 | @multitable @columnfractions 0.25 0.75 |
| 15800 | @kindex C-c C-c | 16795 | @kindex C-c C-c |
| @@ -15807,9 +16802,9 @@ are active: | |||
| 15807 | @item @kbd{M-@key{down}} @tab @code{org-babel-switch-to-session} | 16802 | @item @kbd{M-@key{down}} @tab @code{org-babel-switch-to-session} |
| 15808 | @end multitable | 16803 | @end multitable |
| 15809 | 16804 | ||
| 15810 | In an Org mode buffer, the following key bindings are active: | 16805 | Active key bindings in Org mode buffer: |
| 15811 | 16806 | ||
| 15812 | @multitable @columnfractions 0.45 0.55 | 16807 | @multitable @columnfractions 0.5 0.5 |
| 15813 | @kindex C-c C-v p | 16808 | @kindex C-c C-v p |
| 15814 | @kindex C-c C-v C-p | 16809 | @kindex C-c C-v C-p |
| 15815 | @item @kbd{C-c C-v p} @ @ @r{or} @ @ @kbd{C-c C-v C-p} @tab @code{org-babel-previous-src-block} | 16810 | @item @kbd{C-c C-v p} @ @ @r{or} @ @ @kbd{C-c C-v C-p} @tab @code{org-babel-previous-src-block} |
| @@ -15878,8 +16873,7 @@ In an Org mode buffer, the following key bindings are active: | |||
| 15878 | @item @kbd{C-c C-v x} @ @ @r{or} @ @ @kbd{C-c C-v C-x} @tab @code{org-babel-do-key-sequence-in-edit-buffer} | 16873 | @item @kbd{C-c C-v x} @ @ @r{or} @ @ @kbd{C-c C-v C-x} @tab @code{org-babel-do-key-sequence-in-edit-buffer} |
| 15879 | @end multitable | 16874 | @end multitable |
| 15880 | 16875 | ||
| 15881 | @c When possible these keybindings were extended to work when the control key is | 16876 | @c Extended key bindings when control key is kept pressed: |
| 15882 | @c kept pressed, resulting in the following additional keybindings. | ||
| 15883 | 16877 | ||
| 15884 | @c @multitable @columnfractions 0.25 0.75 | 16878 | @c @multitable @columnfractions 0.25 0.75 |
| 15885 | @c @item @kbd{C-c C-v C-a} @tab @code{org-babel-sha1-hash} | 16879 | @c @item @kbd{C-c C-v C-a} @tab @code{org-babel-sha1-hash} |
| @@ -15892,15 +16886,18 @@ In an Org mode buffer, the following key bindings are active: | |||
| 15892 | @c @item @kbd{C-c C-v C-z} @tab @code{org-babel-switch-to-session} | 16886 | @c @item @kbd{C-c C-v C-z} @tab @code{org-babel-switch-to-session} |
| 15893 | @c @end multitable | 16887 | @c @end multitable |
| 15894 | 16888 | ||
| 15895 | @node Batch execution, , Key bindings and useful functions, Working With Source Code | 16889 | @node Batch execution |
| 15896 | @section Batch execution | 16890 | @section Batch execution |
| 15897 | @cindex code block, batch execution | 16891 | @cindex code block, batch execution |
| 15898 | @cindex source code, batch execution | 16892 | @cindex source code, batch execution |
| 15899 | 16893 | ||
| 15900 | It is possible to call functions from the command line. This shell | 16894 | Org mode features, including working with source code facilities can be |
| 15901 | script calls @code{org-babel-tangle} on every one of its arguments. | 16895 | invoked from the command line. This enables building shell scripts for batch |
| 16896 | processing, running automated system tasks, and expanding Org mode's | ||
| 16897 | usefulness. | ||
| 15902 | 16898 | ||
| 15903 | Be sure to adjust the paths to fit your system. | 16899 | The sample script shows batch processing of multiple files using |
| 16900 | @code{org-babel-tangle}. | ||
| 15904 | 16901 | ||
| 15905 | @example | 16902 | @example |
| 15906 | #!/bin/sh | 16903 | #!/bin/sh |
| @@ -15917,35 +16914,33 @@ for i in $@@; do | |||
| 15917 | done | 16914 | done |
| 15918 | 16915 | ||
| 15919 | emacs -Q --batch \ | 16916 | emacs -Q --batch \ |
| 15920 | --eval "(progn | 16917 | --eval "(progn |
| 15921 | (add-to-list 'load-path (expand-file-name \"~/src/org/lisp/\")) | 16918 | (require 'org)(require 'ob)(require 'ob-tangle) |
| 15922 | (add-to-list 'load-path (expand-file-name \"~/src/org/contrib/lisp/\" t)) | 16919 | (mapc (lambda (file) |
| 15923 | (require 'org)(require 'org-exp)(require 'ob)(require 'ob-tangle) | 16920 | (find-file (expand-file-name file \"$DIR\")) |
| 15924 | (mapc (lambda (file) | 16921 | (org-babel-tangle) |
| 15925 | (find-file (expand-file-name file \"$DIR\")) | 16922 | (kill-buffer)) '($FILES)))" 2>&1 |grep -i tangled |
| 15926 | (org-babel-tangle) | ||
| 15927 | (kill-buffer)) '($FILES)))" 2>&1 |grep tangled | ||
| 15928 | @end example | 16923 | @end example |
| 15929 | 16924 | ||
| 15930 | @node Miscellaneous, Hacking, Working With Source Code, Top | 16925 | @node Miscellaneous |
| 15931 | @chapter Miscellaneous | 16926 | @chapter Miscellaneous |
| 15932 | 16927 | ||
| 15933 | @menu | 16928 | @menu |
| 15934 | * Completion:: M-TAB knows what you need | 16929 | * Completion:: M-TAB guesses completions |
| 15935 | * Easy Templates:: Quick insertion of structural elements | 16930 | * Easy templates:: Quick insertion of structural elements |
| 15936 | * Speed keys:: Electric commands at the beginning of a headline | 16931 | * Speed keys:: Electric commands at the beginning of a headline |
| 15937 | * Code evaluation security:: Org mode files evaluate inline code | 16932 | * Code evaluation security:: Org mode files evaluate inline code |
| 15938 | * Customization:: Adapting Org to your taste | 16933 | * Customization:: Adapting Org to changing tastes |
| 15939 | * In-buffer settings:: Overview of the #+KEYWORDS | 16934 | * In-buffer settings:: Overview of the #+KEYWORDS |
| 15940 | * The very busy C-c C-c key:: When in doubt, press C-c C-c | 16935 | * The very busy C-c C-c key:: When in doubt, press C-c C-c |
| 15941 | * Clean view:: Getting rid of leading stars in the outline | 16936 | * Clean view:: Getting rid of leading stars in the outline |
| 15942 | * TTY keys:: Using Org on a tty | 16937 | * TTY keys:: Using Org on a tty |
| 15943 | * Interaction:: Other Emacs packages | 16938 | * Interaction:: With other Emacs packages |
| 15944 | * org-crypt:: Encrypting Org files | 16939 | * org-crypt:: Encrypting Org files |
| 15945 | @end menu | 16940 | @end menu |
| 15946 | 16941 | ||
| 15947 | 16942 | ||
| 15948 | @node Completion, Easy Templates, Miscellaneous, Miscellaneous | 16943 | @node Completion |
| 15949 | @section Completion | 16944 | @section Completion |
| 15950 | @cindex completion, of @TeX{} symbols | 16945 | @cindex completion, of @TeX{} symbols |
| 15951 | @cindex completion, of TODO keywords | 16946 | @cindex completion, of TODO keywords |
| @@ -15961,15 +16956,13 @@ emacs -Q --batch \ | |||
| 15961 | @cindex tag completion | 16956 | @cindex tag completion |
| 15962 | @cindex link abbreviations, completion of | 16957 | @cindex link abbreviations, completion of |
| 15963 | 16958 | ||
| 15964 | Emacs would not be Emacs without completion, and Org mode uses it whenever it | 16959 | Org has in-buffer completions. Unlike minibuffer completions, which are |
| 15965 | makes sense. If you prefer an @i{iswitchb}- or @i{ido}-like interface for | 16960 | useful for quick command interactions, Org's in-buffer completions are more |
| 15966 | some of the completion prompts, you can specify your preference by setting at | 16961 | suitable for content creation in Org documents. Type one or more letters and |
| 15967 | most one of the variables @code{org-completion-use-iswitchb} | 16962 | invoke the hot key to complete the text in-place. Depending on the context |
| 15968 | @code{org-completion-use-ido}. | 16963 | and the keys, Org will offer different types of completions. No minibuffer |
| 15969 | 16964 | is involved. Such mode-specific hot keys have become an integral part of | |
| 15970 | Org supports in-buffer completion. This type of completion does | 16965 | Emacs and Org provides several shortcuts. |
| 15971 | not make use of the minibuffer. You simply type a few letters into | ||
| 15972 | the buffer and use the key to complete text right there. | ||
| 15973 | 16966 | ||
| 15974 | @table @kbd | 16967 | @table @kbd |
| 15975 | @kindex M-@key{TAB} | 16968 | @kindex M-@key{TAB} |
| @@ -15996,112 +16989,123 @@ buffer. | |||
| 15996 | After @samp{[}, complete link abbreviations (@pxref{Link abbreviations}). | 16989 | After @samp{[}, complete link abbreviations (@pxref{Link abbreviations}). |
| 15997 | @item | 16990 | @item |
| 15998 | After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or | 16991 | After @samp{#+}, complete the special keywords like @samp{TYP_TODO} or |
| 15999 | @samp{OPTIONS} which set file-specific options for Org mode. When the | 16992 | file-specific @samp{OPTIONS}. After option keyword is complete, pressing |
| 16000 | option keyword is already complete, pressing @kbd{M-@key{TAB}} again | 16993 | @kbd{M-@key{TAB}} again will insert example settings for that option. |
| 16001 | will insert example settings for this keyword. | ||
| 16002 | @item | 16994 | @item |
| 16003 | In the line after @samp{#+STARTUP: }, complete startup keywords, | 16995 | After @samp{#+STARTUP: }, complete startup keywords. |
| 16004 | i.e., valid keys for this line. | ||
| 16005 | @item | 16996 | @item |
| 16006 | Elsewhere, complete dictionary words using Ispell. | 16997 | When the point is anywhere else, complete dictionary words using Ispell. |
| 16007 | @end itemize | 16998 | @end itemize |
| 16999 | @kindex C-M-i | ||
| 17000 | If your desktop intercepts the combo @kbd{M-@key{TAB}} to switch windows, use | ||
| 17001 | @kbd{C-M-i} or @kbd{@key{ESC} @key{TAB}} as an alternative or customize your | ||
| 17002 | environment. | ||
| 16008 | @end table | 17003 | @end table |
| 16009 | 17004 | ||
| 16010 | @node Easy Templates, Speed keys, Completion, Miscellaneous | 17005 | @node Easy templates |
| 16011 | @section Easy Templates | 17006 | @section Easy templates |
| 16012 | @cindex template insertion | 17007 | @cindex template insertion |
| 16013 | @cindex insertion, of templates | 17008 | @cindex insertion, of templates |
| 16014 | 17009 | ||
| 16015 | Org mode supports insertion of empty structural elements (like | 17010 | With just a few keystrokes, Org's easy templates inserts empty pairs of |
| 16016 | @code{#+BEGIN_SRC} and @code{#+END_SRC} pairs) with just a few key | 17011 | structural elements, such as @code{#+BEGIN_SRC} and @code{#+END_SRC}. Easy |
| 16017 | strokes. This is achieved through a native template expansion mechanism. | 17012 | templates use an expansion mechanism, which is native to Org, in a process |
| 16018 | Note that Emacs has several other template mechanisms which could be used in | 17013 | similar to @file{yasnippet} and other Emacs template expansion packages. |
| 16019 | a similar way, for example @file{yasnippet}. | ||
| 16020 | 17014 | ||
| 16021 | To insert a structural element, type a @samp{<}, followed by a template | 17015 | @kbd{@key{<}} @kbd{@key{s}} @kbd{@key{TAB}} completes the @samp{src} code |
| 16022 | selector and @kbd{@key{TAB}}. Completion takes effect only when the above | 17016 | block. |
| 16023 | keystrokes are typed on a line by itself. | ||
| 16024 | 17017 | ||
| 16025 | The following template selectors are currently supported. | 17018 | @kbd{<} @kbd{l} @kbd{@key{TAB}} |
| 17019 | |||
| 17020 | expands to: | ||
| 17021 | |||
| 17022 | #+BEGIN_EXPORT latex | ||
| 17023 | |||
| 17024 | #+END_EXPORT | ||
| 17025 | |||
| 17026 | Org comes with these pre-defined easy templates: | ||
| 16026 | 17027 | ||
| 16027 | @multitable @columnfractions 0.1 0.9 | 17028 | @multitable @columnfractions 0.1 0.9 |
| 16028 | @item @kbd{s} @tab @code{#+BEGIN_SRC ... #+END_SRC} | 17029 | @item @kbd{s} @tab @code{#+BEGIN_SRC ... #+END_SRC} |
| 16029 | @item @kbd{e} @tab @code{#+BEGIN_EXAMPLE ... #+END_EXAMPLE} | 17030 | @item @kbd{e} @tab @code{#+BEGIN_EXAMPLE ... #+END_EXAMPLE} |
| 16030 | @item @kbd{q} @tab @code{#+BEGIN_QUOTE ... #+END_QUOTE} | 17031 | @item @kbd{q} @tab @code{#+BEGIN_QUOTE ... #+END_QUOTE} |
| 16031 | @item @kbd{v} @tab @code{#+BEGIN_VERSE ... #+END_VERSE} | 17032 | @item @kbd{v} @tab @code{#+BEGIN_VERSE ... #+END_VERSE} |
| 16032 | @item @kbd{c} @tab @code{#+BEGIN_CENTER ... #+END_CENTER} | 17033 | @item @kbd{c} @tab @code{#+BEGIN_CENTER ... #+END_CENTER} |
| 16033 | @item @kbd{l} @tab @code{#+BEGIN_LaTeX ... #+END_LaTeX} | 17034 | @item @kbd{l} @tab @code{#+BEGIN_EXPORT latex ... #+END_EXPORT} |
| 16034 | @item @kbd{L} @tab @code{#+LaTeX:} | 17035 | @item @kbd{L} @tab @code{#+LATEX:} |
| 16035 | @item @kbd{h} @tab @code{#+BEGIN_HTML ... #+END_HTML} | 17036 | @item @kbd{h} @tab @code{#+BEGIN_EXPORT html ... #+END_EXPORT} |
| 16036 | @item @kbd{H} @tab @code{#+HTML:} | 17037 | @item @kbd{H} @tab @code{#+HTML:} |
| 16037 | @item @kbd{a} @tab @code{#+BEGIN_ASCII ... #+END_ASCII} | 17038 | @item @kbd{a} @tab @code{#+BEGIN_EXPORT ascii ... #+END_EXPORT} |
| 16038 | @item @kbd{A} @tab @code{#+ASCII:} | 17039 | @item @kbd{A} @tab @code{#+ASCII:} |
| 16039 | @item @kbd{i} @tab @code{#+INDEX:} line | 17040 | @item @kbd{i} @tab @code{#+INDEX:} line |
| 16040 | @item @kbd{I} @tab @code{#+INCLUDE:} line | 17041 | @item @kbd{I} @tab @code{#+INCLUDE:} line |
| 16041 | @end multitable | 17042 | @end multitable |
| 16042 | 17043 | ||
| 16043 | For example, on an empty line, typing "<e" and then pressing TAB, will expand | 17044 | More templates can added by customizing the variable |
| 16044 | into a complete EXAMPLE template. | 17045 | @code{org-structure-template-alist}, whose docstring has additional details. |
| 16045 | 17046 | ||
| 16046 | You can install additional templates by customizing the variable | 17047 | @node Speed keys |
| 16047 | @code{org-structure-template-alist}. See the docstring of the variable for | ||
| 16048 | additional details. | ||
| 16049 | |||
| 16050 | @node Speed keys, Code evaluation security, Easy Templates, Miscellaneous | ||
| 16051 | @section Speed keys | 17048 | @section Speed keys |
| 16052 | @cindex speed keys | 17049 | @cindex speed keys |
| 17050 | |||
| 17051 | Single keystrokes can execute custom commands in an Org file when the cursor | ||
| 17052 | is on a headline. Without the extra burden of a meta or modifier key, Speed | ||
| 17053 | Keys can speed navigation or execute custom commands. Besides faster | ||
| 17054 | navigation, Speed Keys may come in handy on small mobile devices that do not | ||
| 17055 | have full keyboards. Speed Keys may also work on TTY devices known for their | ||
| 17056 | problems when entering Emacs keychords. | ||
| 17057 | |||
| 16053 | @vindex org-use-speed-commands | 17058 | @vindex org-use-speed-commands |
| 16054 | @vindex org-speed-commands-user | 17059 | By default, Org has Speed Keys disabled. To activate Speed Keys, set the |
| 17060 | variable @code{org-use-speed-commands} to a non-@code{nil} value. To trigger | ||
| 17061 | a Speed Key, the cursor must be at the beginning of an Org headline, before | ||
| 17062 | any of the stars. | ||
| 16055 | 17063 | ||
| 16056 | Single keys can be made to execute commands when the cursor is at the | 17064 | @vindex org-speed-commands-user |
| 16057 | beginning of a headline, i.e., before the first star. Configure the variable | 17065 | @findex org-speed-command-help |
| 16058 | @code{org-use-speed-commands} to activate this feature. There is a | 17066 | Org comes with a pre-defined list of Speed Keys. To add or modify Speed |
| 16059 | pre-defined list of commands, and you can add more such commands using the | 17067 | Keys, customize the variable, @code{org-speed-commands-user}. For more |
| 16060 | variable @code{org-speed-commands-user}. Speed keys do not only speed up | 17068 | details, see the variable's docstring. With Speed Keys activated, @kbd{M-x |
| 16061 | navigation and other commands, but they also provide an alternative way to | 17069 | org-speed-command-help}, or @kbd{?} when cursor is at the beginning of an Org |
| 16062 | execute commands bound to keys that are not or not easily available on a TTY, | 17070 | headline, shows currently active Speed Keys, including the user-defined ones. |
| 16063 | or on a small mobile device with a limited keyboard. | ||
| 16064 | 17071 | ||
| 16065 | To see which commands are available, activate the feature and press @kbd{?} | ||
| 16066 | with the cursor at the beginning of a headline. | ||
| 16067 | 17072 | ||
| 16068 | @node Code evaluation security, Customization, Speed keys, Miscellaneous | 17073 | @node Code evaluation security |
| 16069 | @section Code evaluation and security issues | 17074 | @section Code evaluation and security issues |
| 16070 | 17075 | ||
| 16071 | Org provides tools to work with the code snippets, including evaluating them. | 17076 | Unlike plain text, running code comes with risk. Each @samp{src} code block, |
| 16072 | 17077 | in terms of risk, is equivalent to an executable file. Org therefore puts a | |
| 16073 | Running code on your machine always comes with a security risk. Badly | 17078 | few confirmation prompts by default. This is to alert the casual user from |
| 16074 | written or malicious code can be executed on purpose or by accident. Org has | 17079 | accidentally running untrusted code. |
| 16075 | default settings which will only evaluate such code if you give explicit | ||
| 16076 | permission to do so, and as a casual user of these features you should leave | ||
| 16077 | these precautions intact. | ||
| 16078 | 17080 | ||
| 16079 | For people who regularly work with such code, the confirmation prompts can | 17081 | For users who do not run code blocks or write code regularly, Org's default |
| 16080 | become annoying, and you might want to turn them off. This can be done, but | 17082 | settings should suffice. However, some users may want to tweak the prompts |
| 16081 | you must be aware of the risks that are involved. | 17083 | for fewer interruptions. To weigh the risks of automatic execution of code |
| 17084 | blocks, here are some details about code evaluation. | ||
| 16082 | 17085 | ||
| 16083 | Code evaluation can happen under the following circumstances: | 17086 | Org evaluates code in the following circumstances: |
| 16084 | 17087 | ||
| 16085 | @table @i | 17088 | @table @i |
| 16086 | @item Source code blocks | 17089 | @item Source code blocks |
| 16087 | Source code blocks can be evaluated during export, or when pressing @kbd{C-c | 17090 | Org evaluates @samp{src} code blocks in an Org file during export. Org also |
| 16088 | C-c} in the block. The most important thing to realize here is that Org mode | 17091 | evaluates a @samp{src} code block with the @kbd{C-c C-c} key chord. Users |
| 16089 | files which contain code snippets are, in a certain sense, like executable | 17092 | exporting or running code blocks must load files only from trusted sources. |
| 16090 | files. So you should accept them and load them into Emacs only from trusted | 17093 | Be weary of customizing variables that remove or alter default security |
| 16091 | sources---just like you would do with a program you install on your computer. | 17094 | measures. |
| 16092 | |||
| 16093 | Make sure you know what you are doing before customizing the variables | ||
| 16094 | which take off the default security brakes. | ||
| 16095 | 17095 | ||
| 16096 | @defopt org-confirm-babel-evaluate | 17096 | @defopt org-confirm-babel-evaluate |
| 16097 | When t (the default), the user is asked before every code block evaluation. | 17097 | When @code{t}, Org prompts the user for confirmation before executing each |
| 16098 | When @code{nil}, the user is not asked. When set to a function, it is called with | 17098 | code block. When @code{nil}, Org executes code blocks without prompting the |
| 16099 | two arguments (language and body of the code block) and should return t to | 17099 | user for confirmation. When this option is set to a custom function, Org |
| 16100 | ask and @code{nil} not to ask. | 17100 | invokes the function with these two arguments: the source code language and |
| 17101 | the body of the code block. The custom function must return either a | ||
| 17102 | @code{t} or @code{nil}, which determines if the user is prompted. Each | ||
| 17103 | source code language can be handled separately through this function | ||
| 17104 | argument. | ||
| 16101 | @end defopt | 17105 | @end defopt |
| 16102 | 17106 | ||
| 16103 | For example, here is how to execute "ditaa" code (which is considered safe) | 17107 | For example, this function enables execution of @samp{ditaa} code +blocks |
| 16104 | without asking: | 17108 | without prompting: |
| 16105 | 17109 | ||
| 16106 | @lisp | 17110 | @lisp |
| 16107 | (defun my-org-confirm-babel-evaluate (lang body) | 17111 | (defun my-org-confirm-babel-evaluate (lang body) |
| @@ -16110,86 +17114,73 @@ without asking: | |||
| 16110 | @end lisp | 17114 | @end lisp |
| 16111 | 17115 | ||
| 16112 | @item Following @code{shell} and @code{elisp} links | 17116 | @item Following @code{shell} and @code{elisp} links |
| 16113 | Org has two link types that can directly evaluate code (@pxref{External | 17117 | Org has two link types that can also directly evaluate code (@pxref{External |
| 16114 | links}). These links can be problematic because the code to be evaluated is | 17118 | links}). Because such code is not visible, these links have a potential |
| 16115 | not visible. | 17119 | risk. Org therefore prompts the user when it encounters such links. The |
| 17120 | customization variables are: | ||
| 16116 | 17121 | ||
| 16117 | @defopt org-confirm-shell-link-function | 17122 | @defopt org-confirm-shell-link-function |
| 16118 | Function to queries user about shell link execution. | 17123 | Function that prompts the user before executing a shell link. |
| 16119 | @end defopt | 17124 | @end defopt |
| 16120 | @defopt org-confirm-elisp-link-function | 17125 | @defopt org-confirm-elisp-link-function |
| 16121 | Functions to query user for Emacs Lisp link execution. | 17126 | Function that prompts the user before executing an Emacs Lisp link. |
| 16122 | @end defopt | 17127 | @end defopt |
| 16123 | 17128 | ||
| 16124 | @item Formulas in tables | 17129 | @item Formulas in tables |
| 16125 | Formulas in tables (@pxref{The spreadsheet}) are code that is evaluated | 17130 | Org executes formulas in tables (@pxref{The spreadsheet}) either through the |
| 16126 | either by the @i{calc} interpreter, or by the @i{Emacs Lisp} interpreter. | 17131 | @emph{calc} or the @emph{Emacs Lisp} interpreters. |
| 16127 | @end table | 17132 | @end table |
| 16128 | 17133 | ||
| 16129 | @node Customization, In-buffer settings, Code evaluation security, Miscellaneous | 17134 | @node Customization |
| 16130 | @section Customization | 17135 | @section Customization |
| 16131 | @cindex customization | 17136 | @cindex customization |
| 16132 | @cindex options, for customization | 17137 | @cindex options, for customization |
| 16133 | @cindex variables, for customization | 17138 | @cindex variables, for customization |
| 16134 | 17139 | ||
| 16135 | There are more than 500 variables that can be used to customize | 17140 | Org has more than 500 variables for customization. They can be accessed |
| 16136 | Org. For the sake of compactness of the manual, I am not | 17141 | through the usual @kbd{M-x org-customize RET} command. Or through the Org |
| 16137 | describing the variables here. A structured overview of customization | 17142 | menu, @code{Org->Customization->Browse Org Group}. Org also has per-file |
| 16138 | variables is available with @kbd{M-x org-customize RET}. Or select | 17143 | settings for some variables (@pxref{In-buffer settings}). |
| 16139 | @code{Browse Org Group} from the @code{Org->Customization} menu. Many | ||
| 16140 | settings can also be activated on a per-file basis, by putting special | ||
| 16141 | lines into the buffer (@pxref{In-buffer settings}). | ||
| 16142 | 17144 | ||
| 16143 | @node In-buffer settings, The very busy C-c C-c key, Customization, Miscellaneous | 17145 | @node In-buffer settings |
| 16144 | @section Summary of in-buffer settings | 17146 | @section Summary of in-buffer settings |
| 16145 | @cindex in-buffer settings | 17147 | @cindex in-buffer settings |
| 16146 | @cindex special keywords | 17148 | @cindex special keywords |
| 17149 | In-buffer settings start with @samp{#+}, followed by a keyword, a colon, and | ||
| 17150 | then a word for each setting. Org accepts multiple settings on the same | ||
| 17151 | line. Org also accepts multiple lines for a keyword. This manual describes | ||
| 17152 | these settings throughout. A summary follows here. | ||
| 16147 | 17153 | ||
| 16148 | Org mode uses special lines in the buffer to define settings on a | 17154 | @kbd{C-c C-c} activates any changes to the in-buffer settings. Closing and |
| 16149 | per-file basis. These lines start with a @samp{#+} followed by a | 17155 | reopening the Org file in Emacs also activates the changes. |
| 16150 | keyword, a colon, and then individual words defining a setting. Several | ||
| 16151 | setting words can be in the same line, but you can also have multiple | ||
| 16152 | lines for the keyword. While these settings are described throughout | ||
| 16153 | the manual, here is a summary. After changing any of those lines in the | ||
| 16154 | buffer, press @kbd{C-c C-c} with the cursor still in the line to | ||
| 16155 | activate the changes immediately. Otherwise they become effective only | ||
| 16156 | when the file is visited again in a new Emacs session. | ||
| 16157 | 17156 | ||
| 16158 | @vindex org-archive-location | 17157 | @vindex org-archive-location |
| 16159 | @table @kbd | 17158 | @table @kbd |
| 16160 | @item #+ARCHIVE: %s_done:: | 17159 | @item #+ARCHIVE: %s_done:: |
| 16161 | This line sets the archive location for the agenda file. It applies for | 17160 | Sets the archive location of the agenda file. This location applies to the |
| 16162 | all subsequent lines until the next @samp{#+ARCHIVE} line, or the end | 17161 | lines until the next @samp{#+ARCHIVE} line, if any, in the Org file. The |
| 16163 | of the file. The first such line also applies to any entries before it. | 17162 | first archive location in the Org file also applies to any entries before it. |
| 16164 | The corresponding variable is @code{org-archive-location}. | 17163 | The corresponding variable is @code{org-archive-location}. |
| 16165 | @item #+CATEGORY: | 17164 | @item #+CATEGORY: |
| 16166 | This line sets the category for the agenda file. The category applies | 17165 | Sets the category of the agenda file, which applies to the entire document. |
| 16167 | for all subsequent lines until the next @samp{#+CATEGORY} line, or the | ||
| 16168 | end of the file. The first such line also applies to any entries before it. | ||
| 16169 | @item #+COLUMNS: %25ITEM ... | 17166 | @item #+COLUMNS: %25ITEM ... |
| 16170 | @cindex property, COLUMNS | 17167 | @cindex property, COLUMNS |
| 16171 | Set the default format for columns view. This format applies when | 17168 | Sets the default format for columns view. Org uses this format for column |
| 16172 | columns view is invoked in locations where no @code{COLUMNS} property | 17169 | views where there is no @code{COLUMNS} property. |
| 16173 | applies. | ||
| 16174 | @item #+CONSTANTS: name1=value1 ... | 17170 | @item #+CONSTANTS: name1=value1 ... |
| 16175 | @vindex org-table-formula-constants | 17171 | @vindex org-table-formula-constants |
| 16176 | @vindex org-table-formula | 17172 | @vindex org-table-formula |
| 16177 | Set file-local values for constants to be used in table formulas. This | 17173 | Set file-local values for constants that table formulas can use. This line |
| 16178 | line sets the local variable @code{org-table-formula-constants-local}. | 17174 | sets the local variable @code{org-table-formula-constants-local}. The global |
| 16179 | The global version of this variable is | 17175 | version of this variable is @code{org-table-formula-constants}. |
| 16180 | @code{org-table-formula-constants}. | ||
| 16181 | @item #+FILETAGS: :tag1:tag2:tag3: | 17176 | @item #+FILETAGS: :tag1:tag2:tag3: |
| 16182 | Set tags that can be inherited by any entry in the file, including the | 17177 | Set tags that all entries in the file will inherit from here, including the |
| 16183 | top-level entries. | 17178 | top-level entries. |
| 16184 | @item #+DRAWERS: NAME1 ... | ||
| 16185 | @vindex org-drawers | ||
| 16186 | Set the file-local set of additional drawers. The corresponding global | ||
| 16187 | variable is @code{org-drawers}. | ||
| 16188 | @item #+LINK: linkword replace | 17179 | @item #+LINK: linkword replace |
| 16189 | @vindex org-link-abbrev-alist | 17180 | @vindex org-link-abbrev-alist |
| 16190 | These lines (several are allowed) specify link abbreviations. | 17181 | Each line specifies one abbreviation for one link. Use multiple |
| 16191 | @xref{Link abbreviations}. The corresponding variable is | 17182 | @code{#+LINK:} lines for more, @pxref{Link abbreviations}. The corresponding |
| 16192 | @code{org-link-abbrev-alist}. | 17183 | variable is @code{org-link-abbrev-alist}. |
| 16193 | @item #+PRIORITIES: highest lowest default | 17184 | @item #+PRIORITIES: highest lowest default |
| 16194 | @vindex org-highest-priority | 17185 | @vindex org-highest-priority |
| 16195 | @vindex org-lowest-priority | 17186 | @vindex org-lowest-priority |
| @@ -16202,22 +17193,22 @@ This line sets a default inheritance value for entries in the current | |||
| 16202 | buffer, most useful for specifying the allowed values of a property. | 17193 | buffer, most useful for specifying the allowed values of a property. |
| 16203 | @cindex #+SETUPFILE | 17194 | @cindex #+SETUPFILE |
| 16204 | @item #+SETUPFILE: file | 17195 | @item #+SETUPFILE: file |
| 16205 | This line defines a file that holds more in-buffer setup. Normally this is | 17196 | The setup file is for additional in-buffer settings. Org loads this file and |
| 16206 | entirely ignored. Only when the buffer is parsed for option-setting lines | 17197 | parses it for any settings in it only when Org opens the main file. @kbd{C-c |
| 16207 | (i.e., when starting Org mode for a file, when pressing @kbd{C-c C-c} in a | 17198 | C-c} on the settings line will also parse and load. Org also parses and |
| 16208 | settings line, or when exporting), then the contents of this file are parsed | 17199 | loads the file during normal exporting process. Org parses the contents of |
| 16209 | as if they had been included in the buffer. In particular, the file can be | 17200 | this file as if it was included in the buffer. It can be another Org file. |
| 16210 | any other Org mode file with internal setup. You can visit the file the | 17201 | To visit the file, @kbd{C-c '} while the cursor is on the line with the file |
| 16211 | cursor is in the line with @kbd{C-c '}. | 17202 | name. |
| 16212 | @item #+STARTUP: | 17203 | @item #+STARTUP: |
| 16213 | @cindex #+STARTUP | 17204 | @cindex #+STARTUP |
| 16214 | This line sets options to be used at startup of Org mode, when an | 17205 | Startup options Org uses when first visiting a file. |
| 16215 | Org file is being visited. | ||
| 16216 | 17206 | ||
| 16217 | The first set of options deals with the initial visibility of the outline | 17207 | The first set of options deals with the initial visibility of the outline |
| 16218 | tree. The corresponding variable for global default settings is | 17208 | tree. The corresponding variable for global default settings is |
| 16219 | @code{org-startup-folded}, with a default value @code{t}, which means | 17209 | @code{org-startup-folded} with a default value of @code{t}, which is the same |
| 16220 | @code{overview}. | 17210 | as @code{overview}. |
| 17211 | |||
| 16221 | @vindex org-startup-folded | 17212 | @vindex org-startup-folded |
| 16222 | @cindex @code{overview}, STARTUP keyword | 17213 | @cindex @code{overview}, STARTUP keyword |
| 16223 | @cindex @code{content}, STARTUP keyword | 17214 | @cindex @code{content}, STARTUP keyword |
| @@ -16234,17 +17225,17 @@ showeverything @r{show even drawer contents} | |||
| 16234 | @cindex @code{indent}, STARTUP keyword | 17225 | @cindex @code{indent}, STARTUP keyword |
| 16235 | @cindex @code{noindent}, STARTUP keyword | 17226 | @cindex @code{noindent}, STARTUP keyword |
| 16236 | Dynamic virtual indentation is controlled by the variable | 17227 | Dynamic virtual indentation is controlled by the variable |
| 16237 | @code{org-startup-indented}@footnote{Emacs 23 and Org mode 6.29 are required} | 17228 | @code{org-startup-indented} |
| 16238 | @example | 17229 | @example |
| 16239 | indent @r{start with @code{org-indent-mode} turned on} | 17230 | indent @r{start with @code{org-indent-mode} turned on} |
| 16240 | noindent @r{start with @code{org-indent-mode} turned off} | 17231 | noindent @r{start with @code{org-indent-mode} turned off} |
| 16241 | @end example | 17232 | @end example |
| 16242 | 17233 | ||
| 16243 | @vindex org-startup-align-all-tables | 17234 | @vindex org-startup-align-all-tables |
| 16244 | Then there are options for aligning tables upon visiting a file. This | 17235 | Aligns tables consistently upon visiting a file; useful for restoring |
| 16245 | is useful in files containing narrowed table columns. The corresponding | 17236 | narrowed table columns. The corresponding variable is |
| 16246 | variable is @code{org-startup-align-all-tables}, with a default value | 17237 | @code{org-startup-align-all-tables} with @code{nil} as default value. |
| 16247 | @code{nil}. | 17238 | |
| 16248 | @cindex @code{align}, STARTUP keyword | 17239 | @cindex @code{align}, STARTUP keyword |
| 16249 | @cindex @code{noalign}, STARTUP keyword | 17240 | @cindex @code{noalign}, STARTUP keyword |
| 16250 | @example | 17241 | @example |
| @@ -16253,9 +17244,9 @@ noalign @r{don't align tables on startup} | |||
| 16253 | @end example | 17244 | @end example |
| 16254 | 17245 | ||
| 16255 | @vindex org-startup-with-inline-images | 17246 | @vindex org-startup-with-inline-images |
| 16256 | When visiting a file, inline images can be automatically displayed. The | 17247 | Whether Org should automatically display inline images. The corresponding |
| 16257 | corresponding variable is @code{org-startup-with-inline-images}, with a | 17248 | variable is @code{org-startup-with-inline-images}, with a default value |
| 16258 | default value @code{nil} to avoid delays when visiting a file. | 17249 | @code{nil} to avoid delays when visiting a file. |
| 16259 | @cindex @code{inlineimages}, STARTUP keyword | 17250 | @cindex @code{inlineimages}, STARTUP keyword |
| 16260 | @cindex @code{noinlineimages}, STARTUP keyword | 17251 | @cindex @code{noinlineimages}, STARTUP keyword |
| 16261 | @example | 17252 | @example |
| @@ -16264,10 +17255,9 @@ noinlineimages @r{don't show inline images on startup} | |||
| 16264 | @end example | 17255 | @end example |
| 16265 | 17256 | ||
| 16266 | @vindex org-startup-with-latex-preview | 17257 | @vindex org-startup-with-latex-preview |
| 16267 | When visiting a file, @LaTeX{} fragments can be converted to images | 17258 | Whether Org should automatically convert @LaTeX{} fragments to images. The |
| 16268 | automatically. The variable @code{org-startup-with-latex-preview} which | 17259 | variable @code{org-startup-with-latex-preview}, which controls this setting, |
| 16269 | controls this behavior, is set to @code{nil} by default to avoid delays on | 17260 | is set to @code{nil} by default to avoid startup delays. |
| 16270 | startup. | ||
| 16271 | @cindex @code{latexpreview}, STARTUP keyword | 17261 | @cindex @code{latexpreview}, STARTUP keyword |
| 16272 | @cindex @code{nolatexpreview}, STARTUP keyword | 17262 | @cindex @code{nolatexpreview}, STARTUP keyword |
| 16273 | @example | 17263 | @example |
| @@ -16328,21 +17318,21 @@ nologstatesreversed @r{do not reverse the order of states notes} | |||
| 16328 | 17318 | ||
| 16329 | @vindex org-hide-leading-stars | 17319 | @vindex org-hide-leading-stars |
| 16330 | @vindex org-odd-levels-only | 17320 | @vindex org-odd-levels-only |
| 16331 | Here are the options for hiding leading stars in outline headings, and for | 17321 | These options hide leading stars in outline headings, and indent outlines. |
| 16332 | indenting outlines. The corresponding variables are | 17322 | The corresponding variables are @code{org-hide-leading-stars} and |
| 16333 | @code{org-hide-leading-stars} and @code{org-odd-levels-only}, both with a | 17323 | @code{org-odd-levels-only}, both with a default setting of @code{nil} |
| 16334 | default setting @code{nil} (meaning @code{showstars} and @code{oddeven}). | 17324 | (meaning @code{showstars} and @code{oddeven}). |
| 16335 | @cindex @code{hidestars}, STARTUP keyword | 17325 | @cindex @code{hidestars}, STARTUP keyword |
| 16336 | @cindex @code{showstars}, STARTUP keyword | 17326 | @cindex @code{showstars}, STARTUP keyword |
| 16337 | @cindex @code{odd}, STARTUP keyword | 17327 | @cindex @code{odd}, STARTUP keyword |
| 16338 | @cindex @code{even}, STARTUP keyword | 17328 | @cindex @code{even}, STARTUP keyword |
| 16339 | @example | 17329 | @example |
| 16340 | hidestars @r{make all but one of the stars starting a headline invisible.} | 17330 | hidestars @r{hide all stars on the headline except one.} |
| 16341 | showstars @r{show all stars starting a headline} | 17331 | showstars @r{show all stars on the headline} |
| 16342 | indent @r{virtual indentation according to outline level} | 17332 | indent @r{virtual indents according to the outline level} |
| 16343 | noindent @r{no virtual indentation according to outline level} | 17333 | noindent @r{no virtual indents} |
| 16344 | odd @r{allow only odd outline levels (1,3,...)} | 17334 | odd @r{show odd outline levels only (1,3,...)} |
| 16345 | oddeven @r{allow all outline levels} | 17335 | oddeven @r{show all outline levels} |
| 16346 | @end example | 17336 | @end example |
| 16347 | 17337 | ||
| 16348 | @vindex org-put-time-stamp-overlays | 17338 | @vindex org-put-time-stamp-overlays |
| @@ -16368,8 +17358,8 @@ constSI @r{@file{constants.el} should use the SI unit system} | |||
| 16368 | @vindex org-footnote-define-inline | 17358 | @vindex org-footnote-define-inline |
| 16369 | @vindex org-footnote-auto-label | 17359 | @vindex org-footnote-auto-label |
| 16370 | @vindex org-footnote-auto-adjust | 17360 | @vindex org-footnote-auto-adjust |
| 16371 | To influence footnote settings, use the following keywords. The | 17361 | For footnote settings, use the following keywords. The corresponding |
| 16372 | corresponding variables are @code{org-footnote-define-inline}, | 17362 | variables are @code{org-footnote-define-inline}, |
| 16373 | @code{org-footnote-auto-label}, and @code{org-footnote-auto-adjust}. | 17363 | @code{org-footnote-auto-label}, and @code{org-footnote-auto-adjust}. |
| 16374 | @cindex @code{fninline}, STARTUP keyword | 17364 | @cindex @code{fninline}, STARTUP keyword |
| 16375 | @cindex @code{nofninline}, STARTUP keyword | 17365 | @cindex @code{nofninline}, STARTUP keyword |
| @@ -16414,67 +17404,57 @@ entitiesplain @r{Leave entities plain} | |||
| 16414 | 17404 | ||
| 16415 | @item #+TAGS: TAG1(c1) TAG2(c2) | 17405 | @item #+TAGS: TAG1(c1) TAG2(c2) |
| 16416 | @vindex org-tag-alist | 17406 | @vindex org-tag-alist |
| 16417 | These lines (several such lines are allowed) specify the valid tags in | 17407 | These lines specify valid tags for this file. Org accepts multiple tags |
| 16418 | this file, and (potentially) the corresponding @emph{fast tag selection} | 17408 | lines. Tags could correspond to the @emph{fast tag selection} keys. The |
| 16419 | keys. The corresponding variable is @code{org-tag-alist}. | 17409 | corresponding variable is @code{org-tag-alist}. |
| 16420 | @cindex #+TBLFM | 17410 | @cindex #+TBLFM |
| 16421 | @item #+TBLFM: | 17411 | @item #+TBLFM: |
| 16422 | This line contains the formulas for the table directly above the line. | 17412 | This line is for formulas for the table directly above. A table can have |
| 16423 | 17413 | multiple @samp{#+TBLFM:} lines. On table recalculation, Org applies only the | |
| 16424 | Table can have multiple lines containing @samp{#+TBLFM:}. Note | 17414 | first @samp{#+TBLFM:} line. For details see @ref{Using multiple #+TBLFM |
| 16425 | that only the first line of @samp{#+TBLFM:} will be applied when | 17415 | lines} in @ref{Editing and debugging formulas}. |
| 16426 | you recalculate the table. For more details see @ref{Using | ||
| 16427 | multiple #+TBLFM lines} in @ref{Editing and debugging formulas}. | ||
| 16428 | |||
| 16429 | @item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+DATE:, | 17416 | @item #+TITLE:, #+AUTHOR:, #+EMAIL:, #+LANGUAGE:, #+DATE:, |
| 16430 | @itemx #+OPTIONS:, #+BIND:, | 17417 | @itemx #+OPTIONS:, #+BIND:, |
| 16431 | @itemx #+DESCRIPTION:, #+KEYWORDS:, | ||
| 16432 | @itemx #+LaTeX_HEADER:, #+LaTeX_HEADER_EXTRA:, | ||
| 16433 | @itemx #+HTML_HEAD:, #+HTML_HEAD_EXTRA:, #+HTML_LINK_UP:, #+HTML_LINK_HOME:, | ||
| 16434 | @itemx #+SELECT_TAGS:, #+EXCLUDE_TAGS: | 17418 | @itemx #+SELECT_TAGS:, #+EXCLUDE_TAGS: |
| 16435 | These lines provide settings for exporting files. For more details see | 17419 | These lines provide settings for exporting files. For more details see |
| 16436 | @ref{Export settings}. | 17420 | @ref{Export settings}. |
| 16437 | @item #+TODO: #+SEQ_TODO: #+TYP_TODO: | 17421 | @item #+TODO: #+SEQ_TODO: #+TYP_TODO: |
| 16438 | @vindex org-todo-keywords | 17422 | @vindex org-todo-keywords |
| 16439 | These lines set the TODO keywords and their interpretation in the | 17423 | These lines set the TODO keywords and their significance to the current file. |
| 16440 | current file. The corresponding variable is @code{org-todo-keywords}. | 17424 | The corresponding variable is @code{org-todo-keywords}. |
| 16441 | @end table | 17425 | @end table |
| 16442 | 17426 | ||
| 16443 | @node The very busy C-c C-c key, Clean view, In-buffer settings, Miscellaneous | 17427 | @node The very busy C-c C-c key |
| 16444 | @section The very busy C-c C-c key | 17428 | @section The very busy C-c C-c key |
| 16445 | @kindex C-c C-c | 17429 | @kindex C-c C-c |
| 16446 | @cindex C-c C-c, overview | 17430 | @cindex C-c C-c, overview |
| 16447 | 17431 | ||
| 16448 | The key @kbd{C-c C-c} has many purposes in Org, which are all | 17432 | The @kbd{C-c C-c} key in Org serves many purposes depending on the context. |
| 16449 | mentioned scattered throughout this manual. One specific function of | 17433 | It is probably the most over-worked, multi-purpose key combination in Org. |
| 16450 | this key is to add @emph{tags} to a headline (@pxref{Tags}). In many | 17434 | Its uses are well-documented through out this manual, but here is a |
| 16451 | other circumstances it means something like @emph{``Hey Org, look | 17435 | consolidated list for easy reference. |
| 16452 | here and update according to what you see here''}. Here is a summary of | ||
| 16453 | what this means in different contexts. | ||
| 16454 | 17436 | ||
| 16455 | @itemize @minus | 17437 | @itemize @minus |
| 16456 | @item | 17438 | @item |
| 16457 | If there are highlights in the buffer from the creation of a sparse | 17439 | If any highlights shown in the buffer from the creation of a sparse tree, or |
| 16458 | tree, or from clock display, remove these highlights. | 17440 | from clock display, remove such highlights. |
| 16459 | @item | 17441 | @item |
| 16460 | If the cursor is in one of the special @code{#+KEYWORD} lines, this | 17442 | If the cursor is in one of the special @code{#+KEYWORD} lines, scan the |
| 16461 | triggers scanning the buffer for these lines and updating the | 17443 | buffer for these lines and update the information. |
| 16462 | information. | ||
| 16463 | @item | 17444 | @item |
| 16464 | If the cursor is inside a table, realign the table. This command | 17445 | If the cursor is inside a table, realign the table. The table realigns even |
| 16465 | works even if the automatic table editor has been turned off. | 17446 | if automatic table editor is turned off. |
| 16466 | @item | 17447 | @item |
| 16467 | If the cursor is on a @code{#+TBLFM} line, re-apply the formulas to | 17448 | If the cursor is on a @code{#+TBLFM} line, re-apply the formulas to |
| 16468 | the entire table. | 17449 | the entire table. |
| 16469 | @item | 17450 | @item |
| 16470 | If the current buffer is a capture buffer, close the note and file it. | 17451 | If the current buffer is a capture buffer, close the note and file it. With |
| 16471 | With a prefix argument, file it, without further interaction, to the | 17452 | a prefix argument, also jump to the target location after saving the note. |
| 16472 | default location. | ||
| 16473 | @item | 17453 | @item |
| 16474 | If the cursor is on a @code{<<<target>>>}, update radio targets and | 17454 | If the cursor is on a @code{<<<target>>>}, update radio targets and |
| 16475 | corresponding links in this buffer. | 17455 | corresponding links in this buffer. |
| 16476 | @item | 17456 | @item |
| 16477 | If the cursor is in a property line or at the start or end of a property | 17457 | If the cursor is on a property line or at the start or end of a property |
| 16478 | drawer, offer property commands. | 17458 | drawer, offer property commands. |
| 16479 | @item | 17459 | @item |
| 16480 | If the cursor is at a footnote reference, go to the corresponding | 17460 | If the cursor is at a footnote reference, go to the corresponding |
| @@ -16494,18 +17474,18 @@ block is updated. | |||
| 16494 | If the cursor is at a timestamp, fix the day name in the timestamp. | 17474 | If the cursor is at a timestamp, fix the day name in the timestamp. |
| 16495 | @end itemize | 17475 | @end itemize |
| 16496 | 17476 | ||
| 16497 | @node Clean view, TTY keys, The very busy C-c C-c key, Miscellaneous | 17477 | @node Clean view |
| 16498 | @section A cleaner outline view | 17478 | @section A cleaner outline view |
| 16499 | @cindex hiding leading stars | 17479 | @cindex hiding leading stars |
| 16500 | @cindex dynamic indentation | 17480 | @cindex dynamic indentation |
| 16501 | @cindex odd-levels-only outlines | 17481 | @cindex odd-levels-only outlines |
| 16502 | @cindex clean outline view | 17482 | @cindex clean outline view |
| 16503 | 17483 | ||
| 16504 | Some people find it noisy and distracting that the Org headlines start with a | 17484 | Org's default outline with stars and no indents can become too cluttered for |
| 16505 | potentially large number of stars, and that text below the headlines is not | 17485 | short documents. For @emph{book-like} long documents, the effect is not as |
| 16506 | indented. While this is no problem when writing a @emph{book-like} document | 17486 | noticeable. Org provides an alternate stars and indentation scheme, as shown |
| 16507 | where the outline headings are really section headings, in a more | 17487 | on the right in the following table. It uses only one star and indents text |
| 16508 | @emph{list-oriented} outline, indented structure is a lot cleaner: | 17488 | to line with the heading: |
| 16509 | 17489 | ||
| 16510 | @example | 17490 | @example |
| 16511 | @group | 17491 | @group |
| @@ -16521,38 +17501,40 @@ more text | more text | |||
| 16521 | 17501 | ||
| 16522 | @noindent | 17502 | @noindent |
| 16523 | 17503 | ||
| 16524 | If you are using at least Emacs 23.2@footnote{Emacs 23.1 can actually crash | 17504 | To turn this mode on, use the minor mode, @code{org-indent-mode}. Text lines |
| 16525 | with @code{org-indent-mode}} and version 6.29 of Org, this kind of view can | 17505 | that are not headlines are prefixed with spaces to vertically align with the |
| 16526 | be achieved dynamically at display time using @code{org-indent-mode}. In | 17506 | headline text@footnote{The @code{org-indent-mode} also sets the |
| 16527 | this minor mode, all lines are prefixed for display with the necessary amount | 17507 | @code{wrap-prefix} correctly for indenting and wrapping long lines of |
| 16528 | of space@footnote{@code{org-indent-mode} also sets the @code{wrap-prefix} | 17508 | headlines or text. This minor mode handles @code{visual-line-mode} and |
| 16529 | property, such that @code{visual-line-mode} (or purely setting | 17509 | directly applied settings through @code{word-wrap}.}. |
| 16530 | @code{word-wrap}) wraps long lines (including headlines) correctly indented. | 17510 | |
| 16531 | }. Also headlines are prefixed with additional stars, so that the amount of | 17511 | To make more horizontal space, the headlines are shifted by two stars. This |
| 16532 | indentation shifts by two@footnote{See the variable | 17512 | can be configured by the @code{org-indent-indentation-per-level} variable. |
| 16533 | @code{org-indent-indentation-per-level}.} spaces per level. All headline | 17513 | Only one star on each headline is visible, the rest are masked with the same |
| 16534 | stars but the last one are made invisible using the @code{org-hide} | 17514 | font color as the background. This font face can be configured with the |
| 16535 | face@footnote{Turning on @code{org-indent-mode} sets | 17515 | @code{org-hide} variable. |
| 17516 | |||
| 17517 | Note that turning on @code{org-indent-mode} sets | ||
| 16536 | @code{org-hide-leading-stars} to @code{t} and @code{org-adapt-indentation} to | 17518 | @code{org-hide-leading-stars} to @code{t} and @code{org-adapt-indentation} to |
| 16537 | @code{nil}.}; see below under @samp{2.} for more information on how this | 17519 | @code{nil}; @samp{2.} below shows how this works. |
| 16538 | works. You can turn on @code{org-indent-mode} for all files by customizing | 17520 | |
| 16539 | the variable @code{org-startup-indented}, or you can turn it on for | 17521 | To globally turn on @code{org-indent-mode} for all files, customize the |
| 16540 | individual files using | 17522 | variable @code{org-startup-indented}. |
| 17523 | |||
| 17524 | To turn on indenting for individual files, use @code{#+STARTUP} option as | ||
| 17525 | follows: | ||
| 16541 | 17526 | ||
| 16542 | @example | 17527 | @example |
| 16543 | #+STARTUP: indent | 17528 | #+STARTUP: indent |
| 16544 | @end example | 17529 | @end example |
| 16545 | 17530 | ||
| 16546 | If you want a similar effect in an earlier version of Emacs and/or Org, or if | 17531 | Indent on startup makes Org use hard spaces to align text with headings as |
| 16547 | you want the indentation to be hard space characters so that the plain text | 17532 | shown in examples below. |
| 16548 | file looks as similar as possible to the Emacs display, Org supports you in | ||
| 16549 | the following way: | ||
| 16550 | 17533 | ||
| 16551 | @enumerate | 17534 | @enumerate |
| 16552 | @item | 17535 | @item |
| 16553 | @emph{Indentation of text below headlines}@* | 17536 | @emph{Indentation of text below headlines}@* |
| 16554 | You may indent text below each headline to make the left boundary line up | 17537 | Indent text to align with the headline. |
| 16555 | with the headline, like | ||
| 16556 | 17538 | ||
| 16557 | @example | 17539 | @example |
| 16558 | *** 3rd level | 17540 | *** 3rd level |
| @@ -16560,23 +17542,21 @@ with the headline, like | |||
| 16560 | @end example | 17542 | @end example |
| 16561 | 17543 | ||
| 16562 | @vindex org-adapt-indentation | 17544 | @vindex org-adapt-indentation |
| 16563 | Org supports this with paragraph filling, line wrapping, and structure | 17545 | Org adapts indentations with paragraph filling, line wrapping, and structure |
| 16564 | editing@footnote{See also the variable @code{org-adapt-indentation}.}, | 17546 | editing@footnote{Also see the variable @code{org-adapt-indentation}.}. |
| 16565 | preserving or adapting the indentation as appropriate. | ||
| 16566 | 17547 | ||
| 16567 | @item | 17548 | @item |
| 16568 | @vindex org-hide-leading-stars | 17549 | @vindex org-hide-leading-stars |
| 16569 | @emph{Hiding leading stars}@* You can modify the display in such a way that | 17550 | @emph{Hiding leading stars}@* Org can make leading stars invisible. For |
| 16570 | all leading stars become invisible. To do this in a global way, configure | 17551 | global preference, configure the variable @code{org-hide-leading-stars}. For |
| 16571 | the variable @code{org-hide-leading-stars} or change this on a per-file basis | 17552 | per-file preference, use these file @code{#+STARTUP} options: |
| 16572 | with | ||
| 16573 | 17553 | ||
| 16574 | @example | 17554 | @example |
| 16575 | #+STARTUP: hidestars | 17555 | #+STARTUP: hidestars |
| 16576 | #+STARTUP: showstars | 17556 | #+STARTUP: showstars |
| 16577 | @end example | 17557 | @end example |
| 16578 | 17558 | ||
| 16579 | With hidden stars, the tree becomes: | 17559 | With stars hidden, the tree is shown as: |
| 16580 | 17560 | ||
| 16581 | @example | 17561 | @example |
| 16582 | @group | 17562 | @group |
| @@ -16589,50 +17569,39 @@ With hidden stars, the tree becomes: | |||
| 16589 | 17569 | ||
| 16590 | @noindent | 17570 | @noindent |
| 16591 | @vindex org-hide @r{(face)} | 17571 | @vindex org-hide @r{(face)} |
| 16592 | The leading stars are not truly replaced by whitespace, they are only | 17572 | Because Org makes the font color same as the background color to hide to |
| 16593 | fontified with the face @code{org-hide} that uses the background color as | 17573 | stars, sometimes @code{org-hide} face may need tweaking to get the effect |
| 16594 | font color. If you are not using either white or black background, you may | 17574 | right. For some black and white combinations, @code{grey90} on a white |
| 16595 | have to customize this face to get the wanted effect. Another possibility is | 17575 | background might mask the stars better. |
| 16596 | to set this font such that the extra stars are @i{almost} invisible, for | ||
| 16597 | example using the color @code{grey90} on a white background. | ||
| 16598 | 17576 | ||
| 16599 | @item | 17577 | @item |
| 16600 | @vindex org-odd-levels-only | 17578 | @vindex org-odd-levels-only |
| 16601 | Things become cleaner still if you skip all the even levels and use only odd | 17579 | Using stars for only odd levels, 1, 3, 5, @dots{}, can also clean up the |
| 16602 | levels 1, 3, 5..., effectively adding two stars to go from one outline level | 17580 | clutter. This removes two stars from each level@footnote{Because |
| 16603 | to the next@footnote{When you need to specify a level for a property search | 17581 | @samp{LEVEL=2} has 3 stars, @samp{LEVEL=3} has 4 stars, and so on}. For Org |
| 16604 | or refile targets, @samp{LEVEL=2} will correspond to 3 stars, etc.}. In this | 17582 | to properly handle this cleaner structure during edits and exports, configure |
| 16605 | way we get the outline view shown at the beginning of this section. In order | 17583 | the variable @code{org-odd-levels-only}. To set this per-file, use either |
| 16606 | to make the structure editing and export commands handle this convention | 17584 | one of the following lines: |
| 16607 | correctly, configure the variable @code{org-odd-levels-only}, or set this on | ||
| 16608 | a per-file basis with one of the following lines: | ||
| 16609 | 17585 | ||
| 16610 | @example | 17586 | @example |
| 16611 | #+STARTUP: odd | 17587 | #+STARTUP: odd |
| 16612 | #+STARTUP: oddeven | 17588 | #+STARTUP: oddeven |
| 16613 | @end example | 17589 | @end example |
| 16614 | 17590 | ||
| 16615 | You can convert an Org file from single-star-per-level to the | 17591 | To switch between single and double stars layouts, use @kbd{M-x |
| 16616 | double-star-per-level convention with @kbd{M-x org-convert-to-odd-levels | 17592 | org-convert-to-odd-levels RET} and @kbd{M-x org-convert-to-oddeven-levels}. |
| 16617 | RET} in that file. The reverse operation is @kbd{M-x | ||
| 16618 | org-convert-to-oddeven-levels}. | ||
| 16619 | @end enumerate | 17593 | @end enumerate |
| 16620 | 17594 | ||
| 16621 | @node TTY keys, Interaction, Clean view, Miscellaneous | 17595 | @node TTY keys |
| 16622 | @section Using Org on a tty | 17596 | @section Using Org on a tty |
| 16623 | @cindex tty key bindings | 17597 | @cindex tty key bindings |
| 16624 | 17598 | ||
| 16625 | Because Org contains a large number of commands, by default many of | 17599 | Org provides alternative key bindings for TTY and modern mobile devices that |
| 16626 | Org's core commands are bound to keys that are generally not | 17600 | cannot handle cursor keys and complex modifier key chords. Some of these |
| 16627 | accessible on a tty, such as the cursor keys (@key{left}, @key{right}, | 17601 | workarounds may be more cumbersome than necessary. Users should look into |
| 16628 | @key{up}, @key{down}), @key{TAB} and @key{RET}, in particular when used | 17602 | customizing these further based on their usage needs. For example, the |
| 16629 | together with modifiers like @key{Meta} and/or @key{Shift}. To access | 17603 | normal @kbd{S-@key{cursor}} for editing timestamp might be better with |
| 16630 | these commands on a tty when special keys are unavailable, the following | 17604 | @kbd{C-c .} chord. |
| 16631 | alternative bindings can be used. The tty bindings below will likely be | ||
| 16632 | more cumbersome; you may find for some of the bindings below that a | ||
| 16633 | customized workaround suits you better. For example, changing a timestamp | ||
| 16634 | is really only fun with @kbd{S-@key{cursor}} keys, whereas on a | ||
| 16635 | tty you would rather use @kbd{C-c .} to re-insert the timestamp. | ||
| 16636 | 17605 | ||
| 16637 | @multitable @columnfractions 0.15 0.2 0.1 0.2 | 17606 | @multitable @columnfractions 0.15 0.2 0.1 0.2 |
| 16638 | @item @b{Default} @tab @b{Alternative 1} @tab @b{Speed key} @tab @b{Alternative 2} | 17607 | @item @b{Default} @tab @b{Alternative 1} @tab @b{Speed key} @tab @b{Alternative 2} |
| @@ -16657,74 +17626,62 @@ tty you would rather use @kbd{C-c .} to re-insert the timestamp. | |||
| 16657 | @end multitable | 17626 | @end multitable |
| 16658 | 17627 | ||
| 16659 | 17628 | ||
| 16660 | @node Interaction, org-crypt, TTY keys, Miscellaneous | 17629 | @node Interaction |
| 16661 | @section Interaction with other packages | 17630 | @section Interaction with other packages |
| 16662 | @cindex packages, interaction with other | 17631 | @cindex packages, interaction with other |
| 16663 | Org lives in the world of GNU Emacs and interacts in various ways | 17632 | Org's compatibility and the level of interaction with other Emacs packages |
| 16664 | with other code out there. | 17633 | are documented here. |
| 17634 | |||
| 16665 | 17635 | ||
| 16666 | @menu | 17636 | @menu |
| 16667 | * Cooperation:: Packages Org cooperates with | 17637 | * Cooperation:: Packages Org cooperates with |
| 16668 | * Conflicts:: Packages that lead to conflicts | 17638 | * Conflicts:: Packages that lead to conflicts |
| 16669 | @end menu | 17639 | @end menu |
| 16670 | 17640 | ||
| 16671 | @node Cooperation, Conflicts, Interaction, Interaction | 17641 | @node Cooperation |
| 16672 | @subsection Packages that Org cooperates with | 17642 | @subsection Packages that Org cooperates with |
| 16673 | 17643 | ||
| 16674 | @table @asis | 17644 | @table @asis |
| 16675 | @cindex @file{calc.el} | 17645 | @cindex @file{calc.el} |
| 16676 | @cindex Gillespie, Dave | 17646 | @cindex Gillespie, Dave |
| 16677 | @item @file{calc.el} by Dave Gillespie | 17647 | @item @file{calc.el} by Dave Gillespie |
| 16678 | Org uses the Calc package for implementing spreadsheet | 17648 | Org uses the Calc package for tables to implement spreadsheet functionality |
| 16679 | functionality in its tables (@pxref{The spreadsheet}). Org | 17649 | (@pxref{The spreadsheet}). Org also uses Calc for embedded calculations. |
| 16680 | checks for the availability of Calc by looking for the function | 17650 | @xref{Embedded Mode, , Embedded Mode, calc, GNU Emacs Calc Manual}. |
| 16681 | @code{calc-eval} which will have been autoloaded during setup if Calc has | ||
| 16682 | been installed properly. As of Emacs 22, Calc is part of the Emacs | ||
| 16683 | distribution. Another possibility for interaction between the two | ||
| 16684 | packages is using Calc for embedded calculations. @xref{Embedded Mode, | ||
| 16685 | , Embedded Mode, calc, GNU Emacs Calc Manual}. | ||
| 16686 | @item @file{constants.el} by Carsten Dominik | 17651 | @item @file{constants.el} by Carsten Dominik |
| 16687 | @cindex @file{constants.el} | 17652 | @cindex @file{constants.el} |
| 16688 | @cindex Dominik, Carsten | 17653 | @cindex Dominik, Carsten |
| 16689 | @vindex org-table-formula-constants | 17654 | @vindex org-table-formula-constants |
| 16690 | In a table formula (@pxref{The spreadsheet}), it is possible to use | 17655 | Org can use names for constants in formulas in tables. Org can also use |
| 16691 | names for natural constants or units. Instead of defining your own | 17656 | calculation suffixes for units, such as @samp{M} for @samp{Mega}. For a |
| 16692 | constants in the variable @code{org-table-formula-constants}, install | 17657 | standard collection of such constants, install the @file{constants} package. |
| 16693 | the @file{constants} package which defines a large number of constants | 17658 | Install version 2.0 of this package, available at |
| 16694 | and units, and lets you use unit prefixes like @samp{M} for | 17659 | @url{http://www.astro.uva.nl/~dominik/Tools}. Org checks if the function |
| 16695 | @samp{Mega}, etc. You will need version 2.0 of this package, available | 17660 | @code{constants-get} has been autoloaded. Installation instructions are in |
| 16696 | at @url{http://www.astro.uva.nl/~dominik/Tools}. Org checks for | 17661 | the file, @file{constants.el}. |
| 16697 | the function @code{constants-get}, which has to be autoloaded in your | ||
| 16698 | setup. See the installation instructions in the file | ||
| 16699 | @file{constants.el}. | ||
| 16700 | @item @file{cdlatex.el} by Carsten Dominik | 17662 | @item @file{cdlatex.el} by Carsten Dominik |
| 16701 | @cindex @file{cdlatex.el} | 17663 | @cindex @file{cdlatex.el} |
| 16702 | @cindex Dominik, Carsten | 17664 | @cindex Dominik, Carsten |
| 16703 | Org mode can make use of the CD@LaTeX{} package to efficiently enter | 17665 | Org mode can use CD@LaTeX{} package to efficiently enter @LaTeX{} fragments |
| 16704 | @LaTeX{} fragments into Org files. See @ref{CDLaTeX mode}. | 17666 | into Org files (@pxref{CDLaTeX mode}). |
| 16705 | @item @file{imenu.el} by Ake Stenhoff and Lars Lindberg | 17667 | @item @file{imenu.el} by Ake Stenhoff and Lars Lindberg |
| 16706 | @cindex @file{imenu.el} | 17668 | @cindex @file{imenu.el} |
| 16707 | Imenu allows menu access to an index of items in a file. Org mode | 17669 | Imenu creates dynamic menus based on an index of items in a file. Org mode |
| 16708 | supports Imenu---all you need to do to get the index is the following: | 17670 | supports Imenu menus. Enable it with a mode hook as follows: |
| 16709 | @lisp | 17671 | @lisp |
| 16710 | (add-hook 'org-mode-hook | 17672 | (add-hook 'org-mode-hook |
| 16711 | (lambda () (imenu-add-to-menubar "Imenu"))) | 17673 | (lambda () (imenu-add-to-menubar "Imenu"))) |
| 16712 | @end lisp | 17674 | @end lisp |
| 16713 | @vindex org-imenu-depth | 17675 | @vindex org-imenu-depth |
| 16714 | By default the index is two levels deep---you can modify the depth using | 17676 | By default the Imenu index is two levels deep. Change the index depth using |
| 16715 | the option @code{org-imenu-depth}. | 17677 | thes variable, @code{org-imenu-depth}. |
| 16716 | @item @file{remember.el} by John Wiegley | ||
| 16717 | @cindex @file{remember.el} | ||
| 16718 | @cindex Wiegley, John | ||
| 16719 | Org used to use this package for capture, but no longer does. | ||
| 16720 | @item @file{speedbar.el} by Eric M. Ludlam | 17678 | @item @file{speedbar.el} by Eric M. Ludlam |
| 16721 | @cindex @file{speedbar.el} | 17679 | @cindex @file{speedbar.el} |
| 16722 | @cindex Ludlam, Eric M. | 17680 | @cindex Ludlam, Eric M. |
| 16723 | Speedbar is a package that creates a special frame displaying files and | 17681 | Speedbar package creates a special Emacs frame for displaying files and index |
| 16724 | index items in files. Org mode supports Speedbar and allows you to | 17682 | items in files. Org mode supports Speedbar; users can drill into Org files |
| 16725 | drill into Org files directly from the Speedbar. It also allows you to | 17683 | directly from the Speedbar. The @kbd{<} in the Speedbar frame tweeks the |
| 16726 | restrict the scope of agenda commands to a file or a subtree by using | 17684 | agenda commands to that file or to a subtree. |
| 16727 | the command @kbd{<} in the Speedbar frame. | ||
| 16728 | @cindex @file{table.el} | 17685 | @cindex @file{table.el} |
| 16729 | @item @file{table.el} by Takaaki Ota | 17686 | @item @file{table.el} by Takaaki Ota |
| 16730 | @kindex C-c C-c | 17687 | @kindex C-c C-c |
| @@ -16733,13 +17690,11 @@ the command @kbd{<} in the Speedbar frame. | |||
| 16733 | @cindex Ota, Takaaki | 17690 | @cindex Ota, Takaaki |
| 16734 | 17691 | ||
| 16735 | Complex ASCII tables with automatic line wrapping, column- and row-spanning, | 17692 | Complex ASCII tables with automatic line wrapping, column- and row-spanning, |
| 16736 | and alignment can be created using the Emacs table package by Takaaki Ota | 17693 | and alignment can be created using the Emacs table package by Takaaki Ota. |
| 16737 | (@uref{http://sourceforge.net/projects/table}, and also part of Emacs 22). | 17694 | Org mode recognizes such tables and export them properly. @kbd{C-c '} to |
| 16738 | Org mode will recognize these tables and export them properly. Because of | 17695 | edit these tables in a special buffer, much like Org's @samp{src} code |
| 16739 | interference with other Org mode functionality, you unfortunately cannot edit | 17696 | blocks. Because of interference with other Org mode functionality, Takaaki |
| 16740 | these tables directly in the buffer. Instead, you need to use the command | 17697 | Ota tables cannot be edited directly in the Org buffer. |
| 16741 | @kbd{C-c '} to edit them, similar to source code snippets. | ||
| 16742 | |||
| 16743 | @table @kbd | 17698 | @table @kbd |
| 16744 | @orgcmd{C-c ',org-edit-special} | 17699 | @orgcmd{C-c ',org-edit-special} |
| 16745 | Edit a @file{table.el} table. Works when the cursor is in a table.el table. | 17700 | Edit a @file{table.el} table. Works when the cursor is in a table.el table. |
| @@ -16747,50 +17702,37 @@ Edit a @file{table.el} table. Works when the cursor is in a table.el table. | |||
| 16747 | @orgcmd{C-c ~,org-table-create-with-table.el} | 17702 | @orgcmd{C-c ~,org-table-create-with-table.el} |
| 16748 | Insert a @file{table.el} table. If there is already a table at point, this | 17703 | Insert a @file{table.el} table. If there is already a table at point, this |
| 16749 | command converts it between the @file{table.el} format and the Org mode | 17704 | command converts it between the @file{table.el} format and the Org mode |
| 16750 | format. See the documentation string of the command | 17705 | format. See the documentation string of the command @code{org-convert-table} |
| 16751 | @code{org-convert-table} for the restrictions under which this is | 17706 | for details. |
| 16752 | possible. | ||
| 16753 | @end table | 17707 | @end table |
| 16754 | @file{table.el} is part of Emacs since Emacs 22. | ||
| 16755 | @item @file{footnote.el} by Steven L. Baur | ||
| 16756 | @cindex @file{footnote.el} | ||
| 16757 | @cindex Baur, Steven L. | ||
| 16758 | Org mode recognizes numerical footnotes as provided by this package. | ||
| 16759 | However, Org mode also has its own footnote support (@pxref{Footnotes}), | ||
| 16760 | which makes using @file{footnote.el} unnecessary. | ||
| 16761 | @end table | 17708 | @end table |
| 16762 | 17709 | ||
| 16763 | @node Conflicts, , Cooperation, Interaction | 17710 | @node Conflicts |
| 16764 | @subsection Packages that lead to conflicts with Org mode | 17711 | @subsection Packages that conflict with Org mode |
| 16765 | 17712 | ||
| 16766 | @table @asis | 17713 | @table @asis |
| 16767 | 17714 | ||
| 16768 | @cindex @code{shift-selection-mode} | 17715 | @cindex @code{shift-selection-mode} |
| 16769 | @vindex org-support-shift-select | 17716 | @vindex org-support-shift-select |
| 16770 | In Emacs 23, @code{shift-selection-mode} is on by default, meaning that | 17717 | In Emacs, @code{shift-selection-mode} combines cursor motions with shift key |
| 16771 | cursor motions combined with the shift key should start or enlarge regions. | 17718 | to enlarge regions. Emacs sets this mode by default. This conflicts with |
| 16772 | This conflicts with the use of @kbd{S-@key{cursor}} commands in Org to change | 17719 | Org's use of @kbd{S-@key{cursor}} commands to change timestamps, TODO |
| 16773 | timestamps, TODO keywords, priorities, and item bullet types if the cursor is | 17720 | keywords, priorities, and item bullet types, etc. Since @kbd{S-@key{cursor}} |
| 16774 | at such a location. By default, @kbd{S-@key{cursor}} commands outside | 17721 | commands outside of specific contexts don't do anything, Org offers the |
| 16775 | special contexts don't do anything, but you can customize the variable | 17722 | variable @code{org-support-shift-select} for customization. Org mode |
| 16776 | @code{org-support-shift-select}. Org mode then tries to accommodate shift | 17723 | accommodates shift selection by (i) making it available outside of the |
| 16777 | selection by (i) using it outside of the special contexts where special | 17724 | special contexts where special commands apply, and (ii) extending an |
| 16778 | commands apply, and by (ii) extending an existing active region even if the | 17725 | existing active region even if the cursor moves across a special context. |
| 16779 | cursor moves across a special context. | ||
| 16780 | 17726 | ||
| 16781 | @item @file{CUA.el} by Kim. F. Storm | 17727 | @item @file{CUA.el} by Kim. F. Storm |
| 16782 | @cindex @file{CUA.el} | 17728 | @cindex @file{CUA.el} |
| 16783 | @cindex Storm, Kim. F. | 17729 | @cindex Storm, Kim. F. |
| 16784 | @vindex org-replace-disputed-keys | 17730 | @vindex org-replace-disputed-keys |
| 16785 | Key bindings in Org conflict with the @kbd{S-<cursor>} keys used by CUA mode | 17731 | Org key bindings conflict with @kbd{S-<cursor>} keys used by CUA mode. For |
| 16786 | (as well as @code{pc-select-mode} and @code{s-region-mode}) to select and extend the | 17732 | Org to relinquish these bindings to CUA mode, configure the variable |
| 16787 | region. In fact, Emacs 23 has this built-in in the form of | 17733 | @code{org-replace-disputed-keys}. When set, Org moves the following key |
| 16788 | @code{shift-selection-mode}, see previous paragraph. If you are using Emacs | 17734 | bindings in Org files, and in the agenda buffer (but not during date |
| 16789 | 23, you probably don't want to use another package for this purpose. However, | 17735 | selection). |
| 16790 | if you prefer to leave these keys to a different package while working in | ||
| 16791 | Org mode, configure the variable @code{org-replace-disputed-keys}. When set, | ||
| 16792 | Org will move the following key bindings in Org files, and in the agenda | ||
| 16793 | buffer (but not during date selection). | ||
| 16794 | 17736 | ||
| 16795 | @example | 17737 | @example |
| 16796 | S-UP @result{} M-p S-DOWN @result{} M-n | 17738 | S-UP @result{} M-p S-DOWN @result{} M-n |
| @@ -16799,9 +17741,8 @@ C-S-LEFT @result{} M-S-- C-S-RIGHT @result{} M-S-+ | |||
| 16799 | @end example | 17741 | @end example |
| 16800 | 17742 | ||
| 16801 | @vindex org-disputed-keys | 17743 | @vindex org-disputed-keys |
| 16802 | Yes, these are unfortunately more difficult to remember. If you want | 17744 | Yes, these are unfortunately more difficult to remember. To define a |
| 16803 | to have other replacement keys, look at the variable | 17745 | different replacement keys, look at the variable @code{org-disputed-keys}. |
| 16804 | @code{org-disputed-keys}. | ||
| 16805 | 17746 | ||
| 16806 | @item @file{ecomplete.el} by Lars Magne Ingebrigtsen @email{larsi@@gnus.org} | 17747 | @item @file{ecomplete.el} by Lars Magne Ingebrigtsen @email{larsi@@gnus.org} |
| 16807 | @cindex @file{ecomplete.el} | 17748 | @cindex @file{ecomplete.el} |
| @@ -16819,9 +17760,8 @@ manually when needed in the messages body. | |||
| 16819 | @cindex @file{filladapt.el} | 17760 | @cindex @file{filladapt.el} |
| 16820 | 17761 | ||
| 16821 | Org mode tries to do the right thing when filling paragraphs, list items and | 17762 | Org mode tries to do the right thing when filling paragraphs, list items and |
| 16822 | other elements. Many users reported they had problems using both | 17763 | other elements. Many users reported problems using both @file{filladapt.el} |
| 16823 | @file{filladapt.el} and Org mode, so a safe thing to do is to disable it like | 17764 | and Org mode, so a safe thing to do is to disable filladapt like this: |
| 16824 | this: | ||
| 16825 | 17765 | ||
| 16826 | @lisp | 17766 | @lisp |
| 16827 | (add-hook 'org-mode-hook 'turn-off-filladapt-mode) | 17767 | (add-hook 'org-mode-hook 'turn-off-filladapt-mode) |
| @@ -16836,20 +17776,19 @@ fixed this problem: | |||
| 16836 | @lisp | 17776 | @lisp |
| 16837 | (add-hook 'org-mode-hook | 17777 | (add-hook 'org-mode-hook |
| 16838 | (lambda () | 17778 | (lambda () |
| 16839 | (org-set-local 'yas/trigger-key [tab]) | 17779 | (setq-local yas/trigger-key [tab]) |
| 16840 | (define-key yas/keymap [tab] 'yas/next-field-or-maybe-expand))) | 17780 | (define-key yas/keymap [tab] 'yas/next-field-or-maybe-expand))) |
| 16841 | @end lisp | 17781 | @end lisp |
| 16842 | 17782 | ||
| 16843 | The latest version of yasnippet doesn't play well with Org mode. If the | 17783 | The latest version of yasnippet doesn't play well with Org mode. If the |
| 16844 | above code does not fix the conflict, start by defining the following | 17784 | above code does not fix the conflict, first define the following function: |
| 16845 | function: | ||
| 16846 | 17785 | ||
| 16847 | @lisp | 17786 | @lisp |
| 16848 | (defun yas/org-very-safe-expand () | 17787 | (defun yas/org-very-safe-expand () |
| 16849 | (let ((yas/fallback-behavior 'return-nil)) (yas/expand))) | 17788 | (let ((yas/fallback-behavior 'return-nil)) (yas/expand))) |
| 16850 | @end lisp | 17789 | @end lisp |
| 16851 | 17790 | ||
| 16852 | Then, tell Org mode what to do with the new function: | 17791 | Then tell Org mode to use that function: |
| 16853 | 17792 | ||
| 16854 | @lisp | 17793 | @lisp |
| 16855 | (add-hook 'org-mode-hook | 17794 | (add-hook 'org-mode-hook |
| @@ -16892,21 +17831,19 @@ another key for this command, or override the key in | |||
| 16892 | 17831 | ||
| 16893 | @end table | 17832 | @end table |
| 16894 | 17833 | ||
| 16895 | @node org-crypt, , Interaction, Miscellaneous | 17834 | @node org-crypt |
| 16896 | @section org-crypt.el | 17835 | @section org-crypt.el |
| 16897 | @cindex @file{org-crypt.el} | 17836 | @cindex @file{org-crypt.el} |
| 16898 | @cindex @code{org-decrypt-entry} | 17837 | @cindex @code{org-decrypt-entry} |
| 16899 | 17838 | ||
| 16900 | Org-crypt will encrypt the text of an entry, but not the headline, or | 17839 | Org crypt encrypts the text of an Org entry, but not the headline, or |
| 16901 | properties. Org-crypt uses the Emacs EasyPG library to encrypt and decrypt | 17840 | properties. Org crypt uses the Emacs EasyPG library to encrypt and decrypt. |
| 16902 | files. | ||
| 16903 | 17841 | ||
| 16904 | Any text below a headline that has a @samp{:crypt:} tag will be automatically | 17842 | Any text below a headline that has a @samp{:crypt:} tag will be automatically |
| 16905 | be encrypted when the file is saved. If you want to use a different tag just | 17843 | be encrypted when the file is saved. To use a different tag, customize the |
| 16906 | customize the @code{org-crypt-tag-matcher} setting. | 17844 | @code{org-crypt-tag-matcher} variable. |
| 16907 | 17845 | ||
| 16908 | To use org-crypt it is suggested that you have the following in your | 17846 | Suggested Org crypt settings in Emacs init file: |
| 16909 | @file{.emacs}: | ||
| 16910 | 17847 | ||
| 16911 | @lisp | 17848 | @lisp |
| 16912 | (require 'org-crypt) | 17849 | (require 'org-crypt) |
| @@ -16928,14 +17865,14 @@ To use org-crypt it is suggested that you have the following in your | |||
| 16928 | ;; # -*- buffer-auto-save-file-name: nil; -*- | 17865 | ;; # -*- buffer-auto-save-file-name: nil; -*- |
| 16929 | @end lisp | 17866 | @end lisp |
| 16930 | 17867 | ||
| 16931 | Excluding the crypt tag from inheritance prevents already encrypted text | 17868 | Excluding the crypt tag from inheritance prevents encrypting previously |
| 16932 | being encrypted again. | 17869 | encrypted text. |
| 16933 | 17870 | ||
| 16934 | @node Hacking, MobileOrg, Miscellaneous, Top | 17871 | @node Hacking |
| 16935 | @appendix Hacking | 17872 | @appendix Hacking |
| 16936 | @cindex hacking | 17873 | @cindex hacking |
| 16937 | 17874 | ||
| 16938 | This appendix covers some aspects where users can extend the functionality of | 17875 | This appendix covers some areas where users can extend the functionality of |
| 16939 | Org. | 17876 | Org. |
| 16940 | 17877 | ||
| 16941 | @menu | 17878 | @menu |
| @@ -16953,38 +17890,35 @@ Org. | |||
| 16953 | * Using the mapping API:: Mapping over all or selected entries | 17890 | * Using the mapping API:: Mapping over all or selected entries |
| 16954 | @end menu | 17891 | @end menu |
| 16955 | 17892 | ||
| 16956 | @node Hooks, Add-on packages, Hacking, Hacking | 17893 | @node Hooks |
| 16957 | @section Hooks | 17894 | @section Hooks |
| 16958 | @cindex hooks | 17895 | @cindex hooks |
| 16959 | 17896 | ||
| 16960 | Org has a large number of hook variables that can be used to add | 17897 | Org has a large number of hook variables for adding functionality. This |
| 16961 | functionality. This appendix about hacking is going to illustrate the | 17898 | appendix illustrates using a few. A complete list of hooks with |
| 16962 | use of some of them. A complete list of all hooks with documentation is | 17899 | documentation is maintained by the Worg project at |
| 16963 | maintained by the Worg project and can be found at | 17900 | @uref{http://orgmode.org/worg/doc.html#hooks}. |
| 16964 | @uref{http://orgmode.org/worg/org-configs/org-hooks.php}. | ||
| 16965 | 17901 | ||
| 16966 | @node Add-on packages, Adding hyperlink types, Hooks, Hacking | 17902 | @node Add-on packages |
| 16967 | @section Add-on packages | 17903 | @section Add-on packages |
| 16968 | @cindex add-on packages | 17904 | @cindex add-on packages |
| 16969 | 17905 | ||
| 16970 | A large number of add-on packages have been written by various authors. | 17906 | Various authors wrote a large number of add-on packages for Org. |
| 16971 | 17907 | ||
| 16972 | These packages are not part of Emacs, but they are distributed as contributed | 17908 | These packages are not part of Emacs, but they are distributed as contributed |
| 16973 | packages with the separate release available at @uref{http://orgmode.org}. | 17909 | packages with the separate release available at @uref{http://orgmode.org}. |
| 16974 | See the @file{contrib/README} file in the source code directory for a list of | 17910 | See the @file{contrib/README} file in the source code directory for a list of |
| 16975 | contributed files. You may also find some more information on the Worg page: | 17911 | contributed files. Worg page with more information is at: |
| 16976 | @uref{http://orgmode.org/worg/org-contrib/}. | 17912 | @uref{http://orgmode.org/worg/org-contrib/}. |
| 16977 | 17913 | ||
| 16978 | @node Adding hyperlink types, Adding export back-ends, Add-on packages, Hacking | 17914 | @node Adding hyperlink types |
| 16979 | @section Adding hyperlink types | 17915 | @section Adding hyperlink types |
| 16980 | @cindex hyperlinks, adding new types | 17916 | @cindex hyperlinks, adding new types |
| 16981 | 17917 | ||
| 16982 | Org has a large number of hyperlink types built-in | 17918 | Org has many built-in hyperlink types (@pxref{Hyperlinks}), and an interface |
| 16983 | (@pxref{Hyperlinks}). If you would like to add new link types, Org | 17919 | for adding new link types. The example file, @file{org-man.el}, shows the |
| 16984 | provides an interface for doing so. Let's look at an example file, | 17920 | process of adding Org links to Unix man pages, which look like this: |
| 16985 | @file{org-man.el}, that will add support for creating links like | 17921 | @samp{[[man:printf][The printf manpage]]}: |
| 16986 | @samp{[[man:printf][The printf manpage]]} to show Unix manual pages inside | ||
| 16987 | Emacs: | ||
| 16988 | 17922 | ||
| 16989 | @lisp | 17923 | @lisp |
| 16990 | ;;; org-man.el - Support for links to manpages in Org | 17924 | ;;; org-man.el - Support for links to manpages in Org |
| @@ -17029,149 +17963,118 @@ PATH should be a topic that can be thrown at the man command." | |||
| 17029 | @end lisp | 17963 | @end lisp |
| 17030 | 17964 | ||
| 17031 | @noindent | 17965 | @noindent |
| 17032 | You would activate this new link type in @file{.emacs} with | 17966 | To activate links to man pages in Org, enter this in the init file: |
| 17033 | 17967 | ||
| 17034 | @lisp | 17968 | @lisp |
| 17035 | (require 'org-man) | 17969 | (require 'org-man) |
| 17036 | @end lisp | 17970 | @end lisp |
| 17037 | 17971 | ||
| 17038 | @noindent | 17972 | @noindent |
| 17039 | Let's go through the file and see what it does. | 17973 | A review of @file{org-man.el}: |
| 17040 | @enumerate | 17974 | @enumerate |
| 17041 | @item | 17975 | @item |
| 17042 | It does @code{(require 'org)} to make sure that @file{org.el} has been | 17976 | First, @code{(require 'org)} ensures @file{org.el} is loaded. |
| 17043 | loaded. | ||
| 17044 | @item | 17977 | @item |
| 17045 | The next line calls @code{org-add-link-type} to define a new link type | 17978 | The @code{org-add-link-type} defines a new link type with @samp{man} prefix. |
| 17046 | with prefix @samp{man}. The call also contains the name of a function | 17979 | The call contains the function to call that follows the link type. |
| 17047 | that will be called to follow such a link. | ||
| 17048 | @item | 17980 | @item |
| 17049 | @vindex org-store-link-functions | 17981 | @vindex org-store-link-functions |
| 17050 | The next line adds a function to @code{org-store-link-functions}, in | 17982 | The next line adds a function to @code{org-store-link-functions} that records |
| 17051 | order to allow the command @kbd{C-c l} to record a useful link in a | 17983 | a useful link with the command @kbd{C-c l} in a buffer displaying a man page. |
| 17052 | buffer displaying a man page. | ||
| 17053 | @end enumerate | 17984 | @end enumerate |
| 17054 | 17985 | ||
| 17055 | The rest of the file defines the necessary variables and functions. | 17986 | The rest of the file defines necessary variables and functions. First is the |
| 17056 | First there is a customization variable that determines which Emacs | 17987 | customization variable @code{org-man-command}. It has two options, |
| 17057 | command should be used to display man pages. There are two options, | 17988 | @code{man} and @code{woman}. Next is a function whose argument is the link |
| 17058 | @code{man} and @code{woman}. Then the function to follow a link is | 17989 | path, which for man pages is the topic of the man command. To follow the |
| 17059 | defined. It gets the link path as an argument---in this case the link | 17990 | link, the function calls the @code{org-man-command} to display the man page. |
| 17060 | path is just a topic for the manual command. The function calls the | 17991 | |
| 17061 | value of @code{org-man-command} to display the man page. | 17992 | |
| 17062 | 17993 | @kbd{C-c l} constructs and stores the link. | |
| 17063 | Finally the function @code{org-man-store-link} is defined. When you try | 17994 | |
| 17064 | to store a link with @kbd{C-c l}, this function will be called to | 17995 | @kbd{C-c l} calls the function @code{org-man-store-link}, which first checks |
| 17065 | try to make a link. The function must first decide if it is supposed to | 17996 | if the @code{major-mode} is appropriate. If check fails, the function |
| 17066 | create the link for this buffer type; we do this by checking the value | 17997 | returns @code{nil}. Otherwise the function makes a link string by combining |
| 17067 | of the variable @code{major-mode}. If not, the function must exit and | 17998 | the @samp{man:} prefix with the man topic. The function then calls |
| 17068 | return the value @code{nil}. If yes, the link is created by getting the | 17999 | @code{org-store-link-props} with @code{:type} and @code{:link} properties. A |
| 17069 | manual topic from the buffer name and prefixing it with the string | 18000 | @code{:description} property is an optional string that is displayed when the |
| 17070 | @samp{man:}. Then it must call the command @code{org-store-link-props} | 18001 | function inserts the link in the Org buffer. |
| 17071 | and set the @code{:type} and @code{:link} properties. Optionally you | 18002 | |
| 17072 | can also set the @code{:description} property to provide a default for | 18003 | @kbd{C-c C-l} inserts the stored link. |
| 17073 | the link description when the link is later inserted into an Org | 18004 | |
| 17074 | buffer with @kbd{C-c C-l}. | 18005 | To define new link types, define a function that implements completion |
| 17075 | 18006 | support with @kbd{C-c C-l}. This function should not accept any arguments | |
| 17076 | When it makes sense for your new link type, you may also define a function | 18007 | but return the appropriate prefix and complete link string. |
| 17077 | @code{org-PREFIX-complete-link} that implements special (e.g., completion) | 18008 | |
| 17078 | support for inserting such a link with @kbd{C-c C-l}. Such a function should | 18009 | @node Adding export back-ends |
| 17079 | not accept any arguments, and return the full link with prefix. | ||
| 17080 | |||
| 17081 | @node Adding export back-ends, Context-sensitive commands, Adding hyperlink types, Hacking | ||
| 17082 | @section Adding export back-ends | 18010 | @section Adding export back-ends |
| 17083 | @cindex Export, writing back-ends | 18011 | @cindex Export, writing back-ends |
| 17084 | 18012 | ||
| 17085 | Org 8.0 comes with a completely rewritten export engine which makes it easy | 18013 | Org's export engine makes it easy for writing new back-ends. The framework |
| 17086 | to write new export back-ends, either from scratch, or from deriving them | 18014 | on which the engine was built makes it easy to derive new back-ends from |
| 17087 | from existing ones. | 18015 | existing ones. |
| 17088 | 18016 | ||
| 17089 | Your two entry points are respectively @code{org-export-define-backend} and | 18017 | The two main entry points to the export engine are: |
| 17090 | @code{org-export-define-derived-backend}. To grok these functions, you | 18018 | @code{org-export-define-backend} and |
| 17091 | should first have a look at @file{ox-latex.el} (for how to define a new | 18019 | @code{org-export-define-derived-backend}. To grok these functions, see |
| 17092 | back-end from scratch) and @file{ox-beamer.el} (for how to derive a new | 18020 | @file{ox-latex.el} for an example of defining a new back-end from scratch, |
| 17093 | back-end from an existing one. | 18021 | and @file{ox-beamer.el} for an example of deriving from an existing engine. |
| 17094 | 18022 | ||
| 17095 | When creating a new back-end from scratch, the basic idea is to set the name | 18023 | For creating a new back-end from scratch, first set its name as a symbol in |
| 17096 | of the back-end (as a symbol) and an an alist of elements and export | 18024 | an alist consisting of elements and export functions. To make the back-end |
| 17097 | functions. On top of this, you will need to set additional keywords like | 18025 | visible to the export dispatcher, set @code{:menu-entry} keyword. For export |
| 17098 | @code{:menu-entry} (to display the back-end in the export dispatcher), | 18026 | options specific to this back-end, set the @code{:options-alist}. |
| 17099 | @code{:export-block} (to specify what blocks should not be exported by this | 18027 | |
| 17100 | back-end), and @code{:options-alist} (to let the user set export options that | 18028 | For creating a new back-end from an existing one, set @code{:translate-alist} |
| 17101 | are specific to this back-end.) | 18029 | to an alist of export functions. This alist replaces the parent back-end |
| 17102 | 18030 | functions. | |
| 17103 | Deriving a new back-end is similar, except that you need to set | 18031 | |
| 17104 | @code{:translate-alist} to an alist of export functions that should be used | 18032 | For complete documentation, see |
| 17105 | instead of the parent back-end functions. | ||
| 17106 | |||
| 17107 | For a complete reference documentation, see | ||
| 17108 | @url{http://orgmode.org/worg/dev/org-export-reference.html, the Org Export | 18033 | @url{http://orgmode.org/worg/dev/org-export-reference.html, the Org Export |
| 17109 | Reference on Worg}. | 18034 | Reference on Worg}. |
| 17110 | 18035 | ||
| 17111 | @node Context-sensitive commands, Tables in arbitrary syntax, Adding export back-ends, Hacking | 18036 | @node Context-sensitive commands |
| 17112 | @section Context-sensitive commands | 18037 | @section Context-sensitive commands |
| 17113 | @cindex context-sensitive commands, hooks | 18038 | @cindex context-sensitive commands, hooks |
| 17114 | @cindex add-ons, context-sensitive commands | 18039 | @cindex add-ons, context-sensitive commands |
| 17115 | @vindex org-ctrl-c-ctrl-c-hook | 18040 | @vindex org-ctrl-c-ctrl-c-hook |
| 17116 | 18041 | ||
| 17117 | Org has several commands that act differently depending on context. The most | 18042 | Org has facilities for building context sensitive commands. Authors of Org |
| 17118 | important example is the @kbd{C-c C-c} (@pxref{The very busy C-c C-c key}). | 18043 | add-ons can tap into this functionality. |
| 17119 | Also the @kbd{M-cursor} and @kbd{M-S-cursor} keys have this property. | ||
| 17120 | 18044 | ||
| 17121 | Add-ons can tap into this functionality by providing a function that detects | 18045 | Some Org commands change depending on the context. The most important |
| 17122 | special context for that add-on and executes functionality appropriate for | 18046 | example of this behavior is the @kbd{C-c C-c} (@pxref{The very busy C-c C-c |
| 17123 | the context. Here is an example from Dan Davison's @file{org-R.el} which | 18047 | key}). Other examples are @kbd{M-cursor} and @kbd{M-S-cursor}. |
| 17124 | allows you to evaluate commands based on the @file{R} programming language | ||
| 17125 | @footnote{@file{org-R.el} has been replaced by the Org mode functionality | ||
| 17126 | described in @ref{Working With Source Code} and is now obsolete.}. For this | ||
| 17127 | package, special contexts are lines that start with @code{#+R:} or | ||
| 17128 | @code{#+RR:}. | ||
| 17129 | |||
| 17130 | @lisp | ||
| 17131 | (defun org-R-apply-maybe () | ||
| 17132 | "Detect if this is context for org-R and execute R commands." | ||
| 17133 | (if (save-excursion | ||
| 17134 | (beginning-of-line 1) | ||
| 17135 | (looking-at "#\\+RR?:")) | ||
| 17136 | (progn (call-interactively 'org-R-apply) | ||
| 17137 | t) ;; to signal that we took action | ||
| 17138 | nil)) ;; to signal that we did not | ||
| 17139 | |||
| 17140 | (add-hook 'org-ctrl-c-ctrl-c-hook 'org-R-apply-maybe) | ||
| 17141 | @end lisp | ||
| 17142 | |||
| 17143 | The function first checks if the cursor is in such a line. If that is the | ||
| 17144 | case, @code{org-R-apply} is called and the function returns @code{t} to | ||
| 17145 | signal that action was taken, and @kbd{C-c C-c} will stop looking for other | ||
| 17146 | contexts. If the function finds it should do nothing locally, it returns | ||
| 17147 | @code{nil} so that other, similar functions can have a try. | ||
| 17148 | 18048 | ||
| 18049 | These context sensitive commands work by providing a function that detects | ||
| 18050 | special context for that add-on and executes functionality appropriate for | ||
| 18051 | that context. | ||
| 17149 | 18052 | ||
| 17150 | @node Tables in arbitrary syntax, Dynamic blocks, Context-sensitive commands, Hacking | 18053 | @node Tables in arbitrary syntax |
| 17151 | @section Tables and lists in arbitrary syntax | 18054 | @section Tables and lists in arbitrary syntax |
| 17152 | @cindex tables, in other modes | 18055 | @cindex tables, in other modes |
| 17153 | @cindex lists, in other modes | 18056 | @cindex lists, in other modes |
| 17154 | @cindex Orgtbl mode | 18057 | @cindex Orgtbl mode |
| 17155 | 18058 | ||
| 17156 | Since Orgtbl mode can be used as a minor mode in arbitrary buffers, a | 18059 | Because of Org's success in handling tables with Orgtbl, a frequently asked |
| 17157 | frequent feature request has been to make it work with native tables in | 18060 | feature is to Org's usability functions to other table formats native to |
| 17158 | specific languages, for example @LaTeX{}. However, this is extremely | 18061 | other modem's, such as @LaTeX{}. This would be hard to do in a general way |
| 17159 | hard to do in a general way, would lead to a customization nightmare, | 18062 | without complicated customization nightmares. Moreover, that would take Org |
| 17160 | and would take away much of the simplicity of the Orgtbl mode table | 18063 | away from its simplicity roots that Orgtbl has proven. There is, however, an |
| 17161 | editor. | 18064 | alternate approach to accomplishing the same. |
| 17162 | 18065 | ||
| 17163 | This appendix describes a different approach. We keep the Orgtbl mode | 18066 | This approach involves implementing a custom @emph{translate} function that |
| 17164 | table in its native format (the @i{source table}), and use a custom | 18067 | operates on a native Org @emph{source table} to produce a table in another |
| 17165 | function to @i{translate} the table to the correct syntax, and to | 18068 | format. This strategy would keep the excellently working Orgtbl simple and |
| 17166 | @i{install} it in the right location (the @i{target table}). This puts | 18069 | isolate complications, if any, confined to the translate function. To add |
| 17167 | the burden of writing conversion functions on the user, but it allows | 18070 | more alien table formats, we just add more translate functions. Also the |
| 17168 | for a very flexible system. | 18071 | burden of developing custom translate functions for new table formats will be |
| 17169 | 18072 | in the hands of those who know those formats best. | |
| 17170 | Bastien added the ability to do the same with lists, in Orgstruct mode. You | 18073 | |
| 17171 | can use Org's facilities to edit and structure lists by turning | 18074 | For an example of how this strategy works, see Orgstruct mode. In that mode, |
| 17172 | @code{orgstruct-mode} on, then locally exporting such lists in another format | 18075 | Bastien added the ability to use Org's facilities to edit and re-structure |
| 17173 | (HTML, @LaTeX{} or Texinfo.) | 18076 | lists. He did by turning @code{orgstruct-mode} on, and then exporting the |
| 17174 | 18077 | list locally to another format, such as HTML, @LaTeX{} or Texinfo. | |
| 17175 | 18078 | ||
| 17176 | @menu | 18079 | @menu |
| 17177 | * Radio tables:: Sending and receiving radio tables | 18080 | * Radio tables:: Sending and receiving radio tables |
| @@ -17180,15 +18083,17 @@ can use Org's facilities to edit and structure lists by turning | |||
| 17180 | * Radio lists:: Sending and receiving lists | 18083 | * Radio lists:: Sending and receiving lists |
| 17181 | @end menu | 18084 | @end menu |
| 17182 | 18085 | ||
| 17183 | @node Radio tables, A @LaTeX{} example, Tables in arbitrary syntax, Tables in arbitrary syntax | 18086 | @node Radio tables |
| 17184 | @subsection Radio tables | 18087 | @subsection Radio tables |
| 17185 | @cindex radio tables | 18088 | @cindex radio tables |
| 17186 | 18089 | ||
| 17187 | To define the location of the target table, you first need to create two | 18090 | Radio tables are target locations for translated tables that are not near |
| 17188 | lines that are comments in the current mode, but contain magic words | 18091 | their source. Org finds the target location and inserts the translated |
| 17189 | @code{BEGIN/END RECEIVE ORGTBL} for Orgtbl mode to find. Orgtbl mode will | 18092 | table. |
| 17190 | insert the translated table between these lines, replacing whatever was there | 18093 | |
| 17191 | before. For example in C mode where comments are between @code{/* ... */}: | 18094 | The key to finding the target location are the magic words @code{BEGIN/END |
| 18095 | RECEIVE ORGTBL}. They have to appear as comments in the current mode. If | ||
| 18096 | the mode is C, then: | ||
| 17192 | 18097 | ||
| 17193 | @example | 18098 | @example |
| 17194 | /* BEGIN RECEIVE ORGTBL table_name */ | 18099 | /* BEGIN RECEIVE ORGTBL table_name */ |
| @@ -17196,8 +18101,8 @@ before. For example in C mode where comments are between @code{/* ... */}: | |||
| 17196 | @end example | 18101 | @end example |
| 17197 | 18102 | ||
| 17198 | @noindent | 18103 | @noindent |
| 17199 | Just above the source table, we put a special line that tells | 18104 | At the location of source, Org needs a special line to direct Orgtbl to |
| 17200 | Orgtbl mode how to translate this table and where to install it. For | 18105 | translate and to find the target for inserting the translated table. For |
| 17201 | example: | 18106 | example: |
| 17202 | @cindex #+ORGTBL | 18107 | @cindex #+ORGTBL |
| 17203 | @example | 18108 | @example |
| @@ -17205,67 +18110,53 @@ example: | |||
| 17205 | @end example | 18110 | @end example |
| 17206 | 18111 | ||
| 17207 | @noindent | 18112 | @noindent |
| 17208 | @code{table_name} is the reference name for the table that is also used | 18113 | @code{table_name} is the table's reference name, which is also used in the |
| 17209 | in the receiver lines. @code{translation_function} is the Lisp function | 18114 | receiver lines, and the @code{translation_function} is the Lisp function that |
| 17210 | that does the translation. Furthermore, the line can contain a list of | 18115 | translates. This line, in addition, may also contain alternating key and |
| 17211 | arguments (alternating key and value) at the end. The arguments will be | 18116 | value arguments at the end. The translation function gets these values as a |
| 17212 | passed as a property list to the translation function for | 18117 | property list. A few standard parameters are already recognized and acted |
| 17213 | interpretation. A few standard parameters are already recognized and | 18118 | upon before the translation function is called: |
| 17214 | acted upon before the translation function is called: | ||
| 17215 | 18119 | ||
| 17216 | @table @code | 18120 | @table @code |
| 17217 | @item :skip N | 18121 | @item :skip N |
| 17218 | Skip the first N lines of the table. Hlines do count as separate lines for | 18122 | Skip the first N lines of the table. Hlines do count; include them if they |
| 17219 | this parameter! | 18123 | are to be skipped. |
| 17220 | 18124 | ||
| 17221 | @item :skipcols (n1 n2 ...) | 18125 | @item :skipcols (n1 n2 ...) |
| 17222 | List of columns that should be skipped. If the table has a column with | 18126 | List of columns to be skipped. First Org automatically discards columns with |
| 17223 | calculation marks, that column is automatically discarded as well. | 18127 | calculation marks and then sends the table to the translator function, which |
| 17224 | Please note that the translator function sees the table @emph{after} the | 18128 | then skips columns as specified in @samp{skipcols}. |
| 17225 | removal of these columns, the function never knows that there have been | ||
| 17226 | additional columns. | ||
| 17227 | |||
| 17228 | @item :no-escape t | ||
| 17229 | When non-@code{nil}, do not escape special characters @code{&%#_^} when exporting | ||
| 17230 | the table. The default value is @code{nil}. | ||
| 17231 | @end table | 18129 | @end table |
| 17232 | 18130 | ||
| 17233 | @noindent | 18131 | @noindent |
| 17234 | The one problem remaining is how to keep the source table in the buffer | 18132 | To keep the source table intact in the buffer without being disturbed when |
| 17235 | without disturbing the normal workings of the file, for example during | 18133 | the source file is compiled or otherwise being worked on, use one of these |
| 17236 | compilation of a C file or processing of a @LaTeX{} file. There are a | 18134 | strategies: |
| 17237 | number of different solutions: | ||
| 17238 | 18135 | ||
| 17239 | @itemize @bullet | 18136 | @itemize @bullet |
| 17240 | @item | 18137 | @item |
| 17241 | The table could be placed in a block comment if that is supported by the | 18138 | Place the table in a block comment. For example, in C mode you could wrap |
| 17242 | language. For example, in C mode you could wrap the table between | 18139 | the table between @samp{/*} and @samp{*/} lines. |
| 17243 | @samp{/*} and @samp{*/} lines. | ||
| 17244 | @item | 18140 | @item |
| 17245 | Sometimes it is possible to put the table after some kind of @i{END} | 18141 | Put the table after an @samp{END} statement. For example @samp{\bye} in |
| 17246 | statement, for example @samp{\bye} in @TeX{} and @samp{\end@{document@}} | 18142 | @TeX{} and @samp{\end@{document@}} in @LaTeX{}. |
| 17247 | in @LaTeX{}. | ||
| 17248 | @item | 18143 | @item |
| 17249 | You can just comment the table line-by-line whenever you want to process | 18144 | Comment and uncomment each line of the table during edits. The @kbd{M-x |
| 17250 | the file, and uncomment it whenever you need to edit the table. This | 18145 | orgtbl-toggle-comment RET} command makes toggling easy. |
| 17251 | only sounds tedious---the command @kbd{M-x orgtbl-toggle-comment RET} | ||
| 17252 | makes this comment-toggling very easy, in particular if you bind it to a | ||
| 17253 | key. | ||
| 17254 | @end itemize | 18146 | @end itemize |
| 17255 | 18147 | ||
| 17256 | @node A @LaTeX{} example, Translator functions, Radio tables, Tables in arbitrary syntax | 18148 | @node A @LaTeX{} example |
| 17257 | @subsection A @LaTeX{} example of radio tables | 18149 | @subsection A @LaTeX{} example of radio tables |
| 17258 | @cindex @LaTeX{}, and Orgtbl mode | 18150 | @cindex @LaTeX{}, and Orgtbl mode |
| 17259 | 18151 | ||
| 17260 | The best way to wrap the source table in @LaTeX{} is to use the | 18152 | To wrap a source table in @LaTeX{}, use the @code{comment} environment |
| 17261 | @code{comment} environment provided by @file{comment.sty}. It has to be | 18153 | provided by @file{comment.sty}. To activate it, put |
| 17262 | activated by placing @code{\usepackage@{comment@}} into the document | 18154 | @code{\usepackage@{comment@}} in the document header. Orgtbl mode inserts a |
| 17263 | header. Orgtbl mode can insert a radio table skeleton@footnote{By | 18155 | radio table skeleton@footnote{By default this works only for @LaTeX{}, HTML, |
| 17264 | default this works only for @LaTeX{}, HTML, and Texinfo. Configure the | 18156 | and Texinfo. Configure the variable @code{orgtbl-radio-table-templates} to |
| 17265 | variable @code{orgtbl-radio-table-templates} to install templates for other | 18157 | install templates for other export formats.} with the command @kbd{M-x |
| 17266 | modes.} with the command @kbd{M-x orgtbl-insert-radio-table RET}. You will | 18158 | orgtbl-insert-radio-table RET}, which prompts for a table name. For example, |
| 17267 | be prompted for a table name, let's say we use @samp{salesfigures}. You | 18159 | if @samp{salesfigures} is the name, the template inserts: |
| 17268 | will then get the following template: | ||
| 17269 | 18160 | ||
| 17270 | @cindex #+ORGTBL, SEND | 18161 | @cindex #+ORGTBL, SEND |
| 17271 | @example | 18162 | @example |
| @@ -17279,17 +18170,17 @@ will then get the following template: | |||
| 17279 | 18170 | ||
| 17280 | @noindent | 18171 | @noindent |
| 17281 | @vindex @LaTeX{}-verbatim-environments | 18172 | @vindex @LaTeX{}-verbatim-environments |
| 17282 | The @code{#+ORGTBL: SEND} line tells Orgtbl mode to use the function | 18173 | The line @code{#+ORGTBL: SEND} tells Orgtbl mode to use the function |
| 17283 | @code{orgtbl-to-latex} to convert the table into @LaTeX{} and to put it | 18174 | @code{orgtbl-to-latex} to convert the table to @LaTeX{} format, then insert |
| 17284 | into the receiver location with name @code{salesfigures}. You may now | 18175 | the table at the target (receive) location named @code{salesfigures}. Now |
| 17285 | fill in the table---feel free to use the spreadsheet features@footnote{If | 18176 | the table is ready for data entry. It can even use spreadsheet |
| 17286 | the @samp{#+TBLFM} line contains an odd number of dollar characters, | 18177 | features@footnote{If the @samp{#+TBLFM} line contains an odd number of dollar |
| 17287 | this may cause problems with font-lock in @LaTeX{} mode. As shown in the | 18178 | characters, this may cause problems with font-lock in @LaTeX{} mode. As |
| 17288 | example you can fix this by adding an extra line inside the | 18179 | shown in the example you can fix this by adding an extra line inside the |
| 17289 | @code{comment} environment that is used to balance the dollar | 18180 | @code{comment} environment that is used to balance the dollar expressions. |
| 17290 | expressions. If you are using AUC@TeX{} with the font-latex library, a | 18181 | If you are using AUC@TeX{} with the font-latex library, a much better |
| 17291 | much better solution is to add the @code{comment} environment to the | 18182 | solution is to add the @code{comment} environment to the variable |
| 17292 | variable @code{LaTeX-verbatim-environments}.}: | 18183 | @code{LaTeX-verbatim-environments}.}: |
| 17293 | 18184 | ||
| 17294 | @example | 18185 | @example |
| 17295 | % BEGIN RECEIVE ORGTBL salesfigures | 18186 | % BEGIN RECEIVE ORGTBL salesfigures |
| @@ -17307,14 +18198,12 @@ variable @code{LaTeX-verbatim-environments}.}: | |||
| 17307 | @end example | 18198 | @end example |
| 17308 | 18199 | ||
| 17309 | @noindent | 18200 | @noindent |
| 17310 | When you are done, press @kbd{C-c C-c} in the table to get the converted | 18201 | After editing, @kbd{C-c C-c} inserts translated table at the target location, |
| 17311 | table inserted between the two marker lines. | 18202 | between the two marker lines. |
| 17312 | 18203 | ||
| 17313 | Now let's assume you want to make the table header by hand, because you | 18204 | For hand-made custom tables, note that the translator needs to skip the first |
| 17314 | want to control how columns are aligned, etc. In this case we make sure | 18205 | two lines of the source table. Also the command has to @emph{splice} out the |
| 17315 | that the table translator skips the first 2 lines of the source | 18206 | target table without the header and footer. |
| 17316 | table, and tell the command to work as a @i{splice}, i.e., to not produce | ||
| 17317 | header and footer commands of the target table: | ||
| 17318 | 18207 | ||
| 17319 | @example | 18208 | @example |
| 17320 | \begin@{tabular@}@{lrrr@} | 18209 | \begin@{tabular@}@{lrrr@} |
| @@ -17335,135 +18224,109 @@ Month & \multicolumn@{1@}@{c@}@{Days@} & Nr.\ sold & per day\\ | |||
| 17335 | @end example | 18224 | @end example |
| 17336 | 18225 | ||
| 17337 | The @LaTeX{} translator function @code{orgtbl-to-latex} is already part of | 18226 | The @LaTeX{} translator function @code{orgtbl-to-latex} is already part of |
| 17338 | Orgtbl mode. It uses a @code{tabular} environment to typeset the table | 18227 | Orgtbl mode and uses @code{tabular} environment by default to typeset the |
| 17339 | and marks horizontal lines with @code{\hline}. Furthermore, it | 18228 | table and mark the horizontal lines with @code{\hline}. For additional |
| 17340 | interprets the following parameters (see also @pxref{Translator functions}): | 18229 | parameters to control output, @pxref{Translator functions}: |
| 17341 | 18230 | ||
| 17342 | @table @code | 18231 | @table @code |
| 17343 | @item :splice nil/t | 18232 | @item :splice nil/t |
| 17344 | When set to t, return only table body lines, don't wrap them into a | 18233 | When non-@code{nil}, returns only table body lines; not wrapped in tabular |
| 17345 | tabular environment. Default is @code{nil}. | 18234 | environment. Default is @code{nil}. |
| 17346 | 18235 | ||
| 17347 | @item :fmt fmt | 18236 | @item :fmt fmt |
| 17348 | A format to be used to wrap each field, it should contain @code{%s} for the | 18237 | Format to warp each field. It should contain @code{%s} for the original |
| 17349 | original field value. For example, to wrap each field value in dollars, | 18238 | field value. For example, to wrap each field value in dollar symbol, you |
| 17350 | you could use @code{:fmt "$%s$"}. This may also be a property list with | 18239 | could use @code{:fmt "$%s$"}. Format can also wrap a property list with |
| 17351 | column numbers and formats, for example @code{:fmt (2 "$%s$" 4 "%s\\%%")}. | 18240 | column numbers and formats, for example @code{:fmt (2 "$%s$" 4 "%s\\%%")}. |
| 17352 | A function of one argument can be used in place of the strings; the | 18241 | In place of a string, a function of one argument can be used; the function |
| 17353 | function must return a formatted string. | 18242 | must return a formatted string. |
| 17354 | 18243 | ||
| 17355 | @item :efmt efmt | 18244 | @item :efmt efmt |
| 17356 | Use this format to print numbers with exponentials. The format should | 18245 | Format numbers as exponentials. The spec should have @code{%s} twice for |
| 17357 | have @code{%s} twice for inserting mantissa and exponent, for example | 18246 | inserting mantissa and exponent, for example @code{"%s\\times10^@{%s@}"}. |
| 17358 | @code{"%s\\times10^@{%s@}"}. The default is @code{"%s\\,(%s)"}. This | 18247 | This may also be a property list with column numbers and formats, for example |
| 17359 | may also be a property list with column numbers and formats, for example | ||
| 17360 | @code{:efmt (2 "$%s\\times10^@{%s@}$" 4 "$%s\\cdot10^@{%s@}$")}. After | 18248 | @code{:efmt (2 "$%s\\times10^@{%s@}$" 4 "$%s\\cdot10^@{%s@}$")}. After |
| 17361 | @code{efmt} has been applied to a value, @code{fmt} will also be | 18249 | @code{efmt} has been applied to a value, @code{fmt} will also be applied. |
| 17362 | applied. Similar to @code{fmt}, functions of two arguments can be | 18250 | Functions with two arguments can be supplied instead of strings. By default, |
| 17363 | supplied instead of strings. | 18251 | no special formatting is applied. |
| 17364 | @end table | 18252 | @end table |
| 17365 | 18253 | ||
| 17366 | @node Translator functions, Radio lists, A @LaTeX{} example, Tables in arbitrary syntax | 18254 | @node Translator functions |
| 17367 | @subsection Translator functions | 18255 | @subsection Translator functions |
| 17368 | @cindex HTML, and Orgtbl mode | 18256 | @cindex HTML, and Orgtbl mode |
| 17369 | @cindex translator function | 18257 | @cindex translator function |
| 17370 | 18258 | ||
| 17371 | Orgtbl mode has several translator functions built-in: @code{orgtbl-to-csv} | 18259 | Orgtbl mode has built-in translator functions: @code{orgtbl-to-csv} |
| 17372 | (comma-separated values), @code{orgtbl-to-tsv} (TAB-separated values) | 18260 | (comma-separated values), @code{orgtbl-to-tsv} (TAB-separated values), |
| 17373 | @code{orgtbl-to-latex}, @code{orgtbl-to-html}, and @code{orgtbl-to-texinfo}. | 18261 | @code{orgtbl-to-latex}, @code{orgtbl-to-html}, @code{orgtbl-to-texinfo}, |
| 17374 | Except for @code{orgtbl-to-html}@footnote{The HTML translator uses the same | 18262 | @code{orgtbl-to-unicode} and @code{orgtbl-to-orgtbl}. They use the generic |
| 17375 | code that produces tables during HTML export.}, these all use a generic | 18263 | translator, @code{orgtbl-to-generic}, which delegates translations to various |
| 17376 | translator, @code{orgtbl-to-generic}. For example, @code{orgtbl-to-latex} | 18264 | export back-ends. |
| 17377 | itself is a very short function that computes the column definitions for the | ||
| 17378 | @code{tabular} environment, defines a few field and line separators and then | ||
| 17379 | hands processing over to the generic translator. Here is the entire code: | ||
| 17380 | 18265 | ||
| 17381 | @lisp | 18266 | Properties passed to the function through the @samp{ORGTBL SEND} line take |
| 17382 | @group | 18267 | precedence over properties defined inside the function. For example, this |
| 17383 | (defun orgtbl-to-latex (table params) | 18268 | overrides the default @LaTeX{} line endings, @samp{\\}, with @samp{\\[2mm]}: |
| 17384 | "Convert the Orgtbl mode TABLE to LaTeX." | ||
| 17385 | (let* ((alignment (mapconcat (lambda (x) (if x "r" "l")) | ||
| 17386 | org-table-last-alignment "")) | ||
| 17387 | (params2 | ||
| 17388 | (list | ||
| 17389 | :tstart (concat "\\begin@{tabular@}@{" alignment "@}") | ||
| 17390 | :tend "\\end@{tabular@}" | ||
| 17391 | :lstart "" :lend " \\\\" :sep " & " | ||
| 17392 | :efmt "%s\\,(%s)" :hline "\\hline"))) | ||
| 17393 | (orgtbl-to-generic table (org-combine-plists params2 params)))) | ||
| 17394 | @end group | ||
| 17395 | @end lisp | ||
| 17396 | |||
| 17397 | As you can see, the properties passed into the function (variable | ||
| 17398 | @var{PARAMS}) are combined with the ones newly defined in the function | ||
| 17399 | (variable @var{PARAMS2}). The ones passed into the function (i.e., the | ||
| 17400 | ones set by the @samp{ORGTBL SEND} line) take precedence. So if you | ||
| 17401 | would like to use the @LaTeX{} translator, but wanted the line endings to | ||
| 17402 | be @samp{\\[2mm]} instead of the default @samp{\\}, you could just | ||
| 17403 | overrule the default with | ||
| 17404 | 18269 | ||
| 17405 | @example | 18270 | @example |
| 17406 | #+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]" | 18271 | #+ORGTBL: SEND test orgtbl-to-latex :lend " \\\\[2mm]" |
| 17407 | @end example | 18272 | @end example |
| 17408 | 18273 | ||
| 17409 | For a new language, you can either write your own converter function in | 18274 | For a new language translator, define a converter function. It can be a |
| 17410 | analogy with the @LaTeX{} translator, or you can use the generic function | 18275 | generic function, such as shown in this example. It marks a beginning and |
| 17411 | directly. For example, if you have a language where a table is started | 18276 | ending of a table with @samp{!BTBL!} and @samp{!ETBL!}; a beginning and |
| 17412 | with @samp{!BTBL!}, ended with @samp{!ETBL!}, and where table lines are | 18277 | ending of lines with @samp{!BL!} and @samp{!EL!}; and uses a TAB for a field |
| 17413 | started with @samp{!BL!}, ended with @samp{!EL!}, and where the field | 18278 | separator: |
| 17414 | separator is a TAB, you could call the generic translator like this (on | ||
| 17415 | a single line!): | ||
| 17416 | 18279 | ||
| 17417 | @example | 18280 | @lisp |
| 17418 | #+ORGTBL: SEND test orgtbl-to-generic :tstart "!BTBL!" :tend "!ETBL!" | 18281 | (defun orgtbl-to-language (table params) |
| 17419 | :lstart "!BL! " :lend " !EL!" :sep "\t" | 18282 | "Convert the orgtbl-mode TABLE to language." |
| 17420 | @end example | 18283 | (orgtbl-to-generic |
| 18284 | table | ||
| 18285 | (org-combine-plists | ||
| 18286 | '(:tstart "!BTBL!" :tend "!ETBL!" :lstart "!BL!" :lend "!EL!" :sep "\t") | ||
| 18287 | params))) | ||
| 18288 | @end lisp | ||
| 17421 | 18289 | ||
| 17422 | @noindent | 18290 | @noindent |
| 17423 | Please check the documentation string of the function | 18291 | The documentation for the @code{orgtbl-to-generic} function shows a complete |
| 17424 | @code{orgtbl-to-generic} for a full list of parameters understood by | 18292 | list of parameters, each of which can be passed through to |
| 17425 | that function, and remember that you can pass each of them into | ||
| 17426 | @code{orgtbl-to-latex}, @code{orgtbl-to-texinfo}, and any other function | 18293 | @code{orgtbl-to-latex}, @code{orgtbl-to-texinfo}, and any other function |
| 17427 | using the generic function. | 18294 | using that generic function. |
| 17428 | 18295 | ||
| 17429 | Of course you can also write a completely new function doing complicated | 18296 | For complicated translations the generic translator function could be |
| 17430 | things the generic translator cannot do. A translator function takes | 18297 | replaced by a custom translator function. Such a custom function must take |
| 17431 | two arguments. The first argument is the table, a list of lines, each | 18298 | two arguments and return a single string containing the formatted table. The |
| 17432 | line either the symbol @code{hline} or a list of fields. The second | 18299 | first argument is the table whose lines are a list of fields or the symbol |
| 17433 | argument is the property list containing all parameters specified in the | 18300 | @code{hline}. The second argument is the property list consisting of |
| 17434 | @samp{#+ORGTBL: SEND} line. The function must return a single string | 18301 | parameters specified in the @samp{#+ORGTBL: SEND} line. Please share your |
| 17435 | containing the formatted table. If you write a generally useful | 18302 | translator functions by posting them to the Org users mailing list, |
| 17436 | translator, please post it on @email{emacs-orgmode@@gnu.org} so that | 18303 | @email{emacs-orgmode@@gnu.org}. |
| 17437 | others can benefit from your work. | 18304 | |
| 17438 | 18305 | @node Radio lists | |
| 17439 | @node Radio lists, , Translator functions, Tables in arbitrary syntax | ||
| 17440 | @subsection Radio lists | 18306 | @subsection Radio lists |
| 17441 | @cindex radio lists | 18307 | @cindex radio lists |
| 17442 | @cindex org-list-insert-radio-list | 18308 | @cindex org-list-insert-radio-list |
| 17443 | 18309 | ||
| 17444 | Sending and receiving radio lists works exactly the same way as sending and | 18310 | Call the @code{org-list-insert-radio-list} function to insert a radio list |
| 17445 | receiving radio tables (@pxref{Radio tables}). As for radio tables, you can | 18311 | template in HTML, @LaTeX{}, and Texinfo mode documents. Sending and |
| 17446 | insert radio list templates in HTML, @LaTeX{} and Texinfo modes by calling | 18312 | receiving radio lists works is the same as for radio tables (@pxref{Radio |
| 17447 | @code{org-list-insert-radio-list}. | 18313 | tables}) except for these differences: |
| 17448 | |||
| 17449 | Here are the differences with radio tables: | ||
| 17450 | 18314 | ||
| 18315 | @cindex #+ORGLST | ||
| 17451 | @itemize @minus | 18316 | @itemize @minus |
| 17452 | @item | 18317 | @item |
| 17453 | Orgstruct mode must be active. | 18318 | Orgstruct mode must be active. |
| 17454 | @item | 18319 | @item |
| 17455 | Use the @code{ORGLST} keyword instead of @code{ORGTBL}. | 18320 | Use @code{ORGLST} keyword instead of @code{ORGTBL}. |
| 17456 | @item | 18321 | @item |
| 17457 | The available translation functions for radio lists don't take | 18322 | @kbd{C-c C-c} works only on the first list item. |
| 17458 | parameters. | ||
| 17459 | @item | ||
| 17460 | @kbd{C-c C-c} will work when pressed on the first item of the list. | ||
| 17461 | @end itemize | 18323 | @end itemize |
| 17462 | 18324 | ||
| 17463 | Here is a @LaTeX{} example. Let's say that you have this in your | 18325 | Built-in translators functions are: @code{org-list-to-latex}, |
| 17464 | @LaTeX{} file: | 18326 | @code{org-list-to-html} and @code{org-list-to-texinfo}. They use the |
| 18327 | @code{org-list-to-generic} translator function. See its documentation for | ||
| 18328 | parameters for accurate customizations of lists. Here is a @LaTeX{} example: | ||
| 17465 | 18329 | ||
| 17466 | @cindex #+ORGLST | ||
| 17467 | @example | 18330 | @example |
| 17468 | % BEGIN RECEIVE ORGLST to-buy | 18331 | % BEGIN RECEIVE ORGLST to-buy |
| 17469 | % END RECEIVE ORGLST to-buy | 18332 | % END RECEIVE ORGLST to-buy |
| @@ -17477,21 +18340,21 @@ Here is a @LaTeX{} example. Let's say that you have this in your | |||
| 17477 | \end@{comment@} | 18340 | \end@{comment@} |
| 17478 | @end example | 18341 | @end example |
| 17479 | 18342 | ||
| 17480 | Pressing @kbd{C-c C-c} on @code{a new house} and will insert the converted | 18343 | @kbd{C-c C-c} on @samp{a new house} inserts the translated @LaTeX{} list |
| 17481 | @LaTeX{} list between the two marker lines. | 18344 | in-between the BEGIN and END marker lines. |
| 17482 | 18345 | ||
| 17483 | @node Dynamic blocks, Special agenda views, Tables in arbitrary syntax, Hacking | 18346 | @node Dynamic blocks |
| 17484 | @section Dynamic blocks | 18347 | @section Dynamic blocks |
| 17485 | @cindex dynamic blocks | 18348 | @cindex dynamic blocks |
| 17486 | 18349 | ||
| 17487 | Org documents can contain @emph{dynamic blocks}. These are | 18350 | Org supports @emph{dynamic blocks} in Org documents. They are inserted with |
| 17488 | specially marked regions that are updated by some user-written function. | 18351 | begin and end markers like any other @samp{src} code block, but the contents |
| 17489 | A good example for such a block is the clock table inserted by the | 18352 | are updated automatically by a user function. For example, @kbd{C-c C-x C-r} |
| 17490 | command @kbd{C-c C-x C-r} (@pxref{Clocking work time}). | 18353 | inserts a dynamic table that updates the work time (@pxref{Clocking work |
| 18354 | time}). | ||
| 17491 | 18355 | ||
| 17492 | Dynamic blocks are enclosed by a BEGIN-END structure that assigns a name | 18356 | Dynamic blocks can have names and function parameters. The syntax is similar |
| 17493 | to the block and can also specify parameters for the function producing | 18357 | to @samp{src} code block specifications: |
| 17494 | the content of the block. | ||
| 17495 | 18358 | ||
| 17496 | @cindex #+BEGIN:dynamic block | 18359 | @cindex #+BEGIN:dynamic block |
| 17497 | @example | 18360 | @example |
| @@ -17500,7 +18363,7 @@ the content of the block. | |||
| 17500 | #+END: | 18363 | #+END: |
| 17501 | @end example | 18364 | @end example |
| 17502 | 18365 | ||
| 17503 | Dynamic blocks are updated with the following commands | 18366 | These command update dynamic blocks: |
| 17504 | 18367 | ||
| 17505 | @table @kbd | 18368 | @table @kbd |
| 17506 | @orgcmd{C-c C-x C-u,org-dblock-update} | 18369 | @orgcmd{C-c C-x C-u,org-dblock-update} |
| @@ -17509,17 +18372,16 @@ Update dynamic block at point. | |||
| 17509 | Update all dynamic blocks in the current file. | 18372 | Update all dynamic blocks in the current file. |
| 17510 | @end table | 18373 | @end table |
| 17511 | 18374 | ||
| 17512 | Updating a dynamic block means to remove all the text between BEGIN and | 18375 | Before updating a dynamic block, Org removes content between the BEGIN and |
| 17513 | END, parse the BEGIN line for parameters and then call the specific | 18376 | END markers. Org then reads the parameters on the BEGIN line for passing to |
| 17514 | writer function for this block to insert the new content. If you want | 18377 | the writer function. If the function expects to access the removed content, |
| 17515 | to use the original content in the writer function, you can use the | 18378 | then Org expects an extra parameter, @code{:content}, on the BEGIN line. |
| 17516 | extra parameter @code{:content}. | ||
| 17517 | 18379 | ||
| 17518 | For a block with name @code{myblock}, the writer function is | 18380 | To syntax for calling a writer function with a named block, @code{myblock} |
| 17519 | @code{org-dblock-write:myblock} with as only parameter a property list | 18381 | is: @code{org-dblock-write:myblock}. Parameters come from the BEGIN line. |
| 17520 | with the parameters given in the begin line. Here is a trivial example | 18382 | |
| 17521 | of a block that keeps track of when the block update function was last | 18383 | The following is an example of a dynamic block and a block writer function |
| 17522 | run: | 18384 | that updates the time when the function was last run: |
| 17523 | 18385 | ||
| 17524 | @example | 18386 | @example |
| 17525 | #+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M" | 18387 | #+BEGIN: block-update-time :format "on %m/%d/%Y at %H:%M" |
| @@ -17528,7 +18390,7 @@ run: | |||
| 17528 | @end example | 18390 | @end example |
| 17529 | 18391 | ||
| 17530 | @noindent | 18392 | @noindent |
| 17531 | The corresponding block writer function could look like this: | 18393 | The dynamic block's writer function: |
| 17532 | 18394 | ||
| 17533 | @lisp | 18395 | @lisp |
| 17534 | (defun org-dblock-write:block-update-time (params) | 18396 | (defun org-dblock-write:block-update-time (params) |
| @@ -17537,47 +18399,40 @@ The corresponding block writer function could look like this: | |||
| 17537 | (format-time-string fmt)))) | 18399 | (format-time-string fmt)))) |
| 17538 | @end lisp | 18400 | @end lisp |
| 17539 | 18401 | ||
| 17540 | If you want to make sure that all dynamic blocks are always up-to-date, | 18402 | To keep dynamic blocks up-to-date in an Org file, use the function, |
| 17541 | you could add the function @code{org-update-all-dblocks} to a hook, for | 18403 | @code{org-update-all-dblocks} in hook, such as @code{before-save-hook}. The |
| 17542 | example @code{before-save-hook}. @code{org-update-all-dblocks} is | 18404 | @code{org-update-all-dblocks} function does not run if the file is not in |
| 17543 | written in a way such that it does nothing in buffers that are not in | 18405 | Org mode. |
| 17544 | @code{org-mode}. | ||
| 17545 | 18406 | ||
| 17546 | You can narrow the current buffer to the current dynamic block (like any | 18407 | Dynamic blocks, like any other block, can be narrowed with |
| 17547 | other block) with @code{org-narrow-to-block}. | 18408 | @code{org-narrow-to-block}. |
| 17548 | 18409 | ||
| 17549 | @node Special agenda views, Speeding up your agendas, Dynamic blocks, Hacking | 18410 | @node Special agenda views |
| 17550 | @section Special agenda views | 18411 | @section Special agenda views |
| 17551 | @cindex agenda views, user-defined | 18412 | @cindex agenda views, user-defined |
| 17552 | 18413 | ||
| 17553 | @vindex org-agenda-skip-function | 18414 | @vindex org-agenda-skip-function |
| 17554 | @vindex org-agenda-skip-function-global | 18415 | @vindex org-agenda-skip-function-global |
| 17555 | Org provides a special hook that can be used to narrow down the selection | 18416 | Org provides a special hook to further limit items in agenda views: |
| 17556 | made by these agenda views: @code{agenda}, @code{agenda*}@footnote{The | 18417 | @code{agenda}, @code{agenda*}@footnote{The @code{agenda*} view is the same as |
| 17557 | @code{agenda*} view is the same than @code{agenda} except that it only | 18418 | @code{agenda} except that it only considers @emph{appointments}, i.e., |
| 17558 | considers @emph{appointments}, i.e., scheduled and deadline items that have a | 18419 | scheduled and deadline items that have a time specification @samp{[h]h:mm} in |
| 17559 | time specification @code{[h]h:mm} in their time-stamps.}, @code{todo}, | 18420 | their time-stamps.}, @code{todo}, @code{alltodo}, @code{tags}, |
| 17560 | @code{alltodo}, @code{tags}, @code{tags-todo}, @code{tags-tree}. You may | 18421 | @code{tags-todo}, @code{tags-tree}. Specify a custom function that tests |
| 17561 | specify a function that is used at each match to verify if the match should | 18422 | inclusion of every matched item in the view. This function can also |
| 17562 | indeed be part of the agenda view, and if not, how much should be skipped. | 18423 | skip as much as is needed. |
| 17563 | You can specify a global condition that will be applied to all agenda views, | 18424 | |
| 17564 | this condition would be stored in the variable | 18425 | For a global condition applicable to agenda views, use the |
| 17565 | @code{org-agenda-skip-function-global}. More commonly, such a definition is | 18426 | @code{org-agenda-skip-function-global} variable. Org uses a global condition |
| 17566 | applied only to specific custom searches, using | 18427 | with @code{org-agenda-skip-function} for custom searching. |
| 17567 | @code{org-agenda-skip-function}. | 18428 | |
| 17568 | 18429 | This example defines a function for a custom view showing TODO items with | |
| 17569 | Let's say you want to produce a list of projects that contain a WAITING | 18430 | WAITING status. Manually this is a multi step search process, but with a |
| 17570 | tag anywhere in the project tree. Let's further assume that you have | 18431 | custom view, this can be automated as follows: |
| 17571 | marked all tree headings that define a project with the TODO keyword | 18432 | |
| 17572 | PROJECT@. In this case you would run a TODO search for the keyword | 18433 | The custom function searches the subtree for the WAITING tag and returns |
| 17573 | PROJECT, but skip the match unless there is a WAITING tag anywhere in | 18434 | @code{nil} on match. Otherwise it gives the location from where the search |
| 17574 | the subtree belonging to the project line. | 18435 | continues. |
| 17575 | |||
| 17576 | To achieve this, you must write a function that searches the subtree for | ||
| 17577 | the tag. If the tag is found, the function must return @code{nil} to | ||
| 17578 | indicate that this match should not be skipped. If there is no such | ||
| 17579 | tag, return the location of the end of the subtree, to indicate that | ||
| 17580 | search should continue from there. | ||
| 17581 | 18436 | ||
| 17582 | @lisp | 18437 | @lisp |
| 17583 | (defun my-skip-unless-waiting () | 18438 | (defun my-skip-unless-waiting () |
| @@ -17588,8 +18443,7 @@ search should continue from there. | |||
| 17588 | subtree-end))) ; tag not found, continue after end of subtree | 18443 | subtree-end))) ; tag not found, continue after end of subtree |
| 17589 | @end lisp | 18444 | @end lisp |
| 17590 | 18445 | ||
| 17591 | Now you may use this function in an agenda custom command, for example | 18446 | To use this custom function in a custom agenda command: |
| 17592 | like this: | ||
| 17593 | 18447 | ||
| 17594 | @lisp | 18448 | @lisp |
| 17595 | (org-add-agenda-custom-command | 18449 | (org-add-agenda-custom-command |
| @@ -17599,22 +18453,20 @@ like this: | |||
| 17599 | @end lisp | 18453 | @end lisp |
| 17600 | 18454 | ||
| 17601 | @vindex org-agenda-overriding-header | 18455 | @vindex org-agenda-overriding-header |
| 17602 | Note that this also binds @code{org-agenda-overriding-header} to get a | 18456 | Note that this also binds @code{org-agenda-overriding-header} to a more |
| 17603 | meaningful header in the agenda view. | 18457 | meaningful string suitable for the agenda view. |
| 17604 | 18458 | ||
| 17605 | @vindex org-odd-levels-only | 18459 | @vindex org-odd-levels-only |
| 17606 | @vindex org-agenda-skip-function | 18460 | @vindex org-agenda-skip-function |
| 17607 | A general way to create custom searches is to base them on a search for | 18461 | |
| 17608 | entries with a certain level limit. If you want to study all entries with | 18462 | Search for entries with a limit set on levels for the custom search. This is |
| 17609 | your custom search function, simply do a search for | 18463 | a general appraoch to creating custom searches in Org. To include all |
| 17610 | @samp{LEVEL>0}@footnote{Note that, when using @code{org-odd-levels-only}, a | 18464 | levels, use @samp{LEVEL>0}@footnote{Note that, for |
| 17611 | level number corresponds to order in the hierarchy, not to the number of | 18465 | @code{org-odd-levels-only}, a level number corresponds to order in the |
| 17612 | stars.}, and then use @code{org-agenda-skip-function} to select the entries | 18466 | hierarchy, not to the number of stars.}. Then to selectively pick the |
| 17613 | you really want to have. | 18467 | matched entries, use @code{org-agenda-skip-function}, which also accepts Lisp |
| 17614 | 18468 | forms, such as @code{org-agenda-skip-entry-if} and | |
| 17615 | You may also put a Lisp form into @code{org-agenda-skip-function}. In | 18469 | @code{org-agenda-skip-subtree-if}. For example: |
| 17616 | particular, you may use the functions @code{org-agenda-skip-entry-if} | ||
| 17617 | and @code{org-agenda-skip-subtree-if} in this form, for example: | ||
| 17618 | 18470 | ||
| 17619 | @table @code | 18471 | @table @code |
| 17620 | @item (org-agenda-skip-entry-if 'scheduled) | 18472 | @item (org-agenda-skip-entry-if 'scheduled) |
| @@ -17640,8 +18492,8 @@ Skip current entry unless the regular expression matches. | |||
| 17640 | Same as above, but check and skip the entire subtree. | 18492 | Same as above, but check and skip the entire subtree. |
| 17641 | @end table | 18493 | @end table |
| 17642 | 18494 | ||
| 17643 | Therefore we could also have written the search for WAITING projects | 18495 | The following is an example of a search for @samp{WAITING} without the |
| 17644 | like this, even without defining a special function: | 18496 | special function: |
| 17645 | 18497 | ||
| 17646 | @lisp | 18498 | @lisp |
| 17647 | (org-add-agenda-custom-command | 18499 | (org-add-agenda-custom-command |
| @@ -17651,72 +18503,71 @@ like this, even without defining a special function: | |||
| 17651 | (org-agenda-overriding-header "Projects waiting for something: ")))) | 18503 | (org-agenda-overriding-header "Projects waiting for something: ")))) |
| 17652 | @end lisp | 18504 | @end lisp |
| 17653 | 18505 | ||
| 17654 | @node Speeding up your agendas, Extracting agenda information, Special agenda views, Hacking | 18506 | @node Speeding up your agendas |
| 17655 | @section Speeding up your agendas | 18507 | @section Speeding up your agendas |
| 17656 | @cindex agenda views, optimization | 18508 | @cindex agenda views, optimization |
| 17657 | 18509 | ||
| 17658 | When your Org files grow in both number and size, agenda commands may start | 18510 | Some agenda commands slow down when the Org files grow in size or number. |
| 17659 | to become slow. Below are some tips on how to speed up the agenda commands. | 18511 | Here are tips to speed up: |
| 17660 | 18512 | ||
| 17661 | @enumerate | 18513 | @enumerate |
| 17662 | @item | 18514 | @item |
| 17663 | Reduce the number of Org agenda files: this will reduce the slowness caused | 18515 | Reduce the number of Org agenda files to avoid slowdowns due to hard drive |
| 17664 | by accessing a hard drive. | 18516 | accesses. |
| 17665 | @item | 18517 | @item |
| 17666 | Reduce the number of DONE and archived headlines: this way the agenda does | 18518 | Reduce the number of @samp{DONE} and archived headlines so agenda operations |
| 17667 | not need to skip them. | 18519 | that skip over these can finish faster. |
| 17668 | @item | 18520 | @item |
| 17669 | @vindex org-agenda-dim-blocked-tasks | 18521 | @vindex org-agenda-dim-blocked-tasks |
| 17670 | Inhibit the dimming of blocked tasks: | 18522 | Do not dim blocked tasks: |
| 17671 | @lisp | 18523 | @lisp |
| 17672 | (setq org-agenda-dim-blocked-tasks nil) | 18524 | (setq org-agenda-dim-blocked-tasks nil) |
| 17673 | @end lisp | 18525 | @end lisp |
| 17674 | @item | 18526 | @item |
| 17675 | @vindex org-startup-folded | 18527 | @vindex org-startup-folded |
| 17676 | @vindex org-agenda-inhibit-startup | 18528 | @vindex org-agenda-inhibit-startup |
| 17677 | Inhibit agenda files startup options: | 18529 | Stop preparing agenda buffers on startup: |
| 17678 | @lisp | 18530 | @lisp |
| 17679 | (setq org-agenda-inhibit-startup nil) | 18531 | (setq org-agenda-inhibit-startup nil) |
| 17680 | @end lisp | 18532 | @end lisp |
| 17681 | @item | 18533 | @item |
| 17682 | @vindex org-agenda-show-inherited-tags | 18534 | @vindex org-agenda-show-inherited-tags |
| 17683 | @vindex org-agenda-use-tag-inheritance | 18535 | @vindex org-agenda-use-tag-inheritance |
| 17684 | Disable tag inheritance in agenda: | 18536 | Disable tag inheritance for agendas: |
| 17685 | @lisp | 18537 | @lisp |
| 17686 | (setq org-agenda-use-tag-inheritance nil) | 18538 | (setq org-agenda-use-tag-inheritance nil) |
| 17687 | @end lisp | 18539 | @end lisp |
| 17688 | @end enumerate | 18540 | @end enumerate |
| 17689 | 18541 | ||
| 17690 | You can set these options for specific agenda views only. See the docstrings | 18542 | These options can be applied to selected agenda views. For more details |
| 17691 | of these variables for details on why they affect the agenda generation, and | 18543 | about generation of agenda views, see the docstrings for the relevant |
| 17692 | this @uref{http://orgmode.org/worg/agenda-optimization.html, dedicated Worg | 18544 | variables, and this @uref{http://orgmode.org/worg/agenda-optimization.html, |
| 17693 | page} for further explanations. | 18545 | dedicated Worg page} for agenda optimization. |
| 17694 | 18546 | ||
| 17695 | @node Extracting agenda information, Using the property API, Speeding up your agendas, Hacking | 18547 | @node Extracting agenda information |
| 17696 | @section Extracting agenda information | 18548 | @section Extracting agenda information |
| 17697 | @cindex agenda, pipe | 18549 | @cindex agenda, pipe |
| 17698 | @cindex Scripts, for agenda processing | 18550 | @cindex Scripts, for agenda processing |
| 17699 | 18551 | ||
| 17700 | @vindex org-agenda-custom-commands | 18552 | @vindex org-agenda-custom-commands |
| 17701 | Org provides commands to access agenda information for the command | 18553 | Org provides commands to access agendas through Emacs batch mode. Through |
| 17702 | line in Emacs batch mode. This extracted information can be sent | 18554 | this command-line interface, agendas are automated for further processing or |
| 17703 | directly to a printer, or it can be read by a program that does further | 18555 | printing. |
| 17704 | processing of the data. The first of these commands is the function | 18556 | |
| 17705 | @code{org-batch-agenda}, that produces an agenda view and sends it as | 18557 | @code{org-batch-agenda} creates an agenda view in ASCII and outputs to |
| 17706 | ASCII text to STDOUT@. The command takes a single string as parameter. | 18558 | STDOUT. This command takes one string parameter. When string length=1, Org |
| 17707 | If the string has length 1, it is used as a key to one of the commands | 18559 | uses it as a key to @code{org-agenda-custom-commands}. These are the same |
| 17708 | you have configured in @code{org-agenda-custom-commands}, basically any | 18560 | ones available through @kbd{C-c a}. |
| 17709 | key you can use after @kbd{C-c a}. For example, to directly print the | 18561 | |
| 17710 | current TODO list, you could use | 18562 | This example command line directly prints the TODO list to the printer: |
| 17711 | 18563 | ||
| 17712 | @example | 18564 | @example |
| 17713 | emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr | 18565 | emacs -batch -l ~/.emacs -eval '(org-batch-agenda "t")' | lpr |
| 17714 | @end example | 18566 | @end example |
| 17715 | 18567 | ||
| 17716 | If the parameter is a string with 2 or more characters, it is used as a | 18568 | When the string parameter length is two or more characters, Org matches it |
| 17717 | tags/TODO match string. For example, to print your local shopping list | 18569 | with tags/TODO strings. For example, this example command line prints items |
| 17718 | (all items with the tag @samp{shop}, but excluding the tag | 18570 | tagged with @samp{shop}, but excludes items tagged with @samp{NewYork}: |
| 17719 | @samp{NewYork}), you could use | ||
| 17720 | 18571 | ||
| 17721 | @example | 18572 | @example |
| 17722 | emacs -batch -l ~/.emacs \ | 18573 | emacs -batch -l ~/.emacs \ |
| @@ -17724,7 +18575,7 @@ emacs -batch -l ~/.emacs \ | |||
| 17724 | @end example | 18575 | @end example |
| 17725 | 18576 | ||
| 17726 | @noindent | 18577 | @noindent |
| 17727 | You may also modify parameters on the fly like this: | 18578 | An example showing on-the-fly parameter modifications: |
| 17728 | 18579 | ||
| 17729 | @example | 18580 | @example |
| 17730 | emacs -batch -l ~/.emacs \ | 18581 | emacs -batch -l ~/.emacs \ |
| @@ -17736,14 +18587,11 @@ emacs -batch -l ~/.emacs \ | |||
| 17736 | @end example | 18587 | @end example |
| 17737 | 18588 | ||
| 17738 | @noindent | 18589 | @noindent |
| 17739 | which will produce a 30-day agenda, fully restricted to the Org file | 18590 | which will produce an agenda for the next 30 days from just the |
| 17740 | @file{~/org/projects.org}, not even including the diary. | 18591 | @file{~/org/projects.org} file. |
| 17741 | 18592 | ||
| 17742 | If you want to process the agenda data in more sophisticated ways, you | 18593 | For structured processing of agenda output, use @code{org-batch-agenda-csv} |
| 17743 | can use the command @code{org-batch-agenda-csv} to get a comma-separated | 18594 | with the following fields: |
| 17744 | list of values for each agenda item. Each line in the output will | ||
| 17745 | contain a number of fields separated by commas. The fields in a line | ||
| 17746 | are: | ||
| 17747 | 18595 | ||
| 17748 | @example | 18596 | @example |
| 17749 | category @r{The category of the item} | 18597 | category @r{The category of the item} |
| @@ -17769,12 +18617,15 @@ priority-n @r{The computed numerical priority} | |||
| 17769 | @end example | 18617 | @end example |
| 17770 | 18618 | ||
| 17771 | @noindent | 18619 | @noindent |
| 17772 | Time and date will only be given if a timestamp (or deadline/scheduled) | 18620 | If the selection of the agenda item was based on a timestamp, including those |
| 17773 | led to the selection of the item. | 18621 | items with @samp{DEADLINE} and @samp{SCHEDULED} keywords, then Org includes |
| 18622 | date and time in the output. | ||
| 17774 | 18623 | ||
| 17775 | A CSV list like this is very easy to use in a post-processing script. | 18624 | If the selection of the agenda item was based on a timestamp (or |
| 17776 | For example, here is a Perl program that gets the TODO list from | 18625 | deadline/scheduled), then Org includes date and time in the output. |
| 17777 | Emacs/Org and prints all the items, preceded by a checkbox: | 18626 | |
| 18627 | Here is an example of a post-processing script in Perl. It takes the CSV | ||
| 18628 | output from Emacs and prints with a checkbox: | ||
| 17778 | 18629 | ||
| 17779 | @example | 18630 | @example |
| 17780 | #!/usr/bin/perl | 18631 | #!/usr/bin/perl |
| @@ -17795,13 +18646,12 @@ foreach $line (split(/\n/,$agenda)) @{ | |||
| 17795 | @} | 18646 | @} |
| 17796 | @end example | 18647 | @end example |
| 17797 | 18648 | ||
| 17798 | @node Using the property API, Using the mapping API, Extracting agenda information, Hacking | 18649 | @node Using the property API |
| 17799 | @section Using the property API | 18650 | @section Using the property API |
| 17800 | @cindex API, for properties | 18651 | @cindex API, for properties |
| 17801 | @cindex properties, API | 18652 | @cindex properties, API |
| 17802 | 18653 | ||
| 17803 | Here is a description of the functions that can be used to work with | 18654 | Functions for working with properties. |
| 17804 | properties. | ||
| 17805 | 18655 | ||
| 17806 | @defun org-entry-properties &optional pom which | 18656 | @defun org-entry-properties &optional pom which |
| 17807 | Get all properties of the entry at point-or-marker POM.@* | 18657 | Get all properties of the entry at point-or-marker POM.@* |
| @@ -17813,14 +18663,15 @@ POM may also be @code{nil}, in which case the current entry is used. | |||
| 17813 | If WHICH is @code{nil} or @code{all}, get all properties. If WHICH is | 18663 | If WHICH is @code{nil} or @code{all}, get all properties. If WHICH is |
| 17814 | @code{special} or @code{standard}, only get that subclass. | 18664 | @code{special} or @code{standard}, only get that subclass. |
| 17815 | @end defun | 18665 | @end defun |
| 18666 | |||
| 17816 | @vindex org-use-property-inheritance | 18667 | @vindex org-use-property-inheritance |
| 17817 | @findex org-insert-property-drawer | 18668 | @findex org-insert-property-drawer |
| 17818 | @defun org-entry-get pom property &optional inherit | 18669 | @defun org-entry-get pom property &optional inherit |
| 17819 | Get value of @code{PROPERTY} for entry at point-or-marker @code{POM}@. By default, | 18670 | Get value of @code{PROPERTY} for entry at point-or-marker @code{POM}@. By |
| 17820 | this only looks at properties defined locally in the entry. If @code{INHERIT} | 18671 | default, this only looks at properties defined locally in the entry. If |
| 17821 | is non-@code{nil} and the entry does not have the property, then also check | 18672 | @code{INHERIT} is non-@code{nil} and the entry does not have the property, |
| 17822 | higher levels of the hierarchy. If @code{INHERIT} is the symbol | 18673 | then also check higher levels of the hierarchy. If @code{INHERIT} is the |
| 17823 | @code{selective}, use inheritance if and only if the setting of | 18674 | symbol @code{selective}, use inheritance if and only if the setting of |
| 17824 | @code{org-use-property-inheritance} selects @code{PROPERTY} for inheritance. | 18675 | @code{org-use-property-inheritance} selects @code{PROPERTY} for inheritance. |
| 17825 | @end defun | 18676 | @end defun |
| 17826 | 18677 | ||
| @@ -17837,7 +18688,7 @@ Get all property keys in the current buffer. | |||
| 17837 | @end defun | 18688 | @end defun |
| 17838 | 18689 | ||
| 17839 | @defun org-insert-property-drawer | 18690 | @defun org-insert-property-drawer |
| 17840 | Insert a property drawer for the current entry. Also | 18691 | Insert a property drawer for the current entry. |
| 17841 | @end defun | 18692 | @end defun |
| 17842 | 18693 | ||
| 17843 | @defun org-entry-put-multivalued-property pom property &rest values | 18694 | @defun org-entry-put-multivalued-property pom property &rest values |
| @@ -17875,41 +18726,37 @@ to be entered. The functions must return @code{nil} if they are not | |||
| 17875 | responsible for this property. | 18726 | responsible for this property. |
| 17876 | @end defopt | 18727 | @end defopt |
| 17877 | 18728 | ||
| 17878 | @node Using the mapping API, , Using the property API, Hacking | 18729 | @node Using the mapping API |
| 17879 | @section Using the mapping API | 18730 | @section Using the mapping API |
| 17880 | @cindex API, for mapping | 18731 | @cindex API, for mapping |
| 17881 | @cindex mapping entries, API | 18732 | @cindex mapping entries, API |
| 17882 | 18733 | ||
| 17883 | Org has sophisticated mapping capabilities to find all entries satisfying | 18734 | Org has sophisticated mapping capabilities for finding entries. Org uses |
| 17884 | certain criteria. Internally, this functionality is used to produce agenda | 18735 | this functionality internally for generating agenda views. Org also exposes |
| 17885 | views, but there is also an API that can be used to execute arbitrary | 18736 | an API for executing arbitrary functions for each selected entry. The API's |
| 17886 | functions for each or selected entries. The main entry point for this API | 18737 | main entry point is: |
| 17887 | is: | ||
| 17888 | 18738 | ||
| 17889 | @defun org-map-entries func &optional match scope &rest skip | 18739 | @defun org-map-entries func &optional match scope &rest skip |
| 17890 | Call @code{FUNC} at each headline selected by @code{MATCH} in @code{SCOPE}. | 18740 | Call @samp{FUNC} at each headline selected by @code{MATCH} in @code{SCOPE}. |
| 17891 | 18741 | ||
| 17892 | @code{FUNC} is a function or a Lisp form. The function will be called | 18742 | @samp{FUNC} is a function or a Lisp form. With the cursor positioned at the |
| 17893 | without arguments, with the cursor positioned at the beginning of the | 18743 | beginning of the headline, call the function without arguments. Org returns |
| 17894 | headline. The return values of all calls to the function will be collected | 18744 | an alist of return values of calls to the function. |
| 17895 | and returned as a list. | ||
| 17896 | 18745 | ||
| 17897 | The call to @code{FUNC} will be wrapped into a save-excursion form, so | 18746 | To avoid preserving point, Org wraps the call to @code{FUNC} in |
| 17898 | @code{FUNC} does not need to preserve point. After evaluation, the cursor | 18747 | save-excursion form. After evaluation, Org moves the cursor to the end of |
| 17899 | will be moved to the end of the line (presumably of the headline of the | 18748 | the line that was just processed. Search continues from that point forward. |
| 17900 | processed entry) and search continues from there. Under some circumstances, | 18749 | This may not always work as expected under some conditions, such as if the |
| 17901 | this may not produce the wanted results. For example, if you have removed | 18750 | current sub-tree was removed by a previous archiving operation. In such rare |
| 17902 | (e.g., archived) the current (sub)tree it could mean that the next entry will | 18751 | circumstances, Org skips the next entry entirely when it should not. To stop |
| 17903 | be skipped entirely. In such cases, you can specify the position from where | 18752 | Org from such skips, make @samp{FUNC} set the variable |
| 17904 | search should continue by making @code{FUNC} set the variable | 18753 | @code{org-map-continue-from} to a specific buffer position. |
| 17905 | @code{org-map-continue-from} to the desired buffer position. | ||
| 17906 | 18754 | ||
| 17907 | @code{MATCH} is a tags/property/todo match as it is used in the agenda match | 18755 | @samp{MATCH} is a tags/property/TODO match. Org iterates only matched |
| 17908 | view. Only headlines that are matched by this query will be considered | 18756 | headlines. Org iterates over all headlines when @code{MATCH} is @code{nil} |
| 17909 | during the iteration. When @code{MATCH} is @code{nil} or @code{t}, all | 18757 | or @code{t}. |
| 17910 | headlines will be visited by the iteration. | ||
| 17911 | 18758 | ||
| 17912 | @code{SCOPE} determines the scope of this command. It can be any of: | 18759 | @samp{SCOPE} determines the scope of this command. It can be any of: |
| 17913 | 18760 | ||
| 17914 | @example | 18761 | @example |
| 17915 | nil @r{the current buffer, respecting the restriction if any} | 18762 | nil @r{the current buffer, respecting the restriction if any} |
| @@ -17925,8 +18772,8 @@ agenda-with-archives | |||
| 17925 | @r{if this is a list, all files in the list will be scanned} | 18772 | @r{if this is a list, all files in the list will be scanned} |
| 17926 | @end example | 18773 | @end example |
| 17927 | @noindent | 18774 | @noindent |
| 17928 | The remaining args are treated as settings for the skipping facilities of | 18775 | The remaining args are treated as settings for the scanner's skipping |
| 17929 | the scanner. The following items can be given here: | 18776 | facilities. Valid args are: |
| 17930 | 18777 | ||
| 17931 | @vindex org-agenda-skip-function | 18778 | @vindex org-agenda-skip-function |
| 17932 | @example | 18779 | @example |
| @@ -17940,10 +18787,9 @@ function or Lisp form | |||
| 17940 | @end example | 18787 | @end example |
| 17941 | @end defun | 18788 | @end defun |
| 17942 | 18789 | ||
| 17943 | The function given to that mapping routine can really do anything you like. | 18790 | The mapping routine can call any arbitrary function, even functions that |
| 17944 | It can use the property API (@pxref{Using the property API}) to gather more | 18791 | change meta data or query the property API (@pxref{Using the property API}). |
| 17945 | information about the entry, or in order to change metadata in the entry. | 18792 | Here are some handy functions: |
| 17946 | Here are a couple of functions that might be handy: | ||
| 17947 | 18793 | ||
| 17948 | @defun org-todo &optional arg | 18794 | @defun org-todo &optional arg |
| 17949 | Change the TODO state of the entry. See the docstring of the functions for | 18795 | Change the TODO state of the entry. See the docstring of the functions for |
| @@ -17969,9 +18815,9 @@ Promote the current entry. | |||
| 17969 | Demote the current entry. | 18815 | Demote the current entry. |
| 17970 | @end defun | 18816 | @end defun |
| 17971 | 18817 | ||
| 17972 | Here is a simple example that will turn all entries in the current file with | 18818 | This example turns all entries tagged with @code{TOMORROW} into TODO entries |
| 17973 | a tag @code{TOMORROW} into TODO entries with the keyword @code{UPCOMING}. | 18819 | with keyword @code{UPCOMING}. Org ignores entries in comment trees and |
| 17974 | Entries in comment trees and in archive trees will be ignored. | 18820 | archive trees. |
| 17975 | 18821 | ||
| 17976 | @lisp | 18822 | @lisp |
| 17977 | (org-map-entries | 18823 | (org-map-entries |
| @@ -17986,105 +18832,103 @@ The following example counts the number of entries with TODO keyword | |||
| 17986 | (length (org-map-entries t "/+WAITING" 'agenda)) | 18832 | (length (org-map-entries t "/+WAITING" 'agenda)) |
| 17987 | @end lisp | 18833 | @end lisp |
| 17988 | 18834 | ||
| 17989 | @node MobileOrg, History and Acknowledgments, Hacking, Top | 18835 | @node MobileOrg |
| 17990 | @appendix MobileOrg | 18836 | @appendix MobileOrg |
| 17991 | @cindex iPhone | 18837 | @cindex iPhone |
| 17992 | @cindex MobileOrg | 18838 | @cindex MobileOrg |
| 17993 | 18839 | ||
| 17994 | @i{MobileOrg} is the name of the mobile companion app for Org mode, currently | 18840 | MobileOrg is a companion mobile app that runs on iOS and Android devices. |
| 17995 | available for iOS and for Android. @i{MobileOrg} offers offline viewing and | 18841 | MobileOrg enables offline-views and capture support for an Org mode system |
| 17996 | capture support for an Org mode system rooted on a ``real'' computer. It | 18842 | that is rooted on a ``real'' computer. MobileOrg can record changes to |
| 17997 | does also allow you to record changes to existing entries. The | 18843 | existing entries. |
| 17998 | @uref{https://github.com/MobileOrg/, iOS implementation} for the | 18844 | |
| 17999 | @i{iPhone/iPod Touch/iPad} series of devices, was started by Richard Moreland | 18845 | The @uref{https://github.com/MobileOrg/, iOS implementation} for the |
| 18000 | and is now in the hands Sean Escriva. Android users should check out | 18846 | @emph{iPhone/iPod Touch/iPad} series of devices, was started by Richard |
| 18001 | @uref{http://wiki.github.com/matburt/mobileorg-android/, MobileOrg Android} | 18847 | Moreland and is now in the hands Sean Escriva. Android users should check |
| 18002 | by Matt Jones. The two implementations are not identical but offer similar | 18848 | out @uref{http://wiki.github.com/matburt/mobileorg-android/, MobileOrg |
| 18003 | features. | 18849 | Android} by Matt Jones. Though the two implementations are not identical, |
| 18004 | 18850 | they offer similar features. | |
| 18005 | This appendix describes the support Org has for creating agenda views in a | 18851 | |
| 18006 | format that can be displayed by @i{MobileOrg}, and for integrating notes | 18852 | This appendix describes Org's support for agenda view formats compatible with |
| 18007 | captured and changes made by @i{MobileOrg} into the main system. | 18853 | MobileOrg. It also describes synchronizing changes, such as to notes, |
| 18008 | 18854 | between MobileOrg and the computer. | |
| 18009 | For changing tags and TODO states in MobileOrg, you should have set up the | 18855 | |
| 18010 | customization variables @code{org-todo-keywords} and @code{org-tag-alist} to | 18856 | To change tags and TODO states in MobileOrg, first customize the variables |
| 18011 | cover all important tags and TODO keywords, even if individual files use only | 18857 | @code{org-todo-keywords} and @code{org-tag-alist}. These should cover all |
| 18012 | part of these. MobileOrg will also offer you states and tags set up with | 18858 | the important tags and TODO keywords, even if Org files use only some of |
| 18013 | in-buffer settings, but it will understand the logistics of TODO state | 18859 | them. Though MobileOrg has in-buffer settings, it understands TODO states |
| 18014 | @i{sets} (@pxref{Per-file keywords}) and @i{mutually exclusive} tags | 18860 | @emph{sets} (@pxref{Per-file keywords}) and @emph{mutually exclusive} tags |
| 18015 | (@pxref{Setting tags}) only for those set in these variables. | 18861 | (@pxref{Setting tags}) only for those set in these variables. |
| 18016 | 18862 | ||
| 18017 | @menu | 18863 | @menu |
| 18018 | * Setting up the staging area:: Where to interact with the mobile device | 18864 | * Setting up the staging area:: For the mobile device |
| 18019 | * Pushing to MobileOrg:: Uploading Org files and agendas | 18865 | * Pushing to MobileOrg:: Uploading Org files and agendas |
| 18020 | * Pulling from MobileOrg:: Integrating captured and flagged items | 18866 | * Pulling from MobileOrg:: Integrating captured and flagged items |
| 18021 | @end menu | 18867 | @end menu |
| 18022 | 18868 | ||
| 18023 | @node Setting up the staging area, Pushing to MobileOrg, MobileOrg, MobileOrg | 18869 | @node Setting up the staging area |
| 18024 | @section Setting up the staging area | 18870 | @section Setting up the staging area |
| 18025 | 18871 | ||
| 18026 | MobileOrg needs to interact with Emacs through a directory on a server. If you | 18872 | MobileOrg needs access to a file directory on a server to interact with |
| 18027 | are using a public server, you should consider to encrypt the files that are | 18873 | Emacs. With a public server, consider encrypting the files. MobileOrg |
| 18028 | uploaded to the server. This can be done with Org mode 7.02 and with | 18874 | version 1.5 supports encryption for the iPhone. Org also requires |
| 18029 | @i{MobileOrg 1.5} (iPhone version), and you need an @file{openssl} | 18875 | @file{openssl} installed on the local computer. To turn on encryption, set |
| 18030 | installation on your system. To turn on encryption, set a password in | 18876 | the same password in MobileOrg and in Emacs. Set the password in the |
| 18031 | @i{MobileOrg} and, on the Emacs side, configure the variable | 18877 | variable @code{org-mobile-use-encryption}@footnote{If Emacs is configured for |
| 18032 | @code{org-mobile-use-encryption}@footnote{If you can safely store the | 18878 | safe storing of passwords, then configure the variable, |
| 18033 | password in your Emacs setup, you might also want to configure | 18879 | @code{org-mobile-encryption-password}; please read the docstring of that |
| 18034 | @code{org-mobile-encryption-password}. Please read the docstring of that | 18880 | variable.}. Note that even after MobileOrg encrypts the file contents, the |
| 18035 | variable. Note that encryption will apply only to the contents of the | 18881 | file names will remain visible on the file systems of the local computer, the |
| 18036 | @file{.org} files. The file names themselves will remain visible.}. | 18882 | server, and the mobile device. |
| 18037 | 18883 | ||
| 18038 | The easiest way to create that directory is to use a free | 18884 | For a server to host files, consider options like |
| 18039 | @uref{http://dropbox.com,Dropbox.com} account@footnote{If you cannot use | 18885 | @uref{http://dropbox.com,Dropbox.com} account@footnote{An alternative is to |
| 18040 | Dropbox, or if your version of MobileOrg does not support it, you can use a | 18886 | use webdav server. MobileOrg documentation has details of webdav server |
| 18041 | webdav server. For more information, check out the documentation of MobileOrg and also this | 18887 | configuration. Additional help is at |
| 18042 | @uref{http://orgmode.org/worg/org-faq.html#mobileorg_webdav, FAQ entry}.}. | 18888 | @uref{http://orgmode.org/worg/org-faq.html#mobileorg_webdav, FAQ entry}.}. |
| 18043 | When MobileOrg first connects to your Dropbox, it will create a directory | 18889 | On first connection, MobileOrg creates a directory @file{MobileOrg/} on |
| 18044 | @i{MobileOrg} inside the Dropbox. After the directory has been created, tell | 18890 | Dropbox. Pass its location to Emacs through an init file variable as |
| 18045 | Emacs about it: | 18891 | follows: |
| 18046 | 18892 | ||
| 18047 | @lisp | 18893 | @lisp |
| 18048 | (setq org-mobile-directory "~/Dropbox/MobileOrg") | 18894 | (setq org-mobile-directory "~/Dropbox/MobileOrg") |
| 18049 | @end lisp | 18895 | @end lisp |
| 18050 | 18896 | ||
| 18051 | Org mode has commands to put files for @i{MobileOrg} into that directory, | 18897 | Org copies files to the above directory for MobileOrg. Org also uses the |
| 18052 | and to read captured notes from there. | 18898 | same directory for sharing notes between Org and MobileOrg. |
| 18053 | 18899 | ||
| 18054 | @node Pushing to MobileOrg, Pulling from MobileOrg, Setting up the staging area, MobileOrg | 18900 | @node Pushing to MobileOrg |
| 18055 | @section Pushing to MobileOrg | 18901 | @section Pushing to MobileOrg |
| 18056 | 18902 | ||
| 18057 | This operation copies all files currently listed in @code{org-mobile-files} | 18903 | Org pushes files listed in @code{org-mobile-files} to |
| 18058 | to the directory @code{org-mobile-directory}. By default this list contains | 18904 | @code{org-mobile-directory}. Files include agenda files (as listed in |
| 18059 | all agenda files (as listed in @code{org-agenda-files}), but additional files | 18905 | @code{org-agenda-files}). Customize @code{org-mobile-files} to add other |
| 18060 | can be included by customizing @code{org-mobile-files}. File names will be | 18906 | files. File names will be staged with paths relative to |
| 18061 | staged with paths relative to @code{org-directory}, so all files should be | 18907 | @code{org-directory}, so all files should be inside this |
| 18062 | inside this directory@footnote{Symbolic links in @code{org-directory} need to | 18908 | directory@footnote{Symbolic links in @code{org-directory} should have the |
| 18063 | have the same name than their targets.}. | 18909 | same name as their targets.}. |
| 18064 | 18910 | ||
| 18065 | The push operation also creates a special Org file @file{agendas.org} with | 18911 | Push creates a special Org file @file{agendas.org} with custom agenda views |
| 18066 | all custom agenda view defined by the user@footnote{While creating the | 18912 | defined by the user@footnote{While creating the agendas, Org mode will force |
| 18067 | agendas, Org mode will force ID properties on all referenced entries, so that | 18913 | ID properties on all referenced entries, so that these entries can be |
| 18068 | these entries can be uniquely identified if @i{MobileOrg} flags them for | 18914 | uniquely identified if MobileOrg flags them for further action. To avoid |
| 18069 | further action. If you do not want to get these properties in so many | 18915 | setting properties configure the variable |
| 18070 | entries, you can set the variable @code{org-mobile-force-id-on-agenda-items} | 18916 | @code{org-mobile-force-id-on-agenda-items} to @code{nil}. Org mode will then |
| 18071 | to @code{nil}. Org mode will then rely on outline paths, in the hope that | 18917 | rely on outline paths, assuming they are unique.}. |
| 18072 | these will be unique enough.}. | 18918 | |
| 18073 | 18919 | Org writes the file @file{index.org}, containing links to other files. | |
| 18074 | Finally, Org writes the file @file{index.org}, containing links to all other | 18920 | MobileOrg reads this file first from the server to determine what other files |
| 18075 | files. @i{MobileOrg} first reads this file from the server, and then | 18921 | to download for agendas. For faster downloads, MobileOrg will read only |
| 18076 | downloads all agendas and Org files listed in it. To speed up the download, | 18922 | those files whose checksums@footnote{Checksums are stored automatically in |
| 18077 | MobileOrg will only read files whose checksums@footnote{Checksums are stored | 18923 | the file @file{checksums.dat}.} have changed. |
| 18078 | automatically in the file @file{checksums.dat}} have changed. | 18924 | |
| 18079 | 18925 | @node Pulling from MobileOrg | |
| 18080 | @node Pulling from MobileOrg, , Pushing to MobileOrg, MobileOrg | ||
| 18081 | @section Pulling from MobileOrg | 18926 | @section Pulling from MobileOrg |
| 18082 | 18927 | ||
| 18083 | When @i{MobileOrg} synchronizes with the server, it not only pulls the Org | 18928 | When MobileOrg synchronizes with the server, it pulls the Org files for |
| 18084 | files for viewing. It also appends captured entries and pointers to flagged | 18929 | viewing. It then appends to the file @file{mobileorg.org} on the server the |
| 18085 | and changed entries to the file @file{mobileorg.org} on the server. Org has | 18930 | captured entries, pointers to flagged and changed entries. Org integrates |
| 18086 | a @emph{pull} operation that integrates this information into an inbox file | 18931 | its data in an inbox file format. |
| 18087 | and operates on the pointers to flagged entries. Here is how it works: | ||
| 18088 | 18932 | ||
| 18089 | @enumerate | 18933 | @enumerate |
| 18090 | @item | 18934 | @item |
| @@ -18092,46 +18936,37 @@ Org moves all entries found in | |||
| 18092 | @file{mobileorg.org}@footnote{@file{mobileorg.org} will be empty after this | 18936 | @file{mobileorg.org}@footnote{@file{mobileorg.org} will be empty after this |
| 18093 | operation.} and appends them to the file pointed to by the variable | 18937 | operation.} and appends them to the file pointed to by the variable |
| 18094 | @code{org-mobile-inbox-for-pull}. Each captured entry and each editing event | 18938 | @code{org-mobile-inbox-for-pull}. Each captured entry and each editing event |
| 18095 | will be a top-level entry in the inbox file. | 18939 | is a top-level entry in the inbox file. |
| 18096 | @item | 18940 | @item |
| 18097 | After moving the entries, Org will attempt to implement the changes made in | 18941 | After moving the entries, Org attempts changes to MobileOrg. Some changes |
| 18098 | @i{MobileOrg}. Some changes are applied directly and without user | 18942 | are applied directly and without user interaction. Examples include changes |
| 18099 | interaction. Examples are all changes to tags, TODO state, headline and body | 18943 | to tags, TODO state, headline and body text. Entries for further action are |
| 18100 | text that can be cleanly applied. Entries that have been flagged for further | 18944 | tagged as @code{:FLAGGED:}. Org marks entries with problems with an error |
| 18101 | action will receive a tag @code{:FLAGGED:}, so that they can be easily found | 18945 | message in the inbox. They have to be resolved manually. |
| 18102 | again. When there is a problem finding an entry or applying the change, the | ||
| 18103 | pointer entry will remain in the inbox and will be marked with an error | ||
| 18104 | message. You need to later resolve these issues by hand. | ||
| 18105 | @item | 18946 | @item |
| 18106 | Org will then generate an agenda view with all flagged entries. The user | 18947 | Org generates an agenda view for flagged entries for user intervention to |
| 18107 | should then go through these entries and do whatever actions are necessary. | 18948 | clean up. For notes stored in flagged entries, MobileOrg displays them in |
| 18108 | If a note has been stored while flagging an entry in @i{MobileOrg}, that note | 18949 | the echo area when the cursor is on the corresponding agenda item. |
| 18109 | will be displayed in the echo area when the cursor is on the corresponding | ||
| 18110 | agenda line. | ||
| 18111 | 18950 | ||
| 18112 | @table @kbd | 18951 | @table @kbd |
| 18113 | @kindex ? | 18952 | @kindex ? |
| 18114 | @item ? | 18953 | @item ? |
| 18115 | Pressing @kbd{?} in that special agenda will display the full flagging note in | 18954 | Pressing @kbd{?} displays the entire flagged note in another window. Org |
| 18116 | another window and also push it onto the kill ring. So you could use @kbd{? | 18955 | also pushes it to the kill ring. To store flagged note as a normal note, use |
| 18117 | z C-y C-c C-c} to store that flagging note as a normal note in the entry. | 18956 | @kbd{? z C-y C-c C-c}. Pressing @kbd{?} twice does these things: first it |
| 18118 | Pressing @kbd{?} twice in succession will offer to remove the | 18957 | removes the @code{:FLAGGED:} tag; second, it removes the flagged note from |
| 18119 | @code{:FLAGGED:} tag along with the recorded flagging note (which is stored | 18958 | the property drawer; third, it signals that manual editing of the flagged |
| 18120 | in a property). In this way you indicate that the intended processing for | 18959 | entry is now finished. |
| 18121 | this flagged entry is finished. | ||
| 18122 | @end table | 18960 | @end table |
| 18123 | @end enumerate | 18961 | @end enumerate |
| 18124 | 18962 | ||
| 18125 | @kindex C-c a ? | 18963 | @kindex C-c a ? |
| 18126 | If you are not able to process all flagged entries directly, you can always | 18964 | @kbd{C-c a ?} returns to the agenda view to finish processing flagged |
| 18127 | return to this agenda view@footnote{Note, however, that there is a subtle | 18965 | entries. Note that these entries may not be the most recent since MobileOrg |
| 18128 | difference. The view created automatically by @kbd{M-x org-mobile-pull RET} | 18966 | searches files that were last pulled. To get an updated agenda view with |
| 18129 | is guaranteed to search all files that have been addressed by the last pull. | 18967 | changes since the last pull, pull again. |
| 18130 | This might include a file that is not currently in your list of agenda files. | 18968 | |
| 18131 | If you later use @kbd{C-c a ?} to regenerate the view, only the current | 18969 | @node History and acknowledgments |
| 18132 | agenda files will be searched.} using @kbd{C-c a ?}. | ||
| 18133 | |||
| 18134 | @node History and Acknowledgments, GNU Free Documentation License, MobileOrg, Top | ||
| 18135 | @appendix History and acknowledgments | 18970 | @appendix History and acknowledgments |
| 18136 | @cindex acknowledgments | 18971 | @cindex acknowledgments |
| 18137 | @cindex history | 18972 | @cindex history |
| @@ -18143,17 +18978,17 @@ Org was born in 2003, out of frustration over the user interface of the Emacs | |||
| 18143 | Outline mode. I was trying to organize my notes and projects, and using | 18978 | Outline mode. I was trying to organize my notes and projects, and using |
| 18144 | Emacs seemed to be the natural way to go. However, having to remember eleven | 18979 | Emacs seemed to be the natural way to go. However, having to remember eleven |
| 18145 | different commands with two or three keys per command, only to hide and show | 18980 | different commands with two or three keys per command, only to hide and show |
| 18146 | parts of the outline tree, that seemed entirely unacceptable to me. Also, | 18981 | parts of the outline tree, that seemed entirely unacceptable. Also, when |
| 18147 | when using outlines to take notes, I constantly wanted to restructure the | 18982 | using outlines to take notes, I constantly wanted to restructure the tree, |
| 18148 | tree, organizing it parallel to my thoughts and plans. @emph{Visibility | 18983 | organizing it paralleling my thoughts and plans. @emph{Visibility cycling} |
| 18149 | cycling} and @emph{structure editing} were originally implemented in the | 18984 | and @emph{structure editing} were originally implemented in the package |
| 18150 | package @file{outline-magic.el}, but quickly moved to the more general | 18985 | @file{outline-magic.el}, but quickly moved to the more general @file{org.el}. |
| 18151 | @file{org.el}. As this environment became comfortable for project planning, | 18986 | As this environment became comfortable for project planning, the next step |
| 18152 | the next step was adding @emph{TODO entries}, basic @emph{timestamps}, and | 18987 | was adding @emph{TODO entries}, basic @emph{timestamps}, and @emph{table |
| 18153 | @emph{table support}. These areas highlighted the two main goals that Org | 18988 | support}. These areas highlighted the two main goals that Org still has |
| 18154 | still has today: to be a new, outline-based, plain text mode with innovative | 18989 | today: to be a new, outline-based, plain text mode with innovative and |
| 18155 | and intuitive editing features, and to incorporate project planning | 18990 | intuitive editing features, and to incorporate project planning functionality |
| 18156 | functionality directly into a notes file. | 18991 | directly into a notes file. |
| 18157 | 18992 | ||
| 18158 | Since the first release, literally thousands of emails to me or to | 18993 | Since the first release, literally thousands of emails to me or to |
| 18159 | @email{emacs-orgmode@@gnu.org} have provided a constant stream of bug | 18994 | @email{emacs-orgmode@@gnu.org} have provided a constant stream of bug |
| @@ -18169,15 +19004,17 @@ Before I get to this list, a few special mentions are in order: | |||
| 18169 | @table @i | 19004 | @table @i |
| 18170 | @item Bastien Guerry | 19005 | @item Bastien Guerry |
| 18171 | Bastien has written a large number of extensions to Org (most of them | 19006 | Bastien has written a large number of extensions to Org (most of them |
| 18172 | integrated into the core by now), including the @LaTeX{} exporter and the plain | 19007 | integrated into the core by now), including the @LaTeX{} exporter and the |
| 18173 | list parser. His support during the early days, when he basically acted as | 19008 | plain list parser. His support during the early days was central to the |
| 18174 | co-maintainer, was central to the success of this project. Bastien also | 19009 | success of this project. Bastien also invented Worg, helped establishing the |
| 18175 | invented Worg, helped establishing the Web presence of Org, and sponsored | 19010 | Web presence of Org, and sponsored hosting costs for the orgmode.org website. |
| 18176 | hosting costs for the orgmode.org website. | 19011 | Bastien stepped in as maintainer of Org between 2011 and 2013, at a time when |
| 19012 | I desperately needed a break. | ||
| 18177 | @item Eric Schulte and Dan Davison | 19013 | @item Eric Schulte and Dan Davison |
| 18178 | Eric and Dan are jointly responsible for the Org-babel system, which turns | 19014 | Eric and Dan are jointly responsible for the Org-babel system, which turns |
| 18179 | Org into a multi-language environment for evaluating code and doing literate | 19015 | Org into a multi-language environment for evaluating code and doing literate |
| 18180 | programming and reproducible research. | 19016 | programming and reproducible research. This has become one of Org's killer |
| 19017 | features that define what Org is today. | ||
| 18181 | @item John Wiegley | 19018 | @item John Wiegley |
| 18182 | John has contributed a number of great ideas and patches directly to Org, | 19019 | John has contributed a number of great ideas and patches directly to Org, |
| 18183 | including the attachment system (@file{org-attach.el}), integration with | 19020 | including the attachment system (@file{org-attach.el}), integration with |
| @@ -18198,9 +19035,8 @@ let me know what I am missing here! | |||
| 18198 | 19035 | ||
| 18199 | @section From Bastien | 19036 | @section From Bastien |
| 18200 | 19037 | ||
| 18201 | I (Bastien) have been maintaining Org since January 2011. This appendix | 19038 | I (Bastien) have been maintaining Org between 2011 and 2013. This appendix |
| 18202 | would not be complete without adding a few more acknowledgements and thanks | 19039 | would not be complete without adding a few more acknowledgments and thanks. |
| 18203 | to Carsten's ones above. | ||
| 18204 | 19040 | ||
| 18205 | I am first grateful to Carsten for his trust while handing me over the | 19041 | I am first grateful to Carsten for his trust while handing me over the |
| 18206 | maintainership of Org. His unremitting support is what really helped me | 19042 | maintainership of Org. His unremitting support is what really helped me |
| @@ -18218,13 +19054,13 @@ Eric is maintaining the Babel parts of Org. His reactivity here kept me away | |||
| 18218 | from worrying about possible bugs here and let me focus on other parts. | 19054 | from worrying about possible bugs here and let me focus on other parts. |
| 18219 | 19055 | ||
| 18220 | @item Nicolas Goaziou | 19056 | @item Nicolas Goaziou |
| 18221 | Nicolas is maintaining the consistency of the deepest parts of Org. His | 19057 | Nicolas is maintaining the consistency of the deepest parts of Org. His work |
| 18222 | work on @file{org-element.el} and @file{ox.el} has been outstanding, and | 19058 | on @file{org-element.el} and @file{ox.el} has been outstanding, and it opened |
| 18223 | opened the doors for many new ideas and features. He rewrote many of the | 19059 | the doors for many new ideas and features. He rewrote many of the old |
| 18224 | old exporters to use the new export engine, and helped with documenting | 19060 | exporters to use the new export engine, and helped with documenting this |
| 18225 | this major change. More importantly (if that's possible), he has been more | 19061 | major change. More importantly (if that's possible), he has been more than |
| 18226 | than reliable during all the work done for Org 8.0, and always very | 19062 | reliable during all the work done for Org 8.0, and always very reactive on |
| 18227 | reactive on the mailing list. | 19063 | the mailing list. |
| 18228 | 19064 | ||
| 18229 | @item Achim Gratz | 19065 | @item Achim Gratz |
| 18230 | Achim rewrote the building process of Org, turning some @emph{ad hoc} tools | 19066 | Achim rewrote the building process of Org, turning some @emph{ad hoc} tools |
| @@ -18280,13 +19116,14 @@ specified time. | |||
| 18280 | calculations and improved XEmacs compatibility, in particular by porting | 19116 | calculations and improved XEmacs compatibility, in particular by porting |
| 18281 | @file{nouline.el} to XEmacs. | 19117 | @file{nouline.el} to XEmacs. |
| 18282 | @item | 19118 | @item |
| 18283 | @i{Sacha Chua} suggested copying some linking code from Planner. | 19119 | @i{Sacha Chua} suggested copying some linking code from Planner, and helped |
| 19120 | make Org pupular through her blog. | ||
| 18284 | @item | 19121 | @item |
| 18285 | @i{Toby S. Cubitt} contributed to the code for clock formats. | 19122 | @i{Toby S. Cubitt} contributed to the code for clock formats. |
| 18286 | @item | 19123 | @item |
| 18287 | @i{Baoqiu Cui} contributed the DocBook exporter. It has been deleted from | 19124 | @i{Baoqiu Cui} contributed the first DocBook exporter. In Org 8.0, we go a |
| 18288 | Org 8.0: you can now export to Texinfo and export the @file{.texi} file to | 19125 | different route: you can now export to Texinfo and export the @file{.texi} |
| 18289 | DocBook using @code{makeinfo}. | 19126 | file to DocBook using @code{makeinfo}. |
| 18290 | @item | 19127 | @item |
| 18291 | @i{Eddward DeVilla} proposed and tested checkbox statistics. He also | 19128 | @i{Eddward DeVilla} proposed and tested checkbox statistics. He also |
| 18292 | came up with the idea of properties, and that there should be an API for | 19129 | came up with the idea of properties, and that there should be an API for |
| @@ -18383,7 +19220,7 @@ basis. | |||
| 18383 | @i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler | 19220 | @i{Stefan Monnier} provided a patch to keep the Emacs-Lisp compiler |
| 18384 | happy. | 19221 | happy. |
| 18385 | @item | 19222 | @item |
| 18386 | @i{Richard Moreland} wrote @i{MobileOrg} for the iPhone. | 19223 | @i{Richard Moreland} wrote MobileOrg for the iPhone. |
| 18387 | @item | 19224 | @item |
| 18388 | @i{Rick Moynihan} proposed allowing multiple TODO sequences in a file | 19225 | @i{Rick Moynihan} proposed allowing multiple TODO sequences in a file |
| 18389 | and being able to quickly restrict the agenda to a subtree. | 19226 | and being able to quickly restrict the agenda to a subtree. |
| @@ -18501,35 +19338,37 @@ work on a tty. | |||
| 18501 | @item | 19338 | @item |
| 18502 | @i{Piotr Zielinski} wrote @file{org-mouse.el}, proposed agenda blocks | 19339 | @i{Piotr Zielinski} wrote @file{org-mouse.el}, proposed agenda blocks |
| 18503 | and contributed various ideas and code snippets. | 19340 | and contributed various ideas and code snippets. |
| 19341 | @item | ||
| 19342 | @i{Marco Wahl} wrote @file{org-eww.el}. | ||
| 18504 | @end itemize | 19343 | @end itemize |
| 18505 | 19344 | ||
| 18506 | 19345 | ||
| 18507 | @node GNU Free Documentation License, Main Index, History and Acknowledgments, Top | 19346 | @node GNU Free Documentation License |
| 18508 | @appendix GNU Free Documentation License | 19347 | @appendix GNU Free Documentation License |
| 18509 | @include doclicense.texi | 19348 | @include doclicense.texi |
| 18510 | 19349 | ||
| 18511 | 19350 | ||
| 18512 | @node Main Index, Key Index, GNU Free Documentation License, Top | 19351 | @node Main Index |
| 18513 | @unnumbered Concept index | 19352 | @unnumbered Concept index |
| 18514 | 19353 | ||
| 18515 | @printindex cp | 19354 | @printindex cp |
| 18516 | 19355 | ||
| 18517 | @node Key Index, Command and Function Index, Main Index, Top | 19356 | @node Key Index |
| 18518 | @unnumbered Key index | 19357 | @unnumbered Key index |
| 18519 | 19358 | ||
| 18520 | @printindex ky | 19359 | @printindex ky |
| 18521 | 19360 | ||
| 18522 | @node Command and Function Index, Variable Index, Key Index, Top | 19361 | @node Command and Function Index |
| 18523 | @unnumbered Command and function index | 19362 | @unnumbered Command and function index |
| 18524 | 19363 | ||
| 18525 | @printindex fn | 19364 | @printindex fn |
| 18526 | 19365 | ||
| 18527 | @node Variable Index, , Command and Function Index, Top | 19366 | @node Variable Index |
| 18528 | @unnumbered Variable index | 19367 | @unnumbered Variable index |
| 18529 | 19368 | ||
| 18530 | This is not a complete index of variables and faces, only the ones that are | 19369 | This is not a complete index of variables and faces, only the ones that are |
| 18531 | mentioned in the manual. For a more complete list, use @kbd{M-x | 19370 | mentioned in the manual. For a complete list, use @kbd{M-x org-customize |
| 18532 | org-customize @key{RET}} and then click yourself through the tree. | 19371 | @key{RET}}. |
| 18533 | 19372 | ||
| 18534 | @printindex vr | 19373 | @printindex vr |
| 18535 | 19374 | ||