To suppress headers and footers on otherwise empty versos, I use:
// see https://forum.typst.app/t/how-can-i-suppress-headers-and-footers-on-blank-verso-trailing-pages/4384/9
// and referenced git page for limitations
#show selector.or(
pagebreak.where(to: "odd"),
pagebreak.where(to: "even"),
): set page(header: none, footer: none)
To place folios bottom center on h1 pages, and in the top margins on other content pages, I use:
#import "@preview/hydra:0.6.2": hydra
#let hydraver = "0.6.2"
// consider changing quads to nuts if page numbering goes
// over 999, or creat a variable that adapts automatically
// as page count grows
#let folio_recto(pageno) = context {
box(width:0em, height: 1em)[
#place(dx: marginalia.get-right().sep)[
#box(height: 1em)[|]
#box(height: 1em, width: marginalia.get-right().width)[
#align(right)[#(counter(page).display())
#sym.space.en]
]
]
]
}
#let folio_verso(pageno) = context {
box(width:0em)[
#align(right)[
#place(dx: 0em - marginalia.get-left().width - marginalia.get-left().sep)[
#sym.space.en
#(counter(page).display())
]
|
#h(marginalia.get-left().sep)
]
]
}
// Why the 3pt offest on verso?
#let placefolio(pageno, is-odd) = {
let headerbase = 2 * LINESIZE
if is-odd {
place(top + right,
dy: headerbase - 6pt,
folio_recto(pageno))
} else {
place(top + left,
dy: headerbase - 3pt,
folio_verso(pageno))
}
}
// for the header test is-start-chapter, see
// https://github.com/typst/typst/issues/1613#issuecomment-2437415579
#set page(
footer-descent: 0pt,
footer: context {
let chapters = query(
selector(heading.where(level: 1)).before(here())
)
let is-start-chapter() = chapters.len() > 0 and chapters.last().location().page() == here().page()
if is-start-chapter() {
align(center, counter(page).display())
}
},
header: context {
let is-start-chapter() = query(
heading.where(level: 1).after(here())
)
.map(h => h.location().page())
.at(0, default: 0) == here().page()
if not is-start-chapter() {// always not start
placefolio(
counter(page).display(),
calc.odd(here().page()))
if calc.odd(here().page()) {
h(1fr)
hydra(2, display: (_, it) => { emph(it.body)})
} else {
hydra(1, display: (_, it) => { emph(it.body)})
h(1fr)
}
}
},
)
(LINESIZE is elsewhere defined as the FONTSIZE plus leading. I find the default Typst settings for these unusable and struggle to come up with a good alternative, but for now use
#set text(
font: "Libertinus Serif",
number-type: "old-style",
size: FONTSIZE,
top-edge: LINESIZE,
bottom-edge: LINESIZE,
hyphenate: true,
costs: (hyphenation: 70%),
lang: "en",
)
)
You can obviously chose not to place the folio on h1 pages.
Chapter epigraphs are simple. Just insert something like this before the chapter heading to which it applies:
#[
#pagebreak(to: "even")
#set page(
footer: none,
header: none)
#v(1fr)
#chapterEpigraph(
label: <qAmis-K01>,
width: 80%,
attribution: [Kingsley Amis],
note: [Kingsley Amis in "Letters to the Editor" in #emph[The
Times] (of London) (1983, 11) on February 22],
)[
Sir. No, "more means worse" was not what I said 20 years ago
about the expansion of higher education (leader, February 18).
What I wrote in 1960 was "more will mean worse." I think the
difference is substantial, but let that go for now. You show
by your misquotation that you couldn't be bothered to look up
the reference, thereby ignoring the context, any arguments or
evidence put forward, etc.
Having garbled my remark you say roundly that in the event I
was wrong. Not altogether, perhaps. Laziness and incuriosity
about sources are familiar symptoms of academic decline.
#endnote[The Kingsey Amis letter was quoted, in part, by Nigel
Rees in BrFQ at 8·2. The letter was in response to #emph[The
Times] misquoting "MORE WILL MEAN WORSE" as "more is worse".
According to Rees, Amis used the phrase in a July 1960
#emph[Encounter] magazine article in reference to the
expansion of higher education and what Amis described as the
"delusion that there are thousands of young people who are
capable of benefiting from university training but have
somehow failed to find their way there." The phrase was in
running caps in that article. Amis clearly intended it to
indicate a shouted statement. How much of the letter is the
result of editing by the paper and how much is Amis' work is
not clear. Newspapers typically reserve the right to make
changes that they feel improve the letter without notice to
the author.
Despite Amis' snarky protestation, the phrase "more means
less" continues to be associated with him.]
]
#v(2fr)
]
Where the chapterEpigraph function is whatever you want it to be to format the epigraph.
There may well be more efficient ways to accomplish all of these. I am just working my way into many parts of Typst.