diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs index ad1f3e45f..530bd26e1 100644 --- a/src/Text/Pandoc/Writers/LaTeX.hs +++ b/src/Text/Pandoc/Writers/LaTeX.hs @@ -278,4 +278,6 @@ inlineToLaTeX (Note contents) = do contents' <- blockListToLaTeX contents st <- get put (st {stInNote = False}) - return $ "\\footnote{" ++ stripTrailingNewlines contents' ++ "}" + return $ "\\footnote{" ++ stripTrailingNewlines contents' ++ "\n}" + -- note: the \n before } is important; removing it causes problems + -- if a Verbatim environment occurs at the end of the footnote. diff --git a/tests/writer.latex b/tests/writer.latex index 00fc0d115..337fd05bb 100644 --- a/tests/writer.latex +++ b/tests/writer.latex @@ -673,21 +673,26 @@ Here is a movie \includegraphics{movie.jpg} icon. \section{Footnotes} -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. +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. Subsequent blocks are indented to show that they belong to the footnote (as with list items). \begin{Verbatim} { } \end{Verbatim} -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].} +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]. +} \begin{quote} -Notes can go in quotes.\footnote{In quote.} +Notes can go in quotes.\footnote{In quote. +} \end{quote} \begin{enumerate}[1.] -\item And in list items.\footnote{In list.} +\item And in list items.\footnote{In list. +} \end{enumerate} This paragraph should not be part of the note, as it is not indented.