Skip to content

Commit

Permalink
feat(packages): Only call 'noindent' after chapter if language is E…
Browse files Browse the repository at this point in the history
…nglish
  • Loading branch information
jodros committed Feb 6, 2024
1 parent ebdbcc9 commit 021f524
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions classes/book.lua
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,11 @@ function class:registerCommands ()
SILE.call("nofoliothispage")
-- English typography (notably) expects the first paragraph under a section
-- not to be indented. Frenchies, don't use this class :)
SILE.call("noindent")
if lang == "en" then SILE.call("noindent") end
end, "Begin a new chapter")

self:registerCommand("section", function (options, content)
local lang = SILE.settings:get("document.language")
SILE.typesetter:leaveHmode()
SILE.call("goodbreak")
SILE.call("bigskip")
Expand All @@ -181,7 +182,6 @@ 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
Expand Down Expand Up @@ -209,11 +209,12 @@ function class:registerCommands ()
SILE.call("novbreak")
-- English typography (notably) expects the first paragraph under a section
-- not to be indented. Frenchies, don't use this class :)
SILE.call("noindent")
if lang == "en" then SILE.call("noindent") end
SILE.typesetter:inhibitLeading()
end, "Begin a new section")

self:registerCommand("subsection", function (options, content)
local lang = SILE.settings:get("document.language")
SILE.typesetter:leaveHmode()
SILE.call("goodbreak")
SILE.call("noindent")
Expand All @@ -224,7 +225,6 @@ 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
Expand All @@ -238,7 +238,7 @@ function class:registerCommands ()
SILE.call("novbreak")
-- English typography (notably) expects the first paragraph under a section
-- not to be indented. Frenchies, don't use this class :)
SILE.call("noindent")
if lang == "en" then SILE.call("noindent") end
SILE.typesetter:inhibitLeading()
end, "Begin a new subsection")

Expand Down

0 comments on commit 021f524

Please sign in to comment.