diff options
Diffstat (limited to '_extensions/js/multicol-nohead')
-rw-r--r-- | _extensions/js/multicol-nohead/multicol-nohead.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/_extensions/js/multicol-nohead/multicol-nohead.lua b/_extensions/js/multicol-nohead/multicol-nohead.lua index a5bba1b..d242ac7 100644 --- a/_extensions/js/multicol-nohead/multicol-nohead.lua +++ b/_extensions/js/multicol-nohead/multicol-nohead.lua @@ -7,6 +7,11 @@ local multicol_end = pandoc.RawBlock('latex', [[ \end{multicols} ]]) +-- TODO: detect pre-quarto-filter pattern too +local function is_newpage_command(elem) + return elem.t == "RawBlock" and elem.text == "\\newpage{}" +end + -- TODO: include header level 2 and author paragraph above multicolumn function is_author(elem) return elem.t == Para and elem.content[1].text == "Forfatter:" @@ -22,6 +27,11 @@ function Pandoc(doc) if elem.t == "Header" and elem.level == 1 then multicol_places[i] = multicol_now and "renew" or "begin" multicol_now = true + elseif is_newpage_command(elem) then + if multicol_now then + multicol_places[i] = "end" + multicol_now = false + end elseif elem.t == "HorizontalRule" then if multicol_now then multicol_places[i] = "end" |