diff options
Diffstat (limited to '_extensions')
-rw-r--r-- | _extensions/js/multicol-nohead/_extension.yml | 6 | ||||
-rw-r--r-- | _extensions/js/multicol-nohead/multicol-nohead.lua | 47 | ||||
-rw-r--r-- | _extensions/js/stylish-issue/_extension.yaml | 12 |
3 files changed, 53 insertions, 12 deletions
diff --git a/_extensions/js/multicol-nohead/_extension.yml b/_extensions/js/multicol-nohead/_extension.yml new file mode 100644 index 0000000..104f8ab --- /dev/null +++ b/_extensions/js/multicol-nohead/_extension.yml @@ -0,0 +1,6 @@ +title: Multicol-NoHead +author: Jonas Smedegaard +version: 0.0.1 +contributes: + filters: + - multicol-nohead.lua diff --git a/_extensions/js/multicol-nohead/multicol-nohead.lua b/_extensions/js/multicol-nohead/multicol-nohead.lua new file mode 100644 index 0000000..1fa5d4a --- /dev/null +++ b/_extensions/js/multicol-nohead/multicol-nohead.lua @@ -0,0 +1,47 @@ +-- Render content below header in three columns + +local multicol_begin = pandoc.RawBlock('latex', [[ +\begin{multicols}{2}\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 + return multicol_delimit(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 diff --git a/_extensions/js/stylish-issue/_extension.yaml b/_extensions/js/stylish-issue/_extension.yaml index f799288..9d03703 100644 --- a/_extensions/js/stylish-issue/_extension.yaml +++ b/_extensions/js/stylish-issue/_extension.yaml @@ -56,15 +56,3 @@ contributes: # suppress figure label - text: | \usepackage[labelformat=empty]{caption} - - include-before-body: - - text: | -# enable multiple tagged columns - - text: | - \begin{multicols}{2} - \raggedcolumns - - include-after-body: -# conclude multiple tagged columns - - text: | - \end{multicols} |