diff options
author | John MacFarlane <jgm@berkeley.edu> | 2011-07-22 12:19:34 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2011-07-22 12:19:34 -0700 |
commit | 0cf2a631e8d51d59096faeb9497da85baf80d925 (patch) | |
tree | 3a3110bc5276eae321f29c7dab5988b65d610ca0 /tests | |
parent | e3e9225ab3229548a40b2e93caec4ee44088a759 (diff) | |
download | pandoc-0cf2a631e8d51d59096faeb9497da85baf80d925.tar.gz |
LaTeX writer: Use \texttt and escapes instead of \verb!..!.
\verb is simply too fragile; it doesn't work inside command
arguments.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lhs-test.latex | 9 | ||||
-rw-r--r-- | tests/lhs-test.latex+lhs | 9 | ||||
-rw-r--r-- | tests/writer.latex | 17 |
3 files changed, 20 insertions, 15 deletions
diff --git a/tests/lhs-test.latex b/tests/lhs-test.latex index d34c21090..f8851900a 100644 --- a/tests/lhs-test.latex +++ b/tests/lhs-test.latex @@ -5,6 +5,7 @@ \usepackage[breaklinks=true,unicode=true,pdfborder={0 0 0}]{hyperref} \setlength{\parindent}{0pt} \setlength{\parskip}{6pt plus 2pt minus 1pt} +\setlength{\emergencystretch}{3em} -- prevent overfull lines \setcounter{secnumdepth}{0} @@ -12,7 +13,7 @@ \section{lhs test} -\verb!unsplit! is an arrow that takes a pair of values and combines them to +\texttt{unsplit} is an arrow that takes a pair of values and combines them to return a single value: \begin{verbatim} @@ -20,9 +21,9 @@ unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d unsplit = arr . uncurry -- arr (\op (x,y) -> x `op` y) \end{verbatim} -\verb!(***)! combines two arrows into a new arrow by running the two arrows on -a pair of values (one arrow on the first item of the pair and one arrow on the -second item of the pair). +\texttt{(***)} combines two arrows into a new arrow by running the two arrows +on a pair of values (one arrow on the first item of the pair and one arrow on +the second item of the pair). \begin{verbatim} f *** g = first f >>> second g diff --git a/tests/lhs-test.latex+lhs b/tests/lhs-test.latex+lhs index 29237f820..6222866ea 100644 --- a/tests/lhs-test.latex+lhs +++ b/tests/lhs-test.latex+lhs @@ -7,6 +7,7 @@ \usepackage[breaklinks=true,unicode=true,pdfborder={0 0 0}]{hyperref} \setlength{\parindent}{0pt} \setlength{\parskip}{6pt plus 2pt minus 1pt} +\setlength{\emergencystretch}{3em} -- prevent overfull lines \setcounter{secnumdepth}{0} @@ -14,7 +15,7 @@ \section{lhs test} -\verb!unsplit! is an arrow that takes a pair of values and combines them to +\texttt{unsplit} is an arrow that takes a pair of values and combines them to return a single value: \begin{code} @@ -22,9 +23,9 @@ unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d unsplit = arr . uncurry -- arr (\op (x,y) -> x `op` y) \end{code} -\verb!(***)! combines two arrows into a new arrow by running the two arrows on -a pair of values (one arrow on the first item of the pair and one arrow on the -second item of the pair). +\texttt{(***)} combines two arrows into a new arrow by running the two arrows +on a pair of values (one arrow on the first item of the pair and one arrow on +the second item of the pair). \begin{verbatim} f *** g = first f >>> second g diff --git a/tests/writer.latex b/tests/writer.latex index 8cf7d4887..b13f93ac4 100644 --- a/tests/writer.latex +++ b/tests/writer.latex @@ -28,6 +28,7 @@ \usepackage[breaklinks=true,unicode=true,pdfborder={0 0 0}]{hyperref} \setlength{\parindent}{0pt} \setlength{\parskip}{6pt plus 2pt minus 1pt} +\setlength{\emergencystretch}{3em} -- prevent overfull lines \setcounter{secnumdepth}{0} \VerbatimFootnotes % allows verbatim text in footnotes @@ -558,7 +559,8 @@ So is \textbf{\emph{this}} word. So is \textbf{\emph{this}} word. -This is code: \verb!>!, \verb!$!, \verb!\!, \verb!\$!, \verb!<html>!. +This is code: \texttt{\textgreater{}}, \texttt{\$}, \texttt{\textbackslash{}}, +\texttt{\textbackslash{}\$}, \texttt{\textless{}html\textgreater{}}. \sout{This is \emph{strikeout}.} @@ -582,7 +584,7 @@ spaces: a\^{}b c\^{}d, a\ensuremath{\sim}b c\ensuremath{\sim}d. `He said, ``I want to go.''\,' Were you alive in the 70's? -Here is some quoted `\verb!code!' and a +Here is some quoted `\texttt{code}' and a ``\href{http://example.com/?foo=1\&bar=2}{quoted link}''. Some dashes: one---two --- three---four --- five. @@ -618,14 +620,14 @@ These shouldn't be math: \begin{itemize} \item - To get the famous equation, write \verb!$e = mc^2$!. + To get the famous equation, write \texttt{\$e = mc\^{}2\$}. \item \$22,000 is a \emph{lot} of money. So is \$34,000. (It worked if ``lot'' is emphasized.) \item Shoes (\$20) and socks (\$5). \item - Escaped \verb!$!: \$73 \emph{this should be emphasized} 23\$. + Escaped \texttt{\$}: \$73 \emph{this should be emphasized} 23\$. \end{itemize} Here's a LaTeX table: @@ -777,7 +779,8 @@ An e-mail address: Blockquoted: \url{http://example.com/} \end{quote} -Auto-links should not occur here: \verb!<http://example.com/>! +Auto-links should not occur here: +\texttt{\textless{}http://example.com/\textgreater{}} \begin{verbatim} or here: <http://example.com/> @@ -815,8 +818,8 @@ Here is a footnote reference,\footnote{Here is the footnote. It can go indent the first line of each block.} This should \emph{not} be a footnote reference, because it contains a space.{[}\^{}my note{]} Here is an inline note.\footnote{This is \emph{easier} to type. Inline notes may contain - \href{http://google.com}{links} and \verb!]! verbatim characters, as well as - {[}bracketed text{]}.} + \href{http://google.com}{links} and \texttt{{]}} verbatim characters, as + well as {[}bracketed text{]}.} \begin{quote} Notes can go in quotes.\footnote{In quote.} |