Skip to content

Instantly share code, notes, and snippets.

@hoeltgman
Forked from wdkrnls/org-syntax-cheatsheet.org
Created October 3, 2012 06:32
Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save hoeltgman/3825415 to your computer and use it in GitHub Desktop.
Save hoeltgman/3825415 to your computer and use it in GitHub Desktop.
Org-mode Syntax Cheat sheet

org-syntax-cheatsheet.org

1 What else can be specified.

Also check Manual entry for export options

1.1 Summary:

  • #+TITLE: the title to be shown (default is the buffer name)
  • #+AUTHOR: the author (default taken from user-full-name)
  • #+DATE: a date, an Org timestamp1, or a format string for format-time-string
  • #+EMAIL: his/her email address (default from user-mail-address)
  • #+DESCRIPTION: the page description, e.g. for the XHTML meta tag
  • #+KEYWORDS: the page keywords, e.g. for the XHTML meta tag
  • #+LANGUAGE: language for HTML, e.g. ‘en’ (org-export-default-language)
  • #+TEXT: Some descriptive text to be inserted at the beginning.
  • #+TEXT: Several lines may be given.
  • #+OPTIONS: H:2 num:t toc:t \n:nil @:t ::t |:t ^:t f:t TeX:t …
  • #+BIND: lisp-var lisp-val, e.g.: org-export-latex-low-levels itemize
  • You need to confirm using these, or configure org-export-allow-BIND
    • #+LINK_UP: the “up” link of an exported page
    • #+LINK_HOME: the “home” link of an exported page
    • #+LaTeX_HEADER: extra line(s) for the LaTeX header, like \usepackage{xyz}
    • #+EXPORT_SELECT_TAGS: Tags that select a tree for export
    • #+EXPORT_EXCLUDE_TAGS: Tags that exclude a tree from export
    • #+XSLT: the XSLT stylesheet used by DocBook exporter to generate FO file
  • #+SETUPFILE: path to setup file. (simplifies frequent use of the same options)
  • #+STYLE: <link rel=”stylesheet” type=”text/css” href=”stylesheet.css” /> (for html export)

1.2 Meaning of the options

  • H: set the number of headline levels for export
  • num: turn on/off section-numbers
  • toc: turn on/off table of contents, or set level limit (integer)
  • \n: turn on/off line-break-preservation (DOES NOT WORK)
  • @: turn on/off quoted HTML tags
???
turn on/off fixed-width sections
  • |: turn on/off tables
  • ^: turn on/off TeX-like syntax for sub- and superscripts. If you write “^:{}”, ab will be interpreted, but the simple a_b will be left as it is.
  • -: turn on/off conversion of special strings.
  • f: turn on/off footnotes like this[1].
  • todo: turn on/off inclusion of TODO keywords into exported text
  • tasks: turn on/off inclusion of tasks (TODO items), can be nil to remove all tasks, todo to remove DONE tasks, or list of kwds to keep
  • pri: turn on/off priority cookies
  • tags: turn on/off inclusion of tags, may also be not-in-toc
  • <: turn on/off inclusion of any time/date stamps like DEADLINES
  • *: turn on/off emphasized text (bold, italic, underlined)
  • TeX: turn on/off simple TeX macros in plain text
  • LaTeX: configure export of LaTeX fragments. Default auto
  • skip: turn on/off skipping the text before the first heading
  • author: turn on/off inclusion of author name/email into exported file
  • email: turn on/off inclusion of author email into exported file
  • creator: turn on/off inclusion of creator info into exported file
  • timestamp: turn on/off inclusion creation time into exported file
  • d: turn on/off inclusion of drawers, or list drawers to include

1.3 CSS Support for HTML export

  • p.author author information, including email
  • p.date publishing date
  • p.creator creator info, about org mode version
  • .title document title
  • .todo TODO keywords, all not-done states
  • .done the DONE keywords, all states that count as done
  • .WAITING each TODO keyword also uses a class named after itself
  • .timestamp timestamp
  • .timestamp-kwd keyword associated with a timestamp, like SCHEDULED
  • .timestamp-wrapper span around keyword plus timestamp
  • .tag tag in a headline
  • ._HOME each tag uses itself as a class, “@” replaced by “_”
  • .target target for links
  • .linenr the line number in a code example
  • .code-highlighted for highlighting referenced code lines
  • div.outline-N div for outline level N (headline plus text))
  • div.outline-text-N extra div for text at outline level N
  • .section-number-N section number in headlines, different for each level
  • div.figure how to format an inlined image
  • pre.src formatted source code
  • pre.example normal example
  • p.verse verse paragraph
  • div.footnotes footnote section headline
  • p.footnote footnote definition paragraph, containing a footnote
  • .footref a footnote reference number (always a <sup>)
  • .footnum footnote number in footnote definition (always <sup>)

1.4 LaTeX Support

By default, the LaTeX output uses the class article.

  • #+LaTeX_CLASS: article
  • #+LaTeX_CLASS_OPTIONS: [a4paper]
  • #+LaTeX_HEADER: \usepackage{xyz}
  • #+LaTeX: Literal LaTeX code for export
  • #+BEGIN_LaTeX All lines between these markers are exported literally
  • #+CAPTION: A long table
    …..…..
    …..…..
  • #+CAPTION: A long table
    …..…..
    …..…..
  • #+CAPTION: The black-body emission of the disk around HR 4049

    ./img/sed-hr4049.pdf

    ./img/hst.png

  • Beamer class support
  • Embedded Latex

2 References

2.1 Org Babel

Babel for org-mode

2.2 Org

Tutorials Worg main site.

3 Heading with tags

3.1 TODO Heading 2: Set a deadline and a schedule

3.1.1 DONE [66%] Heading 3: a list with checkboxes

  1. [X] task 1
  2. [X] task 2
  3. [ ] task 3

3.2 TODO [1/3] Track completion of tasks

3.2.1 DONE Finished task

  • State “DONE” from “TODO” [2012-03-07 Wed 07:56]

3.2.2 STARTED Started task

3.2.3 TODO Unstarted task

  • State “TODO” from “DONE” [2012-03-07 Wed 08:02]

4 Fancy typesetting features

  • bold ital underline code verbatim strike through
  • : literal example
  • —– horizontal line (5 dashes)

5 Hyperlinks

hyperlink text http://orgmode.org/worg/images/orgweb/2.jpg External Links targetted link shell commands

6 Tables and Spreadsheets

6.1 Basic Table

Col1Col 2
KWSep
TWAug

6.2 Spreadsheet

xy
11
21.4142136
31.7320508
42

7 Source Code

plot(1:10)
return x + 1

8 Mathematical Equations

\begin{equation} ∫^x_0 x^2 dx = \frac{x^3}{3} \end{equation}

@shenlebantongying
Copy link

This is really nice!

Saved a lot of time for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment