commit d22744d70ff8cc365fbd2e1f67591d1686980605 Author: Ernesto Martinez Garcia Date: Tue Mar 4 16:26:19 2025 +0100 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ed83e23 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.pdf +**/dhat-heap.json +model/ diff --git a/1.0.0/README.md b/1.0.0/README.md new file mode 100644 index 0000000..ac5aeb0 --- /dev/null +++ b/1.0.0/README.md @@ -0,0 +1,33 @@ +# Typst ISEC Slides Template + +An unofficial ISEC TUGraz Slides template + +Author: Ernesto Martínez García <[ecomaikgolf.com](https://ecomaikgolf.com)> + +> [!NOTE] +> If you are an ISEC or TUGraz employee and want it renamed to `isec-slides` or +> `tugraz-slides` I would need an approval to allocate the name :) + +## Design + +TODO + +## Contributing + +Contribute to the template in the [upstream repository](https://github.com/ecomaikgolf/typst-isec-slides-template) + +Check for [open issues](https://github.com/ecomaikgolf/typst-isec-slides-template) + +## Samples + +TODO + +## License `src/assets/tuglogo.svg` + +According to Wikipedia: + +> This logo image consists only of simple geometric shapes or text. It does not +> meet the threshold of originality needed for copyright protection, and is +> therefore in the public domain. [...] + +https://en.m.wikipedia.org/wiki/File:TU_Graz.svg diff --git a/1.0.0/src/assets/tuglogo.svg b/1.0.0/src/assets/tuglogo.svg new file mode 100644 index 0000000..e5d11af --- /dev/null +++ b/1.0.0/src/assets/tuglogo.svg @@ -0,0 +1,47 @@ + + + + + + + + + + diff --git a/1.0.0/src/colors.typ b/1.0.0/src/colors.typ new file mode 100644 index 0000000..6d68a3e --- /dev/null +++ b/1.0.0/src/colors.typ @@ -0,0 +1,87 @@ +// TUGraz +#let tug = rgb("e4154b") +#let isec = rgb("272733") +#let foot = rgb("e1e1e1") +#let web = rgb("0c5a77") + +// Faculties +#let csbme = rgb("19b4e3") +#let arch = rgb("0a98a2") +#let bauw = rgb("d68e23") +#let etec = rgb("68242c") +#let mach = rgb("3066ba") +#let chem = rgb("5e60a8") +#let math = rgb("1e6934") + +// ISEC research areas +#let crypto = rgb("a6c947") +#let system = rgb("1171a8") +#let formal = rgb("f7931e") +#let applied = rgb("7d219e") + +// Powerpoint palette +#let page = tug +#let fore = rgb("0f0f0f") +#let back = rgb("ffffff") +#let dark = rgb("3b5a70") +#let lite = rgb("eeece1") +#let head = rgb("245b78") +#let body = rgb("e2e9ed") +#let urlA = rgb("0066d8") +#let urlB = rgb("6c2f91") +#let colA = tug +#let colB = rgb("5191c1") +#let colC = rgb("a5a5a5") +#let colD = rgb("285f82") +#let colE = rgb("78b473") +#let colF = rgb("e59352") + + +#let tugred = colA +#let tuggreen = colE +#let tugblue = colD +#let tugyellow = colF +#let tugcyan = csbme +#let tugpurple = applied +#let tugviolet = chem +#let tugmagenta = tugpurple +#let tugturquoise = arch +#let tugbrown = etec +#let tugblack = fore +#let tugwhite = back +#let tuggray = colC +#let tuggrey = tuggray +#let tugdark = dark +#let tugmid = colB +#let tuglite = lite + +#let main = tug +#let head = isec +#let emph = colD +#let standout = head + +#let showcase = [ + #set rect(width: 7.4cm, height: 1.5cm) + #set text(fill: white) + #set align(center) + #grid(columns: 3, rows: 6, column-gutter: 1.8cm, row-gutter: 0.05cm, align: left, + rect(fill: isec)[isec], + rect(fill: tug)[tug = main], + rect(fill: colA)[colA = tugred], + rect(fill: csbme)[csbme = tugcyan], + rect(fill: fore)[fore], + rect(fill: colB)[colB = tugmid], + rect(fill: crypto)[crypto], + rect(fill: back)[#text(fill: black)[back]], + rect(fill: colC)[colC = tuggray], + rect(fill: system)[system], + rect(fill: foot)[#text(fill: black)[foot]], + rect(fill: colD)[colD = tugblue], + rect(fill: formal)[formal], + rect(fill: emph)[emph], + rect(fill: colE)[colE = tuggreen], + rect(fill: applied)[applied = tugpurple], + rect(fill: lite)[#text(fill: black)[lite]], + rect(fill: colF)[colF = tugyellow], + ) +] diff --git a/1.0.0/src/helper.typ b/1.0.0/src/helper.typ new file mode 100644 index 0000000..90f912b --- /dev/null +++ b/1.0.0/src/helper.typ @@ -0,0 +1,34 @@ +// -------------------------------------------------------------------------- +// Extra helper functions + +// Fix for typst #311 "Behavior of first line indentation in paragraphs ..." +// https://github.com/typst/typst/issues/311#issuecomment-2023038611 +#let fix-311 = context { + set par.line(numbering: none) + let a = par(box()) + a + v(-0.8 * measure(2 * a).width) +} + +// Transforms content into string +#let content-to-string(content) = { + if content.has("text") { + content.text + } else if content.has("children") { + content.children.map(content-to-string).join("") + } else if content.has("body") { + content-to-string(content.body) + } else if content == [ ] { + " " + } +} + +// partitle simulates \paragraph{title} (more or less) +#let partitle(title: [Title], body) = context [ + #block(above: 0.8cm)[ + *#title* #h(0.3cm) #body + ] + #fix-311 +] + +//vim:tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab colorcolumn=81 diff --git a/1.0.0/src/lib.typ b/1.0.0/src/lib.typ new file mode 100644 index 0000000..c22cb5b --- /dev/null +++ b/1.0.0/src/lib.typ @@ -0,0 +1,284 @@ +#import "@preview/polylux:0.4.0": * +#import "@preview/codly:1.2.0": * +#import "@preview/showybox:2.0.4": showybox +#import "@preview/cheq:0.2.2": * +#import "@preview/fontawesome:0.5.0": * + +#import "pages/title.typ": * +#import "pages/outline.typ": * +#import "colors.typ" + +#let slides( + title: none, + subtitle: none, + authors: none, + date: none, + footer: none, + progress: true, + extra: none, + body +) = [ + + + #let get-heading(level: 1) = context { + let ah = query(heading.where(level: level).after(here())) + let bh = query(heading.where(level: level).before(here())) + + if ah.len() > 0 { + let h = ah.first() + if h.location().page() == here().page() { + h.body + } else { + if bh.len() > 0 { + let h = bh.last() + h.body + } + } + } + } + + #show emph: it => { + text(colors.tug, it.body) + } + + // -------------------------------------------------------------------------- + // Text + + #set text(size: 20pt, lang: "en", region: "US", font: "Open Sans") + + // -------------------------------------------------------------------------- + // Page + + #set page( + paper: "presentation-16-9", + margin: ( + left: 1.49cm, + right: 1.48cm, + top: 2.6cm, + bottom: 1.6cm, + ), + header: [ + #set block(width: 100%) + #set text(fill: black) + + #grid(columns: (auto, 25%), gutter: 0pt, align: top, + block[ + #text(size: 24pt, weight: "semibold", get-heading()) + ], + block()[ + #align(top + right)[ + #v(-0.17cm) + #move(dx: 0.27cm)[ + #text(size: 13.5pt, weight: "medium")[isec.tugraz.at] + #h(0.1cm) + #box(inset: 0pt, outset: 0pt)[#square(width: 0.3cm, height: 0.3cm, outset: 0pt, inset: 0pt, stroke: none, fill: colors.tug)] + ] + ] + ], + ) + ], + footer: context [ + #let footer-body = [ + + #set block(height: 100%, width: 100%) + #set text(size: 15pt, fill: rgb("808080")) + + #grid(columns: (page.margin.bottom.length - 1.68%, 1.3%, auto, 2.5%), + gutter: 0pt, align: horizon, + block(fill: colors.tug)[ + #set align(center + horizon) + #set text(fill: white, size: 12pt) + #toolbox.slide-number + ], + block(), + block[ + #set align(left + horizon) + #set text(size: 13pt) + #footer + ], + block(), + ) + ] + + #let progress-body = [ + #set block(height: 2pt, width: 100%) + #toolbox.progress-ratio(ratio => { + grid( + columns: (ratio * 100%, 1fr), gutter: 0pt, + block(fill: colors.tug), + block(fill: colors.tug), + ) + }) + ] + + #show: toolbox.full-width-block[ + #stack(dir: ttb, + block(height: 100%, footer-body), + if progress { place(float: true, bottom)[#progress-body] } + ) + ] + ], + ) + + // -------------------------------------------------------------------------- + // Enumerate and listing + + #let default-map = ( + "x": text(fill: colors.tuggreen, fa-square-check()), + " ": text(fill: colors.tuggray, fa-square()), + "+": text(fill: colors.tuggreen, fa-plus-circle()), + "-": text(fill: colors.tug, fa-minus-circle()), + ">": text(fill: colors.tugblue, fa-arrow-circle-right()), + ) + + + // TODO not a big fan of doing this one + #show: checklist.with( + marker-map: default-map, + show-list-set-block: (above: 0.7em, below: 0.7em), + radius: 0pt, + ) + + // TODO improve + + #set list(indent: 0.48cm, body-indent: 1.2em, spacing: 0.4cm) + #set list(marker: ( + (move(dy: 0.11cm, square(width: 0.4em, height: 0.4em, fill: colors.tug))), + (move(dy: 0.11cm, square(width: 0.4em, height: 0.4em, fill: black))), + (move(dy: 0.11cm, square(width: 0.4em, height: 0.4em, fill: gray))), + )) + + //#show list.item.where(level: 1): set text(size: 10pt) + + #set enum(numbering: n => [ + #square(stroke: none, fill: colors.tug)[ + #align(center)[ + #text(fill: white)[#n] + ] + ] + ]) + + // -------------------------------------------------------------------------- + // Code listings + + #show raw.where(block: true): set text(size: 13pt) + + #show: codly-init.with() + #codly( + display-name: false, + display-icon: false, + radius: 0pt, + stroke: 1pt + black, + smart-indent: true, + zebra-fill: luma(240), + number-format: (number) => [#text(size: 12pt, fill: gray)[#number]], + number-align: right + horizon, + breakable: true) + + // -------------------------------------------------------------------------- + // Bibliography + + #set bibliography(title: "Bibliography", style: "ieee") + #set cite(style: "alphanumeric") + #show bibliography: set par(spacing: 0.4cm) + #show bibliography: set grid(align: top + left) + #show bibliography: set text(17pt) + #show bibliography: t => { + show grid.cell.where(x: 0): set text(fill: colors.tug) + show grid.cell.where(x: 0): set align(top + left) + show link: set text(fill: colors.tuggray) + t + } + + // -------------------------------------------------------------------------- + // Page + #show heading.where(level: 1): it => [ + #slide[ + // Hack to show the slides even if empty + #place(left + top, hide(square(width: 0pt, height: 0pt))) + ] + ] + + #title-slide(title, subtitle, authors, extra) + + #counter("logical-slide").update(0) + #set align(horizon) + + #body +] + +// Standout slides don't count as real slides in the official template +#let standout-slide(body) = [ + #set page(footer: none, header: none) + #set align(center) + #set text(size: 28pt) + #move(dy: -2.08cm)[ + #body + ] +] + +#let section-slide(section, subtitle) = [ + #set page(footer: none, header: none) + #set align(center) + + #slide[ + #move(dy: -0.3cm)[ + #text(size: 36pt)[#section] + + #v(-0.2cm) + #text(size: 20pt)[#subtitle] + ] + ] +] + +#let blank-slide(body) = [ + #set page(footer: none, header: none, margin: 0pt) + #set align(center) + + #slide[ + #body + ] +] + +#let highlight(color: colors.tug, fill: white, body) = [ + #box[ + #rect(fill: color, inset: (x: 0.2em, y: 0.4em))[ + #set text(fill: fill) + #body + ] + ] +] + +#let comment(body) = [ + #set text(fill: colors.tuggray, size: 16pt) + #body +] + +#let tblock(title, body, color: colors.tug, color-body: colors.lite) = [ + + #show emph: it => { + text(weight: "medium", fill: color, it.body) + } + + #showybox( + title-style: ( + color: white, + sep-thickness: 0pt, + ), + frame: ( + //inset: 0.4em, + radius: 0pt, + thickness: 0pt, + border-color: color, + title-color: color, + body-color: color-body, + inset: (x: 0.55em, y: 0.65em), + ), + above: 0.78em, + below: 0.78em, + title: title, + body + ) +] + +//vim:tabstop=2 softtabstop=2 shiftwidth=2 noexpandtab colorcolumn=81 diff --git a/1.0.0/src/pages/outline.typ b/1.0.0/src/pages/outline.typ new file mode 100644 index 0000000..1170f69 --- /dev/null +++ b/1.0.0/src/pages/outline.typ @@ -0,0 +1,15 @@ +#import "@preview/polylux:0.4.0": * +#import "../colors.typ" + +#let outline-slide() = [ + + #slide[ + = Outline + #let outline = toolbox.all-sections((sections, _current) => { + enum(..sections) + }) + #outline.fields() + #type(outline) + ] + +] diff --git a/1.0.0/src/pages/title.typ b/1.0.0/src/pages/title.typ new file mode 100644 index 0000000..460e4e3 --- /dev/null +++ b/1.0.0/src/pages/title.typ @@ -0,0 +1,101 @@ +#import "@preview/polylux:0.4.0": * +#import "../colors.typ" + +#let title-slide(title, subtitle, authors, extra) = [ + + + + #let footer-isec = [ + #set text(size: 13.3pt, weight: "medium") + + #let arrow-icon = [ + #move(dy: -0.05cm, dx: -0.05cm, + rotate(45deg, + square(fill: none, size: 0.18cm, stroke: ( + "top": colors.tug + 1.35pt, + "bottom": none, + "right": colors.tug + 1.35pt, + "left": none, + )) + ) + ) + ] + + #v(0.4cm) + #box(arrow-icon) #h(0.1cm) isec.tugraz.at + ] + + #set page(footer: footer-isec, header: none) + #set block(below: 0pt, above: 0pt) + + #slide[ + + #place(top + right, dy: -1.9cm, dx: 0.78cm, + [ + #set align(right) + #set text(size: 12pt, tracking: 3.6pt) + + #image("../assets/tuglogo.svg", width: 4.1cm) + + #v(0.13cm) + + #move(dx: -0.07cm)[ + SCIENCE + ] + + #v(0.65em) + + #move(dx: -0.03cm)[ + PASSION + ] + + #v(0.65em) + + #move(dx: -0.06cm)[ + TECHNOLOGY + ] + + ] + ) + + + #v(0.8cm) + + #block(width: 70%)[ + #let title = text(size: 40.5pt, weight: "bold")[#title] + + #move(dx: 0.04em)[ + #grid(columns: (0.195cm, auto), column-gutter: 0.7cm, + context [ + #let s = measure(title) + #move(dy: -0.4cm, rect(fill: colors.tug, height: s.height + 0.65cm)) + ], + title + ) + ] + ] + + #v(0.6cm) + + #block(width: 70%)[ + #text(size: 28.3pt, fill: colors.tug, weight: "bold")[#subtitle] + ] + + #v(1.48cm) + + #block(width: 70%)[ + #set text(size: 19pt) + #for author in authors [ + #author #h(1.1em) + ] + ] + + #v(0.95cm) + + #block(width: 70%)[ + #extra + ] + + ] + +] diff --git a/1.0.0/template/bibliography.bib b/1.0.0/template/bibliography.bib new file mode 100644 index 0000000..8497860 --- /dev/null +++ b/1.0.0/template/bibliography.bib @@ -0,0 +1,13 @@ +// You can use LaTeX's bibliography format per default +// or +// Typst's Hayagriva: +// https://github.com/typst/hayagriva/blob/main/docs/file-format.md + +@software{emg25template, + author = {Ernesto Martínez García}, + year = {2025}, + month = {1}, + title = {{Typst ISEC Master's Thesis Template}}, + url = {https://github.com/ecomaikgolf/typst-isec-master-thesis-template}, + urldate = {2025-01-01} +} // Update urldate! diff --git a/1.0.0/template/slides.typ b/1.0.0/template/slides.typ new file mode 100644 index 0000000..c2e41ee --- /dev/null +++ b/1.0.0/template/slides.typ @@ -0,0 +1,116 @@ +#import "@local/definitely-not-isec-slides:1.0.0": * + +// ---------------------------------------------------------------------------- +// Configuration +// ---------------------------------------------------------------------------- +#show: slides.with( + title: [ Long Paper Title #linebreak() with One to Three Lines], + subtitle: [ An optional short subtitle ], + authors: ( [*First Author*], [Second Author], [Third Author], ), + date: [ 29th Jan 2025 ], + footer: [ First Author ], + extra: [ SomeConf 2025 ], + progress: false, +) + += List + +- First point... +- Second point... + - Subpoint... + - Subpoint... +- Third point... + += List and Figure + +#grid(columns: (1fr, 1fr), + [ + 1. First point... + 2. Second point... + 3. Third point... + ], + [ + #rect(width: 95%, height: 60%) + ] +) + +#standout-slide[Standout slide] + +#section-slide([Section Header], [Optional subtitle or figure]) + += Blocks + +#tblock([Color], color: colors.tugblue)[ + Highlighted content: _Emphasis_, a + _b_ = c, _n-dimensional_ +] + +#tblock([Alert Block])[ + Important content: _Alert_, a + _b_ = c +] + +#tblock([Example Block], color: colors.tuggreen)[ + Example content +] + +#block[ + #set align(horizon) + + #highlight[Highlight (main)] + #highlight(color: colors.tugblue)[Highlight (empth)] + Normal text + #comment[Minor comment] +] + += Color Palette + +#v(-1.5cm) +#colors.showcase + += Lists with FontAwesome + + +Checklist: + +- [x] Item 1 +- [x] Item 2 +- [ ] Item 3 + +Advantages and Disadvantages: + +- [+] Advantage +- [-] Disadvantage +- [>] Conclusion + +- this is a test + += Color Scheme for PGFplots: Lines + += Color Scheme for PGFplots: Fill + += Code Listings + +Powered by codly: + +```cpp +int main() { + std::vector test(50); +} +``` + +```sh +#!/bin/bash + +exit 0 +``` + += Usable Area + +#rect(width: 100%, height: 100%, fill: colors.tugmid) + += Acknowledgements + +This is a test@emg25template + +#bibliography("bibliography.bib") + + diff --git a/1.0.0/thumbnail.png b/1.0.0/thumbnail.png new file mode 100644 index 0000000..c865493 Binary files /dev/null and b/1.0.0/thumbnail.png differ diff --git a/1.0.0/typst.toml b/1.0.0/typst.toml new file mode 100644 index 0000000..45177ae --- /dev/null +++ b/1.0.0/typst.toml @@ -0,0 +1,17 @@ +[package] +name = "definitely-not-isec-slides" +version = "1.0.0" +entrypoint = "src/lib.typ" +authors = ["Ernesto Martínez "] +license = "MIT" +description = "An unofficial ISEC TUGraz slides template" +repository = "https://github.com/ecomaikgolf/typst-isec-slides-template" +categories = ["slides"] +disciplines = ["computer-science", "engineering"] +keywords = ["ISEC", "Institute of Information Security", "IAIK", "TUGraz", "Graz University of Technology", "thesis", "template", "Master Thesis"] +compiler = "0.13.0" + +[template] +path = "template" +entrypoint = "slides.typ" +thumbnail = "thumbnail.png" diff --git a/CITATION.cff b/CITATION.cff new file mode 100644 index 0000000..4cc12e0 --- /dev/null +++ b/CITATION.cff @@ -0,0 +1,18 @@ +cff-version: 1.2.0 +title: Typst ISEC Slides Template +message: >- + ISEC Typst Slides Template +type: software +authors: + - given-names: Ernesto Martínez García + email: me@ecomaikgolf.com + affiliation: ISEC Graz University of Technology +repository-code: >- + https://github.com/ecomaikgolf/typst-isec-slides-template +keywords: + - typst + - template + - slides + - isec + - iaik + - tugraz diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f6f6c5e --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Ernesto Martínez García + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..180980b --- /dev/null +++ b/README.md @@ -0,0 +1,74 @@ +# Typst ISEC Slides Template + +Quickstart (CLI): + +> [!NOTE] +> This is temporary and the template will be upstreamed in Typst Universe so +> that not a single clone is needed + +```sh +git clone git@github.com:ecomaikgolf/typst-isec-slides-template.git ~/.local/share/typst/packages/local/definitely-not-isec-slides/ +typst init @preview/definitely-not-isec-slides:1.0.0 slides +``` +Tested typst version: `0.13.0`. + +## Typst + +### What's Typst? + +A modern typesetting system which has: + +- Milisecond incremental (memoized) builds¹ +- Subsecond full builds¹ +- Multithreaded builds per pagebreak +- Easy rustc-like compiler error messages (and no intermediates!) +- Transparent multiple compiler passes (no more mklatex/makefiles) +- Simple & powerful scripting and syntax +- WebAssembly plugin support (python/js interpreters in your thesis? Sure) + +Migrating from LaTeX? Check the [migration guide](https://typst.app/docs/guides/guide-for-latex-users/) + +¹: This is obviously not a serious benchmark and depends on the document. But + it's fast trust me + +### Quick usage + +Start incremental compilations with: + +```sh +typst watch slides.typ +``` + +then open the generated PDF: + +```sh +xdg-open slides.typ +``` + +Now edit `slides.typ` and it will be incrementally built in each save. + +Incremental builds are blazingly fast, but regular PDF rendering (on the +viewer) is a bottleneck here. + +Use tinymist with neovim's `:TypstPreview` (or VSCode plugin), which uses the +browser to do PDF partial renderings and previews will be even more responsive. +No need for running `typst watch` now. It even has features like cursor sync, +click to jump, etc. + +## Design + +TODO + +## Samples + +TODO + +## License `src/assets/tuglogo.svg` + +According to Wikipedia: + +> This logo image consists only of simple geometric shapes or text. It does not +> meet the threshold of originality needed for copyright protection, and is +> therefore in the public domain. [...] + +https://en.m.wikipedia.org/wiki/File:TU_Graz.svg