Org Mode Manual Learning Notes
Learning notes recorded during reading org mode manual, simple and incomplete, because they are all about basic syntax.
headers
Headers are lines started with star * (be careful that there should not be any indent before the star, otherwise it will be an item of a list, not a header).
The first level header is with one star *, and the second with two stars, and so on.
lists
unsorted lists
Unsorted list items start with -, + or *, but the star is NOT recommanded because it is not easy to distinguish it from headers.
- so, this is an unsorted list item using -
- this one using +
sorted lists
Sorted list items start with 1. or 1), if org-alphabetical-lists
is configured, a. a) A. A) can also be used.
- sorted list item using a right parenthesis )
- using a period .
description lists
Description list items are unsorted list items, which contain separator :: to distinguish description term from description.
- description example
- this is a description for the "description example"
foot notes
tables
create a table is very easy, like what I am doing below:
name | age | job |
---|---|---|
Kelvin Hu | 23 | Software Engineer |
Someone | Unknown | Unknown |
several useful key bindings:
C-c -
:: mapping command is org-table-insert-hline, will insert a separate line belowC-c RET
:: mapping command is org-table-hline-and-move, insert a separate line and move to next rowC-c |
:: mapping command is org-table-create-or-convert-from-region, create or convert table
links
Links exist between two square brackets, like below:
kelvin's github blog or http://kelvinh.github.com
useful key bindings:
-
C-c C-o
- org-open-at-point, open the link in browser
for more information about links, please visit offical org doc: click here
markup rules
title
The line below will be considered as the title of this document:
#+title: the line will be used as the title of current document note that the case is not sensitive, so #+title: will have the same effect as #+TITLE: and also do not forget the colon ":"
several other useful syntax
#+BEGIN_VERSE and #+END_VERSE: the contents between the two tags will be outputed originaly, with no format '#+BEGIN_QUOTE' and '#+END_QUOTE': the contents between the two tags are treated as quoting (why I add a quote ' here? you may try it then you will know why I add it here ^_^) #+BEGIN_CENTER and #+END_CENTER: the two tags will center the contents between them
emphasis and monospace
As the offical doc says, you can make word bold, italic and underlined, and also strike through. also there are other two syntax: code
and verbatim
, I do not quite know what they are used for.
horizontal rules
a line with at least 5 dashes and only contains dashes will be converted into a horizontal line, like below:
comments
several rules:
1) lines start with # 2) indented lines start with #+ 3) contents between #+BEGIN_COMMENT and #+END_COMMENT 4) entire subtree starts with keyword COMMENT
C-c ;
can toggle the COMMENT keyword at the beginning of an entry
note: all comments will NOT be exported
useful syntax again
'#+begin_example' example here... '#+end_example' '#+begin_src <syntax> [-n -r]' some code here... '#+end_src'
the <syntax> stands for the type, e.g. emacs-lisp
e.g. as below:
1: (defun hello-world() 2: (print "hello world"))
public class Test { public static void main(String[] args) { System.out.println("hello world"); } }
include files
for example: #+include: "~/.emacs.d/init.el" src emacs-lisp will insert the contents of ~/.emacs.d/init.el at current position, as below: (the second parameter is the tag type, "src" stands for "#+begin_src/#+end_src" pair, so do "quote" and "example")
#+include: "~/.emacs.d/init.el" src emacs-lisp