From 80036332ebae0f7318aa7b8c9c02f80885904b70 Mon Sep 17 00:00:00 2001 From: Popa <115492561+Popa-42@users.noreply.github.com> Date: Fri, 11 Sep 2026 16:18:33 +0200 Subject: [PATCH] feat: rename CS template to formal template --- README.md | 4 ++-- examples/{computer-science.typ => formal.typ} | 6 +++--- lib.typ | 2 +- .../{computer-science.typ => formal.typ} | 20 +++++++++---------- src/theme.typ | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) rename examples/{computer-science.typ => formal.typ} (92%) rename src/templates/{computer-science.typ => formal.typ} (86%) diff --git a/README.md b/README.md index 5a94737..fe02368 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ Optional arguments: - `show-credits`: display the package credit (`false`) - `credits`: custom credit content -### `computer-science-template` +### `formal-template` A denser layout with (German) submission and attestation dates, optional digit grouping, and decimal-comma formatting. Required arguments are `sheetnumber`, @@ -107,7 +107,7 @@ Optional arguments: - `qed`: right-aligned square; `jb`: justified line break - `smallcaps` and `upper`: tracked small-cap and uppercase helpers -See `examples/base.typ` and `examples/computer-science.typ` for complete source +See `examples/base.typ` and `examples/formal.typ` for complete source examples. ## Fonts diff --git a/examples/computer-science.typ b/examples/formal.typ similarity index 92% rename from examples/computer-science.typ rename to examples/formal.typ index 0a12595..2478d36 100644 --- a/examples/computer-science.typ +++ b/examples/formal.typ @@ -1,6 +1,6 @@ -#import "@preview/clean-sheets:0.3.0": Cal, chevrons, computer-science-template, definition, exercise, korollar, lemma, qed +#import "@preview/clean-sheets:0.3.0": Cal, chevrons, formal-template, definition, exercise, korollar, lemma, qed -#show: body => computer-science-template( +#show: body => formal-template( 1, subtitle: [Vorlesung 1: Einführung in die Grundlagen], [Exemplarische Grundlagen I], @@ -17,7 +17,7 @@ attestations-until: datetime(day: 8, month: 1, year: 2027, hour: 10, minute: 0, second: 0), info-text: lorem(40), track-heading-counter: true, - page-numbering: "Blatt I von I", + page-numbering: "I von I", group-digits: true, decimal-comma: true, text-font: "Libertinus Serif", diff --git a/lib.typ b/lib.typ index 184b2bd..03b39ad 100644 --- a/lib.typ +++ b/lib.typ @@ -1,5 +1,5 @@ #import "src/templates/base.typ": base-template -#import "src/templates/computer-science.typ": computer-science-template +#import "src/templates/formal.typ": formal-template #import "src/helpers.typ": Cal, Complement, chevrons, german-date-time, group-digits-text, jb, qed #import "src/components/boxes.typ": axiom, corollary, definition, exercise, korollar, lemma, satz, theorem diff --git a/src/templates/computer-science.typ b/src/templates/formal.typ similarity index 86% rename from src/templates/computer-science.typ rename to src/templates/formal.typ index 400d4d1..c7551e1 100644 --- a/src/templates/computer-science.typ +++ b/src/templates/formal.typ @@ -1,9 +1,9 @@ #import "../config.typ": custom-raw-syntaxes -#import "../theme.typ": code-theme, common-theme, computer-science-theme, smallcaps +#import "../theme.typ": code-theme, common-theme, formal-theme, smallcaps #import "../helpers.typ": german-date-time, group-digits-text, render-footnote-entry -/// Computer science exercise sheet template. -#let computer-science-template( +/// Formal exercise sheet template. +#let formal-template( sheetnumber, subtitle: none, course, @@ -21,25 +21,25 @@ group-digits: false, decimal-comma: true, raw-syntaxes: custom-raw-syntaxes, - text-font: computer-science-theme.text-font, - math-font: computer-science-theme.math-font, + text-font: formal-theme.text-font, + math-font: formal-theme.math-font, table-header-smallcaps: false, no-pagebreak: false, body, ) = { - let font-size = computer-science-theme.font-size + let font-size = formal-theme.font-size set page( header: context { if counter(page).get().first() > 1 [ - #set text(computer-science-theme.header-size) + #set text(formal-theme.header-size) #grid( columns: (3fr, 2fr, 3fr), align(start)[_#course _], align(center)[*Übungsblatt #sheetnumber*], align(end)[#students.map(((name, matrNr)) => name).join(", ")], ) - #line(length: 100%, stroke: 0.4pt + computer-science-theme.divider) + #line(length: 100%, stroke: 0.4pt + formal-theme.divider) ] }, numbering: page-numbering, @@ -76,7 +76,7 @@ size: font-size - code-theme.size-offset, ) - show raw.where(block: true): box.with(..computer-science-theme.raw-block) + show raw.where(block: true): box.with(..formal-theme.raw-block) show raw.where(block: false): box.with(..code-theme.inline) show figure.where(kind: table): set block(breakable: true) @@ -126,7 +126,7 @@ ) #v(0.2cm) - #line(length: 100%, stroke: 0.4pt + computer-science-theme.divider) + #line(length: 100%, stroke: 0.4pt + formal-theme.divider) #v(0.3cm) #align(center)[ diff --git a/src/theme.typ b/src/theme.typ index 2504930..3077b8d 100644 --- a/src/theme.typ +++ b/src/theme.typ @@ -91,7 +91,7 @@ raw-block: code-theme.block, ) -#let computer-science-theme = ( +#let formal-theme = ( font-size: 10.5pt, text-font: fonts.cmu, math-font: fonts.cmu-math,