Skip to content

Latest commit

 

History

History
510 lines (379 loc) · 11.5 KB

introduction.org

File metadata and controls

510 lines (379 loc) · 11.5 KB

Complete org-mode reference

Using org-mode for editing plain text files is a great experience. The structured editing of the document is very powerful.

\begin{noteblock} There does not seem to be a reference file out there with everything org-mode has to offer, so this is an attempt to make one. \end{noteblock}

Many of the below examples are taken from fniessen’s refcard.

Typography

Bold and italic

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

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

Monospace, superscript and subscript

- 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
  • 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

Lists

Unordered lists

- one item
- two item
  - sub item
    - sub sub item
  • one item
  • two item
    • sub item
      • sub sub item

Ordered lists

1. numbered
2. also
3. and another
   1. sub item
   2. sub item
  1. numbered
  2. also
  3. and another
    1. sub item
    2. sub item

Checklists

- [X] Checked.
- [-] Half-checked.
- [ ] Not checked.
- Normal list item.
  • [X] Checked.
  • [-] Half-checked.
  • [ ] Not checked.
  • Normal list item.

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

Tables

Simple table with headers

| Header 1 | Header 2 |
|----------+----------|
| Value    | not key  |
Header 1Header 2
Valuenot key

Naming your table

#+CAPTION: Description of the table
| Header 1 | Header 2 |
|----------+----------|
| Value    | not key  |
Header 1Header 2
Valuenot key

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 |
<r><c><l>
123
RightCenterLeft
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Links

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

Citations

How about some @apa ?

Blocks

Quote

Sometimes you just need to quote someone.

this is a quote from someone very wise

Code

#include <stdio.h>

int main() { (ref:sc)
  // printf() displays the string inside quotation
  printf("Hello, World!");
  return 0;
}

in line (sc) there is some code.

Example

#include <stdio.h>

int main() {
  // printf() displays the string inside quotation
  printf("Hello, World!");
  return 0;
}

ditaa

If you want to run ditaa in Emacs you will need to add it to org-babel and set the path to the ditaa.jar you will have to install.

(org-babel-do-load-languages
 'org-babel-load-languages
 '((ditaa . t)))

(setq org-ditaa-jar-path "/usr/share/ditaa/ditaa.jar")

You can then use your best ascii art skills to draw diagrams.

#+BEGIN_SRC ditaa :file images/architecture.png :exports results
                                                      +---------+
                                 /----------------\   |Lucene{s}|
                                 |Search          +---+---------+
                                 +----------------+   |  H2 {s} |
         SWANK                   |Source Resolver |   +---------+
          |                      +----------------+
 +-----+  :  +--------------+    |Doc Server      |   +--------+
 |Emacs|<--->|   Project    +----+----------------+   | JVM{io}|
 +-----+  |  +---+----------+ |  |Debug Manager   +---+--------+
          :      |        ^   :  +----------------+
          |  +---+----+   |   |  |Analyzer        +---+-----------+
          |  |File{io}|   |   |  \----------------/   |scalac     |
          |  |Watchers|   |   |                       +-----------+
          |  +--------+   |   |  /----------\         |Refactoring|
          |    ^          |   +--+Formatting|         +-----------+
          |    |          |      \----------/
          +----|-=--------|-=------------------------------------
      +-----+  |   +------++
      |Files+--+   |.ensime|
      +-----+      +-------+
#+END_SRC

Is converted to the following image.

images/architecture.png

Links

To external sources

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

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

To documents

[[./introduction.org][Inception!]]

Inception!

Links to headings

In the chapter, References, below the heading is annotated with custom properties.

* References
  :PROPERTIES:
  :CUSTOM_ID: References
  :END:

Then you can reference the heading using a link.

See chapter [[#References][References]].

See chapter References.

Images

[[./images/test.jpg]] 

./images/test.jpg

\begin{cautionblock} The current version of pandoc seems to have an issue with identifying the images when the extension is uppercase or pdf. It is tracked in issue 5454 on github (jgm/pandoc#5454).

If you have issues loading images, please check that one. \end{cautionblock}

Figures and tables

#+label: fig:naame
#+caption: caption
[[file:images/test.jpg]]

See figure [@fig:name].

images/test.jpg

See figure [@fig:name] .

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
This is a useful note.

Be careful!  Check that you have...

Try doing it this way...

Caution

Important

Additional admontions

This can be achieved by using Awesomebox

\begin{noteblock}
Another way to create a box
\end{noteblock}

\begin{noteblock} Another way to create a box \end{noteblock}

Formula

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 = 2sin(x)cos(x)\) because \(sin^2x + cos^2x = 1\).

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:

\[ ∫_0^∞ e-x^2 dx = {{\sqrt{π}} \over {2}} \]

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

References

If you want to include a list of references in your document, which you should if you are writing a serious paper, then use the following code to include it in this section.

#+ATTR_HTML: :id refs

The result will be:

Appendix

some stuff afterwards.