Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only call 'noindent' if language is English in book commands #1991

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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