From 9562390d6883110bd00d5b667761ec6b615eb5d7 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Tue, 16 Mar 2010 06:45:47 +0000 Subject: ConTeXt writer: support images in figures. Also, DON'T put image in figure (as was done previously) when it's an inline image. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1893 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/Text/Pandoc/Writers/ConTeXt.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/Text/Pandoc/Writers') diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs index b1e3acb8f..545acded5 100644 --- a/src/Text/Pandoc/Writers/ConTeXt.hs +++ b/src/Text/Pandoc/Writers/ConTeXt.hs @@ -109,6 +109,10 @@ blockToConTeXt (Plain lst) = do let options = stOptions st contents <- wrapTeXIfNeeded options False inlineListToConTeXt lst return $ Reg contents +blockToConTeXt (Para [Image txt (src,_)]) = do + capt <- inlineListToConTeXt txt + return $ Pad $ text "\\placefigure[here,nonumber]{" <> capt <> + text "}{\\externalfigure[" <> text src <> text "]}" blockToConTeXt (Para lst) = do st <- get let options = stOptions st @@ -265,10 +269,8 @@ inlineToConTeXt (Link txt (src, _)) = do label <- inlineListToConTeXt txt return $ text "\\useURL[" <> text ref <> text "][" <> text src <> text "][][" <> label <> text "]\\from[" <> text ref <> char ']' -inlineToConTeXt (Image alternate (src, tit)) = do - alt <- inlineListToConTeXt alternate - return $ text "\\placefigure\n[]\n[fig:" <> alt <> text "]\n{" <> - text tit <> text "}\n{\\externalfigure[" <> text src <> text "]}" +inlineToConTeXt (Image _ (src, _)) = do + return $ text "{\\externalfigure[" <> text src <> text "]}" inlineToConTeXt (Note contents) = do contents' <- blockListToConTeXt contents let rawnote = stripTrailingNewlines $ render contents' -- cgit v1.2.3