orgguide.info (99920B)
1 This is orgguide.info, produced by makeinfo version 6.8 from 2 orgguide.texi. 3 4 Copyright © 2004–2024 Free Software Foundation, Inc. 5 6 Permission is granted to copy, distribute and/or modify this 7 document under the terms of the GNU Free Documentation License, 8 Version 1.3 or any later version published by the Free Software 9 Foundation; with no Invariant Sections, with the Front-Cover Texts 10 being “A GNU Manual,” and with the Back-Cover Texts as in (a) 11 below. A copy of the license is included in the section entitled 12 “GNU Free Documentation License.” in the full Org manual, which is 13 distributed together with this compact guide. 14 15 (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and 16 modify this GNU manual.” 17 18 INFO-DIR-SECTION Emacs editing modes 19 START-INFO-DIR-ENTRY 20 * Org Guide: (orgguide). Abbreviated Org mode manual. 21 END-INFO-DIR-ENTRY 22 23 24 File: orgguide.info, Node: Top, Next: Introduction, Up: (dir) 25 26 Org Mode Compact Guide 27 ********************** 28 29 Copyright © 2004–2024 Free Software Foundation, Inc. 30 31 Permission is granted to copy, distribute and/or modify this 32 document under the terms of the GNU Free Documentation License, 33 Version 1.3 or any later version published by the Free Software 34 Foundation; with no Invariant Sections, with the Front-Cover Texts 35 being “A GNU Manual,” and with the Back-Cover Texts as in (a) 36 below. A copy of the license is included in the section entitled 37 “GNU Free Documentation License.” in the full Org manual, which is 38 distributed together with this compact guide. 39 40 (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and 41 modify this GNU manual.” 42 43 * Menu: 44 45 * Introduction:: Welcome! 46 * Document Structure:: A tree works like your brain. 47 * Tables:: Pure magic for quick formatting. 48 * Hyperlinks:: Notes in context. 49 * TODO Items:: Every tree branch can be a TODO item. 50 * Tags:: Tagging headlines and matching sets of tags. 51 * Properties:: Storing information about an entry. 52 * Dates and Times:: Making items useful for planning. 53 * Capture, Refile, Archive: Capture Refile Archive. The ins and outs for projects. 54 * Agenda Views:: Collecting information into views. 55 * Markup:: Compose beautiful documents. 56 * Exporting:: Sharing and publishing notes. 57 * Publishing:: Create a web site of linked Org files. 58 * Working with Source Code:: Export, evaluate, and tangle code blocks. 59 * Miscellaneous:: All the rest which did not fit elsewhere. 60 61 — The Detailed Node Listing — 62 63 Document Structure 64 65 * Headlines:: How to typeset Org tree nodes. 66 * Visibility Cycling:: Show and hide, much simplified. 67 * Motion:: Jumping to other headlines. 68 * Structure Editing:: Changing sequence and level of headlines. 69 * Sparse Trees:: Matches embedded in context. 70 * Plain Lists:: Additional structure within an entry. 71 72 TODO Items 73 74 * TODO Basics:: Marking and displaying TODO entries. 75 * Multi-state Workflow:: More than just on/off. 76 * Progress Logging:: Dates and notes for progress. 77 * Priorities:: Some things are more important than others. 78 * Breaking Down Tasks:: Splitting a task into manageable pieces. 79 * Checkboxes:: Tick-off lists. 80 81 Dates and Times 82 83 * Timestamps:: Assigning a time to a tree entry. 84 * Creating Timestamps:: Commands that insert timestamps. 85 * Deadlines and Scheduling:: Planning your work. 86 * Clocking Work Time:: Tracking how long you spent on a task. 87 88 Capture, Refile, Archive 89 90 * Capture:: Capturing new stuff. 91 * Refile and Copy:: Moving/copying a tree from one place to another. 92 * Archiving:: What to do with finished products. 93 94 Agenda Views 95 96 * Agenda Files:: Files being searched for agenda information. 97 * Agenda Dispatcher:: Keyboard access to agenda views. 98 * Built-in Agenda Views:: What is available out of the box? 99 * Global TODO List:: All unfinished action items. 100 * Matching Tags and Properties:: Structured information with fine-tuned search. 101 * Search View:: Find entries by searching for text. 102 * Agenda Commands:: Remote editing of Org trees. 103 * Custom Agenda Views:: Defining special searches and views. 104 105 Markup 106 107 * Paragraphs:: The basic unit of text. 108 * Emphasis and Monospace:: Bold, italic, etc. 109 * Embedded LaTeX:: LaTeX can be freely used inside Org documents. 110 * Literal examples:: Source code examples with special formatting. 111 * Images:: Display an image. 112 * Creating Footnotes:: Edit and read footnotes. 113 114 Exporting 115 116 * The Export Dispatcher:: The main interface. 117 * Export Settings:: Common export settings. 118 * Table of Contents:: The if and where of the table of contents. 119 * Include Files:: Include additional files into a document. 120 * Comment Lines:: What will not be exported. 121 * ASCII/UTF-8 Export:: Exporting to flat files with encoding. 122 * HTML Export:: Exporting to HTML. 123 * LaTeX Export:: Exporting to LaTeX and processing to PDF. 124 * iCalendar Export:: Exporting to iCalendar. 125 126 127 128 File: orgguide.info, Node: Introduction, Next: Document Structure, Prev: Top, Up: Top 129 130 1 Introduction 131 ************** 132 133 Org is a mode for keeping notes, maintaining TODO lists, and doing 134 project planning with a fast and effective plain-text system. It is 135 also an authoring and publishing system, and it supports working with 136 source code for literal programming and reproducible research. 137 138 This document is a much compressed derivative of the *note 139 comprehensive Org mode manual: (org)Top. It contains all basic features 140 and commands, along with important hints for customization. It is 141 intended for beginners who would shy back from a 200 pages manual 142 because of sheer size. 143 144 Installation 145 ============ 146 147 Important: If you are using a version of Org that is part of the 148 Emacs distribution, please skip this section and go directly to 149 *note Activation::. 150 151 If you have downloaded Org from the web, either as a distribution 152 ‘.zip’ or ‘.tar’ file, or as a Git archive, it is best to run it 153 directly from the distribution directory. You need to add the ‘lisp/’ 154 subdirectories to the Emacs load path. To do this, add the following 155 line to your Emacs init file: 156 157 (add-to-list 'load-path "~/path/to/orgdir/lisp") 158 159 If you have been using git or a tar ball to get Org, you need to run the 160 following command to generate autoload information. 161 162 make autoloads 163 164 Activation 165 ========== 166 167 Add the following lines to your Emacs init file to define _global_ keys 168 for three commands that are useful in any Emacs buffer, not just Org 169 buffers. Please choose suitable keys yourself. 170 171 (global-set-key (kbd "C-c l") #'org-store-link) 172 (global-set-key (kbd "C-c a") #'org-agenda) 173 (global-set-key (kbd "C-c c") #'org-capture) 174 175 Files with extension ‘.org’ will be put into Org mode automatically. 176 177 Feedback 178 ======== 179 180 If you find problems with Org, or if you have questions, remarks, or 181 ideas about it, please mail to the Org mailing list 182 <mailto:emacs-orgmode@gnu.org>. For information on how to submit bug 183 reports, see the *note main manual: (org)Top. 184 185 186 File: orgguide.info, Node: Document Structure, Next: Tables, Prev: Introduction, Up: Top 187 188 2 Document Structure 189 ******************** 190 191 Org is an outliner. Outlines allow a document to be organized in a 192 hierarchical structure, which, least for me, is the best representation 193 of notes and thoughts. An overview of this structure is achieved by 194 folding, i.e., hiding large parts of the document to show only the 195 general document structure and the parts currently being worked on. Org 196 greatly simplifies the use of outlines by compressing the entire show 197 and hide functionalities into a single command, ‘org-cycle’, which is 198 bound to the ‘<TAB>’ key. 199 200 * Menu: 201 202 * Headlines:: How to typeset Org tree nodes. 203 * Visibility Cycling:: Show and hide, much simplified. 204 * Motion:: Jumping to other headlines. 205 * Structure Editing:: Changing sequence and level of headlines. 206 * Sparse Trees:: Matches embedded in context. 207 * Plain Lists:: Additional structure within an entry. 208 209 210 File: orgguide.info, Node: Headlines, Next: Visibility Cycling, Up: Document Structure 211 212 2.1 Headlines 213 ============= 214 215 Headlines define the structure of an outline tree. The headlines in Org 216 start on the left margin(1) with one or more stars followed by a space. 217 For example: 218 219 * Top level headline 220 ** Second level 221 *** Third level 222 some text 223 *** Third level 224 more text 225 * Another top level headline 226 227 Note that a headline named after ‘org-footnote-section’, which 228 defaults to ‘Footnotes’, is considered as special. A subtree with this 229 headline will be silently ignored by exporting functions. 230 231 Some people find the many stars too noisy and would prefer an outline 232 that has whitespace followed by a single star as headline starters. See 233 *note Miscellaneous:: for a setup to realize this. 234 235 ---------- Footnotes ---------- 236 237 (1) See the variable ‘org-special-ctrl-a/e’ to configure special 238 behavior of ‘C-a’ and ‘C-e’ in headlines. 239 240 241 File: orgguide.info, Node: Visibility Cycling, Next: Motion, Prev: Headlines, Up: Document Structure 242 243 2.2 Visibility Cycling 244 ====================== 245 246 Outlines make it possible to hide parts of the text in the buffer. Org 247 uses just two commands, bound to ‘<TAB>’ and ‘S-<TAB>’ (‘org-cycle’ and 248 ‘org-shifttab’) to change the visibility in the buffer. 249 250 ‘<TAB>’ (‘org-cycle’) 251 _Subtree cycling_: Rotate current subtree among the states 252 253 ,-> FOLDED -> CHILDREN -> SUBTREE --. 254 '-----------------------------------' 255 256 When called with a prefix argument (‘C-u <TAB>’), or with the Shift 257 key, global cycling is invoked. 258 259 ‘S-<TAB>’ (‘org-global-cycle’) 260 ‘C-u <TAB>’ (‘org-cycle’) 261 _Global cycling_: Rotate the entire buffer among the states 262 263 ,-> OVERVIEW -> CONTENTS -> SHOW ALL --. 264 '--------------------------------------' 265 266 ‘C-u C-u C-u <TAB>’ (‘org-show-all’) 267 Show all, including drawers. 268 269 When Emacs first visits an Org file, the global state is set to 270 ‘showeverything’, i.e., all file content is visible. This can be 271 configured through the variable ‘org-startup-folded’, or on a per-file 272 basis by adding a ‘STARTUP’ keyword to ‘overview’, ‘content’, ‘showall’, 273 ‘showeverything’ or ‘show<n>levels’ (n = 2..5) like this: 274 275 #+STARTUP: content 276 277 278 File: orgguide.info, Node: Motion, Next: Structure Editing, Prev: Visibility Cycling, Up: Document Structure 279 280 2.3 Motion 281 ========== 282 283 The following commands jump to other headlines in the buffer. 284 285 ‘C-c C-n’ (‘org-next-visible-heading’) 286 Next heading. 287 ‘C-c C-p’ (‘org-previous-visible-heading’) 288 Previous heading. 289 290 ‘C-c C-f’ (‘org-backward-heading-same-level’) 291 Next heading same level. 292 293 ‘C-c C-b’ (‘outline-backward-same-level’) 294 Previous heading same level. 295 296 ‘C-c C-u’ (‘outline-up-heading’) 297 Backward to higher level heading. 298 299 300 File: orgguide.info, Node: Structure Editing, Next: Sparse Trees, Prev: Motion, Up: Document Structure 301 302 2.4 Structure Editing 303 ===================== 304 305 ‘M-<RET>’ (‘org-meta-return’) 306 Insert new heading with same level as current. If point is in a 307 plain list item, a new item is created (see *note Plain Lists::). 308 When this command is used in the middle of a line, the line is 309 split and the rest of the line becomes the new headline(1). 310 311 ‘M-S-<RET>’ (‘org-insert-todo-heading’) 312 Insert new TODO entry with same level as current heading. 313 314 ‘<TAB>’ (‘org-cycle’) in new 315 empty entry 316 In a new entry with no text yet, ‘<TAB>’ cycles through reasonable 317 levels. 318 319 ‘M-<LEFT>’ (‘org-metaleft’) 320 ‘M-<RIGHT>’ (‘org-metaright’) 321 Promote or demote current heading by one level. 322 323 ‘M-<UP>’ (‘org-move-subtree-up’) 324 ‘M-<DOWN>’ (‘org-move-subtree-down’) 325 Move subtree up or down, i.e., swap with previous or next subtree 326 of same level. 327 328 ‘C-c C-w’ (‘org-refile’) 329 Refile entry or region to a different location. See *note Refile 330 and Copy::. 331 332 ‘C-x n s’ (‘org-narrow-to-subtree’) 333 ‘C-x n w’ (‘widen’) 334 Narrow buffer to current subtree and widen it again. 335 336 When there is an active region (Transient Mark mode), promotion and 337 demotion work on all headlines in the region. 338 339 ---------- Footnotes ---------- 340 341 (1) If you do not want the line to be split, customize the variable 342 ‘org-M-RET-may-split-line’. 343 344 345 File: orgguide.info, Node: Sparse Trees, Next: Plain Lists, Prev: Structure Editing, Up: Document Structure 346 347 2.5 Sparse Trees 348 ================ 349 350 An important feature of Org mode is the ability to construct _sparse 351 trees_ for selected information in an outline tree, so that the entire 352 document is folded as much as possible, but the selected information is 353 made visible along with the headline structure above it(1). Just try it 354 out and you will see immediately how it works. 355 356 Org mode contains several commands creating such trees, all these 357 commands can be accessed through a dispatcher: 358 359 ‘C-c /’ (‘org-sparse-tree’) 360 This prompts for an extra key to select a sparse-tree creating 361 command. 362 363 ‘C-c / r’ (‘org-occur’) 364 Occur. Prompts for a regexp and shows a sparse tree with all 365 matches. Each match is also highlighted; the highlights disappear 366 by pressing ‘C-c C-c’. 367 368 The other sparse tree commands select headings based on TODO 369 keywords, tags, or properties and will be discussed later in this 370 manual. 371 372 ---------- Footnotes ---------- 373 374 (1) See also the variable ‘org-show-context-detail’ to decide how 375 much context is shown around each match. 376 377 378 File: orgguide.info, Node: Plain Lists, Prev: Sparse Trees, Up: Document Structure 379 380 2.6 Plain Lists 381 =============== 382 383 Within an entry of the outline tree, hand-formatted lists can provide 384 additional structure. They also provide a way to create lists of 385 checkboxes (see *note Checkboxes::). Org supports editing such lists, 386 and every exporter (see *note Exporting::) can parse and format them. 387 388 Org knows ordered lists, unordered lists, and description lists. 389 390 • _Unordered_ list items start with ‘-’, ‘+’, or ‘*’ as bullets. 391 392 • _Ordered_ list items start with ‘1.’, or ‘1)’. 393 394 • _Description_ list use ‘::’ to separate the _term_ from the 395 description. 396 397 Items belonging to the same list must have the same indentation on 398 the first line. An item ends before the next line that is indented like 399 its bullet/number, or less. A list ends when all items are closed, or 400 before two blank lines. An example: 401 402 * Lord of the Rings 403 My favorite scenes are (in this order) 404 1. The attack of the Rohirrim 405 2. Eowyn's fight with the witch king 406 + this was already my favorite scene in the book 407 + I really like Miranda Otto. 408 Important actors in this film are: 409 - Elijah Wood :: He plays Frodo 410 - Sean Astin :: He plays Sam, Frodo's friend. 411 412 The following commands act on items when point is in the first line 413 of an item (the line with the bullet or number). 414 415 ‘<TAB>’ (‘org-cycle’) 416 Items can be folded just like headline levels. 417 418 ‘M-<RET>’ (‘org-insert-heading’) 419 Insert new item at current level. With a prefix argument, force a 420 new heading (see *note Structure Editing::). 421 422 ‘M-S-<RET>’ (‘org-insert-todo-heading’) 423 Insert a new item with a checkbox (see *note Checkboxes::). 424 425 ‘M-<UP>’ (‘org-move-item-up’) 426 ‘M-<DOWN>’ (‘org-move-item-down’) 427 Move the item including subitems up/down (swap with previous/next 428 item of same indentation). If the list is ordered, renumbering is 429 automatic. 430 431 ‘M-<LEFT>’ (‘org-do-promote’) 432 ‘M-<RIGHT>’ (‘org-do-demote’) 433 Decrease/increase the indentation of an item, leaving children 434 alone. 435 436 ‘M-S-<LEFT>’ (‘org-promote-subtree’) 437 ‘M-S-<RIGHT>’ (‘org-demote-subtree’) 438 Decrease/increase the indentation of the item, including subitems. 439 440 ‘C-c C-c’ (‘org-toggle-checkbox’) 441 If there is a checkbox (see *note Checkboxes::) in the item line, 442 toggle the state of the checkbox. Also verify bullets and 443 indentation consistency in the whole list. 444 445 ‘C-c -’ (‘org-cycle-list-bullet’) 446 Cycle the entire list level through the different itemize/enumerate 447 bullets (‘-’, ‘+’, ‘*’, ‘1.’, ‘1)’). 448 449 450 File: orgguide.info, Node: Tables, Next: Hyperlinks, Prev: Document Structure, Up: Top 451 452 3 Tables 453 ******** 454 455 Org comes with a fast and intuitive table editor. Spreadsheet-like 456 calculations are supported in connection with the Emacs Calc package 457 (see *note GNU Emacs Calculator Manual: (calc)Top.). 458 459 Org makes it easy to format tables in plain ASCII. Any line with ‘|’ 460 as the first non-whitespace character is considered part of a table. 461 ‘|’ is also the column separator. A table might look like this: 462 463 | Name | Phone | Age | 464 |-------+-------+-----| 465 | Peter | 1234 | 17 | 466 | Anna | 4321 | 25 | 467 468 A table is re-aligned automatically each time you press ‘<TAB>’ or 469 ‘<RET>’ or ‘C-c C-c’ inside the table. ‘<TAB>’ also moves to the next 470 field (‘<RET>’ to the next row) and creates new table rows at the end of 471 the table or before horizontal lines. The indentation of the table is 472 set by the first line. Any line starting with ‘|-’ is considered as a 473 horizontal separator line and will be expanded on the next re-align to 474 span the whole table width. So, to create the above table, you would 475 only type 476 477 |Name|Phone|Age| 478 |- 479 480 and then press ‘<TAB>’ to align the table and start filling in fields. 481 Even faster would be to type ‘|Name|Phone|Age’ followed by ‘C-c <RET>’. 482 483 When typing text into a field, Org treats ‘<DEL>’, ‘Backspace’, and 484 all character keys in a special way, so that inserting and deleting 485 avoids shifting other fields. Also, when typing _immediately after 486 point was moved into a new field with ‘<TAB>’, ‘S-<TAB>’ or ‘<RET>’_, 487 the field is automatically made blank. 488 489 Creation and conversion 490 ======================= 491 492 ‘C-c |’ (‘org-table-create-or-convert-from-region’) 493 Convert the active region to table. If every line contains at 494 least one ‘<TAB>’ character, the function assumes that the material 495 is tab separated. If every line contains a comma, comma-separated 496 values (CSV) are assumed. If not, lines are split at whitespace 497 into fields. 498 499 If there is no active region, this command creates an empty Org 500 table. But it is easier just to start typing, like ‘| N a m e | P 501 h o n e | A g e <RET> | - <TAB>’. 502 503 Re-aligning and field motion 504 ============================ 505 506 ‘C-c C-c’ (‘org-table-align’) 507 Re-align the table without moving point. 508 509 ‘<TAB>’ (‘org-table-next-field’) 510 Re-align the table, move to the next field. Creates a new row if 511 necessary. 512 513 ‘S-<TAB>’ (‘org-table-previous-field’) 514 Re-align, move to previous field. 515 516 ‘<RET>’ (‘org-table-next-row’) 517 Re-align the table and move down to next row. Creates a new row if 518 necessary. 519 520 ‘S-<UP>’ (‘org-table-move-cell-up’) 521 ‘S-<DOWN>’ (‘org-table-move-cell-down’) 522 ‘S-<LEFT>’ (‘org-table-move-cell-left’) 523 ‘S-<RIGHT>’ (‘org-table-move-cell-right’) 524 Move a cell up, down, left, and right by swapping with adjacent 525 cell. 526 527 Column and row editing 528 ====================== 529 530 ‘M-<LEFT>’ (‘org-table-move-column-left’), ‘M-<RIGHT>’ (‘org-table-move-column-right’) 531 Move the current column left/right. 532 533 ‘M-S-<LEFT>’ (‘org-table-delete-column’) 534 Kill the current column. 535 536 ‘M-S-<RIGHT>’ (‘org-table-insert-column’) 537 Insert a new column to the left of point position. 538 539 ‘M-<UP>’ (‘org-table-move-row-up’), ‘M-<DOWN>’ (‘org-table-move-row-down’) 540 Move the current row up/down. 541 542 ‘M-S-<UP>’ (‘org-table-kill-row’) 543 Kill the current row or horizontal line. 544 545 ‘M-S-<DOWN>’ (‘org-table-insert-row’) 546 Insert a new row above the current row. With a prefix argument, 547 the line is created below the current one. 548 549 ‘C-c -’ (‘org-table-insert-hline’) 550 Insert a horizontal line below current row. With a prefix 551 argument, the line is created above the current line. 552 553 ‘C-c <RET>’ (‘org-table-hline-and-move’) 554 Insert a horizontal line below current row, and move the point into 555 the row below that line. 556 557 ‘C-c ^’ (‘org-table-sort-lines’) 558 Sort the table lines in the region. The position of point 559 indicates the column to be used for sorting, and the range of lines 560 is the range between the nearest horizontal separator lines, or the 561 entire table. 562 563 564 File: orgguide.info, Node: Hyperlinks, Next: TODO Items, Prev: Tables, Up: Top 565 566 4 Hyperlinks 567 ************ 568 569 Like HTML, Org provides links inside a file, external links to other 570 files, Usenet articles, emails, and much more. 571 572 Org recognizes plain URIs, possibly wrapped within angle brackets, 573 and activate them as clickable links. The general link format, however, 574 looks like this: 575 576 [[LINK][DESCRIPTION]] 577 578 or alternatively 579 580 [[LINK]] 581 582 Once a link in the buffer is complete, with all brackets present, Org 583 changes the display so that ‘DESCRIPTION’ is displayed instead of 584 ‘[[LINK][DESCRIPTION]]’ and ‘LINK’ is displayed instead of ‘[[LINK]]’. 585 To edit the invisible LINK part, use ‘C-c C-l’ with the point on the 586 link. 587 588 Internal links 589 ============== 590 591 If the link does not look like a URL, it is considered to be internal in 592 the current file. The most important case is a link like 593 ‘[[#my-custom-id]]’ which links to the entry with the ‘CUSTOM_ID’ 594 property ‘my-custom-id’. 595 596 Links such as ‘[[My Target]]’ or ‘[[My Target][Find my target]]’ lead 597 to a text search in the current file for the corresponding target, which 598 looks like ‘<<My Target>>’. 599 600 External Links 601 ============== 602 603 Org supports links to files, websites, Usenet and email messages, BBDB 604 database entries and links to both IRC conversations and their logs. 605 External links are URL-like locators. They start with a short 606 identifying string followed by a colon. There can be no space after the 607 colon. Here are some examples: 608 609 ‘http://www.astro.uva.nl/=dominik’ on the web 610 ‘file:/home/dominik/images/jupiter.jpg’ file, absolute path 611 ‘/home/dominik/images/jupiter.jpg’ same as above 612 ‘file:papers/last.pdf’ file, relative path 613 ‘./papers/last.pdf’ same as above 614 ‘file:projects.org’ another Org file 615 ‘docview:papers/last.pdf::NNN’ open in DocView mode at page NNN 616 ‘id:B7423F4D-2E8A-471B-8810-C40F074717E9’ link to heading by ID 617 ‘news:comp.emacs’ Usenet link 618 ‘mailto:adent@galaxy.net’ mail link 619 ‘mhe:folder#id’ MH-E message link 620 ‘rmail:folder#id’ Rmail message link 621 ‘gnus:group#id’ Gnus article link 622 ‘bbdb:R.*Stallman’ BBDB link (with regexp) 623 ‘irc:/irc.com/#emacs/bob’ IRC link 624 ‘info:org#Hyperlinks’ Info node link 625 626 File links can contain additional information to make Emacs jump to a 627 particular location in the file when following a link. This can be a 628 line number or a search option after a double colon. Here are a few 629 examples,, together with an explanation: 630 631 ‘file:~/code/main.c::255’ Find line 255 632 ‘file:~/xx.org::My Target’ Find ‘<<My Target>>’ 633 ‘[[file:~/xx.org::#my-custom-id]]’ Find entry with a custom ID 634 635 Handling Links 636 ============== 637 638 Org provides methods to create a link in the correct syntax, to insert 639 it into an Org file, and to follow the link. 640 641 The main function is ‘org-store-link’, called with ‘M-x 642 org-store-link’. Because of its importance, we suggest to bind it to a 643 widely available key (see *note Activation::). It stores a link to the 644 current location. The link is stored for later insertion into an Org 645 buffer—see below. 646 647 From an Org buffer, the following commands create, navigate or, more 648 generally, act on links. 649 650 ‘C-c C-l’ (‘org-insert-link’) 651 Insert a link. This prompts for a link to be inserted into the 652 buffer. You can just type a link, or use history keys ‘<UP>’ and 653 ‘<DOWN>’ to access stored links. You will be prompted for the 654 description part of the link. 655 656 When called with a ‘C-u’ prefix argument, file name completion is 657 used to link to a file. 658 659 ‘C-c C-l’ (with point on existing link) (‘org-insert-link’) 660 When point is on an existing link, ‘C-c C-l’ allows you to edit the 661 link and description parts of the link. 662 663 ‘C-c C-o’ (‘open-link-at-point’) 664 Open link at point. 665 666 ‘C-c &’ (‘org-mark-ring-goto’) 667 Jump back to a recorded position. A position is recorded by the 668 commands following internal links, and by ‘C-c %’. Using this 669 command several times in direct succession moves through a ring of 670 previously recorded positions. 671 672 673 File: orgguide.info, Node: TODO Items, Next: Tags, Prev: Hyperlinks, Up: Top 674 675 5 TODO Items 676 ************ 677 678 Org mode does not require TODO lists to live in separate documents. 679 Instead, TODO items are part of a notes file, because TODO items usually 680 come up while taking notes! With Org mode, simply mark any entry in a 681 tree as being a TODO item. In this way, information is not duplicated, 682 and TODO items remain in the context from which they emerged. 683 684 Org mode provides methods to give you an overview of all the things 685 that you have to do, collected from many files. 686 687 * Menu: 688 689 * TODO Basics:: Marking and displaying TODO entries. 690 * Multi-state Workflow:: More than just on/off. 691 * Progress Logging:: Dates and notes for progress. 692 * Priorities:: Some things are more important than others. 693 * Breaking Down Tasks:: Splitting a task into manageable pieces. 694 * Checkboxes:: Tick-off lists. 695 696 697 File: orgguide.info, Node: TODO Basics, Next: Multi-state Workflow, Up: TODO Items 698 699 5.1 Basic TODO Functionality 700 ============================ 701 702 Any headline becomes a TODO item when it starts with the word ‘TODO’, 703 for example: 704 705 *** TODO Write letter to Sam Fortune 706 707 The most important commands to work with TODO entries are: 708 709 ‘C-c C-t’ (‘org-todo’) 710 Rotate the TODO state of the current item among 711 712 ,-> (unmarked) -> TODO -> DONE --. 713 '--------------------------------' 714 715 The same rotation can also be done “remotely” from the agenda 716 buffer with the ‘t’ command key (see *note Agenda Commands::). 717 718 ‘S-<RIGHT>’ (‘org-shiftright’) 719 ‘S-<LEFT>’ (‘org-shiftleft’) 720 Select the following/preceding TODO state, similar to cycling. 721 722 ‘C-c / t’ (‘org-show-todo-tree’) 723 View TODO items in a _sparse tree_ (see *note Sparse Trees::). 724 Folds the entire buffer, but shows all TODO items—with not-DONE 725 state—and the headings hierarchy above them. 726 727 ‘M-x org-agenda t’ (‘org-todo-list’) 728 Show the global TODO list. Collects the TODO items (with not-DONE 729 states) from all agenda files (see *note Agenda Views::) into a 730 single buffer. See *note Global TODO List::, for more information. 731 732 ‘S-M-<RET>’ (‘org-insert-todo-heading’) 733 Insert a new TODO entry below the current one. 734 735 Changing a TODO state can also trigger tag changes. See the 736 docstring of the option ‘org-todo-state-tags-triggers’ for details. 737 738 739 File: orgguide.info, Node: Multi-state Workflow, Next: Progress Logging, Prev: TODO Basics, Up: TODO Items 740 741 5.2 Multi-state Workflow 742 ======================== 743 744 You can use TODO keywords to indicate _sequential_ working progress 745 states: 746 747 (setq org-todo-keywords 748 '((sequence "TODO" "FEEDBACK" "VERIFY" "|" "DONE" "DELEGATED"))) 749 750 The vertical bar separates the ‘TODO’ keywords (states that _need 751 action_) from the ‘DONE’ states (which need _no further action_). If 752 you do not provide the separator bar, the last state is used as the 753 ‘DONE’ state. With this setup, the command ‘C-c C-t’ cycles an entry 754 from ‘TODO’ to ‘FEEDBACK’, then to ‘VERIFY’, and finally to ‘DONE’ and 755 ‘DELEGATED’. 756 757 Sometimes you may want to use different sets of TODO keywords in 758 parallel. For example, you may want to have the basic ‘TODO=/=DONE’, 759 but also a workflow for bug fixing. Your setup would then look like 760 this: 761 762 (setq org-todo-keywords 763 '((sequence "TODO(t)" "|" "DONE(d)") 764 (sequence "REPORT(r)" "BUG(b)" "KNOWNCAUSE(k)" "|" "FIXED(f)"))) 765 766 The keywords should all be different, this helps Org mode to keep track 767 of which subsequence should be used for a given entry. The example also 768 shows how to define keys for fast access of a particular state, by 769 adding a letter in parenthesis after each keyword—you will be prompted 770 for the key after ‘C-c C-t’. 771 772 To define TODO keywords that are valid only in a single file, use the 773 following text anywhere in the file. 774 775 #+TODO: TODO(t) | DONE(d) 776 #+TODO: REPORT(r) BUG(b) KNOWNCAUSE(k) | FIXED(f) 777 #+TODO: | CANCELED(c) 778 779 After changing one of these lines, use ‘C-c C-c’ with the cursor 780 still in the line to make the changes known to Org mode. 781 782 783 File: orgguide.info, Node: Progress Logging, Next: Priorities, Prev: Multi-state Workflow, Up: TODO Items 784 785 5.3 Progress Logging 786 ==================== 787 788 To record a timestamp and a note when changing a TODO state, call the 789 command ‘org-todo’ with a prefix argument. 790 791 ‘C-u C-c C-t’ (‘org-todo’) 792 Prompt for a note and record a the time of the TODO state change. 793 794 Org mode can also automatically record a timestamp and optionally a 795 note when you mark a TODO item as DONE, or even each time you change the 796 state of a TODO item. This system is highly configurable, settings can 797 be on a per-keyword basis and can be localized to a file or even a 798 subtree. For information on how to clock working time for a task, see 799 *note Clocking Work Time::. 800 801 Closing items 802 ------------- 803 804 The most basic logging is to keep track of _when_ a certain TODO item 805 was marked as done. This can be achieved with(1) 806 807 (setq org-log-done 'time) 808 809 Then each time you turn an entry from a TODO (not-done) state into any 810 of the DONE states, a line ‘CLOSED: [timestamp]’ is inserted just after 811 the headline. 812 813 If you want to record a note along with the timestamp, use(2) 814 815 (setq org-log-done 'note) 816 817 You are then be prompted for a note, and that note is stored below the 818 entry with a ‘Closing Note’ heading. 819 820 Tracking TODO state changes 821 --------------------------- 822 823 You might want to keep track of TODO state changes. You can either 824 record just a timestamp, or a time-stamped note for a change. These 825 records are inserted after the headline as an itemized list. When 826 taking a lot of notes, you might want to get the notes out of the way 827 into a drawer. Customize the variable ‘org-log-into-drawer’ to get this 828 behavior. 829 830 For state logging, Org mode expects configuration on a per-keyword 831 basis. This is achieved by adding special markers ‘!’ (for a timestamp) 832 and ‘@’ (for a note) in parentheses after each keyword. For example: 833 834 #+TODO: TODO(t) WAIT(w@/!) | DONE(d!) CANCELED(c@) 835 836 defines TODO keywords and fast access keys, and also request that a time 837 is recorded when the entry is set to ‘DONE’, and that a note is recorded 838 when switching to ‘WAIT’ or ‘CANCELED’. The same syntax works also when 839 setting ‘org-todo-keywords’. 840 841 ---------- Footnotes ---------- 842 843 (1) The corresponding in-buffer setting is ‘#+STARTUP: logdone’. 844 845 (2) The corresponding in-buffer setting is ‘#+STARTUP: logenotedone’. 846 847 848 File: orgguide.info, Node: Priorities, Next: Breaking Down Tasks, Prev: Progress Logging, Up: TODO Items 849 850 5.4 Priorities 851 ============== 852 853 If you use Org mode extensively, you may end up with enough TODO items 854 that it starts to make sense to prioritize them. Prioritizing can be 855 done by placing a _priority cookie_ into the headline of a TODO item, 856 like this 857 858 *** TODO [#A] Write letter to Sam Fortune 859 860 Org mode supports three priorities: ‘A’, ‘B’, and ‘C’. ‘A’ is the 861 highest, ‘B’ the default if none is given. Priorities make a difference 862 only in the agenda. 863 864 ‘C-c ,’ (‘org-priority’) 865 Set the priority of the current headline. Press ‘A’, ‘B’ or ‘C’ to 866 select a priority, or ‘<SPC>’ to remove the cookie. 867 868 ‘S-<UP>’ (‘org-priority-up’) 869 ‘S-<DOWN>’ (‘org-priority-down’) 870 Increase/decrease the priority of the current headline. 871 872 873 File: orgguide.info, Node: Breaking Down Tasks, Next: Checkboxes, Prev: Priorities, Up: TODO Items 874 875 5.5 Breaking Tasks Down into Subtasks 876 ===================================== 877 878 It is often advisable to break down large tasks into smaller, manageable 879 subtasks. You can do this by creating an outline tree below a TODO 880 item, with detailed subtasks on the tree. To keep an overview of the 881 fraction of subtasks that have already been marked as done, insert 882 either ‘[/]’ or ‘[%]’ anywhere in the headline. These cookies are 883 updated each time the TODO status of a child changes, or when pressing 884 ‘C-c C-c’ on the cookie. For example: 885 886 * Organize Party [33%] 887 ** TODO Call people [1/2] 888 *** TODO Peter 889 *** DONE Sarah 890 ** TODO Buy food 891 ** DONE Talk to neighbor 892 893 894 File: orgguide.info, Node: Checkboxes, Prev: Breaking Down Tasks, Up: TODO Items 895 896 5.6 Checkboxes 897 ============== 898 899 Every item in a plain list (see *note Plain Lists::) can be made into a 900 checkbox by starting it with the string ‘[ ]’. Checkboxes are not 901 included into the global TODO list, so they are often great to split a 902 task into a number of simple steps. 903 904 Here is an example of a checkbox list. 905 906 * TODO Organize party [2/4] 907 - [-] call people [1/2] 908 - [ ] Peter 909 - [X] Sarah 910 - [X] order food 911 912 Checkboxes work hierarchically, so if a checkbox item has children 913 that are checkboxes, toggling one of the children checkboxes makes the 914 parent checkbox reflect if none, some, or all of the children are 915 checked. 916 917 The following commands work with checkboxes: 918 919 ‘C-c C-c’, ‘C-u C-c C-c’ (‘org-toggle-checkbox’) 920 Toggle checkbox status or—with prefix argument—checkbox presence at 921 point. 922 923 ‘M-S-<RET>’ (‘org-insert-todo-heading’) 924 Insert a new item with a checkbox. This works only if point is 925 already in a plain list item (see *note Plain Lists::). 926 927 928 File: orgguide.info, Node: Tags, Next: Properties, Prev: TODO Items, Up: Top 929 930 6 Tags 931 ****** 932 933 An excellent way to implement labels and contexts for cross-correlating 934 information is to assign _tags_ to headlines. Org mode has extensive 935 support for tags. 936 937 Every headline can contain a list of tags; they occur at the end of 938 the headline. Tags are normal words containing letters, numbers, ‘_’, 939 and ‘@’. Tags must be preceded and followed by a single colon, e.g., 940 ‘:work:’. Several tags can be specified, as in ‘:work:urgent:’. Tags 941 by default are in bold face with the same color as the headline. 942 943 Tag inheritance 944 =============== 945 946 Tags make use of the hierarchical structure of outline trees. If a 947 heading has a certain tag, all subheadings inherit the tag as well. For 948 example, in the list 949 950 * Meeting with the French group :work: 951 ** Summary by Frank :boss:notes: 952 *** TODO Prepare slides for him :action: 953 954 the final heading has the tags ‘work’, ‘boss’, ‘notes’, and ‘action’ 955 even though the final heading is not explicitly marked with those tags. 956 957 You can also set tags that all entries in a file should inherit just 958 as if these tags were defined in a hypothetical level zero that 959 surrounds the entire file. Use a line like this(1): 960 961 #+FILETAGS: :Peter:Boss:Secret: 962 963 Setting tags 964 ============ 965 966 Tags can simply be typed into the buffer at the end of a headline. 967 After a colon, ‘M-<TAB>’ offers completion on tags. There is also a 968 special command for inserting tags: 969 970 ‘C-c C-q’ (‘org-set-tags-command’) 971 Enter new tags for the current headline. Org mode either offers 972 completion or a special single-key interface for setting tags, see 973 below. 974 975 ‘C-c C-c’ (‘org-set-tags-command’) 976 When point is in a headline, this does the same as ‘C-c C-q’. 977 978 Org supports tag insertion based on a _list of tags_. By default 979 this list is constructed dynamically, containing all tags currently used 980 in the buffer. You may also globally specify a hard list of tags with 981 the variable ‘org-tag-alist’. Finally you can set the default tags for 982 a given file using the ‘TAGS’ keyword, like 983 984 #+TAGS: @work @home @tennisclub 985 #+TAGS: laptop car pc sailboat 986 987 By default Org mode uses the standard minibuffer completion 988 facilities for entering tags. However, it also implements another, 989 quicker, tag selection method called _fast tag selection_. This allows 990 you to select and deselect tags with just a single key press. For this 991 to work well you should assign unique letters to most of your commonly 992 used tags. You can do this globally by configuring the variable 993 ‘org-tag-alist’ in your Emacs init file. For example, you may find the 994 need to tag many items in different files with ‘@home’. In this case 995 you can set something like: 996 997 (setq org-tag-alist '(("@work" . ?w) ("@home" . ?h) ("laptop" . ?l))) 998 999 If the tag is only relevant to the file you are working on, then you 1000 can instead set the ‘TAGS’ keyword as: 1001 1002 #+TAGS: @work(w) @home(h) @tennisclub(t) laptop(l) pc(p) 1003 1004 Tag groups 1005 ========== 1006 1007 A tag can be defined as a _group tag_ for a set of other tags. The 1008 group tag can be seen as the “broader term” for its set of tags. 1009 1010 You can set group tags by using brackets and inserting a colon 1011 between the group tag and its related tags: 1012 1013 #+TAGS: [ GTD : Control Persp ] 1014 1015 or, if tags in the group should be mutually exclusive: 1016 1017 #+TAGS: { Context : @Home @Work } 1018 1019 When you search for a group tag, it return matches for all members in 1020 the group and its subgroups. In an agenda view, filtering by a group 1021 tag displays or hide headlines tagged with at least one of the members 1022 of the group or any of its subgroups. 1023 1024 If you want to ignore group tags temporarily, toggle group tags 1025 support with ‘org-toggle-tags-groups’, bound to ‘C-c C-x q’. 1026 1027 Tag searches 1028 ============ 1029 1030 ‘C-c / m’ or ‘C-c \’ (‘org-match-sparse-tree’) 1031 Create a sparse tree with all headlines matching a tags search. 1032 With a ‘C-u’ prefix argument, ignore headlines that are not a TODO 1033 line. 1034 1035 ‘M-x org-agenda m’ (‘org-tags-view’) 1036 Create a global list of tag matches from all agenda files. See 1037 *note Matching Tags and Properties::. 1038 1039 ‘M-x org-agenda M’ (‘org-tags-view’) 1040 Create a global list of tag matches from all agenda files, but 1041 check only TODO items. 1042 1043 These commands all prompt for a match string which allows basic 1044 Boolean logic like ‘+boss+urgent-project1’, to find entries with tags 1045 ‘boss’ and ‘urgent’, but not ‘project1’, or ‘Kathy|Sally’ to find 1046 entries which are tagged, like ‘Kathy’ or ‘Sally’. The full syntax of 1047 the search string is rich and allows also matching against TODO 1048 keywords, entry levels and properties. For a more detailed description 1049 with many examples, see *note Matching Tags and Properties::. 1050 1051 ---------- Footnotes ---------- 1052 1053 (1) As with all these in-buffer settings, pressing ‘C-c C-c’ 1054 activates any changes in the line. 1055 1056 1057 File: orgguide.info, Node: Properties, Next: Dates and Times, Prev: Tags, Up: Top 1058 1059 7 Properties 1060 ************ 1061 1062 Properties are key-value pairs associated with an entry. They live in a 1063 special drawer with the name ‘PROPERTIES’. Each property is specified 1064 on a single line, with the key (surrounded by colons) first, and the 1065 value after it: 1066 1067 * CD collection 1068 ** Classic 1069 *** Goldberg Variations 1070 :PROPERTIES: 1071 :Title: Goldberg Variations 1072 :Composer: J.S. Bach 1073 :Publisher: Deutsche Grammophon 1074 :NDisks: 1 1075 :END: 1076 1077 You may define the allowed values for a particular property ‘Xyz’ by 1078 setting a property ‘Xyz_ALL’. This special property is _inherited_, so 1079 if you set it in a level 1 entry, it applies to the entire tree. When 1080 allowed values are defined, setting the corresponding property becomes 1081 easier and is less prone to typing errors. For the example with the CD 1082 collection, we can pre-define publishers and the number of disks in a 1083 box like this: 1084 1085 * CD collection 1086 :PROPERTIES: 1087 :NDisks_ALL: 1 2 3 4 1088 :Publisher_ALL: "Deutsche Grammophon" Philips EMI 1089 :END: 1090 1091 If you want to set properties that can be inherited by any entry in a 1092 file, use a line like: 1093 1094 #+PROPERTY: NDisks_ALL 1 2 3 4 1095 1096 The following commands help to work with properties: 1097 1098 ‘C-c C-x p’ (‘org-set-property’) 1099 Set a property. This prompts for a property name and a value. 1100 1101 ‘C-c C-c d’ (‘org-delete-property’) 1102 Remove a property from the current entry. 1103 1104 To create sparse trees and special lists with selection based on 1105 properties, the same commands are used as for tag searches (see *note 1106 Tags::). The syntax for the search string is described in *note 1107 Matching Tags and Properties::. 1108 1109 1110 File: orgguide.info, Node: Dates and Times, Next: Capture Refile Archive, Prev: Properties, Up: Top 1111 1112 8 Dates and Times 1113 ***************** 1114 1115 To assist project planning, TODO items can be labeled with a date and/or 1116 a time. The specially formatted string carrying the date and time 1117 information is called a _timestamp_ in Org mode. This may be a little 1118 confusing because timestamp is often used as indicating when something 1119 was created or last changed. However, in Org mode this term is used in 1120 a much wider sense. 1121 1122 Timestamps can be used to plan appointments, schedule tasks, set 1123 deadlines, track time, and more. The following sections describe the 1124 timestamp format and tooling that Org mode provides for common use cases 1125 dealing with time and time intervals. 1126 1127 * Menu: 1128 1129 * Timestamps:: Assigning a time to a tree entry. 1130 * Creating Timestamps:: Commands that insert timestamps. 1131 * Deadlines and Scheduling:: Planning your work. 1132 * Clocking Work Time:: Tracking how long you spent on a task. 1133 1134 1135 File: orgguide.info, Node: Timestamps, Next: Creating Timestamps, Up: Dates and Times 1136 1137 8.1 Timestamps 1138 ============== 1139 1140 A timestamp is a specification of a date—possibly with a time or a range 1141 of times—in a special format, either ‘<2003-09-16 Tue>’ or ‘<2003-09-16 1142 Tue 09:39>’ or ‘<2003-09-16 Tue 12:00-12:30>’. A timestamp can appear 1143 anywhere in the headline or body of an Org tree entry. Its presence 1144 causes entries to be shown on specific dates in the agenda (see *note 1145 Built-in Agenda Views::). We distinguish: 1146 1147 Plain timestamp; Event; Appointment 1148 A simple timestamp just assigns a date/time to an item. This is 1149 just like writing down an appointment or event in a paper agenda. 1150 There can be multiple timestamps in an item. 1151 1152 * Meet Peter at the movies 1153 <2006-11-01 Wed 19:15> 1154 * Discussion on climate change 1155 <2006-11-02 Thu 20:00-22:00> 1156 * My days off 1157 <2006-11-03 Fri> 1158 <2006-11-06 Mon> 1159 1160 Timestamp with repeater interval 1161 A timestamp may contain a _repeater interval_, indicating that it 1162 applies not only on the given date, but again and again after a 1163 certain interval of N hours (h), days (d), weeks (w), months (m), 1164 or years (y). The following shows up in the agenda every 1165 Wednesday: 1166 1167 * Pick up Sam at school 1168 <2007-05-16 Wed 12:30 +1w> 1169 1170 Diary-style expression entries 1171 For more complex date specifications, Org mode supports using the 1172 special expression diary entries implemented in the Emacs Calendar 1173 package. For example, with optional time: 1174 1175 * 22:00-23:00 The nerd meeting on every 2nd Thursday of the month 1176 <%%(diary-float t 4 2)> 1177 1178 Time range 1179 Time range is a timestamp having two time units connected by ‘-’ 1180 1181 * Discussion on climate change 1182 <2006-11-02 Thu 10:00-12:00> 1183 1184 Time/Date range 1185 Two timestamps connected by ‘--’ denote a range. In the agenda, 1186 the headline is shown on the first and last day of the range, and 1187 on any dates that are displayed and fall in the range. The first 1188 example specifies just the dates of the range while the second 1189 example specifies a time range for each date. 1190 1191 ** Meeting in Amsterdam 1192 <2004-08-23 Mon>--<2004-08-26 Thu> 1193 ** This weeks committee meetings 1194 <2004-08-23 Mon 10:00-11:00>--<2004-08-26 Thu 10:00-11:00> 1195 1196 Inactive timestamp 1197 Just like a plain timestamp, but with square brackets instead of 1198 angular ones. These timestamps are inactive in the sense that they 1199 do _not_ trigger an entry to show up in the agenda. 1200 1201 * Gillian comes late for the fifth time 1202 [2006-11-01 Wed] 1203 1204 1205 File: orgguide.info, Node: Creating Timestamps, Next: Deadlines and Scheduling, Prev: Timestamps, Up: Dates and Times 1206 1207 8.2 Creating Timestamps 1208 ======================= 1209 1210 For Org mode to recognize timestamps, they need to be in the specific 1211 format. All commands listed below produce timestamps in the correct 1212 format. 1213 1214 ‘C-c .’ (‘org-timestamp’) 1215 Prompt for a date and insert a corresponding timestamp. When point 1216 is at an existing timestamp in the buffer, the command is used to 1217 modify this timestamp instead of inserting a new one. When this 1218 command is used twice in succession, a time range is inserted. 1219 With a prefix argument, it also adds the current time. 1220 1221 ‘C-c !’ (‘org-timestamp-inactive’) 1222 Like ‘C-c .’, but insert an inactive timestamp that does not cause 1223 an agenda entry. 1224 1225 ‘S-<LEFT>’ (‘org-timestamp-down-day’) 1226 ‘S-<RIGHT>’ (‘org-timestamp-up-day’) 1227 Change date at point by one day. 1228 1229 ‘S-<UP>’ (‘org-timestamp-up’) 1230 ‘S-<DOWN>’ (‘org-timestamp-down’) 1231 On the beginning or enclosing bracket of a timestamp, change its 1232 type. Within a timestamp, change the item under point. Point can 1233 be on a year, month, day, hour or minute. When the timestamp 1234 contains a time range like ‘15:30-16:30’, modifying the first time 1235 also shifts the second, shifting the time block with constant 1236 length. To change the length, modify the second time. 1237 1238 When Org mode prompts for a date/time, it accepts any string 1239 containing some date and/or time information, and intelligently 1240 interprets the string, deriving defaults for unspecified information 1241 from the current date and time. You can also select a date in the 1242 pop-up calendar. See the *note manual: (org)Top. for more information 1243 on how exactly the date/time prompt works. 1244 1245 1246 File: orgguide.info, Node: Deadlines and Scheduling, Next: Clocking Work Time, Prev: Creating Timestamps, Up: Dates and Times 1247 1248 8.3 Deadlines and Scheduling 1249 ============================ 1250 1251 A timestamp may be preceded by special keywords to facilitate planning: 1252 1253 ‘C-c C-d’ (‘org-deadline’) 1254 Insert ‘DEADLINE’ keyword along with a time stamp, in the line 1255 following the headline. 1256 1257 Meaning: the task—most likely a TODO item, though not 1258 necessarily—is supposed to be finished on that date. 1259 1260 On the deadline date, the task is listed in the agenda. In 1261 addition, the agenda for _today_ carries a warning about the 1262 approaching or missed deadline, starting 1263 ‘org-deadline-warning-days’ before the due date, and continuing 1264 until the entry is marked as done. An example: 1265 1266 *** TODO write article about the Earth for the Guide 1267 DEADLINE: <2004-02-29 Sun> 1268 The editor in charge is [[bbdb:Ford Prefect]] 1269 1270 ‘C-c C-s’ (‘org-schedule’) 1271 Insert ‘SCHEDULED’ keyword along with a stamp, in the line 1272 following the headline. 1273 1274 Meaning: you are planning to start working on that task on the 1275 given date(1). 1276 1277 The headline is listed under the given date(2). In addition, a 1278 reminder that the scheduled date has passed is present in the 1279 compilation for _today_, until the entry is marked as done, i.e., 1280 the task is automatically forwarded until completed. 1281 1282 *** TODO Call Trillian for a date on New Years Eve. 1283 SCHEDULED: <2004-12-25 Sat> 1284 1285 Some tasks need to be repeated again and again. Org mode helps to 1286 organize such tasks using a so-called repeater in a ‘DEADLINE’, 1287 ‘SCHEDULED’, or plain timestamps. In the following example: 1288 1289 ** TODO Pay the rent 1290 DEADLINE: <2005-10-01 Sat +1m> 1291 1292 the ‘+1m’ is a repeater; the intended interpretation is that the task 1293 has a deadline on ‘<2005-10-01>’ and repeats itself every (one) month 1294 starting from that time. 1295 1296 ---------- Footnotes ---------- 1297 1298 (1) This is quite different from what is normally understood by 1299 _scheduling a meeting_, which is done in Org by just inserting a time 1300 stamp without keyword. 1301 1302 (2) It will still be listed on that date after it has been marked as 1303 done. If you do not like this, set the variable 1304 ‘org-agenda-skip-scheduled-if-done’. 1305 1306 1307 File: orgguide.info, Node: Clocking Work Time, Prev: Deadlines and Scheduling, Up: Dates and Times 1308 1309 8.4 Clocking Work Time 1310 ====================== 1311 1312 Org mode allows you to clock the time you spend on specific tasks in a 1313 project. 1314 1315 ‘C-c C-x C-i’ (‘org-clock-in’) 1316 Start the clock on the current item (clock-in). This inserts the 1317 ‘CLOCK’ keyword together with a timestamp. When called with a 1318 ‘C-u’ prefix argument, select the task from a list of recently 1319 clocked tasks. 1320 1321 ‘C-c C-x C-o’ (‘org-clock-out’) 1322 Stop the clock (clock-out). This inserts another timestamp at the 1323 same location where the clock was last started. It also directly 1324 computes the resulting time in inserts it after the time range as 1325 ‘=>HH:MM’. 1326 1327 ‘C-c C-x C-e’ (‘org-clock-modify-effort-estimate’) 1328 Update the effort estimate for the current clock task. 1329 1330 ‘C-c C-x C-q’ (‘org-clock-cancel’) 1331 Cancel the current clock. This is useful if a clock was started by 1332 mistake, or if you ended up working on something else. 1333 1334 ‘C-c C-x C-j’ (‘org-clock-goto’) 1335 Jump to the headline of the currently clocked in task. With a 1336 ‘C-u’ prefix argument, select the target task from a list of 1337 recently clocked tasks. 1338 1339 The ‘l’ key may be used in the agenda (see *note Built-in Agenda 1340 Views::) to show which tasks have been worked on or closed during a day. 1341 1342 1343 File: orgguide.info, Node: Capture Refile Archive, Next: Agenda Views, Prev: Dates and Times, Up: Top 1344 1345 9 Capture, Refile, Archive 1346 ************************** 1347 1348 An important part of any organization system is the ability to quickly 1349 capture new ideas and tasks, and to associate reference material with 1350 them. Org does this using a process called _capture_. It also can 1351 store files related to a task (_attachments_) in a special directory. 1352 Once in the system, tasks and projects need to be moved around. Moving 1353 completed project trees to an archive file keeps the system compact and 1354 fast. 1355 1356 * Menu: 1357 1358 * Capture:: Capturing new stuff. 1359 * Refile and Copy:: Moving/copying a tree from one place to another. 1360 * Archiving:: What to do with finished products. 1361 1362 1363 File: orgguide.info, Node: Capture, Next: Refile and Copy, Up: Capture Refile Archive 1364 1365 9.1 Capture 1366 =========== 1367 1368 Capture lets you quickly store notes with little interruption of your 1369 work flow. You can define templates for new entries and associate them 1370 with different targets for storing notes. 1371 1372 Setting up capture 1373 ------------------ 1374 1375 The following customization sets a default target(1) file for notes. 1376 1377 (setq org-default-notes-file (concat org-directory "/notes.org")) 1378 1379 You may also define a global key for capturing new material (see 1380 *note Activation::). 1381 1382 Using capture 1383 ------------- 1384 1385 ‘M-x org-capture’ (‘org-capture’) 1386 Start a capture process, placing you into a narrowed indirect 1387 buffer to edit. 1388 1389 ‘C-c C-c’ (‘org-capture-finalize’) 1390 Once you have finished entering information into the capture 1391 buffer, ‘C-c C-c’ returns you to the window configuration before 1392 the capture process, so that you can resume your work without 1393 further distraction. 1394 1395 ‘C-c C-w’ (‘org-capture-refile’) 1396 Finalize the capture process by refiling the note to a different 1397 place (see *note Refile and Copy::). 1398 1399 ‘C-c C-k’ (‘org-capture-kill’) 1400 Abort the capture process and return to the previous state. 1401 1402 Capture templates 1403 ----------------- 1404 1405 You can use templates for different types of capture items, and for 1406 different target locations. Say you would like to use one template to 1407 create general TODO entries, and you want to put these entries under the 1408 heading ‘Tasks’ in your file ‘~/org/gtd.org’. Also, a date tree in the 1409 file ‘journal.org’ should capture journal entries. A possible 1410 configuration would look like: 1411 1412 (setq org-capture-templates 1413 '(("t" "Todo" entry (file+headline "~/org/gtd.org" "Tasks") 1414 "* TODO %?\n %i\n %a") 1415 ("j" "Journal" entry (file+datetree "~/org/journal.org") 1416 "* %?\nEntered on %U\n %i\n %a"))) 1417 1418 If you then press ‘t’ from the capture menu, Org will prepare the 1419 template for you like this: 1420 1421 * TODO 1422 [[file:LINK TO WHERE YOU INITIATED CAPTURE]] 1423 1424 During expansion of the template, special %-escapes(2) allow dynamic 1425 insertion of content. Here is a small selection of the possibilities, 1426 consult the *note manual: (org)Top. for more. 1427 1428 ‘%a’ annotation, normally the link created with ‘org-store-link’ 1429 ‘%i’ initial content, the region when capture is called with ‘C-u’ 1430 ‘%t’, ‘%T’ timestamp, date only, or date and time 1431 ‘%u’, ‘%U’ like above, but inactive timestamps 1432 ‘%?’ after completing the template, position point here 1433 1434 ---------- Footnotes ---------- 1435 1436 (1) Using capture templates, you get finer control over capture 1437 locations. See *note Capture templates::. 1438 1439 (2) If you need one of these sequences literally, escape the ‘%’ with 1440 a backslash. 1441 1442 1443 File: orgguide.info, Node: Refile and Copy, Next: Archiving, Prev: Capture, Up: Capture Refile Archive 1444 1445 9.2 Refile and Copy 1446 =================== 1447 1448 When reviewing the captured data, you may want to refile or to copy some 1449 of the entries into a different list, for example into a project. 1450 Cutting, finding the right location, and then pasting the note is 1451 cumbersome. To simplify this process, you can use the following special 1452 command: 1453 1454 ‘C-c C-w’ (‘org-agenda-refile’) 1455 Refile the entry or region at point. This command offers possible 1456 locations for refiling the entry and lets you select one with 1457 completion. The item (or all items in the region) is filed below 1458 the target heading as a subitem. 1459 1460 By default, all level 1 headlines in the current buffer are 1461 considered to be targets, but you can have more complex definitions 1462 across a number of files. See the variable ‘org-refile-targets’ 1463 for details. 1464 1465 ‘C-u C-c C-w’ (‘org-agenda-refile’) 1466 Use the refile interface to jump to a heading. 1467 1468 ‘C-u C-u C-c C-w’ (‘org-refile-goto-last-stored’) 1469 Jump to the location where ‘org-refile’ last moved a tree to. 1470 1471 ‘C-c M-w’ (‘org-refile-copy’) 1472 Copying works like refiling, except that the original note is not 1473 deleted. 1474 1475 1476 File: orgguide.info, Node: Archiving, Prev: Refile and Copy, Up: Capture Refile Archive 1477 1478 9.3 Archiving 1479 ============= 1480 1481 When a project represented by a (sub)tree is finished, you may want to 1482 move the tree out of the way and to stop it from contributing to the 1483 agenda. Archiving is important to keep your working files compact and 1484 global searches like the construction of agenda views fast. 1485 1486 The most common archiving action is to move a project tree to another 1487 file, the archive file. 1488 1489 ‘C-c C-x C-a’ (‘org-archive-subtree-default’) 1490 Archive the current entry using the command specified in the 1491 variable ‘org-archive-default-command’. 1492 1493 ‘C-c C-x C-s’ or short ‘C-c $’ (‘org-archive-subtree’) 1494 Archive the subtree starting at point position to the location 1495 given by ‘org-archive-location’. 1496 1497 The default archive location is a file in the same directory as the 1498 current file, with the name derived by appending ‘_archive’ to the 1499 current file name. You can also choose what heading to file archived 1500 items under, with the possibility to add them to a datetree in a file. 1501 For information and examples on how to specify the file and the heading, 1502 see the documentation string of the variable ‘org-archive-location’. 1503 1504 There is also an in-buffer option for setting this variable, for 1505 example: 1506 1507 #+ARCHIVE: %s_done:: 1508 1509 1510 File: orgguide.info, Node: Agenda Views, Next: Markup, Prev: Capture Refile Archive, Up: Top 1511 1512 10 Agenda Views 1513 *************** 1514 1515 Due to the way Org works, TODO items, time-stamped items, and tagged 1516 headlines can be scattered throughout a file or even a number of files. 1517 To get an overview of open action items, or of events that are important 1518 for a particular date, this information must be collected, sorted and 1519 displayed in an organized way. 1520 1521 The extracted information is displayed in a special _agenda buffer_. 1522 This buffer is read-only, but provides commands to visit the 1523 corresponding locations in the original Org files, and even to edit 1524 these files remotely. Remote editing from the agenda buffer means, for 1525 example, that you can change the dates of deadlines and appointments 1526 from the agenda buffer. For commands available in the Agenda buffer, 1527 see *note Agenda Commands::. 1528 1529 * Menu: 1530 1531 * Agenda Files:: Files being searched for agenda information. 1532 * Agenda Dispatcher:: Keyboard access to agenda views. 1533 * Built-in Agenda Views:: What is available out of the box? 1534 * Global TODO List:: All unfinished action items. 1535 * Matching Tags and Properties:: Structured information with fine-tuned search. 1536 * Search View:: Find entries by searching for text. 1537 * Agenda Commands:: Remote editing of Org trees. 1538 * Custom Agenda Views:: Defining special searches and views. 1539 1540 1541 File: orgguide.info, Node: Agenda Files, Next: Agenda Dispatcher, Up: Agenda Views 1542 1543 10.1 Agenda Files 1544 ================= 1545 1546 The information to be shown is normally collected from all _agenda 1547 files_, the files listed in the variable ‘org-agenda-files’. 1548 1549 ‘C-c [’ (‘org-agenda-file-to-front’) 1550 Add current file to the list of agenda files. The file is added to 1551 the front of the list. If it was already in the list, it is moved 1552 to the front. With a prefix argument, file is added/moved to the 1553 end. 1554 1555 ‘C-c ]’ (‘org-remove-file’) 1556 Remove current file from the list of agenda files. 1557 1558 ‘C-'’ 1559 ‘C-,’ (‘org-cycle-agenda-files’) 1560 Cycle through agenda file list, visiting one file after the other. 1561 1562 1563 File: orgguide.info, Node: Agenda Dispatcher, Next: Built-in Agenda Views, Prev: Agenda Files, Up: Agenda Views 1564 1565 10.2 The Agenda Dispatcher 1566 ========================== 1567 1568 The views are created through a dispatcher, accessible with ‘M-x 1569 org-agenda’, or, better, bound to a global key (see *note Activation::). 1570 It displays a menu from which an additional letter is required to 1571 execute a command. The dispatcher offers the following default 1572 commands: 1573 1574 ‘a’ 1575 Create the calendar-like agenda (see *note Built-in Agenda 1576 Views::). 1577 1578 ‘t’ 1579 ‘T’ 1580 Create a list of all TODO items (see *note Global TODO List::). 1581 1582 ‘m’ 1583 ‘M’ 1584 Create a list of headlines matching a given expression (see *note 1585 Matching Tags and Properties::). 1586 1587 ‘s’ 1588 Create a list of entries selected by a boolean expression of 1589 keywords and/or regular expressions that must or must not occur in 1590 the entry. 1591 1592 1593 File: orgguide.info, Node: Built-in Agenda Views, Next: Global TODO List, Prev: Agenda Dispatcher, Up: Agenda Views 1594 1595 10.3 The Weekly/Daily Agenda 1596 ============================ 1597 1598 The purpose of the weekly/daily _agenda_ is to act like a page of a 1599 paper agenda, showing all the tasks for the current week or day. 1600 1601 ‘M-x org-agenda a’ (‘org-agenda-list’) 1602 Compile an agenda for the current week from a list of Org files. 1603 The agenda shows the entries for each day. 1604 1605 Org mode understands the syntax of the diary and allows you to use 1606 diary expression entries directly in Org files: 1607 1608 * Holidays 1609 :PROPERTIES: 1610 :CATEGORY: Holiday 1611 :END: 1612 %%(org-calendar-holiday) ; special function for holiday names 1613 1614 * Birthdays 1615 :PROPERTIES: 1616 :CATEGORY: Ann 1617 :END: 1618 %%(org-anniversary 1956 5 14) Arthur Dent is %d years old 1619 %%(org-anniversary 1869 10 2) Mahatma Gandhi would be %d years old 1620 1621 Org can interact with Emacs appointments notification facility. To 1622 add the appointments of your agenda files, use the command 1623 ‘org-agenda-to-appt’. 1624 1625 1626 File: orgguide.info, Node: Global TODO List, Next: Matching Tags and Properties, Prev: Built-in Agenda Views, Up: Agenda Views 1627 1628 10.4 The Global TODO List 1629 ========================= 1630 1631 The global TODO list contains all unfinished TODO items formatted and 1632 collected into a single place. Remote editing of TODO items lets you 1633 can change the state of a TODO entry with a single key press. For 1634 commands available in the TODO list, see *note Agenda Commands::. 1635 1636 ‘M-x org-agenda t’ (‘org-todo-list’) 1637 Show the global TODO list. This collects the TODO items from all 1638 agenda files (see *note Agenda Views::) into a single buffer. 1639 1640 ‘M-x org-agenda T’ (‘org-todo-list’) 1641 Like the above, but allows selection of a specific TODO keyword. 1642 1643 1644 File: orgguide.info, Node: Matching Tags and Properties, Next: Search View, Prev: Global TODO List, Up: Agenda Views 1645 1646 10.5 Matching Tags and Properties 1647 ================================= 1648 1649 If headlines in the agenda files are marked with _tags_ (see *note 1650 Tags::), or have properties (see *note Properties::), you can select 1651 headlines based on this metadata and collect them into an agenda buffer. 1652 The match syntax described here also applies when creating sparse trees 1653 with ‘C-c / m’. 1654 1655 ‘M-x org-agenda m’ (‘org-tags-view’) 1656 Produce a list of all headlines that match a given set of tags. 1657 The command prompts for a selection criterion, which is a boolean 1658 logic expression with tags, like ‘+work+urgent-withboss’ or 1659 ‘work|home’ (see *note Tags::). If you often need a specific 1660 search, define a custom command for it (see *note Agenda 1661 Dispatcher::). 1662 1663 ‘M-x org-agenda M’ (‘org-tags-view’) 1664 Like ‘m’, but only select headlines that are also TODO items. 1665 1666 A search string can use Boolean operators ‘&’ for AND and ‘|’ for OR. 1667 ‘&’ binds more strongly than ‘|’. Parentheses are currently not 1668 implemented. Each element in the search is either a tag, a regular 1669 expression matching tags, or an expression like ‘PROPERTY OPERATOR 1670 VALUE’ with a comparison operator, accessing a property value. Each 1671 element may be preceded by ‘-’ to select against it, and ‘+’ is 1672 syntactic sugar for positive selection. The AND operator ‘&’ is 1673 optional when ‘+’ or ‘-’ is present. Here are some examples, using only 1674 tags. 1675 1676 ‘+work-boss’ 1677 Select headlines tagged ‘work’, but discard those also tagged 1678 ‘boss’. 1679 1680 ‘work|laptop’ 1681 Selects lines tagged ‘work’ or ‘laptop’. 1682 1683 ‘work|laptop+night’ 1684 Like before, but require the ‘laptop’ lines to be tagged also 1685 ‘night’. 1686 1687 You may also test for properties at the same time as matching tags, 1688 see the *note manual: (org)Top. for more information. 1689 1690 1691 File: orgguide.info, Node: Search View, Next: Agenda Commands, Prev: Matching Tags and Properties, Up: Agenda Views 1692 1693 10.6 Search View 1694 ================ 1695 1696 This agenda view is a general text search facility for Org mode entries. 1697 It is particularly useful to find notes. 1698 1699 ‘M-x org-agenda s’ (‘org-search-view’) 1700 This is a special search that lets you select entries by matching a 1701 substring or specific words using a boolean logic. 1702 1703 For example, the search string ‘computer equipment’ matches entries 1704 that contain ‘computer equipment’ as a substring. 1705 1706 Search view can also search for specific keywords in the entry, using 1707 Boolean logic. The search string ‘+computer +wifi -ethernet 1708 -{8\.11[bg]}’ matches note entries that contain the keywords ‘computer’ 1709 and ‘wifi’, but not the keyword ‘ethernet’, and which are also not 1710 matched by the regular expression ‘8\.11[bg]’, meaning to exclude both 1711 ‘8.11b’ and ‘8.11g’. 1712 1713 Note that in addition to the agenda files, this command also searches 1714 the files listed in ‘org-agenda-text-search-extra-files’. 1715 1716 1717 File: orgguide.info, Node: Agenda Commands, Next: Custom Agenda Views, Prev: Search View, Up: Agenda Views 1718 1719 10.7 Commands in the Agenda Buffer 1720 ================================== 1721 1722 Entries in the agenda buffer are linked back to the Org file or diary 1723 file where they originate. You are not allowed to edit the agenda 1724 buffer itself, but commands are provided to show and jump to the 1725 original entry location, and to edit the Org files “remotely” from the 1726 agenda buffer. This is just a selection of the many commands, explore 1727 the agenda menu and the *note manual: (org)Top. for a complete list. 1728 1729 Motion 1730 ------ 1731 1732 ‘n’ (‘org-agenda-next-line’) 1733 Next line (same as ‘<DOWN>’ and ‘C-n’). 1734 1735 ‘p’ (‘org-agenda-previous-line’) 1736 Previous line (same as ‘<UP>’ and ‘C-p’). 1737 1738 View/Go to Org file 1739 ------------------- 1740 1741 ‘<SPC>’ (‘org-agenda-show-and-scroll-up’) 1742 Display the original location of the item in another window. With 1743 a prefix argument, make sure that drawers stay folded. 1744 1745 ‘<TAB>’ (‘org-agenda-goto’) 1746 Go to the original location of the item in another window. 1747 1748 ‘<RET>’ (‘org-agenda-switch-to’) 1749 Go to the original location of the item and delete other windows. 1750 1751 Change display 1752 -------------- 1753 1754 ‘o’ (‘delete-other-windows’) 1755 Delete other windows. 1756 1757 ‘v d’ or short ‘d’ (‘org-agenda-day-view’) 1758 Switch to day view. 1759 1760 ‘v w’ or short ‘w’ (‘org-agenda-week-view’) 1761 Switch to week view. 1762 1763 ‘f’ (‘org-agenda-later’) 1764 Go forward in time to display the span following the current one. 1765 For example, if the display covers a week, switch to the following 1766 week. 1767 1768 ‘b’ (‘org-agenda-earlier’) 1769 Go backward in time to display earlier dates. 1770 1771 ‘.’ (‘org-agenda-goto-today’) 1772 Go to today. 1773 1774 ‘j’ (‘org-agenda-goto-date’) 1775 Prompt for a date and go there. 1776 1777 ‘v l’ or ‘v L’ or short ‘l’ (‘org-agenda-log-mode’) 1778 Toggle Logbook mode. In Logbook mode, entries that were marked as 1779 done while logging was on (see the variable ‘org-log-done’) are 1780 shown in the agenda, as are entries that have been clocked on that 1781 day. When called with a ‘C-u’ prefix argument, show all possible 1782 logbook entries, including state changes. 1783 1784 ‘r’ 1785 ‘g’ (‘org-agenda-redo’) 1786 Recreate the agenda buffer, for example to reflect the changes 1787 after modification of the timestamps of items. 1788 1789 ‘s’ (‘org-save-all-org-buffers’) 1790 Save all Org buffers in the current Emacs session, and also the 1791 locations of IDs. 1792 1793 Remote editing 1794 -------------- 1795 1796 ‘0--9’ 1797 Digit argument. 1798 1799 ‘t’ (‘org-agenda-todo’) 1800 Change the TODO state of the item, both in the agenda and in the 1801 original Org file. 1802 1803 ‘C-k’ (‘org-agenda-kill’) 1804 Delete the current agenda item along with the entire subtree 1805 belonging to it in the original Org file. 1806 1807 ‘C-c C-w’ (‘org-agenda-refile’) 1808 Refile the entry at point. 1809 1810 ‘a’ (‘org-agenda-archive-default-with-confirmation’) 1811 Archive the subtree corresponding to the entry at point using the 1812 default archiving command set in ‘org-archive-default-command’. 1813 1814 ‘$’ (‘org-agenda-archive’) 1815 Archive the subtree corresponding to the current headline. 1816 1817 ‘C-c C-s’ (‘org-agenda-schedule’) 1818 Schedule this item. With a prefix argument, remove the scheduling 1819 timestamp 1820 1821 ‘C-c C-d’ (‘org-agenda-deadline’) 1822 Set a deadline for this item. With a prefix argument, remove the 1823 deadline. 1824 1825 ‘S-<RIGHT>’ (‘org-agenda-do-date-later’) 1826 Change the timestamp associated with the current line by one day 1827 into the future. 1828 1829 ‘S-<LEFT>’ (‘org-agenda-do-date-earlier’) 1830 Change the timestamp associated with the current line by one day 1831 into the past. 1832 1833 ‘I’ (‘org-agenda-clock-in’) 1834 Start the clock on the current item. 1835 1836 ‘O’ (‘org-agenda-clock-out’) 1837 Stop the previously started clock. 1838 1839 ‘X’ (‘org-agenda-clock-cancel’) 1840 Cancel the currently running clock. 1841 1842 ‘J’ (‘org-agenda-clock-goto’) 1843 Jump to the running clock in another window. 1844 1845 Quit and exit 1846 ------------- 1847 1848 ‘q’ (‘org-agenda-quit’) 1849 Quit agenda, remove the agenda buffer. 1850 1851 ‘x’ (‘org-agenda-exit’) 1852 Exit agenda, remove the agenda buffer and all buffers loaded by 1853 Emacs for the compilation of the agenda. 1854 1855 1856 File: orgguide.info, Node: Custom Agenda Views, Prev: Agenda Commands, Up: Agenda Views 1857 1858 10.8 Custom Agenda Views 1859 ======================== 1860 1861 The first application of custom searches is the definition of keyboard 1862 shortcuts for frequently used searches, either creating an agenda 1863 buffer, or a sparse tree (the latter covering of course only the current 1864 buffer). 1865 1866 Custom commands are configured in the variable 1867 ‘org-agenda-custom-commands’. You can customize this variable, for 1868 example by pressing ‘C’ from the agenda dispatcher (see *note Agenda 1869 Dispatcher::). You can also directly set it with Emacs Lisp in the 1870 Emacs init file. The following example contains all valid agenda views: 1871 1872 (setq org-agenda-custom-commands 1873 '(("w" todo "WAITING") 1874 ("u" tags "+boss-urgent") 1875 ("v" tags-todo "+boss-urgent"))) 1876 1877 The initial string in each entry defines the keys you have to press 1878 after the dispatcher command in order to access the command. Usually 1879 this is just a single character. The second parameter is the search 1880 type, followed by the string or regular expression to be used for the 1881 matching. The example above will therefore define: 1882 1883 ‘w’ 1884 as a global search for TODO entries with ‘WAITING’ as the TODO 1885 keyword. 1886 1887 ‘u’ 1888 as a global tags search for headlines tagged ‘boss’ but not 1889 ‘urgent’. 1890 1891 ‘v’ 1892 The same search, but limiting it to headlines that are also TODO 1893 items. 1894 1895 1896 File: orgguide.info, Node: Markup, Next: Exporting, Prev: Agenda Views, Up: Top 1897 1898 11 Markup for Rich Contents 1899 *************************** 1900 1901 Org is primarily about organizing and searching through your plain-text 1902 notes. However, it also provides a lightweight yet robust markup 1903 language for rich text formatting and more. Used in conjunction with 1904 the export framework (see *note Exporting::), you can author beautiful 1905 documents in Org. 1906 1907 * Menu: 1908 1909 * Paragraphs:: The basic unit of text. 1910 * Emphasis and Monospace:: Bold, italic, etc. 1911 * Embedded LaTeX:: LaTeX can be freely used inside Org documents. 1912 * Literal examples:: Source code examples with special formatting. 1913 * Images:: Display an image. 1914 * Creating Footnotes:: Edit and read footnotes. 1915 1916 1917 File: orgguide.info, Node: Paragraphs, Next: Emphasis and Monospace, Up: Markup 1918 1919 11.1 Paragraphs 1920 =============== 1921 1922 Paragraphs are separated by at least one empty line. If you need to 1923 enforce a line break within a paragraph, use ‘\\’ at the end of a line. 1924 1925 To preserve the line breaks, indentation and blank lines in a region, 1926 but otherwise use normal formatting, you can use this construct, which 1927 can also be used to format poetry. 1928 1929 #+BEGIN_VERSE 1930 Great clouds overhead 1931 Tiny black birds rise and fall 1932 Snow covers Emacs 1933 1934 ---AlexSchroeder 1935 #+END_VERSE 1936 1937 When quoting a passage from another document, it is customary to 1938 format this as a paragraph that is indented on both the left and the 1939 right margin. You can include quotations in Org documents like this: 1940 1941 #+BEGIN_QUOTE 1942 Everything should be made as simple as possible, 1943 but not any simpler ---Albert Einstein 1944 #+END_QUOTE 1945 1946 If you would like to center some text, do it like this: 1947 1948 #+BEGIN_CENTER 1949 Everything should be made as simple as possible, \\ 1950 but not any simpler 1951 #+END_CENTER 1952 1953 1954 File: orgguide.info, Node: Emphasis and Monospace, Next: Embedded LaTeX, Prev: Paragraphs, Up: Markup 1955 1956 11.2 Emphasis and Monospace 1957 =========================== 1958 1959 You can make words ‘*bold*’, ‘/italic/’, ‘_underlined_’, ‘=verbatim=’ 1960 and ‘~code~’, and, if you must, ‘+strike-through+’. Text in the code 1961 and verbatim string is not processed for Org specific syntax; it is 1962 exported verbatim. 1963 1964 1965 File: orgguide.info, Node: Embedded LaTeX, Next: Literal examples, Prev: Emphasis and Monospace, Up: Markup 1966 1967 11.3 Embedded LaTeX 1968 =================== 1969 1970 For scientific notes which need to be able to contain mathematical 1971 symbols and the occasional formula, Org mode supports embedding LaTeX 1972 code into its files. You can directly use TeX-like syntax for special 1973 symbols, enter formulas and entire LaTeX environments. 1974 1975 The radius of the sun is R_sun = 6.96 x 10^8 m. On the other hand, 1976 the radius of Alpha Centauri is R_{Alpha Centauri} = 1.28 x R_{sun}. 1977 1978 \begin{equation} % arbitrary environments, 1979 x=\sqrt{b} % even tables, figures 1980 \end{equation} % etc 1981 1982 If $a^2=b$ and \( b=2 \), then the solution must be 1983 either $$ a=+\sqrt{2} $$ or \[ a=-\sqrt{2} \]. 1984 1985 1986 File: orgguide.info, Node: Literal examples, Next: Images, Prev: Embedded LaTeX, Up: Markup 1987 1988 11.4 Literal examples 1989 ===================== 1990 1991 You can include literal examples that should not be subjected to markup. 1992 Such examples are typeset in monospace, so this is well suited for 1993 source code and similar examples. 1994 1995 #+BEGIN_EXAMPLE 1996 Some example from a text file. 1997 #+END_EXAMPLE 1998 1999 For simplicity when using small examples, you can also start the 2000 example lines with a colon followed by a space. There may also be 2001 additional whitespace before the colon: 2002 2003 Here is an example 2004 : Some example from a text file. 2005 2006 If the example is source code from a programming language, or any 2007 other text that can be marked up by Font Lock in Emacs, you can ask for 2008 the example to look like the fontified Emacs buffer. 2009 2010 #+BEGIN_SRC emacs-lisp 2011 (defun org-xor (a b) 2012 "Exclusive or." 2013 (if a (not b) b)) 2014 #+END_SRC 2015 2016 To edit the example in a special buffer supporting this language, use 2017 ‘C-c '’ to both enter and leave the editing buffer. 2018 2019 2020 File: orgguide.info, Node: Images, Next: Creating Footnotes, Prev: Literal examples, Up: Markup 2021 2022 11.5 Images 2023 =========== 2024 2025 An image is a link to an image file that does not have a description 2026 part, for example 2027 2028 ./img/cat.jpg 2029 2030 If you wish to define a caption for the image and maybe a label for 2031 internal cross references (see *note Hyperlinks::), make sure that the 2032 link is on a line by itself and precede it with ‘CAPTION’ and ‘NAME’ 2033 keywords as follows: 2034 2035 #+CAPTION: This is the caption for the next figure link (or table) 2036 #+NAME: fig:SED-HR4049 2037 [[./img/a.jpg]] 2038 2039 2040 File: orgguide.info, Node: Creating Footnotes, Prev: Images, Up: Markup 2041 2042 11.6 Creating Footnotes 2043 ======================= 2044 2045 A footnote is defined in a paragraph that is started by a footnote 2046 marker in square brackets in column 0, no indentation allowed. The 2047 footnote reference is simply the marker in square brackets, inside text. 2048 For example: 2049 2050 The Org website[fn:1] now looks a lot better than it used to. 2051 ... 2052 [fn:1] The link is: https://orgmode.org 2053 2054 The following commands handle footnotes: 2055 2056 ‘C-c C-x f’ (‘org-footnote-action’) 2057 The footnote action command. When point is on a footnote 2058 reference, jump to the definition. When it is at a definition, 2059 jump to the (first) reference. Otherwise, create a new footnote. 2060 When this command is called with a prefix argument, a menu of 2061 additional options including renumbering is offered. 2062 2063 ‘C-c C-c’ (‘org-ctrl-c-ctrl-c’) 2064 Jump between definition and reference. 2065 2066 2067 File: orgguide.info, Node: Exporting, Next: Publishing, Prev: Markup, Up: Top 2068 2069 12 Exporting 2070 ************ 2071 2072 Org can convert and export documents to a variety of other formats while 2073 retaining as much structure (see *note Document Structure::) and markup 2074 (see *note Markup::) as possible. 2075 2076 * Menu: 2077 2078 * The Export Dispatcher:: The main interface. 2079 * Export Settings:: Common export settings. 2080 * Table of Contents:: The if and where of the table of contents. 2081 * Include Files:: Include additional files into a document. 2082 * Comment Lines:: What will not be exported. 2083 * ASCII/UTF-8 Export:: Exporting to flat files with encoding. 2084 * HTML Export:: Exporting to HTML. 2085 * LaTeX Export:: Exporting to LaTeX and processing to PDF. 2086 * iCalendar Export:: Exporting to iCalendar. 2087 2088 2089 File: orgguide.info, Node: The Export Dispatcher, Next: Export Settings, Up: Exporting 2090 2091 12.1 The Export Dispatcher 2092 ========================== 2093 2094 The export dispatcher is the main interface for Org’s exports. A 2095 hierarchical menu presents the currently configured export formats. 2096 Options are shown as easy toggle switches on the same screen. 2097 2098 ‘C-c C-e’ (‘org-export-dispatch’) 2099 Invokes the export dispatcher interface. 2100 2101 Org exports the entire buffer by default. If the Org buffer has an 2102 active region, then Org exports just that region. 2103 2104 2105 File: orgguide.info, Node: Export Settings, Next: Table of Contents, Prev: The Export Dispatcher, Up: Exporting 2106 2107 12.2 Export Settings 2108 ==================== 2109 2110 The exporter recognizes special lines in the buffer which provide 2111 additional information. These lines may be put anywhere in the file: 2112 2113 #+TITLE: I'm in the Mood for Org 2114 2115 Most proeminent export options include: 2116 2117 ‘TITLE’ the title to be shown 2118 ‘AUTHOR’ the author (default taken from ‘user-full-name’) 2119 ‘DATE’ a date, fixed, or an Org timestamp 2120 ‘EMAIL’ email address (default from ‘user-mail-address’) 2121 ‘LANGUAGE’ language code, e.g., ‘en’ 2122 2123 Option keyword sets can be inserted from the export dispatcher (see 2124 *note The Export Dispatcher::) using the ‘Insert template’ command by 2125 pressing ‘#’. 2126 2127 2128 File: orgguide.info, Node: Table of Contents, Next: Include Files, Prev: Export Settings, Up: Exporting 2129 2130 12.3 Table of Contents 2131 ====================== 2132 2133 The table of contents includes all headlines in the document. Its depth 2134 is therefore the same as the headline levels in the file. If you need 2135 to use a different depth, or turn it off entirely, set the 2136 ‘org-export-with-toc’ variable accordingly. You can achieve the same on 2137 a per file basis, using the following ‘toc’ item in ‘OPTIONS’ keyword: 2138 2139 #+OPTIONS: toc:2 (only include two levels in TOC) 2140 #+OPTIONS: toc:nil (no default TOC at all) 2141 2142 Org normally inserts the table of contents directly before the first 2143 headline of the file. 2144 2145 2146 File: orgguide.info, Node: Include Files, Next: Comment Lines, Prev: Table of Contents, Up: Exporting 2147 2148 12.4 Include Files 2149 ================== 2150 2151 During export, you can include the content of another file. For 2152 example, to include your ‘.emacs’ file, you could use: 2153 2154 #+INCLUDE: "~/.emacs" src emacs-lisp 2155 2156 The first parameter is the file name to include. The optional second 2157 parameter specifies the block type: ‘example’, ‘export’ or ‘src’. The 2158 optional third parameter specifies the source code language to use for 2159 formatting the contents. This is relevant to both ‘export’ and ‘src’ 2160 block types. 2161 2162 You can visit the included file with ‘C-c '’. 2163 2164 2165 File: orgguide.info, Node: Comment Lines, Next: ASCII/UTF-8 Export, Prev: Include Files, Up: Exporting 2166 2167 12.5 Comment Lines 2168 ================== 2169 2170 Lines starting with zero or more whitespace characters followed by one 2171 ‘#’ and a whitespace are treated as comments and, as such, are not 2172 exported. 2173 2174 Likewise, regions surrounded by ‘#+BEGIN_COMMENT’ ... ‘#+END_COMMENT’ 2175 are not exported. 2176 2177 Finally, a ‘COMMENT’ keyword at the beginning of an entry, but after 2178 any other keyword or priority cookie, comments out the entire subtree. 2179 The command below helps changing the comment status of a headline. 2180 2181 ‘C-c ;’ (‘org-toggle-comment’) 2182 Toggle the ‘COMMENT’ keyword at the beginning of an entry. 2183 2184 2185 File: orgguide.info, Node: ASCII/UTF-8 Export, Next: HTML Export, Prev: Comment Lines, Up: Exporting 2186 2187 12.6 ASCII/UTF-8 Export 2188 ======================= 2189 2190 ASCII export produces an output file containing only plain ASCII 2191 characters. This is the simplest and most direct text output. It does 2192 not contain any Org markup. UTF-8 export uses additional characters and 2193 symbols available in this encoding standards. 2194 2195 ‘C-c C-e t a’ 2196 ‘C-c C-e t u’ (‘org-ascii-export-to-ascii’) 2197 Export as an ASCII file with a ‘.txt’ extension. For ‘myfile.org’, 2198 Org exports to ‘myfile.txt’, overwriting without warning. For 2199 ‘myfile.txt’, Org exports to ‘myfile.txt.txt’ in order to prevent 2200 data loss. 2201 2202 2203 File: orgguide.info, Node: HTML Export, Next: LaTeX Export, Prev: ASCII/UTF-8 Export, Up: Exporting 2204 2205 12.7 HTML Export 2206 ================ 2207 2208 Org mode contains an HTML exporter with extensive HTML formatting 2209 compatible with XHTML 1.0 strict standard. 2210 2211 ‘C-c C-e h h’ (‘org-html-export-to-html’) 2212 Export as HTML file with a ‘.html’ extension. For ‘myfile.org’, 2213 Org exports to ‘myfile.html’, overwriting without warning. ‘C-c 2214 C-e h o’ exports to HTML and opens it in a web browser. 2215 2216 The HTML export backend transforms ‘<’ and ‘>’ to ‘<’ and ‘>’. 2217 To include raw HTML code in the Org file so the HTML export backend can 2218 insert that HTML code in the output, use this inline syntax: 2219 ‘@@html:...@@’. For example: 2220 2221 @@html:<b>@@bold text@@html:</b>@@ 2222 2223 For larger raw HTML code blocks, use these HTML export code blocks: 2224 2225 #+HTML: Literal HTML code for export 2226 2227 #+BEGIN_EXPORT html 2228 All lines between these markers are exported literally 2229 #+END_EXPORT 2230 2231 2232 File: orgguide.info, Node: LaTeX Export, Next: iCalendar Export, Prev: HTML Export, Up: Exporting 2233 2234 12.8 LaTeX Export 2235 ================= 2236 2237 The LaTeX export backend can handle complex documents, incorporate 2238 standard or custom LaTeX document classes, generate documents using 2239 alternate LaTeX engines, and produce fully linked PDF files with 2240 indexes, bibliographies, and tables of contents, destined for 2241 interactive online viewing or high-quality print publication. 2242 2243 By default, the LaTeX output uses the _article_ class. You can 2244 change this by adding an option like ‘#+LATEX_CLASS: myclass’ in your 2245 file. The class must be listed in ‘org-latex-classes’. 2246 2247 ‘C-c C-e l l’ (‘org-latex-export-to-latex’) 2248 Export to a LaTeX file with a ‘.tex’ extension. For ‘myfile.org’, 2249 Org exports to ‘myfile.tex’, overwriting without warning. 2250 2251 ‘C-c C-e l p’ (‘org-latex-export-to-pdf’) 2252 Export as LaTeX file and convert it to PDF file. 2253 2254 ‘C-c C-e l o’ (‘<no corresponding named command>’) 2255 Export as LaTeX file and convert it to PDF, then open the PDF using 2256 the default viewer. 2257 2258 The LaTeX export backend can insert any arbitrary LaTeX code, see 2259 *note Embedded LaTeX::. There are three ways to embed such code in the 2260 Org file and they all use different quoting syntax. 2261 2262 Inserting in-line quoted with @ symbols: 2263 2264 Code embedded in-line @@latex:any arbitrary LaTeX code@@ in a paragraph. 2265 2266 Inserting as one or more keyword lines in the Org file: 2267 2268 #+LATEX: any arbitrary LaTeX code 2269 2270 Inserting as an export block in the Org file, where the backend 2271 exports any code between begin and end markers: 2272 2273 #+BEGIN_EXPORT latex 2274 any arbitrary LaTeX code 2275 #+END_EXPORT 2276 2277 2278 File: orgguide.info, Node: iCalendar Export, Prev: LaTeX Export, Up: Exporting 2279 2280 12.9 iCalendar Export 2281 ===================== 2282 2283 A large part of Org mode’s interoperability success is its ability to 2284 easily export to or import from external applications. The iCalendar 2285 export backend takes calendar data from Org files and exports to the 2286 standard iCalendar format. 2287 2288 ‘C-c C-e c f’ (‘org-icalendar-export-to-ics’) 2289 Create iCalendar entries from the current Org buffer and store them 2290 in the same directory, using a file extension ‘.ics’. 2291 2292 ‘C-c C-e c c’ (‘org-icalendar-combine-agenda-files’) 2293 Create a combined iCalendar file from Org files in 2294 ‘org-agenda-files’ and write it to 2295 ‘org-icalendar-combined-agenda-file’ file name. 2296 2297 2298 File: orgguide.info, Node: Publishing, Next: Working with Source Code, Prev: Exporting, Up: Top 2299 2300 13 Publishing 2301 ************* 2302 2303 Org includes a publishing management system that allows you to configure 2304 automatic HTML conversion of _projects_ composed of interlinked Org 2305 files. You can also configure Org to automatically upload your exported 2306 HTML pages and related attachments, such as images and source code 2307 files, to a web server. 2308 2309 You can also use Org to convert files into PDF, or even combine HTML 2310 and PDF conversion so that files are available in both formats on the 2311 server. 2312 2313 For detailed instructions about setup, see the *note manual: 2314 (org)Top. Here is an example: 2315 2316 (setq org-publish-project-alist 2317 '(("org" 2318 :base-directory "~/org/" 2319 :publishing-function org-html-publish-to-html 2320 :publishing-directory "~/public_html" 2321 :section-numbers nil 2322 :with-toc nil 2323 :html-head "<link rel=\"stylesheet\" 2324 href=\"../other/mystyle.css\" 2325 type=\"text/css\"/>"))) 2326 2327 ‘C-c C-e P x’ (‘org-publish’) 2328 Prompt for a specific project and publish all files that belong to 2329 it. 2330 2331 ‘C-c C-e P p’ (‘org-publish-current-project’) 2332 Publish the project containing the current file. 2333 2334 ‘C-c C-e P f’ (‘org-publish-current-file’) 2335 Publish only the current file. 2336 2337 ‘C-c C-e P a’ (‘org-publish-all’) 2338 Publish every project. 2339 2340 Org uses timestamps to track when a file has changed. The above 2341 functions normally only publish changed files. You can override this 2342 and force publishing of all files by giving a prefix argument to any of 2343 the commands above. 2344 2345 2346 File: orgguide.info, Node: Working with Source Code, Next: Miscellaneous, Prev: Publishing, Up: Top 2347 2348 14 Working with Source Code 2349 *************************** 2350 2351 Org mode provides a number of features for working with source code, 2352 including editing of code blocks in their native major mode, evaluation 2353 of code blocks, tangling of code blocks, and exporting code blocks and 2354 their results in several formats. 2355 2356 A source code block conforms to this structure: 2357 2358 #+NAME: <name> 2359 #+BEGIN_SRC <language> <switches> <header arguments> 2360 <body> 2361 #+END_SRC 2362 2363 where: 2364 2365 • ‘<name>’ is a string used to uniquely name the code block, 2366 2367 • ‘<language>’ specifies the language of the code block, e.g., 2368 ‘emacs-lisp’, ‘shell’, ‘R’, ‘python’, etc., 2369 2370 • ‘<switches>’ can be used to control export of the code block, 2371 2372 • ‘<header arguments>’ can be used to control many aspects of code 2373 block behavior as demonstrated below, 2374 2375 • ‘<body>’ contains the actual source code. 2376 2377 Use ‘C-c '’ to edit the current code block. It opens a new major 2378 mode edit buffer containing the body of the source code block, ready for 2379 any edits. Use ‘C-c '’ again to close the buffer and return to the Org 2380 buffer. 2381 2382 Using header arguments 2383 ====================== 2384 2385 A header argument is specified with an initial colon followed by the 2386 argument’s name in lowercase. 2387 2388 Header arguments can be set in several ways; Org prioritizes them in 2389 case of overlaps or conflicts by giving local settings a higher 2390 priority. 2391 2392 System-wide header arguments 2393 Those are specified by customizing ‘org-babel-default-header-args’ 2394 variable, or, for a specific language LANG 2395 ‘org-babel-default-header-args:LANG’. 2396 2397 Header arguments in properties 2398 You can set them using ‘header-args’ property (see *note 2399 Properties::)—or ‘header-args:LANG’ for language LANG. Header 2400 arguments set through properties drawers apply at the sub-tree 2401 level on down. 2402 2403 Header arguments in code blocks 2404 Header arguments are most commonly set at the source code block 2405 level, on the ‘BEGIN_SRC’ line: 2406 2407 #+NAME: factorial 2408 #+BEGIN_SRC haskell :results silent :exports code :var n=0 2409 fac 0 = 1 2410 fac n = n * fac (n-1) 2411 #+END_SRC 2412 2413 Code block header arguments can span multiple lines using ‘HEADER’ 2414 keyword on each line. 2415 2416 Evaluating code blocks 2417 ====================== 2418 2419 Use ‘C-c C-c’ to evaluate the current code block and insert its results 2420 in the Org document. By default, evaluation is only turned on for 2421 ‘emacs-lisp’ code blocks, however support exists for evaluating blocks 2422 in many languages. For a complete list of supported languages see the 2423 *note manual: (org)Top. The following shows a code block and its 2424 results. 2425 2426 #+BEGIN_SRC emacs-lisp 2427 (+ 1 2 3 4) 2428 #+END_SRC 2429 2430 #+RESULTS: 2431 : 10 2432 2433 The following syntax is used to pass arguments to code blocks using 2434 the ‘var’ header argument. 2435 2436 :var NAME=ASSIGN 2437 2438 NAME is the name of the variable bound in the code block body. ASSIGN 2439 is a literal value, such as a string, a number, a reference to a table, 2440 a list, a literal example, another code block—with or without 2441 arguments—or the results of evaluating a code block. 2442 2443 Results of evaluation 2444 ===================== 2445 2446 How Org handles results of a code block execution depends on many header 2447 arguments working together. The primary determinant, however, is the 2448 ‘results’ header argument. It controls the _collection_, _type_, 2449 _format_, and _handling_ of code block results. 2450 2451 Collection 2452 How the results should be collected from the code block. You may 2453 choose either ‘output’ or ‘value’ (the default). 2454 2455 Type 2456 What result types to expect from the execution of the code block. 2457 You may choose among ‘table’, ‘list’, ‘scalar’, and ‘file’. Org 2458 tries to guess it if you do not provide it. 2459 2460 Format 2461 How Org processes results. Some possible values are ‘code’, 2462 ‘drawer’, ‘html’, ‘latex’, ‘link’, and ‘raw’. 2463 2464 Handling 2465 How to insert the results once properly formatted. Allowed values 2466 are ‘silent’, ‘replace’ (the default), ‘append’, or ‘prepend’. 2467 2468 Code blocks which output results to files—e.g.: graphs, diagrams and 2469 figures—can accept a ‘:file FILENAME’ header argument, in which case the 2470 results are saved to the named file, and a link to the file is inserted 2471 into the buffer. 2472 2473 Exporting code blocks 2474 ===================== 2475 2476 It is possible to export the _code_ of code blocks, the _results_ of 2477 code block evaluation, _both_ the code and the results of code block 2478 evaluation, or _none_. Org defaults to exporting _code_ for most 2479 languages. 2480 2481 The ‘exports’ header argument is to specify if that part of the Org 2482 file is exported to, say, HTML or LaTeX formats. It can be set to 2483 either ‘code’, ‘results’, ‘both’ or ‘none’. 2484 2485 Extracting source code 2486 ====================== 2487 2488 Use ‘C-c C-v t’ to create pure source code files by extracting code from 2489 source blocks in the current buffer. This is referred to as 2490 “tangling”—a term adopted from the literate programming community. 2491 During tangling of code blocks their bodies are expanded using 2492 ‘org-babel-expand-src-block’, which can expand both variable and “Noweb” 2493 style references. In order to tangle a code block it must have a 2494 ‘tangle’ header argument, see the *note manual: (org)Top. for details. 2495 2496 2497 File: orgguide.info, Node: Miscellaneous, Prev: Working with Source Code, Up: Top 2498 2499 15 Miscellaneous 2500 **************** 2501 2502 Completion 2503 ========== 2504 2505 Org has in-buffer completions with ‘M-<TAB>’. No minibuffer is 2506 involved. Type one or more letters and invoke the hot key to complete 2507 the text in-place. 2508 2509 For example, this command will complete TeX symbols after ‘\’, TODO 2510 keywords at the beginning of a headline, and tags after ‘:’ in a 2511 headline. 2512 2513 Structure Templates 2514 =================== 2515 2516 To quickly insert empty structural blocks, such as ‘#+BEGIN_SRC’ ... 2517 ‘#+END_SRC’, or to wrap existing text in such a block, use 2518 2519 ‘C-c C-,’ (‘org-insert-structure-template’) 2520 Prompt for a type of block structure, and insert the block at 2521 point. If the region is active, it is wrapped in the block. 2522 2523 Clean view 2524 ========== 2525 2526 Org’s default outline with stars and no indents can become too cluttered 2527 for short documents. For _book-like_ long documents, the effect is not 2528 as noticeable. Org provides an alternate stars and indentation scheme, 2529 as shown on the right in the following table. It uses only one star and 2530 indents text to line with the heading: 2531 2532 * Top level headline | * Top level headline 2533 ** Second level | * Second level 2534 *** Third level | * Third level 2535 some text | some text 2536 *** Third level | * Third level 2537 more text | more text 2538 * Another top level headline | * Another top level headline 2539 2540 This kind of view can be achieved dynamically at display time using 2541 Org Indent mode (‘M-x org-indent-mode <RET>’), which prepends intangible 2542 space to each line. You can turn on Org Indent mode for all files by 2543 customizing the variable ‘org-startup-indented’, or you can turn it on 2544 for individual files using 2545 2546 #+STARTUP: indent 2547 2548 If you want the indentation to be hard space characters so that the 2549 plain text file looks as similar as possible to the Emacs display, Org 2550 supports you by helping to indent (with ‘<TAB>’) text below each 2551 headline, by hiding leading stars, and by only using levels 1, 3, etc to 2552 get two characters indentation for each level. To get this support in a 2553 file, use 2554 2555 #+STARTUP: hidestars odd 2556 2557 2558 2559 Tag Table: 2560 Node: Top922 2561 Node: Introduction5668 2562 Ref: Installation6354 2563 Ref: Activation7066 2564 Ref: Feedback7509 2565 Node: Document Structure7766 2566 Node: Headlines8837 2567 Ref: Headlines-Footnote-19719 2568 Node: Visibility Cycling9842 2569 Node: Motion11236 2570 Node: Structure Editing11830 2571 Ref: Structure Editing-Footnote-113262 2572 Node: Sparse Trees13366 2573 Ref: Sparse Trees-Footnote-114476 2574 Node: Plain Lists14591 2575 Node: Tables17380 2576 Ref: Creation and conversion19073 2577 Ref: Re-aligning and field motion19673 2578 Ref: Column and row editing20433 2579 Node: Hyperlinks21784 2580 Ref: Internal links22542 2581 Ref: External Links22995 2582 Ref: Handling Links24825 2583 Node: TODO Items26316 2584 Node: TODO Basics27293 2585 Node: Multi-state Workflow28831 2586 Node: Progress Logging30622 2587 Ref: Closing items31386 2588 Ref: Tracking TODO state changes31941 2589 Ref: Progress Logging-Footnote-132940 2590 Ref: Progress Logging-Footnote-233013 2591 Node: Priorities33091 2592 Node: Breaking Down Tasks34008 2593 Node: Checkboxes34811 2594 Node: Tags35950 2595 Ref: Tag inheritance36575 2596 Ref: Setting tags37313 2597 Ref: Tag groups39091 2598 Ref: Tag searches39887 2599 Ref: Tags-Footnote-140967 2600 Node: Properties41071 2601 Node: Dates and Times42883 2602 Node: Timestamps43920 2603 Node: Creating Timestamps46676 2604 Node: Deadlines and Scheduling48519 2605 Ref: Deadlines and Scheduling-Footnote-150585 2606 Ref: Deadlines and Scheduling-Footnote-250746 2607 Node: Clocking Work Time50909 2608 Node: Capture Refile Archive52344 2609 Node: Capture53152 2610 Ref: Setting up capture53454 2611 Ref: Using capture53725 2612 Ref: Capture templates54421 2613 Ref: Capture-Footnote-155854 2614 Ref: Capture-Footnote-255965 2615 Node: Refile and Copy56056 2616 Node: Archiving57366 2617 Node: Agenda Views58742 2618 Node: Agenda Files60197 2619 Node: Agenda Dispatcher60945 2620 Node: Built-in Agenda Views61865 2621 Node: Global TODO List62978 2622 Node: Matching Tags and Properties63739 2623 Node: Search View65769 2624 Node: Agenda Commands66879 2625 Ref: Motion (1)67482 2626 Ref: View/Go to Org file67685 2627 Ref: Change display68123 2628 Ref: Remote editing69493 2629 Ref: Quit and exit71081 2630 Node: Custom Agenda Views71335 2631 Node: Markup72811 2632 Node: Paragraphs73637 2633 Node: Emphasis and Monospace74759 2634 Node: Embedded LaTeX75177 2635 Node: Literal examples76046 2636 Node: Images77136 2637 Node: Creating Footnotes77737 2638 Node: Exporting78711 2639 Node: The Export Dispatcher79587 2640 Node: Export Settings80145 2641 Node: Table of Contents80970 2642 Node: Include Files81703 2643 Node: Comment Lines82389 2644 Node: ASCII/UTF-8 Export83114 2645 Node: HTML Export83847 2646 Node: LaTeX Export84885 2647 Node: iCalendar Export86628 2648 Node: Publishing87407 2649 Node: Working with Source Code89138 2650 Ref: Using header arguments90405 2651 Ref: Evaluating code blocks91583 2652 Ref: Results of evaluation92474 2653 Ref: Exporting code blocks93696 2654 Ref: Extracting source code94160 2655 Node: Miscellaneous94704 2656 Ref: Completion94827 2657 Ref: Structure Templates95164 2658 Ref: Clean view95528 2659 2660 End Tag Table 2661 2662 2663 Local Variables: 2664 coding: utf-8 2665 End: