% title % author % date
Cheatsheet on Pandoc's markdown.
Pandoc uses a limited front matter, called Title block in its documentation, that can only contain a few fields:
% title
% author
% date
To get a table linked of contents, use the --toc
option this gives ids based on name to the headers (strips illegal chars, transforms spaces into hyphens).
You can give explicit attributes to headers like this one.
Explicit IDs will override automatic ids that would be generated by toc
.
Only the id has effect in LaTeX (becomes a label), other don't even show in HTML.
According to docs it should also be possible to add arbitrary attributes of type a=b, but this currently breaks the header.
2^10^ is 1024. sup
tag in HTML.
H2O is a liquid. sub
tag in HTML.
striked out
Named references, much like traditional Math equation references.
(@) no tag. a bit useless.
a paragraph
(@) no tag. a bit useless.
must be at start of line to work: (@)
(@tag1) text of tag1
Ref to tag1: (@tag1)
(@tag2) text of tag2
Ref to tag1: (@tag1)
(@tag1) <-- cannot start line directly with reference. It will be treated as a list item.
Pandoc understands many ordered list formats. Insane.
- a
- a
- a
(1) a (2) a (3) a
Extra code block formats. Insane.
import os
def f(a):
print a
f("abc")
Two backticks:
`` import os
def f(a): print a
f("abc") ``
Inline:
Display on a single line:
Firs chars after first dollar and before lats one must not be space: $ x^2$ $x^2 $ $ x^2 $
Multiline and align:
Must use double dollars $$
!
Raw LaTeX is ignored on HTML output.
Inline \LaTeX directive.
Block LaTeX directive:
\begin{equation} x^2 \end{equation}
Remove page number from a single page document: add the following line to the top:
% A pdf file without page numbers created from pandoc markdown
% sieste
% June 2013
\pagenumbering{gobble}
# First header
etc
Ignored for PDF output:
raw HTML
**markdown bold in raw HTML**