-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbook-boxes.lua
More file actions
33 lines (29 loc) · 806 Bytes
/
Copy pathbook-boxes.lua
File metadata and controls
33 lines (29 loc) · 806 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
local environments = {
["worked-example"] = "wetexample",
["definition-box"] = "wetdefinition",
["theorem-box"] = "wettheorem",
["learning-outcomes"] = "wetoutcomes",
["try-it"] = "wettry",
["applied-problem"] = "wetapplied"
}
function Div(el)
if el.classes:includes("print-answer") then
return {}
end
for class_name, environment in pairs(environments) do
if el.classes:includes(class_name) then
return {
pandoc.RawBlock("latex", "\\begin{" .. environment .. "}"),
el,
pandoc.RawBlock("latex", "\\end{" .. environment .. "}")
}
end
end
return el
end
function Header(el)
if el.level == 1 and pandoc.utils.stringify(el.content) == "(APPENDIX) Appendices" then
return pandoc.RawBlock("latex", "\\appendix")
end
return el
end