From a3d08bfd57de7ce619f4157a3245f9071b38356c Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Fri, 13 Jun 2025 21:46:42 +0200 Subject: support raw \end{multicols} --- _extensions/js/multicol-nohead/multicol-nohead.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to '_extensions/js/multicol-nohead/multicol-nohead.lua') diff --git a/_extensions/js/multicol-nohead/multicol-nohead.lua b/_extensions/js/multicol-nohead/multicol-nohead.lua index d74e87a..67c2f15 100644 --- a/_extensions/js/multicol-nohead/multicol-nohead.lua +++ b/_extensions/js/multicol-nohead/multicol-nohead.lua @@ -31,6 +31,10 @@ local function is_columnar_header(elem) return elem.t == "Header" and elem.level == 1 end +local function is_multicols_end(elem) + return elem.t == "RawBlock" and elem.text == "\\end{multicols}" +end + -- a standalone image with optional caption that has class .wide -- TODO: detect pre-quarto-filter pattern too local function is_wide(elem) @@ -126,6 +130,8 @@ function Pandoc(doc) multicol_places[i] = "end" multicol_now = false end + elseif is_multicols_end(elem) then + multicol_now = false end end if multicol_now then -- cgit v1.2.3