git.iko.soy/typeable/pandoc
on master help sign in
LaTeX writer: use deVerb on table and picture captions.

Otherwise LaTeX complains about \verb inside command argument. Thanks to bbanier for reporting the bug.

commit8d54e304c647770dd6da1af844707c314898824c authorJohn MacFarlane <jgm@berkeley.edu> dateTue 24 May 2011, 23:56 (15 years ago) parent6e59053
1 file changed+2−2
src/Text/Pandoc/Writers/LaTeX.hs+2−2
src/Text/Pandoc/Writers/LaTeX.hs+2−2
@@ -161,7 +161,7 @@ blockToLaTeX :: Block -- ^ Block to convert
161161blockToLaTeX Null = return empty
162162blockToLaTeX (Plain lst) = inlineListToLaTeX lst
163163blockToLaTeX (Para [Image txt (src,tit)]) = do
164− capt <- inlineListToLaTeX txt
164+ capt <- inlineListToLaTeX $ deVerb txt
165165 img <- inlineToLaTeX (Image txt (src,tit))
166166 return $ "\\begin{figure}[htbp]" $$ "\\centering" $$ img $$
167167 ("\\caption{" <> capt <> char '}') $$ "\\end{figure}" $$ blankline
@@ -272,7 +272,7 @@ blockToLaTeX (Table caption aligns widths heads rows) = do
272272 headers <- if all null heads
273273 then return empty
274274 else liftM ($$ "\\hline") $ (tableRowToLaTeX widths) heads
275− captionText <- inlineListToLaTeX caption
275+ captionText <- inlineListToLaTeX $ deVerb caption
276276 rows' <- mapM (tableRowToLaTeX widths) rows
277277 let colDescriptors = concat $ zipWith toColDescriptor widths aligns
278278 let tableBody = text ("\\begin{tabular}{" ++ colDescriptors ++ "}") $$