aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/LaTeX.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-05-24 23:56:23 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2011-05-24 23:56:23 -0700
commit8d54e304c647770dd6da1af844707c314898824c (patch)
tree2f415d584b614c7ddfcdebdd3d1514313455b214 /src/Text/Pandoc/Writers/LaTeX.hs
parent6e59053d3287b6ff5f71b7ff789c0d7215388359 (diff)
downloadpandoc-8d54e304c647770dd6da1af844707c314898824c.tar.gz
LaTeX writer: use deVerb on table and picture captions.
Otherwise LaTeX complains about \verb inside command argument. Thanks to bbanier for reporting the bug.
Diffstat (limited to 'src/Text/Pandoc/Writers/LaTeX.hs')
-rw-r--r--src/Text/Pandoc/Writers/LaTeX.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/LaTeX.hs b/src/Text/Pandoc/Writers/LaTeX.hs
index 7dd736da4..1a15adf7a 100644
--- a/src/Text/Pandoc/Writers/LaTeX.hs
+++ b/src/Text/Pandoc/Writers/LaTeX.hs
@@ -161,7 +161,7 @@ blockToLaTeX :: Block -- ^ Block to convert
blockToLaTeX Null = return empty
blockToLaTeX (Plain lst) = inlineListToLaTeX lst
blockToLaTeX (Para [Image txt (src,tit)]) = do
- capt <- inlineListToLaTeX txt
+ capt <- inlineListToLaTeX $ deVerb txt
img <- inlineToLaTeX (Image txt (src,tit))
return $ "\\begin{figure}[htbp]" $$ "\\centering" $$ img $$
("\\caption{" <> capt <> char '}') $$ "\\end{figure}" $$ blankline
@@ -272,7 +272,7 @@ blockToLaTeX (Table caption aligns widths heads rows) = do
headers <- if all null heads
then return empty
else liftM ($$ "\\hline") $ (tableRowToLaTeX widths) heads
- captionText <- inlineListToLaTeX caption
+ captionText <- inlineListToLaTeX $ deVerb caption
rows' <- mapM (tableRowToLaTeX widths) rows
let colDescriptors = concat $ zipWith toColDescriptor widths aligns
let tableBody = text ("\\begin{tabular}{" ++ colDescriptors ++ "}") $$