From e2e4d39b802f697a8e1ba88f93237f77344c2856 Mon Sep 17 00:00:00 2001 From: gapato Date: Tue, 16 Jun 2026 14:52:42 +0200 Subject: [PATCH] =?UTF-8?q?refactor,=20document=20=E2=86=92=C2=A0report,?= =?UTF-8?q?=20option=20to=20underline=20headings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 +++++----- src/lib.pdf | Bin 2316 -> 0 bytes src/lib.typ | 15 +++++++++++---- template/{document.typ => report.typ} | 5 ++--- typst.toml | 6 +++--- 5 files changed, 21 insertions(+), 15 deletions(-) delete mode 100644 src/lib.pdf rename template/{document.typ => report.typ} (81%) diff --git a/README.md b/README.md index d4ebb84..2cf0908 100644 --- a/README.md +++ b/README.md @@ -13,15 +13,15 @@ typship download -n local https://imsc.uni-graz.at/git/gjankowiak/typst-uniforli #### Manually ```bash -mkdir -p ~/.local/share/typst/packages/local/uniforlife-document/ -cd ~/.local/share/typst/packages/local/uniforlife-document/ -curl https://imsc.uni-graz.at/git/gjankowiak/typst-uniforlife-template/archive/0.0.1.tar.gz | tar zx --xform 's/typst-uniforlife-document/0.0.1/' +mkdir -p ~/.local/share/typst/packages/local/uniforlife-report/ +cd ~/.local/share/typst/packages/local/uniforlife-report/ +curl https://imsc.uni-graz.at/git/gjankowiak/typst-uniforlife-template/archive/0.0.2.tar.gz | tar zx --xform 's/typst-uniforlife-report/0.0.2/' ``` ## Quickstart (CLI) ```sh -typst init @local/uniforlife-document document +typst init @local/uniforlife-report report ``` -Tested typst version: `0.14.0`. +Tested typst version: `0.15.0`. diff --git a/src/lib.pdf b/src/lib.pdf deleted file mode 100644 index 908ef243bf0523fff897c76fb63622da441ae2a4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2316 zcma)8&2Hm15N^?%fW8CaB4`#1TR*lOOOUld>;z2{WewZiZV~K(k!VF5NmMBsR&wft z^i6u`BlQ(JL&>)6>;|ig$>BG{`QtY}nN2UdX75Zp`3pWxGl@a?{b$YdG(z;{Q^ANn zqcJOSJK^hG5)+r#NmP=%0ifrfG~d@)9-*3MeL;UA#X6Kr!PuO0iQ03XvVayu-2(e5 zl}siX+_flZ4hWDfnaE1KT%ZaH5}Bem^$v{kJZ>voWV;_8KI5KB$Z6SZwe)tvXDm%%UMdnXr@(v|L`4r-(z_j(YDaT1CtYgOD@PM zbWACU(K81<>kVEI@Cd6*PN%MASVLoA4ouq|n)X}6`q?lPMrkKJe;wG0=j`C}CLYHb z;)Qk3229e3N{W)j`d+F={utb}g7e;01q~meBKIs#@^Rqw*w<6ChQ^k zgRY&N}3zsE(an~vk?hNW9p7ZBa@DVMbB=H*X~fhj9PkrWb= zMbIF<=W99cz@5sODBKw>)*@9Vqflqi+1MDm*)zevt>;;>L+52rMbQg+rdPB8q;Y@@ zg4eNGb^u?_;@9y~FXFvM(aOewD{ug=^Z^N(&kDEcvnA)L-)=QeKR)%M&`oI`ui<^w z$v>xYy+{+E<(`iDgJr!?hx&mIT7>RRR!`WMK6Y={7?(%JofUx+TD%R$OFM`m`w0B&660I%LU1-}u-w z-~M*9xc+!A#Px%fcNh5Z0}~}E_%Mn*jHfNDE7WTJre^S(V6}UY{{BJ3{o{^+=lTWW8Xa&)%@z}2 zij>Dl7Ao_5PTledLCR4qdjm~HPFb#)tDYR&(YBuy0Tqu|`HJtz9|bHTFbQ!wC{ij5 z76MtXXj-DI=KT)|+b}T`Y{h`w+v8)J2*BgR*KaKJ1Qc47Sb>UW5Jxk19~s(q-zKXc zcQO-L8$XioWg{3cM>1;wGv!FuHz5N@vcc%3J$vZ9zzrRkl!vzt-4q$k&h52#2R3q{ { + let heading_text = if smallcaps_headings {smallcaps(it)} else {it} + if underline_headings { + block(stroke: (bottom: darkyellow+0.2em), inset: (bottom: 0.05em))[#heading_text] + } else { + heading_text + } } show link: it => underline(stroke: yellow+0.2em, offset: 0.15em, evade: false, background: true)[#it] @@ -63,7 +70,7 @@ set par(spacing: leading, leading: leading, first-line-indent: 2em, justify: tru set text(top-edge: 0.7em, fontsize, lang: lang) v(-0.5cm) -align(center)[#text(1.1em)[#underline(stroke: darkyellow+0.5em, extent: 0.1em, offset: 0.05em, evade: false, background: true)[#smallcaps([=== *#title*])]]] +align(center)[#text(1.1em)[#underline(stroke: darkyellow+0.3em, extent: 0.1em, offset: 0.05em, evade: false, background: true)[#smallcaps([#heading(numbering: none, outlined: false, level: 2)[*#title*]])]]] v(0.5cm) body diff --git a/template/document.typ b/template/report.typ similarity index 81% rename from template/document.typ rename to template/report.typ index fa96ec7..2211d2c 100644 --- a/template/document.typ +++ b/template/report.typ @@ -1,6 +1,6 @@ -#import "@local/uniforlife-document:0.0.1": document +#import "@local/uniforlife-document:0.0.2": report -#document( +#report( title: [Antigravity cuisine], task: [Recipe for fried eggs], university: [University of Graz], @@ -15,7 +15,6 @@ #lorem(200) - // #bibliography("refs.bib") ] diff --git a/typst.toml b/typst.toml index 9e233a0..a88b094 100644 --- a/typst.toml +++ b/typst.toml @@ -1,6 +1,6 @@ [package] -name = "uniforlife-document" -version = "0.0.1" +name = "uniforlife-report" +version = "0.0.2" entrypoint = "src/lib.typ" authors = ["Gaspard Jankowiak"] license = "MIT" @@ -13,4 +13,4 @@ compiler = "0.14.0" [template] path = "template" -entrypoint = "document.typ" +entrypoint = "report.typ"