From d57510acb3d235487f9a04a5fcf8260fbd6ed7f6 Mon Sep 17 00:00:00 2001 From: Fabrice Niessen <(concat "fniessen" at-sign "pirilampo.org")> Date: Thu, 26 Feb 2015 10:15:13 +0100 Subject: [PATCH] Improve cheat sheet --- org-mode-syntax.html | 1178 ++++++++++++++++++++++++++++++------------ org-mode-syntax.org | 250 +++++---- 2 files changed, 1003 insertions(+), 425 deletions(-) diff --git a/org-mode-syntax.html b/org-mode-syntax.html index 4646701..fc0db5e 100755 --- a/org-mode-syntax.html +++ b/org-mode-syntax.html @@ -10,8 +10,9 @@ - - + + + -
+
+ UP + | + HOME +

Org mode syntax example

@@ -105,70 +163,90 @@ documents, creating Web pages and much more!

-

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
+
+
+
  1. First element
      @@ -247,6 +438,14 @@ Enumerated lists are marked with numbers or letters: You can have ordered lists with jumping numbers:

      +
      + +
      1. [@1] First
      +2. [@2] Second
      +5. [@5] Jump to 5th
      +
      +
      +
      1. First
      2. Second
      3. @@ -255,24 +454,38 @@ You can have ordered lists with jumping numbers:
-
-

Definition lists

-
-
-
Definition list
List containing definitions.
+
+

Definition lists

+
+

+Labeled, multi-line lists. +

-
Term to define
Explication of the term.
+
+ +
- First term to define ::
+     Definition of the first term.
+
+- Second term ::
+     Explication of the second term.
+
+
+ +
+
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 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

+

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.

-
-
Text
-
+
+

Text

+

A one-liner result:

-
date +"%Y-%m-%d"
+
date +"%Y-%m-%d"
 
-2014-03-15
+2015-02-26
 
-
-
Graphics
-
+
+

Graphics

+

Data to be charted:

@@ -565,9 +871,9 @@ The resulting chart:
-
-
R code block
-
+
+

R code block

+
library(ggplot2)
@@ -588,20 +894,10 @@ Plot:
 
-
-
-

Inline code

-
-

-You can also evaluate code inline as follows: 1 + 1 is . -

-
-
- -
-

Notes at the footer

-
+ -
-

Formatting text

-
-
-

Text effects

-
+
+

Formatting text

+
+
+

Text effects

+

Emphasize (italics), strongly (bold), and very strongly (bold italics).

@@ -647,9 +943,9 @@ Other elements to use sparingly are:
-
-

Quotations

-
+
+

Quotations

+

Use the quote block to typeset quoted text.

@@ -684,7 +980,7 @@ A short one:

Everything should be made as simple as possible, -but not any simpler – Albert Einstein +but not any simpler. – Albert Einstein

@@ -725,9 +1021,9 @@ See http://www.google.com/ for more informa
-
-

Spaces

-
+
+

Spaces

+

Using non-breaking spaces.

@@ -740,9 +1036,9 @@ Or add/use an Org entity?
-
-

Mathematical formulae

-
+
+

Mathematical formulae

+

You can embed LaTeX math formatting in Org mode files using the following syntax: @@ -815,110 +1111,96 @@ environments ($$, …).

-
-

Special characters

-
+
+

Special characters

+

Some of the widely used special characters (converted from text characters to their typographically correct entitites):

-
-

Accents

-
-

-À Á -

+
+

Accents

+
+
    +
  • À Á
  • +
-
-

Punctuation

-
-

-Dash: – — -

+
+

Punctuation

+
+
    +
  • Dash: – —
  • -

    -Marks: ¡ ¿ -

    +
  • Marks: ¡ ¿
  • -

    -Quotations: « » -

    +
  • Quotations: « »
  • -

    -Miscellaneous: ¶ ª -

    +
  • Miscellaneous: ¶ ª
  • +
-
-

Commercial symbols

-
-

-Property marks: © ® -

+
+

Commercial symbols

+
+
    +
  • Property marks: © ®
  • -

    -Currency: ¢ € ¥ £ -

    +
  • Currency: ¢ € ¥ £
  • +
-
-

Greek characters

-
+
+

Greek characters

+

The Greek letters α, β, and γ are used to denote angles.

-
-

Math characters

-
-

-Science: ± ÷ -

+
+

Math characters

+
+
    +
  • Science: ± ÷
  • -

    -Arrows: → → ← ↔ ⇒ ⇐ ⇔ -

    +
  • Arrows: → → ← ↔ ⇒ ⇐ ⇔
  • -

    -Function names: arccos cos -

    +
  • Function names: arccos cos
  • -

    -Signs and symbols: • * -

    +
  • Signs and symbols: • *
  • +
-
-

Misc

-
-

-Suits: ♣ ♠ -

+
+

Misc

+
+
    +
  • Suits: ♣ ♠
  • +
-
-

Comments

-
+
+

Comments

+

It’s possible to add comments in the document.

-
-

Tables

-
+
+

Tables

+

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:

-
-

Align tables on the page

-
+
+

Align tables on the page

+

Here is a table on the left side:

@@ -1181,13 +1463,14 @@ to the right.
+
-
-

Images, video and audio

-
-
-

Images

-
+
+

Images, video and audio

+
+
+

Images

+

You can insert image files of different formats to a page:

@@ -1273,9 +1556,9 @@ Place images side by side: XXX
-
-

Video

-
+
+

Video

+

Videos can’t be added directly but you can add an image with a link to the video like this:

@@ -1286,22 +1569,22 @@ Videos can’t be added directly but you can add an image with a link to the
-
-

Sounds

+
+

Sounds

-
-

Special text boxes

-
+
+

Special text boxes (“admonitions”)

+

Simple box (“inline task”): XXX

-
-

Example

-
+
+

Example

+

You can have example blocks.

@@ -1318,12 +1601,123 @@ Find entries with an exact phrase – To do this, put the phrase in You can create several other boxes (info, tip, note or warning) which all have a different default image.

+ +

+Admonitions: attention, caution, danger, error, hint, important, note, tip, +warning and the generic admonition. +

+ +

+(Most themes style only note and warning specially.) +

-
-

Info

-
+
+

Note

+
+

+A note box is displayed as follows: +

+ +
+

+Note example
+This is a useful note… +

+ +
+ +
+

+See also +

+ +
+
+
+ +
+

Warning

+
+

+A warning box is displayed as follows: +

+ +
+

+Warning example
+Be careful! Check that you have… +

+ +
+ +
+

+Caution +

+ +
+ + +
+

+Attention +

+ +
+ +
+

+Admonitiontodo +

+ +
+
+
+ +
+

Tip

+
+

+A tip box is displayed as follows: +

+ +
+

+Tip example
+Try doing it this way… +

+ +
+ +
+

+Important +

+ +
+ + +
+

+Hint +

+ +
+ +
+

+Success +

+ +
+
+
+ +
+

Info

+

An info box is displayed as follows:

@@ -1338,80 +1732,120 @@ Did you know…
-
-

Tip

-
+
+

Danger

+
+

-A tip box is displayed as follows: +Danger

-
+
+ +

-Tip example
-Try doing it this way… +Error

-
-

Note

-
+
+

Neutral

+
+

-A note box is displayed as follows: -

- -
-

-Note example
-This is a useful note… +Neutral

-
-

Warning

-
+
+

Additional body elements

+
+
+

Special highlighted body elements

+

-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. +

+
+
+ +
+

Block quote with optional attribution line

+
+
+

+epigraph +

+ +
+
+
+ +
+

Block quotes with their own class attribute

+
+
+

+highlights +

+ +
+ +
+

+pull-quote +

+ +
+ +
+

+Blockquote

- -