git.iko.soy/typeable/pandoc
on master help sign in
LaTeX writer: support figures with captions.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1892 788f1e2b-df1e-0410-8736-df70ead52e1b

commitda117c9d68fb2169b43dda6131bfa35856113347 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateTue 16 Mar 2010, 04:06 (17 years ago) parentcb31c89
2 files changed+9
src/Text/Pandoc/Writers/LaTeX.hs+5 tests/writer.latex+4
src/Text/Pandoc/Writers/LaTeX.hs+5
@@ -130,6 +130,11 @@ blockToLaTeX (Plain lst) = do
130130 st <- get
131131 let opts = stOptions st
132132 wrapTeXIfNeeded opts True inlineListToLaTeX lst
133+blockToLaTeX (Para [Image txt (src,tit)]) = do
134+ capt <- inlineListToLaTeX txt
135+ img <- inlineToLaTeX (Image txt (src,tit))
136+ return $ text "\\begin{figure}[htb]" $$ text "\\centering" $$ img $$
137+ (text "\\caption{" <> capt <> char '}') $$ text "\\end{figure}\n"
133138blockToLaTeX (Para lst) = do
134139 st <- get
135140 let opts = stOptions st
tests/writer.latex+4
@@ -809,7 +809,11 @@ or here: <http://example.com/>
809809
810810From ``Voyage dans la Lune'' by Georges Melies (1902):
811811
812+\begin{figure}[htb]
813+\centering
812814\includegraphics{lalune.jpg}
815+\caption{lalune}
816+\end{figure}
813817
814818Here is a movie \includegraphics{movie.jpg} icon.
815819