-- Keep prose in two columns while allowing tables and figures to use the page. -- Pandoc's default LaTeX tables use longtable, which cannot run inside -- multicol. Closing and reopening the columns also keeps dense evidence tables -- and vector figures legible in the generated paper. function Pandoc(doc) local blocks = {} local in_columns = false for _, block in ipairs(doc.blocks) do -- Keep the paper title and author line full width. Begin the two-column -- body at the abstract, as in a conventional conference manuscript. if not in_columns and block.t == "Header" and block.level == 2 and pandoc.utils.stringify(block.content) == "Abstract" then table.insert(blocks, pandoc.RawBlock("latex", "\\begin{multicols}{2}")) in_columns = true end if in_columns and (block.t == "Table" or block.t == "Figure") then table.insert(blocks, pandoc.RawBlock("latex", "\\end{multicols}")) table.insert(blocks, block) table.insert(blocks, pandoc.RawBlock("latex", "\\begin{multicols}{2}")) else table.insert(blocks, block) end end if in_columns then table.insert(blocks, pandoc.RawBlock("latex", "\\end{multicols}")) end doc.blocks = blocks return doc end