diff --git a/classes/book.lua b/classes/book.lua index c99b0820c..31d6bd035 100644 --- a/classes/book.lua +++ b/classes/book.lua @@ -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) @@ -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 @@ -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()