From 3c9f203dedaa60b9e038136aa00ad7f858443e57 Mon Sep 17 00:00:00 2001 From: Ethan Reece Date: Thu, 26 Sep 2024 16:47:02 -0500 Subject: [PATCH] Move absolutely measured portions of header to src/base --- src/base/page.typ | 24 ++++++++++++++---------- src/base/page/header.typ | 8 ++++++++ src/page/essay/header.typ | 13 +++---------- src/page/essay/header/content.typ | 5 ----- 4 files changed, 25 insertions(+), 25 deletions(-) create mode 100644 src/base/page/header.typ delete mode 100644 src/page/essay/header/content.typ diff --git a/src/base/page.typ b/src/base/page.typ index c3734b2..fe91346 100644 --- a/src/base/page.typ +++ b/src/base/page.typ @@ -1,13 +1,17 @@ #let base_page( header: [], body -) = page( - paper: "us-letter", - margin: ( - x: 1in, - y: 1in, - ), - header: header, - header-ascent: 0in, - body -) +) = { + import "page/header.typ": base_page_header + + page( + paper: "us-letter", + margin: ( + x: 1in, + y: 1in, + ), + header: base_page_header(header), + header-ascent: 0in, + body + ) +} diff --git a/src/base/page/header.typ b/src/base/page/header.typ new file mode 100644 index 0000000..ce579fe --- /dev/null +++ b/src/base/page/header.typ @@ -0,0 +1,8 @@ +#let base_page_header(content) = block( + width: 100%, + height: 0.5in, + align( + right + top, + content + ) +) diff --git a/src/page/essay/header.typ b/src/page/essay/header.typ index e2b0839..f2d62db 100644 --- a/src/page/essay/header.typ +++ b/src/page/essay/header.typ @@ -1,12 +1,5 @@ #let page_essay_header(author_name_last: "") = { - import "header/content.typ": page_essay_header_content - - block( - width: 100%, - height: 0.5in, - align( - right + top, - page_essay_header_content(author_name_last: author_name_last) - ) - ) + author_name_last + " " + counter(page).display() } diff --git a/src/page/essay/header/content.typ b/src/page/essay/header/content.typ deleted file mode 100644 index 58fbbaf..0000000 --- a/src/page/essay/header/content.typ +++ /dev/null @@ -1,5 +0,0 @@ -#let page_essay_header_content(author_name_last: "") = { - author_name_last - " " - counter(page).display() -}