...
A shortcut form can also be used for specifying the language of the code
block:
::
```haskell
qsort [] = []
```
This is equivalent to:
::
``` {.haskell}
qsort [] = []
```
To prevent all highlighting, use the ``--no-highlight`` flag. To set the
highlighting style, use ``--highlight-style``.
Lists
-----
Bullet lists
~~~~~~~~~~~~
A bullet list is a list of bulleted list items. A bulleted list item
begins with a bullet (``*``, ``+``, or ``-``). Here is a simple example:
::
* one
* two
* three
This will produce a "compact" list. If you want a "loose" list, in which
each item is formatted as a paragraph, put spaces between the items:
::
* one
* two
* three
The bullets need not be flush with the left margin; they may be indented
one, two, or three spaces. The bullet must be followed by whitespace.
List items look best if subsequent lines are flush with the first line
(after the bullet):
::
* here is my first
list item.
* and my second.
But markdown also allows a "lazy" format:
::
* here is my first
list item.
* and my second.
The four-space rule
~~~~~~~~~~~~~~~~~~~
A list item may contain multiple paragraphs and other block-level
content. However, subsequent paragraphs must be preceded by a blank line
and indented four spaces or a tab. The list will look better if the
first paragraph is aligned with the rest:
::
* First paragraph.
Continued.
* Second paragraph. With a code block, which must be indented
eight spaces:
{ code }
List items may include other lists. In this case the preceding blank
line is optional. The nested list must be indented four spaces or one
tab:
::
* fruits
+ apples
- macintosh
- red delicious
+ pears
+ peaches
* vegetables
+ brocolli
+ chard
As noted above, markdown allows you to write list items "lazily,"
instead of indenting continuation lines. However, if there are multiple
paragraphs or other blocks in a list item, the first line of each must
be indented.
::
+ A lazy, lazy, list
item.
+ Another one; this looks
bad but is legal.
Second paragraph of second
list item.
**Note:** Although the four-space rule for continuation paragraphs comes
from the official `markdown syntax
guide `` tags around "First", "Second", or "Third"), while markdown puts ``
`` tags
around "Second" and "Third" (but not "First"), because of the blank
space around "Third". Pandoc follows a simple rule: if the text is
followed by a blank line, it is treated as a paragraph. Since "Second"
is followed by a list, and not a blank line, it isn't treated as a
paragraph. The fact that the list is followed by a blank line is
irrelevant. (Note: Pandoc works this way even when the ``--strict``
option is specified. This behavior is consistent with the official
markdown syntax description, even though it is different from that of
``Markdown.pl``.)
Ending a list
~~~~~~~~~~~~~
What if you want to put an indented code block after a list?
::
- item one
- item two
{ my code block }
Trouble! Here pandoc (like other markdown implementations) will treat
``{ my code block }`` as the second paragraph of item two, and not as a
code block.
To "cut off" the list after item two, you can insert some non-indented
content, like an HTML comment, which won't produce visible output in any
format:
::
- item one
- item two
{ my code block }
You can use the same trick if you want two consecutive lists instead of
one big list:
::
1. one
2. two
3. three
1. uno
2. dos
3. tres
Horizontal rules
----------------
A line containing a row of three or more ``*``, ``-``, or ``_``
characters (optionally separated by spaces) produces a horizontal rule:
::
* * * *
---------------
Tables
------
*Pandoc extension*.
Three kinds of tables may be used. All three kinds presuppose the use of
a fixed-width font, such as Courier.
**Simple tables** look like this:
::
Right Left Center Default
------- ------ ---------- -------
12 12 12 12
123 123 123 123
1 1 1 1
Table: Demonstration of simple table syntax.
The headers and table rows must each fit on one line. Column alignments
are determined by the position of the header text relative to the dashed
line below it: [3]_
- If the dashed line is flush with the header text on the right side
but extends beyond it on the left, the column is right-aligned.
- If the dashed line is flush with the header text on the left side but
extends beyond it on the right, the column is left-aligned.
- If the dashed line extends beyond the header text on both sides, the
column is centered.
- If the dashed line is flush with the header text on both sides, the
default alignment is used (in most cases, this will be left).
The table must end with a blank line, or a line of dashes followed by a
blank line. A caption may optionally be provided (as illustrated in the
example above). A caption is a paragraph beginning with the string
``Table:`` (or just ``:``), which will be stripped off. It may appear
either before or after the table.
The column headers may be omitted, provided a dashed line is used to end
the table. For example:
::
------- ------ ---------- -------
12 12 12 12
123 123 123 123
1 1 1 1
------- ------ ---------- -------
When headers are omitted, column alignments are determined on the basis
of the first line of the table body. So, in the tables above, the
columns would be right, left, center, and right aligned, respectively.
**Multiline tables** allow headers and table rows to span multiple lines
of text (but cells that span multiple columns or rows of the table are
not supported). Here is an example:
::
-------------------------------------------------------------
Centered Default Right Left
Header Aligned Aligned Aligned
----------- ------- --------------- -------------------------
First row 12.0 Example of a row that
spans multiple lines.
Second row 5.0 Here's another one. Note
the blank line between
rows.
-------------------------------------------------------------
Table: Here's the caption. It, too, may span
multiple lines.
These work like simple tables, but with the following differences:
- They must begin with a row of dashes, before the header text (unless
the headers are omitted).
- They must end with a row of dashes, then a blank line.
- The rows must be separated by blank lines.
In multiline tables, the table parser pays attention to the widths of
the columns, and the writers try to reproduce these relative widths in
the output. So, if you find that one of the columns is too narrow in the
output, try widening it in the markdown source.
Headers may be omitted in multiline tables as well as simple tables:
::
----------- ------- --------------- -------------------------
First row 12.0 Example of a row that
spans multiple lines.
Second row 5.0 Here's another one. Note
the blank line between
rows.
-------------------------------------------------------------
: Here's a multiline table without headers.
It is possible for a multiline table to have just one row, but the row
should be followed by a blank line (and then the row of dashes that ends
the table), or the table may be interpreted as a simple table.
**Grid tables** look like this:
::
: Sample grid table.
+---------------+---------------+--------------------+
| Fruit | Price | Advantages |
+===============+===============+====================+
| Bananas | $1.34 | - built-in wrapper |
| | | - bright color |
+---------------+---------------+--------------------+
| Oranges | $2.10 | - cures scurvy |
| | | - tasty |
+---------------+---------------+--------------------+
The row of ``=``\ s separates the header from the table body, and can be
omitted for a headerless table. The cells of grid tables may contain
arbitrary block elements (multiple paragraphs, code blocks, lists,
etc.). Alignments are not supported, nor are cells that span multiple
columns or rows. Grid tables can be created easily using `Emacs table
mode
``. This is a nice alternative to
markdown's "invisible" way of indicating hard line breaks using two
trailing spaces on a line.
Backslash escapes do not work in verbatim contexts.
Smart punctuation
-----------------
*Pandoc extension*.
If the ``--smart`` option is specified, pandoc will produce
typographically correct output, converting straight quotes to curly
quotes, ``---`` to em-dashes, ``--`` to en-dashes, and ``...`` to
ellipses. Nonbreaking spaces are inserted after certain abbreviations,
such as "Mr."
Note: if your LaTeX template uses the ``csquotes`` package, pandoc will
detect automatically this and use ``\enquote{...}`` for quoted text.
Inline formatting
-----------------
Emphasis
~~~~~~~~
To *emphasize* some text, surround it with ``*``\ s or ``_``, like this:
::
This text is _emphasized with underscores_, and this
is *emphasized with asterisks*.
Double ``*`` or ``_`` produces **strong emphasis**:
::
This is **strong emphasis** and __with underscores__.
A ``*`` or ``_`` character surrounded by spaces, or backslash-escaped,
will not trigger emphasis:
::
This is * not emphasized *, and \*neither is this\*.
Because ``_`` is sometimes used inside words and identifiers, pandoc
does not interpret a ``_`` surrounded by alphanumeric characters as an
emphasis marker. If you want to emphasize just part of a word, use
``*``:
::
feas*ible*, not feas*able*.
Strikeout
~~~~~~~~~
*Pandoc extension*.
To strikeout a section of text with a horizontal line, begin and end it
with ``~~``. Thus, for example,
::
This ~~is deleted text.~~
Superscripts and subscripts
~~~~~~~~~~~~~~~~~~~~~~~~~~~
*Pandoc extension*.
Superscripts may be written by surrounding the superscripted text by
``^`` characters; subscripts may be written by surrounding the
subscripted text by ``~`` characters. Thus, for example,
::
H~2~O is a liquid. 2^10^ is 1024.
If the superscripted or subscripted text contains spaces, these spaces
must be escaped with backslashes. (This is to prevent accidental
superscripting and subscripting through the ordinary use of ``~`` and
``^``.) Thus, if you want the letter P with 'a cat' in subscripts, use
``P~a\ cat~``, not ``P~a cat~``.
Verbatim
~~~~~~~~
To make a short span of text verbatim, put it inside backticks:
::
What is the difference between `>>=` and `>>`?
If the verbatim text includes a backtick, use double backticks:
::
Here is a literal backtick `` ` ``.
(The spaces after the opening backticks and before the closing backticks
will be ignored.)
The general rule is that a verbatim span starts with a string of
consecutive backticks (optionally followed by a space) and ends with a
string of the same number of backticks (optionally preceded by a space).
Note that backslash-escapes (and other markdown constructs) do not work
in verbatim contexts:
::
This is a backslash followed by an asterisk: `\*`.
Attributes can be attached to verbatim text, just as with `delimited
code blocks <#delimited-code-blocks>`_:
::
`<$>`{.haskell}
Math
----
*Pandoc extension*.
Anything between two ``$`` characters will be treated as TeX math. The
opening ``$`` must have a character immediately to its right, while the
closing ``$`` must have a character immediately to its left. Thus,
``$20,000 and $30,000`` won't parse as math. If for some reason you need
to enclose text in literal ``$`` characters, backslash-escape them and
they won't be treated as math delimiters.
TeX math will be printed in all output formats. How it is rendered
depends on the output format:
Markdown, LaTeX, Org-Mode, ConTeXt
It will appear verbatim between ``$`` characters.
reStructuredText
It will be rendered using an interpreted text role ``:math:``, as
described
`here