blob: 2b987982799f6bee6c846780f85457abf13e56a0 (
plain)
- -- Render content below header in three columns
- local multicol_begin = pandoc.RawBlock('latex', [[
- \begin{multicols}{3}\raggedcolumns
- ]])
- local multicol_end = pandoc.RawBlock('latex', [[
- \end{multicols}
- ]])
- local multicol_now = false
- -- TODO: include header level 2 and author paragraph above multicolumn
- function is_author(elem)
- return elem.t == Para and elem.content[1].text == "Forfatter:"
- end
- function multicol_delimit(elem)
- if multicol_now == true then
- return {multicol_end, elem, multicol_begin}
- else
- multicol_now = true
- return {elem, multicol_begin}
- end
- end
- function Header(elem)
- if FORMAT:match 'latex' then
- if elem.level == 1 then
- return multicol_delimit(elem)
- end
- end
- end
- function HorizontalRule(elem)
- if FORMAT:match 'latex' then
- multicol_now = false
- return {multicol_end, elem}
- end
- end
- function Pandoc(doc)
- if FORMAT:match 'latex' then
- if multicol_now == true then
- doc.blocks:insert(multicol_end)
- return doc
- end
- end
- end
|