summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--_extensions/js/multicol-nohead/_extension.yml6
-rw-r--r--_extensions/js/multicol-nohead/multicol-nohead.lua47
-rw-r--r--_extensions/js/stylish-issue/_extension.yaml12
-rw-r--r--_quarto.yml1
-rw-r--r--tryk/oroeposten_5.qmd9
5 files changed, 54 insertions, 21 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}
diff --git a/_quarto.yml b/_quarto.yml
index f43f267..2cd743e 100644
--- a/_quarto.yml
+++ b/_quarto.yml
@@ -70,3 +70,4 @@ resources:
filters:
- nobreaks
+ - multicol-nohead
diff --git a/tryk/oroeposten_5.qmd b/tryk/oroeposten_5.qmd
index b1ed250..c5001ff 100644
--- a/tryk/oroeposten_5.qmd
+++ b/tryk/oroeposten_5.qmd
@@ -72,17 +72,8 @@ format:
{{< include ../nummer5/stensliber/_index.qmd >}}
-```{=latex}
-\end{multicols}
-```
-
----
-```{=latex}
-\begin{multicols}{2}
-\raggedcolumns
-```
-
# Bidragsydere m.m.
{{< include ../nummer5/_about.md >}}