git.iko.soy/typeable/pandoc
on 1.17 help sign in
typeable/pandoc/tests/latex-reader.latex
848 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,unicode=true]{hyperref}
9\usepackage[normalem]{ulem}
10% avoid problems with \sout in headers with hyperref:
11\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
12\usepackage{enumerate}
13\usepackage{fancyvrb}
14\usepackage{graphicx}
15\usepackage{url}
17\setcounter{secnumdepth}{0}
18\VerbatimFootnotes % allows verbatim text in footnotes
19\title{Pandoc Test Suite}
20\author{John MacFarlane \and Anonymous}
21\date{July 17, 2006}
22\begin{document}
23\maketitle
25This is a set of tests for pandoc. Most of them are adapted from
26John Gruber's markdown test suite.
28\begin{center}\rule{3in}{0.4pt}\end{center}
30\section{Headers}
32\subsection{Level 2 with an \href{/url}{embedded link}}
34\subsubsection{Level 3 with \emph{emphasis}}
36Level 4
38Level 5
40\section[alt title ignored]{Level 1}
42\subsection{Level 2 with \emph{emphasis}}
44\subsubsection{Level 3}
46with no blank line
48\subsection{Level 2}
50with no blank line
52\begin{center}\rule{3in}{0.4pt}\end{center}
54\section{Paragraphs}
56Here's a regular paragraph.
58In Markdown 1.0.0 and earlier. Version 8. This line turns into a
59list item. Because a hard-wrapped line in the middle of a paragraph
60looked like a list item.
62Here's one with a bullet. * criminey.
64There should be a hard line break\\here.
66\begin{center}\rule{3in}{0.4pt}\end{center}
68\section{Block Quotes}
70E-mail style:
72\begin{quote}
73This is a block quote. It is pretty short.
75\end{quote}
76\begin {quote}
77Code in a block quote:
79\begin{verbatim}
80sub status {
81 print "working";
83\end{verbatim}
84A list:
86\begin{enumerate}[1.]
87\item
88 item one
89\item
90 item two
91\end{enumerate}
92Nested block quotes:
94\begin{quote}
95nested
97\end{quote}
98\begin{quote}
99nested
101\end{quote}
102\end{quote}
103This should not be a block quote: 2 \textgreater{} 1.
105Box-style:
107\begin{quote}
108Example:
110\begin{verbatim}
111sub status {
112 print "working";
114\end{verbatim}
115\end{quote}
116\begin{quote}
117\begin{enumerate}[1.]
118\item
119 do laundry
120\item
121 take out the trash
122\end{enumerate}
123\end{quote}
124Here's a nested one:
126\begin{quote}
127Joe said:
129\begin{quote}
130Don't quote me.
132\end{quote}
133\end{quote}
134And a following paragraph.
136\begin{center}\rule{3in}{0.4pt}\end{center}
138\section{Code Blocks}
140Code:
142\begin{verbatim}
143---- (should be four hyphens)
145sub status {
146 print "working";
149this code block is indented by one tab
150\end{verbatim}
151And:
153\begin{verbatim}
154 this code block is indented by two tabs
156These should not be escaped: \$ \\ \> \[ \{
157\end{verbatim}
159\begin{obeylines}
160this has \emph{two
161lines}
162\end{obeylines}
163\begin{center}\rule{3in}{0.4pt}\end{center}
165\section{Lists}
167\subsection{Unordered}
169Asterisks tight:
171\begin{itemize}
172\item
173 asterisk 1
174\item
175 asterisk 2
176\item
177 asterisk 3
178\end{itemize}
179Asterisks loose:
181\begin{itemize}
182\item
183 asterisk 1
185\item
186 asterisk 2
188\item
189 asterisk 3
191\end{itemize}
192Pluses tight:
194\begin{itemize}
195\item
196 Plus 1
197\item
198 Plus 2
199\item
200 Plus 3
201\end{itemize}
202Pluses loose:
204\begin{itemize}
205\item
206 Plus 1
208\item
209 Plus 2
211\item
212 Plus 3
214\end{itemize}
215Minuses tight:
217\begin{itemize}
218\item
219 Minus 1
220\item
221 Minus 2
222\item
223 Minus 3
224\end{itemize}
225Minuses loose:
227\begin{itemize}
228\item
229 Minus 1
231\item
232 Minus 2
234\item
235 Minus 3
237\end{itemize}
238\subsection{Ordered}
240Tight:
242\begin{enumerate}[1.]
243\item
244 First
245\item
246 Second
247\item
248 Third
249\end{enumerate}
250and:
252\begin{enumerate}[1.]
253\item
254 One
255\item
256 Two
257\item
258 Three
259\end{enumerate}
260Loose using tabs:
262\begin{enumerate}[1.]
263\item
264 First
266\item
267 Second
269\item
270 Third
272\end{enumerate}
273and using spaces:
275\begin{enumerate}[1.]
276\item
277 One
279\item
280 Two
282\item
283 Three
285\end{enumerate}
286Multiple paragraphs:
288\begin{enumerate}[1.]
289\item
290 Item 1, graf one.
292 Item 1. graf two. The quick brown fox jumped over the lazy dog's
293 back.
295\item
296 Item 2.
298\item
299 Item 3.
301\end{enumerate}
302\subsection{Nested}
304\begin{itemize}
305\item
306 Tab
307 \begin{itemize}
308 \item
309 Tab
310 \begin{itemize}
311 \item
312 Tab
313 \end{itemize}
314 \end{itemize}
315\end{itemize}
316Here's another:
318\begin{enumerate}[1.]
319\item
320 First
321\item
322 Second:
323 \begin{itemize}
324 \item
325 Fee
326 \item
327 Fie
328 \item
329 Foe
330 \end{itemize}
331\item
332 Third
333\end{enumerate}
334Same thing but with paragraphs:
336\begin{enumerate}[1.]
337\item
338 First
340\item
341 Second:
343 \begin{itemize}
344 \item
345 Fee
346 \item
347 Fie
348 \item
349 Foe
350 \end{itemize}
351\item
352 Third
354\end{enumerate}
355\subsection{Tabs and spaces}
357\begin{itemize}
358\item
359 this is a list item indented with tabs
361\item
362 this is a list item indented with spaces
364 \begin{itemize}
365 \item
366 this is an example list item indented with tabs
368 \item
369 this is an example list item indented with spaces
371 \end{itemize}
372\end{itemize}
373\subsection{Fancy list markers}
375\begin{enumerate}[(1)]
376\setcounter{enumi}{1}
377\item
378 begins with 2
379\item
380 and now 3
382 with a continuation
384 \begin{enumerate}[i.]
385 \setcounter{enumii}{3}
386 \item
387 sublist with roman numerals, starting with 4
388 \item
389 more items
390 \begin{enumerate}[(A)]
391 \item
392 a subsublist
393 \item
394 a subsublist
395 \end{enumerate}
396 \end{enumerate}
397\end{enumerate}
398Nesting:
400\begin{enumerate}[A.]
401\item
402 Upper Alpha
403 \begin{enumerate}[I.]
404 \item
405 Upper Roman.
406 \begin{enumerate}[(1)]
407 \setcounter{enumiii}{5}
408 \item
409 Decimal start with 6
410 \begin{enumerate}[a)]
411 \setcounter{enumiv}{2}
412 \item
413 Lower alpha with paren
414 \end{enumerate}
415 \end{enumerate}
416 \end{enumerate}
417\end{enumerate}
418Autonumbering:
420\begin{enumerate}
421\item
422 Autonumber.
423\item
424 More.
425 \begin{enumerate}
426 \item
427 Nested.
428 \end{enumerate}
429\end{enumerate}
430Should not be a list item:
432M.A. 2007
434B. Williams
436\begin{center}\rule{3in}{0.4pt}\end{center}
438\section{Definition Lists}
440Tight using spaces:
442\begin{description}
443\item[apple]
444red fruit
445\item[orange]
446orange fruit
447\item[banana]
448yellow fruit
449\end{description}
450Tight using tabs:
452\begin{description}
453\item[apple]
454red fruit
455\item[orange]
456orange fruit
457\item[banana]
458yellow fruit
459\end{description}
460Loose:
462\begin{description}
463\item[apple]
464red fruit
466\item[orange]
467orange fruit
469\item[banana]
470yellow fruit
472\end{description}
473Multiple blocks with italics:
475\begin{description}
476\item[\emph{apple}]
477red fruit
479contains seeds, crisp, pleasant to taste
481\item[\emph{orange}]
482orange fruit
484\begin{verbatim}
485{ orange code block }
486\end{verbatim}
487\begin{quote}
488orange block quote
490\end{quote}
491\end{description}
492\section{HTML Blocks}
494Simple block on one line:
496foo
497And nested without indentation:
499foo
500bar
501Interpreted markdown in a table:
503This is \emph{emphasized}
504And this is \textbf{strong}
505Here's a simple block:
507foo
508This should be a code block, though:
510\begin{verbatim}
511<div>
512 foo
513</div>
514\end{verbatim}
515As should this:
517\begin{verbatim}
518<div>foo</div>
519\end{verbatim}
520Now, nested:
522foo
523This should just be an HTML comment:
525Multiline:
527Code block:
529\begin{verbatim}
530<!-- Comment -->
531\end{verbatim}
532Just plain comment, with trailing spaces on the line:
534Code:
536\begin{verbatim}
537<hr />
538\end{verbatim}
539Hr's:
541\begin{center}\rule{3in}{0.4pt}\end{center}
543\section{Inline Markup}
545This is \emph{emphasized}, and so \emph{is this}.
547This is \textbf{strong}, and so \textbf{is this}.
549An \emph{\href{/url}{emphasized link}}.
551\textbf{\emph{This is strong and em.}}
553So is \textbf{\emph{this}} word.
555\textbf{\emph{This is strong and em.}}
557So is \textbf{\emph{this}} word.
559This is code: \verb!>!, \verb!$!, \verb!\!, \verb!\$!,
560\verb!<html>!.
562\sout{This is \emph{strikeout}.}
564Superscripts: a\textsuperscript{bc}d
565a\textsuperscript{\emph{hello}} a\textsuperscript{hello there}.
567Subscripts: H\textsubscript{2}O, H\textsubscript{23}O,
568H\textsubscript{many of them}O.
570These should not be superscripts or subscripts, because of the
571unescaped spaces: a\^{}b c\^{}d, a\ensuremath{\sim}b
572c\ensuremath{\sim}d.
574\begin{center}\rule{3in}{0.4pt}\end{center}
576\section{Smart quotes, ellipses, dashes}
578``Hello,'' said the spider. ``\,`Shelob' is my name.''
580`A', `B', and `C' are letters.
582`Oak,' `elm,' and `beech' are names of trees. So is `pine.'
584`He said, ``I want to go.''\,' Were you alive in the 70's?
586Here is some quoted `\verb!code!' and a
587``\href{http://example.com/?foo=1&bar=2}{quoted link}''.
589Some dashes: one---two---three---four---five.
591Dashes between numbers: 5--7, 255--66, 1987--1999.
593Ellipses\ldots{}and\ldots{}and\ldots{}.
595\begin{center}\rule{3in}{0.4pt}\end{center}
597\section{LaTeX}
599\begin{itemize}
600\item
601 \cite[22-23]{smith.1899}
602\item
603 \doublespacing
604\item
605 $2+2=4$
606\item
607 $x \in y$
608\item
609 $\alpha \wedge \omega$
610\item
611 $223$
612\item
613 $p$-Tree
614\item
615 $\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$
616\item
617 Here's one that has a line break in it:
618 $\alpha + \omega \times x^2$.
619\end{itemize}
620These shouldn't be math:
622\begin{itemize}
623\item
624 To get the famous equation, write \verb!$e = mc^2$!.
625\item
626 \$22,000 is a \emph{lot} of money. So is \$34,000. (It worked if
627 ``lot'' is emphasized.)
628\item
629 Escaped \verb!$!: \$73 \emph{this should be emphasized} 23\$.
630\end{itemize}
631Here's a LaTeX table:
633\begin{tabular}{|l|l|}\hline
634Animal & Number \\ \hline
635Dog & 2 \\
636Cat & 1 \\ \hline
637\end{tabular}
639A table with one column:
641\begin{tabular}{c}
642Animal \\
643Vegetable
644\end{tabular}
646\begin{center}\rule{3in}{0.4pt}\end{center}
648\section{Special Characters}
650Here is some unicode:
652\begin{itemize}
653\item
654 I hat: Î
655\item
656 o umlaut: ö
657\item
658 section: §
659\item
660 set membership: ∈
661\item
662 copyright: ©
663\end{itemize}
664AT\&T has an ampersand in their name.
666AT\&T is another way to write it.
668This \& that.
6704 \textless{} 5.
6726 \textgreater{} 5.
674Backslash: \textbackslash{}
676Backtick: `
678Asterisk: *
680Underscore: \_
682Left brace: \{
684Right brace: \}
686Left bracket: [
688Right bracket: ]
690Left paren: (
692Right paren: )
694Greater-than: \textgreater{}
696Hash: \#
698Period: .
700Bang: !
702Plus: +
704Minus: -
706\begin{center}\rule{3in}{0.4pt}\end{center}
708\section{Links}
710\subsection{Explicit}
712Just a \href{/url/}{URL}.
714\href{/url/}{URL and title}.
716\href{/url/}{URL and title}.
718\href{/url/}{URL and title}.
720\href{/url/}{URL and title}
722\href{/url/}{URL and title}
724\href{/url/with_underscore}{with\_underscore}
726\href{mailto:nobody@nowhere.net}{Email link}
728\href{}{Empty}.
730\subsection{Reference}
732Foo \href{/url/}{bar}.
734Foo \href{/url/}{bar}.
736Foo \href{/url/}{bar}.
738With \href{/url/}{embedded [brackets]}.
740\href{/url/}{b} by itself should be a link.
742Indented \href{/url}{once}.
744Indented \href{/url}{twice}.
746Indented \href{/url}{thrice}.
748This should [not][] be a link.
750\begin{verbatim}
751[not]: /url
752\end{verbatim}
753Foo \href{/url/}{bar}.
755Foo \href{/url/}{biz}.
757\subsection{With ampersands}
759Here's a
760\href{http://example.com/?foo=1&bar=2}{link with an ampersand in the URL}.
762Here's a link with an amersand in the link text:
763\href{http://att.com/}{AT\&T}.
765Here's an \href{/script?foo=1&bar=2}{inline link}.
767Here's an
768\href{/script?foo=1&bar=2}{inline link in pointy braces}.
770\subsection{Autolinks}
772With an ampersand: \url{http://example.com/?foo=1&bar=2}
774\begin{itemize}
775\item
776 In a list?
777\item
778 \url{http://example.com/}
779\item
780 It should.
781\end{itemize}
782An e-mail address:
783\href{mailto:nobody@nowhere.net}{nobody@nowhere.net}
785\begin{quote}
786Blockquoted: \url{http://example.com/}
788\end{quote}
789Auto-links should not occur here: \verb!<http://example.com/>!
791\begin{verbatim}
792or here: <http://example.com/>
793\end{verbatim}
794\begin{center}\rule{3in}{0.4pt}\end{center}
796\section{Images}
798From ``Voyage dans la Lune'' by Georges Melies (1902):
800\includegraphics{lalune.jpg}
802Here is a movie \includegraphics{movie.jpg} icon.
804\begin{center}\rule{3in}{0.4pt}\end{center}
806\section{Footnotes}
808Here is a footnote
809reference,\footnote{ Here is the footnote. It can go anywhere after the footnote
810reference. It need not be placed at the end of the document.
812and
813another.\footnote{ Here's the long note. This one contains multiple blocks.
815Subsequent blocks are indented to show that they belong to the
816footnote (as with list items).
818\begin{Verbatim}
819 { <code> }
820\end{Verbatim}
821If you want, you can indent every line, but you can also be lazy
822and just indent the first line of each block.
824This should \emph{not} be a footnote reference, because it contains
825a space.[\^{}my note] Here is an inline
826note.\footnote{ This is \emph{easier} to type. Inline notes may contain
827\href{http://google.com}{links} and \verb!]! verbatim characters,
828as well as [bracketed text].
831\begin{quote}
832Notes can go in quotes.\footnote{ In quote.
835\end{quote}
836\begin{enumerate}[1.]
837\item
838 And in list items.\footnote{ In list.
840\end{enumerate}
841This paragraph should not be part of the note, as it is not
842indented.
844\section{Escaped characters}
846\$ \% \& \# \_ \{ \}
848\end{document}