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

Added footnote support and improve balancing logic for parallel typesetting. #2212

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 47 additions & 30 deletions classes/diglot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,55 @@ local plain = require("classes.plain")
local class = pl.class(plain)
class._name = "diglot"

function class:_init (options)
plain._init(self, options)
self:loadPackage("counters")
function class:_init(options)
Omikhleia marked this conversation as resolved.
Show resolved Hide resolved
plain._init(self, options)

self:registerPostinit(function ()
SILE.scratch.counters.folio = { value = 1, display = "arabic" }
end)
self:registerPostinit(function()
SILE.scratch.counters.folio = { value = 1, display = "arabic" }
end)

self:declareFrame("a", {
left = "8.3%pw",
right = "48%pw",
top = "11.6%ph",
bottom = "80%ph",
})
self:declareFrame("b", {
left = "52%pw",
right = "100%pw-left(a)",
top = "top(a)",
bottom = "bottom(a)",
})
self:declareFrame("folio", {
left = "left(a)",
right = "right(b)",
top = "bottom(a)+3%ph",
bottom = "bottom(a)+8%ph",
})
self:loadPackage("parallel", {
frames = {
left = "a",
right = "b",
},
})
self:declareFrame("a", {
left = "2.5%pw",
right = "47.5%pw",
top = "3.5%ph",
-- bottom = "93.50%ph",
bottom = "85%ph",
})
self:declareFrame("b", {
left = "52.5%pw",
right = "100%pw-left(a)",
top = "top(a)",
bottom = "bottom(a)",
})
self:declareFrame("c", {
left = "left(a)",
right = "right(a)",
top = "bottom(a)",
bottom = "bottom(a)+10%ph", -- Adjust as needed for footnote space
})
self:declareFrame("d", {
left = "left(b)",
right = "right(b)",
top = "bottom(b)",
bottom = "bottom(b)+10%ph", -- Adjust as needed for footnote space
})
self:declareFrame("folio", {
left = "left(a)",
right = "right(b)",
top = "bottom(c)+1.5%ph",
bottom = "bottom(c)+4.75%ph",
})

self:loadPackage("parallel", {
frames = {
left = "a",
right = "b",
},
ftn_frames = {
ftn_left = "c",
ftn_right = "d",
},
})
end

return class