git.iko.soy/typeable/pandoc
on master help sign in
Fixed bug in LaTeX writer. When a footnote ends with a Verbatim

environment, the close } of the footnote needs to occur on the same line or an error occurs. Fixed by adding a newline before the close } in every footnote. git-svn-id: https://pandoc.googlecode.com/svn/trunk@897 788f1e2b-df1e-0410-8736-df70ead52e1b

commitf609755cb6eed6e0f42f90f1c6814f7578b2000a authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSat 25 Aug 2007, 18:17 (19 years ago) parentab23086
2 files changed+12−5
src/Text/Pandoc/Writers/LaTeX.hs+3−1 tests/writer.latex+9−4
src/Text/Pandoc/Writers/LaTeX.hs+3−1
@@ -278,4 +278,6 @@ inlineToLaTeX (Note contents) = do
278278 contents' <- blockListToLaTeX contents
279279 st <- get
280280 put (st {stInNote = False})
281− return $ "\\footnote{" ++ stripTrailingNewlines contents' ++ "}"
281+ return $ "\\footnote{" ++ stripTrailingNewlines contents' ++ "\n}"
282+ -- note: the \n before } is important; removing it causes problems
283+ -- if a Verbatim environment occurs at the end of the footnote.
tests/writer.latex+9−4
@@ -673,21 +673,26 @@ Here is a movie \includegraphics{movie.jpg} icon.
673673
674674\section{Footnotes}
675675
676−Here is a footnote reference,\footnote{Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.} and another.\footnote{Here's the long note. This one contains multiple blocks.
676+Here is a footnote reference,\footnote{Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.
677+} and another.\footnote{Here's the long note. This one contains multiple blocks.
677678
678679Subsequent blocks are indented to show that they belong to the footnote (as with list items).
679680
680681\begin{Verbatim}
681682 { <code> }
682683\end{Verbatim}
683−If you want, you can indent every line, but you can also be lazy and just 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].}
684+If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.
685+} 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].
686+}
684687
685688\begin{quote}
686−Notes can go in quotes.\footnote{In quote.}
689+Notes can go in quotes.\footnote{In quote.
690+}
687691
688692\end{quote}
689693\begin{enumerate}[1.]
690−\item And in list items.\footnote{In list.}
694+\item And in list items.\footnote{In list.
695+}
691696\end{enumerate}
692697This paragraph should not be part of the note, as it is not indented.
693698