# -*- mode: org; coding: utf-8; -*- * Header Information :noexport: #+TITLE: Org-mode Teaser Demo #+AUTHOR: Karl Voit #+EMAIL: tools@Karl-Voit.at #+DATE: 2016-04-24 #+DESCRIPTION: #+KEYWORDS: #+LANGUAGE: en #+OPTIONS: H:3 num:t toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t #+OPTIONS: TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc #+INFOJS_OPT: view:nil toc:nil ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js #+EXPORT_SELECT_TAGS: export #+EXPORT_EXCLUDE_TAGS: noexport #+LINK_UP: #+LINK_HOME: #+XSLT: #+STARTUP: hidestars #+STARTUP: overview (or: showall, content, showeverything) http://orgmode.org/org.html#Visibility-cycling [[info:org#Visibility%20cycling][info:org#Visibility cycling]] #+TODO: TODO(t) NEXT(n) STARTED(s) WAITING(w@/!) SOMEDAY(S!) | DONE(d!/!) CANCELLED(c@/!) http://orgmode.org/org.html#Per_002dfile-keywords [[info:org#Per-file%20keywords][info:org#Per-file keywords]] #+TAGS: important(i) private(p) #+TAGS: @HOME(h) @OFFICE(o) http://orgmode.org/org.html#Setting-tags [[info:org#Setting%20tags][info:org#Setting tags]] #+NOstartup: beamer #+NOLaTeX_CLASS: beamer #+NOLaTeX_CLASS_OPTIONS: [bigger] #+NOBEAMER_FRAME_LEVEL: 2 * Setting Up the Demo :noexport: - [ ] start key visualization tool like [[http://pabloseminario.com/projects/screenkey/][screenkey]] - [ ] check font size - de/increase by ~S-Mousebutton1~ - [X] disable creation of PROPERTIES drawer containing CREATED timestamp: - M-: (org-expiry-deinsinuate) - see: Local Variables below * Org-mode by Examples :PROPERTIES: :VISIBILITY: children :END: - This is a subset(!) of Org-mode basics to demonstrate the main features (sometimes probably more) of this wonderful tool - Find the newest version of this document on [[https://github.com/novoid/org-mode-workshop]] #+TBLNAME: key-legend | *key* | *description* | |-------+---------------------| | M | Meta (often: Alt) | | C | Ctrl | | S | Shift | | TAB | Tabulator | | RET | Return, Enter, CRLF | | UP | arrow: up | | DOWN | arrow: down | | LEFT | arrow: left | | RIGHT | arrow: right | | SPC | Space | ** activating Org-mode - http://orgmode.org/org.html#Activation - http://orgmode.org/worg/org-configs/org-customization-guide.html [[http://orgmode.org/worg/org-tutorials/orgtutorial_dto.html#sec-1-2][Activation of Org-mode (external Tutorial)]]: #+BEGIN_SRC emacs-lisp (add-to-list 'auto-mode-alist '("\\.\\(org\\|org_archive\\|txt\\)$" . org-mode)) (define-key global-map "\C-ca" 'org-agenda) ;; by convention: "C-c a" opens agenda (define-key global-map "\C-cc" 'org-capture) ;; by convention: "C-c c" captures stuff (define-key global-map "\C-cl" 'org-store-link) ;; by convention: "C-c l" stores a link to this heading (setq org-log-done t) ;; if you want to log DONE-states to the :LOGBOOK:-drawer #+END_SRC - Org-mode *minor mode* (structure editing and lists) ~orgstruct-mode~ ([[http://orgmode.org/org.html#Orgstruct-mode][docu]]) ** Org-mode documentation - http://orgmode.org/org.html is up to date - ~C-h i~ (while being in an Org-mode file) gives you a local version :-) *** In case of Org-mode documentation does not work For using Org-mode from a local git repository: add following to your configuration: : (add-to-list 'Info-additional-directory-list "~/.emacs.d//org-mode/doc/") OR: install Org-mode documentation to your system with: : cd $ORGMODEDIRECTORY && sudo make install-info ** text formatting syntax [[http://orgmode.org/org.html#Emphasis-and-monospace][(docu)]] - *bold* - /italic/ - _underline_ - +strike through+ - =code= - ~commands~ - http://orgmode.org : small example #+COMMENT: this will never be exported #+BEGIN_COMMENT multi line comment #+END_COMMENT - not (yet) working and edge cases: - /*combination*/ - */combination/* - _*combination*_ - *_combination_* - =*combination*= - ~C:\a\very\old\DOS\path~ - http://orgmode.org - [[http://orgmode.org][orgmode-Homepage]] - [[http://orgmode.org][*orgmode* /Homepage/]] *** COMMENT no exported either foo bar ** outlining ([[http://orgmode.org/org.html#Document-Structure][docu]]) - headlines start with asterisks - levels - visibility - ~TAB~ *visibility cycling* - ~S-TAB~ change buffer visibility - ~C-c C-r~ *reveal context* - per-file visibility ~#+STARTUP: overview~ and so on: ([[http://orgmode.org/org.html#Visibility-cycling][docu]]) - ~C-u C-u TAB~ *restore startup visibility* - motion - ~C-c C-n~ *next heading* - ~C-c C-p~ *previous heading* - ~C-c C-u~ one level up - ~C-c C-j~ jump (goto) - ~C-c C-f~ forward same level - ~C-c C-b~ backward same level - ~M-x org-goto~ nifty inerface for searching within an Org-mode buffer - create basic elements - ~C-RET~ *new heading* below - move elements - ~M-UP/DOWN~ *move up/down* with subitems - ~M-LEFT~ *promote* - ~M-RIGHT~ *demote* - ~M-S-LEFT/RIGHT~ promote/demote with subitems - ~C-c C-c~ *toggle/modify* things ([[http://orgmode.org/org.html#The-very-busy-C_002dc-C_002dc-key][docu]]) - checkbox: activate/deactivate, heading: tags, tables: re-calculate, jump footnote and back, update tables, update TODO-count, ... - ~C-c C-x b~ *open sub-tree in separate buffer* (org-tree-to-indirect-buffer) *** Creating - [ ] DEMO: create headings *** Using - [ ] DEMO: visibility cycling - [ ] DEMO: move headings This is a quite boring text just to show some body content. **** This is the 1st heading This is a quite boring text just to show some body content. ***** Sub-heading 1 This is a quite boring text just to show some body content. **** This is another heading This is a quite boring text just to show some body content. ***** Sub-heading 2 This is a quite boring text just to show some body content. **** This is yet another heading **** OK, now this is getting boring :-) *** encryption - whole Org-mode files - selective headlines using :crypt: - ~org-decrypt-entry~ *** time stamps when taking notes ([[http://orgmode.org/manual/Relative-timer.html][docu]], [[info:org#Timers][info:org#Timers]]) - ~C-c C-x .~ start timer - ~C-c C-x -~ insert list item with time - ~M-~ insert heading with time - ~C-c C-x ,~ toggle timer pause - ~C-u C-c C-x ,~ stop timer - also handy: - ~C-c C-x ;~ set countdown ** sparse trees ([[http://orgmode.org/org.html#Sparse-trees][docu]]) - Filtering - ~C-c /~ Filter in *sparse trees* - ~C-c / r~ Filter using *Regular Expressions* - Moving in results - ~M-g n~ goto next match - ~M-g o~ goto previous match - [[http://orgmode.org/org.html#Property-searches][docu: property search]] - ~C-c a L~ time sorted view of buffer ** lists [[http://orgmode.org/org.html#Plain-lists][(docu)]] - ~M-RET~ *new list item* - ~M-S-RET~ create checkbox - ~M-LEFT/RIGHT/UP/DOWN~ move item - ~C-c -~ cycle item type OR turn into list item *** examples simple list: - Emacs - Org-mode - Lists enumerate: 1. Emacs 2. Org-mode 3. Lists check lists: *** Simple - [ ] DEMO: create simple lists and move items around *** Checklists - ~M-S-RET~ new item with checkbox - ~C-c C-*~ checkboxes become TODOs - ~C-c C-C~ toggle checkboxes between ~[X]~ and ~[ ]~ - ~C-u C-u C-c C-C~ toggle checkboxes between ~[ ]~ and ~[-]~ - Clean out garage 1. [ ] get stuff out - [ ] be careful with that axe, Eugene 2. [ ] get rid of old stuff - using eBay? - try to use rubbish as birthday presents for family 3. [ ] repaint garage 4. [ ] put stuff back in *** Headings with TODO items **** TODO Clean out garage [0/4] ***** TODO get stuff out - be careful with that axe, Eugene ***** TODO get rid of old stuff - using eBay? - try to use rubbish as birthday presents for family ***** TODO repaint garage ***** TODO put stuff back in *** Taking notes during a meeting or similar ([[http://orgmode.org/org.html#Relative-timer][docu]]) :PROPERTIES: :CREATED: [2014-04-20 Sun 11:33] :END: - ~C-c C-x .~ (re)start a timer - ~C-c C-x -~ or ~M-~ insert description list item with the current relative time - ~C-c C-x ,~ pause/continue - ~C-u C-c C-x ,~ stop timer Bonus feature: - ~C-c C-x ;~ count down timer ** drawers, properties, columns ([[http://orgmode.org/org.html#Properties-and-Columns][docu]]) - meta-data on headings - standard drawers :PROPERTIES: and :LOGBOOK: - ends with :END: - FIXXME - ~C-c C-z~ timed LOGBOOK entry - ~:ID: label~ define ID in PROPERTIES - hint: the property CATEGORY gets inherited and displayed on the agenda: *** NEXT Test with category property :mytag: :PROPERTIES: :CATEGORY: mycategory :END: ** blocks ([[http://orgmode.org/org.html#Blocks][docu]]) - encapsulating content with begin...end structure - ~> - id:myexampleid - [[file:~/.zshrc.local]] - http://orgmode.org - [[http://orgmode.org/org.html#External-links][docu: list of external links]] - custom links: [[contact:John%20Smith][contact:John Smith]] - [[http://orgmode.org/org.html#Link-abbreviations][docu: link abbrevations]] - ~C-c l~ *store link* (also in many other buffer types: [[http://orgmode.org/org.html#Handling-links][docu]]) - ~C-c C-l~ *inserting link* (or edit existing link) - ~C-u C-c C-l~ file link (shortcut) - ~C-c C-o~ *open link* - ~C-c C-x C-n~ goto *next link* - ~C-c C-x C-p~ goto *previous link* - "radio targets" are auto-links created by target like ~<<>>~ - all occurrences of "target name" will be links - ~C-c C-x C-v~ toggle show inline images - ~C-c %~ push position into ring - ~C-c &~ goto last saved position in ring - footnotes ([[http://orgmode.org/org.html#Footnotes][docu]]) - plain [fn::great content here] - with own label [fn:mylabel:great content here] - reference [fn:myotherlabel] [fn:2] - ~C-c C-c~ jump between footnote and reference - ~C-c C-x f~ footnote action command (see [[http://orgmode.org/org.html#Footnotes][docu]]) [fn:myotherlabel] This is a footnote from reference above. [fn:2] This is a footnote with a simple number as label. - *many external link types* see [[http://orgmode.org/org.html#External-links][docu]] *** heading with PROPERTIES drawer containing ID :PROPERTIES: :ID: myexampleid :END: foo bar ** states; TODO items ([[http://orgmode.org/org.html#TODO-Items][docu]]) - ~C-c C-t~ *rotate TODO state* - ~C-c / t~ sparse tree with TODOs - ~C-c a t~ global TODO list in agenda - ~C-S-RET~ *new TODO heading* - per-file keywords ~#+TODO: TODO(t) FEEDBACK(f) | DONE(d!) CANCELED(c!@)~ - ~!~ timestamp - ~@~ add note *** making dependencies explicit: org-depend - simple, ordered method with PROPERTIES drawer: : :ORDERED: t - ~C-c C-x o~ toggle ORDERED property - see only tasks that are *not* depending on other *open* tasks - see only things that can be done now - http://orgmode.org/worg/org-contrib/org-depend.html - to define workflows (see demo below) - task dependencies with org-depend ([[http://orgmode.org/worg/org-contrib/org-depend.html][docu]]) - ~:BLOCKER: an-heading-id another-heading-id~ define blocking task - ~:TRIGGER: chain-siblings(NEXT)~ define trigger for setting NEXT - ~:TRIGGER: my-heading-id(NEXT)~ define trigger for specific heading to set to NEXT **** example with chain siblings ***** NEXT buy bike :PROPERTIES: :TRIGGER: chain-siblings(NEXT) :END: ***** take tour ***** goto hospital **** example with triggers and blockers ***** NEXT go for shopping :PROPERTIES: :ID: my-shopping :TRIGGER: my-new-clothes(NEXT) my-next-errands(TODO) :END: After setting this task to DONE, enjoying new clothes get to state NEXT and looking out for next errands to TODO. ***** enjoy new clothes :PROPERTIES: :ID: my-new-clothes :END: ***** look out for next errands :PROPERTIES: :ID: my-next-errands :BLOCKER: my-new-clothes :END: I can not finish this task as long as I did not enjoy my new clothes. *** making dependencies explicit: org-edna - [[https://www.nongnu.org/org-edna-el/][org-edna]]: bit more complex syntax compared to org-depend but also more powerful - same general approach using ~:BLOCKER:~ and ~:TRIGGER:~ properties - task dependencies with org-edna: - ~:BLOCKER: ids("an-heading-id" "another-heading-id")~ define blocking task - ~:BLOCKER: ids("id:an-heading-id" "another-heading-id")~ same example but navigable id - ~:TRIGGER: ids("my-heading-id") todo!(NEXT) scheduled!("++3d")~ define trigger for specific heading to set to NEXT and schedule 3 days later **** example with triggers and blockers ***** NEXT go for shopping :PROPERTIES: :ID: my-shopping :TRIGGER: ids("my-new-clothes") todo!(NEXT) ids("id:my-next-errands") todo!(TODO) :END: After setting this task to DONE, enjoying new clothes get to state NEXT and looking out for next errands to TODO. ***** enjoy new clothes :PROPERTIES: :ID: my-new-clothes :END: ***** look out for next errands :PROPERTIES: :ID: my-next-errands :BLOCKER: ids("my-new-clothes") :END: I can not finish this task as long as I did not enjoy my new clothes. *** logging state changes ([[http://orgmode.org/org.html#Tracking-TODO-state-changes][docu]]) - ~!~ in todo state definition - ~org-log-into-drawer~ for setting default behavior *** habits ([[http://orgmode.org/org.html#Tracking-your-habits][docu]]) - enable habits module by customizing the variable ~org-modules~ - TODO items with property STYLE is set to the value ~habit~: : :STYLE: habit #+BEGIN_EXAMPLE ** TODO Shave SCHEDULED: <2009-10-17 Sat .+2d/4d> - State "DONE" from "TODO" [2009-10-15 Thu] - State "DONE" from "TODO" [2009-10-12 Mon] - State "DONE" from "TODO" [2009-10-10 Sat] - State "DONE" from "TODO" [2009-10-04 Sun] - State "DONE" from "TODO" [2009-10-02 Fri] - State "DONE" from "TODO" [2009-09-29 Tue] - State "DONE" from "TODO" [2009-09-25 Fri] - State "DONE" from "TODO" [2009-09-19 Sat] - State "DONE" from "TODO" [2009-09-16 Wed] - State "DONE" from "TODO" [2009-09-12 Sat] :PROPERTIES: :STYLE: habit :LAST_REPEAT: [2009-10-19 Mon 00:36] :END: #+END_EXAMPLE *** priorities ([[http://orgmode.org/org.html#Priorities][docu]]) - ~C-c ,~ set priorities - ~S-UP/DOWN~ *change priority* - [A], [B], [C] - no priority is ordered like [B] **** TODO [#A] example *** breaking down in subtasks ([[http://orgmode.org/org.html#Breaking-down-tasks][docu]]) - for TODO-headings: stat cookies ~[/]~ or ~[%]~ (will be ~[1/3]~ or ~[33%]~) - also possible: - for checkboxes - recursive - mark entry to DONE if all children are DONE **** TODO example [1/3] [33%] ***** DONE subtask 1 ***** TODO subtask 2 ***** TODO subtask 3 ** inline display of images (and PDF files) - ~C-c C-x C-v~ =org-toggle-inline-images= [[file:org-mode-logo_283x283.png]] [[file:org-mode-teaser.pdf]] ** tags [[http://orgmode.org/org.html#Tags][(docu)]] - inherited tags - per-file definition of tags: : #+TAGS: { @work(w) @home(h) } online(o) kids(k) - per-file tags for all entries: : #+FILETAGS: :this:that:foo: - ~C-c C-q~ *set tags* - ~C-c C-c~ set tags if cursor is on a heading - ~C-c / m~ *search for tags* in sparse tree - ~C-c a m~ global list of tag matching - ~C-c a M~ same but check only TODO items - syntax ([[http://orgmode.org/org.html#Matching-tags-and-properties][docu]]) - ~+boss+urgent~ AND - ~boss|urgent~ OR - ~+boss+urgent-project~ combination of tags - ~work+TODO="WAITING"|home+TODO="WAITING"~ Waiting tasks both at work and at home *** example :tag: *** Tag groups ([[http://orgmode.org/manual/Tag-groups.html][docu]]) - searching for a group tag return matches of all member tags as well - example: #+TAGS: { @read: @read_book @read_ebook } #+BEGIN_SRC elisp (setq org-tag-alist '((:startgroup . nil) ("@read" . nil) (:grouptags . nil) ("@read_book" . nil) ("@read_ebook" . nil) (:endgroup . nil))) #+END_SRC - searching for "@read" also returns "@read_book" and "@read_ebook" ** tables simple [[http://orgmode.org/org.html#Tables][(docu)]] - ~C-c C-c~ *update table* - ~TAB~ *move next field* - ~RET~ next row - ~M-LEFT/RIGHT/UP/DOWN~ *moving rows/columns* - ~C-c -~ insert vertical bar below - ~C-c |~ convert region into table OR: insert new table - ~C-c ^~ sort lines (in region) - [ ] DEMO: create table ** tables complex ([[http://orgmode.org/org.html#The-spreadsheet][docu]], [[http://orgmode.org/worg/org-tutorials/org-spreadsheet-intro.html][tutorial]]) - ~C-c |~ move region into table (see [[http://orgmode.org/org.html#Built_002din-table-editor][docu]]) - TABs, CSV, ... - ~C-c +~ sum current column (or marked rectangle) - ~=$1+$2~ value = sum of 1st and 2nd column - ~:=vsum(@I..@II)~ field = sum between 1st and 2nd hline - ~C-u C-u C-c C-c~ recompute table with iterations ([[http://orgmode.org/org.html#Updating-the-table][docu]]) - ~#+TBLFM: $3 = $1 + $2~ table formula - ~#+TBLFM: $1 = -1 + 1 :: @2$1 = 1~ incremental numbers - ~org-table-import~ import data from CSV file - ~org-table-export~ export data to CSV file #+TBLNAME: mydemo-USD-EUR-rate | *US-Dollar* | *EUR* | | 1 | 0.76481836 | | *When* | *What* | *USD* | *EUR* | |------------+------------------------+-------+-------| | 2012-02-03 | Taxi Graz-Airport | | 18.00 | | 2012-02-03 | Taxi Seattle Airport | 25.00 | 19.12 | | 2012-02-13 | Taxi | 7.00 | 5.35 | | 2012-02-14 | Taxi | 8.00 | 6.12 | | 2012-02-17 | Taxi to Airport SeaTac | 35.00 | 26.77 | | 2012-02-22 | Taxi Airport-Graz | | 16.00 | |------------+------------------------+-------+-------| | | | | 91.36 | #+TBLFM: @>$4=vsum(@I$4..@II$4);%.2f::@3$4=@3$3*remote(mydemo-USD-EUR-rate,@2$2);%.2f::@4$4=@4$3*remote(mydemo-USD-EUR-rate,@2$2);%.2f::@5$4=@5$3*remote(mydemo-USD-EUR-rate,@2$2);%.2f::@6$4=@6$3*remote(mydemo-USD-EUR-rate,@2$2);%.2f - ~C-c C-c~ update values - ~C-c }~ visualize rows/columns - ~C-c '~ edit formula in separate buffer - ~C-c C-r~ switch between internal references (@3$2) and standard references (B3) - ~S-///~ shift reference at point - [[http://orgmode.org/worg/org-tutorials/org-spreadsheet-intro.html#sec-7][debugging formulas]] - many, many, many more table features in the documentation! - http://orgmode.org/worg/org-tutorials/index.html#sec-3-2 - http://orgmode.org/worg/org-faq.html#Tables - [[http://orgmode.org/worg/org-faq.html#fill-table-column-with-incremental-numbers][incremental numbers]], [[http://orgmode.org/worg/org-faq.html#table-column-filled-with-ERROR][what to do on #ERROR in columns]], ... - http://orgmode.org/worg/org-hacks.html#sec-1-4 - calculations using time, date, hex, GPS, ... *** referencing example with detailed explanation Here is another example working with tables and referencing other tables. I did this example twice: first in a column (vertical) based layout and then the very same example in a row (horizontal) based layout: **** column-based #+NAME: Income2012v | | Income May 2012 | Income June 2012 | |-------+-----------------+------------------| | Joe | 12 | 10 | | Alice | 22 | 24 | | Bob | 16 | 17 | |-------+-----------------+------------------| | sum | 50 | 51 | #+NAME: comparison-table-vertical | | June 2012 (from above) | plus 20 percent | June 2013 | Difference | |-------+------------------------+-----------------+-----------+------------| | Joe | 10 | 12.0 | 11 | -1.0 | | Alice | 24 | 28.8 | 31 | 2.2 | | Bob | 17 | 20.4 | 21 | 0.6 | |-------+------------------------+-----------------+-----------+------------| | sum | 51 | | | 1.8 | #+TBLFM: @>$5=vsum(@I..@II)::@>$3=string("")::$1='(identity remote(Income2012v, @@#$1))::$2='(identity remote(Income2012v, @@#$3))::$3=1.2 * remote(Income2012v, @@#$3);%.1f::$5=$4-$3;%.1f - all formulas explained in detail: - ~@>$5=vsum(@I..@II)~ - value: ~1.8~ - last row (~@>~) of column five (~$5~) is the sum of column five between first and second horizontal line (~@I..@II~) - ~@>$3=string("")~ - no value (empty) - overwrite the last row (~@>~) of column three (~$3~) with an empty string - otherwise it would get 1.2 times the value of corresponding column of table Income2012v as well - I chose not to want this sum in this column - ~$1='(identity remote(Income2012v, @@#$1))~ - values: ~Joe~ until ~sum~ - copy content of the first column of table "Income2012v" (Lisp formula ~'(identity remote(Income2012v, @@#$1))~) to the first column in this table (~$1~) - the "identity" statement prevents calc from interpreting the content - this is because I am too lazy to enter all names once again :-) - see also [[http://orgmode.org/worg/org-hacks.html#field-coordinates-in-formulas][Org-hacks]] for field formulas - ~$2='(identity remote(Income2012v, @@#$3))~ - values: ~10; 24; 17; 51~ - copy the content of the second column of table "Income2012v" to the second column in this table - you could skip this column and calculate the values of the next columns with direct references to ~remote(Income2012v, @@#$3)~ as well. However, it is more easy to compare visually if the values from 2012 are shown here as well (usability/readability) - note: by convention, only the values after the first horizontal line are taken - ~$3=1.2 * remote(Income2012v, @@#$3);%.1f~ - values: ~12.0; 28.8; 20.4; 61.2~ - column three (~$3~) is 120 percent of the values of the third column of table "Income2012v" with one decimal place (~;%.1f~) - note: 61.2 (1.2 times 51) is overwritten by formula ~@>$3~ from above - ~$5=$4-$3;%.1f~ - values: ~-1.0; 2.2; 0.6~ - column five (~$5~) is the difference between column four to column three with one decimal place Here is another example: how to sum up the numbers of the first column so far: #+NAME: Sum-up-of-other-column | Numbers | Sum of numbers so far | |---------+-----------------------| | 1 | 1 | | 5 | 6 | | 10 | 16 | | 50 | 66 | | 200 | 266 | | 1000 | 1266 | #+TBLFM: @3$2..@>$2=vsum(@2$1..$-1) The formular can be simplified even more by using a column formula: ~#+TBLFM: $2=vsum(@2$1..$-1)~ provides the same result as above. **** row-based #+NAME: Income2012h | | Joe | Alice | Bob | sum | | Income May 2012 | 12 | 22 | 16 | 50 | | Income June 2012 | 10 | 24 | 17 | 51 | #+NAME: comparison-table-horizontal | | Joe | Alice | Bob | sum | | Income June 2012 | 10 | 24 | 17 | 51 | | plus 20 percent | 12.0 | 28.8 | 20.4 | 60.0 | | June 2013 | 11 | 31 | 21 | | | Difference | -1.0 | 2.2 | 0.6 | 1.8 | #+TBLFM: @>$>=vsum(@5$2..@5$4)::@1$2..@1$4='(identity remote(Income2012h, @1$$#))::@2='(identity remote(Income2012h, @3$$#))::@3$2..@3$4=1.2 * remote(Income2012h, @3$$#);%.1f::@5$2..@5$4=@4-@3;%.1f - all formulas explained in detail: - ~@>$>=vsum(@5$2..@5$4)~ - value: ~1.8~ - last column in last row (~@>$>~) is the vector-sum (~vsum~) of column two to four of fifth row (~@5$2..@5$4~) - ~@1$2..@1$4='(identity remote(Income2012h, @1$$#))~ - values: ~Joe | Alice | Bob | sum~ - column two to four of first row (~@1$2..@1$4~) are copied from the corresponding fields of the first row (~@1$$#~) of table "Income2012h" - see also [[http://orgmode.org/worg/org-hacks.html#field-coordinates-in-formulas][Org-hacks]] for field formulas - ~@2='(identity remote(Income2012h, @3$$#))~ - values: ~2012 Income June | 10 | 24 | 17 | 51~ - the second row (~@2~) is copied from the corresponding fields of the first row (~@1$$#~) of table "Income2012h" - my guess: "2012" is moved to the beginning of the field most probably because it is interpreted as numeric value and not as string - ~@3$2..@3$4=1.2 * remote(Income2012h, @3$$#);%.1f~ - values: ~12.0 | 28.8 | 20.4 | 60.0~ - the columns two to four of the third row (~@3$2..@3$4~) is 120 percent of the corresponding values of the third row (~@3$$#~) of the table "Income2012h" with one decimal place (~;%.1f~) - ~@5$2..@5$4=@4-@3;%.1f~ - values: ~-1.0 | 2.2 | 0.6~ - the column two to four of the fifth row (~@5$2..@5$4~) is the difference of the values in the corresponding values of the fourth row and the third row (~@4-@3~) with one decimal place (~;%.1f~) ** column view ([[http://orgmode.org/org.html#Column-view][docu]]) :PROPERTIES: :COLUMNS: %25ITEM %TAGS %PRIORITY %TODO %10MyProperties :MyProperties_ALL: "Thomas" "Maria" "Susan" "Joe" :END: - ~C-c C-x C-c~ activate column view - ~e~ edit value - ~n/p~ next/previous value - ~q~ quit column view - ~a~ edit allowed values - ~C-c C-x p~ set property *** example sub-item :mytag1: :PROPERTIES: :MyProperties: Susan :END: *** NEXT [#B] another example :mytag2: :PROPERTIES: :MyProperties: Thomas :END: ** capture, refile, archive ([[http://orgmode.org/org.html#Capture-_002d-Refile-_002d-Archive][docu]]) - ~C-c c~ *capture* - ~C-c C-w~ *refile* - ~C-c C-x C-a~ *archive* - ~C-u C-u C-c c~ *goto last capture* - ~#+ARCHIVE: %s_done::~ per-file archive - ~C-c C-x a~ toggle ARCHIVE tag - ~C-u C-c C-x a~ check direct children for archiving #+BEGIN_SRC emacs-lisp ;; ###################################################### ;; templates for capturing C-c c ;; http://orgmode.org/org.html#Capture-templates (setq org-capture-templates '( ("s" "shorts-todo" entry (file+headline "~/share/all/org-mode/misc.org" "shorts") "* NEXT %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n" :empty-lines 1) ("e" "Event" entry (file+headline "~/share/all/org-mode/misc.org" "Events") "* %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n" :empty-lines 1) ("i" "IST Templates") ("is" "IST shorts" entry (file+headline "~/share/all/org-mode/IST.org" "shorts") "* NEXT %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n" :empty-lines 1) ("ie" "IST event" entry (file+headline "~/share/all/org-mode/IST.org" "Events") "* %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n" :empty-lines 1) ("ii" "IST isst" entry (file+headline "~/share/all/org-mode/IST.org" "Events") "* %? IST isst: \n:PROPERTIES:\n:CREATED: %U\n:END:\n\n- [[contact:Ingo Pill][Ingo Pill]]\n- [[contact:Thomas Quartisch][Thomas Quartisch]]\n\n" :empty-lines 1) ("b" "Besorgung" entry (file+headline "~/share/all/org-mode/hardware.org" "Besorgungen") "* TODO %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n" :empty-lines 1) ("C" "Clipboard" entry (file+headline "~/share/all/org-mode/misc.org" "shorts") "* TODO %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n%x\n\n" :empty-lines 1) ("c" "capture to inbox, refile later" entry (file "~/share/all/org-mode/inbox.org") "\n* %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n" :empty-lines 1) ("m" "movie" entry (file+headline "~/share/all/org-mode/movies.org" "inbox") "* TODO %?\n:PROPERTIES:\n:CREATED: %U\n:END:\n\n" :empty-lines 1) ("x" "xlog") ("xh" "xlog hometrainer" table-line (id "xlog-hometrainer") "| %T | | | |") ("xk" "Keyboard Akkus leer" table-line (id "3407c9b7-1b41-443b-9254-32c4af3a54e8") "| %T |") ) ) #+END_SRC ** attachments ([[http://orgmode.org/org.html#Attachments][docu]]) - ~C-c C-a~ *org-attach* (menu) - ~i~ *inherit* - ~s~ *set directory* - ~a~ attach: move file to task directory - ~c/m/l~ attach: copy/move/link file - much more ** dates & time ([[http://orgmode.org/org.html#Dates-and-Times][docu]]) - ~C-c .~ *insert active* <2012-04-23 Mon> (with ~C-u~: <2012-04-23 Mon 19:14>) - ~C-c !~ insert inactive [2012-04-23 Mon] (with ~C-u~: [2012-04-23 Mon 19:14]) - ~S-RIGHT/LEFT/UP/DOWN~ interactively change timestamp - ~C-c <~ *insert today* - ~C-c C-o~ open agenda for current timestamp - ~C-c C-d~ *insert DEADLINE* - ~C-c C-s~ *insert SCHEDULED* - ~C-u C-c C-d~ removing DEADLINE - ~C-u C-c C-s~ removing SCHEDULED - ~C-c / d~ sparse tree with deadlines - ~DEADLINE ~ defining repeated events/tasks - ~.+2w~ repetition interval starting with last DONE timestamp - ~++3m~ never show multiple times even if not DONE - ~.+2d/4d~ show up on agenda not earlier as 2 days until 4 days - ~+1w -2d~ repeat weekly but show not earlier as two days before - ~C-c C-x c~ clone (recurring) event with time-shift (~org-clone-subtree-with-time-shift~) - good idea: create recurring event and clone it with time-shift - this way, canceling single events or moving single events is possible - ~13:00-15:15~ or ~13:00+2:15~ time range - ~<2013-11-15 Fri>-<2013-11-17 Sun>~ date range - ~C-c C-y~ return time range between dates - ~UP/DOWN~ on time stamp start/end -> toggle active/inactive *Note:* please do not use time-stamps prior to [[https://en.wikipedia.org/wiki/Unix_time][UNIX epoch]] which is 1970-01-01. Some systems do handle those time-stamps fine, others produce errors. *** advanced date/time with sexp ([[http://orgmode.org/manual/Timestamps.html][docu]]) :PROPERTIES: :CREATED: [2014-07-21 Mon 21:11] :END: To do a thing every x days between two dates, put: : %%(and (diary-cyclic x M1 D1 Y1) (diary-block M1 D1 Y1 M2 D2 Y2)) thing 22:00-23:00 The nerd meeting on every 2nd Thursday of the month : <%%(diary-float t 4 2)> ** agenda ([[http://orgmode.org/org.html#Agenda-Views][docu]]) - ~C-c [~ add buffer to agenda - ~C-c ]~ remove buffer from agenda - ~C-c a~ show agenda command menu - ~C-c a a~ *invoke agenda view* - ~C-c C-x <~ *lock agenda* to subtree - ~C-c C-x >~ *release* agenda restriction *lock* when being *in agenda* mode: - ~q~ *quit agenda* - ~j~ *jump to date* - ~.~ *goto today* - ~f/b~ *forward/back* - ~v~ *choose view menu* - ~d/w~ *day/week view* - ~v d/w/m~ view for day/week/month - ~r~ *refresh* - ~RET~ *goto item* - ~SPC~ show item - ~<~ *toggle filter to file* - ~F~ *toggle follow mode* - ~o~ *delete other window* - ~/~ filter by tag - ~E~ toggle entry text - ~R~ toggle clock report - ~t~ *change TODO state* - ~:~ or ~T~ *set tags* - ~S-UP/DOWN~ *set priority* - ~,~ set priority - ~S-LEFT/RIGHT~ *change timestamp day* - ~>~ change timestamp to today - ~e~ set effort - ~m~ mark - ~u~ unmark - ~B~ bulk action - ~S~ *scatter marked TODOs* over the next N days - clocking - ~I~ start - ~O~ stop - ~X~ cancel - ~J~ jump to running clock entry - attachments to TODO entries - ~C-c C-a~ *attachment menu* - ~C-c C-a s~ *set attachment folder* - ~C-c C-a i~ inherit attachment folder - ~C-c C-a o~ *open attachment* - learn how to create your own agenda views: - http://orgmode.org/org.html#Custom-agenda-views - http://www.reddit.com/r/emacs/comments/2b9obs/org_users_what_did_it_take_you_a_long_time_to/cj4lb35 ** clocking time ([[http://orgmode.org/org.html#Clocking-work-time][docu]]) - ~C-c C-x C-i~ start clock on item - ~C-c C-x C-o/x~ stop or cancel clock on item - ~C-c C-x C-d~ display total subtree times - ~C-c C-c~ remove displayed times - ~C-c C-x C-r~ insert/update table with report - please do read [[http://irreal.org/blog/?p=5307][Irreal: Org Clocking and Idle Time]] for handling idle time for clocking *** example sub-hierarchy with report #+BEGIN: clocktable :maxlevel 2 :scope subtree Clock summary at [2012-11-19 Mon 11:17] | Headline | Time | |--------------+---------| | *Total time* | *27:16* | |--------------+---------| #+END: **** example item :LOGBOOK: CLOCK: [2012-11-19 Mon 11:16]--[2012-11-19 Mon 11:17] => 0:01 CLOCK: [2012-11-18 Sun 19:15]--[2012-11-18 Sun 19:23] => 0:08 :END: **** another item :LOGBOOK: CLOCK: [2012-11-18 Sun 19:26]--[2012-11-18 Sun 19:33] => 0:07 CLOCK: [2012-11-17 Sat 16:25]--[2012-11-18 Sun 19:25] => 27:00 :END: ** dynamic blocks with ELISP ([[http://orgmode.org/org.html#Dynamic-blocks][docu]]) - execute ELISP functions in special blocks (see docu) - ~C-c C-x C-u~ update block - ~C-u C-c C-x C-u~ update buffer blocks ** source code ([[http://orgmode.org/org.html#Working-With-Source-Code][docu]]) - python "Hello World" - ~C-c '~ *edit in native mode* - ~