summaryrefslogtreecommitdiff
path: root/artikler/index.qmd
blob: a93d5c82006d5ae84b8a211b994eed1553df2b1a (plain)

title: "Artikler" listing:

  • id: articles contents: "../nummer*/*/index.qmd" sort: "date desc author" type: table categories: cloud fields: [date, title, subtitle]

Se også udgivelser og udskriftsvenlige formater.

Artikler

:::{#articles} :::

opt">, [[
  • \begin{multicols}{3}\raggedcolumns
  • ]])
  • local multicol_end = pandoc.RawBlock('latex', [[
  • \end{multicols}
  • ]])
  • local ad_template = [[
  • \begin{minipage}[%s][%s\textheight][c]{\textwidth}
  • \centering
  • \includegraphics[width=\linewidth,height=%s\textheight,keepaspectratio]{%s}
  • \end{minipage}
  • ]]
  • local function has_class(elem, class)
  • local classes = elem.classes
  • if not classes then
  • return false
  • end
  • for _, c in ipairs(classes) do
  • if c == class then
  • return true
  • end
  • end
  • return false
  • end
  • local function is_columnar_header(elem)
  • return elem.t == "Header" and elem.level == 1
  • end
  • -- TODO: detect pre-quarto-filter pattern too
  • local function is_newpage_command(elem)
  • return (elem.t == "RawBlock" and elem.text == "\\newpage{}")
  • or (elem.t == "Para" and #elem.content == 5 and elem.content[3] == "pagebreak")
  • end
  • -- a paragraph where initial element has class .ad is an advertising
  • local function is_advertising(elem)
  • if elem.t == "Para" then
  • local elem1 = elem.content[1]
  • if elem1.t == "Image" and has_class(elem1, "ad") then
  • return true
  • end
  • end
  • return false
  • end
  • -- wrap images with class .ad to span half or full page
  • local function ad(elem)
  • local amount = #elem.content
  • -- 1 ad, spanning full page except with class .top or .bottom
  • if amount == 1 then
  • local elem1 = elem.content[1]
  • if elem1.t ~= "Image" or not elem1.src then
  • error("failed to parse advertisement")
  • return elem
  • end
  • if has_class(elem1, "top") then
  • return pandoc.RawBlock('latex', "\\noindent\n"
  • .. string.format(ad_template, "t", "0.5", "0.5", elem1.src))
  • elseif has_class(elem1, "bottom") then
  • return pandoc.RawBlock('latex', "\\vspace*{\\fill}\\noindent\n"
  • .. string.format(ad_template, "b", "0.5", "0.5", elem1.src))
  • end
  • return pandoc.RawBlock('latex',"\\noindent\n"
  • .. string.format(ad_template, "t", "1", "1", elem1.src))
  • end
  • -- 2 ads spanning full page
  • if amount == 3 then
  • local elem1 = elem.content[1]
  • local elem2 = elem.content[3]
  • if elem1.t ~= "Image" or not elem1.src