diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2010-03-16 06:45:47 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2010-03-16 06:45:47 +0000 |
commit | 9562390d6883110bd00d5b667761ec6b615eb5d7 (patch) | |
tree | ce5448788b39e6d57a352f4bd1f98f1a7374644c /src/Text/Pandoc/Writers | |
parent | da117c9d68fb2169b43dda6131bfa35856113347 (diff) | |
download | pandoc-9562390d6883110bd00d5b667761ec6b615eb5d7.tar.gz |
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
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r-- | src/Text/Pandoc/Writers/ConTeXt.hs | 10 |
1 files changed, 6 insertions, 4 deletions
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' |