From d3a90d59d523a75173e39e1106105ef7f396a7f3 Mon Sep 17 00:00:00 2001 From: BestUsernameEver Date: Sat, 17 Feb 2024 13:40:51 -0500 Subject: [PATCH 1/6] =?UTF-8?q?=E2=9A=A1=20Changed=20width=20of=20title=20?= =?UTF-8?q?box=20based=20on=20title=20length?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/linear/entries.typ | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/themes/linear/entries.typ b/themes/linear/entries.typ index 297f44a..452eb27 100644 --- a/themes/linear/entries.typ +++ b/themes/linear/entries.typ @@ -50,15 +50,14 @@ #let body-entry(context: (:), body) = { show: page.with(margin: (top: 88pt), header: [ - #set align(center) - #set text(size: 30pt) - #box( - //baseline: 2pt, - fill: entry-type-metadata.at(context.type), - width: 300pt, - inset: 10pt, - [#context.title], - ) + #set text(size: 30pt) + #align(center, [ + #box( + fill: entry-type-metadata.at(context.type), + inset: 10pt, + [#context.title] + ) + ]) ], footer: [ #set align(left) Written by: From ee4c413f53a05465daee72ce267d1c986b9d4c81 Mon Sep 17 00:00:00 2001 From: BestUsernameEver Date: Sat, 17 Feb 2024 14:12:41 -0500 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=8E=A8=20Reformatted=20frontmatter=20?= =?UTF-8?q?headers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/linear/entries.typ | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/themes/linear/entries.typ b/themes/linear/entries.typ index 452eb27..6a9060b 100644 --- a/themes/linear/entries.typ +++ b/themes/linear/entries.typ @@ -37,11 +37,8 @@ show: page.with( //margin: (top: 8em), header: [ - #set align(center) #set text(size: 25pt) - - #context.title - + #align(center, [#context.title]) ], background: set-margins(8%, 8%), ) @@ -49,7 +46,8 @@ } #let body-entry(context: (:), body) = { - show: page.with(margin: (top: 88pt), header: [ + show: page.with(margin: (top: 88pt), + header: [ #set text(size: 30pt) #align(center, [ #box( @@ -58,12 +56,14 @@ [#context.title] ) ]) - ], footer: [ + ], + footer: [ #set align(left) Written by: #h(30%) Witnessed by: - ], background: set-margins(8%, 8%)) + ], + background: set-margins(8%, 8%)) show heading: it => { set-heading(it, context.type) From d1ee08f4df7cdcaece93e957031d29d826e55751 Mon Sep 17 00:00:00 2001 From: BestUsernameEver Date: Sun, 25 Feb 2024 00:13:24 -0500 Subject: [PATCH 3/6] =?UTF-8?q?=F0=9F=92=84=20Reprogrammed=20page=20border?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/linear/entries.typ | 87 ++++++++++++++++++++++++++++----------- themes/linear/format.typ | 57 ++++++++----------------- themes/linear/linear.typ | 2 +- 3 files changed, 81 insertions(+), 65 deletions(-) diff --git a/themes/linear/entries.typ b/themes/linear/entries.typ index 6a9060b..0831a76 100644 --- a/themes/linear/entries.typ +++ b/themes/linear/entries.typ @@ -35,35 +35,58 @@ #let frontmatter-entry(context: (:), body) = { show: page.with( - //margin: (top: 8em), header: [ #set text(size: 25pt) - #align(center, [#context.title]) + #set line(stroke: 1.5pt) + #align(center + horizon, grid(columns: (1fr, auto, 1fr), + [ + #line(length: 100%) + ], + [ + #h(20pt) + #context.title + #h(20pt) + ], + [ + #line(length: 100%) + ])) ], - background: set-margins(8%, 8%), ) + + set-border() + body } #let body-entry(context: (:), body) = { - show: page.with(margin: (top: 88pt), - header: [ - #set text(size: 30pt) - #align(center, [ - #box( - fill: entry-type-metadata.at(context.type), - inset: 10pt, - [#context.title] - ) - ]) - ], - footer: [ - #set align(left) - Written by: - #h(30%) - Witnessed by: - ], - background: set-margins(8%, 8%)) + show: page.with(margin: (top: 88pt), + header: [ + #set text(size: 30pt) + #set line(stroke: 1.5pt) + + #align(center + horizon, grid(columns: (1fr, auto, 1fr), + [ + #line(length: 100%) + ], + [ + #h(20pt) + #box(fill: entry-type-metadata.at(context.type), outset: 10pt, [#context.title]) + #h(20pt) + ], + [ + #line(length: 100%) + ])) + ], + + footer: [ + #set align(left) + Written by: + #h(30%) + Witnessed by: + ], + ) + + set-border() show heading: it => { set-heading(it, context.type) @@ -83,10 +106,24 @@ #let appendix-entry(context: (:), body) = { show: page.with(header: [ - #set align(center) #set text(size: 25pt) - #context.title - - ], background: set-margins(8%, 8%)) + #set line(stroke: 1.5pt) + #align(center + horizon, grid(columns: (1fr, auto, 1fr), + [ + #line(length: 100%) + ], + [ + #h(20pt) + #context.title + #h(20pt) + ], + [ + #line(length: 100%) + ])) + ] + ) + + set-border() + body } diff --git a/themes/linear/format.typ b/themes/linear/format.typ index 1616eb4..352c285 100644 --- a/themes/linear/format.typ +++ b/themes/linear/format.typ @@ -1,49 +1,28 @@ #import "entry-types.typ": * -/// Sets the length and width of the margins +/// Formats the border lines /// /// Example Usage: /// /// ```typ -/// #set-margins(8%, 15%) +/// #set-border() /// ``` -/// -/// - x (size, ratio): the distance from the edge of the page to the left and right margins -/// - y (size, ratio): the distance from the edge of the page to the bottom margin -/// -> content -#let set-margins(x, y) = { +#let set-border() = { + let top-axis = -8.4% // The title line height + let left-axis = -10% // 10% less than the automatic left border (0%) + let right-axis = 110% // 10% more than the automatic right border (100%) + let bottom-axis = 100% // The automatic bottom border + set line(stroke: 1.5pt) - // TL: top left - // TR: top right - let border-TL = 0% + 15% - let border-TR = 100% - 15% - place( - // Left border line - line(start: (0% + x, 5%), end: (0% + x, 100% - y)), - ) - place( - // Right border line - line(start: (100% - x, 5%), end: (100% - x, 100% - y)), - ) - place( - // Bottom border line - line(start: (0% + x, 100% - y), end: (100% - x, 100% - y)), - ) - place( - // TL border line -> —— - line(start: (0% + x, 5%), end: (border-TL + x, 5%)), - ) - place( - // TR border line -> —— - line(start: (100% - x, 5%), end: (border-TR - x, 5%)), - ) - place( - // TL border line -> ︱ - line(start: (border-TL + x, 4%), end: (border-TL + x, 6%)), - ) - place( - // TR border line -> ︱ - line(start: (border-TR - x, 4%), end: (border-TR - x, 6%)), - ) + // Top left border + place(line(start: (left-axis, top-axis), end: (0%, top-axis))) + // Top right border + place(line(start: (right-axis, top-axis), end: (100%, top-axis))) + // Left border + place(line(start: (left-axis, top-axis), end: (left-axis, bottom-axis))) + // Right border + place(line(start: (right-axis, top-axis), end: (right-axis, bottom-axis))) + // Bottom border + place(line(start: (left-axis, bottom-axis), end: (right-axis, bottom-axis))) } #let set-heading(it, type) = { diff --git a/themes/linear/linear.typ b/themes/linear/linear.typ index 1a82bbe..44760b7 100644 --- a/themes/linear/linear.typ +++ b/themes/linear/linear.typ @@ -1,6 +1,6 @@ #import "rules.typ": rules #import "entries.typ": cover, frontmatter-entry, body-entry, appendix-entry -#import "format.typ": set-margins, set-heading +#import "format.typ": set-border, set-heading #import "components/components.typ" #import "colors.typ": * From e44f5f01107007be02f28d9b2cbc2597a1254303 Mon Sep 17 00:00:00 2001 From: BestUsernameEver Date: Sun, 25 Feb 2024 00:26:12 -0500 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=90=9B=20Adjusted=20top=20and=20botto?= =?UTF-8?q?m=20borders=20for=20frontmatter=20and=20appendix=20entries?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/linear/entries.typ | 6 +++--- themes/linear/format.typ | 13 ++++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/themes/linear/entries.typ b/themes/linear/entries.typ index 0831a76..b21d1ee 100644 --- a/themes/linear/entries.typ +++ b/themes/linear/entries.typ @@ -53,7 +53,7 @@ ], ) - set-border() + set-border(context.type) body } @@ -86,7 +86,7 @@ ], ) - set-border() + set-border(context.type) show heading: it => { set-heading(it, context.type) @@ -123,7 +123,7 @@ ] ) - set-border() + set-border(context.type) body } diff --git a/themes/linear/format.typ b/themes/linear/format.typ index 352c285..59768b7 100644 --- a/themes/linear/format.typ +++ b/themes/linear/format.typ @@ -6,12 +6,19 @@ /// ```typ /// #set-border() /// ``` -#let set-border() = { +#let set-border(type) = { let top-axis = -8.4% // The title line height + let bottom-axis = 100% // The automatic bottom border + + // Adjusts top and bottom borders for frontmatter and appendix entries + if (type == none) { + top-axis = -6.6% + bottom-axis = 106% + } + let left-axis = -10% // 10% less than the automatic left border (0%) let right-axis = 110% // 10% more than the automatic right border (100%) - let bottom-axis = 100% // The automatic bottom border - + set line(stroke: 1.5pt) // Top left border place(line(start: (left-axis, top-axis), end: (0%, top-axis))) From 6a79c6825c647f48ad529d3d5855be70e825551c Mon Sep 17 00:00:00 2001 From: BestUsernameEver Date: Sun, 25 Feb 2024 00:29:48 -0500 Subject: [PATCH 5/6] =?UTF-8?q?=E2=9A=A1=20Tweaked=20border=20size?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/linear/format.typ | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/linear/format.typ b/themes/linear/format.typ index 59768b7..9006d42 100644 --- a/themes/linear/format.typ +++ b/themes/linear/format.typ @@ -16,8 +16,8 @@ bottom-axis = 106% } - let left-axis = -10% // 10% less than the automatic left border (0%) - let right-axis = 110% // 10% more than the automatic right border (100%) + let left-axis = -8% // 8% less than the automatic left border (0%) + let right-axis = 108% // 8% more than the automatic right border (100%) set line(stroke: 1.5pt) // Top left border From d0ccb5782e0bfb4f9eec3bc1a4f9140b4c5da8e8 Mon Sep 17 00:00:00 2001 From: BattleCh1cken Date: Sun, 25 Feb 2024 10:40:44 -0500 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=A9=B9=20Added=20a=20")"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- themes/linear/entries.typ | 1 + 1 file changed, 1 insertion(+) diff --git a/themes/linear/entries.typ b/themes/linear/entries.typ index c45db39..8d7d133 100644 --- a/themes/linear/entries.typ +++ b/themes/linear/entries.typ @@ -90,6 +90,7 @@ ] ) ], + ) set-border(context.type)