git.iko.soy/typeable/pandoc
on rc/2.11.0.3 help sign in
typeable/pandoc/test/writer.context
909 lines 16 kB history raw
1% Enable hyperlinks
2\setupinteraction
3 [state=start,
4 title={Pandoc Test Suite},
5 author={John MacFarlane; Anonymous},
6 style=,
7 color=,
8 contrastcolor=]
10% make chapter, section bookmarks visible when opening document
11\placebookmarks[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][chapter, section]
12\setupinteractionscreen[option=bookmark]
14\setuppagenumbering[location={footer,middle}]
15\setupbackend[export=yes]
16\setupstructure[state=start,method=auto]
18% use microtypography
19\definefontfeature[default][default][script=latn, protrusion=quality, expansion=quality, itlc=yes, textitalics=yes, onum=yes, pnum=yes]
20\definefontfeature[smallcaps][script=latn, protrusion=quality, expansion=quality, smcp=yes, onum=yes, pnum=yes]
21\setupalign[hz,hanging]
22\setupitaliccorrection[global, always]
24\setupbodyfontenvironment[default][em=italic] % use italic as em, not slanted
26\definefallbackfamily[mainface][rm][CMU Serif][preset=range:greek, force=yes]
27\definefontfamily[mainface][rm][Latin Modern Roman]
28\definefontfamily[mainface][mm][Latin Modern Math]
29\definefontfamily[mainface][ss][Latin Modern Sans]
30\definefontfamily[mainface][tt][Latin Modern Typewriter][features=none]
31\setupbodyfont[mainface]
33\setupwhitespace[medium]
35\setuphead[chapter] [style=\tfd\setupinterlinespace,header=empty]
36\setuphead[section] [style=\tfc\setupinterlinespace]
37\setuphead[subsection] [style=\tfb\setupinterlinespace]
38\setuphead[subsubsection] [style=\bf]
39\setuphead[subsubsubsection] [style=\sc]
40\setuphead[subsubsubsubsection][style=\it]
42\setuphead[chapter, section, subsection, subsubsection, subsubsubsection, subsubsubsubsection][number=no]
44\definedescription
45 [description]
46 [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm, alternative=hanging]
48\setupitemize[autointro] % prevent orphan list intro
49\setupitemize[indentnext=no]
51\setupfloat[figure][default={here,nonumber}]
52\setupfloat[table][default={here,nonumber}]
54\setupthinrules[width=15em] % width of horizontal rules
56\setupxtable[frame=off]
57\setupxtable[head][topframe=on,bottomframe=on]
58\setupxtable[body][]
59\setupxtable[foot][bottomframe=on]
62\starttext
63\startalignment[middle]
64 {\tfd\setupinterlinespace Pandoc Test Suite}
65 \smallskip
66 {\tfa\setupinterlinespace John MacFarlane\crlf Anonymous}
67 \smallskip
68 {\tfa\setupinterlinespace July 17, 2006}
69 \bigskip
70\stopalignment
72This is a set of tests for pandoc. Most of them are adapted from John Gruber's
73markdown test suite.
75\thinrule
77\section[title={Headers},reference={headers}]
79\subsection[title={Level 2 with an \useURL[url1][/url][][embedded
80link]\from[url1]},reference={level-2-with-an-embedded-link}]
82\subsubsection[title={Level 3 with
83{\em emphasis}},reference={level-3-with-emphasis}]
85\subsubsubsection[title={Level 4},reference={level-4}]
87\subsubsubsubsection[title={Level 5},reference={level-5}]
89\section[title={Level 1},reference={level-1}]
91\subsection[title={Level 2 with
92{\em emphasis}},reference={level-2-with-emphasis}]
94\subsubsection[title={Level 3},reference={level-3}]
96with no blank line
98\subsection[title={Level 2},reference={level-2}]
100with no blank line
102\thinrule
104\section[title={Paragraphs},reference={paragraphs}]
106Here's a regular paragraph.
108In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
109Because a hard-wrapped line in the middle of a paragraph looked like a list
110item.
112Here's one with a bullet. * criminey.
114There should be a hard line break\crlf
115here.
117\thinrule
119\section[title={Block Quotes},reference={block-quotes}]
121E-mail style:
123\startblockquote
124This is a block quote. It is pretty short.
125\stopblockquote
127\startblockquote
128Code in a block quote:
130\starttyping
131sub status {
132 print "working";
134\stoptyping
136A list:
138\startitemize[n,packed][stopper=.]
139\item
140 item one
141\item
142 item two
143\stopitemize
145Nested block quotes:
147\startblockquote
148nested
149\stopblockquote
151\startblockquote
152nested
153\stopblockquote
154\stopblockquote
156This should not be a block quote: 2 > 1.
158And a following paragraph.
160\thinrule
162\section[title={Code Blocks},reference={code-blocks}]
164Code:
166\starttyping
167---- (should be four hyphens)
169sub status {
170 print "working";
173this code block is indented by one tab
174\stoptyping
176And:
178\starttyping
179 this code block is indented by two tabs
181These should not be escaped: \$ \\ \> \[ \{
182\stoptyping
184\thinrule
186\section[title={Lists},reference={lists}]
188\subsection[title={Unordered},reference={unordered}]
190Asterisks tight:
192\startitemize[packed]
193\item
194 asterisk 1
195\item
196 asterisk 2
197\item
198 asterisk 3
199\stopitemize
201Asterisks loose:
203\startitemize
204\item
205 asterisk 1
206\item
207 asterisk 2
208\item
209 asterisk 3
210\stopitemize
212Pluses tight:
214\startitemize[packed]
215\item
216 Plus 1
217\item
218 Plus 2
219\item
220 Plus 3
221\stopitemize
223Pluses loose:
225\startitemize
226\item
227 Plus 1
228\item
229 Plus 2
230\item
231 Plus 3
232\stopitemize
234Minuses tight:
236\startitemize[packed]
237\item
238 Minus 1
239\item
240 Minus 2
241\item
242 Minus 3
243\stopitemize
245Minuses loose:
247\startitemize
248\item
249 Minus 1
250\item
251 Minus 2
252\item
253 Minus 3
254\stopitemize
256\subsection[title={Ordered},reference={ordered}]
258Tight:
260\startitemize[n,packed][stopper=.]
261\item
262 First
263\item
264 Second
265\item
266 Third
267\stopitemize
269and:
271\startitemize[n,packed][stopper=.]
272\item
273 One
274\item
275 Two
276\item
277 Three
278\stopitemize
280Loose using tabs:
282\startitemize[n][stopper=.]
283\item
284 First
285\item
286 Second
287\item
288 Third
289\stopitemize
291and using spaces:
293\startitemize[n][stopper=.]
294\item
295 One
296\item
297 Two
298\item
299 Three
300\stopitemize
302Multiple paragraphs:
304\startitemize[n][stopper=.]
305\item
306 Item 1, graf one.
308 Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
309\item
310 Item 2.
311\item
312 Item 3.
313\stopitemize
315\subsection[title={Nested},reference={nested}]
317\startitemize[packed]
318\item
319 Tab
320 \startitemize[packed]
321 \item
322 Tab
323 \startitemize[packed]
324 \item
325 Tab
326 \stopitemize
327 \stopitemize
328\stopitemize
330Here's another:
332\startitemize[n,packed][stopper=.]
333\item
334 First
335\item
336 Second:
337 \startitemize[packed]
338 \item
339 Fee
340 \item
341 Fie
342 \item
343 Foe
344 \stopitemize
345\item
346 Third
347\stopitemize
349Same thing but with paragraphs:
351\startitemize[n][stopper=.]
352\item
353 First
354\item
355 Second:
357 \startitemize[packed]
358 \item
359 Fee
360 \item
361 Fie
362 \item
363 Foe
364 \stopitemize
365\item
366 Third
367\stopitemize
369\subsection[title={Tabs and spaces},reference={tabs-and-spaces}]
371\startitemize
372\item
373 this is a list item indented with tabs
374\item
375 this is a list item indented with spaces
377 \startitemize
378 \item
379 this is an example list item indented with tabs
380 \item
381 this is an example list item indented with spaces
382 \stopitemize
383\stopitemize
385\subsection[title={Fancy list markers},reference={fancy-list-markers}]
387\startitemize[n][start=2,left=(,stopper=),width=2.0em]
388\item
389 begins with 2
390\item
391 and now 3
393 with a continuation
395 \startitemize[r,packed][start=4,stopper=.,width=2.0em]
396 \item
397 sublist with roman numerals, starting with 4
398 \item
399 more items
400 \startitemize[A,packed][left=(,stopper=),width=2.0em]
401 \item
402 a subsublist
403 \item
404 a subsublist
405 \stopitemize
406 \stopitemize
407\stopitemize
409Nesting:
411\startitemize[A,packed][stopper=.]
412\item
413 Upper Alpha
414 \startitemize[R,packed][stopper=.]
415 \item
416 Upper Roman.
417 \startitemize[n,packed][start=6,left=(,stopper=),width=2.0em]
418 \item
419 Decimal start with 6
420 \startitemize[a,packed][start=3,stopper=)]
421 \item
422 Lower alpha with paren
423 \stopitemize
424 \stopitemize
425 \stopitemize
426\stopitemize
428Autonumbering:
430\startitemize[n,packed]
431\item
432 Autonumber.
433\item
434 More.
435 \startitemize[a,packed]
436 \item
437 Nested.
438 \stopitemize
439\stopitemize
441Should not be a list item:
443M.A.~2007
445B. Williams
447\thinrule
449\section[title={Definition Lists},reference={definition-lists}]
451Tight using spaces:
453\startdescription{apple}
454 red fruit
455\stopdescription
457\startdescription{orange}
458 orange fruit
459\stopdescription
461\startdescription{banana}
462 yellow fruit
463\stopdescription
465Tight using tabs:
467\startdescription{apple}
468 red fruit
469\stopdescription
471\startdescription{orange}
472 orange fruit
473\stopdescription
475\startdescription{banana}
476 yellow fruit
477\stopdescription
479Loose:
481\startdescription{apple}
482 red fruit
483\stopdescription
485\startdescription{orange}
486 orange fruit
487\stopdescription
489\startdescription{banana}
490 yellow fruit
491\stopdescription
493Multiple blocks with italics:
495\startdescription{{\em apple}}
496 red fruit
498 contains seeds, crisp, pleasant to taste
499\stopdescription
501\startdescription{{\em orange}}
502 orange fruit
504\starttyping
505{ orange code block }
506\stoptyping
508 \startblockquote
509 orange block quote
510 \stopblockquote
511\stopdescription
513Multiple definitions, tight:
515\startdescription{apple}
516 red fruit
518 computer
519\stopdescription
521\startdescription{orange}
522 orange fruit
524 bank
525\stopdescription
527Multiple definitions, loose:
529\startdescription{apple}
530 red fruit
532 computer
533\stopdescription
535\startdescription{orange}
536 orange fruit
538 bank
539\stopdescription
541Blank line after term, indented marker, alternate markers:
543\startdescription{apple}
544 red fruit
546 computer
547\stopdescription
549\startdescription{orange}
550 orange fruit
552 \startitemize[n,packed][stopper=.]
553 \item
554 sublist
555 \item
556 sublist
557 \stopitemize
558\stopdescription
560\section[title={HTML Blocks},reference={html-blocks}]
562Simple block on one line:
564foo
566And nested without indentation:
568foo
570bar
572Interpreted markdown in a table:
574This is {\em emphasized}
575And this is {\bf strong}
576Here's a simple block:
578foo
580This should be a code block, though:
582\starttyping
583<div>
584 foo
585</div>
586\stoptyping
588As should this:
590\starttyping
591<div>foo</div>
592\stoptyping
594Now, nested:
596foo
598This should just be an HTML comment:
600Multiline:
602Code block:
604\starttyping
605<!-- Comment -->
606\stoptyping
608Just plain comment, with trailing spaces on the line:
610Code:
612\starttyping
613<hr />
614\stoptyping
616Hr's:
618\thinrule
620\section[title={Inline Markup},reference={inline-markup}]
622This is {\em emphasized}, and so {\em is this}.
624This is {\bf strong}, and so {\bf is this}.
626An {\em \useURL[url2][/url][][emphasized link]\from[url2]}.
628{\bf {\em This is strong and em.}}
630So is {\bf {\em this}} word.
632{\bf {\em This is strong and em.}}
634So is {\bf {\em this}} word.
636This is code: \type{>}, \type{$}, \type{\}, \type{\$}, \type{<html>}.
638\overstrikes{This is {\em strikeout}.}
640Superscripts: a\high{bc}d a\high{{\em hello}} a\high{hello~there}.
642Subscripts: H\low{2}O, H\low{23}O, H\low{many~of~them}O.
644These should not be superscripts or subscripts, because of the unescaped
645spaces: a^b c^d, a\lettertilde{}b c\lettertilde{}d.
647\thinrule
649\section[title={Smart quotes, ellipses,
650dashes},reference={smart-quotes-ellipses-dashes}]
652\quotation{Hello,} said the spider. \quotation{\quote{Shelob} is my name.}
654\quote{A}, \quote{B}, and \quote{C} are letters.
656\quote{Oak,} \quote{elm,} and \quote{beech} are names of trees. So is
657\quote{pine.}
659\quote{He said, \quotation{I want to go.}} Were you alive in the 70's?
661Here is some quoted \quote{\type{code}} and a
662\quotation{\useURL[url3][http://example.com/?foo=1&bar=2][][quoted
663link]\from[url3]}.
665Some dashes: one---two --- three---four --- five.
667Dashes between numbers: 5--7, 255--66, 1987--1999.
669Ellipses\ldots{}and\ldots{}and\ldots{}.
671\thinrule
673\section[title={LaTeX},reference={latex}]
675\startitemize[packed]
676\item
677 \cite[22-23]{smith.1899}
678\item
679 $2+2=4$
680\item
681 $x \in y$
682\item
683 $\alpha \wedge \omega$
684\item
685 $223$
686\item
687 $p$-Tree
688\item
689 Here's some display math:
690 \startformula \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} \stopformula
691\item
692 Here's one that has a line break in it: $\alpha + \omega \times x^2$.
693\stopitemize
695These shouldn't be math:
697\startitemize[packed]
698\item
699 To get the famous equation, write \type{$e = mc^2$}.
700\item
701 \$22,000 is a {\em lot} of money. So is \$34,000. (It worked if
702 \quotation{lot} is emphasized.)
703\item
704 Shoes (\$20) and socks (\$5).
705\item
706 Escaped \type{$}: \$73 {\em this should be emphasized} 23\$.
707\stopitemize
709Here's a LaTeX table:
711\begin{tabular}{|l|l|}\hline
712Animal & Number \\ \hline
713Dog & 2 \\
714Cat & 1 \\ \hline
715\end{tabular}
717\thinrule
719\section[title={Special Characters},reference={special-characters}]
721Here is some unicode:
723\startitemize[packed]
724\item
725 I hat: Î
726\item
727 o umlaut: ö
728\item
729 section: §
730\item
731 set membership: ∈
732\item
733 copyright: ©
734\stopitemize
736AT&T has an ampersand in their name.
738AT&T is another way to write it.
740This & that.
7424 < 5.
7446 > 5.
746Backslash: \letterbackslash{}
748Backtick: `
750Asterisk: *
752Underscore: _
754Left brace: \{
756Right brace: \}
758Left bracket: {[}
760Right bracket: {]}
762Left paren: (
764Right paren: )
766Greater-than: >
768Hash: \#
770Period: .
772Bang: !
774Plus: +
776Minus: -
778\thinrule
780\section[title={Links},reference={links}]
782\subsection[title={Explicit},reference={explicit}]
784Just a \useURL[url4][/url/][][URL]\from[url4].
786\useURL[url5][/url/][][URL and title]\from[url5].
788\useURL[url6][/url/][][URL and title]\from[url6].
790\useURL[url7][/url/][][URL and title]\from[url7].
792\useURL[url8][/url/][][URL and title]\from[url8]
794\useURL[url9][/url/][][URL and title]\from[url9]
796\useURL[url10][/url/with_underscore][][with_underscore]\from[url10]
798\useURL[url11][mailto:nobody@nowhere.net][][Email link]\from[url11]
800\useURL[url12][][][Empty]\from[url12].
802\subsection[title={Reference},reference={reference}]
804Foo \useURL[url13][/url/][][bar]\from[url13].
806With \useURL[url14][/url/][][embedded {[}brackets{]}]\from[url14].
808\useURL[url15][/url/][][b]\from[url15] by itself should be a link.
810Indented \useURL[url16][/url][][once]\from[url16].
812Indented \useURL[url17][/url][][twice]\from[url17].
814Indented \useURL[url18][/url][][thrice]\from[url18].
816This should {[}not{]}{[}{]} be a link.
818\starttyping
819[not]: /url
820\stoptyping
822Foo \useURL[url19][/url/][][bar]\from[url19].
824Foo \useURL[url20][/url/][][biz]\from[url20].
826\subsection[title={With ampersands},reference={with-ampersands}]
828Here's a \useURL[url21][http://example.com/?foo=1&bar=2][][link with an
829ampersand in the URL]\from[url21].
831Here's a link with an amersand in the link text:
832\useURL[url22][http://att.com/][][AT&T]\from[url22].
834Here's an \useURL[url23][/script?foo=1&bar=2][][inline link]\from[url23].
836Here's an \useURL[url24][/script?foo=1&bar=2][][inline link in pointy
837braces]\from[url24].
839\subsection[title={Autolinks},reference={autolinks}]
841With an ampersand: \useURL[url25][http://example.com/?foo=1&bar=2]\from[url25]
843\startitemize[packed]
844\item
845 In a list?
846\item
847 \useURL[url26][http://example.com/]\from[url26]
848\item
849 It should.
850\stopitemize
852An e-mail address:
853\useURL[url27][mailto:nobody@nowhere.net][][nobody@nowhere.net]\from[url27]
855\startblockquote
856Blockquoted: \useURL[url28][http://example.com/]\from[url28]
857\stopblockquote
859Auto-links should not occur here: \type{<http://example.com/>}
861\starttyping
862or here: <http://example.com/>
863\stoptyping
865\thinrule
867\section[title={Images},reference={images}]
869From \quotation{Voyage dans la Lune} by Georges Melies (1902):
871\placefigure{lalune}{\externalfigure[lalune.jpg]}
873Here is a movie {\externalfigure[movie.jpg]} icon.
875\thinrule
877\section[title={Footnotes},reference={footnotes}]
879Here is a footnote reference,\footnote{Here is the footnote. It can go
880 anywhere after the footnote reference. It need not be placed at the end of
881 the document.} and another.\startbuffer Here's the long note. This one
882 contains multiple blocks.
884 Subsequent blocks are indented to show that they belong to the footnote (as
885 with list items).
887\starttyping
888 { <code> }
889\stoptyping
891 If you want, you can indent every line, but you can also be lazy and just
892 indent the first line of each block.\stopbuffer\footnote{\getbuffer} This
893should {\em not} be a footnote reference, because it contains a space.{[}^my
894note{]} Here is an inline note.\footnote{This is {\em easier} to type. Inline
895 notes may contain \useURL[url29][http://google.com][][links]\from[url29] and
896 \type{]} verbatim characters, as well as {[}bracketed text{]}.}
898\startblockquote
899Notes can go in quotes.\footnote{In quote.}
900\stopblockquote
902\startitemize[n,packed][stopper=.]
903\item
904 And in list items.\footnote{In list.}
905\stopitemize
907This paragraph should not be part of the note, as it is not indented.
909\stoptext