aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2013-11-30 16:16:35 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2013-11-30 16:16:35 -0800
commitbb0f299165de22e119675aa6ceed0192a80c78e8 (patch)
treed1b4641a7639d646c2459c46e0781e716de2a435
parentbc6bb3be5c430b1357e58144e64daa561770fe44 (diff)
downloadpandoc-bb0f299165de22e119675aa6ceed0192a80c78e8.tar.gz
ConTeXt writer: Don't hardcode figure/table placement.
Instead, let this be set in the template, using `\setupfloat`. Thanks to Aditya Mahajan for the suggestion.
m---------data/templates13
-rw-r--r--src/Text/Pandoc/Writers/ConTeXt.hs8
2 files changed, 11 insertions, 10 deletions
diff --git a/data/templates b/data/templates
-Subproject 8cadd4f2044c0c25842eeb5a2370a6e3384f4bd
+Subproject 713a8f63d5589ab9313869e47b03cf7f49e00e9
diff --git a/src/Text/Pandoc/Writers/ConTeXt.hs b/src/Text/Pandoc/Writers/ConTeXt.hs
index 179d9bc5b..3095cf508 100644
--- a/src/Text/Pandoc/Writers/ConTeXt.hs
+++ b/src/Text/Pandoc/Writers/ConTeXt.hs
@@ -130,7 +130,7 @@ blockToConTeXt (Plain lst) = inlineListToConTeXt lst
-- title beginning with fig: indicates that the image is a figure
blockToConTeXt (Para [Image txt (src,'f':'i':'g':':':_)]) = do
capt <- inlineListToConTeXt txt
- return $ blankline $$ "\\placefigure[here]" <> braces capt <>
+ return $ blankline $$ "\\placefigure" <> braces capt <>
braces ("\\externalfigure" <> brackets (text src)) <> blankline
blockToConTeXt (Para lst) = do
contents <- inlineListToConTeXt lst
@@ -205,9 +205,9 @@ blockToConTeXt (Table caption aligns widths heads rows) = do
else liftM ($$ "\\HL") $ tableRowToConTeXt heads
captionText <- inlineListToConTeXt caption
rows' <- mapM tableRowToConTeXt rows
- return $ "\\placetable" <> brackets ("here" <> if null caption
- then ",none"
- else "")
+ return $ "\\placetable" <> (if null caption
+ then brackets "none"
+ else empty)
<> braces captionText $$
"\\starttable" <> brackets (text colDescriptors) $$
"\\HL" $$ headers $$