Open ondohotola opened 1 year ago
The best I can think of at the moment, it to write something like:
#import "@local/din-5008-letter:0.1.0"
#let hooks = din-5008-letter.block-hooks(
pagenumber: (wordings: (:), styling: (:), extras: (:)) => locate(loc => if loc.page() > 1 {
set align(right)
text(styling.theme-color)[#loc.page()]
text(gray.darken(50%), " / " + str(counter(page).final(loc).at(0)))
}),
footer: locate(loc => if loc.page() == 1 [custom footer,\ which only appears on\ the first page])
)
#show: din-5008-letter.letter.with(block-hooks: hooks)
#for i in range(15).map(x => calc.abs(x - 7)) {
lorem(20 * i)
parbreak()
}
But you can notice, that the bottom margin of the 2nd page is not ideal. Unfortunately, typst doesn't yet allow for margins, which depend on pagenumbers.
Thank you,
The following (almost) works for me :-)-O
#let myfooter = text(size: 1em)[my footer\ and another line ]
and then
pagenumber: (
wordings: (:),
styling: (:),
extras: (:)) => locate(loc =>
if loc.page() > 1 {
align(right)[
#counter(page).display(
(number, total) => text[#number / #total#v(3em)],
both: true,
)
]
} else { align(center)[#line(length: 100%)#myfooter] }
),
I need to play with the line length a little as I have a line in the header where length: 100%
results in a wider line.
Can you revisit #3 again, because with 0.1.0 I don't l know any more how to turn the number off on the first page.
How do I turn off the footer for all but the first page, keeping the (self designed) footer in place?