Contents

{:.no_toc}

Introduction

Examples shows explicit examples for different syntaxes. Other Syntaxes show the syntaxes that can’t be shown explicitly.

Organization

Note:

Examples

@markdown

See Emphasis and Other Syntaxes to see alternative Setext-style header styles @markdown

@markdown

Header Containing Attributes {#identifier .class1 key=value1}

@pandoc @phpextra

Header Unnumbered {-}

@pandoc

Header Unnumbered 2 {.Unnumbered}

@pandoc

Auto Cross Reference

User defined reference

Deeper Levels of Headers

Header4

Header5
Header6

Backslash Escapes

*testing* @markdown

Emphasis

CriticMarkup

Visually it looks like emphasis. Functionally it is much more, and called Critic Markup @mmd

See more at CriticMarkup—MultiMarkdown Documentation.

Horizontal Rules

@markdown


3 or more hyphens or asterisks


Break

@markdown

No break like this

Soft break
like this

Hard break

like this

Superscript & Subscript

Smarty Pants

@markdown(+smartypants) @pandoc(–smart) @ghpages

@mmd

Abbreviations (PHP Markdown Extra)

@mmd @phpextra @pandoc(+abbreviations)

Testing abbreviations: HTML, W3C (mouseover it to see)

Lists

Ordered Lists

@markdown

  1. test
  2. test
  3. test

Unordered Lists

@markdown

Nested Lists

@markdown

Note about LaTeX output in mmd/pandoc:

Cutoff a List

@markdown

  1. one
  2. two
  3. three
  1. uno
  2. dos
  3. tres
{ my code block }

List Item in a Block

@markdown

Fancy Lists

@pandoc

. one

. two

9) Ninth 10) Tenth 11) Eleventh i. i ii. ii iii. iii (2) Two (5) Three 1. Four * Five

Definition Lists

Method 1

@mmd @phpextra @pandoc @ghpages

Physics
The Fundamental of Science
Describe the Nature
Make Prediction

Method 2

@ghpages @pandoc @mmd

Term 1
Definition 1
Term 2 with inline markup

Definition 2

{ some code, part of Definition 2 }

Third paragraph of definition 2.

Numbered Example Lists

@pandoc

(@) My first example will be numbered (1). (@) My second example will be numbered (2).

Explanation of examples.

(@) My third example will be numbered (3).

(@good) This is a good example.

As (@good) illustrates, …

Code

Fenced Code Blocks

Method 1

@markdown

test
test
    test
    # test

Method 2

@markdown(partial:language-not-supported) @ghpages @pandoc @mmd

\nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}

Method 3

@pandoc

~~~markdown test test test # test ~~~

~~~ {#mycode .markdown .numberLines startFrom=“100”} test test test # test ~~~

Block-quotes

@markdown

Test

test

test

test

Block-quotes Quoting Codes

@markdown

\newcommand...

Line Blocks

@ghpages(partial) @pandoc

| The limerick packs laughs anatomical | In space that is quite economical. | But the good ones I’ve seen | So seldom are clean | And the clean ones so seldom are comical

| 200 Main St. | Berkeley, CA 94718

Tables

Method 1

@ghpages @pandoc @mmd

| Right | Left | Default | Center |
|——:|:—–|———|:——:|
| 12 | 12 | 12 | 12 |
| 123 | 123 | 123 | 123 |
| 1 | 1 | 1 | 1 |
Notice how pandoc can have optional caption like this

Method 2

@mmd

Table Caption
Grouping
Left align Right align Center align
This This This
column column column
will will will
be be be
left right center
aligned aligned aligned
And a big grouping is like this

Method 3

@pandoc

Right Left Center Default ——- —— ———- ——- 12 12 12 12 123 123 123 123 1 1 1 1

Table: Demonstration of simple table syntax.

Method 4

@pandoc


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.

Method 5

@pandoc
Sample grid table.

+—————+—————+——————–+ | Fruit | Price | Advantages | +===============+===============+====================+ | Bananas | $1.34 | - built-in wrapper | | | | - bright color | +—————+—————+——————–+ | Oranges | $2.10 | - cures scurvy | | | | - tasty | +—————+—————+——————–+

Method 6

@ghpages

—————–+————+—————–+—————-
Default aligned Left aligned Center aligned Right aligned
First body part Second cell Third cell fourth cell
Second line foo strong blah
Third line blah blah bar
—————–+————+—————–+—————-
Second body
2 line
=================+============+=================+================
Footer row
—————–+————+—————–+—————-

See Syntax | kramdown

Footnotes

Reference Footnotes

This paragraph won’t be part of the note, because it isn’t indented.

Glossaries

A special kind of footnote [4]. @mmd

See more at Glossary—MultiMarkdown Documentation.

Citations

It can looks like footnotes in HTML output.

MultiMarkdown

@mmd

See more at Citations—MultiMarkdown Documentation.

Pandoc

@pandoc

Very powerful but complicated. See more at Citations—Pandoc Documentation.

Images

Reference Images

[ref]: image.png “optional title” {#id .class key=val key2=“val 2”}

Block Level Images

Block Level
Block Level

Not Block Level

RAW

HTML

See more at Raw—MultiMarkdown Documentation. See test in [Babelmark 2 - Compare markdown implementations](http://johnmacfarlane.net/babelmark2/?normalize=1&text=%3Cdiv%3EThis+should+not+be+markdown+(or+is+it%3F%29+%3C%2Fdiv%3E%0A%3Cdiv+markdown%3D1%3EThis+is+markdown%3C%2Fdiv%3E).

LaTeX

Other Syntaxes

Metadata

Note: mmd accepts capitalized metadata keys but others do not. For maximum compatibility, author(s), title, etc. should be in lower cases.

MultiMarkdown Metadata Block

@mmd @pandoc(+mmd_title_block)

title:    A Sample MultiMarkdown Document  
author:   Fletcher T. Penney  
date:     February 9, 2011  
comment:  This is a comment intended to demonstrate  
          metadata that spans multiple lines, yet  
          is treated as a single value.  
CSS:      http://example.com/standard.css

See more at Metadata—MultiMarkdown Documentation.

Pandoc Title Block

@pandoc

% title
% author(s) (separated by semicolons)
% date

YAML Metadata Block

@Mmd(partial)

@pandoc @ghpages

---
title:    A Sample MultiMarkdown Document  
author:   Fletcher T. Penney  
date:     February 9, 2011  
tags: [nothing, nothingness]
abstract: |
  This is the abstract.

  It consists of two paragraphs.
---

TOC

Pandoc

@pandoc

Use --toc as a command argument.

MultiMarkdown

@mmd

{{TOC}}, see beginning. It preprocess the headings and generate a ToC on its own, and doesn’t give instruction for LaTeX to generate one. A hack is like this:

---
...
LaTeX Input:    mmd-load-toc-setcounter
LaTeX Input:    mmd-load-toc
...
---
<!-- \begin{comment} -->
{{TOC}}
<!-- \end{comment} -->
...

See more at ickc/peg-multimarkdown-latex-support: Default support files for generating LaTeX documents with MMD 3 through MMD 5.

Kramdown

@ghpages

# Contents
{:.no_toc}

* Will be replaced with the ToC, excluding the "Contents" header
{:toc}

Math

MathJax is assumed. MathJax has many configurable options. See MathJax TeX and LaTeX Support — MathJax 2.6 documentation.

Markdown

@markdown

Add the following at the beginning of the document:

<script type="text/javascript"
    src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML-full">
    </script>

MathJax.js is used and any codes within math delimiters are treated as raw HTML and to be processed by MathJax.

MathJax delimiter are $$...$$, \\(...\\) and \\[...\\] (because an extra \ can be used to escape from MarkDown).

Depending on the markdown parser, extra tricks might be needed to make sure nothing within the math delimiter is treated as markdown (see TeX and LaTeX in HTML documents — MathJax 2.6 documentation). $...$ can be used with MathJax configuration (see TeX and LaTeX math delimiters — MathJax 2.6 documentation).

MultiMarkdown and Pandoc

There are subtleties how math should be used in HTML+MathJax and LaTeX output from single markdown source. See more in Testing LaTeX Environments Usage in MathJax From Markdown Conversion (including mmd and pandoc).

MultiMarkdown

@mmd

Add the following metadata at the beginning of the document:

HTML header:    <script type="text/javascript"
    src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML-full">
    </script>

MultiMarkdown math delimiter are $...$, $$...$$, \\(...\\) and \\[...\\].

Pandoc

@pandoc(–mathjax)

For pandoc, add --mathjax in the command-line argument.

Default math delimiter for pandoc is $...$, $$...$$. Other options are configurable. See more in Pandoc - Pandoc User’s Guide.

Inline Math

Block Math

Other Examples

File Transclusion

@mmd

See more at File Transclusion—MultiMarkdown Documentation.

References

Some examples are directly or indirectly copied from the following documentations:

  1. Pandoc - Pandoc User’s Guide
  2. MultiMarkdown User’s Guide
  3. Syntax | kramdown

  1. This is a mmd inline footnote  ↩

  2. This is a footnote  ↩

  3. Here’s one with multiple blocks.

    Subsequent paragraphs are indented to show that they belong to the previous footnote.

    { some.code }
    

    The whole paragraph can be indented, or just the first line. In this way, multi-paragraph footnotes work like multi-paragraph list items.  ↩

  4. term :

    The actual definition belongs on a new line, and can continue on just as other footnotes. Note how it fallbacks gracefully in Markdown.  ↩

  5. John Doe. Some Big Fancy Book. Vanity Press, 2006.

  6. John Doe. Another Big Fancy Book. Vanity Press, 2016.