summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--_extensions/js/multicol-nohead/multicol-nohead.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/_extensions/js/multicol-nohead/multicol-nohead.lua b/_extensions/js/multicol-nohead/multicol-nohead.lua
index 85e0dd8..d74e87a 100644
--- a/_extensions/js/multicol-nohead/multicol-nohead.lua
+++ b/_extensions/js/multicol-nohead/multicol-nohead.lua
@@ -31,6 +31,13 @@ local function is_columnar_header(elem)
return elem.t == "Header" and elem.level == 1
end
+-- a standalone image with optional caption that has class .wide
+-- TODO: detect pre-quarto-filter pattern too
+local function is_wide(elem)
+ return ((elem.t == "Para" and has_class(elem.content[1], "wide"))
+ or (elem.t == "Figure" and has_class(elem.content[1].content[1], "wide")))
+end
+
-- TODO: detect pre-quarto-filter pattern too
local function is_newpage_command(elem)
return (elem.t == "RawBlock" and elem.text == "\\newpage{}")
@@ -100,6 +107,10 @@ function Pandoc(doc)
if is_columnar_header(elem) then
multicol_places[i] = multicol_now and "renew" or "begin"
multicol_now = true
+ elseif is_wide(elem) then
+ if multicol_now then
+ multicol_places[i] = "renew"
+ end
elseif is_advertising(elem) then
doc.blocks[i] = ad(elem)
if multicol_now then