Skip to content

Commit

Permalink
docs: micro-typography, font change and title page on the Lefevre exa…
Browse files Browse the repository at this point in the history
…mple
  • Loading branch information
Omikhleia authored and Didier Willis committed Apr 25, 2023
1 parent 775ff41 commit f914c94
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 38 deletions.
13 changes: 13 additions & 0 deletions classes/resilient/book.lua
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ function class:registerStyles ()

-- quotes
SILE.scratch.styles.alignments["block"] = "blockindent"
SILE.scratch.styles.alignments["quotation"] = "quoteindent"

self:registerStyle("blockquote", {}, {
font = { size = "0.95em" },
Expand Down Expand Up @@ -482,6 +483,18 @@ function class:registerCommands ()
end)
end, "Typeset its contents in a right and left indented block.")

self:registerCommand("quoteindent", function (_, content)
SILE.settings:temporarily(function ()
local indent = SILE.settings:get("book.blockquote.margin"):absolute() * 0.875
local lskip = SILE.settings:get("document.lskip") or SILE.nodefactory.glue()
local rskip = SILE.settings:get("document.rskip") or SILE.nodefactory.glue()
SILE.settings:set("document.lskip", SILE.nodefactory.glue(lskip.width + indent))
SILE.settings:set("document.rskip", SILE.nodefactory.glue(rskip.width + indent * 0.5))
SILE.process(content)
SILE.call("par")
end)
end, "Typeset its contents in a right and left indented block (variant).")

self:registerCommand("blockquote", function (_, content)
SILE.call("style:apply:paragraph", { name = "blockquote" }, content)
end, "Typeset its contents in a styled blockquote.")
Expand Down
12 changes: 8 additions & 4 deletions examples/lefevre-tuor-idril-styles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ blockquote:
origin: "resilient.book"
style:
font:
size: "0.95em"
size: "0.9583em"
paragraph:
after:
skip: "smallskip"
align: "block"
align: "quotation"
before:
skip: "smallskip"

Expand Down Expand Up @@ -149,7 +149,7 @@ footnote:
origin: "resilient.footnotes"
style:
font:
size: "0.8em"
size: "0.75em"
numbering:
display: "arabic"

Expand All @@ -160,7 +160,7 @@ footnote-marker:
after:
kern: "iwsp"
before:
kern: "-3.75nspc"
kern: "-3nspc"

footnote-marker-counter:
inherit: "footnote-marker"
Expand Down Expand Up @@ -404,6 +404,8 @@ lists-itemize6:
sectioning-base:
origin: "resilient.book"
style:
font:
family: "Libertinus Serif"
paragraph:
after:
indent: false
Expand Down Expand Up @@ -879,4 +881,6 @@ toc-pageno:
url:
origin: "resilient.book"
style:
font:
language: "und"

Loading

0 comments on commit f914c94

Please sign in to comment.