Orgmode tables and IDs

Tables serve as a spreadsheet environment within orgmode. We can assign unique identifiers to a cell using caret ^ and underscore _ on the first column of the table, to point either to the element above or to the element below respectively. Note that these identifiers should contain only letters & numbers (and not special characters like underscore, dash etc), as a result CamelCase seems a good choice.

Using C-c C-x p (or M-x org-set-property) in a heading we can assign a property. Each property has a unique key and a value. Whereas we can assign any name for the key a built-in property is ID. If we would like to ensure that we will get a unique ID value we can call M-x org-id-get-create.

Properties are kind of invisible in orgmode as they are not visible in html, pdf and other publishing utilities, and they may have inheritance, though this not a default feature. Also note that if we are using unique IDs we can call them from different files. So, unique IDs behave differently from internal links.

** Exams
   :PROPERTIES:
   :ID:       unique-exams-id
   :END:
#+NAME: ratings
|   | Grades      | Tom         | John         | Andy         | Mean     |
|---+-------------+-------------+--------------+--------------+----------|
| # | Mathematics | 5.625       | 8.125        | 4.875        | 6.208    |
| ^ |             | TomMathExam | JohnMathExam | AndyMathExam | MeanMath |
| _ |             | TomPhysExam | JohnPhysExam | AndyPhysExam | MeanPhys |
| # | Physics     | 7.875       | 9.125        | 5.25         | 7.417    |
#+TBLFM: $> = vmean($>>>>..$>>);%.3f

** Final
   :PROPERTIES:
   :ID:       unique-final-grades
   :END:
|   | Final       | Tom     | John     | Andy     | Mean      |
|---+-------------+---------+----------+----------+-----------|
| # | Mathematics | 6       | 7        | 6        | 6.333     |
| ^ |             | TomMath | JohnMath | AndyMath | FinalMath |
| _ |             | TomPhys | JohnPhys | AndyPhys | FinalPhys |
| # | Physics     | 8       | 8        | 6        | 7.333     |
#+TBLFM: $TomMath=remote(unique-exams-id, ($TomMathExam + $MeanMath)/2);%.0f::$JohnMath=remote(unique-exams-id, ($JohnMathExam + $MeanMath)/2);%.0f::$AndyMath=remote(unique-exams-id, ($AndyMathExam + $MeanMath)/2);%.0f
#+TBLFM: $TomPhys=remote(unique-exams-id, ($TomPhysExam + $MeanPhys)/2);%.0f::$JohnPhys=remote(unique-exams-id, ($JohnPhysExam + $MeanPhys)/2);%.0f::$AndyPhys=remote(unique-exams-id, ($AndyPhysExam + $MeanPhys)/2);%.0f
#+TBLFM: $FinalMath=vmean($>>>>..$>>);%.3f::$FinalPhys=vmean($>>>>..$>>);%.3f

Latest posts