Org mode syntax example
Table of Contents
-
-
- Basics +
- Document header +
- Section titles (headings) +
- Biggest heading (level 1) -
- Org miscellaneous +
- Paragraphs -
- Org macros -
- BigBlow addons +
- Lists + + +
- Miscellaneous effects + + +
- Source code + + +
- Images, video and audio + + +
- Special text boxes (“admonitions”) + + +
- Links + + +
- Org miscellaneous + + +
- Org macros +
- BigBlow addons
Basics
+Document header
Biggest heading
-+Title and author line: +
+ +#+TITLE: Org mode syntax example +#+AUTHOR: Fabrice Niessen + +My document provides... ++
+Attributes… +
+Section titles (headings)
+* Biggest heading (level 1) + +New chapter. + +** Bigger heading (level 2) + +New section. + +*** Big heading (level 3) + +New sub-section. + +**** Heading (level 4) + +New sub-sub-section. ++
Biggest heading (level 1)
+New chapter.
Bigger heading
-Bigger heading (level 2)
+New section.
Big heading
-Big heading (level 3)
+New sub-section.
Text breaks
--A single newline has no effect. -This line is part of the same paragraph. -
- --But an empty line -
- --demarcates paragraphs. -
- -
-By entering two consecutive backslashes,
-you can force to break lines
-without starting a new paragraph.
-
-For an horizontal line, insert at least 5 dashes: this is some text above an -horizontal rule -
--
-and some text below it. -
-Numbered headings
+Heading (level 4)
+New sub-sub-section. +
+Numbered headings
+You can create numbered headings up to a certain level by setting an option:
@@ -181,9 +259,83 @@ You can create numbered headings up to a certain level by setting an option:Text width
-Paragraphs
+Normal
+A single newline has no effect. +This line is part of the same paragraph. + +But an empty line + +demarcates paragraphs. ++
+A single newline has no effect. +This line is part of the same paragraph. +
+ ++But an empty line +
+ ++demarcates paragraphs. +
+Line breaks
+By entering two consecutive backslashes, +you can force to break lines \\ +without starting a new paragraph. ++
+By entering two consecutive backslashes,
+you can force to break lines
+without starting a new paragraph.
+
Horizontal rules
+For an horizontal line, insert at least 5 dashes: this is some text above an +horizontal rule +----- +and some text below it. ++
+For an horizontal line, insert at least 5 dashes: this is some text above an +horizontal rule +
++
+and some text below it. +
+Text width
+One morning, when Gregor Samsa woke from troubled dreams, he found himself transformed in his bed into a horrible vermin. He lay on his armour-like back, @@ -196,44 +348,83 @@ compared with the size of the rest of him, waved about helplessly as he looked.
Lists
-Lists
+-Org markup allows you to create bulleted or numbered lists. It allows any +Org markup allows you to create bulleted or numbered lists. It allows any combination of the two list types.
Unordered lists
-Unordered lists
+-Itemized lists are marked with bullets. They are convenient to: +Itemized lists are marked with bullets. Create them with a minus or a plus sign.
++They are convenient to: +
+ +- Organize data, and +- Make the document + + Prettier, and + + Easier to read. ++
-
-
- organize data, and -
- make the document +
- Organize data, and +
- Make the document
-
-
- prettier, and -
- easier to read. +
- Prettier, and +
- Easier to read.
-Create them with a minus or a plus sign. -
Ordered lists
-Checklists
+- [X] Checked +- [-] Half-checked +- [ ] Not checked +- Normal list item ++
-
+
- ☑ Checked +
- ☐ Half-checked +
- ☐ Not checked +
- Normal list item +
Ordered lists
+Enumerated lists are marked with numbers or letters:
+1. First element + 1) First sub-item + 2) Last sub-item +2. Second element ++
- First element
-
@@ -247,6 +438,14 @@ Enumerated lists are marked with numbers or letters:
You can have ordered lists with jumping numbers:
+
- First
- Second @@ -255,24 +454,38 @@ You can have ordered lists with jumping numbers:
+ ++1. [@1] First +2. [@2] Second +5. [@5] Jump to 5th +
+
Definition lists
--
-
- Definition list
- List containing definitions. +
- Term to define
- Explication of the term. +
- First term to define
- Definition of the first term. + +
- Second term
- Explication of the second term.
Definition lists
++Labeled, multi-line lists. +
-- First term to define :: + Definition of the first term. + +- Second term :: + Explication of the second term. ++
-
+
Miscellaneous effects
-Include Org files
-Miscellaneous effects
+Include Org files
+
You can include another Org file and skip its title by using the :lines
argument
to #+INCLUDE
:
@@ -293,9 +506,9 @@ File inclusion, through INCLUDE keywords, is an export-only feature.
Inline HTML
-Inline HTML
+You can include raw HTML in your Org documents and it will get kept as HTML when it’s exported. XXX @@ -345,9 +558,9 @@ Don’t edit the exported HTML file!
Inline LaTeX
-Inline LaTeX
+You can also use raw LaTeX. XXX
@@ -358,24 +571,117 @@ Text can be preformatted (in a fixed-width font).Centered text
-Centered text
+
+This text is
+aligned to the left!
+
-This text is centered!
+This text is
+centered!
+This text is
+aligned to the right!
+
Code blocks
-Line numbers
-Source code
+Inline code
+Reference code like variables or functions inline. ++
+Reference code like variables
or functions
inline.
+
+You can also evaluate code inline as follows: 1 + 1 is 1 + 1
+
2
.
+
Code block with syntax highlighting
++The source code blocks support syntax highlighting: +
+ +/* + * Application that displays a "Hello" message to the standard output. + */ +int main(int arc, char **argv) +{ + printf("Hello, %s!\n", (argc>1) ? argv[1] : "World"); + return 0; +} ++
+The following language strings are currently recognized: +
+ ++Awk, C, R, Asymptote, Calc, Clojure, CSS, Ditaa, Dot, Emacs Lisp, Forth, Fortran, Gnuplot, Haskell, IO, J, Java, Javascript, LaTeX, Ledger, Lilypond, Lisp, Makefile, Maxima, Matlab, Mscgen, Ocaml, Octave, Org, Perl, Pico Lisp, PlantUML, Python, Ruby, Sass, Scala, Scheme, Screen, Shell Script, Shen, Sql, Sqlite, ebnf2ps. +
+ ++Code block with long lines: +
+ +testing testing testing testing testing testing testing testing testing testing +0 1 2 3 4 5 6 7 8 9 +123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456 ++
+For PDF (LaTeX), one solution is to surround the code block such as: +
+ +print("This block is in scriptsize") ++
+This block is in scriptsize ++
Line numbers
+
Both in
The output from the execution of programs, scripts or commands can be inserted
in the document itself, allowing you to work in the reproducible research
@@ -438,28 +744,28 @@ mindset.
A one-liner result:
Data to be charted:
-You can also evaluate code inline as follows: 1 + 1 is .
-
Emphasize (italics), strongly (bold), and very strongly (bold italics).
Use the
Everything should be made as simple as possible,
-but not any simpler – Albert Einstein
+but not any simpler. – Albert Einstein
Using non-breaking spaces.
You can embed LaTeX math formatting in Org mode files using the following
syntax:
@@ -815,110 +1111,96 @@ environments ($$, …).
Some of the widely used special characters (converted from text characters to
their typographically correct entitites):
-À Á
-
-Dash: – —
-
-Marks: ¡ ¿
-
-Quotations: « »
-
-Miscellaneous: ¶ ª
-
-Property marks: © ®
-
-Currency: ¢ € ¥ £
-
The Greek letters α, β, and γ are used to denote angles.
-Science: ± ÷
-
-Arrows: → → ← ↔ ⇒ ⇐ ⇔
-
-Function names: arccos cos
-
-Signs and symbols: • *
-
-Suits: ♣ ♠
-
It’s possible to add comments in the document.
You can create tables with an optional header row (by using an horizontal line
of dashes to separate it from the rest of the table).
@@ -1058,9 +1340,9 @@ Different from the following:
Here is a table on the left side:
You can insert image files of different formats to a page:
Videos can’t be added directly but you can add an image with a link to the video like this:
Simple box (“inline task”): XXX
You can have
+Admonitions: attention, caution, danger, error, hint, important, note, tip,
+warning and the generic admonition.
+
+(Most themes style only
+A note box is displayed as follows:
+
+Note example
+See also
+
+A warning box is displayed as follows:
+
+Warning example
+Caution
+
+Attention
+
+Admonitiontodo
+
+A tip box is displayed as follows:
+
+Tip example
+Important
+
+Hint
+
+Success
+
An info box is displayed as follows:
-A tip box is displayed as follows:
+Danger
-Tip example
-A note box is displayed as follows:
-
-Note example
-A warning box is displayed as follows:
+Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
+tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
+quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
+consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
+cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
+proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
+Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac
+turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor
+sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies
+mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien
+ullamcorper pharetra. Vestibulum erat wisi…
+
+Phasellus ut libero. Nulla in libero non enim tristique sollicitudin. Ut
+tempor. Phasellus pellentesque augue eget ante. Mauris malesuada. Donec sit
+amet diam sit amet dolor placerat blandit. Morbi enim purus, imperdiet in,
+molestie sit amet, pellentesque eu, mauris. In vel erat vel ipsum bibendum
+commodo. Curabitur accumsan. Nam sed metus. Etiam tristique bibendum justo.
+
+epigraph
+
+highlights
+
+pull-quote
+
+Blockquote
This document is available in plain text, HTML and PDF.
-See:
+See http://www.pirilampo.org/ (automatic!) and the
+Org mode Web site.
+
-See the Org mode Web site.
-
Mailto link
@@ -1448,24 +1901,73 @@ See the Org mode Web site.
+ Inline anchors make arbitrary content referenceable.
+
+Use a cross reference to link to this location.
+
+Links generally point to an headline.
+
+They can also point to a link anchor in the current
+document or in another document.
+
+See:
+
Timestamps:
By default,
@@ -1499,9 +2001,9 @@ That can be changed by adding such a line (into your Org document):
This section will be collapsed when loading the page because the entry has the
@@ -1514,9 +2016,9 @@ Powerful, no?
You can add tags to any entry, and hightlight all entries having some specific
tag by clicking on the buttons made accessible to you in the “Dashboard”.
@@ -1524,9 +2026,9 @@ tag by clicking on the buttons made accessible to you in the “Dashboard&rd
Now, you can even make your weekly review in the HTML export… Press the
This text is colored in blue.
The string example
and in src
snippets, you can add a -n
switch to the end of the
begin
line, to get the lines of the example numbered.
@@ -428,9 +734,9 @@ In line
-Output
-Output
+Text
-Text
+date +"%Y-%m-%d"
+
date +"%Y-%m-%d"
-2014-03-15
+2015-02-26
Graphics
-Graphics
+R code block
-R code block
+library(ggplot2)
@@ -588,20 +894,10 @@ Plot:
Inline code
-Notes at the footer
-Notes at the footer
+
Formatting text
-Text effects
-Formatting text
+Text effects
+Quotations
-Quotations
+quote
block to typeset quoted text.
@@ -725,9 +1021,9 @@ See http://www.google.com/ for more informa
Spaces
-Spaces
+Mathematical formulae
-Mathematical formulae
+Special characters
-Special characters
+Accents
-Accents
+
+
Punctuation
-Punctuation
+
+
Commercial symbols
-Commercial symbols
+
+
Greek characters
-Greek characters
+Math characters
-Math characters
+
+
Misc
-Misc
+
+
Comments
-Comments
+Tables
-Tables
+Align tables on the page
-Align tables on the page
+Images, video and audio
-Images
-Images, video and audio
+Images
+Video
-Video
+Sounds
+Sounds
Special text boxes
-Special text boxes (“admonitions”)
+Example
-Example
+example
blocks.
info
, tip
, note
or warning
) which all have
a different default image.
+
+note
and warning
specially.)
+Info
-Note
+
+This is a useful note…
+Warning
+
+Be careful! Check that you have…
+Tip
+
+Try doing it this way…
+Info
+Tip
-Danger
+
-Try doing it this way…
+Error
Note
-Neutral
+
-This is a useful note…
+Neutral
Warning
-Additional body elements
+Special highlighted body elements
+Block quote with optional attribution line
+Block quotes with their own class attribute
+Links
-Hyperlinks
-Links
+[square brackets]
.
Internal links
-External links
+See http://www.pirilampo.org (automatic!) and the
+Org mode Web site.
+
+Relative links
+
External links
-Email links
+Mailto link
+
+Internal links
+Inline anchors
+<<anchor>> Inline anchors make arbitrary content referenceable.
+
+Use a cross reference to link to this location.
+
+Org miscellaneous
-Dates
-Internal cross references
+
+
+Org miscellaneous
+Dates
+DONE [A] Buy GTD book online
-DONE [A] Buy GTD book online
+DONE
actions will be collapsed.
TODO [A] Read GTD book
-TODO [A] Read GTD book
+TODO [B] Apply GTD methodoloy
-TODO [B] Apply GTD methodoloy
+Some note computer write
-Some note computer write
+Weekly review computer
-Weekly review computer
+r
key
to start entering the “review mode” where all but one active entry are
@@ -1536,9 +2038,9 @@ collapsed, so that you can really focus on one item at a time!
Org macros
-Org macros
+BigBlow addons
-BigBlow addons
+fixme
(in upper case) gets replaced by a “Fix Me!” image: