git.iko.soy/typeable/pandoc
on 1.15.0.3 help sign in
typeable/pandoc/tests/writer.latex
975 lines 17 kB history raw
1\documentclass[]{article}
2\usepackage{lmodern}
3\usepackage{amssymb,amsmath}
4\usepackage{ifxetex,ifluatex}
5\usepackage{fixltx2e} % provides \textsubscript
6\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
7 \usepackage[T1]{fontenc}
8 \usepackage[utf8]{inputenc}
9\else % if luatex or xelatex
10 \ifxetex
11 \usepackage{mathspec}
12 \usepackage{xltxtra,xunicode}
13 \else
14 \usepackage{fontspec}
15 \fi
16 \defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
17 \newcommand{\euro}{€}
18\fi
19% use upquote if available, for straight quotes in verbatim environments
20\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
21% use microtype if available
22\IfFileExists{microtype.sty}{%
23\usepackage{microtype}
24\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
25}{}
26\ifxetex
27 \usepackage[setpagesize=false, % page size defined by xetex
28 unicode=false, % unicode breaks when used with xetex
29 xetex]{hyperref}
30\else
31 \usepackage[unicode=true]{hyperref}
32\fi
33\usepackage[usenames,dvipsnames]{color}
34\hypersetup{breaklinks=true,
35 bookmarks=true,
36 pdfauthor={John MacFarlane; Anonymous},
37 pdftitle={Pandoc Test Suite},
38 colorlinks=true,
39 citecolor=blue,
40 urlcolor=blue,
41 linkcolor=magenta,
42 pdfborder={0 0 0}}
43\urlstyle{same} % don't use monospace font for urls
44\usepackage{fancyvrb}
45\VerbatimFootnotes
46\usepackage{graphicx,grffile}
47\makeatletter
48\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
49\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
50\makeatother
51% Scale images if necessary, so that they will not overflow the page
52% margins by default, and it is still possible to overwrite the defaults
53% using explicit options in \includegraphics[width, height, ...]{}
54\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
55\usepackage[normalem]{ulem}
56% avoid problems with \sout in headers with hyperref:
57\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
58\setlength{\parindent}{0pt}
59\setlength{\parskip}{6pt plus 2pt minus 1pt}
60\setlength{\emergencystretch}{3em} % prevent overfull lines
61\providecommand{\tightlist}{%
62 \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
63\setcounter{secnumdepth}{0}
64\VerbatimFootnotes % allows verbatim text in footnotes
66\title{Pandoc Test Suite}
67\author{John MacFarlane \and Anonymous}
68\date{July 17, 2006}
70% Redefines (sub)paragraphs to behave more like sections
71\ifx\paragraph\undefined\else
72\let\oldparagraph\paragraph
73\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
74\fi
75\ifx\subparagraph\undefined\else
76\let\oldsubparagraph\subparagraph
77\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
78\fi
80\begin{document}
81\maketitle
83This is a set of tests for pandoc. Most of them are adapted from John Gruber's
84markdown test suite.
86\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
88\section{Headers}\label{headers}
90\subsection{\texorpdfstring{Level 2 with an \href{/url}{embedded
91link}}{Level 2 with an embedded link}}\label{level-2-with-an-embedded-link}
93\subsubsection{\texorpdfstring{Level 3 with
94\emph{emphasis}}{Level 3 with emphasis}}\label{level-3-with-emphasis}
96\paragraph{Level 4}\label{level-4}
98\subparagraph{Level 5}\label{level-5}
100\section{Level 1}\label{level-1}
102\subsection{\texorpdfstring{Level 2 with
103\emph{emphasis}}{Level 2 with emphasis}}\label{level-2-with-emphasis}
105\subsubsection{Level 3}\label{level-3}
107with no blank line
109\subsection{Level 2}\label{level-2}
111with no blank line
113\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
115\section{Paragraphs}\label{paragraphs}
117Here's a regular paragraph.
119In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
120Because a hard-wrapped line in the middle of a paragraph looked like a list
121item.
123Here's one with a bullet. * criminey.
125There should be a hard line break\\
126here.
128\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
130\section{Block Quotes}\label{block-quotes}
132E-mail style:
134\begin{quote}
135This is a block quote. It is pretty short.
136\end{quote}
138\begin{quote}
139Code in a block quote:
141\begin{verbatim}
142sub status {
143 print "working";
145\end{verbatim}
147A list:
149\begin{enumerate}
150\def\labelenumi{\arabic{enumi}.}
151\tightlist
152\item
153 item one
154\item
155 item two
156\end{enumerate}
158Nested block quotes:
160\begin{quote}
161nested
162\end{quote}
164\begin{quote}
165nested
166\end{quote}
167\end{quote}
169This should not be a block quote: 2 \textgreater{} 1.
171And a following paragraph.
173\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
175\section{Code Blocks}\label{code-blocks}
177Code:
179\begin{verbatim}
180---- (should be four hyphens)
182sub status {
183 print "working";
186this code block is indented by one tab
187\end{verbatim}
189And:
191\begin{verbatim}
192 this code block is indented by two tabs
194These should not be escaped: \$ \\ \> \[ \{
195\end{verbatim}
197\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
199\section{Lists}\label{lists}
201\subsection{Unordered}\label{unordered}
203Asterisks tight:
205\begin{itemize}
206\tightlist
207\item
208 asterisk 1
209\item
210 asterisk 2
211\item
212 asterisk 3
213\end{itemize}
215Asterisks loose:
217\begin{itemize}
218\item
219 asterisk 1
220\item
221 asterisk 2
222\item
223 asterisk 3
224\end{itemize}
226Pluses tight:
228\begin{itemize}
229\tightlist
230\item
231 Plus 1
232\item
233 Plus 2
234\item
235 Plus 3
236\end{itemize}
238Pluses loose:
240\begin{itemize}
241\item
242 Plus 1
243\item
244 Plus 2
245\item
246 Plus 3
247\end{itemize}
249Minuses tight:
251\begin{itemize}
252\tightlist
253\item
254 Minus 1
255\item
256 Minus 2
257\item
258 Minus 3
259\end{itemize}
261Minuses loose:
263\begin{itemize}
264\item
265 Minus 1
266\item
267 Minus 2
268\item
269 Minus 3
270\end{itemize}
272\subsection{Ordered}\label{ordered}
274Tight:
276\begin{enumerate}
277\def\labelenumi{\arabic{enumi}.}
278\tightlist
279\item
280 First
281\item
282 Second
283\item
284 Third
285\end{enumerate}
287and:
289\begin{enumerate}
290\def\labelenumi{\arabic{enumi}.}
291\tightlist
292\item
293 One
294\item
295 Two
296\item
297 Three
298\end{enumerate}
300Loose using tabs:
302\begin{enumerate}
303\def\labelenumi{\arabic{enumi}.}
304\item
305 First
306\item
307 Second
308\item
309 Third
310\end{enumerate}
312and using spaces:
314\begin{enumerate}
315\def\labelenumi{\arabic{enumi}.}
316\item
317 One
318\item
319 Two
320\item
321 Three
322\end{enumerate}
324Multiple paragraphs:
326\begin{enumerate}
327\def\labelenumi{\arabic{enumi}.}
328\item
329 Item 1, graf one.
331 Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
332\item
333 Item 2.
334\item
335 Item 3.
336\end{enumerate}
338\subsection{Nested}\label{nested}
340\begin{itemize}
341\tightlist
342\item
343 Tab
345 \begin{itemize}
346 \tightlist
347 \item
348 Tab
350 \begin{itemize}
351 \tightlist
352 \item
353 Tab
354 \end{itemize}
355 \end{itemize}
356\end{itemize}
358Here's another:
360\begin{enumerate}
361\def\labelenumi{\arabic{enumi}.}
362\tightlist
363\item
364 First
365\item
366 Second:
368 \begin{itemize}
369 \tightlist
370 \item
371 Fee
372 \item
373 Fie
374 \item
375 Foe
376 \end{itemize}
377\item
378 Third
379\end{enumerate}
381Same thing but with paragraphs:
383\begin{enumerate}
384\def\labelenumi{\arabic{enumi}.}
385\item
386 First
387\item
388 Second:
390 \begin{itemize}
391 \tightlist
392 \item
393 Fee
394 \item
395 Fie
396 \item
397 Foe
398 \end{itemize}
399\item
400 Third
401\end{enumerate}
403\subsection{Tabs and spaces}\label{tabs-and-spaces}
405\begin{itemize}
406\item
407 this is a list item indented with tabs
408\item
409 this is a list item indented with spaces
411 \begin{itemize}
412 \item
413 this is an example list item indented with tabs
414 \item
415 this is an example list item indented with spaces
416 \end{itemize}
417\end{itemize}
419\subsection{Fancy list markers}\label{fancy-list-markers}
421\begin{enumerate}
422\def\labelenumi{(\arabic{enumi})}
423\setcounter{enumi}{1}
424\item
425 begins with 2
426\item
427 and now 3
429 with a continuation
431 \begin{enumerate}
432 \def\labelenumii{\roman{enumii}.}
433 \setcounter{enumii}{3}
434 \tightlist
435 \item
436 sublist with roman numerals, starting with 4
437 \item
438 more items
440 \begin{enumerate}
441 \def\labelenumiii{(\Alph{enumiii})}
442 \tightlist
443 \item
444 a subsublist
445 \item
446 a subsublist
447 \end{enumerate}
448 \end{enumerate}
449\end{enumerate}
451Nesting:
453\begin{enumerate}
454\def\labelenumi{\Alph{enumi}.}
455\tightlist
456\item
457 Upper Alpha
459 \begin{enumerate}
460 \def\labelenumii{\Roman{enumii}.}
461 \tightlist
462 \item
463 Upper Roman.
465 \begin{enumerate}
466 \def\labelenumiii{(\arabic{enumiii})}
467 \setcounter{enumiii}{5}
468 \tightlist
469 \item
470 Decimal start with 6
472 \begin{enumerate}
473 \def\labelenumiv{\alph{enumiv})}
474 \setcounter{enumiv}{2}
475 \tightlist
476 \item
477 Lower alpha with paren
478 \end{enumerate}
479 \end{enumerate}
480 \end{enumerate}
481\end{enumerate}
483Autonumbering:
485\begin{enumerate}
486\tightlist
487\item
488 Autonumber.
489\item
490 More.
492 \begin{enumerate}
493 \tightlist
494 \item
495 Nested.
496 \end{enumerate}
497\end{enumerate}
499Should not be a list item:
501M.A.~2007
503B. Williams
505\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
507\section{Definition Lists}\label{definition-lists}
509Tight using spaces:
511\begin{description}
512\tightlist
513\item[apple]
514red fruit
515\item[orange]
516orange fruit
517\item[banana]
518yellow fruit
519\end{description}
521Tight using tabs:
523\begin{description}
524\tightlist
525\item[apple]
526red fruit
527\item[orange]
528orange fruit
529\item[banana]
530yellow fruit
531\end{description}
533Loose:
535\begin{description}
536\item[apple]
537red fruit
538\item[orange]
539orange fruit
540\item[banana]
541yellow fruit
542\end{description}
544Multiple blocks with italics:
546\begin{description}
547\item[\emph{apple}]
548red fruit
550contains seeds, crisp, pleasant to taste
551\item[\emph{orange}]
552orange fruit
554\begin{verbatim}
555{ orange code block }
556\end{verbatim}
558\begin{quote}
559orange block quote
560\end{quote}
561\end{description}
563Multiple definitions, tight:
565\begin{description}
566\tightlist
567\item[apple]
568red fruit
570computer
571\item[orange]
572orange fruit
574bank
575\end{description}
577Multiple definitions, loose:
579\begin{description}
580\item[apple]
581red fruit
583computer
584\item[orange]
585orange fruit
587bank
588\end{description}
590Blank line after term, indented marker, alternate markers:
592\begin{description}
593\item[apple]
594red fruit
596computer
597\item[orange]
598orange fruit
600\begin{enumerate}
601\def\labelenumi{\arabic{enumi}.}
602\tightlist
603\item
604 sublist
605\item
606 sublist
607\end{enumerate}
608\end{description}
610\section{HTML Blocks}\label{html-blocks}
612Simple block on one line:
614foo
616And nested without indentation:
618foo
620bar
622Interpreted markdown in a table:
624This is \emph{emphasized}
626And this is \textbf{strong}
628Here's a simple block:
630foo
632This should be a code block, though:
634\begin{verbatim}
635<div>
636 foo
637</div>
638\end{verbatim}
640As should this:
642\begin{verbatim}
643<div>foo</div>
644\end{verbatim}
646Now, nested:
648foo
650This should just be an HTML comment:
652Multiline:
654Code block:
656\begin{verbatim}
657<!-- Comment -->
658\end{verbatim}
660Just plain comment, with trailing spaces on the line:
662Code:
664\begin{verbatim}
665<hr />
666\end{verbatim}
668Hr's:
670\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
672\section{Inline Markup}\label{inline-markup}
674This is \emph{emphasized}, and so \emph{is this}.
676This is \textbf{strong}, and so \textbf{is this}.
678An \emph{\href{/url}{emphasized link}}.
680\textbf{\emph{This is strong and em.}}
682So is \textbf{\emph{this}} word.
684\textbf{\emph{This is strong and em.}}
686So is \textbf{\emph{this}} word.
688This is code: \texttt{\textgreater{}}, \texttt{\$}, \texttt{\textbackslash{}},
689\texttt{\textbackslash{}\$}, \texttt{\textless{}html\textgreater{}}.
691\sout{This is \emph{strikeout}.}
693Superscripts: a\textsuperscript{bc}d a\textsuperscript{\emph{hello}}
694a\textsuperscript{hello~there}.
696Subscripts: H\textsubscript{2}O, H\textsubscript{23}O,
697H\textsubscript{many~of~them}O.
699These should not be superscripts or subscripts, because of the unescaped
700spaces: a\^{}b c\^{}d, a\textasciitilde{}b c\textasciitilde{}d.
702\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
704\section{Smart quotes, ellipses, dashes}\label{smart-quotes-ellipses-dashes}
706``Hello,'' said the spider. ``\,`Shelob' is my name.''
708`A', `B', and `C' are letters.
710`Oak,' `elm,' and `beech' are names of trees. So is `pine.'
712`He said, ``I want to go.''\,' Were you alive in the 70's?
714Here is some quoted `\texttt{code}' and a
715``\href{http://example.com/?foo=1\&bar=2}{quoted link}''.
717Some dashes: one---two --- three---four --- five.
719Dashes between numbers: 5--7, 255--66, 1987--1999.
721Ellipses\ldots{}and\ldots{}and\ldots{}.
723\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
725\section{LaTeX}\label{latex}
727\begin{itemize}
728\tightlist
729\item
730 \cite[22-23]{smith.1899}
731\item
732 \(2+2=4\)
733\item
734 \(x \in y\)
735\item
736 \(\alpha \wedge \omega\)
737\item
738 \(223\)
739\item
740 \(p\)-Tree
741\item
742 Here's some display math:
743 \[\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\]
744\item
745 Here's one that has a line break in it: \(\alpha + \omega \times x^2\).
746\end{itemize}
748These shouldn't be math:
750\begin{itemize}
751\tightlist
752\item
753 To get the famous equation, write \texttt{\$e\ =\ mc\^{}2\$}.
754\item
755 \$22,000 is a \emph{lot} of money. So is \$34,000. (It worked if ``lot'' is
756 emphasized.)
757\item
758 Shoes (\$20) and socks (\$5).
759\item
760 Escaped \texttt{\$}: \$73 \emph{this should be emphasized} 23\$.
761\end{itemize}
763Here's a LaTeX table:
765\begin{tabular}{|l|l|}\hline
766Animal & Number \\ \hline
767Dog & 2 \\
768Cat & 1 \\ \hline
769\end{tabular}
771\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
773\section{Special Characters}\label{special-characters}
775Here is some unicode:
777\begin{itemize}
778\tightlist
779\item
780 I hat: Î
781\item
782 o umlaut: ö
783\item
784 section: §
785\item
786 set membership: ∈
787\item
788 copyright: ©
789\end{itemize}
791AT\&T has an ampersand in their name.
793AT\&T is another way to write it.
795This \& that.
7974 \textless{} 5.
7996 \textgreater{} 5.
801Backslash: \textbackslash{}
803Backtick: `
805Asterisk: *
807Underscore: \_
809Left brace: \{
811Right brace: \}
813Left bracket: {[}
815Right bracket: {]}
817Left paren: (
819Right paren: )
821Greater-than: \textgreater{}
823Hash: \#
825Period: .
827Bang: !
829Plus: +
831Minus: -
833\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
835\section{Links}\label{links}
837\subsection{Explicit}\label{explicit}
839Just a \href{/url/}{URL}.
841\href{/url/}{URL and title}.
843\href{/url/}{URL and title}.
845\href{/url/}{URL and title}.
847\href{/url/}{URL and title}
849\href{/url/}{URL and title}
851\href{/url/with_underscore}{with\_underscore}
853\href{mailto:nobody@nowhere.net}{Email link}
855\href{}{Empty}.
857\subsection{Reference}\label{reference}
859Foo \href{/url/}{bar}.
861Foo \href{/url/}{bar}.
863Foo \href{/url/}{bar}.
865With \href{/url/}{embedded {[}brackets{]}}.
867\href{/url/}{b} by itself should be a link.
869Indented \href{/url}{once}.
871Indented \href{/url}{twice}.
873Indented \href{/url}{thrice}.
875This should {[}not{]}{[}{]} be a link.
877\begin{verbatim}
878[not]: /url
879\end{verbatim}
881Foo \href{/url/}{bar}.
883Foo \href{/url/}{biz}.
885\subsection{With ampersands}\label{with-ampersands}
887Here's a \href{http://example.com/?foo=1\&bar=2}{link with an ampersand in the
888URL}.
890Here's a link with an amersand in the link text:
891\href{http://att.com/}{AT\&T}.
893Here's an \href{/script?foo=1\&bar=2}{inline link}.
895Here's an \href{/script?foo=1\&bar=2}{inline link in pointy braces}.
897\subsection{Autolinks}\label{autolinks}
899With an ampersand: \url{http://example.com/?foo=1\&bar=2}
901\begin{itemize}
902\tightlist
903\item
904 In a list?
905\item
906 \url{http://example.com/}
907\item
908 It should.
909\end{itemize}
911An e-mail address:
912\href{mailto:nobody@nowhere.net}{\nolinkurl{nobody@nowhere.net}}
914\begin{quote}
915Blockquoted: \url{http://example.com/}
916\end{quote}
918Auto-links should not occur here:
919\texttt{\textless{}http://example.com/\textgreater{}}
921\begin{verbatim}
922or here: <http://example.com/>
923\end{verbatim}
925\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
927\section{Images}\label{images}
929From ``Voyage dans la Lune'' by Georges Melies (1902):
931\begin{figure}[htbp]
932\centering
933\includegraphics{lalune.jpg}
934\caption{lalune}
935\end{figure}
937Here is a movie \includegraphics{movie.jpg} icon.
939\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
941\section{Footnotes}\label{footnotes}
943Here is a footnote reference,\footnote{Here is the footnote. It can go
944 anywhere after the footnote reference. It need not be placed at the end of
945 the document.} and another.\footnote{Here's the long note. This one contains
946 multiple blocks.
948 Subsequent blocks are indented to show that they belong to the footnote (as
949 with list items).
951\begin{Verbatim}
952 { <code> }
953\end{Verbatim}
955 If you want, you can indent every line, but you can also be lazy and just
956 indent the first line of each block.} This should \emph{not} be a footnote
957reference, because it contains a space.{[}\^{}my note{]} Here is an inline
958note.\footnote{This is \emph{easier} to type. Inline notes may contain
959 \href{http://google.com}{links} and \texttt{{]}} verbatim characters, as
960 well as {[}bracketed text{]}.}
962\begin{quote}
963Notes can go in quotes.\footnote{In quote.}
964\end{quote}
966\begin{enumerate}
967\def\labelenumi{\arabic{enumi}.}
968\tightlist
969\item
970 And in list items.\footnote{In list.}
971\end{enumerate}
973This paragraph should not be part of the note, as it is not indented.
975\end{document}