From 2b91a16d7d103b487386f8a1f4a846c80baed4ab Mon Sep 17 00:00:00 2001 From: servostar Date: Mon, 11 Nov 2024 18:38:11 +0100 Subject: [PATCH 1/4] fix: unexpected opening parenthesis --- src/lib.typ | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib.typ b/src/lib.typ index 812412d..771f01d 100644 --- a/src/lib.typ +++ b/src/lib.typ @@ -13,9 +13,7 @@ #import "glossary.typ": glossary #import "pages/titlepage.typ": new_title_page #import "pages/declaration-of-authorship.typ": new_declaration_of_authorship -#import "pages/confidentiality-statement.typ": ( - new_confidentiality_statement_page, -) +#import "pages/confidentiality-statement.typ": new_confidentiality_statement_page #import "pages/prerelease-note.typ": new_prerelease_note #import "pages/outline.typ": new_outline #import "pages/abstract.typ": new_abstract -- 2.40.1 From 4573e873441b66808b028c163637795d1a0ce712 Mon Sep 17 00:00:00 2001 From: servostar Date: Tue, 3 Dec 2024 09:22:02 +0100 Subject: [PATCH 2/4] feat: consider included files and relative paths --- run-fmt.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/run-fmt.sh b/run-fmt.sh index b4fee1c..ffc07d9 100755 --- a/run-fmt.sh +++ b/run-fmt.sh @@ -17,7 +17,7 @@ function format() { exit 1 fi - local imports=$(rg "#import \"([a-z0-9/\-]+\.typ)\"" -Nor '$1' "$1") + local imports=$(rg "#import \"([a-z0-9/\-.]+\.typ)\"" -Nor '$1' "$1") # format all included files while IFS= read -r line; do @@ -26,6 +26,16 @@ function format() { fi format "$wd/$line" "$2" done <<< "$imports" + + local includes=$(rg "#import \"([a-z0-9/\-.]+\.typ)\"" -Nor '$1' "$1") + + # format all included files + while IFS= read -r line; do + if [ -z "$line" ]; then + continue + fi + format "$wd/$line" "$2" + done <<< "$includes" } case $1 in -- 2.40.1 From 266ae6f468056d648ff2609141637b38e90cc4a0 Mon Sep 17 00:00:00 2001 From: servostar Date: Tue, 3 Dec 2024 09:22:15 +0100 Subject: [PATCH 3/4] build: switch to unstable --- shell.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell.nix b/shell.nix index 12fabe3..54657e1 100644 --- a/shell.nix +++ b/shell.nix @@ -1,5 +1,5 @@ let - nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-24.11"; + nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-unstable"; pkgs = import nixpkgs { config = {}; overlays = []; }; in -- 2.40.1 From acb5c8027c68a1558bb3bed011c150bf8c0e7010 Mon Sep 17 00:00:00 2001 From: servostar Date: Tue, 3 Dec 2024 09:22:25 +0100 Subject: [PATCH 4/4] style: run typstyle --- src/conf.typ | 125 +++++++++++++----------- src/glossary.typ | 1 - src/lib.typ | 4 +- src/pages/abstract.typ | 1 - src/pages/confidentiality-statement.typ | 1 - src/pages/declaration-of-authorship.typ | 1 - src/pages/outline.typ | 1 - src/pages/prerelease-note.typ | 1 - src/style.typ | 1 - 9 files changed, 71 insertions(+), 65 deletions(-) diff --git a/src/conf.typ b/src/conf.typ index 131a294..02b6303 100644 --- a/src/conf.typ +++ b/src/conf.typ @@ -11,64 +11,75 @@ // default configuration #let default-config = ( - // language settings used to make decisions about hyphenation and others - lang: "en", // ISO 3166 language code of text: "de", "en" - region: "en", // region code - // mark this thesis as draft - // Adds preleminarry note page and watermark - draft: true, - // information about author(s) - university: ( - program: "Informationtechnology", - faculty: "Technik", - name: "dualen Hochschule Baden-Württemberg", - campus: "Eppelheim" + // language settings used to make decisions about hyphenation and others + lang: "en", // ISO 3166 language code of text: "de", "en" + region: "en", // region code + // mark this thesis as draft + // Adds preleminarry note page and watermark + draft: true, + // information about author(s) + university: ( + program: "Informationtechnology", + faculty: "Technik", + name: "dualen Hochschule Baden-Württemberg", + campus: "Eppelheim", + ), + supervisor-signature: false, + authors: ((), ()), + // information about thesis + thesis: ( + title: "Unofficial ABB/DHBW Typst template", + subtitle: "for reports and thesises", // subtitle may be none + submission-date: "23rd march 2020", + timeframe: "1st january 2020 - 20th march 2020", + kind: "T2000", + // translated version of abstract, only used in case language is not english + summary: none, + abstract: none, + preface: none, + keywords: ("IT", "other stuff"), + bibliography: none, /* bibliography("refs.bib") */ + glossary: none, + appendices: none, + ), + style: ( + header: ( + content-padding: 1.5em, + underline-top-padding: 0pt, + logo-height: 5em, + logo-image: "res/ABB.svg", ), - supervisor-signature: false, - authors: ((),()), - // information about thesis - thesis: ( - title: "Unofficial ABB/DHBW Typst template", - subtitle: "for reports and thesises", // subtitle may be none - submission-date: "23rd march 2020", - timeframe: "1st january 2020 - 20th march 2020", - kind: "T2000", - // translated version of abstract, only used in case language is not english - summary: none, - abstract: none, - preface: none, - keywords: ( "IT", "other stuff" ), - bibliography: none /* bibliography("refs.bib") */, - glossary: none, - appendices: none), - style: ( - header: ( - content-padding: 1.5em, - underline-top-padding: 0pt, - logo-height: 5em, - logo-image: "res/ABB.svg"), - footer: ( - content-padding: 1.5em), - page: ( - format: "a4", - margin: ( - left: 3cm, - right: 2.5cm, - top: 2.5cm, - bottom: 2.5cm)), - text: ( - size: 12pt, - font: "Fira Sans"), - heading: ( - font: "Fira Sans"), - code: ( - theme: "res/abb.tmTheme", - font: "FiraCode Nerd Font", - lines: false, - size: 10pt, - tab-size: 4), - link: ( - color: ABB-GRAY-02))) + footer: ( + content-padding: 1.5em, + ), + page: ( + format: "a4", + margin: ( + left: 3cm, + right: 2.5cm, + top: 2.5cm, + bottom: 2.5cm, + ), + ), + text: ( + size: 12pt, + font: "Fira Sans", + ), + heading: ( + font: "Fira Sans", + ), + code: ( + theme: "res/abb.tmTheme", + font: "FiraCode Nerd Font", + lines: false, + size: 10pt, + tab-size: 4, + ), + link: ( + color: ABB-GRAY-02, + ), + ), +) // Insert a dictionary `update` into `base` but only the entries of update that also exist in base // Runs recursively on all sub dictionaries diff --git a/src/glossary.typ b/src/glossary.typ index 8cbb8c3..d6d674c 100644 --- a/src/glossary.typ +++ b/src/glossary.typ @@ -8,7 +8,6 @@ // License: MIT #let glossary(entries, config) = { - assert( type(entries) == dictionary, message: "The glossary is not a dictionary", diff --git a/src/lib.typ b/src/lib.typ index 771f01d..812412d 100644 --- a/src/lib.typ +++ b/src/lib.typ @@ -13,7 +13,9 @@ #import "glossary.typ": glossary #import "pages/titlepage.typ": new_title_page #import "pages/declaration-of-authorship.typ": new_declaration_of_authorship -#import "pages/confidentiality-statement.typ": new_confidentiality_statement_page +#import "pages/confidentiality-statement.typ": ( + new_confidentiality_statement_page, +) #import "pages/prerelease-note.typ": new_prerelease_note #import "pages/outline.typ": new_outline #import "pages/abstract.typ": new_abstract diff --git a/src/pages/abstract.typ b/src/pages/abstract.typ index 8fa3e76..b14adb3 100644 --- a/src/pages/abstract.typ +++ b/src/pages/abstract.typ @@ -8,7 +8,6 @@ #let new_abstract(config) = ( context { - set align(center + horizon) // only include summary when a language other than english is used diff --git a/src/pages/confidentiality-statement.typ b/src/pages/confidentiality-statement.typ index 474a8f6..c655082 100644 --- a/src/pages/confidentiality-statement.typ +++ b/src/pages/confidentiality-statement.typ @@ -8,7 +8,6 @@ #let new_confidentiality_statement_page(config) = ( context { - pagebreak(weak: true) let thesis = config.thesis diff --git a/src/pages/declaration-of-authorship.typ b/src/pages/declaration-of-authorship.typ index ca4ff75..4438d43 100644 --- a/src/pages/declaration-of-authorship.typ +++ b/src/pages/declaration-of-authorship.typ @@ -8,7 +8,6 @@ #let new_declaration_of_authorship(config) = ( context { - pagebreak(weak: true) let thesis = config.thesis diff --git a/src/pages/outline.typ b/src/pages/outline.typ index 143e4ce..e650f21 100644 --- a/src/pages/outline.typ +++ b/src/pages/outline.typ @@ -12,7 +12,6 @@ // NOTE: will not render in case the listing is empty #let render_filtered_outline(title: str, kind: selector) = ( context { - let elems = query(figure.where(kind: kind)) let count = elems.len() diff --git a/src/pages/prerelease-note.typ b/src/pages/prerelease-note.typ index ecbf9a7..7b08660 100644 --- a/src/pages/prerelease-note.typ +++ b/src/pages/prerelease-note.typ @@ -8,7 +8,6 @@ #let new_prerelease_note(config) = ( context { - pagebreak(weak: true) let thesis = config.thesis diff --git a/src/style.typ b/src/style.typ index 9615f94..4ac3150 100644 --- a/src/style.typ +++ b/src/style.typ @@ -296,7 +296,6 @@ if current-page == 1 { // logo moved to content - } else if query() .first() .location() -- 2.40.1