git.iko.soy/typeable/pandoc
on master help sign in
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.

commitbb0f299165de22e119675aa6ceed0192a80c78e8 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 30 Nov 2013, 16:16 (13 years ago) parentbc6bb3b
2 files changed+5−5
data/templates+1−1 src/Text/Pandoc/Writers/ConTeXt.hs+4−4
data/templates+1−1

Submodule changed.

src/Text/Pandoc/Writers/ConTeXt.hs+4−4
@@ -130,7 +130,7 @@ blockToConTeXt (Plain lst) = inlineListToConTeXt lst
130130-- title beginning with fig: indicates that the image is a figure
131131blockToConTeXt (Para [Image txt (src,'f':'i':'g':':':_)]) = do
132132 capt <- inlineListToConTeXt txt
133− return $ blankline $$ "\\placefigure[here]" <> braces capt <>
133+ return $ blankline $$ "\\placefigure" <> braces capt <>
134134 braces ("\\externalfigure" <> brackets (text src)) <> blankline
135135blockToConTeXt (Para lst) = do
136136 contents <- inlineListToConTeXt lst
@@ -205,9 +205,9 @@ blockToConTeXt (Table caption aligns widths heads rows) = do
205205 else liftM ($$ "\\HL") $ tableRowToConTeXt heads
206206 captionText <- inlineListToConTeXt caption
207207 rows' <- mapM tableRowToConTeXt rows
208− return $ "\\placetable" <> brackets ("here" <> if null caption
209− then ",none"
210− else "")
208+ return $ "\\placetable" <> (if null caption
209+ then brackets "none"
210+ else empty)
211211 <> braces captionText $$
212212 "\\starttable" <> brackets (text colDescriptors) $$
213213 "\\HL" $$ headers $$