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
| \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
| -- 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
| -- 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
| local List = require 'pandoc.List' | |
| local meta | |
| function merge_meta(m1, m2) | |
| local result = m1 | |
| for k, v in pairs(m2) do | |
| if result[k] == nil then | |
| result[k] = v | |
| 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
| -- Render TeX and LaTeX like the `\TeX` and `\LaTeX{}` macros do. | |
| -- Copyright © 2020 Albert Krewinkel <albert+pandoc@zeitkraut.de> | |
| -- License: MIT License | |
| -- Style inspired by https://tess.oconnor.cx/2007/08/tex-poshlet | |
| local style = pandoc.RawBlock('html', [[ | |
| <style> | |
| .tex-logo sub, .latex-logo sub { | |
| font-size: 100%; | |
| margin-left: -0.1667em; |
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 known_exts = pandoc.List{".png", ".jpg", "jpeg"} | |
| if FORMAT:match 'tex' then | |
| known_exts = pandoc.List { | |
| ".pdf", ".png", ".jpg", ".mps", ".jpeg", ".jbig2", ".jb2" | |
| } | |
| elseif FORMAT:match 'html' then | |
| known_exts = pandoc.List { | |
| ".svg", ".png", ".jpg", ".jpeg", ".webp", ".gif" | |
| } | |
| 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
| -- This is a sample custom writer for pandoc, using Layout to | |
| -- produce nicely wrapped output. | |
| local layout = pandoc.layout | |
| local text = pandoc.text | |
| local type = pandoc.utils.type | |
| local l = layout.literal | |
| -- Table to store footnotes, so they can be included at the 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
| -- Generate a Table of Contents. | |
| -- | |
| -- This is an adaption of the Haskell code used in pandoc. This script | |
| -- is intended to be adapted to specific requirements before use. E.g., | |
| -- it can be modified to add additional elements as TOC items, to add | |
| -- more info to each line in the TOC, or to control whether the heading | |
| -- number is included in the link. | |
| local PANDOC_WRITER_OPTIONS = PANDOC_WRITER_OPTIONS | |
| _ENV = pandoc |
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 interactive (it, env) | |
| local has_readline, RL = pcall(require, 'readline') | |
| if not has_readline then | |
| RL = { | |
| readline = function (prompt) | |
| io.stdout:write(prompt) | |
| return io.read() | |
| end | |
| } |