git.iko.soy/typeable/pandoc
on 2.5 help sign in
typeable/pandoc/test/writer.latex
997 lines 18 kB history raw
1\PassOptionsToPackage{unicode=true}{hyperref} % options for packages loaded elsewhere
2\PassOptionsToPackage{hyphens}{url}
3%
4\documentclass[]{article}
5\usepackage{lmodern}
6\usepackage{amssymb,amsmath}
7\usepackage{ifxetex,ifluatex}
8\usepackage{fixltx2e} % provides \textsubscript
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{Ligatures=TeX,Scale=MatchLowercase}
16\fi
17% use upquote if available, for straight quotes in verbatim environments
18\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
19% use microtype if available
20\IfFileExists{microtype.sty}{%
21\usepackage[]{microtype}
22\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
23}{}
24\IfFileExists{parskip.sty}{%
25\usepackage{parskip}
26}{% else
27\setlength{\parindent}{0pt}
28\setlength{\parskip}{6pt plus 2pt minus 1pt}
30\usepackage{fancyvrb}
31\usepackage{hyperref}
32\hypersetup{
33 pdftitle={Pandoc Test Suite},
34 pdfauthor={John MacFarlane; Anonymous},
35 pdfborder={0 0 0},
36 breaklinks=true}
37\urlstyle{same} % don't use monospace font for urls
38\VerbatimFootnotes % allows verbatim text in footnotes
39\usepackage{graphicx,grffile}
40\makeatletter
41\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
42\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
43\makeatother
44% Scale images if necessary, so that they will not overflow the page
45% margins by default, and it is still possible to overwrite the defaults
46% using explicit options in \includegraphics[width, height, ...]{}
47\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
48\usepackage[normalem]{ulem}
49% avoid problems with \sout in headers with hyperref:
50\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
51\setlength{\emergencystretch}{3em} % prevent overfull lines
52\providecommand{\tightlist}{%
53 \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
54\setcounter{secnumdepth}{0}
55% Redefines (sub)paragraphs to behave more like sections
56\ifx\paragraph\undefined\else
57\let\oldparagraph\paragraph
58\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
59\fi
60\ifx\subparagraph\undefined\else
61\let\oldsubparagraph\subparagraph
62\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
63\fi
65% set default figure placement to htbp
66\makeatletter
67\def\fps@figure{htbp}
68\makeatother
71\title{Pandoc Test Suite}
72\author{John MacFarlane \and Anonymous}
73\date{July 17, 2006}
75\begin{document}
76\maketitle
78This is a set of tests for pandoc. Most of them are adapted from John Gruber's
79markdown test suite.
81\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
83\hypertarget{headers}{%
84\section{Headers}\label{headers}}
86\hypertarget{level-2-with-an-embedded-link}{%
87\subsection{\texorpdfstring{Level 2 with an \href{/url}{embedded
88link}}{Level 2 with an embedded link}}\label{level-2-with-an-embedded-link}}
90\hypertarget{level-3-with-emphasis}{%
91\subsubsection{\texorpdfstring{Level 3 with
92\emph{emphasis}}{Level 3 with emphasis}}\label{level-3-with-emphasis}}
94\hypertarget{level-4}{%
95\paragraph{Level 4}\label{level-4}}
97\hypertarget{level-5}{%
98\subparagraph{Level 5}\label{level-5}}
100\hypertarget{level-1}{%
101\section{Level 1}\label{level-1}}
103\hypertarget{level-2-with-emphasis}{%
104\subsection{\texorpdfstring{Level 2 with
105\emph{emphasis}}{Level 2 with emphasis}}\label{level-2-with-emphasis}}
107\hypertarget{level-3}{%
108\subsubsection{Level 3}\label{level-3}}
110with no blank line
112\hypertarget{level-2}{%
113\subsection{Level 2}\label{level-2}}
115with no blank line
117\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
119\hypertarget{paragraphs}{%
120\section{Paragraphs}\label{paragraphs}}
122Here's a regular paragraph.
124In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
125Because a hard-wrapped line in the middle of a paragraph looked like a list
126item.
128Here's one with a bullet. * criminey.
130There should be a hard line break\\
131here.
133\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
135\hypertarget{block-quotes}{%
136\section{Block Quotes}\label{block-quotes}}
138E-mail style:
140\begin{quote}
141This is a block quote. It is pretty short.
142\end{quote}
144\begin{quote}
145Code in a block quote:
147\begin{verbatim}
148sub status {
149 print "working";
151\end{verbatim}
153A list:
155\begin{enumerate}
156\def\labelenumi{\arabic{enumi}.}
157\tightlist
158\item
159 item one
160\item
161 item two
162\end{enumerate}
164Nested block quotes:
166\begin{quote}
167nested
168\end{quote}
170\begin{quote}
171nested
172\end{quote}
173\end{quote}
175This should not be a block quote: 2 \textgreater{} 1.
177And a following paragraph.
179\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
181\hypertarget{code-blocks}{%
182\section{Code Blocks}\label{code-blocks}}
184Code:
186\begin{verbatim}
187---- (should be four hyphens)
189sub status {
190 print "working";
193this code block is indented by one tab
194\end{verbatim}
196And:
198\begin{verbatim}
199 this code block is indented by two tabs
201These should not be escaped: \$ \\ \> \[ \{
202\end{verbatim}
204\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
206\hypertarget{lists}{%
207\section{Lists}\label{lists}}
209\hypertarget{unordered}{%
210\subsection{Unordered}\label{unordered}}
212Asterisks tight:
214\begin{itemize}
215\tightlist
216\item
217 asterisk 1
218\item
219 asterisk 2
220\item
221 asterisk 3
222\end{itemize}
224Asterisks loose:
226\begin{itemize}
227\item
228 asterisk 1
229\item
230 asterisk 2
231\item
232 asterisk 3
233\end{itemize}
235Pluses tight:
237\begin{itemize}
238\tightlist
239\item
240 Plus 1
241\item
242 Plus 2
243\item
244 Plus 3
245\end{itemize}
247Pluses loose:
249\begin{itemize}
250\item
251 Plus 1
252\item
253 Plus 2
254\item
255 Plus 3
256\end{itemize}
258Minuses tight:
260\begin{itemize}
261\tightlist
262\item
263 Minus 1
264\item
265 Minus 2
266\item
267 Minus 3
268\end{itemize}
270Minuses loose:
272\begin{itemize}
273\item
274 Minus 1
275\item
276 Minus 2
277\item
278 Minus 3
279\end{itemize}
281\hypertarget{ordered}{%
282\subsection{Ordered}\label{ordered}}
284Tight:
286\begin{enumerate}
287\def\labelenumi{\arabic{enumi}.}
288\tightlist
289\item
290 First
291\item
292 Second
293\item
294 Third
295\end{enumerate}
297and:
299\begin{enumerate}
300\def\labelenumi{\arabic{enumi}.}
301\tightlist
302\item
303 One
304\item
305 Two
306\item
307 Three
308\end{enumerate}
310Loose using tabs:
312\begin{enumerate}
313\def\labelenumi{\arabic{enumi}.}
314\item
315 First
316\item
317 Second
318\item
319 Third
320\end{enumerate}
322and using spaces:
324\begin{enumerate}
325\def\labelenumi{\arabic{enumi}.}
326\item
327 One
328\item
329 Two
330\item
331 Three
332\end{enumerate}
334Multiple paragraphs:
336\begin{enumerate}
337\def\labelenumi{\arabic{enumi}.}
338\item
339 Item 1, graf one.
341 Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
342\item
343 Item 2.
344\item
345 Item 3.
346\end{enumerate}
348\hypertarget{nested}{%
349\subsection{Nested}\label{nested}}
351\begin{itemize}
352\tightlist
353\item
354 Tab
356 \begin{itemize}
357 \tightlist
358 \item
359 Tab
361 \begin{itemize}
362 \tightlist
363 \item
364 Tab
365 \end{itemize}
366 \end{itemize}
367\end{itemize}
369Here's another:
371\begin{enumerate}
372\def\labelenumi{\arabic{enumi}.}
373\tightlist
374\item
375 First
376\item
377 Second:
379 \begin{itemize}
380 \tightlist
381 \item
382 Fee
383 \item
384 Fie
385 \item
386 Foe
387 \end{itemize}
388\item
389 Third
390\end{enumerate}
392Same thing but with paragraphs:
394\begin{enumerate}
395\def\labelenumi{\arabic{enumi}.}
396\item
397 First
398\item
399 Second:
401 \begin{itemize}
402 \tightlist
403 \item
404 Fee
405 \item
406 Fie
407 \item
408 Foe
409 \end{itemize}
410\item
411 Third
412\end{enumerate}
414\hypertarget{tabs-and-spaces}{%
415\subsection{Tabs and spaces}\label{tabs-and-spaces}}
417\begin{itemize}
418\item
419 this is a list item indented with tabs
420\item
421 this is a list item indented with spaces
423 \begin{itemize}
424 \item
425 this is an example list item indented with tabs
426 \item
427 this is an example list item indented with spaces
428 \end{itemize}
429\end{itemize}
431\hypertarget{fancy-list-markers}{%
432\subsection{Fancy list markers}\label{fancy-list-markers}}
434\begin{enumerate}
435\def\labelenumi{(\arabic{enumi})}
436\setcounter{enumi}{1}
437\item
438 begins with 2
439\item
440 and now 3
442 with a continuation
444 \begin{enumerate}
445 \def\labelenumii{\roman{enumii}.}
446 \setcounter{enumii}{3}
447 \tightlist
448 \item
449 sublist with roman numerals, starting with 4
450 \item
451 more items
453 \begin{enumerate}
454 \def\labelenumiii{(\Alph{enumiii})}
455 \tightlist
456 \item
457 a subsublist
458 \item
459 a subsublist
460 \end{enumerate}
461 \end{enumerate}
462\end{enumerate}
464Nesting:
466\begin{enumerate}
467\def\labelenumi{\Alph{enumi}.}
468\tightlist
469\item
470 Upper Alpha
472 \begin{enumerate}
473 \def\labelenumii{\Roman{enumii}.}
474 \tightlist
475 \item
476 Upper Roman.
478 \begin{enumerate}
479 \def\labelenumiii{(\arabic{enumiii})}
480 \setcounter{enumiii}{5}
481 \tightlist
482 \item
483 Decimal start with 6
485 \begin{enumerate}
486 \def\labelenumiv{\alph{enumiv})}
487 \setcounter{enumiv}{2}
488 \tightlist
489 \item
490 Lower alpha with paren
491 \end{enumerate}
492 \end{enumerate}
493 \end{enumerate}
494\end{enumerate}
496Autonumbering:
498\begin{enumerate}
499\tightlist
500\item
501 Autonumber.
502\item
503 More.
505 \begin{enumerate}
506 \tightlist
507 \item
508 Nested.
509 \end{enumerate}
510\end{enumerate}
512Should not be a list item:
514M.A.~2007
516B. Williams
518\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
520\hypertarget{definition-lists}{%
521\section{Definition Lists}\label{definition-lists}}
523Tight using spaces:
525\begin{description}
526\tightlist
527\item[apple]
528red fruit
529\item[orange]
530orange fruit
531\item[banana]
532yellow fruit
533\end{description}
535Tight using tabs:
537\begin{description}
538\tightlist
539\item[apple]
540red fruit
541\item[orange]
542orange fruit
543\item[banana]
544yellow fruit
545\end{description}
547Loose:
549\begin{description}
550\item[apple]
551red fruit
552\item[orange]
553orange fruit
554\item[banana]
555yellow fruit
556\end{description}
558Multiple blocks with italics:
560\begin{description}
561\item[\emph{apple}]
562red fruit
564contains seeds, crisp, pleasant to taste
565\item[\emph{orange}]
566orange fruit
568\begin{verbatim}
569{ orange code block }
570\end{verbatim}
572\begin{quote}
573orange block quote
574\end{quote}
575\end{description}
577Multiple definitions, tight:
579\begin{description}
580\tightlist
581\item[apple]
582red fruit
584computer
585\item[orange]
586orange fruit
588bank
589\end{description}
591Multiple definitions, loose:
593\begin{description}
594\item[apple]
595red fruit
597computer
598\item[orange]
599orange fruit
601bank
602\end{description}
604Blank line after term, indented marker, alternate markers:
606\begin{description}
607\item[apple]
608red fruit
610computer
611\item[orange]
612orange fruit
614\begin{enumerate}
615\def\labelenumi{\arabic{enumi}.}
616\tightlist
617\item
618 sublist
619\item
620 sublist
621\end{enumerate}
622\end{description}
624\hypertarget{html-blocks}{%
625\section{HTML Blocks}\label{html-blocks}}
627Simple block on one line:
629foo
631And nested without indentation:
633foo
635bar
637Interpreted markdown in a table:
639This is \emph{emphasized}
641And this is \textbf{strong}
643Here's a simple block:
645foo
647This should be a code block, though:
649\begin{verbatim}
650<div>
651 foo
652</div>
653\end{verbatim}
655As should this:
657\begin{verbatim}
658<div>foo</div>
659\end{verbatim}
661Now, nested:
663foo
665This should just be an HTML comment:
667Multiline:
669Code block:
671\begin{verbatim}
672<!-- Comment -->
673\end{verbatim}
675Just plain comment, with trailing spaces on the line:
677Code:
679\begin{verbatim}
680<hr />
681\end{verbatim}
683Hr's:
685\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
687\hypertarget{inline-markup}{%
688\section{Inline Markup}\label{inline-markup}}
690This is \emph{emphasized}, and so \emph{is this}.
692This is \textbf{strong}, and so \textbf{is this}.
694An \emph{\href{/url}{emphasized link}}.
696\textbf{\emph{This is strong and em.}}
698So is \textbf{\emph{this}} word.
700\textbf{\emph{This is strong and em.}}
702So is \textbf{\emph{this}} word.
704This is code: \texttt{\textgreater{}}, \texttt{\$}, \texttt{\textbackslash{}},
705\texttt{\textbackslash{}\$}, \texttt{\textless{}html\textgreater{}}.
707\sout{This is \emph{strikeout}.}
709Superscripts: a\textsuperscript{bc}d a\textsuperscript{\emph{hello}}
710a\textsuperscript{hello~there}.
712Subscripts: H\textsubscript{2}O, H\textsubscript{23}O,
713H\textsubscript{many~of~them}O.
715These should not be superscripts or subscripts, because of the unescaped
716spaces: a\^{}b c\^{}d, a\textasciitilde{}b c\textasciitilde{}d.
718\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
720\hypertarget{smart-quotes-ellipses-dashes}{%
721\section{Smart quotes, ellipses, dashes}\label{smart-quotes-ellipses-dashes}}
723``Hello,'' said the spider. ``\,`Shelob' is my name.''
725`A', `B', and `C' are letters.
727`Oak,' `elm,' and `beech' are names of trees. So is `pine.'
729`He said, ``I want to go.''\,' Were you alive in the 70's?
731Here is some quoted `\texttt{code}' and a
732``\href{http://example.com/?foo=1\&bar=2}{quoted link}''.
734Some dashes: one---two --- three---four --- five.
736Dashes between numbers: 5--7, 255--66, 1987--1999.
738Ellipses\ldots{}and\ldots{}and\ldots{}.
740\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
742\hypertarget{latex}{%
743\section{LaTeX}\label{latex}}
745\begin{itemize}
746\tightlist
747\item
748 \cite[22-23]{smith.1899}
749\item
750 \(2+2=4\)
751\item
752 \(x \in y\)
753\item
754 \(\alpha \wedge \omega\)
755\item
756 \(223\)
757\item
758 \(p\)-Tree
759\item
760 Here's some display math:
761 \[\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\]
762\item
763 Here's one that has a line break in it: \(\alpha + \omega \times x^2\).
764\end{itemize}
766These shouldn't be math:
768\begin{itemize}
769\tightlist
770\item
771 To get the famous equation, write \texttt{\$e\ =\ mc\^{}2\$}.
772\item
773 \$22,000 is a \emph{lot} of money. So is \$34,000. (It worked if ``lot'' is
774 emphasized.)
775\item
776 Shoes (\$20) and socks (\$5).
777\item
778 Escaped \texttt{\$}: \$73 \emph{this should be emphasized} 23\$.
779\end{itemize}
781Here's a LaTeX table:
783\begin{tabular}{|l|l|}\hline
784Animal & Number \\ \hline
785Dog & 2 \\
786Cat & 1 \\ \hline
787\end{tabular}
789\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
791\hypertarget{special-characters}{%
792\section{Special Characters}\label{special-characters}}
794Here is some unicode:
796\begin{itemize}
797\tightlist
798\item
799 I hat: Î
800\item
801 o umlaut: ö
802\item
803 section: §
804\item
805 set membership: ∈
806\item
807 copyright: ©
808\end{itemize}
810AT\&T has an ampersand in their name.
812AT\&T is another way to write it.
814This \& that.
8164 \textless{} 5.
8186 \textgreater{} 5.
820Backslash: \textbackslash{}
822Backtick: `
824Asterisk: *
826Underscore: \_
828Left brace: \{
830Right brace: \}
832Left bracket: {[}
834Right bracket: {]}
836Left paren: (
838Right paren: )
840Greater-than: \textgreater{}
842Hash: \#
844Period: .
846Bang: !
848Plus: +
850Minus: -
852\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
854\hypertarget{links}{%
855\section{Links}\label{links}}
857\hypertarget{explicit}{%
858\subsection{Explicit}\label{explicit}}
860Just a \href{/url/}{URL}.
862\href{/url/}{URL and title}.
864\href{/url/}{URL and title}.
866\href{/url/}{URL and title}.
868\href{/url/}{URL and title}
870\href{/url/}{URL and title}
872\href{/url/with_underscore}{with\_underscore}
874\href{mailto:nobody@nowhere.net}{Email link}
876\href{}{Empty}.
878\hypertarget{reference}{%
879\subsection{Reference}\label{reference}}
881Foo \href{/url/}{bar}.
883With \href{/url/}{embedded {[}brackets{]}}.
885\href{/url/}{b} by itself should be a link.
887Indented \href{/url}{once}.
889Indented \href{/url}{twice}.
891Indented \href{/url}{thrice}.
893This should {[}not{]}{[}{]} be a link.
895\begin{verbatim}
896[not]: /url
897\end{verbatim}
899Foo \href{/url/}{bar}.
901Foo \href{/url/}{biz}.
903\hypertarget{with-ampersands}{%
904\subsection{With ampersands}\label{with-ampersands}}
906Here's a \href{http://example.com/?foo=1\&bar=2}{link with an ampersand in the
907URL}.
909Here's a link with an amersand in the link text:
910\href{http://att.com/}{AT\&T}.
912Here's an \href{/script?foo=1\&bar=2}{inline link}.
914Here's an \href{/script?foo=1\&bar=2}{inline link in pointy braces}.
916\hypertarget{autolinks}{%
917\subsection{Autolinks}\label{autolinks}}
919With an ampersand: \url{http://example.com/?foo=1\&bar=2}
921\begin{itemize}
922\tightlist
923\item
924 In a list?
925\item
926 \url{http://example.com/}
927\item
928 It should.
929\end{itemize}
931An e-mail address:
932\href{mailto:nobody@nowhere.net}{\nolinkurl{nobody@nowhere.net}}
934\begin{quote}
935Blockquoted: \url{http://example.com/}
936\end{quote}
938Auto-links should not occur here:
939\texttt{\textless{}http://example.com/\textgreater{}}
941\begin{verbatim}
942or here: <http://example.com/>
943\end{verbatim}
945\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
947\hypertarget{images}{%
948\section{Images}\label{images}}
950From ``Voyage dans la Lune'' by Georges Melies (1902):
952\begin{figure}
953\centering
954\includegraphics{lalune.jpg}
955\caption{lalune}
956\end{figure}
958Here is a movie \includegraphics{movie.jpg} icon.
960\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
962\hypertarget{footnotes}{%
963\section{Footnotes}\label{footnotes}}
965Here is a footnote reference,\footnote{Here is the footnote. It can go
966 anywhere after the footnote reference. It need not be placed at the end of
967 the document.} and another.\footnote{Here's the long note. This one contains
968 multiple blocks.
970 Subsequent blocks are indented to show that they belong to the footnote (as
971 with list items).
973\begin{Verbatim}
974 { <code> }
975\end{Verbatim}
977 If you want, you can indent every line, but you can also be lazy and just
978 indent the first line of each block.} This should \emph{not} be a footnote
979reference, because it contains a space.{[}\^{}my note{]} Here is an inline
980note.\footnote{This is \emph{easier} to type. Inline notes may contain
981 \href{http://google.com}{links} and \texttt{{]}} verbatim characters, as
982 well as {[}bracketed text{]}.}
984\begin{quote}
985Notes can go in quotes.\footnote{In quote.}
986\end{quote}
988\begin{enumerate}
989\def\labelenumi{\arabic{enumi}.}
990\tightlist
991\item
992 And in list items.\footnote{In list.}
993\end{enumerate}
995This paragraph should not be part of the note, as it is not indented.
997\end{document}