This repository has been archived on 2024-03-03. You can view files and clone it, but cannot push or open issues or pull requests.
adlin/tutorial/colored-blocks.lua
Pierre-Olivier Mercier 313597aede
Some checks reported errors
continuous-integration/drone/push Build was killed
Add LaTeX model from virli course
2022-02-19 00:32:49 +01:00

48 lines
1.2 KiB
Lua

function Div(el)
if el.classes[1] == "warning"
then
-- insert element in front
table.insert(
el.content, 1,
pandoc.RawBlock("latex", "\\noindent\\begin{alertbox}"))
-- insert element at the back
table.insert(
el.content,
pandoc.RawBlock("latex", "\\end{alertbox}"))
elseif el.classes[1] == "code"
then
-- insert element in front
table.insert(
el.content, 1,
pandoc.RawBlock("latex", "\\noindent\\begin{codebox}"))
-- insert element at the back
table.insert(
el.content,
pandoc.RawBlock("latex", "\\end{codebox}"))
elseif el.classes[1] == "question"
then
-- insert element in front
table.insert(
el.content, 1,
pandoc.RawBlock("latex", "\\noindent\\begin{questionbox}"))
-- insert element at the back
table.insert(
el.content,
pandoc.RawBlock("latex", "\\end{questionbox}"))
elseif el.classes[1] == "more"
then
-- insert element in front
table.insert(
el.content, 1,
pandoc.RawBlock("latex", "\\begin{morebox}"))
-- insert element at the back
table.insert(
el.content,
pandoc.RawBlock("latex", "\\end{morebox}"))
end
return el
end