diff --git a/README.html b/README.html new file mode 100755 index 0000000..d26a5e6 --- /dev/null +++ b/README.html @@ -0,0 +1,2312 @@ + + + + + +Org mode syntax quick reference + + + + + + + + + + + + + + + + +
UP | HOME
+
+

Org mode syntax quick reference

+
+

Table of Contents

+
+ +
+
+ +++ + + + + + + + + + + + + + + +
FrameworkOrg mode 8
Bug trackerhttps://github.com/fniessen/refcard-org-mode/issues
Sourcehttps://github.com/fniessen/refcard-org-mode
+
+

Summary

+
+ +
+

This is an Org mode document, using the .org extension (supported by GitHub).

+

Org mode is an easy-to-write plain text formatting syntax for authoring notes, articles, LaTeX documents, books, Web pages, Beamer slide decks and much more!

+

This is a cheat sheet for Org mode 8 (because of some markup syntax changes since Org mode 7), using ReadTheOrg CSS.

+

Reading through all the documentation is highly recommended, but for the truly impatient, following are some quick steps to get started.

+
+
+
+
+

Document header

+
+

Title and author line:

+
+
+#+TITLE:     Org mode syntax examples
+#+AUTHOR:    Fabrice Niessen
+
+My document provides...
+
+

It's a good practice to also include an email line following the author line.

+
+
+#+EMAIL:     john.doe@example.com
+
+
+
+
+

Document settings

+
+
+

Document description

+
+
+#+DESCRIPTION: This document catalogs a set of tips and tricks for composing documents in Org mode.
+#+KEYWORDS:  org-mode, syntax, quick reference, cheat sheet, recommended practices, latex, beamer, html
+#+LANGUAGE:  en
+
+
+
+

Section numbering

+
+
+
+#+OPTIONS:   H:4
+
+
+
+#+OPTIONS:   num:nil
+
+
+
+
+

Table of contents

+
+

Set the toc attribute to activate an auto-generated table of contents (limited to its 2 first levels) at the top of document.

+
+
+#+OPTIONS:   toc:2
+
+
+
+#+OPTIONS:   p:t
+
+
+

The ALT_TITLE property allows to set an alternate title (shorter, for example) for a given headline in the table of contents and other running heads.

+
+
+
+
+

List of figures

+
+

#+TOC: figures is not implemented yet in the HMTL backend.

+
+
+
+

List of tables

+
+

#+TOC: tables is already implemented in the HTML backend.

+
+
+
+

List of equations

+
+
+
+

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

Bigger heading (level 2)

+
+

New section.

+
+
+

Big heading (level 3)

+
+

New sub-section.

+
+
+
Heading (level 4)
+
+

New sub-sub-section.

+
+
+
+
+
+

Numbered headings

+
+

You can create numbered headings up to a certain level by setting an option:

+
+
+#+OPTIONS: H:4
+
+
+
+
+
+

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, and if he lifted his head a little he could see his brown belly, slightly domed and divided by arches into stiff sections. The bedding was hardly able to cover it and seemed ready to slide off any moment. His many legs, pitifully thin compared with the size of the rest of him, waved about helplessly as he looked.

+
+
+
+
+

Formatting text

+
+

Text effects.

+
+
+

Bold and italic

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

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

+

Markup elements can be nested:

+
+
+This is italic text which contains underlined text within it, whereas this is
+normal underlined text.
+
+

This is italic text which contains underlined text within it, whereas this is normal underlined text.

+

Markup can span across multiple lines, by default no more than 2:

+
+
+*This
+is not
+bold.*
+
+

*This is not bold.*

+

Org mode does not interpret a marker surrounded by alphanumeric characters as an emphasis marker. So, you can't (easily) emphasize just part of a word:

+
+
+Not feas*ible*.
+
+

Not feas*ible*.

+
+
+
+

Monospace, superscript and subscript

+
+

Other elements to use sparingly are:

+
+
+- monospaced typewriter font for inline code
+- monospaced typewriter font for verbatim text
+- deleted text (vs. inserted text)
+- text with superscript, such as 210
+- text with subscript, such as H2O
+
+
    +
  • monospaced typewriter font for inline code
  • +
  • monospaced typewriter font for verbatim text
  • +
  • deleted text (vs. inserted text)
  • +
  • text with superscript, such as 210
  • +
  • text with subscript, such as H2O
  • +
+
+
+
+

Smart punctuation

+
+

If the XXX option is specified, Org mode will produce typographically correct output, converting straight quotes to curly quotes, --- to em-dashes, -- to en-dashes, and ... to ellipses.

+
+
+
+
+

Lists

+
+

Org markup allows you to create bulleted or numbered lists. It allows any combination of the two list types.

+
+
+

Unordered lists

+
+

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.

+
+
+- Item with some lengthy text wrapping hopefully across several lines. We add
+  a few words to really show the line wrapping.
+- Bullet.
+  + Bullet.
+    * Bullet.
+
+
    +
  • Item with some lengthy text wrapping hopefully across several lines. We add a few words to really show the line wrapping.
  • +
  • Bullet. +
      +
    • Bullet. +
        +
      • Bullet.
      • +
      +
    • +
    +
  • +
+
+
+
+

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. Arabic (decimal) numbered list item. We add a few words to show the line
+   wrapping.
+   A. Upper case alpha (letter) numbered list item.
+      a. Lower alpha.
+      b. Lower alpha.
+   B. Upper alpha.
+2. Number.
+
+
    +
  1. Arabic (decimal) numbered list item. We add a few words to show the line wrapping. +
      +
    1. Upper case alpha (letter) numbered list item. +
        +
      1. Lower alpha.
      2. +
      3. Lower alpha.
      4. +
      +
    2. +
    3. Upper alpha.
    4. +
    +
  2. +
  3. Number.
  4. +
+

You can have ordered lists with jumping numbers:

+
+
+2. [@2] We start with point number 2.
+3. Automatically numbered item.
+
+
    +
  1. We start with point number 2.
  2. +
  3. Automatically numbered item.
  4. +
+
+
+
+

Definition lists

+
+

Labeled, multi-line lists.

+
+
+- First term to define ::
+     Definition of the first term. We add a few words to show the line wrapping,
+     to see what happens when you have long lines.
+
+- Second term ::
+     Explication of the second term with inline markup.
+
+     In many paragraphs.
+
+
+
First term to define
+
Definition of the first term. We add a few words to show the line wrapping, to see what happens when you have long lines.
+
Second term
+
+

Explication of the second term with inline markup.

+

In many paragraphs.

+
+
+
+
+
+

Separating lists

+
+

Adjacent lists sometimes like to fuse. To force the start of a new list, offset the two lists by an empty line comment:

+
+
+- apples
+- oranges
+- bananas
+
+# Comment.
+
+- carrots
+- tomatoes
+- celery
+
+
    +
  • apples
  • +
  • oranges
  • +
  • bananas
  • +
+
    +
  • carrots
  • +
  • tomatoes
  • +
  • celery
  • +
+
+
+
+
+

Tables

+
+

Tables are one of the most refined areas of the Org mode syntax. They are very easy to create and to read.

+
+
+

Simple table

+
+
+
+| Cell in column 1, row 1 | Cell in column 2, row 1 |
+| Cell in column 1, row 2 | Cell in column 2, row 2 |
+
+ +++ + + + + + + + + + + +
Cell in column 1, row 1Cell in column 2, row 1
Cell in column 1, row 2Cell in column 2, row 2
+

Org tables have cells of at most one line long: there is no such thing as a multi-line table cell in Org.

+
+
+
+

Column formatting

+
+

Columns are automatically aligned:

+
    +
  • Number-rich columns to the right, and
  • +
  • String-rich columns to the left.
  • +
+
+
+

Table with aligned cells

+
+

If you want to override the automatic alignment, use <r>, <c> or <l>.

+
+
+#+CAPTION: Table with aligned columns
+|          <r> | <c>          | <l>          |
+|            1 | 2            | 3            |
+|        Right | Center       | Left         |
+| xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx |
+
+ + ++++ + + + + + + + + + + + + + + + + + +
Table 1: Table with aligned columns
123
RightCenterLeft
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
+
+
+
+

Table with column size adjusted

+
+
+
+

Header row

+
+

You can create tables with an header row (by using an horizontal line of dashes to separate it from the rest of the table).

+
+
+#+CAPTION: Table with an header row
+| Name of column 1 | Name of column 2 | Name of column 3 |
+|------------------+------------------+------------------|
+| Top left         | Top middle       |                  |
+|                  |                  | Right            |
+| Bottom left      | Bottom middle    |                  |
+
+ + ++++ + + + + + + + + + + + + + + + + + + + + + + + + +
Table 2: Table with an header row
Name of column 1Name of column 2Name of column 3
Top leftTop middle
Right
Bottom leftBottom middle
+
+
+
+

Table placement

+
+
+
+#+ATTR_LATEX: :center nil
+| a | b |
+| 1 | 2 |
+
+ +++ + + + + + + + + + + +
ab
12
+

XXX Different from the following:

+
+
+| a | b |
+| 1 | 2 |
+
+ +++ + + + + + + + + + + +
ab
12
+
+
+
+

Align tables on the page

+
+
+

Left

+
+

Here is a table on the left side:

+
+
+#+LATEX: \noindent
+#+ATTR_LATEX: :center nil
+| a | b | c |
+|---+---+---|
+| 1 | 2 | 3 |
+| 4 | 5 | 6 |
+#+LATEX: \hfill
+
+ ++++ + + + + + + + + + + + + + + + + + + + +
abc
123
456
+

The noindent just gets rid of the indentation of the first line of a paragraph which in this case is the table. The hfill adds infinite stretch after the table, so it pushes the table to the left.

+
+
+
+

Center

+
+

Here is a centered table:

+
+
+| a | b | c |
+|---+---+---|
+| 1 | 2 | 3 |
+| 4 | 5 | 6 |
+
+ ++++ + + + + + + + + + + + + + + + + + + + +
abc
123
456
+
+
+
+

Right

+
+

And here's a table on the right side:

+
+
+#+LATEX: \hfill
+#+ATTR_LATEX: :center nil
+| a | b | c |
+|---+---+---|
+| 1 | 2 | 3 |
+| 4 | 5 | 6 |
+
+ ++++ + + + + + + + + + + + + + + + + + + + +
abc
123
456
+

Here the hfill adds infinite stretch before the table, so it pushes the table to the right.

+
+
+
+
+

Table size

+
+
+
+#+ATTR_HTML: :width 100%
+| Cell in column 1, row 1 | Cell in column 2, row 1 |
+| Cell in column 1, row 2 | Cell in column 2, row 2 |
+
+ +++ + + + + + + + + + + +
Cell in column 1, row 1Cell in column 2, row 1
Cell in column 1, row 2Cell in column 2, row 2
+
+
+
+

CSV

+
+

You can fill a table from a CSV file using R commands.

+
+
+
+
+ + +
+

External links

+
+
+
+See http://www.pirilampo.org (automatic!) and the
+Org mode Web site.
+
+

See http://www.pirilampo.org/ (automatic!) and the Org mode Web site.

+
+
+

Relative links

+
+
+
+Home
+
+

Home

+
+
+
+

Email links

+ +
+
+
+

Internal links

+
+
+

Inline anchors

+
+

Anchors are used to specify hypertext link targets.

+
+
+<<anchor>> Inline anchors make arbitrary content referenceable.
+
+

Inline anchors make arbitrary content referenceable.

+
+
+
+

Internal cross references

+
+

Links generally point to an headline.

+
+
+See chapter Links.
+
+

See chapter Links.

+

To add a link to a figure (e.g., "See Figure 1"), just do:

+
+
+#+name: fig
+#+caption: caption
+file:fig.png
+
+See figure fig.
+
+
+

fig.png

+

Figure 1: caption

+
+

See figure 1.

+

You can also create a hypertext link to a document anchor in the current document or in another document.

+
+
+See:
+- Location cross reference.
+- Section Internal links
+
+

See:

+ +
+
+
+
+

Extensions that define new hyperlinks targets

+
+
+
+

Images

+
+

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

+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
HTMLPDF
gifyes
jpegyes
pngyes
bmp(depends on browser support)
+
+
+

Inline picture

+
+
+
+#+caption: Org mode logo
+file:images/org-mode-unicorn.png
+
+
+

org-mode-unicorn.png

+

Figure 2: Org mode logo

+
+
+
+Click to see the Unicorn picture.
+
+

Click to see the Unicorn picture.

+
+
+
+

Image alignment (using positioning)

+
+

Books usually align/float images on the right/left of the contents.

+
+
+

Image is left aligned

+
+
+

Image is right aligned

+
+
+

Image is centered

+ +
+
+
+

Image attributes and values

+
+

XXX Available HTML image tags include …

+ +++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeValue(s)
:altAlternate text
:height
:widthUser defined size in pixels
:align
:border
:bordercolor
:hspace
:vspace
:titleUser defined text
+
+
+#+ATTR_LaTeX: :width 0.25\linewidth
+file:images/org-mode-unicorn.png
+
+
+

org-mode-unicorn.png

+
+

Place images side by side: XXX

+
+
+
+

Figures

+
+

To define images that will be treated as book illustrations (figures) and automatically labeled and numbered, use XXX.

+
+
+
+
+

Videos

+
+

Videos can't be added directly.

+

Though, you can add an image with a link to the video like this:

+ +
+

bigblow.png

+
+
+
+
+

Admonitions

+
+

Admonitions (contextual backgrounds) are statements taken out of the content's flow and labeled with a title.

+

Common admonitions are:

+
    +
  1. note
  2. +
  3. warning
  4. +
  5. tip
  6. +
  7. caution
  8. +
  9. important
  10. +
+

(Most themes style only note and warning specially.)

+
+
+

Base admonitions

+
+
+

Note

+
+

A note box is displayed as follows:

+
+
+#+begin_note
+This is a useful note.
+#+end_note
+
+
+

This is a useful note.

+
+
+
+
+

Warning

+
+

A warning box is displayed as follows:

+
+
+#+begin_warning
+Be careful!  Check that you have...
+#+end_warning
+
+
+

Be careful! Check that you have…

+
+
+
+
+

Tip

+
+

A tip box is displayed as follows:

+
+
+#+begin_tip
+Try doing it this way...
+#+end_tip
+
+
+

Try doing it this way…

+
+
+
+
+

Caution

+
+
+
+#+begin_caution
+Caution
+#+end_caution
+
+
+

Caution

+
+
+
+
+

Important

+
+
+
+#+begin_important
+Important
+#+end_important
+
+
+

Important

+
+
+
+
+
+

Additional admonitions

+
+
+

Attention

+
+
+
+#+begin_attention
+Attention
+#+end_attention
+
+
+

Attention

+
+
+
+
+

Hint

+
+
+
+#+begin_hint
+Hint
+#+end_hint
+
+
+

Hint

+
+
+
+
+

Error

+
+
+
+#+begin_error
+Error
+#+end_error
+
+
+

Error

+
+
+
+
+

Danger

+
+
+
+#+begin_danger
+Danger
+#+end_danger
+
+
+

Danger

+
+
+
+
+

SeeAlso (Sphinx additional)

+
+
+
+#+begin_seealso
+- Apples ::
+     A kind of fruit.
+#+end_seealso
+
+
+
+
Apples
+
A kind of fruit.
+
+
+
+
+
+
+

Todo admonition

+
+

Simple box ("inline task"):

+
+
+*************** TODO Do this task
+Description of inline task.
+*************** END
+
+

* TODO Do this task Description of inline task.

+
END
+nil
+
TODO Do this task
+

Description of inline task.

+
+

or:

+
+
+*************** WAIT [#B] Do also this other task                        :phone:
+*************** END
+
+

* WAIT [#B] Do also this other task :phone:

+
END
+nil
+
+

Admonitiontodo

+
+
+
+
+
+

Centered text

+
+
+
+#+begin_left
+This text is \\
+aligned to the left!
+#+end_left
+
+#+begin_center
+This text is \\
+centered!
+#+end_center
+
+#+begin_right
+This text is \\
+aligned to the right!
+#+end_right
+
+
+

This text is
+aligned to the left!

+
+
+

This text is
+centered!

+
+
+

This text is
+aligned to the right!

+
+
+
+
+

Sidebar

+
+
+
+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.
+
+#+begin_sidebar
+Org mode was first released by Carsten Dominik in 2004 as an outlining and
+project planning tool.  Further development turned it into a general tool that
+can be used to author professional documents like LaTeX.
+#+end_sidebar
+
+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.
+
+

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.

+
+
+
+

Example

+
+

You can have example blocks.

+
+
+: 10/17/97   9:04         <DIR>    bin
+: 10/16/97  14:11         <DIR>    DOS
+: 10/16/97  14:46         <DIR>    TEMP
+: 10/16/97  14:37         <DIR>    WINNT
+: 10/16/97  14:25             119  AUTOEXEC.BAT
+:  2/13/94   6:21          54,619  COMMAND.COM
+
+
+10/17/97   9:04         <DIR>    bin
+10/16/97  14:11         <DIR>    DOS
+10/16/97  14:46         <DIR>    TEMP
+10/16/97  14:37         <DIR>    WINNT
+10/16/97  14:25             119  AUTOEXEC.BAT
+ 2/13/94   6:21          54,619  COMMAND.COM
+
+

or

+
+
+#+begin_example
+10/17/97   9:04         <DIR>    bin
+10/16/97  14:11         <DIR>    DOS
+10/16/97  14:46         <DIR>    TEMP
+10/16/97  14:37         <DIR>    WINNT
+10/16/97  14:25             119  AUTOEXEC.BAT
+ 2/13/94   6:21          54,619  COMMAND.COM
+#+end_example
+
+
+10/17/97   9:04         <DIR>    bin
+10/16/97  14:11         <DIR>    DOS
+10/16/97  14:46         <DIR>    TEMP
+10/16/97  14:37         <DIR>    WINNT
+10/16/97  14:25             119  AUTOEXEC.BAT
+ 2/13/94   6:21          54,619  COMMAND.COM
+
+
+
+

Prose excerpts

+
+
+

Quote

+
+

Use the quote block for content that doesn't require the preservation of line breaks.

+
+
+#+begin_quote
+Let us change our traditional attitude to the construction of programs:
+Instead of imagining that our main task is to instruct a computer what to do,
+let us concentrate rather on explaining to human beings what we want a
+computer to do.
+
+The practitioner of literate programming can be regarded as an essayist, whose
+main concern is with exposition and excellence of style. Such an author, with
+thesaurus in hand, chooses the names of variables carefully and explains what
+each variable means. He or she strives for a program that is comprehensible
+because its concepts have been introduced in an order that is best for human
+understanding, using a mixture of formal and informal methods that reinforce
+each other.
+
+-- Donald Knuth
+#+end_quote
+
+
+

Let us change our traditional attitude to the construction of programs: Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do.

+

The practitioner of literate programming can be regarded as an essayist, whose main concern is with exposition and excellence of style. Such an author, with thesaurus in hand, chooses the names of variables carefully and explains what each variable means. He or she strives for a program that is comprehensible because its concepts have been introduced in an order that is best for human understanding, using a mixture of formal and informal methods that reinforce each other.

+

- Donald Knuth

+
+

A short one:

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

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

+
+
+
+
+

Verse

+
+

In a verse environment, there is an implicit line break at the end of each line, and indentation is preserved:

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

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

+

Typically used for quoting passages of an email message:

+
+
+#+begin_verse
+>>  The meeting has been postponed to next Friday.
+>
+> Has the deadline for the report been moved too?
+
+Yes.  And chekout http://www.doodle.com/ for rescheduling the meeting.
+
+In the text body,
+   indentation is
+preserved.
+#+end_verse
+
+

>> The meeting has been postponed to next Friday.
+>
+> Has the deadline for the report been moved too?
+
+Yes. And chekout http://www.doodle.com/ for rescheduling the meeting.
+
+In the text body,
+ indentation is
+preserved.

+
+
+
+

Block quote with optional attribution line

+
+

epigraph

+
+
+
+

Block quotes with their own class attribute

+
+
+

highlights

+
+
+

pull-quote

+
+
+

Blockquote

+
+
+
+
+

Non-breaking space

+
+

Insert the Unicode character 00A0 to add a non-breaking space.

+

FIXME Or add/use an Org entity? Or use tilde?

+
+
+
+
+

Comments

+
+
+
+It's possible to add comments in the document.
+
+# This Org comment here won't be displayed.
+
+

It's possible to add comments in the document.

+
+
+
+

Substitutions

+
+
+

General replacements

+
+
+
+#+MACRO: longtext this very very long text
+
+Insert longtext wherever required.
+
+

Insert this very very long text wherever required.

+
+
+
+

Styled references

+
+
+
+#+MACRO: color @@html:<span style="color: $1">$2</span>@@
+
+color(blue, This text is colored in blue.)
+
+color(red, This other text is in red.)
+
+

This text is colored in blue.

+

This other text is in red.

+

Find more macros on GitHub.

+
+
+
+

Special characters

+
+

We also use substitutions to include some of the widely used Unicode characters (like ©, converted from text characters to its typographically correct entity).

+
+
+

Accents

+
+
+
+- \Agrave \Aacute
+
+
    +
  • À Á
  • +
+
+
+
+

Punctuation

+
+
+
+- Dash: \ndash \mdash
+- Marks: \iexcl \iquest
+- Quotations: \laquo \raquo
+- Miscellaneous: \para \ordf
+
+
    +
  • Dash: - -
  • +
  • Marks: ¡ ¿
  • +
  • Quotations: « »
  • +
  • Miscellaneous: ¶ ª
  • +
+
+
+
+

Commercial symbols

+
+
+
+- Property marks: \copy \reg
+- Currency: \cent \EUR \yen \pound
+
+
    +
  • Property marks: © ®
  • +
  • Currency: ¢ € ¥ £
  • +
+
+
+
+

Greek characters

+
+
+
+The Greek letters \alpha, \beta, and \gamma are used to denote angles.
+
+

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

+
+
+
+

Math characters

+
+
+
+- Science: \pm \div
+- Arrows: \to \rarr \larr \harr \rArr \lArr \hArr
+- Function names: \arccos \cos
+- Signs and symbols: \bull \star
+
+
    +
  • Science: ± ÷
  • +
  • Arrows: → → ← ↔ ⇒ ⇐ ⇔
  • +
  • Function names: arccos cos
  • +
  • Signs and symbols: • *
  • +
+
+
+
+

Misc

+
+
+
+- Zero-width non-joiner: \zwnj
+# Smilies: \smiley \sad
+- Suits: \clubs \spades
+
+
    +
  • Zero-width non-joiner: ‌
  • +
+
    +
  • Suits: ♣ ♠
  • +
+
+
+
+
+
+

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 blocks (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;
+}
+
+
+
+
+

Source mode

+
+

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.

+
+
+
+

Line break

+
+

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.

+
+
+1: (defun org-xor (a b)
+2:   "Exclusive or."
+
+

If you use a +n switch, the numbering from the previous numbered snippet will be continued in the current one:

+
+
+3:   (if a (not b) b))
+
+
+
+
+

Callouts

+
+

In literal examples, Org will interpret strings like (ref:name) as labels, and use them as targets for special hyperlinks like [[(name)]] (i.e., the reference name enclosed in single parenthesis). In HTML, hovering the mouse over such a link will remote-highlight the corresponding code line, which is kind of cool.

+

You can also add a -r switch which removes the labels from the source code. With the -n switch, links to these references will be labeled by the line numbers from the code listing, otherwise links will use the labels with no parentheses. Here is an example:

+
+
+1: (save-excursion                  ;
+2:   (goto-char (point-min)))       ;
+
+

In line 1, we remember the current position. Line 2 jumps to point-min.

+
+
+
+
+

Math

+
+

You can embed LaTeX math formatting in Org mode files.

+
+
+

Inline math expressions

+
+

For inline math expressions, use \(...\):

+
+
+The formula \(a^2 + b^2 = c^2\) has been discovered by Pythagoras.
+
+Let \(a=\sin(x) + \cos(x)\). Then \(a^2 = 2\sin(x)\cos(x)\) because \(\sin^2x +
+\cos^2x = 1\).
+
+

The formula \(a^2 + b^2 = c^2\) has been discovered by Pythagoras.

+

Let \(a=\sin(x) + \cos(x)\). Then \(a^2 = 2\sin(x)\cos(x)\) because \(\sin^2x + \cos^2x = 1\).

+
+

It's not advised to use the constructs $...$ (both for Org and for MathJax).

+
+
+
+
+

Math expressions in display mode

+
+

For mathematical expressions which you want to make stand out, centered on their own lines, use \[...\]:

+
+
+The Euler theorem:
+
+\[
+\int_0^\infty e-x^2 dx = {{\sqrt{\pi}} \over {2}}
+\]
+
+LaTeX allows to inline such \[...\] constructs (quadratic formula):
+\[ \frac{-b \pm \sqrt{b^2 - 4 a c}}{2a} \]
+
+

The Euler theorem:

+

\[ \int_0^\infty e^{-x^2} dx = {{\sqrt{\pi}} \over {2}} \]

+

LaTeX allows to inline such \[...\] constructs (quadratic formula): \[ \frac{-b \pm \sqrt{b^2 - 4 a c}}{2a} \]

+
+

Double dollar signs ($$) should not be used.

+
+
+
+\[
+\left( \int0\infty \frac{\sin x}{\sqrt x}\,\mathrm{d}x \
+right)2 -
+\prodk=1\infty \frac{4k2}{4k2-1} +
+\frac{\lambda}{2n}\sumk=1 ^{n} \thetak ^{2} xn = 0
+\]
+
+

\[ \left( \int_{0}^{\infty} \frac{\sin x}{\sqrt x}\,\mathrm{d}x \ right)^{2} - \prod_{k=1}^{\infty} \frac{4k^{2}}{4k^{2}-1} + \frac{\lambda}{2n}\sum_{k=1} ^{n} \theta_{k} ^{2} x^{n} = 0 \]

+

The equation may be wrong, but it's a nice one!

+
+
+
+

Equation numbers

+
+

Differently from $...$ and \(...\), an equation environment produces a numbered equation to which you can add a label and reference the equation by (label) name in other parts of the text. This is not possibly with unnumbered math environments ($$, …).

+
+
+The Pythagoras theorem:
+
+#+name: pythag
+\begin{equation}
+a^2 + b^2 = c^2
+\end{equation}
+
+See equation pythag.
+
+# The sinus theorem can be written as the equation:
+#
+# \begin{equation}
+# \label{eqn:sinalpha}
+# \frac{\sin\alpha}{a}=\frac{\sin\beta}{b}
+# \end{equation}
+#
+# See equation eqn:sinalpha.
+
+

The Pythagoras theorem:

+\begin{equation} a^2 + b^2 = c^2 \end{equation} +

See equation 1.

+

Only captioned equations are numbered.

+

Other alternatives: use

+
    +
  • \begin{equation*} or
  • +
  • \begin{displaymath} (= the verbose form of the \[...\] construct).
  • +
+

M-q does not fill those.

+
+
+
+
+

Miscellaneous effects

+
+
+

Include Org files

+
+

You can include another Org file and skip its title by using the :lines argument to #+INCLUDE:

+
+
+#+INCLUDE: chapter1.org :lines "2-"
+
+
+

File inclusion, through INCLUDE keywords, is an export-only feature.

+
+
+
+
+

Raw HTML

+
+

You can include raw HTML in your Org documents and it will get kept as HTML when it's exported.

+

Text can be preformatted (in a fixed-width font).

+

It is especially useful for more advanced stuff like images or tables where you need more control of the HTML options than Org mode actually gives you.

+

Similarly, you can incorporate JS or do anything else you can do in a Web page (such as importing a CSS file).

+
+
+

Native DIV blocks

+
+

You can create named classes (to get style control from your CSS) with:

+
+#+begin_note
+*Note example* \\
+Did you know...
+#+end_note
+
+

You can also add interactive elements to the HTML such as interactive R plots.

+

Finally, you can include an HTML file verbatim (during export) with:

+
+
+#+INCLUDE: file.html html
+
+

Don't edit the exported HTML file!

+
+
+
+
+

Raw LaTeX

+
+

You can also use raw LaTeX. XXX

+

Text can be preformatted (in a fixed-width font).

+
+
+
+
+

Footnotes

+
+
+
+It is possible to define named footnotes[fn:myfootnote], or ones with automatic
+anchors[fn:2].
+
+

It is possible to define named footnotes1, or ones with automatic anchors2. It is possible to define named footnotes1, or ones with automatic anchors2.

+
+
+
+

Useful extensions

+
+
+

Todo extension

+
+
+

Dates

+
+

Timestamps: [2014-01-16 Thu] and <2014-01-16 Thu>.

+
+
+
+

TODO We need to achieve…

+
+
+

DONE [A] Buy GTD book online

+
+

By default, DONE actions will be collapsed.

+

Note that I should probably implement that default behavior only for ARCHIVE'd items.

+
+
+
+

TODO [A] Read GTD book

+
+

SCHEDULED: <2014-09-11 Thu>

+

By default, all (active) entries will be expanded at page load, so that their contents is visible.

+

That can be changed by adding such a line (into your Org document):

+
+
+#+HTML_HEAD: <script> var HS_STARTUP_FOLDED = true; </script>
+
+
+
+
+

TODO [B] Apply GTD methodoloy

+
+

DEADLINE: <2014-12-01 Mon>

+

This section will be collapsed when loading the page because the entry has the value hsCollapsed for the property :HTML_CONTAINER_CLASS:.

+

Powerful, no?

+
+
+
+

Some note computer write

+
+

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

+
+
+
+

Weekly review computer

+
+

Now, you can even make your weekly review in the HTML export… Press the r key to start entering the "review mode" where all but one active entry are collapsed, so that you can really focus on one item at a time!

+
+
+
+
+

Bigblow extension

+
+

The string fixme (in upper case) gets replaced by a "Fix Me!" image:

+
+
+FIXME Delete this...
+
+

FIXME Delete this…

+
+
+
+
+

Graphs with Graphviz

+
+

To enable the Graphviz extension, we have to add it to the extensions list in the org-babel-load-languages variable.

+
+
+(add-to-list 'org-babel-load-languages '(dot . t))
+(org-babel-do-load-languages 'org-babel-load-languages org-babel-load-languages)
+
+

It uses directly the dot command to process DOT language.

+
+
+

Undirected

+
+
+
+#+begin_src dot :file images/graph.png :cmdline -Tpng
+graph foo {
+        "bar" -- "baz";
+}
+#+end_src
+
+
+
+graph foo {
+        "bar" -- "baz";
+}
+
+
+

graph.png

+
+
+
+
+

Directed

+
+
+
+digraph foo {
+        "bar" -> "baz";
+}
+
+
+

digraph.png

+
+
+
+
+
+

Graphs with R

+
+

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

+

To enable the Graphviz extension, we have to add it to the extensions list in the org-babel-load-languages variable.

+
+
+(add-to-list 'org-babel-load-languages '(R . t)) ; Requires R and ess-mode.
+(org-babel-do-load-languages 'org-babel-load-languages org-babel-load-languages)
+
+

It uses directly the R command to process R language.

+
+
+

Example

+
+

Data to be charted:

+ +++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
MonthDegrees
013.8
024.1
036.3
049.0
0511.9
0615.1
0717.1
0817.4
0915.7
1011.8
117.7
124.8
+

Code:

+
+
+plot(data, type="b", bty="l", col=c("#ABD249"), las=1, lwd=4)
+grid(nx=NULL, ny=NULL, col=c("#E8E8E8"), lwd=1)
+legend("bottom", legend=c("Degrees"), col=c("#ABD249"), pch=c(19))
+
+

The resulting chart:

+
+

Rplot.png

+
+
+
+
+
+

Citations

+
+

Cross-referenced to bibliography.

+
+
+
+

Appendix

+
+
+

Index

+
+

Index (or list of acronyms).

+
    +
  • Write index entries
  • +
+
    +
  • Place the index at the desired location
  • +
  • Produce the index by updating org-latex-pdf-process
  • +
+
+
+
+

Bibliography

+
+

The bibliography…

+
    +
  • Eric Steven Raymond. The Art of Unix Programming. Addison-Wesley. ISBN 0-13-142901-9.
  • +
+
+
+
+

Glossary

+
+

Glossaries are optional.

+
+
A glossary term
+
The corresponding (indented) definition.
+
A second glossary term
+
The corresponding (indented) definition.
+
+
+
+
+
+

Footnotes:

+
+
1 +

Extensively used in large documents.

+
+
2 +

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.

+
+
+
+
+
+

Author: Fabrice Niessen

+

Validate

+
+ + diff --git a/README.org b/README.org new file mode 100755 index 0000000..067145d --- /dev/null +++ b/README.org @@ -0,0 +1,1504 @@ +#+TITLE: Org mode syntax quick reference +#+AUTHOR: Fabrice Niessen +#+EMAIL: fniessen@pirilampo.org +#+DESCRIPTION: Org mode syntax example +#+KEYWORDS: org-mode, syntax, quick reference, cheat sheet, recommended practices, latex, beamer, html +#+LANGUAGE: en +#+OPTIONS: H:4 num:nil toc:2 p:t + +#+HTML_LINK_HOME: http://www.google.com +#+HTML_LINK_UP: http://www.bing.com + +# #+SETUPFILE: ~/src/org-html-themes/setup/theme-readtheorg-local-abs.setup +#+SETUPFILE: ~/src/org-html-themes/setup/theme-readtheorg.setup + +#+PROPERTY: eval yes +#+PROPERTY: exports both +#+PROPERTY: results replace + +# #+MACRO: longtext this is a very very long text to include + +| *Framework* | Org mode 8 | +| *Bug tracker* | https://github.com/fniessen/refcard-org-mode/issues | +| *Source* | https://github.com/fniessen/refcard-org-mode | +# | *Documentation* | http://refcard-org-mode.readthedocs.org/ | + +* Summary + +# See https://tutorialtodoapp.readthedocs.org/en/latest/ + +#+begin_sidebar +*You will learn to:* + +- write your docs in Org mode +- create tables +- create custom code blocks +#+end_sidebar + +#+begin_abstract +This is an Org mode document, using the ~.org~ extension (supported by GitHub). + +*Org mode* is an easy-to-write /plain text/ formatting syntax for authoring notes, +articles, LaTeX documents, books, Web pages, Beamer slide decks and much more! + +This is a cheat sheet for *Org mode 8* (because of some markup syntax changes +since Org mode 7), using [[https://github.com/fniessen/org-html-themes][ReadTheOrg CSS]]. + +Reading through all the [[http://orgmode.org/org.pdf][documentation]] is highly recommended, but for the truly +impatient, following are some quick steps to get started. +#+end_abstract + +# #+begin_abstract +# This paper talks about... +# #+end_abstract + +# See http://asciidoctor.org/docs/user-manual/#the-big-picture + +# See http://home.fnal.gov/~neilsen/notebook/orgExamples/org-examples.html. + +* Document header + +Title and author line: + +#+begin_src org :eval never-export +,#+TITLE: Org mode syntax examples +,#+AUTHOR: Fabrice Niessen + +My document provides... +#+end_src + +It's a good practice to also include an email line following the author line. + +#+begin_src org :eval never-export +,#+EMAIL: john.doe@example.com +#+end_src + +* Document settings + +** Document description + +#+begin_src org :eval never-export +#+DESCRIPTION: This document catalogs a set of tips and tricks for composing documents in Org mode. +#+KEYWORDS: org-mode, syntax, quick reference, cheat sheet, recommended practices, latex, beamer, html +#+LANGUAGE: en +#+end_src + +** Section numbering + +#+begin_src org :eval never-export +#+OPTIONS: H:4 +#+end_src + +#+begin_src org :eval never-export +#+OPTIONS: num:nil +#+end_src + +** Table of contents + +Set the ~toc~ attribute to activate an auto-generated table of contents (limited +to its 2 first levels) at the top of document. + +#+begin_src org :eval never-export +#+OPTIONS: toc:2 +#+end_src + +#+begin_src org :eval never-export +#+OPTIONS: p:t +#+end_src + +#+begin_note +The ~ALT_TITLE~ property allows to set an alternate title (shorter, for example) +for a given headline in the table of contents and other running heads. +#+end_note + +** List of figures + +~#+TOC: figures~ is not implemented yet in the HMTL backend. + +** List of tables + +~#+TOC: tables~ is already implemented in the HTML backend. + +** List of equations + +* Section titles (headings) + +#+begin_src org :eval no +,* Biggest heading (level 1) + +New chapter. +#+end_src + +#+begin_src org +,** Bigger heading (level 2) + +New section. + +,*** Big heading (level 3) + +New sub-section. + +,**** Heading (level 4) + +New sub-sub-section. +#+end_src + +** Numbered headings + +You can create numbered headings up to a certain level by setting an option: + +#+begin_src org +,#+OPTIONS: H:4 +#+end_src + +* Paragraphs + +** Normal + +#+begin_src org +A single newline has no effect. +This line is part of the same paragraph. + +But an empty line + +demarcates paragraphs. +#+end_src + +** Line breaks + +#+begin_src org +By entering two consecutive backslashes, \\ +you can force to break lines +without starting a new paragraph. +#+end_src + +** Horizontal rules + +#+begin_src org +For an horizontal line, insert at least 5 dashes: this is some text above an +horizontal rule +----- +and some text below it. +#+end_src + +** Text width + +# Premiere Elements, page 111 +# +# Vous pouvez créer ces objets en cliquant sur le bouton Nouvel| élément de le +# fenêtre Média. (Le Chapitre 14 explique comment créer| des titres ; le +# Chapitre 15 montre l'utilisation des barres et ton, de la| vidéo noir et de +# l'amorce SMPTE.) +# +# The principles of beautiful Web design, page 6 +# +# In a figurative sense, the concept of visual balance is similar to that of +# physical balance| illustrated by a seesaw. Just as physical objects have +# weight, so do the elements of a layout.| If the elements on either side of a +# layout are of equal weight, they balance one another.| There are two main forms +# of visual balance: symmetrical and asymmetrical. + +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, +and if he lifted his head a little he could see his brown belly, slightly domed +and divided by arches into stiff sections. The bedding was hardly able to cover +it and seemed ready to slide off any moment. His many legs, pitifully thin +compared with the size of the rest of him, waved about helplessly as he looked. + +* Formatting text + +Text effects. + +** Bold and italic + +#+begin_src org +/Emphasize/ (italics), *strongly* (bold), and */very strongly/* (bold italics). +#+end_src + +Markup elements can be nested: + +#+begin_src org +This is /italic text which contains _underlined text_ within it/, whereas _this is +normal underlined text_. +#+end_src + +Markup can span across multiple lines, by default *no more than 2*: + +#+begin_src org +*This +is not +bold.* +#+end_src + +Org mode does not interpret a marker surrounded by alphanumeric characters as an +emphasis marker. So, you can't (easily) emphasize just part of a word: + +#+begin_src org +Not feas*ible*. +#+end_src + +** Monospace, superscript and subscript + +Other elements to use sparingly are: + +#+begin_src org +- monospaced typewriter font for ~inline code~ +- monospaced typewriter font for =verbatim text= +- +deleted text+ (vs. _inserted text_) +- text with super^{script}, such as 2^{10} +- text with sub_{script}, such as H_{2}O +#+end_src + +** Smart punctuation + +If the XXX option is specified, Org mode will produce typographically correct +output, converting straight quotes to curly quotes, ~---~ to em-dashes, ~--~ to +en-dashes, and ~...~ to ellipses. + +* Lists + +Org markup allows you to create *bulleted* or *numbered* lists. It allows any +combination of the two list types. + +** Unordered lists + +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. + +#+begin_src org +- Item with some lengthy text wrapping hopefully across several lines. We add + a few words to really show the line wrapping. +- Bullet. + + Bullet. + * Bullet. +#+end_src + +** Checklists + +#+begin_src org +- [X] Checked. +- [-] Half-checked. +- [ ] Not checked. +- Normal list item. +#+end_src + +** Ordered lists + +Enumerated lists are marked with numbers or letters: + +#+begin_src org +1. Arabic (decimal) numbered list item. We add a few words to show the line + wrapping. + A. Upper case alpha (letter) numbered list item. + a. Lower alpha. + b. Lower alpha. + B. Upper alpha. +2. Number. +#+end_src + +You can have ordered lists with jumping numbers: + +#+begin_src org +2. [@2] We start with point number 2. +3. Automatically numbered item. +#+end_src + +** Definition lists + +Labeled, multi-line lists. + +#+begin_src org +- First term to define :: + Definition of the first term. We add a few words to show the line wrapping, + to see what happens when you have long lines. + +- Second term :: + Explication of the second term with *inline markup*. + + In many paragraphs. +#+end_src + +** Separating lists + +Adjacent lists sometimes like to fuse. To force the start of a new list, offset +the two lists by an empty line comment: + +#+begin_src org +- apples +- oranges +- bananas + +# Comment. + +- carrots +- tomatoes +- celery +#+end_src + +* Tables + +Tables are one of the most refined areas of the Org mode syntax. They are very easy +to create and to read. + +** Simple table + +#+begin_src org +| Cell in column 1, row 1 | Cell in column 2, row 1 | +| Cell in column 1, row 2 | Cell in column 2, row 2 | +#+end_src + +Org tables have cells of at most one line long: there is no such thing as +a multi-line table cell in Org. + +** Column formatting + +Columns are automatically aligned: + +- Number-rich columns to the right, and +- String-rich columns to the left. + +*** Table with aligned cells + +If you want to override the automatic alignment, use ~~, ~~ or ~~. + +#+begin_src org +,#+CAPTION: Table with aligned columns +| | | | +| 1 | 2 | 3 | +| Right | Center | Left | +| xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx | +#+end_src + +*** Table with column size adjusted + +** Header row + +You can create tables with an header row (by using an horizontal line of dashes +to separate it from the rest of the table). + +#+begin_src org +#+CAPTION: Table with an header row +| Name of column 1 | Name of column 2 | Name of column 3 | +|------------------+------------------+------------------| +| Top left | Top middle | | +| | | Right | +| Bottom left | Bottom middle | | +#+end_src + +** Table placement + +#+begin_src org +#+ATTR_LATEX: :center nil +| a | b | +| 1 | 2 | +#+end_src + +XXX Different from the following: + +#+begin_src org +| a | b | +| 1 | 2 | +#+end_src + +** Align tables on the page + +*** Left + +Here is a table on the left side: + +#+begin_src org +,#+LATEX: \noindent +,#+ATTR_LATEX: :center nil +| a | b | c | +|---+---+---| +| 1 | 2 | 3 | +| 4 | 5 | 6 | +,#+LATEX: \hfill +#+end_src + +The ~noindent~ just gets rid of the indentation of the first line of a paragraph +which in this case is the table. The ~hfill~ adds infinite stretch after the +table, so it pushes the table to the left. + +*** Center + +Here is a centered table: + +#+begin_src org +| a | b | c | +|---+---+---| +| 1 | 2 | 3 | +| 4 | 5 | 6 | +#+end_src + +*** Right + +And here's a table on the right side: + +#+begin_src org +#+LATEX: \hfill +#+ATTR_LATEX: :center nil +| a | b | c | +|---+---+---| +| 1 | 2 | 3 | +| 4 | 5 | 6 | +#+end_src + +Here the ~hfill~ adds infinite stretch before the table, so it pushes the table +to the right. + +** Table size + +#+begin_src org +#+ATTR_HTML: :width 100% +| Cell in column 1, row 1 | Cell in column 2, row 1 | +| Cell in column 1, row 2 | Cell in column 2, row 2 | +#+end_src + +** CSV + +You can fill a table from a CSV file using R commands. + +* Links + :PROPERTIES: + :CUSTOM_ID: links + :END: + +#+begin_src org :eval no +,* Links + :PROPERTIES: + :CUSTOM_ID: links + :END: +#+end_src + +This document is available in [[file:org-mode-syntax.org][plain text]], [[file:org-mode-syntax.html][HTML]] and [[file:org-mode-syntax.pdf][PDF]]. + +The links are delimited by double square brackets. + +** External links + +#+begin_src org +See http://www.pirilampo.org (automatic!) and the +[[http://orgmode.org/][Org mode Web site]]. +#+end_src + +# Clicking on the image [[http://orgmode.org/][file:images/org-mode-unicorn.png]] leads to the Org mode +# home page. + +*** Relative links + +#+begin_src org +[[../README.html][Home]] +#+end_src + +*** Email links + +#+begin_src org +[[mailto:john.doe@example.com][email John Doe]] +#+end_src + +** Internal links + :PROPERTIES: + :ID: 0d2b0cb2-116c-4a61-a076-4c641faf4346 + :END: + +*** Inline anchors + +Anchors are used to specify hypertext link targets. + +#+begin_src org +<> Inline anchors make arbitrary content referenceable. +#+end_src + +*** Internal cross references + +Links generally point to an headline. + +#+begin_src org +See chapter [[#links][Links]]. +#+end_src + +To add a link to a figure (e.g., "See Figure 1"), just do: + +#+begin_src org +,#+name: fig +,#+caption: caption +[[file:fig.png]] + +See figure [[fig]]. +#+end_src + +You can also create a hypertext link to a document anchor in the current +document /or in another document/. + +#+begin_src org +See: +- Location [[anchor][cross reference]]. +- Section [[id:0d2b0cb2-116c-4a61-a076-4c641faf4346][Internal links]] +#+end_src + +** Extensions that define new hyperlinks targets + +* Images + +You can insert *image* files of different *formats* to a document: + +| | HTML | PDF | +|------+------------------------------+-----| +| gif | yes | | +| jpeg | yes | | +| png | yes | | +| bmp | (depends on browser support) | | + +** Inline picture + +#+begin_src org +#+caption: Org mode logo +[[file:images/org-mode-unicorn.png]] +#+end_src + +#+begin_src org +Click to see the [[file:images/org-mode-unicorn.png][Unicorn picture]]. +#+end_src + +** Image alignment (using positioning) + +Books usually align/float images on the right/left of the contents. + +*** Image is left aligned + +*** Image is right aligned + +*** Image is centered + +#+name: test +#+begin_src R :exports results :file-ext pdf :results graphics :width 8 :height 3 +plot(runif(100)) +#+end_src + +#+attr_latex: :float t :placement [b] +#+results: test +[[file:test.pdf]] + +** Image attributes and values + +XXX Available HTML image tags include ... + +| Attribute | Value(s) | +|----------------+-----------------------------| +| ~:alt~ | Alternate text | +| ~:height~ | | +| ~:width~ | User defined size in pixels | +| ~:align~ | | +| ~:border~ | | +| ~:bordercolor~ | | +| ~:hspace~ | | +| ~:vspace~ | | +| ~:title~ | User defined text | + +#+begin_src org +#+ATTR_LaTeX: :width 0.25\linewidth +[[file:images/org-mode-unicorn.png]] +#+end_src + +Place images side by side: XXX + +** Figures + +To define images that will be *treated as book illustrations* (figures) and +automatically labeled and numbered, use XXX. + +* Videos + +Videos can't be added directly. + +Though, you can add an image with a link to the video like this: + +#+begin_src org +[[http://www.youtube.com/watch?v=DnSGSiXYuOk][file:../bigblow.png]] +#+end_src + +* Admonitions + +Admonitions (contextual backgrounds) are statements taken out of the content's +flow and labeled with a title. + +Common admonitions are: + +1. ~note~ +2. ~warning~ +3. ~tip~ +4. ~caution~ +5. ~important~ + +(Most themes style only ~note~ and ~warning~ specially.) + +** List of supported admonitions :noexport: + +| Total | | docutils | rST | RTD | AsciiDoc | DocBook | MoinMoin (Modern) | Bootstrap | DocOnce | Confluence | SuperCollider | +|--------+-----------+----------+-----+-----+----------+---------+-------------------+-----------+---------+------------+---------------| +| 7 | note | 1 | 1 | 1 | 1 | 1 | 1 | | | 1 | 1 | +| 9 | warning | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | +| 7 | tip | 1 | 1 | 1 | 1 | 1 | 1 | | | 1 | | +|--------+-----------+----------+-----+-----+----------+---------+-------------------+-----------+---------+------------+---------------| +| 6 | caution | 1 | 1 | 1 | 1 | 1 | 1 | | | | | +| 6 | important | 1 | 1 | 1 | 1 | 1 | 1 | | | | | +|--------+-----------+----------+-----+-----+----------+---------+-------------------+-----------+---------+------------+---------------| +| 3 | attention | 1 | 1 | 1 | | | | | | | | +| 3 | hint | 1 | 1 | 1 | | | | | | | | +| 3 | error | 1 | 1 | 1 | | | | | | | | +| 4 | danger | 1 | 1 | 1 | | | | 1 | | | | +|--------+-----------+----------+-----+-----+----------+---------+-------------------+-----------+---------+------------+---------------| +| #ERROR | seealso | | | ? | | | | | | | | +| #ERROR | todo | | | ? | | | | | | | | +|--------+-----------+----------+-----+-----+----------+---------+-------------------+-----------+---------+------------+---------------| +| 2 | info | | | | | | | 1 | | 1 | | +| 1 | notice | | | | | | | | 1 | | | +| 1 | question | | | | | | | | 1 | | | +| 1 | summary | | | | | | | | 1 | | | +| 1 | success | | | | | | | 1 | | | | +#+TBLFM: $1=vsum($3..$11) + +** Base admonitions + +*** Note + +A note box is displayed as follows: + +#+begin_src org +,#+begin_note +This is a useful note. +,#+end_note +#+end_src + +# #+attr_html: :options [By the way...] +# #+begin_note +# This is a useful note (with a title). +# #+end_note + +*** Warning + +A warning box is displayed as follows: + +#+begin_src org +,#+begin_warning +Be careful! Check that you have... +,#+end_warning +#+end_src + +*** Tip + +A tip box is displayed as follows: + +#+begin_src org +,#+begin_tip +Try doing it this way... +,#+end_tip +#+end_src + +*** Caution + +#+begin_src org +,#+begin_caution +Caution +,#+end_caution +#+end_src + +*** Important + +#+begin_src org +,#+begin_important +Important +,#+end_important +#+end_src + +** Additional admonitions + +*** Attention + +#+begin_src org +,#+begin_attention +Attention +,#+end_attention +#+end_src + +*** Hint + +#+begin_src org +,#+begin_hint +Hint +,#+end_hint +#+end_src + +*** Error + +#+begin_src org +,#+begin_error +Error +,#+end_error +#+end_src + +*** Danger + +#+begin_src org +,#+begin_danger +Danger +,#+end_danger +#+end_src + +*** SeeAlso (Sphinx additional) + +#+begin_src org +,#+begin_seealso +- [[http://en.wikipedia.org/wiki/Apple][Apples]] :: + A kind of [[http://en.wikipedia.org/wiki/Fruit][fruit]]. +,#+end_seealso +#+end_src + +** Todo admonition + +# See example at http://docs.ckan.org/en/latest/contributing/python.html + +Simple box ("inline task"): + +#+begin_src org +*************** TODO Do this task +Description of inline task. +*************** END +#+end_src + +*************** TODO Do this task +Description of inline task. +*************** END +or: + +#+begin_src org +*************** WAIT [#B] Do also this other task :phone: +*************** END +#+end_src + +#+begin_admonitiontodo +Admonitiontodo +#+end_admonitiontodo + +* Centered text + +#+begin_src org +,#+begin_left +This text is \\ +aligned to the left! +,#+end_left + +,#+begin_center +This text is \\ +centered! +,#+end_center + +,#+begin_right +This text is \\ +aligned to the right! +,#+end_right +#+end_src + +* Sidebar + +#+begin_src org +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. + +,#+begin_sidebar +Org mode was first released by Carsten Dominik in 2004 as an outlining and +project planning tool. Further development turned it into a general tool that +can be used to author professional documents like LaTeX. +,#+end_sidebar + +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. +#+end_src + +* Example + +You can have ~example~ blocks. + +#+begin_src org +: 10/17/97 9:04 bin +: 10/16/97 14:11 DOS +: 10/16/97 14:46 TEMP +: 10/16/97 14:37 WINNT +: 10/16/97 14:25 119 AUTOEXEC.BAT +: 2/13/94 6:21 54,619 COMMAND.COM +#+end_src + +or + +#+begin_src org +,#+begin_example +10/17/97 9:04 bin +10/16/97 14:11 DOS +10/16/97 14:46 TEMP +10/16/97 14:37 WINNT +10/16/97 14:25 119 AUTOEXEC.BAT + 2/13/94 6:21 54,619 COMMAND.COM +,#+end_example +#+end_src + +* Prose excerpts + +** Quote + +Use the ~quote~ block for content that *doesn't require the preservation of line +breaks*. + +#+begin_src org +,#+begin_quote +Let us change our traditional attitude to the construction of programs: +Instead of imagining that our main task is to instruct a computer what to do, +let us concentrate rather on explaining to human beings what we want a +computer to do. + +The practitioner of literate programming can be regarded as an essayist, whose +main concern is with exposition and excellence of style. Such an author, with +thesaurus in hand, chooses the names of variables carefully and explains what +each variable means. He or she strives for a program that is comprehensible +because its concepts have been introduced in an order that is best for human +understanding, using a mixture of formal and informal methods that reinforce +each other. + +-- Donald Knuth +,#+end_quote +#+end_src + +A short one: + +#+begin_src org +,#+begin_quote +Everything should be made as simple as possible, +but not any simpler. -- Albert Einstein +,#+end_quote +#+end_src + +** Verse + +In a ~verse~ environment, there is an *implicit line break at the end of each line*, +and *indentation* is preserved: + +#+begin_src org +,#+begin_verse +Everything should be made as simple as possible, +but not any simpler. -- Albert Einstein +,#+end_verse +#+end_src + +Typically used for quoting passages of an email message: + +#+begin_src org +,#+begin_verse +>> The meeting has been postponed to next Friday. +> +> Has the deadline for the report been moved too? + +Yes. And chekout http://www.doodle.com/ for rescheduling the meeting. + +In the text body, + indentation is +preserved. +,#+end_verse +#+end_src + +** Block quote with optional attribution line + +#+begin_epigraph +epigraph +#+end_epigraph + +** Block quotes with their own class attribute + +#+begin_highlights +highlights +#+end_highlights + +#+begin_pull-quote +pull-quote +#+end_pull-quote + +#+begin_blockquote +Blockquote +#+end_blockquote + +** Non-breaking space + +Insert the Unicode character ~00A0~ to add a non-breaking space. + +FIXME Or add/use an Org entity? Or use tilde? + +* Comments + +#+begin_src org +It's possible to add comments in the document. + +# This Org comment here won't be displayed. +#+end_src + +* Substitutions + +** General replacements + +#+begin_src org :eval no +,#+MACRO: longtext this very very long text + +Insert {{{longtext}}} wherever required. +#+end_src + +#+MACRO: longtext this very very long text + +Insert {{{longtext}}} wherever required. + +** Styled references + +#+BEGIN_SRC org :eval no +,#+MACRO: color @@html:$2@@ + +{{{color(blue, This text is colored in blue.)}}} + +{{{color(red, This other text is in red.)}}} +#+END_SRC + +#+MACRO: color @@html:$2@@ + +{{{color(blue, This text is colored in blue.)}}} + +{{{color(red, This other text is in red.)}}} + +Find more macros on [[https://github.com/fniessen/org-macros][GitHub]]. + +** Special characters + +We also use substitutions to include some of the widely used Unicode characters +(like ©, converted from text characters to its typographically correct entity). + +*** Accents + +#+begin_src org +- \Agrave \Aacute +#+end_src + +*** Punctuation + +#+begin_src org +- Dash: \ndash \mdash +- Marks: \iexcl \iquest +- Quotations: \laquo \raquo +- Miscellaneous: \para \ordf +#+end_src + +*** Commercial symbols + +#+begin_src org +- Property marks: \copy \reg +- Currency: \cent \EUR \yen \pound +#+end_src + +*** Greek characters + +#+begin_src org +The Greek letters \alpha, \beta, and \gamma are used to denote angles. +#+end_src + +*** Math characters + +#+begin_src org +- Science: \pm \div +- Arrows: \to \rarr \larr \harr \rArr \lArr \hArr +- Function names: \arccos \cos +- Signs and symbols: \bull \star +#+end_src + +*** Misc + +#+begin_src org +- Zero-width non-joiner: \zwnj +# Smilies: \smiley \sad +- Suits: \clubs \spades +#+end_src + +* Source code + +** Inline code + +#+begin_src org +Reference code like ~variables~ or ~functions~ inline. +#+end_src + +You can also evaluate code inline as follows: 1 + 1 is src_R{1 + 1}. + +** Code blocks (with syntax highlighting) + +The source code blocks support syntax highlighting: + +#+begin_src cpp :eval no +/* + * 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; +} +#+end_src + +** Source mode + +The following language strings are currently recognized: + +#+begin_src emacs-lisp :results drawer :exports results +(concat (mapconcat (lambda (widget) + (widget-get widget :tag)) + (cl-remove-if-not (lambda (it) + (and (consp it) + (eq (car it) 'const))) + (cdr + (widget-get + (get + 'org-babel-load-languages 'custom-type) + :key-type))) + ", ") + ".") +#+end_src + +#+results: +:RESULTS: +Awk, C, R, Asymptote, Calc, Clojure, CSS, Ditaa, Dot, Emacs Lisp, 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. +:END: + +** Line break + +Code block with long lines: + +#+begin_src emacs-lisp :eval no +testing testing testing testing testing testing testing testing testing testing +0 1 2 3 4 5 6 7 8 9 +123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456 +#+end_src + +For PDF (LaTeX), one solution is to surround the code block such as: + +#+latex: \scriptsize +#+begin_src R +print("This block is in scriptsize") +#+end_src +#+latex: \normalize + +** 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. + +#+header: :eval no +#+begin_src emacs-lisp -n +(defun org-xor (a b) + "Exclusive or." +#+end_src + +If you use a ~+n~ switch, the numbering from the previous numbered snippet will +be continued in the current one: + +#+header: :eval no +#+begin_src emacs-lisp +n + (if a (not b) b)) +#+end_src + +** Callouts + +In literal examples, Org will interpret strings like ~(ref:name)~ as labels, and +use them as targets for special hyperlinks like ~[[(name)]]~ (i.e., the reference +name enclosed in single parenthesis). In HTML, hovering the mouse over such +a link will remote-highlight the corresponding code line, which is kind of +cool. + +You can also add a ~-r~ switch which removes the labels from the source code. +With the ~-n~ switch, links to these references will be labeled by the line +numbers from the code listing, otherwise links will use the labels with no +parentheses. Here is an example: + +#+header: :eval no +#+begin_src emacs-lisp -n -r +(save-excursion ; (ref:sc) + (goto-char (point-min))) ; (ref:jump) +#+end_src + +In line [[(sc)]], we remember the current position. [[(jump)][Line (jump)]] jumps to +~point-min~. + +* Math + +You can embed LaTeX math formatting in Org mode files. + +** Inline math expressions + +For *inline math* expressions, use ~\(...\)~: + +#+begin_src org +The formula \(a^2 + b^2 = c^2\) has been discovered by Pythagoras. + +Let \(a=\sin(x) + \cos(x)\). Then \(a^2 = 2\sin(x)\cos(x)\) because \(\sin^2x + +\cos^2x = 1\). +#+end_src + +#+begin_warning +It's /not/ advised to use the constructs ~$...$~ (both for Org and for MathJax). +#+end_warning + +** Math expressions in display mode + +For mathematical expressions which you want to make *stand out, centered on their +own lines*, use ~\[...\]~: + +#+begin_src org +The /Euler theorem/: + +\[ +\int_0^\infty e^{-x^2} dx = {{\sqrt{\pi}} \over {2}} +\] + +LaTeX allows to inline such ~\[...\]~ constructs (/quadratic formula/): +\[ \frac{-b \pm \sqrt{b^2 - 4 a c}}{2a} \] +#+end_src + +#+begin_warning +Double dollar signs (~$$~) should not be used. +#+end_warning + +#+begin_src org +\[ +\left( \int_{0}^{\infty} \frac{\sin x}{\sqrt x}\,\mathrm{d}x \ +right)^{2} - +\prod_{k=1}^{\infty} \frac{4k^{2}}{4k^{2}-1} + +\frac{\lambda}{2n}\sum_{k=1} ^{n} \theta_{k} ^{2} x^{n} = 0 +\] +#+end_src + +The equation may be wrong, but it's a nice one! + +** Equation numbers + +Differently from ~$...$~ and ~\(...\)~, an equation environment produces a *numbered* +equation to which you can add a label and reference the equation by (label) name +in other parts of the text. This is not possibly with unnumbered math +environments (~$$~, ...). + +#+begin_src org +The /Pythagoras theorem/: + +,#+name: pythag +\begin{equation} +a^2 + b^2 = c^2 +\end{equation} + +See equation [[pythag]]. + +# The /sinus theorem/ can be written as the equation: +# +# \begin{equation} +# \label{eqn:sinalpha} +# \frac{\sin\alpha}{a}=\frac{\sin\beta}{b} +# \end{equation} +# +# See equation [[eqn:sinalpha]]. +#+end_src + +Only captioned equations are numbered. + +Other alternatives: use +- ~\begin{equation*}~ or +- ~\begin{displaymath}~ (= the verbose form of the ~\[...\]~ construct). + +~M-q~ does not fill those. + +* Miscellaneous effects + +** Include Org files + +You can include another Org file and skip its title by using the ~:lines~ argument +to ~#+INCLUDE~: + +#+begin_src org +,#+INCLUDE: chapter1.org :lines "2-" +#+end_src + +#+begin_note +File inclusion, through INCLUDE keywords, is an *export-only feature*. +#+end_note + +** Raw HTML + +# http://johnmacfarlane.net/pandoc/README.html + +You can include raw HTML in your Org documents and it will get kept as HTML +when it's exported. + +#+HTML_BEGIN:
+Text can be preformatted (in a fixed-width font).
+#+HTML_END: 
+ +It is especially useful for more advanced stuff like images or tables where you +need more control of the HTML options than Org mode actually gives you. + +Similarly, you can incorporate JS or do anything else you can do in a Web page +(such as importing a CSS file). + +*** Native DIV blocks + +You can create named classes (to get style control from your CSS) with: + +#+begin_example +,#+begin_note +,*Note example* \\ +Did you know... +,#+end_note +#+end_example + +You can also add interactive elements to the HTML such as interactive R plots. + +Finally, you can include an HTML file verbatim (during export) with: + +#+begin_src org +,#+INCLUDE: file.html html +#+end_src + +Don't edit the exported HTML file! + +** Raw LaTeX + +You can also use raw LaTeX. XXX + +#+LaTeX_BEGIN: \begin{verbatim} +Text can be preformatted (in a fixed-width font). +#+LaTeX_END: \end{verbatim} + +* Footnotes  + +#+begin_src org +It is possible to define named footnotes[fn:myfootnote], or ones with automatic +anchors[fn:2]. +#+end_src + +#+results: +It is possible to define named footnotes[fn:myfootnote], or ones with automatic +anchors[fn:2]. + +* Useful extensions + +** Todo extension + +*** Dates + +Timestamps: [2014-01-16 Thu] and <2014-01-16 Thu>. + +*** TODO We need to achieve... + +*** DONE [#A] Buy GTD book :online: + :LOGBOOK: + - State "TODO" -> "DONE" [2014-01-16 Thu 09:52] + :END: + +By default, ~DONE~ actions will be collapsed. + +Note that I should probably implement that default behavior only for ~ARCHIVE~'d +items. + +*** TODO [#A] Read GTD book + SCHEDULED: <2014-09-11 Thu> + +By default, *all* (active) entries will be expanded at page load, so that their +contents is visible. + +That can be changed by adding such a line (into your Org document): + +#+begin_src org :eval no +,#+HTML_HEAD: +#+end_src + +*** TODO [#B] Apply GTD methodoloy + DEADLINE: <2014-12-01 Mon> + :PROPERTIES: + :HTML_CONTAINER_CLASS: hsCollapsed + :END: + +This section will be collapsed when loading the page because the entry has the +value ~hsCollapsed~ for the property ~:HTML_CONTAINER_CLASS:~. + +Powerful, no? + +*** Some note :computer:write: + +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". + +*** Weekly review :computer: + +Now, you can even make your weekly review in the HTML export... Press the ~r~ key +to start entering the "review mode" where all but one active entry are +collapsed, so that you can really focus on one item at a time! + +** Bigblow extension + +The string ~fixme~ (in *upper case*) gets replaced by a "Fix Me!" image: + +#+begin_src org +FIXME Delete this... +#+end_src + +* Graphs with Graphviz + +To enable the Graphviz extension, we have to add it to the extensions list in +the ~org-babel-load-languages~ variable. + +#+begin_src emacs-lisp :exports code +(add-to-list 'org-babel-load-languages '(dot . t)) +(org-babel-do-load-languages 'org-babel-load-languages org-babel-load-languages) +#+end_src + +It uses directly the ~dot~ command to process DOT language. + +** Undirected + +#+begin_src org +,#+begin_src dot :file images/graph.png :cmdline -Tpng +graph foo { + "bar" -- "baz"; +} +,#+end_src +#+end_src + +** Directed + +#+begin_src org :exports results +,#+begin_src dot :file images/digraph.png :cmdline -Tpng +digraph foo { + "bar" -> "baz"; +} +,#+end_src +#+end_src + +* Graphs with R + +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/ +mindset. + +To enable the Graphviz extension, we have to add it to the extensions list in +the ~org-babel-load-languages~ variable. + +#+begin_src emacs-lisp :exports code +(add-to-list 'org-babel-load-languages '(R . t)) ; Requires R and ess-mode. +(org-babel-do-load-languages 'org-babel-load-languages org-babel-load-languages) +#+end_src + +It uses directly the ~R~ command to process R language. + +** Example + +Data to be charted: + +#+name: data +| Month | Degrees | +|-------+---------| +| 01 | 3.8 | +| 02 | 4.1 | +| 03 | 6.3 | +| 04 | 9.0 | +| 05 | 11.9 | +| 06 | 15.1 | +| 07 | 17.1 | +| 08 | 17.4 | +| 09 | 15.7 | +| 10 | 11.8 | +| 11 | 7.7 | +| 12 | 4.8 | + +Code: + +#+name: R-plot +#+begin_src R :var data=data :results graphics :file images/Rplot.png :exports both +plot(data, type="b", bty="l", col=c("#ABD249"), las=1, lwd=4) +grid(nx=NULL, ny=NULL, col=c("#E8E8E8"), lwd=1) +legend("bottom", legend=c("Degrees"), col=c("#ABD249"), pch=c(19)) +#+end_src + +The resulting chart: + +#+results: R-plot +[[file:images/Rplot.png]] + +* Citations + +Cross-referenced to bibliography. + +* Appendix + +** Index + +Index (or list of acronyms). + +- Write index entries + +#+index: Org-mode +#+index: Definitions!Org-mode + +- Place the index at the desired location + +- Produce the index by updating ~org-latex-pdf-process~ + +#+BIND: org-latex-pdf-process ("pdflatex %b" "bibtex %b" "pdflatex %b" "pdflatex %b") + +** Bibliography + +The bibliography... + +- Eric Steven Raymond. The Art of Unix Programming. Addison-Wesley. ISBN + 0-13-142901-9. + +# http://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html + +** Glossary + +Glossaries are optional. + +- A glossary term :: + The corresponding (indented) definition. + +- A second glossary term :: + The corresponding (indented) definition. + +* Footnotes + +[fn:myfootnote] Extensively used in large documents. + +[fn:2] 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. + +#+BIND: org-hide-emphasis-markers nil + +# This is for the sake of Emacs. +# Local Variables: +# org-hide-emphasis-markers: nil +# End: