Skip to content

Instantly share code, notes, and snippets.

@jmablog
jmablog / shortcodes.lua
Created January 30, 2021 17:23
A Pandoc lua filter that applies Pandoc fenced Div styling (https://pandoc.org/MANUAL.html#divs-and-spans) to Word and Latex/PDF output, as well as HTML.
function Div (elem)
if FORMAT:match 'docx' then
if elem.classes[1] == "notes" then
elem.attributes['custom-style'] = 'Notes'
return elem
else
return elem
end
elseif FORMAT:match 'latex' then
if elem.classes[1] == "notes" then