Org Mode
Definitions #
Headlines #
Headline 1 #
Some text side headline 1
Headline 2 #
Some text side headline 2
lists #
Bullet list #
- item 1
- item 2
Numbered list #
- item 1
- M-RET gives me a new number
Note: hold
Shift+left/right arrowto change number type
Checklist [0/5]
#
- we can even have check lists
- M-S-RET gives a new item with a check box
- C-c C-c check/unchecks a box
- you can have sub items
- like this
- that can be checked off individually
- and you can track the number of items by adding
[0/0]to the end of a line above a checklist - this updates when you check items off
definition lists #
- definition lists
- these are useful sometimes
- item 2
- M-RET again gives another item, and long lines wrap in a tidy way underneath the definition
Why org mode is good? #
Org Tables CS fc #
| position | ease | box | interval | due |
|---|---|---|---|---|
| front | 2.20 | 3 | 6.00 | 2021-09-06T07:56:14Z |
Navigation #
note: ¦ is broken pipe used as a replacement of | to escape it.
| create column | ¦¦ |
|---|---|
| create table with predefined columns | `C-c ¦` |
| create new row | <TAB> from last row |
| visit each column | S-<TAB> or <TAB> |
| change column order | M-<right> or M-<left> |
| change row order | M-<up> or M-<down> |
| inserting/deleting row/column | S-M-<down> or <right> |
| add more lines to the table | C-c ~ |
| edit table | C-c ' |
| fix the columns sizes | C-c C-c |
Convert Text/data into table #
select region and C-c | assumes TAB or , separation to create table
C-u C-c | forces CSV
C-u C-u C-c | forces tab
C-u C-u C-u C-c |
- prompts for regular expression to separate
- replaces the regular expression match column boundaries
- use C-u in visual mode
C-u 3 C-c | uses 3 spaces for separation
Formulas #
References #
- C-c ?
- know reference of current field or cell
- $2
- 2nd col
- @2
- 2nd line/row
Formulas #
- :=vmean($2..$3)
- mean of 2nd and 3rd col
range formula
ref
#+TBLFM: @10$2..@10$8=vsum(@2..@8) - C-c =
- to edit formula in mini buffer
- C-u C-c =: to edit cell formula
- C-c '
- to edit in separate buffer
- visually highlights the references
- C-u C-c C-c apply the formula to the entire column
Formatting #
texts #
You can make words
- ‘*bold*’
- ‘/italic/’,
- ‘_underlined_’,
- ‘=verbatim=’ and
- ‘~code~’, and,
- ‘+strike-through+’
lines #
C-c -convert lines to bullets with “-” then useShift-arrowto change the bulletsC-c *To add “*s” to the lineC-c EnterTo create a new headline
Links #
To create a link and reference it in another org node #
`org-store-link` then `org-insert-link` ref
Tags #
Difference between “tag” and “filetags” #
# example of tag
\* Meeting with the French group :work:
\** Summary by Frank :boss:notes:
\*** TODO Prepare slides for him :action:
# the final heading has the tags ‘work’, ‘boss’, ‘notes’, and ‘action’ even though the final heading is not explicitly marked with those tags (inheritance).
# example of file tag, exists on top of a file
#+FILETAGS: :Peter:Boss:Secret:
*Filetags are inherited by all the nodes inside a file as they are set at hypothetical level 0.*
Tag inheritance #
A tag applied to a node is inherited by all the subnodes and trees
Exclude tags while exporting #
org-export-exclude-tags or EXCLUDE_TAGS.
By configuring the org-export-exclude-tags variable, or an EXCLUDE_TAGS file variable, then inserting a matching Org tag on a sub-heading, that content will not appear in the exported Markdown or in the published post, but will remain intact in the original .org file. In my case, it’s a :noexport: tag.
Properties #
Setting #
c-c c-x p: set properties For making a TODO as habit style: habit
C-c C-c at the properties tag #
shows option to set, delete etc
C-c C-x
#
Set properties
Motion, navigation #
Same level #
- C-j/C-k: headlines move up and down same level
- [[]] : headlines up and down visible level
- zu: move up higher level heading
- zd: move down level heading
Date/time prompt #
Date examples #
‘3-2-5’ ⇒ 2003-02-05 ‘2/5/3’ ⇒ 2003-02-05 ‘14’ ⇒ 2006-06-14 ‘12’ ⇒ 2006-07-12 ‘2/5’ ⇒ 2007-02-05 ‘Fri’ ⇒ nearest Friday (default date or later) ‘sep 15’ ⇒ 2006-09-15 ‘feb 15’ ⇒ 2007-02-15 ‘sep 12 9’ ⇒ 2009-09-12 ‘12:45’ ⇒ 2006-06-13 12:45 ‘22 sept 0:34’ ⇒ 2006-09-22 0:34 ‘w4’ ⇒ ISO week for of the current year 2006 ‘2012 w4 fri’ ⇒ Friday of ISO week 4 in 2012 ‘2012-w04-5’ ⇒ Same as above
Time examples #
‘+0’ ⇒ today ‘.’ ⇒ today ‘+2h’ ⇒ two hours from now ‘+4d’ ⇒ four days from today ‘+4’ ⇒ same as +4d ‘+2w’ ⇒ two weeks from today ‘++5’ ⇒ five days from default date ‘+2tue’ ⇒ second Tuesday from now
Relative dates #
- h: hour
- d: day
- w: week
- m: month (not minute)
- y: year
Examples #
Time:
‘1pm => 1pm today’
Range
‘11am-1:15pm’ ⇒ 11:00-13:15 ‘11h-13h15’ ⇒ same as above ‘11am–1:15pm’ ⇒ same as above ‘11am+2:15’ ⇒ same as above
Org slide presentation #
Key bindings #
- M-m o s: enter org tree slide mode
- f8: slide content
- f9: move to previous tree
- f10: move to next tree
Images #
Resize #
Using mouse #
Click on the image and scroll to resize.
Using metadata attributes
#
ref
Set
(setq org-image-actual-width nil)
#+NAME: fig:figure name
#+CAPTION: figure name
#+ATTR_ORG: :width 200
#+ATTR_LATEX: :width 2.0in
#+ATTR_HTML: :width 200
[[file:./file.png]]
Using “org-download” package #
ref
set the fixed width for the downloaded images
(setq org-download-image-org-width 350)
Source blocks in Org Mode #
Python example #
results #
:results value #
default code should execute like a function and return a value.
:results output #
Org returns the contents of the standard output stream as text results.
AI #
Is Emacs the greatest editor?
[AI]: As an AI language model, I don’t have an opinion on whether Emacs is the greatest editor or not. Opinions on the best editor vary depending on personal preferences, programming needs, and level of expertise. Emacs is a powerful and customizable text editor that has been popular among programmers and writers for decades. However, other editors such as Vim, Sublime Text, and Atom also have their strong supporters. It ultimately comes down to what works best for the individual user.
[ME]: