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
This commit is contained in:
parent
ab23086b1b
commit
f609755cb6
2 changed files with 12 additions and 5 deletions
|
@ -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.
|
||||
|
|
|
@ -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}
|
||||
{ <code> }
|
||||
\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.
|
||||
|
||||
|
|
Loading…
Reference in a new issue