From c9b551f366dace119d117d82de675f58265c28da Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Fri, 19 Apr 2024 16:30:19 +0300 Subject: [PATCH] fix(layouts): Revamp pocket book layout matching a5trim usage --- layouts/cep.lua | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/layouts/cep.lua b/layouts/cep.lua index 087826a4..7be0161c 100644 --- a/layouts/cep.lua +++ b/layouts/cep.lua @@ -4,32 +4,39 @@ return function (class) if class._name == "cabook" then - class:loadPackage("masters", {{ - id = "right", - firstContentFrame = "content", - frames = { - content = { + class.defaultFrameset = { + content = { left = "left(page) + 20mm", right = "right(page) - 10mm", top = "top(page) + 20mm", bottom = "top(footnotes)" - }, - runningHead = { + }, + runningHead = { left = "left(content)", right = "right(content)", top = "top(content) - 10mm", bottom = "top(content) - 2mm" - }, - footnotes = { + }, + footnotes = { left = "left(content)", right = "right(content)", height = "0", bottom = "bottom(page) - 15mm" - } - } - }}) + }, + } - SILE.setCommandDefaults("imprint:font", { size = "7pt" }) + class:registerPostinit(function (_) + SILE.setCommandDefaults("imprint:font", { size = "7pt" }) + end) + + -- Hack to avoid SILE bug in print editions + -- See https://github.com/simoncozens/sile/issues/355 + class:registerCommand("href", function (options, content) + if class.options.verseindex then + SILE.call("markverse", options, content) + end + SILE.process(content) + end) end