commit a3d8f1fdd9b4691b61e9f9a476a68f16b7d46677 Author: marius Date: Sun Jun 15 15:22:10 2025 +0200 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dd5e26f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +result +*.pdf diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..a200eb3 --- /dev/null +++ b/flake.lock @@ -0,0 +1,82 @@ +{ + "nodes": { + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1749285348, + "narHash": "sha256-frdhQvPbmDYaScPFiCnfdh3B/Vh81Uuoo0w5TkWmmjU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3e3afe5174c561dee0df6f2c2b2236990146329f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "typix": "typix" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "typix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1749285967, + "narHash": "sha256-YSV7TTCUAQcBJ3RUmQHbn7fDMTY4TjFGd20yzDQfZPk=", + "owner": "loqusion", + "repo": "typix", + "rev": "a586455f69a0c80a8f31ddb8fc34e3380b4477b2", + "type": "github" + }, + "original": { + "owner": "loqusion", + "repo": "typix", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..797abd1 --- /dev/null +++ b/flake.nix @@ -0,0 +1,155 @@ +{ + description = "A Typst project"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + typix = { + url = "github:loqusion/typix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + + flake-utils.url = "github:numtide/flake-utils"; + + # Example of downloading icons from a non-flake source + # font-awesome = { + # url = "github:FortAwesome/Font-Awesome"; + # flake = false; + # }; + }; + + outputs = inputs @ { + nixpkgs, + typix, + flake-utils, + ... + }: + flake-utils.lib.eachDefaultSystem (system: let + pkgs = nixpkgs.legacyPackages.${system}; + inherit (pkgs) lib; + + typixLib = typix.lib.${system}; + + src = typixLib.cleanTypstSource ./.; + commonArgs = { + typstSource = "main.typ"; + + fontPaths = [ + # Add paths to fonts here + # "${pkgs.roboto}/share/fonts/truetype" + "./template/resources" + ]; + + virtualPaths = [ + # Add paths that must be locally accessible to typst here + # { + # dest = "icons"; + # src = "${inputs.font-awesome}/svgs/regular"; + # } + # { + # dest = "./graphics/"; + # src = ./graphics; + # } + #{ + # dest = "./bibliography.bib"; + # src = ./bibliography.bib; + #} + { + dest = "./template/"; + src = ./template; + } + ]; + + + }; + + unstable_typstPackages = [ + { + name = "touying"; + version = "0.6.1"; + hash = "sha256-bTDc32MU4GPbUbW5p4cRSxsl9ODR6qXinvQGeHu2psU="; + } + { + name = "cetz-plot"; + version = "0.1.1"; + hash= "sha256-w5n7gCT6gDtxMvYjDhrwrPjT0b2M69whEUDByjTYDtQ="; + } + + { + name = "cetz"; + version = "0.3.4"; + hash = "sha256-5w3UYRUSdi4hCvAjrp9HslzrUw7BhgDdeCiDRHGvqd4="; + } + { + name = "cetz"; + version = "0.3.2"; + hash = "sha256-3Abz+31Y61rZUnnKlXayqIsEYEOaD47BQPUMwm0i0xA="; + } + { + name = "oxifmt"; + version = "0.2.1"; + hash = "sha256-8PNPa9TGFybMZ1uuJwb5ET0WGIInmIgg8h24BmdfxlU="; + } + { + name = "codly"; + version = "1.3.0"; + hash = "sha256-WcqvySmSYpWW+TmZT7TgPFtbEHA+bP5ggKPll0B8fHk="; + } + { + name = "codly-languages"; + version = "0.1.1"; + hash= "sha256-TSp3unFhn3NSaWhWYZb/i3rD4OolbNZNTdQeBxJ4Jfs="; + } + { + name = "fletcher"; + version = "0.5.8"; + hash = "sha256-kKVp5WN/EbHEz2GCTkr8i8DRiAdqlr4R7EW6drElgWk="; + } + ]; + + # Compile a Typst project, *without* copying the result + # to the current directory + build-drv = typixLib.buildTypstProject (commonArgs + // { + inherit src unstable_typstPackages; + }); + + # Compile a Typst project, and then copy the result + # to the current directory + build-script = typixLib.buildTypstProjectLocal (commonArgs + // { + inherit src unstable_typstPackages; + }); + + # Watch a project and recompile on changes + watch-script = typixLib.watchTypstProject commonArgs; + in { + checks = { + inherit build-drv build-script watch-script; + }; + + packages.default = build-drv; + + apps = rec { + default = watch; + build = flake-utils.lib.mkApp { + drv = build-script; + }; + watch = flake-utils.lib.mkApp { + drv = watch-script; + }; + }; + + devShells.default = typixLib.devShell { + inherit (commonArgs) fontPaths virtualPaths; + packages = [ + # WARNING: Don't run `typst-build` directly, instead use `nix run .#build` + # See https://github.com/loqusion/typix/issues/2 + # build-script + watch-script + # More packages can be added here, like typstfmt + # pkgs.typstfmt + ]; + }; + }); +} diff --git a/main.typ b/main.typ new file mode 100644 index 0000000..9c010d6 --- /dev/null +++ b/main.typ @@ -0,0 +1,30 @@ +#import "@preview/touying:0.6.1": * +#import "./template/conf.typ": * + +#show: tum-slides.with( + aspect-ratio: "16-9", + //language: "de", + config-info( + title: [Presentation Title], + // Author to be shown in the title slide + author: [Author], + // Author to be shown in the footer + footer-author: [Author], + date: datetime.today(), + ), +) + + += Section + +== First Slide + +- Content on the first slide + +== Second Slide + +- Content on the second slide + += Second Section + +== Last slide diff --git a/template/conf.typ b/template/conf.typ new file mode 100644 index 0000000..a0798c7 --- /dev/null +++ b/template/conf.typ @@ -0,0 +1,178 @@ +#import "@preview/touying:0.6.1": * + +#let slide(title: auto, ..args) = touying-slide-wrapper(self => { + let info = self.info + args.named() + if title != auto { + self.store.title = title + } + let header(self) = { + set align(top) + set text(fill: rgb("0065BD"), size: 25pt, weight: "bold") + place(top + right, + dx: -1em, + dy: 1em, + image("./resources/TUM_Logo_blau.svg", width: 7%) + ) + v(1.5em) + h(1em) + utils.display-current-heading(level: 1) + v(-1.6em) + linebreak() + h(1em) + set text(fill: rgb("005293"), size: 20pt) + if self.store.title != none { + utils.call-or-display(self, self.store.title) + } else { + utils.display-current-heading(level: 2) + } + } + let footer(self) = { + set align(bottom) + show: pad.with(.4em) + set text(size: 14pt) + h(1em) + h(1fr) + grid( + columns: (1fr, 4fr, 1fr, 1fr), + align: center, + grid.cell(align: left)[ + #h(1em) + #info.footer-author], + info.title, + utils.display-info-date(self), + grid.cell(align: right)[ + #context [#utils.slide-counter.display()/#utils.last-slide-number] #h(1em)] + ) + } + self = utils.merge-dicts( + self, + config-page( + header: header, + footer: footer, + ), + ) + touying-slide(self: self, ..args) +}) + +#let title-slide(..args) = touying-slide-wrapper(self => { + let info = self.info + args.named() + let header = { + set text(fill: rgb("0065BD"), size: 25pt, weight: "bold") + place(top + right, + dx: -1em, + dy: 1em, + image("./resources/TUM_Logo_blau.svg", width: 7%) + ) + place(top + left, + dy: 3em, + dx: 0.9em, + grid( + columns: (3fr, 1fr), + [ + #set text(fill: rgb("0065BD"), size: 32pt, weight: "bold") + #info.title + ] + ) + ) + } + let body = { + set text(weight: "bold") + v(5em) + info.author + + v(2em) + set text(weight: "regular") + utils.display-info-date(self) + + place(bottom + right, + dx: 2em, + dy: 2em, + image("./resources/TUM_Tower.png", width: 50%) + ) + } + self = utils.merge-dicts( + self, + config-page( + header: header, + ), + ) + touying-slide(self: self, body) +}) + +#let outline-slide(..args) = touying-slide-wrapper(self => { + let header = { + set text(fill: rgb("0065BD"), size: 25pt, weight: "bold") + place(top + right, + dx: -1em, + dy: 1em, + image("./resources/TUM_Logo_blau.svg", width: 7%) + ) + place(top + left, + dy: 3em, + dx: 0.9em, + grid( + columns: (3fr, 1fr), + [ + #set text(fill: rgb("0065BD"), size: 25pt, weight: "bold") + Outline + ] + ) + ) + } + let body = { + + show outline.entry: it => link( + it.element.location(), + [ + #it.body() #linebreak() #v(1em) + ] + ) + align(horizon)[ + #outline(title: none, depth: 1) + //#utils.slide-counter.update(0) + ] + } + self = utils.merge-dicts( + self, + config-page( + header: header, + ), + ) + touying-slide(self: self, body) +}) + +#let tum-slides( + aspect-ratio: "16-9", + footer: none, + ..args, + language: "en", + body, +) = { + set text(size: 20pt, font: "TUM Neue Helvetica", lang: language) + set par(spacing: 0.6em) + + show: touying-slides.with( + config-page( + paper: "presentation-" + aspect-ratio, + margin: (top: 5.5em, left: 1.2em), + ), + config-common( + slide-fn: slide, + datetime-format: "[day].[month].[year]" + ), + config-store( + title: none, + footer: footer, + ), + ..args, + ) + + + + title-slide() + + outline-slide() + + body +} + diff --git a/template/resources/TUMNeueHelvetica-Bold.ttf b/template/resources/TUMNeueHelvetica-Bold.ttf new file mode 100755 index 0000000..a6adbd5 Binary files /dev/null and b/template/resources/TUMNeueHelvetica-Bold.ttf differ diff --git a/template/resources/TUMNeueHelvetica-BoldItalic.ttf b/template/resources/TUMNeueHelvetica-BoldItalic.ttf new file mode 100755 index 0000000..e34f14a Binary files /dev/null and b/template/resources/TUMNeueHelvetica-BoldItalic.ttf differ diff --git a/template/resources/TUMNeueHelvetica-Italic.ttf b/template/resources/TUMNeueHelvetica-Italic.ttf new file mode 100755 index 0000000..c1b2de9 Binary files /dev/null and b/template/resources/TUMNeueHelvetica-Italic.ttf differ diff --git a/template/resources/TUMNeueHelvetica-Regular.ttf b/template/resources/TUMNeueHelvetica-Regular.ttf new file mode 100755 index 0000000..3b7b026 Binary files /dev/null and b/template/resources/TUMNeueHelvetica-Regular.ttf differ diff --git a/template/resources/TUM_Flags_169.png b/template/resources/TUM_Flags_169.png new file mode 100644 index 0000000..530a37b Binary files /dev/null and b/template/resources/TUM_Flags_169.png differ diff --git a/template/resources/TUM_Flags_43.png b/template/resources/TUM_Flags_43.png new file mode 100644 index 0000000..5aede51 Binary files /dev/null and b/template/resources/TUM_Flags_43.png differ diff --git a/template/resources/TUM_Logo_blau.svg b/template/resources/TUM_Logo_blau.svg new file mode 100644 index 0000000..b2219f8 --- /dev/null +++ b/template/resources/TUM_Logo_blau.svg @@ -0,0 +1,6 @@ + +image/svg+xmlTUM_Web_Logo_blau +TUM_Web_Logo_blau +TUM + + \ No newline at end of file diff --git a/template/resources/TUM_Tower.png b/template/resources/TUM_Tower.png new file mode 100644 index 0000000..79481eb Binary files /dev/null and b/template/resources/TUM_Tower.png differ diff --git a/template/resources/TUM_Tower_white.png b/template/resources/TUM_Tower_white.png new file mode 100644 index 0000000..7b08955 Binary files /dev/null and b/template/resources/TUM_Tower_white.png differ