From 4c22a19cc781fc4d2e3c9f1ed3ab517a5d5c882b Mon Sep 17 00:00:00 2001 From: servostar Date: Thu, 4 Apr 2024 12:55:30 +0200 Subject: [PATCH] fixed appendix page header --- src/pages/appendix.typ | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/pages/appendix.typ b/src/pages/appendix.typ index 85938fd..dd4daea 100644 --- a/src/pages/appendix.typ +++ b/src/pages/appendix.typ @@ -1,8 +1,31 @@ +#import "../prelude.typ" as prelude // ------------------------------------------ // Appendix setup // ------------------------------------------ +// function for filtering out all heading which are not of level 1 +#let filter_heading(heading) = { + heading.level == 1 +} + +#set page( + binding: left, + header-ascent: 2em, + header: locate(loc => { + let current_heading = query(selector(heading).after(here())).filter(filter_heading).first() + table(columns: (1fr, auto), + align: (left, right), + stroke: none, + inset: (top: 0pt, bottom: 0.5em, left: 0pt, right: 0pt), + text(size: prelude.to_pt(prelude.format.font-size))[#current_heading.body], + text(size: prelude.to_pt(prelude.format.font-size), counter(page).display("1")), + table.hline() + ) + }), + footer: "" +) + #set heading(numbering: none) = Appendix