git.iko.soy/typeable/pandoc
on 2.7 help sign in
typeable/pandoc/test/writer.latex
1003 lines 18 kB history raw
1\PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
2\PassOptionsToPackage{hyphens}{url}
3%
4\documentclass[
5]{article}
6\usepackage{lmodern}
7\usepackage{amssymb,amsmath}
8\usepackage{ifxetex,ifluatex}
9\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
10 \usepackage[T1]{fontenc}
11 \usepackage[utf8]{inputenc}
12 \usepackage{textcomp} % provides euro and other symbols
13\else % if luatex or xelatex
14 \usepackage{unicode-math}
15 \defaultfontfeatures{Scale=MatchLowercase}
16 \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
17\fi
18% use upquote if available, for straight quotes in verbatim environments
19\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
20\IfFileExists{microtype.sty}{% use microtype if available
21 \usepackage[]{microtype}
22 \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
23}{}
24\makeatletter
25\@ifundefined{KOMAClassName}{% if non-KOMA class
26 \IfFileExists{parskip.sty}{%
27 \usepackage{parskip}
28 }{% else
29 \setlength{\parindent}{0pt}
30 \setlength{\parskip}{6pt plus 2pt minus 1pt}}
31}{% if KOMA class
32 \KOMAoptions{parskip=half}}
33\makeatother
34\usepackage{fancyvrb}
35\usepackage{xcolor}
36\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
37\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
38\hypersetup{
39 pdftitle={Pandoc Test Suite},
40 pdfauthor={John MacFarlane; Anonymous},
41 pdfborder={0 0 0},
42 breaklinks=true}
43\urlstyle{same} % don't use monospace font for urls
44\VerbatimFootnotes % allows verbatim text in footnotes
45\usepackage{graphicx,grffile}
46\makeatletter
47\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
48\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
49\makeatother
50% Scale images if necessary, so that they will not overflow the page
51% margins by default, and it is still possible to overwrite the defaults
52% using explicit options in \includegraphics[width, height, ...]{}
53\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
54\usepackage[normalem]{ulem}
55% avoid problems with \sout in headers with hyperref:
56\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
57\setlength{\emergencystretch}{3em} % prevent overfull lines
58\providecommand{\tightlist}{%
59 \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
60\setcounter{secnumdepth}{-2}
61% Redefines (sub)paragraphs to behave more like sections
62\ifx\paragraph\undefined\else
63 \let\oldparagraph\paragraph
64 \renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
65\fi
66\ifx\subparagraph\undefined\else
67 \let\oldsubparagraph\subparagraph
68 \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
69\fi
71% set default figure placement to htbp
72\makeatletter
73\def\fps@figure{htbp}
74\makeatother
77\title{Pandoc Test Suite}
78\author{John MacFarlane \and Anonymous}
79\date{July 17, 2006}
81\begin{document}
82\maketitle
84This is a set of tests for pandoc. Most of them are adapted from John Gruber's
85markdown test suite.
87\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
89\hypertarget{headers}{%
90\section{Headers}\label{headers}}
92\hypertarget{level-2-with-an-embedded-link}{%
93\subsection{\texorpdfstring{Level 2 with an \href{/url}{embedded
94link}}{Level 2 with an embedded link}}\label{level-2-with-an-embedded-link}}
96\hypertarget{level-3-with-emphasis}{%
97\subsubsection{\texorpdfstring{Level 3 with
98\emph{emphasis}}{Level 3 with emphasis}}\label{level-3-with-emphasis}}
100\hypertarget{level-4}{%
101\paragraph{Level 4}\label{level-4}}
103\hypertarget{level-5}{%
104\subparagraph{Level 5}\label{level-5}}
106\hypertarget{level-1}{%
107\section{Level 1}\label{level-1}}
109\hypertarget{level-2-with-emphasis}{%
110\subsection{\texorpdfstring{Level 2 with
111\emph{emphasis}}{Level 2 with emphasis}}\label{level-2-with-emphasis}}
113\hypertarget{level-3}{%
114\subsubsection{Level 3}\label{level-3}}
116with no blank line
118\hypertarget{level-2}{%
119\subsection{Level 2}\label{level-2}}
121with no blank line
123\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
125\hypertarget{paragraphs}{%
126\section{Paragraphs}\label{paragraphs}}
128Here's a regular paragraph.
130In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
131Because a hard-wrapped line in the middle of a paragraph looked like a list
132item.
134Here's one with a bullet. * criminey.
136There should be a hard line break\\
137here.
139\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
141\hypertarget{block-quotes}{%
142\section{Block Quotes}\label{block-quotes}}
144E-mail style:
146\begin{quote}
147This is a block quote. It is pretty short.
148\end{quote}
150\begin{quote}
151Code in a block quote:
153\begin{verbatim}
154sub status {
155 print "working";
157\end{verbatim}
159A list:
161\begin{enumerate}
162\def\labelenumi{\arabic{enumi}.}
163\tightlist
164\item
165 item one
166\item
167 item two
168\end{enumerate}
170Nested block quotes:
172\begin{quote}
173nested
174\end{quote}
176\begin{quote}
177nested
178\end{quote}
179\end{quote}
181This should not be a block quote: 2 \textgreater{} 1.
183And a following paragraph.
185\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
187\hypertarget{code-blocks}{%
188\section{Code Blocks}\label{code-blocks}}
190Code:
192\begin{verbatim}
193---- (should be four hyphens)
195sub status {
196 print "working";
199this code block is indented by one tab
200\end{verbatim}
202And:
204\begin{verbatim}
205 this code block is indented by two tabs
207These should not be escaped: \$ \\ \> \[ \{
208\end{verbatim}
210\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
212\hypertarget{lists}{%
213\section{Lists}\label{lists}}
215\hypertarget{unordered}{%
216\subsection{Unordered}\label{unordered}}
218Asterisks tight:
220\begin{itemize}
221\tightlist
222\item
223 asterisk 1
224\item
225 asterisk 2
226\item
227 asterisk 3
228\end{itemize}
230Asterisks loose:
232\begin{itemize}
233\item
234 asterisk 1
235\item
236 asterisk 2
237\item
238 asterisk 3
239\end{itemize}
241Pluses tight:
243\begin{itemize}
244\tightlist
245\item
246 Plus 1
247\item
248 Plus 2
249\item
250 Plus 3
251\end{itemize}
253Pluses loose:
255\begin{itemize}
256\item
257 Plus 1
258\item
259 Plus 2
260\item
261 Plus 3
262\end{itemize}
264Minuses tight:
266\begin{itemize}
267\tightlist
268\item
269 Minus 1
270\item
271 Minus 2
272\item
273 Minus 3
274\end{itemize}
276Minuses loose:
278\begin{itemize}
279\item
280 Minus 1
281\item
282 Minus 2
283\item
284 Minus 3
285\end{itemize}
287\hypertarget{ordered}{%
288\subsection{Ordered}\label{ordered}}
290Tight:
292\begin{enumerate}
293\def\labelenumi{\arabic{enumi}.}
294\tightlist
295\item
296 First
297\item
298 Second
299\item
300 Third
301\end{enumerate}
303and:
305\begin{enumerate}
306\def\labelenumi{\arabic{enumi}.}
307\tightlist
308\item
309 One
310\item
311 Two
312\item
313 Three
314\end{enumerate}
316Loose using tabs:
318\begin{enumerate}
319\def\labelenumi{\arabic{enumi}.}
320\item
321 First
322\item
323 Second
324\item
325 Third
326\end{enumerate}
328and using spaces:
330\begin{enumerate}
331\def\labelenumi{\arabic{enumi}.}
332\item
333 One
334\item
335 Two
336\item
337 Three
338\end{enumerate}
340Multiple paragraphs:
342\begin{enumerate}
343\def\labelenumi{\arabic{enumi}.}
344\item
345 Item 1, graf one.
347 Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
348\item
349 Item 2.
350\item
351 Item 3.
352\end{enumerate}
354\hypertarget{nested}{%
355\subsection{Nested}\label{nested}}
357\begin{itemize}
358\tightlist
359\item
360 Tab
362 \begin{itemize}
363 \tightlist
364 \item
365 Tab
367 \begin{itemize}
368 \tightlist
369 \item
370 Tab
371 \end{itemize}
372 \end{itemize}
373\end{itemize}
375Here's another:
377\begin{enumerate}
378\def\labelenumi{\arabic{enumi}.}
379\tightlist
380\item
381 First
382\item
383 Second:
385 \begin{itemize}
386 \tightlist
387 \item
388 Fee
389 \item
390 Fie
391 \item
392 Foe
393 \end{itemize}
394\item
395 Third
396\end{enumerate}
398Same thing but with paragraphs:
400\begin{enumerate}
401\def\labelenumi{\arabic{enumi}.}
402\item
403 First
404\item
405 Second:
407 \begin{itemize}
408 \tightlist
409 \item
410 Fee
411 \item
412 Fie
413 \item
414 Foe
415 \end{itemize}
416\item
417 Third
418\end{enumerate}
420\hypertarget{tabs-and-spaces}{%
421\subsection{Tabs and spaces}\label{tabs-and-spaces}}
423\begin{itemize}
424\item
425 this is a list item indented with tabs
426\item
427 this is a list item indented with spaces
429 \begin{itemize}
430 \item
431 this is an example list item indented with tabs
432 \item
433 this is an example list item indented with spaces
434 \end{itemize}
435\end{itemize}
437\hypertarget{fancy-list-markers}{%
438\subsection{Fancy list markers}\label{fancy-list-markers}}
440\begin{enumerate}
441\def\labelenumi{(\arabic{enumi})}
442\setcounter{enumi}{1}
443\item
444 begins with 2
445\item
446 and now 3
448 with a continuation
450 \begin{enumerate}
451 \def\labelenumii{\roman{enumii}.}
452 \setcounter{enumii}{3}
453 \tightlist
454 \item
455 sublist with roman numerals, starting with 4
456 \item
457 more items
459 \begin{enumerate}
460 \def\labelenumiii{(\Alph{enumiii})}
461 \tightlist
462 \item
463 a subsublist
464 \item
465 a subsublist
466 \end{enumerate}
467 \end{enumerate}
468\end{enumerate}
470Nesting:
472\begin{enumerate}
473\def\labelenumi{\Alph{enumi}.}
474\tightlist
475\item
476 Upper Alpha
478 \begin{enumerate}
479 \def\labelenumii{\Roman{enumii}.}
480 \tightlist
481 \item
482 Upper Roman.
484 \begin{enumerate}
485 \def\labelenumiii{(\arabic{enumiii})}
486 \setcounter{enumiii}{5}
487 \tightlist
488 \item
489 Decimal start with 6
491 \begin{enumerate}
492 \def\labelenumiv{\alph{enumiv})}
493 \setcounter{enumiv}{2}
494 \tightlist
495 \item
496 Lower alpha with paren
497 \end{enumerate}
498 \end{enumerate}
499 \end{enumerate}
500\end{enumerate}
502Autonumbering:
504\begin{enumerate}
505\tightlist
506\item
507 Autonumber.
508\item
509 More.
511 \begin{enumerate}
512 \tightlist
513 \item
514 Nested.
515 \end{enumerate}
516\end{enumerate}
518Should not be a list item:
520M.A.~2007
522B. Williams
524\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
526\hypertarget{definition-lists}{%
527\section{Definition Lists}\label{definition-lists}}
529Tight using spaces:
531\begin{description}
532\tightlist
533\item[apple]
534red fruit
535\item[orange]
536orange fruit
537\item[banana]
538yellow fruit
539\end{description}
541Tight using tabs:
543\begin{description}
544\tightlist
545\item[apple]
546red fruit
547\item[orange]
548orange fruit
549\item[banana]
550yellow fruit
551\end{description}
553Loose:
555\begin{description}
556\item[apple]
557red fruit
558\item[orange]
559orange fruit
560\item[banana]
561yellow fruit
562\end{description}
564Multiple blocks with italics:
566\begin{description}
567\item[\emph{apple}]
568red fruit
570contains seeds, crisp, pleasant to taste
571\item[\emph{orange}]
572orange fruit
574\begin{verbatim}
575{ orange code block }
576\end{verbatim}
578\begin{quote}
579orange block quote
580\end{quote}
581\end{description}
583Multiple definitions, tight:
585\begin{description}
586\tightlist
587\item[apple]
588red fruit
590computer
591\item[orange]
592orange fruit
594bank
595\end{description}
597Multiple definitions, loose:
599\begin{description}
600\item[apple]
601red fruit
603computer
604\item[orange]
605orange fruit
607bank
608\end{description}
610Blank line after term, indented marker, alternate markers:
612\begin{description}
613\item[apple]
614red fruit
616computer
617\item[orange]
618orange fruit
620\begin{enumerate}
621\def\labelenumi{\arabic{enumi}.}
622\tightlist
623\item
624 sublist
625\item
626 sublist
627\end{enumerate}
628\end{description}
630\hypertarget{html-blocks}{%
631\section{HTML Blocks}\label{html-blocks}}
633Simple block on one line:
635foo
637And nested without indentation:
639foo
641bar
643Interpreted markdown in a table:
645This is \emph{emphasized}
647And this is \textbf{strong}
649Here's a simple block:
651foo
653This should be a code block, though:
655\begin{verbatim}
656<div>
657 foo
658</div>
659\end{verbatim}
661As should this:
663\begin{verbatim}
664<div>foo</div>
665\end{verbatim}
667Now, nested:
669foo
671This should just be an HTML comment:
673Multiline:
675Code block:
677\begin{verbatim}
678<!-- Comment -->
679\end{verbatim}
681Just plain comment, with trailing spaces on the line:
683Code:
685\begin{verbatim}
686<hr />
687\end{verbatim}
689Hr's:
691\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
693\hypertarget{inline-markup}{%
694\section{Inline Markup}\label{inline-markup}}
696This is \emph{emphasized}, and so \emph{is this}.
698This is \textbf{strong}, and so \textbf{is this}.
700An \emph{\href{/url}{emphasized link}}.
702\textbf{\emph{This is strong and em.}}
704So is \textbf{\emph{this}} word.
706\textbf{\emph{This is strong and em.}}
708So is \textbf{\emph{this}} word.
710This is code: \texttt{\textgreater{}}, \texttt{\$}, \texttt{\textbackslash{}},
711\texttt{\textbackslash{}\$}, \texttt{\textless{}html\textgreater{}}.
713\sout{This is \emph{strikeout}.}
715Superscripts: a\textsuperscript{bc}d a\textsuperscript{\emph{hello}}
716a\textsuperscript{hello~there}.
718Subscripts: H\textsubscript{2}O, H\textsubscript{23}O,
719H\textsubscript{many~of~them}O.
721These should not be superscripts or subscripts, because of the unescaped
722spaces: a\^{}b c\^{}d, a\textasciitilde b c\textasciitilde d.
724\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
726\hypertarget{smart-quotes-ellipses-dashes}{%
727\section{Smart quotes, ellipses, dashes}\label{smart-quotes-ellipses-dashes}}
729``Hello,'' said the spider. ``\,`Shelob' is my name.''
731`A', `B', and `C' are letters.
733`Oak,' `elm,' and `beech' are names of trees. So is `pine.'
735`He said, ``I want to go.''\,' Were you alive in the 70's?
737Here is some quoted `\texttt{code}' and a
738``\href{http://example.com/?foo=1\&bar=2}{quoted link}''.
740Some dashes: one---two --- three---four --- five.
742Dashes between numbers: 5--7, 255--66, 1987--1999.
744Ellipses\ldots and\ldots and\ldots.
746\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
748\hypertarget{latex}{%
749\section{LaTeX}\label{latex}}
751\begin{itemize}
752\tightlist
753\item
754 \cite[22-23]{smith.1899}
755\item
756 \(2+2=4\)
757\item
758 \(x \in y\)
759\item
760 \(\alpha \wedge \omega\)
761\item
762 \(223\)
763\item
764 \(p\)-Tree
765\item
766 Here's some display math:
767 \[\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\]
768\item
769 Here's one that has a line break in it: \(\alpha + \omega \times x^2\).
770\end{itemize}
772These shouldn't be math:
774\begin{itemize}
775\tightlist
776\item
777 To get the famous equation, write \texttt{\$e\ =\ mc\^{}2\$}.
778\item
779 \$22,000 is a \emph{lot} of money. So is \$34,000. (It worked if ``lot'' is
780 emphasized.)
781\item
782 Shoes (\$20) and socks (\$5).
783\item
784 Escaped \texttt{\$}: \$73 \emph{this should be emphasized} 23\$.
785\end{itemize}
787Here's a LaTeX table:
789\begin{tabular}{|l|l|}\hline
790Animal & Number \\ \hline
791Dog & 2 \\
792Cat & 1 \\ \hline
793\end{tabular}
795\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
797\hypertarget{special-characters}{%
798\section{Special Characters}\label{special-characters}}
800Here is some unicode:
802\begin{itemize}
803\tightlist
804\item
805 I hat: Î
806\item
807 o umlaut: ö
808\item
809 section: §
810\item
811 set membership: ∈
812\item
813 copyright: ©
814\end{itemize}
816AT\&T has an ampersand in their name.
818AT\&T is another way to write it.
820This \& that.
8224 \textless{} 5.
8246 \textgreater{} 5.
826Backslash: \textbackslash{}
828Backtick: `
830Asterisk: *
832Underscore: \_
834Left brace: \{
836Right brace: \}
838Left bracket: {[}
840Right bracket: {]}
842Left paren: (
844Right paren: )
846Greater-than: \textgreater{}
848Hash: \#
850Period: .
852Bang: !
854Plus: +
856Minus: -
858\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
860\hypertarget{links}{%
861\section{Links}\label{links}}
863\hypertarget{explicit}{%
864\subsection{Explicit}\label{explicit}}
866Just a \href{/url/}{URL}.
868\href{/url/}{URL and title}.
870\href{/url/}{URL and title}.
872\href{/url/}{URL and title}.
874\href{/url/}{URL and title}
876\href{/url/}{URL and title}
878\href{/url/with_underscore}{with\_underscore}
880\href{mailto:nobody@nowhere.net}{Email link}
882\href{}{Empty}.
884\hypertarget{reference}{%
885\subsection{Reference}\label{reference}}
887Foo \href{/url/}{bar}.
889With \href{/url/}{embedded {[}brackets{]}}.
891\href{/url/}{b} by itself should be a link.
893Indented \href{/url}{once}.
895Indented \href{/url}{twice}.
897Indented \href{/url}{thrice}.
899This should {[}not{]}{[}{]} be a link.
901\begin{verbatim}
902[not]: /url
903\end{verbatim}
905Foo \href{/url/}{bar}.
907Foo \href{/url/}{biz}.
909\hypertarget{with-ampersands}{%
910\subsection{With ampersands}\label{with-ampersands}}
912Here's a \href{http://example.com/?foo=1\&bar=2}{link with an ampersand in the
913URL}.
915Here's a link with an amersand in the link text:
916\href{http://att.com/}{AT\&T}.
918Here's an \href{/script?foo=1\&bar=2}{inline link}.
920Here's an \href{/script?foo=1\&bar=2}{inline link in pointy braces}.
922\hypertarget{autolinks}{%
923\subsection{Autolinks}\label{autolinks}}
925With an ampersand: \url{http://example.com/?foo=1\&bar=2}
927\begin{itemize}
928\tightlist
929\item
930 In a list?
931\item
932 \url{http://example.com/}
933\item
934 It should.
935\end{itemize}
937An e-mail address:
938\href{mailto:nobody@nowhere.net}{\nolinkurl{nobody@nowhere.net}}
940\begin{quote}
941Blockquoted: \url{http://example.com/}
942\end{quote}
944Auto-links should not occur here:
945\texttt{\textless{}http://example.com/\textgreater{}}
947\begin{verbatim}
948or here: <http://example.com/>
949\end{verbatim}
951\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
953\hypertarget{images}{%
954\section{Images}\label{images}}
956From ``Voyage dans la Lune'' by Georges Melies (1902):
958\begin{figure}
959\centering
960\includegraphics{lalune.jpg}
961\caption{lalune}
962\end{figure}
964Here is a movie \includegraphics{movie.jpg} icon.
966\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
968\hypertarget{footnotes}{%
969\section{Footnotes}\label{footnotes}}
971Here is a footnote reference,\footnote{Here is the footnote. It can go
972 anywhere after the footnote reference. It need not be placed at the end of
973 the document.} and another.\footnote{Here's the long note. This one contains
974 multiple blocks.
976 Subsequent blocks are indented to show that they belong to the footnote (as
977 with list items).
979\begin{Verbatim}
980 { <code> }
981\end{Verbatim}
983 If you want, you can indent every line, but you can also be lazy and just
984 indent the first line of each block.} This should \emph{not} be a footnote
985reference, because it contains a space.{[}\^{}my note{]} Here is an inline
986note.\footnote{This is \emph{easier} to type. Inline notes may contain
987 \href{http://google.com}{links} and \texttt{{]}} verbatim characters, as
988 well as {[}bracketed text{]}.}
990\begin{quote}
991Notes can go in quotes.\footnote{In quote.}
992\end{quote}
994\begin{enumerate}
995\def\labelenumi{\arabic{enumi}.}
996\tightlist
997\item
998 And in list items.\footnote{In list.}
999\end{enumerate}
1001This paragraph should not be part of the note, as it is not indented.
1003\end{document}