Skip to content

Commit

Permalink
Merge branch 'twoside-foo'
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Sep 6, 2022
2 parents e958e5b + 6bdf239 commit b62e8c5
Show file tree
Hide file tree
Showing 16 changed files with 126 additions and 253 deletions.
27 changes: 8 additions & 19 deletions layouts/a4.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,31 @@ return function (class)

class.defaultFrameset = {
content = {
left = "32mm",
right = "100%pw-32mm",
top = "34mm",
left = "left(page) + 32mm",
right = "right(page) - 32mm",
top = "top(page) + 34mm",
bottom = "top(footnotes)"
},
runningHead = {
left = "left(content)",
right = "right(content)",
top = "24mm",
bottom = "30mm"
top = "top(page) + 24mm",
bottom = "top(page) + 30mm"
},
footnotes = {
left = "left(content)",
right = "right(content)",
height = "0",
bottom = "100%ph-34mm"
bottom = "bottom(page) - 34mm"
},
folio = {
left = "left(content)",
right = "right(content)",
top = "100%ph-32mm",
bottom = "100%ph-26mm"
top = "bottom(page) - 32mm",
height = "6mm"
}
}

class:loadPackage("masters", {{
id = "right",
firstContentFrame = "content",
frames = class.defaultFrameset
}})

class:loadPackage("twoside", {
oddPageMaster = "right",
evenPageMaster = "left"
})

-- We have a bound A4 format too, but this one doesn't need double-page openers
class:registerCommand("open-spread", function ()
SILE.typesetter:leaveHmode()
Expand Down
27 changes: 8 additions & 19 deletions layouts/a4ciltli.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,31 @@ return function (class)

class.defaultFrameset = {
content = {
left = "38mm",
right = "100%pw-26mm",
top = "bottom(runningHead)+4mm",
left = "left(page) + 38mm",
right = "right(page) - 26mm",
top = "bottom(runningHead) + 4mm",
bottom = "top(footnotes)"
},
runningHead = {
left = "left(content)",
right = "right(content)",
top = "24mm",
bottom = "30mm"
top = "top(page) + 24mm",
height = "6mm"
},
footnotes = {
left = "left(content)",
right = "right(content)",
height = "0",
bottom = "top(folio)-4mm"
bottom = "top(folio) - 4mm"
},
folio = {
left = "left(content)",
right = "right(content)",
top = "100%ph-30mm",
bottom = "100%ph-24mm"
top = "bottom(page) - 30mm",
height = "6mm"
}
}

class:loadPackage("masters", {{
id = "right",
firstContentFrame = "content",
frames = class.defaultFrameset
}})

class:loadPackage("twoside", {
oddPageMaster = "right",
evenPageMaster = "left"
})

end

end
29 changes: 10 additions & 19 deletions layouts/a5trim.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,43 +6,34 @@ return function (class)

class.defaultFrameset = {
content = {
left = "22.5mm",
right = "100%pw-15mm",
top = "20mm",
left = "left(page) + 22.5mm",
right = "right(page) - 15mm",
top = "top(page) + 20mm",
bottom = "top(footnotes)"
},
runningHead = {
left = "left(content)",
right = "right(content)",
top = "top(content)-8mm",
bottom = "top(content)-2mm"
top = "top(page) + 12mm",
bottom = "top(page) + 18mm"
},
footnotes = {
left = "left(content)",
right = "right(content)",
height = "0",
bottom = "100%ph-18mm"
bottom = "bottom(page) - 18mm"
},
folio = {
left = "left(content)",
right = "right(content)",
top = "100%ph-12mm",
top = "bottom(page) - 12mm",
height = "6mm"
}
}

class:loadPackage("masters", {{
id = "right",
firstContentFrame = "content",
frames = class.defaultFrameset
}})

class:loadPackage("twoside", {
oddPageMaster = "right",
evenPageMaster = "left"
})

SILE.setCommandDefaults("imprint:font", { size = "8.5pt" })
class:registerPostinit(function (class)
SILE.setCommandDefaults("imprint:font", { size = "8.5pt" })
end)

-- Hack to avoid SILE bug in print editions
-- See https://github.com/simoncozens/sile/issues/355
Expand Down
23 changes: 7 additions & 16 deletions layouts/a6.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,16 @@ return function (class)

class.defaultFrameset = {
content = {
left = "12mm",
right = "100%pw-12mm",
top = "12mm",
bottom = "100%ph-12mm"
left = "left(page) + 12mm",
right = "right(page) - 12mm",
top = "top(page) + 12mm",
bottom = "bottom(page) - 12mm"
}
}

class:loadPackage("masters", {{
id = "right",
firstContentFrame = "content",
frames = class.defaultFrameset
}})

class:loadPackage("twoside", {
oddPageMaster = "right",
evenPageMaster = "left"
})

SILE.setCommandDefaults("imprint:font", { size = "6.5pt" })
class:registerPostinit(function (class)
SILE.setCommandDefaults("imprint:font", { size = "6.5pt" })
end)

end

Expand Down
23 changes: 7 additions & 16 deletions layouts/a6trim.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,16 @@ return function (class)

class.defaultFrameset = {
content = {
left = "12mm",
right = "100%pw-12mm",
top = "12mm",
bottom = "100%ph-12mm"
left = "left(page) + 12mm",
right = "right(page) - 12mm",
top = "top(page) + 12mm",
bottom = "bottom(page) - 12mm"
}
}

class:loadPackage("masters", {{
id = "right",
firstContentFrame = "content",
frames = class.defaultFrameset
}})

class:loadPackage("twoside", {
oddPageMaster = "right",
evenPageMaster = "left"
})

SILE.setCommandDefaults("imprint:font", { size = "6.5pt" })
class:registerPostinit(function (class)
SILE.setCommandDefaults("imprint:font", { size = "6.5pt" })
end)

end

Expand Down
23 changes: 7 additions & 16 deletions layouts/a7.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,16 @@ return function (class)

class.defaultFrameset = {
content = {
left = "12mm",
right = "100%pw-6mm",
top = "8mm",
bottom = "100%ph-6mm"
left = "left(page) + 12mm",
right = "right(page) - 6mm",
top = "top(page) + 8mm",
bottom = "bottom(page) - 6mm"
}
}

class:loadPackage("masters", {{
id = "right",
firstContentFrame = "content",
frames = class.defaultFrameset
}})

class:loadPackage("twoside", {
oddPageMaster = "right",
evenPageMaster = "left"
})

SILE.setCommandDefaults("imprint:font", { size = "7pt" })
class:registerPostinit(function (class)
SILE.setCommandDefaults("imprint:font", { size = "7pt" })
end)

end

Expand Down
23 changes: 7 additions & 16 deletions layouts/a7kart.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,13 @@ return function (class)

class.defaultFrameset = {
content = {
left = "8mm",
right = "100%pw-8mm",
top = "8mm",
bottom = "100%ph-8mm"
left = "left(page) + 8mm",
right = "right(page) - 8mm",
top = "top(page) + 8mm",
bottom = "bottom(page) - 8mm"
}
}

class:loadPackage("masters", {{
id = "right",
firstContentFrame = "content",
frames = class.defaultFrameset
}})

class:loadPackage("twoside", {
oddPageMaster = "right",
evenPageMaster = "left"
})

class:registerCommand("output-right-running-head", function () end)

class:registerCommand("output-left-running-head", function () end)
Expand All @@ -35,7 +24,9 @@ return function (class)
SILE.typesetter:leaveHmode()
end)

SILE.setCommandDefaults("imprint:font", { size = "7pt" })
class:registerPostinit(function (class)
SILE.setCommandDefaults("imprint:font", { size = "7pt" })
end)

end

Expand Down
23 changes: 7 additions & 16 deletions layouts/a7trimkart.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,13 @@ return function (class)

class.defaultFrameset = {
content = {
left = "8mm",
right = "100%pw-8mm",
top = "8mm",
bottom = "100%ph-8mm"
left = "left(page) + 8mm",
right = "right(page) - 8mm",
top = "top(page) + 8mm",
bottom = "bottom(page) - 8mm"
}
}

class:loadPackage("masters", {{
id = "right",
firstContentFrame = "content",
frames = class.defaultFrameset
}})

class:loadPackage("twoside", {
oddPageMaster = "right",
evenPageMaster = "left"
})

class:registerCommand("output-right-running-head", function () end)

class:registerCommand("output-left-running-head", function () end)
Expand All @@ -35,7 +24,9 @@ return function (class)
SILE.typesetter:leaveHmode()
end)

SILE.setCommandDefaults("imprint:font", { size = "7pt" })
class:registerPostinit(function (class)
SILE.setCommandDefaults("imprint:font", { size = "7pt" })
end)

end

Expand Down
23 changes: 6 additions & 17 deletions layouts/app.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,25 @@ return function (class)

class.defaultFrameset = {
content = {
left = "2mm",
right = "100%pw-2mm",
top = "bottom(runningHead)+2mm",
left = "left(page) + 2mm",
right = "rigt(page) - 2mm",
top = "bottom(runningHead) + 2mm",
bottom = "top(footnotes)"
},
runningHead = {
left = "left(content)",
right = "right(content)",
top = "2mm",
bottom = "14mm"
top = "top(page) + 2mm",
height = "12mm"
},
footnotes = {
left = "left(content)",
right = "right(content)",
height = "0",
bottom = "100%ph-2mm"
bottom = "bottom(page) - 2mm"
}
}

class:loadPackage("masters", {{
id = "right",
firstContentFrame = "content",
frames = class.defaultFrameset
}})

class:loadPackage("twoside", {
oddPageMaster = "right",
evenPageMaster = "left"
})

class:registerCommand("output-right-running-head", function (_, _)
if not SILE.scratch.headers.right then return end
SILE.typesetNaturally(SILE.getFrame("runningHead"), function ()
Expand Down
Loading

0 comments on commit b62e8c5

Please sign in to comment.