git.iko.soy/typeable/pandoc
on 1.3 help sign in
typeable/pandoc/tests/latex-reader.latex
830 lines 13 kB history raw
1\documentclass{article}
2\usepackage[mathletters]{ucs}
3\usepackage[utf8x]{inputenc}
4\setlength{\parindent}{0pt}
5\setlength{\parskip}{6pt plus 2pt minus 1pt}
7\newcommand{\textsubscript}[1]{\ensuremath{_{\scriptsize\textrm{#1}}}}
8\usepackage[breaklinks=true]{hyperref}
9\usepackage[normalem]{ulem}
10\usepackage{enumerate}
11\usepackage{fancyvrb}
12\usepackage{graphicx}
13\usepackage{url}
15\setcounter{secnumdepth}{0}
16\VerbatimFootnotes % allows verbatim text in footnotes
17\title{Pandoc Test Suite}
18\author{John MacFarlane\\Anonymous}
19\date{July 17, 2006}
20\begin{document}
21\maketitle
23This is a set of tests for pandoc. Most of them are adapted from
24John Gruber's markdown test suite.
26\begin{center}\rule{3in}{0.4pt}\end{center}
28\section{Headers}
30\subsection{Level 2 with an \href{/url}{embedded link}}
32\subsubsection{Level 3 with \emph{emphasis}}
34Level 4
36Level 5
38\section{Level 1}
40\subsection{Level 2 with \emph{emphasis}}
42\subsubsection{Level 3}
44with no blank line
46\subsection{Level 2}
48with no blank line
50\begin{center}\rule{3in}{0.4pt}\end{center}
52\section{Paragraphs}
54Here's a regular paragraph.
56In Markdown 1.0.0 and earlier. Version 8. This line turns into a
57list item. Because a hard-wrapped line in the middle of a paragraph
58looked like a list item.
60Here's one with a bullet. * criminey.
62There should be a hard line break\\here.
64\begin{center}\rule{3in}{0.4pt}\end{center}
66\section{Block Quotes}
68E-mail style:
70\begin{quote}
71This is a block quote. It is pretty short.
73\end{quote}
74\begin{quote}
75Code in a block quote:
77\begin{verbatim}
78sub status {
79 print "working";
81\end{verbatim}
82A list:
84\begin{enumerate}[1.]
85\item
86 item one
87\item
88 item two
89\end{enumerate}
90Nested block quotes:
92\begin{quote}
93nested
95\end{quote}
96\begin{quote}
97nested
99\end{quote}
100\end{quote}
101This should not be a block quote: 2 \textgreater{} 1.
103Box-style:
105\begin{quote}
106Example:
108\begin{verbatim}
109sub status {
110 print "working";
112\end{verbatim}
113\end{quote}
114\begin{quote}
115\begin{enumerate}[1.]
116\item
117 do laundry
118\item
119 take out the trash
120\end{enumerate}
121\end{quote}
122Here's a nested one:
124\begin{quote}
125Joe said:
127\begin{quote}
128Don't quote me.
130\end{quote}
131\end{quote}
132And a following paragraph.
134\begin{center}\rule{3in}{0.4pt}\end{center}
136\section{Code Blocks}
138Code:
140\begin{verbatim}
141---- (should be four hyphens)
143sub status {
144 print "working";
147this code block is indented by one tab
148\end{verbatim}
149And:
151\begin{verbatim}
152 this code block is indented by two tabs
154These should not be escaped: \$ \\ \> \[ \{
155\end{verbatim}
156\begin{center}\rule{3in}{0.4pt}\end{center}
158\section{Lists}
160\subsection{Unordered}
162Asterisks tight:
164\begin{itemize}
165\item
166 asterisk 1
167\item
168 asterisk 2
169\item
170 asterisk 3
171\end{itemize}
172Asterisks loose:
174\begin{itemize}
175\item
176 asterisk 1
178\item
179 asterisk 2
181\item
182 asterisk 3
184\end{itemize}
185Pluses tight:
187\begin{itemize}
188\item
189 Plus 1
190\item
191 Plus 2
192\item
193 Plus 3
194\end{itemize}
195Pluses loose:
197\begin{itemize}
198\item
199 Plus 1
201\item
202 Plus 2
204\item
205 Plus 3
207\end{itemize}
208Minuses tight:
210\begin{itemize}
211\item
212 Minus 1
213\item
214 Minus 2
215\item
216 Minus 3
217\end{itemize}
218Minuses loose:
220\begin{itemize}
221\item
222 Minus 1
224\item
225 Minus 2
227\item
228 Minus 3
230\end{itemize}
231\subsection{Ordered}
233Tight:
235\begin{enumerate}[1.]
236\item
237 First
238\item
239 Second
240\item
241 Third
242\end{enumerate}
243and:
245\begin{enumerate}[1.]
246\item
247 One
248\item
249 Two
250\item
251 Three
252\end{enumerate}
253Loose using tabs:
255\begin{enumerate}[1.]
256\item
257 First
259\item
260 Second
262\item
263 Third
265\end{enumerate}
266and using spaces:
268\begin{enumerate}[1.]
269\item
270 One
272\item
273 Two
275\item
276 Three
278\end{enumerate}
279Multiple paragraphs:
281\begin{enumerate}[1.]
282\item
283 Item 1, graf one.
285 Item 1. graf two. The quick brown fox jumped over the lazy dog's
286 back.
288\item
289 Item 2.
291\item
292 Item 3.
294\end{enumerate}
295\subsection{Nested}
297\begin{itemize}
298\item
299 Tab
300 \begin{itemize}
301 \item
302 Tab
303 \begin{itemize}
304 \item
305 Tab
306 \end{itemize}
307 \end{itemize}
308\end{itemize}
309Here's another:
311\begin{enumerate}[1.]
312\item
313 First
314\item
315 Second:
316 \begin{itemize}
317 \item
318 Fee
319 \item
320 Fie
321 \item
322 Foe
323 \end{itemize}
324\item
325 Third
326\end{enumerate}
327Same thing but with paragraphs:
329\begin{enumerate}[1.]
330\item
331 First
333\item
334 Second:
336 \begin{itemize}
337 \item
338 Fee
339 \item
340 Fie
341 \item
342 Foe
343 \end{itemize}
344\item
345 Third
347\end{enumerate}
348\subsection{Tabs and spaces}
350\begin{itemize}
351\item
352 this is a list item indented with tabs
354\item
355 this is a list item indented with spaces
357 \begin{itemize}
358 \item
359 this is an example list item indented with tabs
361 \item
362 this is an example list item indented with spaces
364 \end{itemize}
365\end{itemize}
366\subsection{Fancy list markers}
368\begin{enumerate}[(1)]
369\setcounter{enumi}{1}
370\item
371 begins with 2
372\item
373 and now 3
375 with a continuation
377 \begin{enumerate}[i.]
378 \setcounter{enumii}{3}
379 \item
380 sublist with roman numerals, starting with 4
381 \item
382 more items
383 \begin{enumerate}[(A)]
384 \item
385 a subsublist
386 \item
387 a subsublist
388 \end{enumerate}
389 \end{enumerate}
390\end{enumerate}
391Nesting:
393\begin{enumerate}[A.]
394\item
395 Upper Alpha
396 \begin{enumerate}[I.]
397 \item
398 Upper Roman.
399 \begin{enumerate}[(1)]
400 \setcounter{enumiii}{5}
401 \item
402 Decimal start with 6
403 \begin{enumerate}[a)]
404 \setcounter{enumiv}{2}
405 \item
406 Lower alpha with paren
407 \end{enumerate}
408 \end{enumerate}
409 \end{enumerate}
410\end{enumerate}
411Autonumbering:
413\begin{enumerate}
414\item
415 Autonumber.
416\item
417 More.
418 \begin{enumerate}
419 \item
420 Nested.
421 \end{enumerate}
422\end{enumerate}
423Should not be a list item:
425M.A. 2007
427B. Williams
429\begin{center}\rule{3in}{0.4pt}\end{center}
431\section{Definition Lists}
433Tight using spaces:
435\begin{description}
436\item[apple]
437red fruit
438\item[orange]
439orange fruit
440\item[banana]
441yellow fruit
442\end{description}
443Tight using tabs:
445\begin{description}
446\item[apple]
447red fruit
448\item[orange]
449orange fruit
450\item[banana]
451yellow fruit
452\end{description}
453Loose:
455\begin{description}
456\item[apple]
457red fruit
459\item[orange]
460orange fruit
462\item[banana]
463yellow fruit
465\end{description}
466Multiple blocks with italics:
468\begin{description}
469\item[\emph{apple}]
470red fruit
472contains seeds, crisp, pleasant to taste
474\item[\emph{orange}]
475orange fruit
477\begin{verbatim}
478{ orange code block }
479\end{verbatim}
480\begin{quote}
481orange block quote
483\end{quote}
484\end{description}
485\section{HTML Blocks}
487Simple block on one line:
489foo
490And nested without indentation:
492foo
493bar
494Interpreted markdown in a table:
496This is \emph{emphasized}
497And this is \textbf{strong}
498Here's a simple block:
500foo
501This should be a code block, though:
503\begin{verbatim}
504<div>
505 foo
506</div>
507\end{verbatim}
508As should this:
510\begin{verbatim}
511<div>foo</div>
512\end{verbatim}
513Now, nested:
515foo
516This should just be an HTML comment:
518Multiline:
520Code block:
522\begin{verbatim}
523<!-- Comment -->
524\end{verbatim}
525Just plain comment, with trailing spaces on the line:
527Code:
529\begin{verbatim}
530<hr />
531\end{verbatim}
532Hr's:
534\begin{center}\rule{3in}{0.4pt}\end{center}
536\section{Inline Markup}
538This is \emph{emphasized}, and so \emph{is this}.
540This is \textbf{strong}, and so \textbf{is this}.
542An \emph{\href{/url}{emphasized link}}.
544\textbf{\emph{This is strong and em.}}
546So is \textbf{\emph{this}} word.
548\textbf{\emph{This is strong and em.}}
550So is \textbf{\emph{this}} word.
552This is code: \verb!>!, \verb!$!, \verb!\!, \verb!\$!,
553\verb!<html>!.
555\sout{This is \emph{strikeout}.}
557Superscripts: a\textsuperscript{bc}d
558a\textsuperscript{\emph{hello}} a\textsuperscript{hello there}.
560Subscripts: H\textsubscript{2}O, H\textsubscript{23}O,
561H\textsubscript{many of them}O.
563These should not be superscripts or subscripts, because of the
564unescaped spaces: a\^{}b c\^{}d, a\ensuremath{\sim}b
565c\ensuremath{\sim}d.
567\begin{center}\rule{3in}{0.4pt}\end{center}
569\section{Smart quotes, ellipses, dashes}
571``Hello,'' said the spider. ``\,`Shelob' is my name.''
573`A', `B', and `C' are letters.
575`Oak,' `elm,' and `beech' are names of trees. So is `pine.'
577`He said, ``I want to go.''\,' Were you alive in the 70's?
579Here is some quoted `\verb!code!' and a
580``\href{http://example.com/?foo=1&bar=2}{quoted link}''.
582Some dashes: one---two---three---four---five.
584Dashes between numbers: 5--7, 255--66, 1987--1999.
586Ellipses\ldots{}and\ldots{}and\ldots{}.
588\begin{center}\rule{3in}{0.4pt}\end{center}
590\section{LaTeX}
592\begin{itemize}
593\item
594 \cite[22-23]{smith.1899}
595\item
596 \doublespacing
597\item
598 $2+2=4$
599\item
600 $x \in y$
601\item
602 $\alpha \wedge \omega$
603\item
604 $223$
605\item
606 $p$-Tree
607\item
608 $\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$
609\item
610 Here's one that has a line break in it:
611 $\alpha + \omega \times x^2$.
612\end{itemize}
613These shouldn't be math:
615\begin{itemize}
616\item
617 To get the famous equation, write \verb!$e = mc^2$!.
618\item
619 \$22,000 is a \emph{lot} of money. So is \$34,000. (It worked if
620 ``lot'' is emphasized.)
621\item
622 Escaped \verb!$!: \$73 \emph{this should be emphasized} 23\$.
623\end{itemize}
624Here's a LaTeX table:
626\begin{tabular}{|l|l|}\hline
627Animal & Number \\ \hline
628Dog & 2 \\
629Cat & 1 \\ \hline
630\end{tabular}
632\begin{center}\rule{3in}{0.4pt}\end{center}
634\section{Special Characters}
636Here is some unicode:
638\begin{itemize}
639\item
640 I hat: Î
641\item
642 o umlaut: ö
643\item
644 section: §
645\item
646 set membership: ∈
647\item
648 copyright: ©
649\end{itemize}
650AT\&T has an ampersand in their name.
652AT\&T is another way to write it.
654This \& that.
6564 \textless{} 5.
6586 \textgreater{} 5.
660Backslash: \textbackslash{}
662Backtick: `
664Asterisk: *
666Underscore: \_
668Left brace: \{
670Right brace: \}
672Left bracket: [
674Right bracket: ]
676Left paren: (
678Right paren: )
680Greater-than: \textgreater{}
682Hash: \#
684Period: .
686Bang: !
688Plus: +
690Minus: -
692\begin{center}\rule{3in}{0.4pt}\end{center}
694\section{Links}
696\subsection{Explicit}
698Just a \href{/url/}{URL}.
700\href{/url/}{URL and title}.
702\href{/url/}{URL and title}.
704\href{/url/}{URL and title}.
706\href{/url/}{URL and title}
708\href{/url/}{URL and title}
710\href{/url/with_underscore}{with\_underscore}
712\href{mailto:nobody@nowhere.net}{Email link}
714\href{}{Empty}.
716\subsection{Reference}
718Foo \href{/url/}{bar}.
720Foo \href{/url/}{bar}.
722Foo \href{/url/}{bar}.
724With \href{/url/}{embedded [brackets]}.
726\href{/url/}{b} by itself should be a link.
728Indented \href{/url}{once}.
730Indented \href{/url}{twice}.
732Indented \href{/url}{thrice}.
734This should [not][] be a link.
736\begin{verbatim}
737[not]: /url
738\end{verbatim}
739Foo \href{/url/}{bar}.
741Foo \href{/url/}{biz}.
743\subsection{With ampersands}
745Here's a
746\href{http://example.com/?foo=1&bar=2}{link with an ampersand in the URL}.
748Here's a link with an amersand in the link text:
749\href{http://att.com/}{AT\&T}.
751Here's an \href{/script?foo=1&bar=2}{inline link}.
753Here's an
754\href{/script?foo=1&bar=2}{inline link in pointy braces}.
756\subsection{Autolinks}
758With an ampersand: \url{http://example.com/?foo=1&bar=2}
760\begin{itemize}
761\item
762 In a list?
763\item
764 \url{http://example.com/}
765\item
766 It should.
767\end{itemize}
768An e-mail address:
769\href{mailto:nobody@nowhere.net}{\texttt{nobody@nowhere.net}}
771\begin{quote}
772Blockquoted: \url{http://example.com/}
774\end{quote}
775Auto-links should not occur here: \verb!<http://example.com/>!
777\begin{verbatim}
778or here: <http://example.com/>
779\end{verbatim}
780\begin{center}\rule{3in}{0.4pt}\end{center}
782\section{Images}
784From ``Voyage dans la Lune'' by Georges Melies (1902):
786\includegraphics{lalune.jpg}
788Here is a movie \includegraphics{movie.jpg} icon.
790\begin{center}\rule{3in}{0.4pt}\end{center}
792\section{Footnotes}
794Here is a footnote
795reference,\footnote{ Here is the footnote. It can go anywhere after the footnote
796reference. It need not be placed at the end of the document.
798and
799another.\footnote{ Here's the long note. This one contains multiple blocks.
801Subsequent blocks are indented to show that they belong to the
802footnote (as with list items).
804\begin{Verbatim}
805 { <code> }
806\end{Verbatim}
807If you want, you can indent every line, but you can also be lazy
808and just indent the first line of each block.
810This should \emph{not} be a footnote reference, because it contains
811a space.[\^{}my note] Here is an inline
812note.\footnote{ This is \emph{easier} to type. Inline notes may contain
813\href{http://google.com}{links} and \verb!]! verbatim characters,
814as well as [bracketed text].
817\begin{quote}
818Notes can go in quotes.\footnote{ In quote.
821\end{quote}
822\begin{enumerate}[1.]
823\item
824 And in list items.\footnote{ In list.
826\end{enumerate}
827This paragraph should not be part of the note, as it is not
828indented.
830\end{document}