UP | HOME

org-mode examples / tutorial

Table of Contents

1. Introduction

Eric Nielsen, Jr. has a lovely document describing how to do various useful things with org-mode. This is my attempt to follow in his footsteps. You can read the original here: http://ehneilsen.net/notebook/orgExamples/org-examples.html

2. Links

Links I found useful here:

3. org-mode header

Lines that begin with #+ are treated as org-mode instructions.

3.1. org-publish

Several org-exporter options are gathered under the #+options tag.

3.1.1. subscripts

,#+options: ^:{}

controls whether text like a_b is understood as a_b or ab. the brackets mean that we need to write

a_{b}

to get the result ab

3.2. html

The following options apply only to the html exporter:

3.2.1. attach a stylesheet

#+html_head: <link rel="stylesheet" type="text/css" href="../css/notebook.css" />

This embeds the text

<link rel="stylesheet" type="text/css" href="../css/notebook.css" />

in the <head> section of the exported .html file I'm using Eric Nielsen Jr.'s notebook.css file:

body {
  max-width: 60em;
  margin:0 auto;
}

pre.example {
  text-align:left;
  border: 1pt solid #A0A0A0;
  background-color: #F0F0F0;
  padding: 1ch;
  display: block;
  clear: right;
}

div.note {
  border: 1pt solid #A0A0A0;
  padding: 1ch;
  display: block;
}

p {
  margin-left: auto;
  margin-right: auto;
}

pre {
    border: 1pt solid #AEBDCC;
    background-color: #F3F5F7;
    padding: 5pt;
    font-family: monospace;
    font-size: small;
    overflow:auto;
}

.diff {
    background-color: #c0ffc0;
}

h1 {
    font-size: x-large;
}

h2 {
    font-size: large;
}

html { font-family: serif; 
}

a:link, a:visited {
    color: navy; 
}

3.2.2. use infojs (javascript texinfo-style navigation)

#+INFOJS_OPT: view:showall toc:nil path:/ext/org/org-info.js

If you omit the path option, then the generated html will get org-info.js from http://orgmode.org/orginfo.js I like to copy the file locally (e.g. to $HOME/Dropbox/public_html/ext/org/orginfo.js) so that I can count on navigation working when my laptop isn't connected to the interwebs.

…to be continued…

4. quoting literal text

See also: http://orgmode.org/manual/Literal-examples.html org-mode manual Place text to be quoted between #+begin_example and #+end_example brackets:

#+begin_example
To be, or not to be, that is the question.
#+end_example

displays as:

To be, or not to be, that is the question.

5. embedding mathematics

See reference here: http://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference

Use $..$ to bracket inline formulae:

For example: \(\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}\) appears inline.

use $$..$$ to bracket out-of-line formulae:

Author: Roland Conybeare

Created: 2024-09-08 Sun 18:01

Validate