Skip to content

Commit

Permalink
Merge pull request #2 from Omikhleia/1-parindent-issue
Browse files Browse the repository at this point in the history
Improper initialization and paragraph indent issue
  • Loading branch information
Omikhleia authored Apr 3, 2023
2 parents 4690893 + 8eda10e commit 23a9264
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/fancytoc/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ package._name = "fancytoc"
function package:_init (options)
base._init(self, options)

self.class:loadPackage("framebox")
self.class:loadPackage("parbox")
self.class:loadPackage("leaders")
pcall(function () return self.class:loadPackage("resilient.styles") end) -- Optional
self:registerStyles()
end

local function linkWrapper (dest, func)
Expand Down Expand Up @@ -63,8 +65,6 @@ function package:findToc (packages)
end

function package:registerCommands ()
self:registerStyles()

self:registerCommand("fancytableofcontents", function (options, _)
local linking = SU.boolean(options.linking, true)

Expand Down Expand Up @@ -109,6 +109,7 @@ function package:registerCommands ()
SILE.call("hfill")
SILE.call("bracebox", { bracewidth = "0.8em"}, function()
SILE.call("parbox", { valign = "middle", width = "75%lw" }, function ()
SILE.settings:set("document.parindent", SILE.length())
for _, c in ipairs(v.children) do
SILE.call("parbox", { valign = "top", strut = "rule", minimize = true, width = "80%lw" }, function ()
SILE.settings:set("document.lskip", SILE.length("1em"))
Expand Down

0 comments on commit 23a9264

Please sign in to comment.