-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME-md.html
503 lines (502 loc) · 23.3 KB
/
README-md.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">code{white-space: pre;}</style>
</head>
<body>
<hr />
<p>HTML Header Level: 1 LaTeX Header Level: 2 LaTeX Input: mmd-article-header LaTeX input: mmd-natbib-plain LaTeX Input: mmd-load-physics-related LaTeX Input: mmd-load-tables-related LaTeX Input: mmd-load-pdfpages LaTeX Input: mmd-load-headings thmd: chapter LaTeX Input: mmd-load-amsthm title: Yet Another Markdown Cheatsheet subtitle: Including MarkDown, MultiMarkdown, pandoc, GFM and LaTeX Math Syntax by MathJax<br />
Keywords: MarkDown, MultiMarkDown, LaTeX, pandoc, gfm<br />
Revision: 0.10 Language: English author: Kolen Cheung Email: [email protected] Affiliation: University of California, Berkeley LaTeX Mode: memoir LaTeX Input: mmd-article-begin-doc tocd: 5 secd: 5 LaTeX Input: mmd-load-toc-setcounter LaTeX Input: mmd-load-toc LaTeX Footer: mmd-memoir-footer ---</p>
<!-- \begin{comment} -->
<script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML-full"></script>
<p><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.1.0/styles/default.min.css"><script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.1.0/highlight.min.js"></script><script>hljs.initHighlightingOnLoad();</script></p>
<h1>Contents</h1>
<p>{:.no_toc}</p>
<ul>
<li>Will be replaced with the ToC, excluding the "Contents" header {:toc}</li>
</ul>
<p>{{TOC}}</p>
<!-- \end{comment} -->
<h1>Introduction</h1>
<p>[Examples][] shows explicit examples for different syntaxes. [Other Syntaxes][] show the syntaxes that can't be shown explicitly.</p>
<h2>Organization</h2>
<ul>
<li>Header levels (except possibly the last header level): features in groups</li>
<li>Last header level or a list: different syntaxes</li>
<li>TaskPaper-styled tags to indicate in what favor of Markdown such syntax is supported
<ul>
<li><code>@markdown</code>: supported by original markdown, hence understood to be supported by all variants of markdown</li>
<li><code>@ghpages</code>: GitHub-Favored Markdown, built by kramdown with GFM option. i.e. GitHub Pages' GitHub-Favored Markdown (not exhaustively tested here. See <a href="http://kramdown.gettalong.org/syntax.html#tables">kramdown's documentation</a> for other possible syntaxes)</li>
<li><code>@mmd</code>: MultiMarkdown </li>
<li><code>@pandoc</code>: pandoc-favored markdown</li>
<li><code>@phpextra</code>: PHP Markdown Extra (inspired some syntax in pandoc and mmd and gfm, not exhaustively tested here)</li>
</ul></li>
<li>TaskPaper Tags
<ul>
<li><code>@...(partial)</code>: partial supports only</li>
<li><code>@...(+...)</code>: when the extension is used</li>
<li><code>@pandoc(--...)</code>: when the command line argument is used</li>
<li><code>@pandoc(parsed)</code>: not verbatim, but parsed</li>
</ul></li>
</ul>
<p>Note:</p>
<ul>
<li>You might see <code><!-- \begin{comment} -->...<!-- \end{comment} --></code>. This is for mmd to tex to pdf use only. Ignore this.</li>
</ul>
<h1>Examples</h1>
<h2>Header</h2>
<p>@markdown</p>
<p>See [Emphasis][] and [Other Syntaxes][] to see alternative Setext-style header styles @markdown</p>
<h3>Header <em>Containing</em> <strong><em>Styling</em></strong> and a <a href="Https://www.wikipedia.org/">Link</a></h3>
<p>@markdown</p>
<h3>Header Containing Attributes {#identifier .class1 key=value1}</h3>
<p>@pandoc @phpextra</p>
<h3>Header Unnumbered {-}</h3>
<p>@pandoc</p>
<h3>Header Unnumbered 2 {.Unnumbered}</h3>
<p>@pandoc</p>
<h3>Auto Cross Reference</h3>
<ul>
<li><a href="#header">Link to Header</a> @pandoc @ghpages @mmd</li>
<li>[Link to Header][Header] @pandoc @mmd</li>
<li>[Header][] @mmd @pandoc</li>
<li>[Header] @mmd @pandoc</li>
</ul>
<h3>User defined reference [userdefinedreference]</h3>
<ul>
<li>[userdefinedreference][] @mmd</li>
<li><a href="#userdefinedreference">Link to userdefinedreference</a> @mmd @pandoc(+mmd<em>header</em>identifiers)</li>
<li><a href="#identifier">Link to "Header Containing Attributes"</a> @pandoc</li>
<li><a href="#identifier">another-link</a> @pandoc</li>
</ul>
<h3>Deeper Levels of Headers</h3>
<h4>Header4</h4>
<h5>Header5</h5>
<h6>Header6</h6>
<h2>Backslash Escapes</h2>
<p>*testing* @markdown</p>
<h2>Emphasis</h2>
<ul>
<li><em>italic</em> or <em>italic</em> @markdown</li>
<li><strong>bold</strong> or <strong>bold</strong> @markdown</li>
<li><strong><em>bold italic</em></strong> or <strong><em>bold italic</em></strong> @markdown</li>
<li>~~strikethrough~~ @pandoc</li>
<li><span style="font-variant:small-caps;">Small caps</span> @pandoc @markdown(html)</li>
</ul>
<h3>CriticMarkup</h3>
<p>@mmd</p>
<p>Visually it looks like emphasis. Functionally it is much more, and called Critic Markup</p>
<ul>
<li>Deletions from the original text: This is {--is --}a test.</li>
<li>Additions: This {++is ++}a test.</li>
<li>Substitutions: This {~~isn't~>is~~} a test.</li>
<li>Highlighting: This is a {==test==}.</li>
<li>Comments: This is a test{>>What is it a test of?<<}.</li>
</ul>
<p>See more at <a href="http://fletcher.github.io/MultiMarkdown-5/criticmarkup.html">CriticMarkup---MultiMarkdown Documentation</a>.</p>
<h2>Horizontal Rules</h2>
<p>@markdown</p>
<hr />
<p>3 or more hyphens or asterisks</p>
<hr />
<h2>Break</h2>
<p>@markdown</p>
<p>No break like this</p>
<p>Soft break<br />
like this</p>
<p>Hard break</p>
<p>like this</p>
<h2>Superscript & Subscript</h2>
<ul>
<li>x^2 @mmd</li>
<li>d~o @mmd</li>
<li>x^a+b^ @mmd @pandoc</li>
<li>x~y,z~ @mmd @pandoc</li>
<li>P~a\ cat~ @pandoc</li>
</ul>
<h2>Smarty Pants</h2>
<p>@markdown(+smartypants) @pandoc(--smart) @ghpages</p>
<ul>
<li>"Example 1"</li>
<li>'Example 2'</li>
<li>en--dash</li>
<li>em---dash</li>
<li>ellipsis...</li>
</ul>
<p>@mmd</p>
<ul>
<li>``Example 3''</li>
</ul>
<h2>Abbreviations (PHP Markdown Extra)</h2>
<p>@mmd @phpextra @pandoc(+abbreviations)</p>
<p><em>[HTML]: HyperText Markup Language </em>[W3C]: World Wide Web Consortium *[PANDOC]: Pandoc will simply ignore this if the extension is used. A graceful fallback.</p>
<p>Testing abbreviations: HTML, W3C (mouseover it to see)</p>
<h2>Lists</h2>
<h3>Compact vs Loose Lists</h3>
<p>The following effects are the same for different kind of lists @markdown</p>
<h4>Compact</h4>
<ul>
<li>test 1</li>
<li>test 2</li>
<li>test 3</li>
</ul>
<h4>Loose</h4>
<ul>
<li><p>test 1</p></li>
<li><p>test 2</p></li>
<li><p>test 3</p></li>
</ul>
<h3>Ordered Lists</h3>
<p>@markdown</p>
<ol>
<li>test</li>
<li>test</li>
<li>test</li>
</ol>
<h3>Unordered Lists</h3>
<p>@markdown</p>
<ul>
<li>test</li>
<li>test</li>
<li>test</li>
</ul>
<h3>Nested Lists</h3>
<p>@markdown</p>
<ul>
<li>test
<ul>
<li>test</li>
</ul></li>
<li>test
<ol>
<li>test</li>
<li>test
<ul>
<li>test
<ol>
<li>test</li>
<li>test</li>
</ol></li>
</ul></li>
<li>test</li>
</ol></li>
<li>test</li>
</ul>
<p>Note about LaTeX output in mmd/pandoc:</p>
<ul>
<li>The Maximum nesting level of lists in LaTeX is 4. The quick hack is to mix itemize and enumerate alternatively to go beyond this.</li>
</ul>
<h3>Cutoff a List</h3>
<p>@markdown</p>
<ol>
<li>one</li>
<li>two</li>
<li>three</li>
</ol>
<!-- -->
<ol>
<li>uno</li>
<li>dos</li>
<li>tres</li>
</ol>
<!-- -->
<ul>
<li>item one</li>
<li>item two</li>
</ul>
<!-- end of list -->
<pre><code>{ my code block }</code></pre>
<h3>List Item in a Block</h3>
<p>@markdown</p>
<ul>
<li><p>First paragraph.</p>
<p>Continued.</p></li>
<li><p>Second paragraph. With a code block, which must be indented eight spaces:</p>
<pre><code>{ code }</code></pre></li>
</ul>
<h3>Fancy Lists</h3>
<p>@pandoc</p>
<h1>. one</h1>
<h1>. two</h1>
<p>9) Ninth 10) Tenth 11) Eleventh i. <code>i</code> ii. <code>ii</code> iii. <code>iii</code> (2) Two (5) Three 1. Four * Five</p>
<h2>Definition Lists</h2>
<h3>Method 1</h3>
<p>@mmd @phpextra @pandoc @ghpages</p>
<p>Physics : The Fundamental of Science : Describe the Nature : Make Prediction</p>
<h3>Method 2</h3>
<p>@ghpages @pandoc @mmd</p>
<p>Term 1</p>
<p>: Definition 1</p>
<p>Term 2 with <em>inline markup</em></p>
<p>: Definition 2</p>
<pre><code> { some code, part of Definition 2 }
Third paragraph of definition 2.</code></pre>
<h2>Numbered Example Lists</h2>
<p>@pandoc</p>
<p>(@) My first example will be numbered (1). (@) My second example will be numbered (2).</p>
<p>Explanation of examples.</p>
<p>(@) My third example will be numbered (3).</p>
<p>(@good) This is a good example.</p>
<p>As (@good) illustrates, ...</p>
<h2>Code</h2>
<ul>
<li><code>testing</code> @markdown</li>
<li><code>\[\ket{a}\]</code>{.latex} @pandoc</li>
</ul>
<h3>Fenced Code Blocks</h3>
<h4>Method 1</h4>
<p>@markdown</p>
<pre><code>test
test
test
# test</code></pre>
<h4>Method 2</h4>
<p>@markdown(partial:language-not-supported) @ghpages @pandoc @mmd</p>
<p><code>tex \nabla \times \mathbf{E} = - \frac{\partial \mathbf{B}}{\partial t}</code></p>
<h4>Method 3</h4>
<p>@pandoc</p>
<p>~~~markdown test test test # test ~~~</p>
<p>~~~ {#mycode .markdown .numberLines startFrom="100"} test test test # test ~~~</p>
<h2>Block-quotes</h2>
<p>@markdown</p>
<blockquote>
<h4>Test</h4>
<p>test</p>
<blockquote>
<p>test</p>
</blockquote>
</blockquote>
<blockquote>
<blockquote>
<p>test</p>
</blockquote>
<ul>
<li>test</li>
</ul>
</blockquote>
<blockquote>
<ul>
<li>test</li>
</ul>
</blockquote>
<h3>Block-quotes Quoting Codes</h3>
<p>@markdown</p>
<blockquote>
<pre><code>\newcommand...</code></pre>
</blockquote>
<h2>Line Blocks</h2>
<p>@ghpages(partial) @pandoc</p>
<p>| 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</p>
<p>| 200 Main St. | Berkeley, CA 94718</p>
<h2>Tables</h2>
<h3>Method 1</h3>
<p>@ghpages @pandoc @mmd</p>
<p>| Right | Left | Default | Center | |------:|:-----|---------|:------:| | 12 | 12 | 12 | 12 | | 123 | 123 | 123 | 123 | | 1 | 1 | 1 | 1 |</p>
<p>: Notice how pandoc can have optional caption like this</p>
<h3>Method 2</h3>
<p>@mmd</p>
<p>[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 |<br />
| And a big grouping is like this |||</p>
<h3>Method 3</h3>
<p>@pandoc</p>
<p>Right Left Center Default ------- ------ ---------- ------- 12 12 12 12 123 123 123 123 1 1 1 1</p>
<p>Table: Demonstration of simple table syntax.</p>
<h3>Method 4</h3>
<p>@pandoc</p>
<hr />
<p>Centered Default Right Left Header Aligned Aligned Aligned ----------- ------- --------------- ------------------------- First row 12.0 Example of a row that spans multiple lines.</p>
<p>Second row 5.0 Here's another one. Note the blank line between rows. -------------------------------------------------------------</p>
<p>Table: Here's the caption. It, too, may span multiple lines.</p>
<h3>Method 5</h3>
<p>@pandoc</p>
<p>: Sample grid table.</p>
<p>+---------------+---------------+--------------------+ | Fruit | Price | Advantages | +===============+===============+====================+ | Bananas | $1.34 | - built-in wrapper | | | | - bright color | +---------------+---------------+--------------------+ | Oranges | $2.10 | - cures scurvy | | | | - tasty | +---------------+---------------+--------------------+</p>
<h3>Method 6</h3>
<p>@ghpages</p>
<!-- \begin{comment} -->
<p>|-----------------+------------+-----------------+----------------| | Default aligned |Left aligned| Center aligned | Right aligned | |-----------------|:-----------|:---------------:|---------------:| | First body part |Second cell | Third cell | fourth cell | | Second line |foo | <strong>strong</strong> | blah | | Third line |blah | blah | bar | |-----------------+------------+-----------------+----------------| | Second body | | | | | 2 line | | | | |=================+============+=================+================| | Footer row | | | | |-----------------+------------+-----------------+----------------|</p>
<!-- \end{comment} -->
<p>See <a href="http://kramdown.gettalong.org/syntax.html#tables">Syntax | kramdown</a></p>
<h2>Links</h2>
<ul>
<li>https://www.wikipedia.org @pandoc(+autolink<em>bare</em>uris)</li>
<li><a href="https://www.wikipedia.org" class="uri">https://www.wikipedia.org</a> @markdown</li>
<li><a href="https://www.wikipedia.org">Wikipedia.org</a> @markdown</li>
<li><a href="https://www.wikipedia.org" title="a title">Wikipedia.org</a> @markdown</li>
<li><script type="text/javascript">
<!--
h='github.com';a='@';n='support';e=n+a+h;
document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'" clas'+'s="em' + 'ail">'+'Mail to GitHub'+'<\/'+'a'+'>');
// -->
</script><noscript>Mail to GitHub (support at github dot com)</noscript> @markdown</li>
</ul>
<h3>Reference Links</h3>
<ul>
<li><a href="https://www.google.com">Search here</a> @markdown</li>
<li>A [link][] with attributes. @mmd</li>
<li>[Another link to the link above][link]. @mmd</li>
<li>A <a href="/foo/bar.html" title="My title, optional">link1</a> with attributes. @markdown</li>
<li><a href="http://fsf.org" title="The free software foundation">Another link</a>. @markdown</li>
<li><a href="/bar#special" title="A title in single quotes">link3</a>. @markdown</li>
</ul>
<p>[link]: image.png "Title" class=external style="border: solid black 1px;"</p>
<h2>Footnotes</h2>
<ul>
<li>Footnotes [^This is a mmd inline footnote] @mmd</li>
<li>Footnotes ^[This is a pandoc inline footnote] @pandoc</li>
</ul>
<h3>Reference Footnotes</h3>
<ul>
<li>Footnotes[^whatever] @markdown</li>
<li>Long Footnotes [^longnote] @pandoc @ghpages @mmd</li>
</ul>
<p>This paragraph won't be part of the note, because it isn't indented.</p>
<h3>Glossaries</h3>
<p>A special kind of footnote [^glossaryfootnote]. @mmd</p>
<p>See more at <a href="http://fletcher.github.io/MultiMarkdown-5/glossary.html">Glossary---MultiMarkdown Documentation</a>.</p>
<h3>Citations</h3>
<p>It can looks like footnotes in HTML output.</p>
<h4>MultiMarkdown</h4>
<p>@mmd</p>
<ul>
<li>This is a statement that should be attributed to its source <a href="John%20Doe.%20*Some%20Big%20Fancy%20Book*.%20Vanity%20Press,%202006.">p. 23</a>.</li>
</ul>
<p><a href="John%20Doe.%20*Another%20Big%20Fancy%20Book*.%20Vanity%20Press,%202016.">Not cited</a></p>
<p>See more at <a href="http://fletcher.github.io/MultiMarkdown-5/citations.html">Citations---MultiMarkdown Documentation</a>.</p>
<h4>Pandoc</h4>
<p>@pandoc</p>
<p>Very powerful but complicated. See more at <a href="http://pandoc.org/README.html#citations">Citations---Pandoc Documentation</a>.</p>
<h2>Images</h2>
<ul>
<li><img src="image.png" title="Optional Title" alt="Alt Text" /> @markdown</li>
</ul>
<h3>Reference Images</h3>
<ul>
<li><img src="image.png" title="Optional Title" alt="Alt Text" /> @markdown</li>
<li>[An Image with Attributes][wikipedia] @mmd @pandoc(+mmd<em>link</em>attributes)</li>
<li><img src="image.png" alt="An Image with Attributes" />{#id .class width=30 height=20px} @pandoc @phpextra(partial)</li>
<li>a reference [image][ref] with attributes. @pandoc @phpextra(partial)</li>
</ul>
<p>[wikipedia]: image.png "Title of the Image" width=40px height=40px</p>
<p>[ref]: image.png "optional title" {#id .class key=val key2="val 2"}</p>
<h3>Image with Links by Nesting Image and Link</h3>
<ul>
<li><a href="https://www.wikipedia.org/"><img src="image.png" alt="Image Link" /></a> @markdown</li>
</ul>
<h3>Block Level Images</h3>
<ul>
<li>Block level: HTML <code>figure</code> element in MultiMarkdown @mmd @pandoc</li>
</ul>
<p><img src="image.png" title="Optional Title" alt="Block Level" /></p>
<p><img src="image.png" title="Optional Title" alt="Not Block Level" />\</p>
<h2>RAW</h2>
<h3>HTML</h3>
<ul>
<li><div>This should *not* be markdown (or is it?) </div>
@markdown</li>
<li><div markdown=1>This *is* markdown</div>
@mmd @pandoc(+markdown_attribute)</li>
</ul>
<p>See more at <a href="http://fletcher.github.io/MultiMarkdown-5/raw.html">Raw---MultiMarkdown Documentation</a>. See test in [Babelmark 2 - Compare markdown implementations](http://johnmacfarlane.net/babelmark2/?normalize=1&text=%3Cdiv%3EThis+should+<em>not</em>+be+markdown+(or+is+it%3F%29+%3C%2Fdiv%3E%0A%3Cdiv+markdown%3D1%3EThis+<em>is</em>+markdown%3C%2Fdiv%3E).</p>
<h3>LaTeX</h3>
<ul>
<li><!-- \newcommand\rawlatex{} -->
@mmd</li>
<li>\newcommand\rawlatex{} @pandoc(parsed)</li>
<li>\begin{...} @pandoc</li>
</ul>
<h1>Other Syntaxes</h1>
<h2>Metadata</h2>
<p>Note: mmd accepts capitalized metadata keys but others do not. For maximum compatibility, <code>author(s)</code>, <code>title</code>, etc. should be in lower cases.</p>
<h3>MultiMarkdown Metadata Block</h3>
<p>@mmd @pandoc(+mmd<em>title</em>block)</p>
<p><code>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</code></p>
<p>See more at <a href="http://fletcher.github.io/MultiMarkdown-5/metadata.html">Metadata---MultiMarkdown Documentation</a>.</p>
<h3>Pandoc Title Block</h3>
<p>@pandoc</p>
<p><code>% title % author(s) (separated by semicolons) % date</code></p>
<h3>YAML Metadata Block</h3>
<p>@Mmd(partial)</p>
<p>@pandoc @ghpages</p>
<h2>```</h2>
<p>title: A Sample MultiMarkdown Document<br />
author: Fletcher T. Penney<br />
date: February 9, 2011<br />
tags: [nothing, nothingness] abstract: | This is the abstract.</p>
<h2>It consists of two paragraphs.</h2>
<p>```</p>
<h2>TOC</h2>
<h3>Pandoc</h3>
<p>@pandoc</p>
<p>Use <code>--toc</code> as a command argument.</p>
<h3>MultiMarkdown</h3>
<p>@mmd</p>
<p><code>{{TOC}}</code>, 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:</p>
<p><code>--- ... LaTeX Input: mmd-load-toc-setcounter LaTeX Input: mmd-load-toc ... --- <!-- \begin{comment} --> {{TOC}} <!-- \end{comment} --> ...</code></p>
<p>See more at <a href="https://github.com/ickc/peg-multimarkdown-latex-support">ickc/peg-multimarkdown-latex-support: Default support files for generating LaTeX documents with MMD 3 through MMD 5</a>.</p>
<h3>Kramdown</h3>
<p>@ghpages</p>
<p>```</p>
<h1>Contents</h1>
<p>{:.no_toc}</p>
<ul>
<li>Will be replaced with the ToC, excluding the "Contents" header {:toc} ```</li>
</ul>
<h2>Math</h2>
<p>MathJax is assumed. MathJax has many configurable options. See <a href="http://mathjax.readthedocs.org/en/latest/tex.html">MathJax TeX and LaTeX Support — MathJax 2.6 documentation</a>.</p>
<h3>Markdown</h3>
<p>@markdown</p>
<p>Add the following at the beginning of the document:</p>
<p><code>html <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML-full"> </script></code></p>
<p>MathJax.js is used and any codes within math delimiters are treated as raw HTML and to be processed by MathJax.</p>
<p>MathJax delimiter are <code>$$...$$</code>, <code>\\(...\\)</code> and <code>\\[...\\]</code> (because an extra <code>\</code> can be used to escape from MarkDown).</p>
<p>Depending on the markdown parser, extra tricks might be needed to make sure nothing within the math delimiter is treated as markdown (see <a href="http://mathjax.readthedocs.org/en/latest/tex.html#tex-and-latex-in-html-documents">TeX and LaTeX in HTML documents — MathJax 2.6 documentation</a>). <code>$...$</code> can be used with MathJax configuration (see <a href="http://mathjax.readthedocs.org/en/latest/tex.html#tex-and-latex-math-delimiters">TeX and LaTeX math delimiters — MathJax 2.6 documentation</a>).</p>
<h3>MultiMarkdown and Pandoc</h3>
<p>There are subtleties how math should be used in HTML+MathJax and LaTeX output from single markdown source. See more in <a href="https://github.com/ickc/mathjax-latex-md-mmd-pandoc">Testing LaTeX Environments Usage in MathJax From Markdown Conversion (including mmd and pandoc)</a>.</p>
<h4>MultiMarkdown</h4>
<p>@mmd</p>
<p>Add the following metadata at the beginning of the document:</p>
<p><code>html HTML header: <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML-full"> </script></code></p>
<p>MultiMarkdown math delimiter are <code>$...$</code>, <code>$$...$$</code>, <code>\\(...\\)</code> and <code>\\[...\\]</code>.</p>
<h4>Pandoc</h4>
<p>@pandoc(--mathjax)</p>
<p>For pandoc, add <code>--mathjax</code> in the command-line argument.</p>
<p>Default math delimiter for pandoc is <code>$...$</code>, <code>$$...$$</code>. Other options are configurable. See more in <a href="http://pandoc.org/README.html#non-pandoc-extensions">Pandoc - Pandoc User’s Guide</a>.</p>
<h3>Inline Math</h3>
<ul>
<li>$1+1$</li>
<li>\(1 + 1\) @pandoc(+tex<em>math</em>double_backslash)</li>
</ul>
<h3>Block Math</h3>
<ul>
<li>$$R R^T = I$$</li>
<li>\[A^T_S = B\]</li>
</ul>
<h3>Other Examples</h3>
<ul>
<li>$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}$$</li>
<li>$$ \begin{aligned} \dot{x} & = \sigma(y-x) \\ \dot{y} & = \rho x - y - xz \\ \dot{z} & = -\beta z + xy \end{aligned} $$</li>
<li>$$\left( \sum<em>{k=1}^n a</em>k b<em>k \right)^2 \leq \left( \sum</em>{k=1}^n a<em>k^2 \right) \left( \sum</em>{k=1}^n b_k^2 \right)$$</li>
<li>$$\mathbf{V}<em>1 \times \mathbf{V}</em>2 = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ \frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\ \frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0 \end{vmatrix}$$</li>
<li>$$P(E) = {n \choose k} p^k (1-p)^{n-k}$$</li>
<li>$$\frac{1}{\Bigl(\sqrt{\phi \sqrt{5}}-\phi\Bigr) e^{\frac25 \pi}} = 1+\frac{e^{-2\pi}} {1+\frac{e^{-4\pi}} {1+\frac{e^{-6\pi}} {1+\frac{e^{-8\pi}} {1+\ldots} } } }$$</li>
<li>$$ \begin{aligned} \nabla \times \vec{\mathbf{B}} -\, \frac1c\, \frac{\partial\vec{\mathbf{E}}}{\partial t} & = \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} & = 4 \pi \rho \\ \nabla \times \vec{\mathbf{E}}\, +\, \frac1c\, \frac{\partial\vec{\mathbf{B}}}{\partial t} & = \vec{\mathbf{0}} \\ \nabla \cdot \vec{\mathbf{B}} & = 0 \end{aligned} $$</li>
<li>$$1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots = \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \quad\quad \text{for $|q|<1$}.$$</li>
</ul>
<h2>File Transclusion</h2>
<p>@mmd</p>
<p>See more at <a href="http://fletcher.github.io/MultiMarkdown-5/transclusion.html">File Transclusion---MultiMarkdown Documentation</a>.</p>
<h1>References</h1>
<p>Some examples are directly or indirectly copied from the following documentations:</p>
<ol>
<li><a href="http://pandoc.org/README.html">Pandoc - Pandoc User’s Guide</a></li>
<li><a href="http://fletcher.github.io/MultiMarkdown-5/">MultiMarkdown User's Guide</a></li>
<li><a href="http://kramdown.gettalong.org/syntax.html#tables">Syntax | kramdown</a></li>
</ol>
</body>
</html>