1 #+TITLE: Org mode syntax
2 #+CAPTION: This is a test of org-mode syntax
3 #+SUBTITLE: Quick reference card
4 #+AUTHOR: Fabrice Niessen
5 #+EMAIL: (concat "fniessen" at-sign "pirilampo.org")
6 #+DESCRIPTION: Org mode syntax example
7 #+KEYWORDS: org-mode, syntax, quick reference, cheat sheet, recommended practices, latex, beamer, html
9 #+OPTIONS: H:4 num:nil toc:2 p:t
11 #+HTML_LINK_HOME: http://www.google.com
12 #+HTML_LINK_UP: http://www.bing.com
14 #+SETUPFILE: ~/.dotfiles/org/theme-readtheorg.setup
16 #+PROPERTY: header-args :eval yes :exports both :results replace
18 # #+MACRO: longtext this is a very very long text to include
20 | *Framework* | Org mode 9 |
21 | *Bug tracker* | https://github.com/fniessen/refcard-org-mode/issues |
22 | *Source* | https://github.com/fniessen/refcard-org-mode |
23 # | *Documentation* | http://refcard-org-mode.readthedocs.org/ |
27 # See https://tutorialtodoapp.readthedocs.org/en/latest/ for nice home page!
32 - write your docs in Org mode
34 - create custom code blocks
39 This is an Org mode document, using the ~.org~ extension (supported by GitHub).
41 *Org mode* is an easy-to-write /plain text/ formatting syntax for authoring notes,
42 articles, LaTeX documents, books, Web pages, Beamer slide decks and much more!
44 This is a cheat sheet for *Org mode 8* (because of some markup syntax changes
45 since Org mode 7), using [[https://github.com/fniessen/org-html-themes][ReadTheOrg CSS]].
47 Reading through all the [[http://orgmode.org/org.pdf][documentation]] is highly recommended, but for the truly
48 impatient, following are some quick steps to get started.
52 # This paper talks about...
55 # See http://asciidoctor.org/docs/user-manual/#the-big-picture
57 # See http://home.fnal.gov/~neilsen/notebook/orgExamples/org-examples.html.
65 Title and author line:
67 #+begin_src org :eval never-export
68 ,#+TITLE: Org mode syntax examples
69 ,#+AUTHOR: Fabrice Niessen
71 My document provides...
74 It's a good practice to also include an email line following the author line.
76 #+begin_src org :eval never-export
77 ,#+EMAIL: john.doe@example.com
82 ** Document description
84 #+begin_src org :eval never-export
85 #+DESCRIPTION: This document catalogs a set of tips and tricks for composing documents in Org mode.
86 #+KEYWORDS: org-mode, syntax, quick reference, cheat sheet, recommended practices, latex, beamer, html
92 #+begin_src org :eval never-export
96 #+begin_src org :eval never-export
102 Set the ~toc~ attribute to activate an auto-generated table of contents (limited
103 to its 2 first levels) at the top of document.
105 #+begin_src org :eval never-export
109 #+begin_src org :eval never-export
114 The ~ALT_TITLE~ property allows to set an alternate title (shorter, for example)
115 for a given headline in the table of contents and other running heads.
118 To locally insert the TOC at some random place, use the ~#+TOC: headlines [n]~
119 feature; for example:
121 #+begin_src org :eval never-export
127 ~#+TOC: figures~ is not implemented yet in the HTML backend.
131 ~#+TOC: tables~ is already implemented in the HTML backend.
135 * Section titles (headings)
137 #+begin_src org :eval no
138 ,* Biggest heading (level 1)
144 ,** Bigger heading (level 2)
148 ,*** Big heading (level 3)
152 ,**** Heading (level 4)
159 You can create numbered headings up to a certain level by setting an option:
170 A single newline has no effect.
171 This line is part of the same paragraph.
175 demarcates paragraphs.
181 By entering two consecutive backslashes, \\
182 you can force a line break
183 without starting a new paragraph.
189 For an horizontal line, insert at least 5 dashes: this is some text above an
192 and some text below it.
197 # Premiere Elements, page 111
199 # Vous pouvez créer ces objets en cliquant sur le bouton Nouvel| élément de le
200 # fenêtre Média. (Le Chapitre 14 explique comment créer| des titres ; le
201 # Chapitre 15 montre l'utilisation des barres et ton, de la| vidéo noir et de
204 # The principles of beautiful Web design, page 6
206 # In a figurative sense, the concept of visual balance is similar to that of
207 # physical balance| illustrated by a seesaw. Just as physical objects have
208 # weight, so do the elements of a layout.| If the elements on either side of a
209 # layout are of equal weight, they balance one another.| There are two main forms
210 # of visual balance: symmetrical and asymmetrical.
212 One morning, when Gregor Samsa woke from troubled dreams, he found himself
213 transformed in his bed into a horrible vermin. He lay on his armour-like back,
214 and if he lifted his head a little he could see his brown belly, slightly domed
215 and divided by arches into stiff sections. The bedding was hardly able to cover
216 it and seemed ready to slide off any moment. His many legs, pitifully thin
217 compared with the size of the rest of him, waved about helplessly as he looked.
226 /Emphasize/ (italics), *strongly* (bold), and */very strongly/* (bold italics).
229 Markup elements can be nested:
232 This is /italic text which contains _underlined text_ within it/, whereas _this is
233 normal underlined text_.
236 Markup can span across multiple lines, by default *no more than 2*:
244 Org mode does not interpret a marker surrounded by alphanumeric characters as an
245 emphasis marker. So, you can't (easily) emphasize just part of a word:
251 ** Monospace, superscript and subscript
253 Other elements to use sparingly are:
256 - monospaced typewriter font for ~inline code~
257 - monospaced typewriter font for =verbatim text=
258 - +deleted text+ (vs. _inserted text_)
259 - text with super^{script}, such as 2^{10}
260 - text with sub_{script}, such as H_{2}O
265 If the XXX option is specified, Org mode will produce typographically correct
266 output, converting straight quotes to curly quotes, ~---~ to em-dashes, ~--~ to
267 en-dashes, and ~...~ to ellipses.
271 Org markup allows you to create *bulleted* or *numbered* lists. It allows any
272 combination of the two list types.
276 Itemized lists are marked with bullets. Create them with a minus or a plus sign.
278 They are convenient to organize data, and make the document prettier, and easier
282 - Item with some lengthy text wrapping hopefully across several lines. We add
283 a few words to really show the line wrapping.
300 Enumerated lists are marked with numbers or letters:
303 1. Arabic (decimal) numbered list item. We add a few words to show the line
305 A. Upper case alpha (letter) numbered list item.
312 You can have ordered lists with jumping numbers:
315 2. [@2] We start with point number 2.
316 3. Automatically numbered item.
321 :ID: f1a4a242-755b-4c38-9280-ee3f60e2b29a
324 Labeled, multi-line lists.
327 - First term to define ::
328 Definition of the first term. We add a few words to show the line wrapping,
329 to see what happens when you have long lines.
332 Explication of the second term with *inline markup*.
339 Adjacent lists sometimes like to fuse. To force the start of a new list, offset
340 the two lists by an empty line comment:
356 Tables are one of the most refined areas of the Org mode syntax. They are very easy
357 to create and to read.
362 | Cell in column 1, row 1 | Cell in column 2, row 1 |
363 | Cell in column 1, row 2 | Cell in column 2, row 2 |
366 Org tables have cells of at most one line long: there is no such thing as
367 a multi-line table cell in Org.
371 Columns are automatically aligned:
373 - Number-rich columns to the right, and
374 - String-rich columns to the left.
376 *** Table with aligned cells
378 If you want to override the automatic alignment, use ~<r>~, ~<c>~ or ~<l>~.
381 ,#+CAPTION: Table with aligned columns
384 | Right | Center | Left |
385 | xxxxxxxxxxxx | xxxxxxxxxxxx | xxxxxxxxxxxx |
388 *** Table with column size adjusted
392 You can create tables with an header row (by using an horizontal line of dashes
393 to separate it from the rest of the table).
396 #+CAPTION: Table with an header row
397 | Name of column 1 | Name of column 2 | Name of column 3 |
398 |------------------+------------------+------------------|
399 | Top left | Top middle | |
401 | Bottom left | Bottom middle | |
406 To test "sticky table headers"...
408 | Name of column 1 | Name of column 2 | Name of column 3 |
409 |------------------+------------------+------------------|
410 | Top left | Top middle | |
439 | Bottom left | Bottom middle | |
444 #+ATTR_LATEX: :center nil
449 XXX Different from the following:
456 ** Align tables on the page
460 Here is a table on the left side:
464 ,#+ATTR_LATEX: :center nil
472 The ~noindent~ just gets rid of the indentation of the first line of a paragraph
473 which in this case is the table. The ~hfill~ adds infinite stretch after the
474 table, so it pushes the table to the left.
478 Here is a centered table:
489 And here's a table on the right side:
493 #+ATTR_LATEX: :center nil
500 Here the ~hfill~ adds infinite stretch before the table, so it pushes the table
506 #+ATTR_HTML: :width 100%
507 | Cell in column 1, row 1 | Cell in column 2, row 1 |
508 | Cell in column 1, row 2 | Cell in column 2, row 2 |
513 You can fill a table from a CSV file using R commands.
520 #+begin_src org :eval no
527 This document is available in [[file:README.org][plain text]], [[file:README.html][HTML]] and [[file:README.pdf][PDF]].
529 The links are delimited by double square brackets.
534 See http://www.pirilampo.org (automatic!) and the
535 [[http://orgmode.org/][Org mode Web site]].
541 [[../README.html][Home]]
547 [[mailto:john.doe@example.com][email John Doe]]
552 To get image links, put a link to a file in the description.
555 Clicking on the image [[http://orgmode.org/][file:images/org-mode-unicorn.png]]
556 leads to the Org mode home page.
561 :ID: 0d2b0cb2-116c-4a61-a076-4c641faf4346
566 Anchors are used to specify hypertext link targets.
569 <<anchor>> Inline anchors make arbitrary content referenceable.
572 *** Internal cross references
574 Links generally point to an headline.
577 See chapter [[#links][Links]].
580 To add a link to a figure (e.g., "See Figure 1"), just do:
590 You can also create a hypertext link to a document anchor in the current
591 document /or in another document/.
595 - Location [[anchor][cross reference]].
596 - Section [[id:0d2b0cb2-116c-4a61-a076-4c641faf4346][Internal links]]
599 ** Extensions that define new hyperlinks targets
603 You can insert *image* files of different *formats* to a document:
606 |------+------------------------------+-----|
610 | bmp | (depends on browser support) | |
615 #+caption: Org mode logo
616 [[file:images/org-mode-unicorn.png]]
620 Click to see the [[file:images/org-mode-unicorn.png][Unicorn picture]].
623 ** Image alignment (using positioning)
625 Books usually align/float images on the right/left of the contents.
627 *** Image is left aligned
629 *** Image is right aligned
631 *** Image is centered
634 #+begin_src R :exports results :file-ext pdf :results graphics :width 8 :height 3
638 #+attr_latex: :float t :placement [b]
642 ** Image attributes and values
644 XXX Available HTML image tags include ...
646 | Attribute | Value(s) |
647 |----------------+-----------------------------|
648 | ~:alt~ | Alternate text |
650 | ~:width~ | User defined size in pixels |
656 | ~:title~ | User defined text |
659 #+ATTR_LaTeX: :width 0.25\linewidth
660 [[file:images/org-mode-unicorn.png]]
663 Place images side by side: XXX
667 To define images that will be *treated as book illustrations* (figures) and
668 automatically labeled and numbered, use XXX.
672 Videos can't be added directly.
674 Though, you can add an image with a link to the video like this:
677 [[http://www.youtube.com/watch?v=DnSGSiXYuOk][file:../bigblow.png]]
682 Admonitions (contextual backgrounds) are statements taken out of the content's
683 flow and labeled with a title.
685 Common admonitions are:
693 (Most themes style only ~note~ and ~warning~ specially.)
695 ** List of supported admonitions :noexport:
697 | Total | | docutils | rST | RTD | AsciiDoc | DocBook | MoinMoin (Modern) | Bootstrap | DocOnce | Confluence | SuperCollider |
698 |--------+-----------+----------+-----+-----+----------+---------+-------------------+-----------+---------+------------+---------------|
699 | 7 | note | 1 | 1 | 1 | 1 | 1 | 1 | | | 1 | 1 |
700 | 9 | warning | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
701 | 7 | tip | 1 | 1 | 1 | 1 | 1 | 1 | | | 1 | |
702 |--------+-----------+----------+-----+-----+----------+---------+-------------------+-----------+---------+------------+---------------|
703 | 6 | caution | 1 | 1 | 1 | 1 | 1 | 1 | | | | |
704 | 6 | important | 1 | 1 | 1 | 1 | 1 | 1 | | | | |
705 |--------+-----------+----------+-----+-----+----------+---------+-------------------+-----------+---------+------------+---------------|
706 | 3 | attention | 1 | 1 | 1 | | | | | | | |
707 | 3 | hint | 1 | 1 | 1 | | | | | | | |
708 | 3 | error | 1 | 1 | 1 | | | | | | | |
709 | 4 | danger | 1 | 1 | 1 | | | | 1 | | | |
710 |--------+-----------+----------+-----+-----+----------+---------+-------------------+-----------+---------+------------+---------------|
711 | #ERROR | seealso | | | ? | | | | | | | |
712 | #ERROR | todo | | | ? | | | | | | | |
713 |--------+-----------+----------+-----+-----+----------+---------+-------------------+-----------+---------+------------+---------------|
714 | 2 | info | | | | | | | 1 | | 1 | |
715 | 1 | notice | | | | | | | | 1 | | |
716 | 1 | question | | | | | | | | 1 | | |
717 | 1 | summary | | | | | | | | 1 | | |
718 | 1 | success | | | | | | | 1 | | | |
719 #+TBLFM: $1=vsum($3..$11)
725 A note box is displayed as follows:
729 This is a useful note.
733 # #+attr_html: :options [By the way...]
734 # #+attr_latex: :options Test
736 # This is a useful note (with a title).
741 A warning box is displayed as follows:
745 Be careful! Check that you have...
751 A tip box is displayed as follows:
755 Try doing it this way...
775 ** Additional admonitions
809 *** SeeAlso (Sphinx additional)
813 - [[http://en.wikipedia.org/wiki/Apple][Apples]] ::
814 A kind of [[http://en.wikipedia.org/wiki/Fruit][fruit]].
820 # See example at http://docs.ckan.org/en/latest/contributing/python.html
821 # or http://wsgiservice.readthedocs.org/en/latest/todo.html
823 Simple box ("inline task"):
826 *************** TODO Do this task
827 Description of inline task.
831 *************** TODO Do this task
832 Description of inline task.
837 *************** WAIT [#B] Do also this other task :phone:
841 #+begin_admonitiontodo
845 Alternatively to the inline tasks (for creating "TODO" annotations), if you want
846 such notes not to show up in the published version, drawers may also do the job,
853 You can then control what drawers are exported with
854 ~org-export-with-drawers~ (or per document with d OPTIONS item).
871 aligned to the right!
878 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
879 tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
880 quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
881 consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
882 cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
883 proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
886 Org mode was first released by Carsten Dominik in 2004 as an outlining and
887 project planning tool. Further development turned it into a general tool that
888 can be used to author professional documents like LaTeX.
891 Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac
892 turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor
893 sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies
894 mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien
895 ullamcorper pharetra. Vestibulum erat wisi...
897 Phasellus ut libero. Nulla in libero non enim tristique sollicitudin. Ut
898 tempor. Phasellus pellentesque augue eget ante. Mauris malesuada. Donec sit
899 amet diam sit amet dolor placerat blandit. Morbi enim purus, imperdiet in,
900 molestie sit amet, pellentesque eu, mauris. In vel erat vel ipsum bibendum
901 commodo. Curabitur accumsan. Nam sed metus. Etiam tristique bibendum justo.
906 You can have ~example~ blocks.
909 : 10/17/97 9:04 <DIR> bin
910 : 10/16/97 14:11 <DIR> DOS
911 : 10/16/97 14:46 <DIR> TEMP
912 : 10/16/97 14:37 <DIR> WINNT
913 : 10/16/97 14:25 119 AUTOEXEC.BAT
914 : 2/13/94 6:21 54,619 COMMAND.COM
921 10/17/97 9:04 <DIR> bin
922 10/16/97 14:11 <DIR> DOS
923 10/16/97 14:46 <DIR> TEMP
924 10/16/97 14:37 <DIR> WINNT
925 10/16/97 14:25 119 AUTOEXEC.BAT
926 2/13/94 6:21 54,619 COMMAND.COM
934 Use the ~quote~ block for content that *doesn't require the preservation of line
939 Let us change our traditional attitude to the construction of programs:
940 Instead of imagining that our main task is to instruct a computer what to do,
941 let us concentrate rather on explaining to human beings what we want a
944 The practitioner of literate programming can be regarded as an essayist, whose
945 main concern is with exposition and excellence of style. Such an author, with
946 thesaurus in hand, chooses the names of variables carefully and explains what
947 each variable means. He or she strives for a program that is comprehensible
948 because its concepts have been introduced in an order that is best for human
949 understanding, using a mixture of formal and informal methods that reinforce
960 Everything should be made as simple as possible,
961 but not any simpler. -- Albert Einstein
967 In a ~verse~ environment, there is an *implicit line break at the end of each line*,
968 and *indentation* is preserved:
972 Everything should be made as simple as possible,
973 but not any simpler. -- Albert Einstein
977 Typically used for quoting passages of an email message:
981 >> The meeting has been postponed to next Friday.
983 > Has the deadline for the report been moved too?
985 Yes. And chekout http://www.doodle.com/ for rescheduling the meeting.
993 ** Block quote with optional attribution line
999 ** Block quotes with their own class attribute
1013 ** Non-breaking space
1015 Insert the Unicode character ~00A0~ to add a non-breaking space.
1017 FIXME Or add/use an Org entity? Or use tilde?
1022 It's possible to add comments in the document.
1024 # This Org comment here won't be displayed.
1028 Org doesn't support *comments inside paragraphs* since a comment ends
1029 a paragraph. However, you can mimic inline comments with export snippets, e.g.,
1034 If you have tables (for example) that you want to ignore during export, one possibility
1035 is to use *comment blocks* or ~:noexport:~ subtrees. Another possibility is to
1036 *use* non-exported *drawers* (see #+OPTIONS: d:).
1039 If you want to ignore that part only during export, but still want to
1040 use keep it active in the buffer, I suggest to use a drawer, with an
1041 appropriate `org-export-with-drawers' value, e.g.,
1044 ,#+OPTIONS: d:(not "NOEXPORT")
1049 ** General replacements
1051 #+begin_src org :eval no
1052 ,#+MACRO: longtext this very very long text
1054 Insert {{{longtext}}} wherever required.
1057 #+MACRO: longtext this very very long text
1059 Insert {{{longtext}}} wherever required.
1061 ** Styled references
1063 #+BEGIN_SRC org :eval no
1064 ,#+MACRO: color @@html:<span style="color: $1">$2</span>@@
1066 {{{color(blue, This text is colored in blue.)}}}
1068 {{{color(red, This other text is in red.)}}}
1071 #+MACRO: color @@html:<span style="color: $1">$2</span>@@
1073 {{{color(blue, This text is colored in blue.)}}}
1075 {{{color(red, This other text is in red.)}}}
1077 Find more macros on [[https://github.com/fniessen/org-macros][GitHub]].
1079 ** Special characters
1081 We also use substitutions to include some of the widely used Unicode characters
1082 (like ©, converted from text characters to its typographically correct entity).
1093 - Dash: \ndash \mdash
1094 - Marks: \iexcl \iquest
1095 - Quotations: \laquo \raquo
1096 - Miscellaneous: \para \ordf
1099 *** Commercial symbols
1102 - Property marks: \copy \reg
1103 - Currency: \cent \EUR \yen \pound
1106 *** Greek characters
1109 The Greek letters \alpha, \beta, and \gamma are used to denote angles.
1116 - Arrows: \to \rarr \larr \harr \rArr \lArr \hArr
1117 - Function names: \arccos \cos
1118 - Signs and symbols: \bull \star
1124 - Zero-width non-joiner: \zwnj
1125 # Smilies: \smiley \sad
1126 - Suits: \clubs \spades
1130 You can insert a real "zero-width space" Unicode character by pressing
1131 ~C-x 8 RET zero width space RET~ or ~C-x 8 RET 200b RET~.
1139 Reference code like ~variables~ or ~functions~ inline.
1142 You can also evaluate code inline as follows: 1 + 1 is src_R{1 + 1}.
1144 ** Code blocks (with syntax highlighting)
1146 The source code blocks support syntax highlighting:
1148 #+begin_src cpp :eval no
1150 * Application that displays a "Hello" message to the standard output.
1152 int main(int arc, char **argv)
1154 printf("Hello, %s!\n", (argc>1) ? argv[1] : "World");
1159 #+begin_src emacs-lisp :eval no
1160 (defvar hello "Hello")
1162 (defun hello (name &optional greeting)
1163 (message "%s %s" (or greeting "Hello") name))
1168 # See http://sphinxcontrib-emacs.readthedocs.org/en/latest/guide/domain.html
1171 You need =htmlize.el= in your ~load-path~, for the HTML export.
1176 The following language strings are currently recognized:
1178 #+begin_src emacs-lisp :results drawer :exports results
1179 (concat (mapconcat (lambda (widget)
1180 (widget-get widget :tag))
1181 (cl-remove-if-not (lambda (it)
1183 (eq (car it) 'const)))
1187 'org-babel-load-languages 'custom-type)
1195 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.
1200 Code block with long lines:
1202 #+begin_src emacs-lisp :eval no
1203 testing testing testing testing testing testing testing testing testing testing
1205 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456
1208 For PDF (LaTeX), one solution is to surround the code block such as:
1210 #+latex: \scriptsize
1212 print("This block is in scriptsize")
1214 #+latex: \normalsize
1218 Both in ~example~ and in ~src~ snippets, you can add a ~-n~ switch to the end of the
1219 ~begin~ line to get the lines numbered:
1222 #+begin_src emacs-lisp -n
1223 (defun org-xor (a b)
1227 If you use a ~+n~ switch, the numbering from the previous numbered snippet will
1228 be continued in the current one:
1231 #+begin_src emacs-lisp +n
1237 In literal examples, Org will interpret strings like ~(ref:name)~ as labels, and
1238 use them as targets for special hyperlinks like ~[[(name)]]~ (i.e., the reference
1239 name enclosed in single parenthesis). In HTML, hovering the mouse over such
1240 a link will remote-highlight the corresponding code line, which is kind of
1243 You can also add a ~-r~ switch which removes the labels from the source code.
1244 With the ~-n~ switch, links to these references will be labeled by the line
1245 numbers from the code listing, otherwise links will use the labels with no
1246 parentheses. Here is an example:
1249 #+begin_src emacs-lisp -n -r
1250 (save-excursion ; (ref:sc)
1251 (goto-char (point-min))) ; (ref:jump)
1254 In line [[(sc)]], we remember the current position. [[(jump)][Line (jump)]] jumps to
1259 You can embed LaTeX math formatting in Org mode files.
1261 ** Inline math expressions
1263 For *inline math* expressions, use the parentheses notation ~\(...\)~:
1266 The formula \(a^2 + b^2 = c^2\) has been discovered by Pythagoras.
1268 Let \(a=\sin(x) + \cos(x)\). Then \(a^2 = 2\sin(x)\cos(x)\) because \(\sin^2x +
1273 It's /not/ advised to use the ~$...$~ construct (both for Org and for MathJax).
1275 Don't forget that ~$~ is also a valid currency symbol!
1278 ** Math expressions in display mode
1280 For mathematical expressions which you want to make *stand out, centered on their
1281 own lines*, use ~\[...\]~:
1284 The /Euler theorem/:
1287 \int_0^\infty e^{-x^2} dx = {{\sqrt{\pi}} \over {2}}
1290 LaTeX allows to inline such ~\[...\]~ constructs (/quadratic formula/):
1291 \[ \frac{-b \pm \sqrt{b^2 - 4 a c}}{2a} \]
1295 Double dollar signs (~$$~) should not be used.
1300 \left( \int_{0}^{\infty} \frac{\sin x}{\sqrt x}\,\mathrm{d}x \
1302 \prod_{k=1}^{\infty} \frac{4k^{2}}{4k^{2}-1} +
1303 \frac{\lambda}{2n}\sum_{k=1} ^{n} \theta_{k} ^{2} x^{n} = 0
1307 The equation may be wrong, but it's a nice one!
1311 Differently from ~$...$~ and ~\(...\)~, an equation environment produces a *numbered*
1312 equation to which you can add a label and reference the equation by (label) name
1313 in other parts of the text. This is not possibly with unnumbered math
1314 environments (~$$~, ...).
1317 The /Pythagoras theorem/:
1324 See equation [[pythag]].
1326 # The /sinus theorem/ can be written as the equation:
1329 # \label{eqn:sinalpha}
1330 # \frac{\sin\alpha}{a}=\frac{\sin\beta}{b}
1333 # See equation [[eqn:sinalpha]].
1336 Only captioned equations are numbered.
1338 Other alternatives: use
1339 - ~\begin{equation*}~ or
1340 - ~\begin{displaymath}~ (= the verbose form of the ~\[...\]~ construct).
1342 ~M-q~ does not fill those.
1344 * Miscellaneous effects
1346 ** Include Org files
1348 You can include another Org file and skip its title by using the ~:lines~ argument
1352 ,#+INCLUDE: "chapter1.org" :lines "2-"
1356 File inclusion, through INCLUDE keywords, is an *export-only feature*.
1361 # http://johnmacfarlane.net/pandoc/README.html
1363 You can include raw HTML in your Org documents and it will get kept as HTML
1366 #+HTML_BEGIN: <pre style="color:red">
1367 Text can be preformatted (in a fixed-width font).
1370 It is especially useful for more advanced stuff like images or tables where you
1371 need more control of the HTML options than Org mode actually gives you.
1373 Similarly, you can incorporate JS or do anything else you can do in a Web page
1374 (such as importing a CSS file).
1376 *** Native DIV blocks
1378 You can create named classes (to get style control from your CSS) with:
1382 This text is wrapped in a myclass DIV...
1386 You can also add interactive elements to the HTML such as interactive R plots.
1388 Finally, you can include an HTML file verbatim (during export) with:
1391 ,#+INCLUDE: "file.html" export html
1394 Don't edit the exported HTML file!
1398 You can also use raw LaTeX. XXX
1400 #+LaTeX_BEGIN: \begin{verbatim}
1401 Text can be preformatted (in a fixed-width font).
1402 #+LaTeX_END: \end{verbatim}
1407 It is possible to define named footnotes[fn:myfootnote], or ones with automatic
1412 It is possible to define named footnotes[fn:myfootnote], or ones with automatic
1421 Timestamps: [2014-01-16 Thu] and <2014-01-16 Thu>.
1423 *** TODO We need to achieve...
1425 *** DONE [#A] Buy GTD book :online:
1427 - State "TODO" -> "DONE" [2014-01-16 Thu 09:52]
1430 By default, ~DONE~ actions will be collapsed.
1432 Note that I should probably implement that default behavior only for ~ARCHIVE~'d
1435 *** TODO [#A] Read GTD book
1436 SCHEDULED: <2014-09-11 Thu>
1438 By default, *all* (active) entries will be expanded at page load, so that their
1439 contents is visible.
1441 That can be changed by adding such a line (into your Org document):
1443 #+begin_src org :eval no
1444 ,#+HTML_HEAD: <script> var HS_STARTUP_FOLDED = true; </script>
1447 *** TODO [#B] Apply GTD methodoloy
1448 DEADLINE: <2014-12-01 Mon>
1450 :HTML_CONTAINER_CLASS: hsCollapsed
1453 This section will be collapsed when loading the page because the entry has the
1454 value ~hsCollapsed~ for the property ~:HTML_CONTAINER_CLASS:~.
1458 *** Some note :computer:write:
1460 You can add tags to any entry, and hightlight all entries having some specific
1461 tag by clicking on the buttons made accessible to you in the "Dashboard".
1463 *** Weekly review :computer:
1465 Now, you can even make your weekly review in the HTML export... Press the ~r~ key
1466 to start entering the "review mode" where all but one active entry are
1467 collapsed, so that you can really focus on one item at a time!
1469 ** Bigblow extension
1471 The string ~fixme~ (in *upper case*) gets replaced by a "Fix Me!" image:
1474 FIXME Delete this...
1477 * Graphs with Graphviz
1479 To enable the Graphviz extension, we have to add it to the extensions list in
1480 the ~org-babel-load-languages~ variable.
1482 #+begin_src emacs-lisp :exports code
1483 (add-to-list 'org-babel-load-languages '(dot . t))
1484 (org-babel-do-load-languages 'org-babel-load-languages org-babel-load-languages)
1487 It uses directly the ~dot~ command to process DOT language.
1492 ,#+begin_src dot :file images/graph.png :cmdline -Tpng
1501 #+begin_src org :exports results
1502 ,#+begin_src dot :file images/digraph.png :cmdline -Tpng
1511 The output from the *execution* of programs, scripts or commands can be inserted
1512 in the document itself, allowing you to work in the /reproducible research/
1515 To enable the Graphviz extension, we have to add it to the extensions list in
1516 the ~org-babel-load-languages~ variable.
1518 #+begin_src emacs-lisp :exports code
1519 (add-to-list 'org-babel-load-languages '(R . t)) ; Requires R and ess-mode.
1520 (org-babel-do-load-languages 'org-babel-load-languages org-babel-load-languages)
1523 It uses directly the ~R~ command to process R language.
1548 #+begin_src R :var data=data :results graphics :file images/Rplot.png :exports both
1549 plot(data, type="b", bty="l", col=c("#ABD249"), las=1, lwd=4)
1550 grid(nx=NULL, ny=NULL, col=c("#E8E8E8"), lwd=1)
1551 legend("bottom", legend=c("Degrees"), col=c("#ABD249"), pch=c(19))
1554 The resulting chart:
1557 [[file:images/Rplot.png]]
1561 #+begin_src R :results output graphics :file foo.png :session *foo*
1563 ggplot(data.frame(x = rnorm(10), y = rnorm(10)),
1564 aes(x = x, y = y)) +
1570 Cross-referenced to bibliography.
1578 Index (or list of acronyms).
1580 - Write index entries
1584 Note that multi-entry terms generate separate index entries.
1586 #+index: Definitions!Org-mode
1588 - Place the index at the desired location
1590 - Produce the index by updating ~org-latex-pdf-process~
1592 #+BIND: org-latex-pdf-process ("pdflatex %b" "bibtex %b" "pdflatex %b" "pdflatex %b")
1598 - Eric Steven Raymond. The Art of Unix Programming. Addison-Wesley. ISBN
1601 # http://rmarkdown.rstudio.com/authoring_bibliographies_and_citations.html
1605 Glossaries are optional. Glossaries entries are an example of [[id:f1a4a242-755b-4c38-9280-ee3f60e2b29a][definition lists]].
1607 - A glossary term ::
1608 The corresponding (indented) definition.
1610 - A second glossary term ::
1611 The corresponding (indented) definition.
1617 Report issues and suggest features and improvements on the [[https://github.com/fniessen/refcard-org-mode/issues/new][GitHub issue tracker]].
1621 I love contributions! Patches under any form are always welcome!
1625 If you use the refcard-org-mode project and feel it is making your life better
1626 and easier, you can show your appreciation and help support future development
1627 by making a [[https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=VCVAS6KPDQ4JC&lc=BE&item_number=refcard%2dorg%2dmode¤cy_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted][donation]] through PayPal. Thank you!
1629 Regardless of the donations, refcard-org-mode will always be free both as in
1630 beer and as in speech.
1634 Copyright (C) 2014-2017 Fabrice Niessen.
1636 Author: Fabrice Niessen \\
1637 Keywords: org-mode refcard
1639 This program is free software; you can redistribute it and/or modify it under
1640 the terms of the GNU General Public License as published by the Free Software
1641 Foundation, either version 3 of the License, or (at your option) any later
1644 This program is distributed in the hope that it will be useful, but WITHOUT ANY
1645 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
1646 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
1648 You should have received a copy of the GNU General Public License along with
1649 this program. If not, see http://www.gnu.org/licenses/.
1651 #+html: <a href="http://opensource.org/licenses/GPL-3.0">
1652 #+html: <img src="http://img.shields.io/:license-gpl-blue.svg" alt=":license-gpl-blue.svg" />
1654 #+html: <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=VCVAS6KPDQ4JC&lc=BE&item_number=refcard%2dorg%2dmode¤cy_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted">
1655 #+html: <img src="https://www.paypalobjects.com/en_US/i/btn/btn_donate_LG.gif" alt="btn_donate_LG.gif" />
1660 [fn:myfootnote] Extensively used in large documents.
1662 [fn:2] Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
1663 eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim
1664 veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea
1665 commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit
1666 esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
1667 non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
1669 #+BIND: org-hide-emphasis-markers nil
1671 # This is for the sake of Emacs.
1673 # org-hide-emphasis-markers: nil