This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Licensed, at your choice, under the MIT or GPL-2-or-later license | |
local header_ids = {} | |
local function collect_id (header) | |
if header.identifier and header.identifier ~= "" then | |
header_ids[header.identifier] = header.content | |
header.identifier = "" | |
return header | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- There is no glyph for pi in the default font, but there is one in the | |
-- math font. | |
function Emph (e) | |
local s = e.content[1] | |
if #e.content == 1 and s.tag == 'Str' and s.text == 'π' then | |
return pandoc.RawInline('tex', '$\\pi$') | |
end | |
end | |
-- No glyph available for `≤` in the monospaced font. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{minimal} | |
\usepackage[utf8]{inputenc} | |
\usepackage{tikz} | |
\newlength{\OAheight} | |
\newcommand{\OA}[1]{% symbol height | |
\setlength{\OAheight}{#1}% | |
\raisebox{-0.40\OAheight}{\resizebox{\OAheight}{!}{% | |
\definecolor{OA}{HTML}{f68212} | |
\begin{tikzpicture}[x=1pt,y=1pt] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--[[ | |
Remove all subtrees whose headlines contain class `noexport`. | |
License: MIT | |
Copyright: © Albert Krewinkel | |
]] | |
-- pandoc.utils.make_sections exists since pandoc 2.8 | |
PANDOC_VERSION:must_be_at_least {2,8} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local yaml_template = "---\nDUMMY: %s\n---" | |
function evaluate (str) | |
local tag, value = str:match('^:(%a*):(.*)') | |
if tag == 'lua' then | |
return load( | |
'return ' .. value, | |
"evaluating " .. value | |
)() | |
elseif tag == 'json' then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass{article} | |
\usepackage{tikz} | |
\usepackage{calc} | |
\newlength{\ORCIDidheight} | |
\newlength{\ORCIDidunit} | |
\definecolor{ORCIDgreen}{HTML}{A6CE39} | |
\newcommand{\ORCIDid}{% | |
% Scale icon to match current line height | |
\settoheight{\ORCIDidheight}{AXg}% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Inlines (inlns) | |
-- switch period/cite elements | |
for i=1,#inlns-1 do | |
local period, cite = inlns[i], inlns[i+1] | |
if period.t == 'Str' and period.text == '.' and cite.t == 'Cite' then | |
inlns[i], inlns[i+1] = cite, period | |
end | |
end | |
return inlns | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local counter = 0 | |
function make_label(nonu) | |
local label_class = 'margin-toggle' .. (nonu and '' or ' sidenote-number') | |
local label_sym = nonu and '⊕' or '' | |
local label_html = string.format( | |
'<label for="sn-%d" class="%s">%s</label>', | |
counter, | |
label_class, | |
label_sym |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- Pandoc Lua filter to include other Markdown files | |
--- | |
--- Usage: Use a special code block with class `include` to | |
--- include Markdown files. Each code line is treated as the | |
--- filename of a Markdown file, parsed as Markdown, and | |
--- included. Metadata from include files is discarded. | |
--- | |
--- Example: | |
--- | |
--- ``` {.include} |