git.iko.soy/typeable/pandoc
on 1.14 help sign in
typeable/pandoc/tests/writer.latex
974 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\hypersetup{breaklinks=true,
34 bookmarks=true,
35 pdfauthor={John MacFarlane; Anonymous},
36 pdftitle={Pandoc Test Suite},
37 colorlinks=true,
38 citecolor=blue,
39 urlcolor=blue,
40 linkcolor=magenta,
41 pdfborder={0 0 0}}
42\urlstyle{same} % don't use monospace font for urls
43\usepackage{fancyvrb}
44\VerbatimFootnotes
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{\parindent}{0pt}
58\setlength{\parskip}{6pt plus 2pt minus 1pt}
59\setlength{\emergencystretch}{3em} % prevent overfull lines
60\providecommand{\tightlist}{%
61 \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
62\setcounter{secnumdepth}{0}
63\VerbatimFootnotes % allows verbatim text in footnotes
65\title{Pandoc Test Suite}
66\author{John MacFarlane \and Anonymous}
67\date{July 17, 2006}
69% Redefines (sub)paragraphs to behave more like sections
70\ifx\paragraph\undefined\else
71\let\oldparagraph\paragraph
72\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
73\fi
74\ifx\subparagraph\undefined\else
75\let\oldsubparagraph\subparagraph
76\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
77\fi
79\begin{document}
80\maketitle
82This is a set of tests for pandoc. Most of them are adapted from John Gruber's
83markdown test suite.
85\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
87\section{Headers}\label{headers}
89\subsection{\texorpdfstring{Level 2 with an \href{/url}{embedded
90link}}{Level 2 with an embedded link}}\label{level-2-with-an-embedded-link}
92\subsubsection{\texorpdfstring{Level 3 with
93\emph{emphasis}}{Level 3 with emphasis}}\label{level-3-with-emphasis}
95\paragraph{Level 4}\label{level-4}
97\subparagraph{Level 5}\label{level-5}
99\section{Level 1}\label{level-1}
101\subsection{\texorpdfstring{Level 2 with
102\emph{emphasis}}{Level 2 with emphasis}}\label{level-2-with-emphasis}
104\subsubsection{Level 3}\label{level-3}
106with no blank line
108\subsection{Level 2}\label{level-2}
110with no blank line
112\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
114\section{Paragraphs}\label{paragraphs}
116Here's a regular paragraph.
118In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
119Because a hard-wrapped line in the middle of a paragraph looked like a list
120item.
122Here's one with a bullet. * criminey.
124There should be a hard line break\\
125here.
127\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
129\section{Block Quotes}\label{block-quotes}
131E-mail style:
133\begin{quote}
134This is a block quote. It is pretty short.
135\end{quote}
137\begin{quote}
138Code in a block quote:
140\begin{verbatim}
141sub status {
142 print "working";
144\end{verbatim}
146A list:
148\begin{enumerate}
149\def\labelenumi{\arabic{enumi}.}
150\tightlist
151\item
152 item one
153\item
154 item two
155\end{enumerate}
157Nested block quotes:
159\begin{quote}
160nested
161\end{quote}
163\begin{quote}
164nested
165\end{quote}
166\end{quote}
168This should not be a block quote: 2 \textgreater{} 1.
170And a following paragraph.
172\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
174\section{Code Blocks}\label{code-blocks}
176Code:
178\begin{verbatim}
179---- (should be four hyphens)
181sub status {
182 print "working";
185this code block is indented by one tab
186\end{verbatim}
188And:
190\begin{verbatim}
191 this code block is indented by two tabs
193These should not be escaped: \$ \\ \> \[ \{
194\end{verbatim}
196\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
198\section{Lists}\label{lists}
200\subsection{Unordered}\label{unordered}
202Asterisks tight:
204\begin{itemize}
205\tightlist
206\item
207 asterisk 1
208\item
209 asterisk 2
210\item
211 asterisk 3
212\end{itemize}
214Asterisks loose:
216\begin{itemize}
217\item
218 asterisk 1
219\item
220 asterisk 2
221\item
222 asterisk 3
223\end{itemize}
225Pluses tight:
227\begin{itemize}
228\tightlist
229\item
230 Plus 1
231\item
232 Plus 2
233\item
234 Plus 3
235\end{itemize}
237Pluses loose:
239\begin{itemize}
240\item
241 Plus 1
242\item
243 Plus 2
244\item
245 Plus 3
246\end{itemize}
248Minuses tight:
250\begin{itemize}
251\tightlist
252\item
253 Minus 1
254\item
255 Minus 2
256\item
257 Minus 3
258\end{itemize}
260Minuses loose:
262\begin{itemize}
263\item
264 Minus 1
265\item
266 Minus 2
267\item
268 Minus 3
269\end{itemize}
271\subsection{Ordered}\label{ordered}
273Tight:
275\begin{enumerate}
276\def\labelenumi{\arabic{enumi}.}
277\tightlist
278\item
279 First
280\item
281 Second
282\item
283 Third
284\end{enumerate}
286and:
288\begin{enumerate}
289\def\labelenumi{\arabic{enumi}.}
290\tightlist
291\item
292 One
293\item
294 Two
295\item
296 Three
297\end{enumerate}
299Loose using tabs:
301\begin{enumerate}
302\def\labelenumi{\arabic{enumi}.}
303\item
304 First
305\item
306 Second
307\item
308 Third
309\end{enumerate}
311and using spaces:
313\begin{enumerate}
314\def\labelenumi{\arabic{enumi}.}
315\item
316 One
317\item
318 Two
319\item
320 Three
321\end{enumerate}
323Multiple paragraphs:
325\begin{enumerate}
326\def\labelenumi{\arabic{enumi}.}
327\item
328 Item 1, graf one.
330 Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
331\item
332 Item 2.
333\item
334 Item 3.
335\end{enumerate}
337\subsection{Nested}\label{nested}
339\begin{itemize}
340\tightlist
341\item
342 Tab
344 \begin{itemize}
345 \tightlist
346 \item
347 Tab
349 \begin{itemize}
350 \tightlist
351 \item
352 Tab
353 \end{itemize}
354 \end{itemize}
355\end{itemize}
357Here's another:
359\begin{enumerate}
360\def\labelenumi{\arabic{enumi}.}
361\tightlist
362\item
363 First
364\item
365 Second:
367 \begin{itemize}
368 \tightlist
369 \item
370 Fee
371 \item
372 Fie
373 \item
374 Foe
375 \end{itemize}
376\item
377 Third
378\end{enumerate}
380Same thing but with paragraphs:
382\begin{enumerate}
383\def\labelenumi{\arabic{enumi}.}
384\item
385 First
386\item
387 Second:
389 \begin{itemize}
390 \tightlist
391 \item
392 Fee
393 \item
394 Fie
395 \item
396 Foe
397 \end{itemize}
398\item
399 Third
400\end{enumerate}
402\subsection{Tabs and spaces}\label{tabs-and-spaces}
404\begin{itemize}
405\item
406 this is a list item indented with tabs
407\item
408 this is a list item indented with spaces
410 \begin{itemize}
411 \item
412 this is an example list item indented with tabs
413 \item
414 this is an example list item indented with spaces
415 \end{itemize}
416\end{itemize}
418\subsection{Fancy list markers}\label{fancy-list-markers}
420\begin{enumerate}
421\def\labelenumi{(\arabic{enumi})}
422\setcounter{enumi}{1}
423\item
424 begins with 2
425\item
426 and now 3
428 with a continuation
430 \begin{enumerate}
431 \def\labelenumii{\roman{enumii}.}
432 \setcounter{enumii}{3}
433 \tightlist
434 \item
435 sublist with roman numerals, starting with 4
436 \item
437 more items
439 \begin{enumerate}
440 \def\labelenumiii{(\Alph{enumiii})}
441 \tightlist
442 \item
443 a subsublist
444 \item
445 a subsublist
446 \end{enumerate}
447 \end{enumerate}
448\end{enumerate}
450Nesting:
452\begin{enumerate}
453\def\labelenumi{\Alph{enumi}.}
454\tightlist
455\item
456 Upper Alpha
458 \begin{enumerate}
459 \def\labelenumii{\Roman{enumii}.}
460 \tightlist
461 \item
462 Upper Roman.
464 \begin{enumerate}
465 \def\labelenumiii{(\arabic{enumiii})}
466 \setcounter{enumiii}{5}
467 \tightlist
468 \item
469 Decimal start with 6
471 \begin{enumerate}
472 \def\labelenumiv{\alph{enumiv})}
473 \setcounter{enumiv}{2}
474 \tightlist
475 \item
476 Lower alpha with paren
477 \end{enumerate}
478 \end{enumerate}
479 \end{enumerate}
480\end{enumerate}
482Autonumbering:
484\begin{enumerate}
485\tightlist
486\item
487 Autonumber.
488\item
489 More.
491 \begin{enumerate}
492 \tightlist
493 \item
494 Nested.
495 \end{enumerate}
496\end{enumerate}
498Should not be a list item:
500M.A.~2007
502B. Williams
504\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
506\section{Definition Lists}\label{definition-lists}
508Tight using spaces:
510\begin{description}
511\tightlist
512\item[apple]
513red fruit
514\item[orange]
515orange fruit
516\item[banana]
517yellow fruit
518\end{description}
520Tight using tabs:
522\begin{description}
523\tightlist
524\item[apple]
525red fruit
526\item[orange]
527orange fruit
528\item[banana]
529yellow fruit
530\end{description}
532Loose:
534\begin{description}
535\item[apple]
536red fruit
537\item[orange]
538orange fruit
539\item[banana]
540yellow fruit
541\end{description}
543Multiple blocks with italics:
545\begin{description}
546\item[\emph{apple}]
547red fruit
549contains seeds, crisp, pleasant to taste
550\item[\emph{orange}]
551orange fruit
553\begin{verbatim}
554{ orange code block }
555\end{verbatim}
557\begin{quote}
558orange block quote
559\end{quote}
560\end{description}
562Multiple definitions, tight:
564\begin{description}
565\tightlist
566\item[apple]
567red fruit
569computer
570\item[orange]
571orange fruit
573bank
574\end{description}
576Multiple definitions, loose:
578\begin{description}
579\item[apple]
580red fruit
582computer
583\item[orange]
584orange fruit
586bank
587\end{description}
589Blank line after term, indented marker, alternate markers:
591\begin{description}
592\item[apple]
593red fruit
595computer
596\item[orange]
597orange fruit
599\begin{enumerate}
600\def\labelenumi{\arabic{enumi}.}
601\tightlist
602\item
603 sublist
604\item
605 sublist
606\end{enumerate}
607\end{description}
609\section{HTML Blocks}\label{html-blocks}
611Simple block on one line:
613foo
615And nested without indentation:
617foo
619bar
621Interpreted markdown in a table:
623This is \emph{emphasized}
625And this is \textbf{strong}
627Here's a simple block:
629foo
631This should be a code block, though:
633\begin{verbatim}
634<div>
635 foo
636</div>
637\end{verbatim}
639As should this:
641\begin{verbatim}
642<div>foo</div>
643\end{verbatim}
645Now, nested:
647foo
649This should just be an HTML comment:
651Multiline:
653Code block:
655\begin{verbatim}
656<!-- Comment -->
657\end{verbatim}
659Just plain comment, with trailing spaces on the line:
661Code:
663\begin{verbatim}
664<hr />
665\end{verbatim}
667Hr's:
669\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
671\section{Inline Markup}\label{inline-markup}
673This is \emph{emphasized}, and so \emph{is this}.
675This is \textbf{strong}, and so \textbf{is this}.
677An \emph{\href{/url}{emphasized link}}.
679\textbf{\emph{This is strong and em.}}
681So is \textbf{\emph{this}} word.
683\textbf{\emph{This is strong and em.}}
685So is \textbf{\emph{this}} word.
687This is code: \texttt{\textgreater{}}, \texttt{\$}, \texttt{\textbackslash{}},
688\texttt{\textbackslash{}\$}, \texttt{\textless{}html\textgreater{}}.
690\sout{This is \emph{strikeout}.}
692Superscripts: a\textsuperscript{bc}d a\textsuperscript{\emph{hello}}
693a\textsuperscript{hello~there}.
695Subscripts: H\textsubscript{2}O, H\textsubscript{23}O,
696H\textsubscript{many~of~them}O.
698These should not be superscripts or subscripts, because of the unescaped
699spaces: a\^{}b c\^{}d, a\textasciitilde{}b c\textasciitilde{}d.
701\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
703\section{Smart quotes, ellipses, dashes}\label{smart-quotes-ellipses-dashes}
705``Hello,'' said the spider. ``\,`Shelob' is my name.''
707`A', `B', and `C' are letters.
709`Oak,' `elm,' and `beech' are names of trees. So is `pine.'
711`He said, ``I want to go.''\,' Were you alive in the 70's?
713Here is some quoted `\texttt{code}' and a
714``\href{http://example.com/?foo=1\&bar=2}{quoted link}''.
716Some dashes: one---two --- three---four --- five.
718Dashes between numbers: 5--7, 255--66, 1987--1999.
720Ellipses\ldots{}and\ldots{}and\ldots{}.
722\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
724\section{LaTeX}\label{latex}
726\begin{itemize}
727\tightlist
728\item
729 \cite[22-23]{smith.1899}
730\item
731 \(2+2=4\)
732\item
733 \(x \in y\)
734\item
735 \(\alpha \wedge \omega\)
736\item
737 \(223\)
738\item
739 \(p\)-Tree
740\item
741 Here's some display math:
742 \[\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\]
743\item
744 Here's one that has a line break in it: \(\alpha + \omega \times x^2\).
745\end{itemize}
747These shouldn't be math:
749\begin{itemize}
750\tightlist
751\item
752 To get the famous equation, write \texttt{\$e\ =\ mc\^{}2\$}.
753\item
754 \$22,000 is a \emph{lot} of money. So is \$34,000. (It worked if ``lot'' is
755 emphasized.)
756\item
757 Shoes (\$20) and socks (\$5).
758\item
759 Escaped \texttt{\$}: \$73 \emph{this should be emphasized} 23\$.
760\end{itemize}
762Here's a LaTeX table:
764\begin{tabular}{|l|l|}\hline
765Animal & Number \\ \hline
766Dog & 2 \\
767Cat & 1 \\ \hline
768\end{tabular}
770\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
772\section{Special Characters}\label{special-characters}
774Here is some unicode:
776\begin{itemize}
777\tightlist
778\item
779 I hat: Î
780\item
781 o umlaut: ö
782\item
783 section: §
784\item
785 set membership: ∈
786\item
787 copyright: ©
788\end{itemize}
790AT\&T has an ampersand in their name.
792AT\&T is another way to write it.
794This \& that.
7964 \textless{} 5.
7986 \textgreater{} 5.
800Backslash: \textbackslash{}
802Backtick: `
804Asterisk: *
806Underscore: \_
808Left brace: \{
810Right brace: \}
812Left bracket: {[}
814Right bracket: {]}
816Left paren: (
818Right paren: )
820Greater-than: \textgreater{}
822Hash: \#
824Period: .
826Bang: !
828Plus: +
830Minus: -
832\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
834\section{Links}\label{links}
836\subsection{Explicit}\label{explicit}
838Just a \href{/url/}{URL}.
840\href{/url/}{URL and title}.
842\href{/url/}{URL and title}.
844\href{/url/}{URL and title}.
846\href{/url/}{URL and title}
848\href{/url/}{URL and title}
850\href{/url/with_underscore}{with\_underscore}
852\href{mailto:nobody@nowhere.net}{Email link}
854\href{}{Empty}.
856\subsection{Reference}\label{reference}
858Foo \href{/url/}{bar}.
860Foo \href{/url/}{bar}.
862Foo \href{/url/}{bar}.
864With \href{/url/}{embedded {[}brackets{]}}.
866\href{/url/}{b} by itself should be a link.
868Indented \href{/url}{once}.
870Indented \href{/url}{twice}.
872Indented \href{/url}{thrice}.
874This should {[}not{]}{[}{]} be a link.
876\begin{verbatim}
877[not]: /url
878\end{verbatim}
880Foo \href{/url/}{bar}.
882Foo \href{/url/}{biz}.
884\subsection{With ampersands}\label{with-ampersands}
886Here's a \href{http://example.com/?foo=1\&bar=2}{link with an ampersand in the
887URL}.
889Here's a link with an amersand in the link text:
890\href{http://att.com/}{AT\&T}.
892Here's an \href{/script?foo=1\&bar=2}{inline link}.
894Here's an \href{/script?foo=1\&bar=2}{inline link in pointy braces}.
896\subsection{Autolinks}\label{autolinks}
898With an ampersand: \url{http://example.com/?foo=1\&bar=2}
900\begin{itemize}
901\tightlist
902\item
903 In a list?
904\item
905 \url{http://example.com/}
906\item
907 It should.
908\end{itemize}
910An e-mail address:
911\href{mailto:nobody@nowhere.net}{\nolinkurl{nobody@nowhere.net}}
913\begin{quote}
914Blockquoted: \url{http://example.com/}
915\end{quote}
917Auto-links should not occur here:
918\texttt{\textless{}http://example.com/\textgreater{}}
920\begin{verbatim}
921or here: <http://example.com/>
922\end{verbatim}
924\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
926\section{Images}\label{images}
928From ``Voyage dans la Lune'' by Georges Melies (1902):
930\begin{figure}[htbp]
931\centering
932\includegraphics{lalune.jpg}
933\caption{lalune}
934\end{figure}
936Here is a movie \includegraphics{movie.jpg} icon.
938\begin{center}\rule{0.5\linewidth}{\linethickness}\end{center}
940\section{Footnotes}\label{footnotes}
942Here is a footnote reference,\footnote{Here is the footnote. It can go
943 anywhere after the footnote reference. It need not be placed at the end of
944 the document.} and another.\footnote{Here's the long note. This one contains
945 multiple blocks.
947 Subsequent blocks are indented to show that they belong to the footnote (as
948 with list items).
950\begin{Verbatim}
951 { <code> }
952\end{Verbatim}
954 If you want, you can indent every line, but you can also be lazy and just
955 indent the first line of each block.} This should \emph{not} be a footnote
956reference, because it contains a space.{[}\^{}my note{]} Here is an inline
957note.\footnote{This is \emph{easier} to type. Inline notes may contain
958 \href{http://google.com}{links} and \texttt{{]}} verbatim characters, as
959 well as {[}bracketed text{]}.}
961\begin{quote}
962Notes can go in quotes.\footnote{In quote.}
963\end{quote}
965\begin{enumerate}
966\def\labelenumi{\arabic{enumi}.}
967\tightlist
968\item
969 And in list items.\footnote{In list.}
970\end{enumerate}
972This paragraph should not be part of the note, as it is not indented.
974\end{document}