git.iko.soy/typeable/pandoc
on 1.8 help sign in
typeable/pandoc/tests/writer.latex
831 lines 14 kB history raw
1\documentclass{article}
2\usepackage{amssymb,amsmath}
3\usepackage[mathletters]{ucs}
4\usepackage[utf8x]{inputenc}
5\usepackage{fancyvrb}
6% Redefine labelwidth for lists; otherwise, the enumerate package will cause
7% markers to extend beyond the left margin.
8\makeatletter\AtBeginDocument{%
9 \renewcommand{\@listi}
10 {\setlength{\labelwidth}{4em}}
11}\makeatother
12\usepackage{enumerate}
13\usepackage[normalem]{ulem}
14% avoid problems with \sout in headers with hyperref:
15\pdfstringdefDisableCommands{\renewcommand{\sout}{}}
16\newcommand{\textsubscr}[1]{\ensuremath{_{\scriptsize\textrm{#1}}}}
17\usepackage{url}
18\usepackage{graphicx}
19% We will generate all images so they have a width \maxwidth. This means
20% that they will get their normal width if they fit onto the page, but
21% are scaled down if they would overflow the margins.
22\makeatletter
23\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth
24\else\Gin@nat@width\fi}
25\makeatother
26\let\Oldincludegraphics\includegraphics
27\renewcommand{\includegraphics}[1]{\Oldincludegraphics[width=\maxwidth]{#1}}
28\usepackage[breaklinks=true,unicode=true,pdfborder={0 0 0}]{hyperref}
29\setlength{\parindent}{0pt}
30\setlength{\parskip}{6pt plus 2pt minus 1pt}
31\setcounter{secnumdepth}{0}
32\VerbatimFootnotes % allows verbatim text in footnotes
34\title{Pandoc Test Suite}
35\author{John MacFarlane\\Anonymous}
36\date{July 17, 2006}
38\begin{document}
39\maketitle
41This is a set of tests for pandoc. Most of them are adapted from John Gruber's
42markdown test suite.
44\begin{center}\rule{3in}{0.4pt}\end{center}
46\section{Headers}
48\subsection{Level 2 with an \href{/url}{embedded link}}
50\subsubsection{Level 3 with \emph{emphasis}}
52\paragraph{Level 4}
54\subparagraph{Level 5}
56\section{Level 1}
58\subsection{Level 2 with \emph{emphasis}}
60\subsubsection{Level 3}
62with no blank line
64\subsection{Level 2}
66with no blank line
68\begin{center}\rule{3in}{0.4pt}\end{center}
70\section{Paragraphs}
72Here's a regular paragraph.
74In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item.
75Because a hard-wrapped line in the middle of a paragraph looked like a list
76item.
78Here's one with a bullet. * criminey.
80There should be a hard line break\\here.
82\begin{center}\rule{3in}{0.4pt}\end{center}
84\section{Block Quotes}
86E-mail style:
88\begin{quote}
89This is a block quote. It is pretty short.
91\end{quote}
92\begin{quote}
93Code in a block quote:
95\begin{verbatim}
96sub status {
97 print "working";
99\end{verbatim}
100A list:
102\begin{enumerate}[1.]
103\item
104 item one
105\item
106 item two
107\end{enumerate}
108Nested block quotes:
110\begin{quote}
111nested
113\end{quote}
114\begin{quote}
115nested
117\end{quote}
118\end{quote}
119This should not be a block quote: 2 \textgreater{} 1.
121And a following paragraph.
123\begin{center}\rule{3in}{0.4pt}\end{center}
125\section{Code Blocks}
127Code:
129\begin{verbatim}
130---- (should be four hyphens)
132sub status {
133 print "working";
136this code block is indented by one tab
137\end{verbatim}
138And:
140\begin{verbatim}
141 this code block is indented by two tabs
143These should not be escaped: \$ \\ \> \[ \{
144\end{verbatim}
145\begin{center}\rule{3in}{0.4pt}\end{center}
147\section{Lists}
149\subsection{Unordered}
151Asterisks tight:
153\begin{itemize}
154\item
155 asterisk 1
156\item
157 asterisk 2
158\item
159 asterisk 3
160\end{itemize}
161Asterisks loose:
163\begin{itemize}
164\item
165 asterisk 1
166\item
167 asterisk 2
168\item
169 asterisk 3
170\end{itemize}
171Pluses tight:
173\begin{itemize}
174\item
175 Plus 1
176\item
177 Plus 2
178\item
179 Plus 3
180\end{itemize}
181Pluses loose:
183\begin{itemize}
184\item
185 Plus 1
186\item
187 Plus 2
188\item
189 Plus 3
190\end{itemize}
191Minuses tight:
193\begin{itemize}
194\item
195 Minus 1
196\item
197 Minus 2
198\item
199 Minus 3
200\end{itemize}
201Minuses loose:
203\begin{itemize}
204\item
205 Minus 1
206\item
207 Minus 2
208\item
209 Minus 3
210\end{itemize}
211\subsection{Ordered}
213Tight:
215\begin{enumerate}[1.]
216\item
217 First
218\item
219 Second
220\item
221 Third
222\end{enumerate}
223and:
225\begin{enumerate}[1.]
226\item
227 One
228\item
229 Two
230\item
231 Three
232\end{enumerate}
233Loose using tabs:
235\begin{enumerate}[1.]
236\item
237 First
238\item
239 Second
240\item
241 Third
242\end{enumerate}
243and using spaces:
245\begin{enumerate}[1.]
246\item
247 One
248\item
249 Two
250\item
251 Three
252\end{enumerate}
253Multiple paragraphs:
255\begin{enumerate}[1.]
256\item
257 Item 1, graf one.
259 Item 1. graf two. The quick brown fox jumped over the lazy dog's back.
260\item
261 Item 2.
262\item
263 Item 3.
264\end{enumerate}
265\subsection{Nested}
267\begin{itemize}
268\item
269 Tab
270 \begin{itemize}
271 \item
272 Tab
273 \begin{itemize}
274 \item
275 Tab
276 \end{itemize}
277 \end{itemize}
278\end{itemize}
279Here's another:
281\begin{enumerate}[1.]
282\item
283 First
284\item
285 Second:
286 \begin{itemize}
287 \item
288 Fee
289 \item
290 Fie
291 \item
292 Foe
293 \end{itemize}
294\item
295 Third
296\end{enumerate}
297Same thing but with paragraphs:
299\begin{enumerate}[1.]
300\item
301 First
302\item
303 Second:
305 \begin{itemize}
306 \item
307 Fee
308 \item
309 Fie
310 \item
311 Foe
312 \end{itemize}
313\item
314 Third
315\end{enumerate}
316\subsection{Tabs and spaces}
318\begin{itemize}
319\item
320 this is a list item indented with tabs
321\item
322 this is a list item indented with spaces
324 \begin{itemize}
325 \item
326 this is an example list item indented with tabs
327 \item
328 this is an example list item indented with spaces
329 \end{itemize}
330\end{itemize}
331\subsection{Fancy list markers}
333\begin{enumerate}[(1)]
334\setcounter{enumi}{1}
335\item
336 begins with 2
337\item
338 and now 3
340 with a continuation
342 \begin{enumerate}[i.]
343 \setcounter{enumii}{3}
344 \item
345 sublist with roman numerals, starting with 4
346 \item
347 more items
348 \begin{enumerate}[(A)]
349 \item
350 a subsublist
351 \item
352 a subsublist
353 \end{enumerate}
354 \end{enumerate}
355\end{enumerate}
356Nesting:
358\begin{enumerate}[A.]
359\item
360 Upper Alpha
361 \begin{enumerate}[I.]
362 \item
363 Upper Roman.
364 \begin{enumerate}[(1)]
365 \setcounter{enumiii}{5}
366 \item
367 Decimal start with 6
368 \begin{enumerate}[a)]
369 \setcounter{enumiv}{2}
370 \item
371 Lower alpha with paren
372 \end{enumerate}
373 \end{enumerate}
374 \end{enumerate}
375\end{enumerate}
376Autonumbering:
378\begin{enumerate}
379\item
380 Autonumber.
381\item
382 More.
383 \begin{enumerate}
384 \item
385 Nested.
386 \end{enumerate}
387\end{enumerate}
388Should not be a list item:
390M.A.~2007
392B. Williams
394\begin{center}\rule{3in}{0.4pt}\end{center}
396\section{Definition Lists}
398Tight using spaces:
400\begin{description}
401\item[apple]
402red fruit
403\item[orange]
404orange fruit
405\item[banana]
406yellow fruit
407\end{description}
408Tight using tabs:
410\begin{description}
411\item[apple]
412red fruit
413\item[orange]
414orange fruit
415\item[banana]
416yellow fruit
417\end{description}
418Loose:
420\begin{description}
421\item[apple]
422red fruit
424\item[orange]
425orange fruit
427\item[banana]
428yellow fruit
430\end{description}
431Multiple blocks with italics:
433\begin{description}
434\item[\emph{apple}]
435red fruit
437contains seeds, crisp, pleasant to taste
439\item[\emph{orange}]
440orange fruit
442\begin{verbatim}
443{ orange code block }
444\end{verbatim}
445\begin{quote}
446orange block quote
448\end{quote}
449\end{description}
450Multiple definitions, tight:
452\begin{description}
453\item[apple]
454red fruit
456computer
457\item[orange]
458orange fruit
460bank
461\end{description}
462Multiple definitions, loose:
464\begin{description}
465\item[apple]
466red fruit
468computer
470\item[orange]
471orange fruit
473bank
475\end{description}
476Blank line after term, indented marker, alternate markers:
478\begin{description}
479\item[apple]
480red fruit
482computer
484\item[orange]
485orange fruit
487\begin{enumerate}[1.]
488\item
489 sublist
490\item
491 sublist
492\end{enumerate}
493\end{description}
494\section{HTML Blocks}
496Simple block on one line:
498foo
499And nested without indentation:
501foo
502bar
503Interpreted markdown in a table:
505This is \emph{emphasized}
506And this is \textbf{strong}
507Here's a simple block:
509foo
510This should be a code block, though:
512\begin{verbatim}
513<div>
514 foo
515</div>
516\end{verbatim}
517As should this:
519\begin{verbatim}
520<div>foo</div>
521\end{verbatim}
522Now, nested:
524foo
525This should just be an HTML comment:
527Multiline:
529Code block:
531\begin{verbatim}
532<!-- Comment -->
533\end{verbatim}
534Just plain comment, with trailing spaces on the line:
536Code:
538\begin{verbatim}
539<hr />
540\end{verbatim}
541Hr's:
543\begin{center}\rule{3in}{0.4pt}\end{center}
545\section{Inline Markup}
547This is \emph{emphasized}, and so \emph{is this}.
549This is \textbf{strong}, and so \textbf{is this}.
551An \emph{\href{/url}{emphasized link}}.
553\textbf{\emph{This is strong and em.}}
555So is \textbf{\emph{this}} word.
557\textbf{\emph{This is strong and em.}}
559So is \textbf{\emph{this}} word.
561This is code: \verb!>!, \verb!$!, \verb!\!, \verb!\$!, \verb!<html>!.
563\sout{This is \emph{strikeout}.}
565Superscripts: a\textsuperscript{bc}d a\textsuperscript{\emph{hello}}
566a\textsuperscript{hello~there}.
568Subscripts: H\textsubscr{2}O, H\textsubscr{23}O, H\textsubscr{many~of~them}O.
570These should not be superscripts or subscripts, because of the unescaped
571spaces: a\^{}b c\^{}d, a\ensuremath{\sim}b c\ensuremath{\sim}d.
573\begin{center}\rule{3in}{0.4pt}\end{center}
575\section{Smart quotes, ellipses, dashes}
577``Hello,'' said the spider. ``\,`Shelob' is my name.''
579`A', `B', and `C' are letters.
581`Oak,' `elm,' and `beech' are names of trees. So is `pine.'
583`He said, ``I want to go.''\,' Were you alive in the 70's?
585Here is some quoted `\verb!code!' and a
586``\href{http://example.com/?foo=1\&bar=2}{quoted link}''.
588Some dashes: one---two --- three---four --- five.
590Dashes between numbers: 5--7, 255--66, 1987--1999.
592Ellipses\ldots{}and\ldots{}and\ldots{}.
594\begin{center}\rule{3in}{0.4pt}\end{center}
596\section{LaTeX}
598\begin{itemize}
599\item
600 \cite[22-23]{smith.1899}
601\item
602 $2+2=4$
603\item
604 $x \in y$
605\item
606 $\alpha \wedge \omega$
607\item
608 $223$
609\item
610 $p$-Tree
611\item
612 Here's some display math:
613 \[\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}\]
614\item
615 Here's one that has a line break in it: $\alpha + \omega \times x^2$.
616\end{itemize}
617These shouldn't be math:
619\begin{itemize}
620\item
621 To get the famous equation, write \verb!$e = mc^2$!.
622\item
623 \$22,000 is a \emph{lot} of money. So is \$34,000. (It worked if ``lot'' is
624 emphasized.)
625\item
626 Shoes (\$20) and socks (\$5).
627\item
628 Escaped \verb!$!: \$73 \emph{this should be emphasized} 23\$.
629\end{itemize}
630Here's a LaTeX table:
632\begin{tabular}{|l|l|}\hline
633Animal & Number \\ \hline
634Dog & 2 \\
635Cat & 1 \\ \hline
636\end{tabular}
638\begin{center}\rule{3in}{0.4pt}\end{center}
640\section{Special Characters}
642Here is some unicode:
644\begin{itemize}
645\item
646 I hat: Î
647\item
648 o umlaut: ö
649\item
650 section: §
651\item
652 set membership: ∈
653\item
654 copyright: ©
655\end{itemize}
656AT\&T has an ampersand in their name.
658AT\&T is another way to write it.
660This \& that.
6624 \textless{} 5.
6646 \textgreater{} 5.
666Backslash: \textbackslash{}
668Backtick: `
670Asterisk: *
672Underscore: \_
674Left brace: \{
676Right brace: \}
678Left bracket: {[}
680Right bracket: {]}
682Left paren: (
684Right paren: )
686Greater-than: \textgreater{}
688Hash: \#
690Period: .
692Bang: !
694Plus: +
696Minus: -
698\begin{center}\rule{3in}{0.4pt}\end{center}
700\section{Links}
702\subsection{Explicit}
704Just a \href{/url/}{URL}.
706\href{/url/}{URL and title}.
708\href{/url/}{URL and title}.
710\href{/url/}{URL and title}.
712\href{/url/}{URL and title}
714\href{/url/}{URL and title}
716\href{/url/with\_underscore}{with\_underscore}
718\href{mailto:nobody@nowhere.net}{Email link}
720\href{}{Empty}.
722\subsection{Reference}
724Foo \href{/url/}{bar}.
726Foo \href{/url/}{bar}.
728Foo \href{/url/}{bar}.
730With \href{/url/}{embedded {[}brackets{]}}.
732\href{/url/}{b} by itself should be a link.
734Indented \href{/url}{once}.
736Indented \href{/url}{twice}.
738Indented \href{/url}{thrice}.
740This should {[}not{]}{[}{]} be a link.
742\begin{verbatim}
743[not]: /url
744\end{verbatim}
745Foo \href{/url/}{bar}.
747Foo \href{/url/}{biz}.
749\subsection{With ampersands}
751Here's a \href{http://example.com/?foo=1\&bar=2}{link with an ampersand in the
752URL}.
754Here's a link with an amersand in the link text:
755\href{http://att.com/}{AT\&T}.
757Here's an \href{/script?foo=1\&bar=2}{inline link}.
759Here's an \href{/script?foo=1\&bar=2}{inline link in pointy braces}.
761\subsection{Autolinks}
763With an ampersand: \url{http://example.com/?foo=1&bar=2}
765\begin{itemize}
766\item
767 In a list?
768\item
769 \url{http://example.com/}
770\item
771 It should.
772\end{itemize}
773An e-mail address:
774\href{mailto:nobody@nowhere.net}{\texttt{nobody@nowhere.net}}
776\begin{quote}
777Blockquoted: \url{http://example.com/}
779\end{quote}
780Auto-links should not occur here: \verb!<http://example.com/>!
782\begin{verbatim}
783or here: <http://example.com/>
784\end{verbatim}
785\begin{center}\rule{3in}{0.4pt}\end{center}
787\section{Images}
789From ``Voyage dans la Lune'' by Georges Melies (1902):
791\begin{figure}[htb]
792\centering
793\includegraphics{lalune.jpg}
794\caption{lalune}
795\end{figure}
797Here is a movie \includegraphics{movie.jpg} icon.
799\begin{center}\rule{3in}{0.4pt}\end{center}
801\section{Footnotes}
803Here is a footnote reference,\footnote{Here is the footnote. It can go
804 anywhere after the footnote reference. It need not be placed at the end of
805 the document.} and another.\footnote{Here's the long note. This one contains
806 multiple blocks.
808 Subsequent blocks are indented to show that they belong to the footnote (as
809 with list items).
811 \begin{Verbatim}
812 { <code> }
813 \end{Verbatim}
814 If you want, you can indent every line, but you can also be lazy and just
815 indent the first line of each block.} This should \emph{not} be a footnote
816reference, because it contains a space.{[}\^{}my note{]} Here is an inline
817note.\footnote{This is \emph{easier} to type. Inline notes may contain
818 \href{http://google.com}{links} and \verb!]! verbatim characters, as well as
819 {[}bracketed text{]}.}
821\begin{quote}
822Notes can go in quotes.\footnote{In quote.}
824\end{quote}
825\begin{enumerate}[1.]
826\item
827 And in list items.\footnote{In list.}
828\end{enumerate}
829This paragraph should not be part of the note, as it is not indented.
831\end{document}