git.iko.soy/typeable/pandoc
on 1.0 help sign in
typeable/pandoc/tests/writer.latex
800 lines 12 kB history raw
1\documentclass{article}
2\usepackage{amsmath}
3\usepackage[mathletters]{ucs}
4\usepackage[utf8x]{inputenc}
5\setlength{\parindent}{0pt}
6\setlength{\parskip}{6pt plus 2pt minus 1pt}
8\newcommand{\textsubscr}[1]{\ensuremath{_{\scriptsize\textrm{#1}}}}
9\usepackage[breaklinks=true]{hyperref}
10\usepackage[normalem]{ulem}
11\usepackage{enumerate}
12\usepackage{fancyvrb}
13\usepackage{graphicx}
14\usepackage{url}
16\setcounter{secnumdepth}{0}
17\VerbatimFootnotes % allows verbatim text in footnotes
18\title{Pandoc Test Suite}
19\author{John MacFarlane\\Anonymous}
20\date{July 17, 2006}
21\begin{document}
22\maketitle
24This is a set of tests for pandoc. Most of them are adapted from
25John Gruber's markdown test suite.
27\begin{center}\rule{3in}{0.4pt}\end{center}
29\section{Headers}
31\subsection{Level 2 with an \href{/url}{embedded link}}
33\subsubsection{Level 3 with \emph{emphasis}}
35Level 4
37Level 5
39\section{Level 1}
41\subsection{Level 2 with \emph{emphasis}}
43\subsubsection{Level 3}
45with no blank line
47\subsection{Level 2}
49with no blank line
51\begin{center}\rule{3in}{0.4pt}\end{center}
53\section{Paragraphs}
55Here's a regular paragraph.
57In Markdown 1.0.0 and earlier. Version 8. This line turns into a
58list item. Because a hard-wrapped line in the middle of a paragraph
59looked like a list item.
61Here's one with a bullet. * criminey.
63There should be a hard line break\\here.
65\begin{center}\rule{3in}{0.4pt}\end{center}
67\section{Block Quotes}
69E-mail style:
71\begin{quote}
72This is a block quote. It is pretty short.
74\end{quote}
75\begin{quote}
76Code in a block quote:
78\begin{verbatim}
79sub status {
80 print "working";
82\end{verbatim}
83A list:
85\begin{enumerate}[1.]
86\item
87 item one
88\item
89 item two
90\end{enumerate}
91Nested block quotes:
93\begin{quote}
94nested
96\end{quote}
97\begin{quote}
98nested
100\end{quote}
101\end{quote}
102This should not be a block quote: 2 \textgreater{} 1.
104And a following paragraph.
106\begin{center}\rule{3in}{0.4pt}\end{center}
108\section{Code Blocks}
110Code:
112\begin{verbatim}
113---- (should be four hyphens)
115sub status {
116 print "working";
119this code block is indented by one tab
120\end{verbatim}
121And:
123\begin{verbatim}
124 this code block is indented by two tabs
126These should not be escaped: \$ \\ \> \[ \{
127\end{verbatim}
128\begin{center}\rule{3in}{0.4pt}\end{center}
130\section{Lists}
132\subsection{Unordered}
134Asterisks tight:
136\begin{itemize}
137\item
138 asterisk 1
139\item
140 asterisk 2
141\item
142 asterisk 3
143\end{itemize}
144Asterisks loose:
146\begin{itemize}
147\item
148 asterisk 1
150\item
151 asterisk 2
153\item
154 asterisk 3
156\end{itemize}
157Pluses tight:
159\begin{itemize}
160\item
161 Plus 1
162\item
163 Plus 2
164\item
165 Plus 3
166\end{itemize}
167Pluses loose:
169\begin{itemize}
170\item
171 Plus 1
173\item
174 Plus 2
176\item
177 Plus 3
179\end{itemize}
180Minuses tight:
182\begin{itemize}
183\item
184 Minus 1
185\item
186 Minus 2
187\item
188 Minus 3
189\end{itemize}
190Minuses loose:
192\begin{itemize}
193\item
194 Minus 1
196\item
197 Minus 2
199\item
200 Minus 3
202\end{itemize}
203\subsection{Ordered}
205Tight:
207\begin{enumerate}[1.]
208\item
209 First
210\item
211 Second
212\item
213 Third
214\end{enumerate}
215and:
217\begin{enumerate}[1.]
218\item
219 One
220\item
221 Two
222\item
223 Three
224\end{enumerate}
225Loose using tabs:
227\begin{enumerate}[1.]
228\item
229 First
231\item
232 Second
234\item
235 Third
237\end{enumerate}
238and using spaces:
240\begin{enumerate}[1.]
241\item
242 One
244\item
245 Two
247\item
248 Three
250\end{enumerate}
251Multiple paragraphs:
253\begin{enumerate}[1.]
254\item
255 Item 1, graf one.
257 Item 1. graf two. The quick brown fox jumped over the lazy dog's
258 back.
260\item
261 Item 2.
263\item
264 Item 3.
266\end{enumerate}
267\subsection{Nested}
269\begin{itemize}
270\item
271 Tab
272 \begin{itemize}
273 \item
274 Tab
275 \begin{itemize}
276 \item
277 Tab
278 \end{itemize}
279 \end{itemize}
280\end{itemize}
281Here's another:
283\begin{enumerate}[1.]
284\item
285 First
286\item
287 Second:
288 \begin{itemize}
289 \item
290 Fee
291 \item
292 Fie
293 \item
294 Foe
295 \end{itemize}
296\item
297 Third
298\end{enumerate}
299Same thing but with paragraphs:
301\begin{enumerate}[1.]
302\item
303 First
305\item
306 Second:
308 \begin{itemize}
309 \item
310 Fee
311 \item
312 Fie
313 \item
314 Foe
315 \end{itemize}
316\item
317 Third
319\end{enumerate}
320\subsection{Tabs and spaces}
322\begin{itemize}
323\item
324 this is a list item indented with tabs
326\item
327 this is a list item indented with spaces
329 \begin{itemize}
330 \item
331 this is an example list item indented with tabs
333 \item
334 this is an example list item indented with spaces
336 \end{itemize}
337\end{itemize}
338\subsection{Fancy list markers}
340\begin{enumerate}[(1)]
341\setcounter{enumi}{1}
342\item
343 begins with 2
344\item
345 and now 3
347 with a continuation
349 \begin{enumerate}[i.]
350 \setcounter{enumii}{3}
351 \item
352 sublist with roman numerals, starting with 4
353 \item
354 more items
355 \begin{enumerate}[(A)]
356 \item
357 a subsublist
358 \item
359 a subsublist
360 \end{enumerate}
361 \end{enumerate}
362\end{enumerate}
363Nesting:
365\begin{enumerate}[A.]
366\item
367 Upper Alpha
368 \begin{enumerate}[I.]
369 \item
370 Upper Roman.
371 \begin{enumerate}[(1)]
372 \setcounter{enumiii}{5}
373 \item
374 Decimal start with 6
375 \begin{enumerate}[a)]
376 \setcounter{enumiv}{2}
377 \item
378 Lower alpha with paren
379 \end{enumerate}
380 \end{enumerate}
381 \end{enumerate}
382\end{enumerate}
383Autonumbering:
385\begin{enumerate}
386\item
387 Autonumber.
388\item
389 More.
390 \begin{enumerate}
391 \item
392 Nested.
393 \end{enumerate}
394\end{enumerate}
395Should not be a list item:
397M.A.~2007
399B. Williams
401\begin{center}\rule{3in}{0.4pt}\end{center}
403\section{Definition Lists}
405Tight using spaces:
407\begin{description}
408\item[apple]
409red fruit
410\item[orange]
411orange fruit
412\item[banana]
413yellow fruit
414\end{description}
415Tight using tabs:
417\begin{description}
418\item[apple]
419red fruit
420\item[orange]
421orange fruit
422\item[banana]
423yellow fruit
424\end{description}
425Loose:
427\begin{description}
428\item[apple]
429red fruit
431\item[orange]
432orange fruit
434\item[banana]
435yellow fruit
437\end{description}
438Multiple blocks with italics:
440\begin{description}
441\item[\emph{apple}]
442red fruit
444contains seeds, crisp, pleasant to taste
446\item[\emph{orange}]
447orange fruit
449\begin{verbatim}
450{ orange code block }
451\end{verbatim}
452\begin{quote}
453orange block quote
455\end{quote}
456\end{description}
457\section{HTML Blocks}
459Simple block on one line:
461foo
462And nested without indentation:
464foo
465bar
466Interpreted markdown in a table:
468This is \emph{emphasized}
469And this is \textbf{strong}
470Here's a simple block:
472foo
473This should be a code block, though:
475\begin{verbatim}
476<div>
477 foo
478</div>
479\end{verbatim}
480As should this:
482\begin{verbatim}
483<div>foo</div>
484\end{verbatim}
485Now, nested:
487foo
488This should just be an HTML comment:
490Multiline:
492Code block:
494\begin{verbatim}
495<!-- Comment -->
496\end{verbatim}
497Just plain comment, with trailing spaces on the line:
499Code:
501\begin{verbatim}
502<hr />
503\end{verbatim}
504Hr's:
506\begin{center}\rule{3in}{0.4pt}\end{center}
508\section{Inline Markup}
510This is \emph{emphasized}, and so \emph{is this}.
512This is \textbf{strong}, and so \textbf{is this}.
514An \emph{\href{/url}{emphasized link}}.
516\textbf{\emph{This is strong and em.}}
518So is \textbf{\emph{this}} word.
520\textbf{\emph{This is strong and em.}}
522So is \textbf{\emph{this}} word.
524This is code: \verb!>!, \verb!$!, \verb!\!, \verb!\$!,
525\verb!<html>!.
527\sout{This is \emph{strikeout}.}
529Superscripts: a\textsuperscript{bc}d
530a\textsuperscript{\emph{hello}} a\textsuperscript{hello~there}.
532Subscripts: H\textsubscr{2}O, H\textsubscr{23}O,
533H\textsubscr{many~of~them}O.
535These should not be superscripts or subscripts, because of the
536unescaped spaces: a\^{}b c\^{}d, a\ensuremath{\sim}b
537c\ensuremath{\sim}d.
539\begin{center}\rule{3in}{0.4pt}\end{center}
541\section{Smart quotes, ellipses, dashes}
543``Hello,'' said the spider. ``\,`Shelob' is my name.''
545`A', `B', and `C' are letters.
547`Oak,' `elm,' and `beech' are names of trees. So is `pine.'
549`He said, ``I want to go.''\,' Were you alive in the 70's?
551Here is some quoted `\verb!code!' and a
552``\href{http://example.com/?foo=1&bar=2}{quoted link}''.
554Some dashes: one---two --- three---four --- five.
556Dashes between numbers: 5--7, 255--66, 1987--1999.
558Ellipses\ldots{}and\ldots{}and\ldots{}.
560\begin{center}\rule{3in}{0.4pt}\end{center}
562\section{LaTeX}
564\begin{itemize}
565\item
566 \cite[22-23]{smith.1899}
567\item
568 $2+2=4$
569\item
570 $x \in y$
571\item
572 $\alpha \wedge \omega$
573\item
574 $223$
575\item
576 $p$-Tree
577\item
578 Here's some display math:
579 \[\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\]
580\item
581 Here's one that has a line break in it:
582 $\alpha + \omega \times x^2$.
583\end{itemize}
584These shouldn't be math:
586\begin{itemize}
587\item
588 To get the famous equation, write \verb!$e = mc^2$!.
589\item
590 \$22,000 is a \emph{lot} of money. So is \$34,000. (It worked if
591 ``lot'' is emphasized.)
592\item
593 Shoes (\$20) and socks (\$5).
594\item
595 Escaped \verb!$!: \$73 \emph{this should be emphasized} 23\$.
596\end{itemize}
597Here's a LaTeX table:
599\begin{tabular}{|l|l|}\hline
600Animal & Number \\ \hline
601Dog & 2 \\
602Cat & 1 \\ \hline
603\end{tabular}
605\begin{center}\rule{3in}{0.4pt}\end{center}
607\section{Special Characters}
609Here is some unicode:
611\begin{itemize}
612\item
613 I hat: Î
614\item
615 o umlaut: ö
616\item
617 section: §
618\item
619 set membership: ∈
620\item
621 copyright: ©
622\end{itemize}
623AT\&T has an ampersand in their name.
625AT\&T is another way to write it.
627This \& that.
6294 \textless{} 5.
6316 \textgreater{} 5.
633Backslash: \textbackslash{}
635Backtick: `
637Asterisk: *
639Underscore: \_
641Left brace: \{
643Right brace: \}
645Left bracket: [
647Right bracket: ]
649Left paren: (
651Right paren: )
653Greater-than: \textgreater{}
655Hash: \#
657Period: .
659Bang: !
661Plus: +
663Minus: -
665\begin{center}\rule{3in}{0.4pt}\end{center}
667\section{Links}
669\subsection{Explicit}
671Just a \href{/url/}{URL}.
673\href{/url/}{URL and title}.
675\href{/url/}{URL and title}.
677\href{/url/}{URL and title}.
679\href{/url/}{URL and title}
681\href{/url/}{URL and title}
683\href{/url/with_underscore}{with\_underscore}
685\href{mailto:nobody@nowhere.net}{Email link}
687\href{}{Empty}.
689\subsection{Reference}
691Foo \href{/url/}{bar}.
693Foo \href{/url/}{bar}.
695Foo \href{/url/}{bar}.
697With \href{/url/}{embedded [brackets]}.
699\href{/url/}{b} by itself should be a link.
701Indented \href{/url}{once}.
703Indented \href{/url}{twice}.
705Indented \href{/url}{thrice}.
707This should [not][] be a link.
709\begin{verbatim}
710[not]: /url
711\end{verbatim}
712Foo \href{/url/}{bar}.
714Foo \href{/url/}{biz}.
716\subsection{With ampersands}
718Here's a
719\href{http://example.com/?foo=1&bar=2}{link with an ampersand in the URL}.
721Here's a link with an amersand in the link text:
722\href{http://att.com/}{AT\&T}.
724Here's an \href{/script?foo=1&bar=2}{inline link}.
726Here's an
727\href{/script?foo=1&bar=2}{inline link in pointy braces}.
729\subsection{Autolinks}
731With an ampersand: \url{http://example.com/?foo=1&bar=2}
733\begin{itemize}
734\item
735 In a list?
736\item
737 \url{http://example.com/}
738\item
739 It should.
740\end{itemize}
741An e-mail address:
742\href{mailto:nobody@nowhere.net}{\texttt{nobody@nowhere.net}}
744\begin{quote}
745Blockquoted: \url{http://example.com/}
747\end{quote}
748Auto-links should not occur here: \verb!<http://example.com/>!
750\begin{verbatim}
751or here: <http://example.com/>
752\end{verbatim}
753\begin{center}\rule{3in}{0.4pt}\end{center}
755\section{Images}
757From ``Voyage dans la Lune'' by Georges Melies (1902):
759\includegraphics{lalune.jpg}
761Here is a movie \includegraphics{movie.jpg} icon.
763\begin{center}\rule{3in}{0.4pt}\end{center}
765\section{Footnotes}
767Here is a footnote reference,%
768\footnote{Here is the footnote. It can go anywhere after the footnote
769reference. It need not be placed at the end of the document.}
770and another.%
771\footnote{Here's the long note. This one contains multiple blocks.
773Subsequent blocks are indented to show that they belong to the
774footnote (as with list items).
776\begin{Verbatim}
777 { <code> }
778\end{Verbatim}
779If you want, you can indent every line, but you can also be lazy
780and just indent the first line of each block.}
781This should \emph{not} be a footnote reference, because it contains
782a space.[\^{}my note] Here is an inline note.%
783\footnote{This is \emph{easier} to type. Inline notes may contain
784\href{http://google.com}{links} and \verb!]! verbatim characters,
785as well as [bracketed text].}
787\begin{quote}
788Notes can go in quotes.%
789\footnote{In quote.}
791\end{quote}
792\begin{enumerate}[1.]
793\item
794 And in list items.%
795 \footnote{In list.}
796\end{enumerate}
797This paragraph should not be part of the note, as it is not
798indented.
800\end{document}