git.iko.soy/typeable/pandoc
on 1.12 help sign in
typeable/pandoc/tests/writer.latex
964 lines 17 kB history raw
1\documentclass[]{article}
2\usepackage[T1]{fontenc}
3\usepackage{lmodern}
4\usepackage{amssymb,amsmath}
5\usepackage{ifxetex,ifluatex}
6\usepackage{fixltx2e} % provides \textsubscript
7% use upquote if available, for straight quotes in verbatim environments
8\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
9\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
10 \usepackage[utf8]{inputenc}
11\else % if luatex or xelatex
12 \ifxetex
13 \usepackage{mathspec}
14 \usepackage{xltxtra,xunicode}
15 \else
16 \usepackage{fontspec}
17 \fi
18 \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
19 \newcommand{\euro}{€}
20\fi
21% use microtype if available
22\IfFileExists{microtype.sty}{\usepackage{microtype}}{}
23\usepackage{fancyvrb}
24\usepackage{graphicx}
25% Redefine \includegraphics so that, unless explicit options are
26% given, the image width will not exceed the width of the page.
27% Images get their normal width if they fit onto the page, but
28% are scaled down if they would overflow the margins.
29\makeatletter
30\def\ScaleIfNeeded{%
31 \ifdim\Gin@nat@width>\linewidth
32 \linewidth
33 \else
34 \Gin@nat@width
35 \fi
37\makeatother
38\let\Oldincludegraphics\includegraphics
39{%
40 \catcode`\@=11\relax%
41 \gdef\includegraphics{\@ifnextchar[{\Oldincludegraphics}{\Oldincludegraphics[width=\ScaleIfNeeded]}}%
42}%
43\ifxetex
44 \usepackage[setpagesize=false, % page size defined by xetex
45 unicode=false, % unicode breaks when used with xetex
46 xetex]{hyperref}
47\else
48 \usepackage[unicode=true]{hyperref}
49\fi
50\hypersetup{breaklinks=true,
51 bookmarks=true,
52 pdfauthor={John MacFarlane; Anonymous},
53 pdftitle={Pandoc Test Suite},
54 colorlinks=true,
55 citecolor=blue,
56 urlcolor=blue,
57 linkcolor=magenta,
58 pdfborder={0 0 0}}
59\urlstyle{same} % don't use monospace font for urls
60\usepackage[normalem]{ulem}
61% avoid problems with \sout in headers with hyperref:
62\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
63\setlength{\parindent}{0pt}
64\setlength{\parskip}{6pt plus 2pt minus 1pt}
65\setlength{\emergencystretch}{3em} % prevent overfull lines
66\setcounter{secnumdepth}{0}
67\VerbatimFootnotes % allows verbatim text in footnotes
69\title{Pandoc Test Suite}
70\author{John MacFarlane \and Anonymous}
71\date{July 17, 2006}
73\begin{document}
74\maketitle
76This is a set of tests for pandoc. Most of them are adapted from John Gruber's
77markdown test suite.
79\begin{center}\rule{3in}{0.4pt}\end{center}
81\section{Headers}\label{headers}
83\subsection{Level 2 with an \href{/url}{embedded
84link}}\label{level-2-with-an-embedded-link}
86\subsubsection{Level 3 with \emph{emphasis}}\label{level-3-with-emphasis}
88\paragraph{Level 4}\label{level-4}
90\subparagraph{Level 5}\label{level-5}
92\section{Level 1}\label{level-1}
94\subsection{Level 2 with \emph{emphasis}}\label{level-2-with-emphasis}
96\subsubsection{Level 3}\label{level-3}
98with no blank line
100\subsection{Level 2}\label{level-2}
102with no blank line
104\begin{center}\rule{3in}{0.4pt}\end{center}
106\section{Paragraphs}\label{paragraphs}
108Here's a regular paragraph.
110In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
111Because a hard-wrapped line in the middle of a paragraph looked like a list
112item.
114Here's one with a bullet. * criminey.
116There should be a hard line break\\here.
118\begin{center}\rule{3in}{0.4pt}\end{center}
120\section{Block Quotes}\label{block-quotes}
122E-mail style:
124\begin{quote}
125This is a block quote. It is pretty short.
126\end{quote}
128\begin{quote}
129Code in a block quote:
131\begin{verbatim}
132sub status {
133 print "working";
135\end{verbatim}
137A list:
139\begin{enumerate}
140\def\labelenumi{\arabic{enumi}.}
141\itemsep1pt\parskip0pt\parsep0pt
142\item
143 item one
144\item
145 item two
146\end{enumerate}
148Nested block quotes:
150\begin{quote}
151nested
152\end{quote}
154\begin{quote}
155nested
156\end{quote}
157\end{quote}
159This should not be a block quote: 2 \textgreater{} 1.
161And a following paragraph.
163\begin{center}\rule{3in}{0.4pt}\end{center}
165\section{Code Blocks}\label{code-blocks}
167Code:
169\begin{verbatim}
170---- (should be four hyphens)
172sub status {
173 print "working";
176this code block is indented by one tab
177\end{verbatim}
179And:
181\begin{verbatim}
182 this code block is indented by two tabs
184These should not be escaped: \$ \\ \> \[ \{
185\end{verbatim}
187\begin{center}\rule{3in}{0.4pt}\end{center}
189\section{Lists}\label{lists}
191\subsection{Unordered}\label{unordered}
193Asterisks tight:
195\begin{itemize}
196\itemsep1pt\parskip0pt\parsep0pt
197\item
198 asterisk 1
199\item
200 asterisk 2
201\item
202 asterisk 3
203\end{itemize}
205Asterisks loose:
207\begin{itemize}
208\item
209 asterisk 1
210\item
211 asterisk 2
212\item
213 asterisk 3
214\end{itemize}
216Pluses tight:
218\begin{itemize}
219\itemsep1pt\parskip0pt\parsep0pt
220\item
221 Plus 1
222\item
223 Plus 2
224\item
225 Plus 3
226\end{itemize}
228Pluses loose:
230\begin{itemize}
231\item
232 Plus 1
233\item
234 Plus 2
235\item
236 Plus 3
237\end{itemize}
239Minuses tight:
241\begin{itemize}
242\itemsep1pt\parskip0pt\parsep0pt
243\item
244 Minus 1
245\item
246 Minus 2
247\item
248 Minus 3
249\end{itemize}
251Minuses loose:
253\begin{itemize}
254\item
255 Minus 1
256\item
257 Minus 2
258\item
259 Minus 3
260\end{itemize}
262\subsection{Ordered}\label{ordered}
264Tight:
266\begin{enumerate}
267\def\labelenumi{\arabic{enumi}.}
268\itemsep1pt\parskip0pt\parsep0pt
269\item
270 First
271\item
272 Second
273\item
274 Third
275\end{enumerate}
277and:
279\begin{enumerate}
280\def\labelenumi{\arabic{enumi}.}
281\itemsep1pt\parskip0pt\parsep0pt
282\item
283 One
284\item
285 Two
286\item
287 Three
288\end{enumerate}
290Loose using tabs:
292\begin{enumerate}
293\def\labelenumi{\arabic{enumi}.}
294\item
295 First
296\item
297 Second
298\item
299 Third
300\end{enumerate}
302and using spaces:
304\begin{enumerate}
305\def\labelenumi{\arabic{enumi}.}
306\item
307 One
308\item
309 Two
310\item
311 Three
312\end{enumerate}
314Multiple paragraphs:
316\begin{enumerate}
317\def\labelenumi{\arabic{enumi}.}
318\item
319 Item 1, graf one.
321 Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
322\item
323 Item 2.
324\item
325 Item 3.
326\end{enumerate}
328\subsection{Nested}\label{nested}
330\begin{itemize}
331\itemsep1pt\parskip0pt\parsep0pt
332\item
333 Tab
335 \begin{itemize}
336 \itemsep1pt\parskip0pt\parsep0pt
337 \item
338 Tab
340 \begin{itemize}
341 \itemsep1pt\parskip0pt\parsep0pt
342 \item
343 Tab
344 \end{itemize}
345 \end{itemize}
346\end{itemize}
348Here's another:
350\begin{enumerate}
351\def\labelenumi{\arabic{enumi}.}
352\itemsep1pt\parskip0pt\parsep0pt
353\item
354 First
355\item
356 Second:
358 \begin{itemize}
359 \itemsep1pt\parskip0pt\parsep0pt
360 \item
361 Fee
362 \item
363 Fie
364 \item
365 Foe
366 \end{itemize}
367\item
368 Third
369\end{enumerate}
371Same thing but with paragraphs:
373\begin{enumerate}
374\def\labelenumi{\arabic{enumi}.}
375\item
376 First
377\item
378 Second:
380 \begin{itemize}
381 \itemsep1pt\parskip0pt\parsep0pt
382 \item
383 Fee
384 \item
385 Fie
386 \item
387 Foe
388 \end{itemize}
389\item
390 Third
391\end{enumerate}
393\subsection{Tabs and spaces}\label{tabs-and-spaces}
395\begin{itemize}
396\item
397 this is a list item indented with tabs
398\item
399 this is a list item indented with spaces
401 \begin{itemize}
402 \item
403 this is an example list item indented with tabs
404 \item
405 this is an example list item indented with spaces
406 \end{itemize}
407\end{itemize}
409\subsection{Fancy list markers}\label{fancy-list-markers}
411\begin{enumerate}
412\def\labelenumi{(\arabic{enumi})}
413\setcounter{enumi}{1}
414\item
415 begins with 2
416\item
417 and now 3
419 with a continuation
421 \begin{enumerate}
422 \def\labelenumii{\roman{enumii}.}
423 \setcounter{enumii}{3}
424 \itemsep1pt\parskip0pt\parsep0pt
425 \item
426 sublist with roman numerals, starting with 4
427 \item
428 more items
430 \begin{enumerate}
431 \def\labelenumiii{(\Alph{enumiii})}
432 \itemsep1pt\parskip0pt\parsep0pt
433 \item
434 a subsublist
435 \item
436 a subsublist
437 \end{enumerate}
438 \end{enumerate}
439\end{enumerate}
441Nesting:
443\begin{enumerate}
444\def\labelenumi{\Alph{enumi}.}
445\itemsep1pt\parskip0pt\parsep0pt
446\item
447 Upper Alpha
449 \begin{enumerate}
450 \def\labelenumii{\Roman{enumii}.}
451 \itemsep1pt\parskip0pt\parsep0pt
452 \item
453 Upper Roman.
455 \begin{enumerate}
456 \def\labelenumiii{(\arabic{enumiii})}
457 \setcounter{enumiii}{5}
458 \itemsep1pt\parskip0pt\parsep0pt
459 \item
460 Decimal start with 6
462 \begin{enumerate}
463 \def\labelenumiv{\alph{enumiv})}
464 \setcounter{enumiv}{2}
465 \itemsep1pt\parskip0pt\parsep0pt
466 \item
467 Lower alpha with paren
468 \end{enumerate}
469 \end{enumerate}
470 \end{enumerate}
471\end{enumerate}
473Autonumbering:
475\begin{enumerate}
476\itemsep1pt\parskip0pt\parsep0pt
477\item
478 Autonumber.
479\item
480 More.
482 \begin{enumerate}
483 \itemsep1pt\parskip0pt\parsep0pt
484 \item
485 Nested.
486 \end{enumerate}
487\end{enumerate}
489Should not be a list item:
491M.A.~2007
493B. Williams
495\begin{center}\rule{3in}{0.4pt}\end{center}
497\section{Definition Lists}\label{definition-lists}
499Tight using spaces:
501\begin{description}
502\itemsep1pt\parskip0pt\parsep0pt
503\item[apple]
504red fruit
505\item[orange]
506orange fruit
507\item[banana]
508yellow fruit
509\end{description}
511Tight using tabs:
513\begin{description}
514\itemsep1pt\parskip0pt\parsep0pt
515\item[apple]
516red fruit
517\item[orange]
518orange fruit
519\item[banana]
520yellow fruit
521\end{description}
523Loose:
525\begin{description}
526\item[apple]
527red fruit
528\item[orange]
529orange fruit
530\item[banana]
531yellow fruit
532\end{description}
534Multiple blocks with italics:
536\begin{description}
537\item[\emph{apple}]
538red fruit
540contains seeds, crisp, pleasant to taste
541\item[\emph{orange}]
542orange fruit
544\begin{verbatim}
545{ orange code block }
546\end{verbatim}
548\begin{quote}
549orange block quote
550\end{quote}
551\end{description}
553Multiple definitions, tight:
555\begin{description}
556\itemsep1pt\parskip0pt\parsep0pt
557\item[apple]
558red fruit
560computer
561\item[orange]
562orange fruit
564bank
565\end{description}
567Multiple definitions, loose:
569\begin{description}
570\item[apple]
571red fruit
573computer
574\item[orange]
575orange fruit
577bank
578\end{description}
580Blank line after term, indented marker, alternate markers:
582\begin{description}
583\item[apple]
584red fruit
586computer
587\item[orange]
588orange fruit
590\begin{enumerate}
591\def\labelenumi{\arabic{enumi}.}
592\itemsep1pt\parskip0pt\parsep0pt
593\item
594 sublist
595\item
596 sublist
597\end{enumerate}
598\end{description}
600\section{HTML Blocks}\label{html-blocks}
602Simple block on one line:
604foo
606And nested without indentation:
608foo
610bar
612Interpreted markdown in a table:
614This is \emph{emphasized}
616And this is \textbf{strong}
618Here's a simple block:
620foo
622This should be a code block, though:
624\begin{verbatim}
625<div>
626 foo
627</div>
628\end{verbatim}
630As should this:
632\begin{verbatim}
633<div>foo</div>
634\end{verbatim}
636Now, nested:
638foo
640This should just be an HTML comment:
642Multiline:
644Code block:
646\begin{verbatim}
647<!-- Comment -->
648\end{verbatim}
650Just plain comment, with trailing spaces on the line:
652Code:
654\begin{verbatim}
655<hr />
656\end{verbatim}
658Hr's:
660\begin{center}\rule{3in}{0.4pt}\end{center}
662\section{Inline Markup}\label{inline-markup}
664This is \emph{emphasized}, and so \emph{is this}.
666This is \textbf{strong}, and so \textbf{is this}.
668An \emph{\href{/url}{emphasized link}}.
670\textbf{\emph{This is strong and em.}}
672So is \textbf{\emph{this}} word.
674\textbf{\emph{This is strong and em.}}
676So is \textbf{\emph{this}} word.
678This is code: \texttt{\textgreater{}}, \texttt{\$}, \texttt{\textbackslash{}},
679\texttt{\textbackslash{}\$}, \texttt{\textless{}html\textgreater{}}.
681\sout{This is \emph{strikeout}.}
683Superscripts: a\textsuperscript{bc}d a\textsuperscript{\emph{hello}}
684a\textsuperscript{hello~there}.
686Subscripts: H\textsubscript{2}O, H\textsubscript{23}O,
687H\textsubscript{many~of~them}O.
689These should not be superscripts or subscripts, because of the unescaped
690spaces: a\^{}b c\^{}d, a\textasciitilde{}b c\textasciitilde{}d.
692\begin{center}\rule{3in}{0.4pt}\end{center}
694\section{Smart quotes, ellipses, dashes}\label{smart-quotes-ellipses-dashes}
696``Hello,'' said the spider. ``\,`Shelob' is my name.''
698`A', `B', and `C' are letters.
700`Oak,' `elm,' and `beech' are names of trees. So is `pine.'
702`He said, ``I want to go.''\,' Were you alive in the 70's?
704Here is some quoted `\texttt{code}' and a
705``\href{http://example.com/?foo=1\&bar=2}{quoted link}''.
707Some dashes: one---two --- three---four --- five.
709Dashes between numbers: 5--7, 255--66, 1987--1999.
711Ellipses\ldots{}and\ldots{}and\ldots{}.
713\begin{center}\rule{3in}{0.4pt}\end{center}
715\section{LaTeX}\label{latex}
717\begin{itemize}
718\itemsep1pt\parskip0pt\parsep0pt
719\item
720 \cite[22-23]{smith.1899}
721\item
722 $2+2=4$
723\item
724 $x \in y$
725\item
726 $\alpha \wedge \omega$
727\item
728 $223$
729\item
730 $p$-Tree
731\item
732 Here's some display math:
733 \[\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\]
734\item
735 Here's one that has a line break in it: $\alpha + \omega \times x^2$.
736\end{itemize}
738These shouldn't be math:
740\begin{itemize}
741\itemsep1pt\parskip0pt\parsep0pt
742\item
743 To get the famous equation, write \texttt{\$e = mc\^{}2\$}.
744\item
745 \$22,000 is a \emph{lot} of money. So is \$34,000. (It worked if ``lot'' is
746 emphasized.)
747\item
748 Shoes (\$20) and socks (\$5).
749\item
750 Escaped \texttt{\$}: \$73 \emph{this should be emphasized} 23\$.
751\end{itemize}
753Here's a LaTeX table:
755\begin{tabular}{|l|l|}\hline
756Animal & Number \\ \hline
757Dog & 2 \\
758Cat & 1 \\ \hline
759\end{tabular}
761\begin{center}\rule{3in}{0.4pt}\end{center}
763\section{Special Characters}\label{special-characters}
765Here is some unicode:
767\begin{itemize}
768\itemsep1pt\parskip0pt\parsep0pt
769\item
770 I hat: Î
771\item
772 o umlaut: ö
773\item
774 section: §
775\item
776 set membership: ∈
777\item
778 copyright: ©
779\end{itemize}
781AT\&T has an ampersand in their name.
783AT\&T is another way to write it.
785This \& that.
7874 \textless{} 5.
7896 \textgreater{} 5.
791Backslash: \textbackslash{}
793Backtick: `
795Asterisk: *
797Underscore: \_
799Left brace: \{
801Right brace: \}
803Left bracket: {[}
805Right bracket: {]}
807Left paren: (
809Right paren: )
811Greater-than: \textgreater{}
813Hash: \#
815Period: .
817Bang: !
819Plus: +
821Minus: -
823\begin{center}\rule{3in}{0.4pt}\end{center}
825\section{Links}\label{links}
827\subsection{Explicit}\label{explicit}
829Just a \href{/url/}{URL}.
831\href{/url/}{URL and title}.
833\href{/url/}{URL and title}.
835\href{/url/}{URL and title}.
837\href{/url/}{URL and title}
839\href{/url/}{URL and title}
841\href{/url/with_underscore}{with\_underscore}
843\href{mailto:nobody@nowhere.net}{Email link}
845\href{}{Empty}.
847\subsection{Reference}\label{reference}
849Foo \href{/url/}{bar}.
851Foo \href{/url/}{bar}.
853Foo \href{/url/}{bar}.
855With \href{/url/}{embedded {[}brackets{]}}.
857\href{/url/}{b} by itself should be a link.
859Indented \href{/url}{once}.
861Indented \href{/url}{twice}.
863Indented \href{/url}{thrice}.
865This should {[}not{]}{[}{]} be a link.
867\begin{verbatim}
868[not]: /url
869\end{verbatim}
871Foo \href{/url/}{bar}.
873Foo \href{/url/}{biz}.
875\subsection{With ampersands}\label{with-ampersands}
877Here's a \href{http://example.com/?foo=1\&bar=2}{link with an ampersand in the
878URL}.
880Here's a link with an amersand in the link text:
881\href{http://att.com/}{AT\&T}.
883Here's an \href{/script?foo=1\&bar=2}{inline link}.
885Here's an \href{/script?foo=1\&bar=2}{inline link in pointy braces}.
887\subsection{Autolinks}\label{autolinks}
889With an ampersand: \url{http://example.com/?foo=1\&bar=2}
891\begin{itemize}
892\itemsep1pt\parskip0pt\parsep0pt
893\item
894 In a list?
895\item
896 \url{http://example.com/}
897\item
898 It should.
899\end{itemize}
901An e-mail address: \href{mailto:nobody@nowhere.net}{nobody@nowhere.net}
903\begin{quote}
904Blockquoted: \url{http://example.com/}
905\end{quote}
907Auto-links should not occur here:
908\texttt{\textless{}http://example.com/\textgreater{}}
910\begin{verbatim}
911or here: <http://example.com/>
912\end{verbatim}
914\begin{center}\rule{3in}{0.4pt}\end{center}
916\section{Images}\label{images}
918From ``Voyage dans la Lune'' by Georges Melies (1902):
920\begin{figure}[htbp]
921\centering
922\includegraphics{lalune.jpg}
923\caption{lalune}
924\end{figure}
926Here is a movie \includegraphics{movie.jpg} icon.
928\begin{center}\rule{3in}{0.4pt}\end{center}
930\section{Footnotes}\label{footnotes}
932Here is a footnote reference,\footnote{Here is the footnote. It can go
933 anywhere after the footnote reference. It need not be placed at the end of
934 the document.} and another.\footnote{Here's the long note. This one contains
935 multiple blocks.
937 Subsequent blocks are indented to show that they belong to the footnote (as
938 with list items).
940\begin{Verbatim}
941 { <code> }
942\end{Verbatim}
944 If you want, you can indent every line, but you can also be lazy and just
945 indent the first line of each block.} This should \emph{not} be a footnote
946reference, because it contains a space.{[}\^{}my note{]} Here is an inline
947note.\footnote{This is \emph{easier} to type. Inline notes may contain
948 \href{http://google.com}{links} and \texttt{{]}} verbatim characters, as
949 well as {[}bracketed text{]}.}
951\begin{quote}
952Notes can go in quotes.\footnote{In quote.}
953\end{quote}
955\begin{enumerate}
956\def\labelenumi{\arabic{enumi}.}
957\itemsep1pt\parskip0pt\parsep0pt
958\item
959 And in list items.\footnote{In list.}
960\end{enumerate}
962This paragraph should not be part of the note, as it is not indented.
964\end{document}