-
Notifications
You must be signed in to change notification settings - Fork 53
/
sidebar.lua
52 lines (47 loc) · 1.26 KB
/
sidebar.lua
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
-- https://github.com/jgm/pandoc/issues/2106#issuecomment-371355862
function Span(el)
if el.classes:includes("todo") then
return {
pandoc.RawInline("latex", "\\textcolor{red}{\\textbf{TODO: }"),
el,
pandoc.RawInline("latex", "}")
}
end
end
function Div(el)
if el.classes:includes("sidebar") then
return {
pandoc.RawBlock("latex", "\\begin{shaded}"),
el,
pandoc.RawBlock("latex", "\\end{shaded}")
}
end
if el.classes:includes("base") then
return {
pandoc.RawBlock("latex", "\\begin{shaded} \\textbf{In Base R}"),
el,
pandoc.RawBlock("latex", "\\end{shaded}")
}
end
if el.classes:includes("tidyverse") then
return {
pandoc.RawBlock("latex", "\\begin{shaded} \\textbf{In Tidyverse}"),
el,
pandoc.RawBlock("latex", "\\end{shaded}")
}
end
if el.classes:includes("rmdnote") then
return {
pandoc.RawBlock("latex", "\\begin{shaded}\\textcolor[RGB]{251,188,5}{\\textbf{注意}}"),
el,
pandoc.RawBlock("latex", "\\end{shaded}")
}
end
if el.classes:includes("warning") then
return {
pandoc.RawBlock("latex", "\\begin{shaded} \\textcolor{red}{\\textbf{警告}}"),
el,
pandoc.RawBlock("latex", "\\end{shaded}")
}
end
end