From 8d54e304c647770dd6da1af844707c314898824c Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 24 May 2011 23:56:23 -0700 Subject: LaTeX writer: use deVerb on table and picture captions. Otherwise LaTeX complains about \verb inside command argument. Thanks to bbanier for reporting the bug. --- src/Text/Pandoc/Writers/LaTeX.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Text/Pandoc/Writers/LaTeX.hs') 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 ++ "}") $$ -- cgit v1.2.3