git.iko.soy/typeable/pandoc
on master help sign in
Fixed bug in LaTeX writer. When a footnote ends with a Verbatim
f609755fiddlosopher
src/Text/Pandoc/Writers/LaTeX.hs+3−1
@@ -278,4 +278,6 @@ inlineToLaTeX (Note contents) = do
278 contents' <- blockListToLaTeX contents
278 contents' <- blockListToLaTeX contents
279 st <- get
279 st <- get
280 put (st {stInNote = False})
280 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.
673
673
674\section{Footnotes}
674\section{Footnotes}
675
675
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.
677
678
678Subsequent blocks are indented to show that they belong to the footnote (as with list items).
679Subsequent blocks are indented to show that they belong to the footnote (as with list items).
679
680
680\begin{Verbatim}
681\begin{Verbatim}
681 { <code> }
682 { <code> }
682\end{Verbatim}
683\end{Verbatim}
684+If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.
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].}
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+}
684
687
685\begin{quote}
688\begin{quote}
686−Notes can go in quotes.\footnote{In quote.}
689+Notes can go in quotes.\footnote{In quote.
690+}
687
691
688\end{quote}
692\end{quote}
689\begin{enumerate}[1.]
693\begin{enumerate}[1.]
690−\item And in list items.\footnote{In list.}
694+\item And in list items.\footnote{In list.
695+}
691\end{enumerate}
696\end{enumerate}
692This paragraph should not be part of the note, as it is not indented.
697This paragraph should not be part of the note, as it is not indented.
693
698