diff --git a/packages/preview/touying-simpres/0.2.0/LICENSE b/packages/preview/touying-simpres/0.2.0/LICENSE new file mode 100644 index 0000000000..333ceb5fda --- /dev/null +++ b/packages/preview/touying-simpres/0.2.0/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 thy0s + +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/packages/preview/touying-simpres/0.2.0/README.md b/packages/preview/touying-simpres/0.2.0/README.md new file mode 100644 index 0000000000..5081342fc5 --- /dev/null +++ b/packages/preview/touying-simpres/0.2.0/README.md @@ -0,0 +1,80 @@ +# touying-simpres + +[![Build Document](https://github.com/thy0s/touying-simpres/actions/workflows/build.yml/badge.svg)](https://github.com/thy0s/touying-simpres/actions/workflows/build.yml) +[![Repo](https://badgen.net/static/GitHub/Repo/blue?icon=github)](https://github.com/thy0s/touying-simpres) +[![License](https://badgen.net/static/License/MIT/blue)](https://opensource.org/license/mit) + +"Simpres" slide template for the [typst](https://typst.app) presentation package [touying](https://touying-typ.github.io). + +It uses the *Source Sans 3* font as default, which can be downloaded [here](https://api.fontsource.org/v1/download/source-sans-3). + + +You can either initialize the template in a new folder with: +```bash +typst init @preview/touying-simpres:0.1.0 +``` + +... or import the template to an existing document with: + +```typst +#import "@preview/touying-simpres:0.1.0": * +``` + +## Configuration + +Use `#show: touying-simpres.with()` to configure the template as needed. + +- `aspect-ratio`: Default is *"16-9"*, alternatively *"4-3"* +- `lang`: The language of the respective presentation (*default "en"*) +- `font`: The font of the presentation (*default "Source Sans 3"*) +- `text-size`: Size of the text content (*default "22pt"*) +- `show-level-one`: (bool) Show section heading on the content slides (*default: true*) +- `footer`: The footer of the content slides (*default: none*) + +Other parameters, such as `title`, `subtitle`, `author`, `date` and `institution` are taken from the `config-info` object, which looks as follows: + +```typst + config-info( + title: [The "Simpres" slide template], + subtitle: [Straightforward Presentations], + author: [thy0s], + date: datetime.today(), + institution: [Funk Town State University], + ) +``` + +## Slide types +- `#outline-slide`: Dedicated outline slide with 2 parameters + + `depth`: Maximum heading level to display (*default: 2*) + + `title`: Override the default *"Outline"*, e.g. when using a different language +- `#focus-slide` - High contrast slide with no configuration options + +The template also shows a `#new-section-slide` for every level one heading and allows for overriding the default settings of `show-level-one` and `footer` by calling the `#slide` function directly. + +## Credit +Parts of this template were inspired by and taken from the [university theme](https://github.com/touying-typ/touying/blob/main/themes/university.typ) and the [metropolis theme](https://github.com/touying-typ/touying/blob/main/themes/metropolis.typ) aswell as the [clean-math-presentation](https://github.com/JoshuaLampert/clean-math-presentation). + +## Contribution +If you have any problems with this template feel free to open an issue. Also, if you have anything usefult to add to this template, you can open a pull request and it will be looked at. + +All constructive contributions are welcome and highly appreciated! + +## Examples + +### Title Slide +![0](thumbnail.png) + +### Outline Slide +![1](https://github.com/thy0s/touying-simpres/blob/assets/images/outline.png) + +### Section Slide +![2](https://github.com/thy0s/touying-simpres/blob/assets/images/section_heading.png) + +### Content Slide (Without L1 Heading) +![3](https://github.com/thy0s/touying-simpres/blob/assets/images/content.png) + +### Content Slide (With L1 Heading) +![6](https://github.com/thy0s/touying-simpres/blob/assets/images/content_l1.png) + +### Focus Slide +![5](https://github.com/thy0s/touying-simpres/blob/assets/images/focus.png) diff --git a/packages/preview/touying-simpres/0.2.0/lib.typ b/packages/preview/touying-simpres/0.2.0/lib.typ new file mode 100644 index 0000000000..32764a13ff --- /dev/null +++ b/packages/preview/touying-simpres/0.2.0/lib.typ @@ -0,0 +1,215 @@ + +/// "Simpres" theme by thy0s +/// Inspired by and partially taken from: +/// - https://github.com/touying-typ/touying/blob/main/themes/university.typ +/// - https://github.com/touying-typ/touying/blob/main/themes/metropolis.typ +/// - https://github.com/JoshuaLampert/clean-math-presentation + +#import "@preview/touying:0.7.4": * + +/// Standard content "slide": +/// - "title" (string) sets the title if function is called directly. +/// - "footer" (string) allows for overriding the default footer for the presentation. +/// - "show-level-one" (bool) allows for toggling the level 1 heading of an individual slide. +#let slide( + title: auto, + footer: auto, + show-level-one: none, + ..args, +) = touying-slide-wrapper(self => { + if title != auto { + self.store.title = title + } + if footer != auto { + self.store.footer = footer + } + let header(self) = { + set align(top) + show: components.cell.with(fill: self.colors.primary, inset: 1em) + set align(horizon) + set text(fill: self.colors.neutral-lightest, size: .7em) + + if show-level-one == true or self.store.show-level-one and show-level-one != false { + utils.display-current-heading(level: 1) + linebreak() + } + + set text(size: 1.8em, weight: "bold") + 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(fill: self.colors.neutral-darkest, size: .7em) + utils.call-or-display(self, self.store.footer) + h(1fr) + context utils.slide-counter.display() + " / " + utils.last-slide-number + } + self = utils.merge-dicts( + self, + config-page( + header: header, + footer: footer, + ), + ) + touying-slide(self: self, ..args) +}) + +/// "title-slide": +/// - Title, subtitle, presenter, institution and date are taken directly from the "config-info" +#let title-slide( + config: (:), + extra: none, + ..args, +) = touying-slide-wrapper(self => { + self = utils.merge-dicts( + self, + config, + config-common(freeze-slide-counter: true), + config-page(fill: self.colors.neutral-lightest), + ) + let info = self.info + args.named() + let body = { + set text(fill: self.colors.neutral-darkest) + set std.align(horizon) + block( + width: 100%, + inset: 2em, + { + text(size: 1.5em, text(weight: "bold", fill: self.colors.primary, info.title)) + if info.subtitle != none { + linebreak() + block(spacing: 1em, text(weight: "medium", info.subtitle)) + } + line(length: 100%, stroke: 2pt + self.colors.primary) + set text(size: .9em) + if info.author != none { + block(spacing: 1em, info.author) + } + if info.institution != none { + block(spacing: 1em, info.institution) + } + if info.date != none { + block(spacing: 1em, info.date.display("[year]-[month]-[day]")) + } + if extra != none { + block(spacing: 1em, extra) + } + }, + ) + } + touying-slide(self: self, body) +}) + +///"outline-slide" based on the standard slide: +/// - depth: Describes the max heading level displayed in the outline +/// - title: Modify the title of the outline slide (e.g. for different languages) +#let outline-slide( + depth: 2, + title: "Outline", +) = slide( + title: title, + show-level-one: false, +)[ + #show outline.entry.where(level: 1): it => strong(it) + #components.adaptive-columns( + outline( + title: none, + indent: auto, + depth: depth, + ), + ) +] + +/// "new-section-slide" is shown for every level one heading (i.e. section headings): +/// - numbered: Display the heading number if it exists (default: true) +#let new-section-slide( + config: (:), + numbered: true, + body, +) = touying-slide-wrapper(self => { + let slide-body = { + set std.align(horizon) + show: pad.with(20%) + set text(size: 1.8em, fill: self.colors.primary, weight: "bold") + stack( + dir: ttb, + spacing: .65em, + utils.display-current-heading(level: 1, numbered: numbered), + block( + height: 2pt, + width: 100%, + spacing: 0pt, + components.progress-bar(height: 2pt, self.colors.primary, self.colors.secondary), + ), + ) + body + } + touying-slide(self: self, config: config, slide-body) +}) + +#let focus-slide(body) = touying-slide-wrapper(self => { + self = utils.merge-dicts( + self, + config-page( + fill: self.colors.primary, + margin: 2em, + ), + ) + set text(fill: self.colors.neutral-lightest, size: 2em) + touying-slide(self: self, align(horizon + center, body)) +}) + + +/// "touying-simpres": +/// - "aspect-ratio" - Set the format of the slides (default: 16-9), (alternatively 4-3) +/// - "lang" (ISO 639-1/2/3 language code) - Set the language of the presentation (default: "en") +/// - "font" - Set the font of your choosing (default: Source Sans 3) Available at: https://github.com/adobe-fonts/source-sans +/// - "font-raw" - Set the monospace font of your choosing (default: Source Code Pro) Available at: https://github.com/adobe-fonts/source-code-pro +/// - "text-size" - Set font size for the text body (default: 22pt) +/// - "text-size-raw" - Set font size for text of type raw (default: 11pt) +/// - "show-level-one" (bool) - Show the section heading on the contents slides (defualt: true) +/// - "footer" - Set the default footer for content slides (can be overridden for individual slides) +#let touying-simpres( + aspect-ratio: "16-9", + lang: "en", + font: "Source Sans 3", + font-raw: "Source Code Pro", + text-size: 22pt, + text-size-raw: 11pt, + show-level-one: true, + footer: none, + ..args, + body, +) = { + set text(size: text-size, font: font, lang: lang) + show raw: set text(size: text-size-raw, font: font-raw) + show: touying-slides.with( + config-page( + paper: "presentation-" + aspect-ratio, + margin: (top: 3.5em, bottom: 1.5em, x: 2em), + ), + config-common( + slide-fn: slide, + new-section-slide-fn: new-section-slide, + ), + config-methods(alert: (self: none, it) => text(fill: self.colors.primary, it)), + config-colors( + primary: rgb("003366"), + secondary: rgb("CCE5FF"), + neutral-lightest: rgb("FFFFFF"), + neutral-darkest: rgb("000000"), + ), + config-store( + title: none, + footer: footer, + show-level-one: show-level-one, + ), + ..args, + ) + body +} diff --git a/packages/preview/touying-simpres/0.2.0/template/main.typ b/packages/preview/touying-simpres/0.2.0/template/main.typ new file mode 100644 index 0000000000..ebc5b2574e --- /dev/null +++ b/packages/preview/touying-simpres/0.2.0/template/main.typ @@ -0,0 +1,115 @@ +#import "@preview/touying:0.7.4": * +#import "@preview/cetz:0.5.2" +#import "@preview/touying-simpres:0.2.0": * + +#show raw: set text(size: 12pt) +#show figure.caption: set text(size: 10pt) + +#show: touying-simpres.with( + aspect-ratio: "16-9", + footer: [#datetime.today().display("[year]-[month]-[day]")], + show-level-one: false, + config-info( + title: [The "Simpres" slide template], + subtitle: [Presentation Template for Education and Business], + author: [thy0s], + date: datetime.today(), + institution: [Funk Town State University], + ), +) + +#let cetz-canvas = touying-reducer.with(reduce: cetz.canvas, cover: cetz.draw.hide.with(bounds: true)) + +#title-slide[] + +#outline-slide(depth: 2) + += Example Slides + +== Bullet Points + +- Networks are a collection of interconnected, autonomous computing devices #cite() + +- *Also pay attention to this bold text!* + + - _This here is also important..._ + +== A CeTZ Figure +#figure( + cetz-canvas({ + import cetz.draw: * + + let darkgray = luma(20%) + + let objects = ( + (pos: (0, 0), name: "n0", fill: black, text: "0", textfill: white), + (pos: (-3, -3), name: "n1", fill: none, text: "1", textfill: darkgray), + (pos: (4, -3), name: "n2", fill: none, text: "1", textfill: darkgray), + (pos: (1, -5), name: "n3", fill: none, text: "2", textfill: darkgray), + (pos: (5, -8), name: "n4", fill: none, text: "2", textfill: darkgray), + (pos: (-4.5, -7.5), name: "n5", fill: none, text: "2", textfill: darkgray), + (pos: (1.5, -9), name: "n6", fill: none, text: "3", textfill: darkgray), + (pos: (8, -11), name: "n7", fill: none, text: "3", textfill: darkgray), + ) + + for obj in objects { + circle(obj.pos, radius: (.75, .75), fill: obj.fill, name: obj.name) + content( + obj.pos, + text(size: 14pt, fill: obj.textfill)[#obj.text] + ) + } + + let dag_edge = line.with( + stroke: (paint: black, thickness: 3pt), + mark: (end: "triangle", length: 0.2), + ) + + dag_edge("n2", "n0") + dag_edge("n1", "n0") + dag_edge("n3", "n1") + dag_edge("n3", "n2") + dag_edge("n5", "n1") + dag_edge("n6", "n3") + dag_edge("n6", "n4") + dag_edge("n4", "n2") + dag_edge("n7", "n4") + }), + caption: [Fully built RPL-DODAG #cite()] +) + +#focus-slide[WATCH OUT] + +#slide(footer: "Override the default footer if necessary.", show-level-one: true, title: "Mixing it Up")[ + +- Show the section heading for individual slides with `show-level-one: true` + +- *Or* you can show it for all slides when configuring the theme... + +```typst + #show: touying-simprpes.with( + aspect-ratio: "16-9", + lang: "en", + font: "Source Sans 3", + font-raw: "Source Code Pro" + text-size: 22pt, + text-size-raw: 11pt, + show-level-one: false, + footer: [#datetime.today().display("[year]-[month]-[day]")], + config-info( + title: [The "Simpres" slide template], + subtitle: [Presentation Template for Education and Business], + author: [Computer Science Department], + date: datetime.today(), + institution: [Funk Town State University], + ), + )' +``` +] + +#heading(outlined: true, depth: 1)[References] +#slide(show-level-one: false, title: "Literature and Figure", footer: "")[#bibliography("refs.yaml", title: none)] + + + + diff --git a/packages/preview/touying-simpres/0.2.0/template/refs.yaml b/packages/preview/touying-simpres/0.2.0/template/refs.yaml new file mode 100644 index 0000000000..695ec3dbc9 --- /dev/null +++ b/packages/preview/touying-simpres/0.2.0/template/refs.yaml @@ -0,0 +1,22 @@ +tanenbaum-2021: + type: Book + title: "Computer Networks" + author: + - Tanenbaum, Andrew + - Wetherall, David + - Feamster, Nick + date: 2021 + publisher: "Pearson Education" + location: "Harlow" + +dodag-figure: + type: Web + title: "Destination Oriented Directed Acyclic Graph (DODAG) rooted at router S" + author: + - Baccelli, Emmanuel + url: + value: https://www.researchgate.net/figure/Destination-Oriented-Directed-Acyclic-Graph-DODAG-rooted-at-router-S_fig2_236883834 + date: 2025-05-23 + date: 2011-09 + + \ No newline at end of file diff --git a/packages/preview/touying-simpres/0.2.0/thumbnail.png b/packages/preview/touying-simpres/0.2.0/thumbnail.png new file mode 100644 index 0000000000..70d30f8013 Binary files /dev/null and b/packages/preview/touying-simpres/0.2.0/thumbnail.png differ diff --git a/packages/preview/touying-simpres/0.2.0/typst.toml b/packages/preview/touying-simpres/0.2.0/typst.toml new file mode 100644 index 0000000000..3c8861cb45 --- /dev/null +++ b/packages/preview/touying-simpres/0.2.0/typst.toml @@ -0,0 +1,18 @@ +[package] +name = "touying-simpres" +version = "0.2.0" +compiler = "0.14.2" +entrypoint = "lib.typ" +authors = ["thy0s "] +license = "MIT" +description = "Presentation template for education and business." +repository = "https://github.com/thy0s/touying-simpres" +keywords = ["presentation", "touying", "slides", "education", "business", "computer science", "lecture", "clean"] +categories = ["presentation"] +disciplines = ["business", "education", "computer-science",] +exclude = [".gitignore"] + +[template] +path = "template" +entrypoint = "main.typ" +thumbnail = "thumbnail.png" \ No newline at end of file