Skip to content

Commit

Permalink
chore(classes): Don't run :post hooks for un-numbered sectioning
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Mar 29, 2023
1 parent a675ec9 commit 128b78f
Showing 1 changed file with 23 additions and 17 deletions.
40 changes: 23 additions & 17 deletions classes/book.lua
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,16 @@ function class:registerCommands ()
level = 1,
msg = "book-chapter-title"
}, content)
if SU.boolean(options.numbering, true) then
local lang = SILE.settings:get("document.language")
local postcmd = "book:chapter:post"
if SILE.Commands[postcmd .. ":" .. lang] then
postcmd = postcmd .. ":" .. lang
end
SILE.call(postcmd)
end
SILE.process(content)
end)
local lang = SILE.settings:get("document.language")
local postcmd = "book:chapter:post"
if SILE.Commands[postcmd .. ":" .. lang] then
postcmd = postcmd .. ":" .. lang
end
SILE.call(postcmd)
SILE.call("book:chapterfont", {}, content)
SILE.call("left-running-head", {}, function ()
SILE.settings:temporarily(function ()
SILE.call("book:left-running-head-font", {}, content)
Expand All @@ -181,12 +183,14 @@ function class:registerCommands ()
toc = options.toc,
level = 2
}, content)
local lang = SILE.settings:get("document.language")
local postcmd = "book:section:post"
if SILE.Commands[postcmd .. ":" .. lang] then
postcmd = postcmd .. ":" .. lang
if SU.boolean(options.numbering, true) then
local lang = SILE.settings:get("document.language")
local postcmd = "book:section:post"
if SILE.Commands[postcmd .. ":" .. lang] then
postcmd = postcmd .. ":" .. lang
end
SILE.call(postcmd)
end
SILE.call(postcmd)
SILE.process(content)
end)
if not SILE.scratch.counters.folio.off then
Expand Down Expand Up @@ -221,12 +225,14 @@ function class:registerCommands ()
toc = options.toc,
level = 3
}, content)
local lang = SILE.settings:get("document.language")
local postcmd = "book:subsection:post"
if SILE.Commands[postcmd .. ":" .. lang] then
postcmd = postcmd .. ":" .. lang
if SU.boolean(options.numbering, true) then
local lang = SILE.settings:get("document.language")
local postcmd = "book:subsection:post"
if SILE.Commands[postcmd .. ":" .. lang] then
postcmd = postcmd .. ":" .. lang
end
SILE.call(postcmd)
end
SILE.call(postcmd)
SILE.process(content)
end)
SILE.typesetter:leaveHmode()
Expand Down

0 comments on commit 128b78f

Please sign in to comment.