-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfancy_book.lua
37 lines (29 loc) · 919 Bytes
/
fancy_book.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
local base = require("packages.base")
local package = pl.class(base)
package._name = "fancy_book"
function package:_init()
base._init(self)
self:loadPackage("lorem")
end
function package:registerCommands ()
self:registerCommand("class:dedication", function(_, content)
SILE.call("hbox")
SILE.call("vfill")
SILE.call("center", {}, function()
SILE.call("font", { size = "20pt", style = "Italic" }, content)
end)
SILE.call("vfill")
end)
self:registerCommand("myappendix", function (options, _)
SILE.typesetter:typeset("Just a demo, no actual appendix")
end)
self:registerCommand("padpage", function (options, _)
local pages = SU.required(options, "pages", "padpage")
for i = 1, pages do
SILE.process({ "This page used to pad out a book length document" })
SILE.call("lorem", { words = 10 })
SILE.call("vfill")
end
end)
end
return package