diff --git a/packages/preview/silky-slides-insa/0.2.0/README.md b/packages/preview/silky-slides-insa/0.2.0/README.md new file mode 100644 index 0000000000..97cce27496 --- /dev/null +++ b/packages/preview/silky-slides-insa/0.2.0/README.md @@ -0,0 +1,120 @@ +# INSA - Slides Typst Template +

+ 4 slides +

+ +Typst Template for presentation for the french engineering school INSA. + +## Table of contents +1. [Example](#examples) +1. [Usage](#usage) +1. [Fonts information](#fonts) +1. [Notes](#notes) +1. [License](#license) +1. [Changelog](#changelog) + +## Example +```typst +#import "@preview/silky-slides-insa:0.2.0": * +#show: insa-slides.with( + title: "Titre du diaporama", + title-visual: none, + subtitle: "Sous-titre (noms et prénoms ?)", + insa: "rennes" +) + += Titre de section + +== Titre d'une slide + +- Liste + - dans + - une liste + +On peut aussi faire un #text(fill: insa-colors.secondary)[texte] avec les #text(fill: insa-colors.primary)[couleurs de l'INSA] ! + +== Une autre slide + +Du texte + +#pause + +Et un autre texte qui apparaît plus tard ! + +#section-slide[Une autre section][Avec une petite description] + +Coucou +``` + +## Usage +### Slide show rule +You call it with `#show: insa-slides.with(..parameters)`. + +| Parameter | Description | Type | Example | +|----------- |------------------------------- |-------------- |-------------------------------- | +| **title** | Title of the presentation | content | `[Titre de la prez]` | +| **title-visual** | Content shown at the right of the title slide | content | none | `image("img.png")` | +| **subtitle** | Subtitle of the presentation | content | `[Sous-titre]` | +| **insa** | INSA name (`rennes`, `hdf`...) | str | `"rennes"` | +| **breadcrumbs** | Whether or not to show the breadcrumbs (fil d'Ariane) | bool | `false` | +| **total-numbering** | Whether or not to show the total amount of slides in the bottom right counter | bool | `false` | +| **text-size** | Size of the text in the slides bodies | length | `22pt` | + +If you assign a content to `title-visual`, the title slide will automatically switch layout to the "visual" one from the graphic charter. If you do not assign a visual content, the title slide will only contain the title and subtitle and will choose the simple layout. + +### Section slide +A section slide is automatically created when you put a level-1 header in your markup. For example: +```typst += Slide section +Blablabla +``` +Will create a section slide with the title "Slide section" and will be followed by a content slide containing "Blablabla". + +If you want to put a subtitle in your section slide, you must explicitely use the `section-slide` function like so: +```typst +#section-slide([Titre de section], description: [Description de section]) +``` + +### Speaker notes (advanced) +Touying provides a way to attach speaker notes to your slides. This is a powerful feature, compatible with this template. In practice, the slides on the exported PDF will be twice as large since the right half will contain the actual speaker notes. You'll need a dedicated PDF viewer for presentations (e.g. pympress) that will show the left half to the audience and the right half to you. + +Follow the instructions [here](https://touying-typ.github.io/docs/external/pympress#speaker-notes) to enable this feature and use it properly with pympress. + +## Fonts +The graphic charter recommends the fonts **League Spartan** for headings and **Source Serif** for regular text. To have the best look, you should install those fonts. + +To behave correctly on computers lacking those specific fonts, this template will automatically fallback to similar ones: +- Headings: [**League Spartan**](https://fonts.google.com/specimen/League+Spartan) -> **Arial** (approved by INSA's graphic charter, by default in Windows) -> **Liberation Sans** (by default in most Linux) +- Body: **Source Serif** -> [**Source Serif 4**](https://fonts.google.com/specimen/Source+Serif+4) -> **Georgia** (approved by the graphic charter) -> _default Typst font_ + +> You can download the fonts from [here](https://github.com/SkytAsul/INSA-Typst-Template/tree/slides-0.2.0/fonts). + +## Notes +This template is being developed by Youenn LE JEUNE from the INSA de Rennes in [this repository](https://github.com/SkytAsul/INSA-Typst-Template) with contributions by other people. + +For now it includes assets from the graphic charters of those INSAs: +- Rennes (`rennes`) +- Hauts de France (`hdf`) +- Centre Val de Loire (`cvl`) +Users from other INSAs can open a pull request on the repository with the assets for their INSA. + +If you have any other feature request, open an issue on the repository. + +## License +The typst template is licensed under the MIT license. This does *not* apply to the image assets. Those image files are property of Groupe INSA. + +## Changelog +### 0.2.0 +- Added the `breadcrumbs` option that shows a breadcrumb (fil d'Ariane) at the bottom of the page +- Added the `total-numbering` option to show the total amount of pages at the bottom right +- Added the `add-heading` option to the `section-slide` function in order to display a section slide without adding a heading to the outline +- Added the `text-size` option to change the default size of the text in slide bodies +- Tweaked the height of the title slide visuals +- Updated Touying version +- Made Touying speaker notes work with the template + +### 0.1.1 +- Added INSA CVL assets + +### 0.1.0 +- Created the template diff --git a/packages/preview/silky-slides-insa/0.2.0/assets/cvl/logo-white.png b/packages/preview/silky-slides-insa/0.2.0/assets/cvl/logo-white.png new file mode 100644 index 0000000000..94a4e5b919 Binary files /dev/null and b/packages/preview/silky-slides-insa/0.2.0/assets/cvl/logo-white.png differ diff --git a/packages/preview/silky-slides-insa/0.2.0/assets/footer.png b/packages/preview/silky-slides-insa/0.2.0/assets/footer.png new file mode 100644 index 0000000000..b8aaa81afe Binary files /dev/null and b/packages/preview/silky-slides-insa/0.2.0/assets/footer.png differ diff --git a/packages/preview/silky-slides-insa/0.2.0/assets/hdf/logo-white.png b/packages/preview/silky-slides-insa/0.2.0/assets/hdf/logo-white.png new file mode 100644 index 0000000000..4ca2947bf7 Binary files /dev/null and b/packages/preview/silky-slides-insa/0.2.0/assets/hdf/logo-white.png differ diff --git a/packages/preview/silky-slides-insa/0.2.0/assets/rennes/logo-white.png b/packages/preview/silky-slides-insa/0.2.0/assets/rennes/logo-white.png new file mode 100644 index 0000000000..76748578a5 Binary files /dev/null and b/packages/preview/silky-slides-insa/0.2.0/assets/rennes/logo-white.png differ diff --git a/packages/preview/silky-slides-insa/0.2.0/assets/slide-section.svg b/packages/preview/silky-slides-insa/0.2.0/assets/slide-section.svg new file mode 100644 index 0000000000..e108cd9584 --- /dev/null +++ b/packages/preview/silky-slides-insa/0.2.0/assets/slide-section.svg @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/preview/silky-slides-insa/0.2.0/assets/slide-title-visual.svg b/packages/preview/silky-slides-insa/0.2.0/assets/slide-title-visual.svg new file mode 100644 index 0000000000..bc7774acac --- /dev/null +++ b/packages/preview/silky-slides-insa/0.2.0/assets/slide-title-visual.svg @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/preview/silky-slides-insa/0.2.0/assets/slide-title.svg b/packages/preview/silky-slides-insa/0.2.0/assets/slide-title.svg new file mode 100644 index 0000000000..f2bc7f0f67 --- /dev/null +++ b/packages/preview/silky-slides-insa/0.2.0/assets/slide-title.svg @@ -0,0 +1,229 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/packages/preview/silky-slides-insa/0.2.0/insa-common.typ b/packages/preview/silky-slides-insa/0.2.0/insa-common.typ new file mode 100644 index 0000000000..46231d9d70 --- /dev/null +++ b/packages/preview/silky-slides-insa/0.2.0/insa-common.typ @@ -0,0 +1,53 @@ +#let insa-heading-fonts = ("League Spartan", "Arial", "Liberation Sans") +#let insa-body-fonts = ("Source Serif", "Source Serif 4", "Georgia") +#let insa-colors = ( + primary: rgb("#e42618"), + secondary: rgb("#f69f1d"), + tertiary: rgb("#f5adaa"), +) + +#let supported-insas = ( + "rennes": "Rennes", + "hdf": "Hauts-de-France", + "cvl": "Centre Val de Loire", +) + +#let assert-insa-id(id) = { + assert( + supported-insas.keys().contains(id), + message: "Only INSAs " + supported-insas.keys().join(", ") + " are supported for now.", + ) +} + +/// Checks that the school ID is supported and returns its full name. +/// +/// - id (str): the short name of the school (rennes, hdf or cvl) +/// -> str +#let insa-school-name(id) = { + assert-insa-id(id) + return supported-insas.at(id) +} + +/// Returns the path to the INSA logo for the given school identifier. +/// +/// - id (str): the short name of the school (rennes, hdf or cvl) +/// -> str +#let insa-logo-path(id, white: false) = { + assert-insa-id(id) + if white { return "assets/" + id + "/logo-white.png" } + let extension = if id == "cvl" { "svg" } else { "png" } + return "assets/" + id + "/logo." + extension +} + +#let insa-front-cover-path(id, variant: 1) = { + assert-insa-id(id) + assert( + variant >= 1 and variant <= 3, + message: "Variant must be 1, 2, or 3.", + ) + + let base-path = "assets/" + id + "/front-cover" + let extension = if (id == "cvl" and variant != 3) { ".svg" } else { ".png" } + return base-path + str(variant) + extension +} + diff --git a/packages/preview/silky-slides-insa/0.2.0/slides-template.typ b/packages/preview/silky-slides-insa/0.2.0/slides-template.typ new file mode 100644 index 0000000000..2e6d152670 --- /dev/null +++ b/packages/preview/silky-slides-insa/0.2.0/slides-template.typ @@ -0,0 +1,223 @@ +#import "insa-common.typ": * +#import "@preview/touying:0.7.4": * + +// UTILITIES: + +#let _breadcrumb() = context { + let dot(selected) = ellipse( + width: 7pt, + height: 7pt, + fill: if selected { insa-colors.secondary } else { luma(80%) }, + stroke: none, + ) + + let current-slide = utils.slide-counter.get().at(0) + let total-slides = utils.slide-counter.final().last() + let dots = (dot(false),) * total-slides + dots.at(current-slide - 1) = dot(true) + stack(dir: ltr, spacing: 4pt, ..dots) +} + +#let _footer(self, color: black) = { + utils.call-or-display(self, self.page.footer) + + let show-total = self.info.total-numbering + + place(right + bottom, box(width: 1.75cm, height: 1.75cm, align(center + horizon, text( + font: insa-body-fonts, + fill: color, + size: if show-total { .75em } else { 1em }, + weight: "bold", + context { + if show-total [ + #utils.slide-counter.get().at(0)/#utils.slide-counter.final().at(0) + ] else [ + #utils.slide-counter.display() + ] + }, + )))) + + if (self.info.breadcrumbs) { + place( + bottom + center, + dy: -0.5cm, + _breadcrumb(), + ) + } +} + +// Hack for https://github.com/touying-typ/touying/issues/219 +#let _size-slide-background(self, background) = { + let notes-position = self.at("show-notes-on-second-screen", default: none) + + align(top + left, box( + width: if notes-position == right { 50% } else { 100% }, + height: if notes-position == bottom { 50% } else { 100% }, + align(horizon + center, background), + )) +} + + +// SLIDES: + +#let title-slide(..args) = touying-slide-wrapper(self => { + let info = self.info + args.named() + + let visual = info.title-visual != none + + self = utils.merge-dicts( + self, + config-page( + background: _size-slide-background(self, image(if visual { "assets/slide-title-visual.svg" } else { + "assets/slide-title.svg" + })), + margin: 0pt, + footer: _footer(self), + ), + ) + touying-slide(self: self, { + let titles-width = 16cm + + if visual { + titles-width = 11.8cm + + place(dx: 13.95cm, dy: 1.9cm, block(width: 12cm, height: 13cm, align( + center + horizon, + info.title-visual, + ))) + } + + place(dx: 2.02cm, dy: 1.89cm, block(width: 4.94cm, info.logo)) + + place(dx: 2.02cm, dy: 4cm, block(width: titles-width, height: 5.81cm, align(bottom, text( + font: insa-heading-fonts, + size: 40pt, + fill: white, + weight: "bold", + info.title, + )))) + + place(dx: 2.02cm, dy: 12.8cm, block(width: titles-width, height: 2.3cm, align(top, text( + font: insa-heading-fonts, + size: 20pt, + fill: black, + info.subtitle, + )))) + }) +}) + +#let section-slide(title, description: none, add-heading: true) = touying-slide-wrapper(self => { + self = utils.merge-dicts( + self, + config-page( + background: _size-slide-background(self, image("assets/slide-section.svg")), + margin: 0pt, + footer: _footer(self), + ), + ) + touying-slide(self: self, { + if add-heading { + // so a manual call to section-slide adds an entry to the outline + show heading: {} + heading(level: 1, title) + } + + place(dx: 2.02cm, dy: 4.1cm, block(width: 20cm, height: 6.8cm, align(bottom, text( + font: insa-heading-fonts, + size: 40pt, + weight: "bold", + fill: black, + if title == none { utils.display-current-heading(level: 1, style: heading => heading.body) } else { title }, + )))) + + place(dx: 2.02cm, dy: 11.5cm, block(width: 17cm, height: 4cm, align(top, text( + font: insa-heading-fonts, + size: 24pt, + fill: black, + description, + )))) + }) +}) + +#let slide(..args) = touying-slide-wrapper(self => { + self = utils.merge-dicts( + self, + config-page( + background: _size-slide-background(self, place(bottom + right, image("assets/footer.png", width: 3.5cm))), + footer: _footer(self, color: white), + ), + config-common( + subslide-preamble: (..args) => { + utils.display-current-heading(level: 2, style: none) + v(0.5em) + }, + ), + ) + touying-slide(self: self, ..args) +}) + +/// A template for INSA presentations +/// +/// - title (str | content): title of the presentation +/// - title-visual (content | none): content shown next to the title +/// - subtitle (content): content shown under the title +/// - insa (str): name of the school +/// - breadcrumbs (bool): whether or not to show the breadcrumbs (fil d'Ariane) +/// - total-numbering (bool): whether or not to show the total amount of slides in the bottom right counter +/// - text-size (length): size of the text in the slides bodies +/// - args (arguments): additional arguments to pass to touying +/// - body (content): rest of the document +/// -> content +#let insa-slides( + title: "Titre à définir", + title-visual: none, + subtitle: "Sous-titre à définir", + insa: "rennes", + breadcrumbs: false, + total-numbering: false, + text-size: 22pt, + ..args, + body, +) = { + _ = insa-school-name(insa) // checks that the INSA is supported + + show: touying-slides.with( + config-page( + paper: "presentation-16-9", + //footer: _footer, + margin: (x: 2.02cm, y: 1.71cm), + ), + config-common( + slide-level: 2, + new-section-slide-fn: section-slide.with(add-heading: false), + slide-fn: slide, + ), + config-info( + title: title, + title-visual: title-visual, + subtitle: subtitle, + logo: image(insa-logo-path(insa, white: true)), + breadcrumbs: breadcrumbs, + total-numbering: total-numbering, + ), + config-colors( + ..insa-colors, + ), + config-methods( + init: (self: none, body) => { + set text(font: insa-body-fonts, size: text-size) + show heading: set text(font: insa-heading-fonts) + + set list(marker: (sym.circle.filled.tiny, sym.plus)) + // TODO: change sublist color to primary (impossible for now) + + body + }, + ), + ..args, + ) + + title-slide() + + body +} diff --git a/packages/preview/silky-slides-insa/0.2.0/template/main.typ b/packages/preview/silky-slides-insa/0.2.0/template/main.typ new file mode 100644 index 0000000000..e2607de7e0 --- /dev/null +++ b/packages/preview/silky-slides-insa/0.2.0/template/main.typ @@ -0,0 +1,30 @@ +#import "@preview/silky-slides-insa:0.2.0": * + +#show: insa-slides.with( + title: "Titre du diaporama", + title-visual: none, + subtitle: "Sous-titre (noms et prénoms ?)", + insa: "rennes", +) + += Titre de section + +== Titre d'une slide + +- Liste + - dans + - une liste + +On peut aussi faire un #text(fill: insa-colors.secondary)[texte] avec les #text(fill: insa-colors.primary)[couleurs de l'INSA] ! + +== Une autre slide + +Du texte + +#pause + +Et un autre texte qui apparaît plus tard ! + +#section-slide([Une autre section], description: [Avec une petite description]) + +Coucou diff --git a/packages/preview/silky-slides-insa/0.2.0/thumbnail-full.png b/packages/preview/silky-slides-insa/0.2.0/thumbnail-full.png new file mode 100644 index 0000000000..66ad4032a5 Binary files /dev/null and b/packages/preview/silky-slides-insa/0.2.0/thumbnail-full.png differ diff --git a/packages/preview/silky-slides-insa/0.2.0/thumbnail.png b/packages/preview/silky-slides-insa/0.2.0/thumbnail.png new file mode 100644 index 0000000000..3d02eceea0 Binary files /dev/null and b/packages/preview/silky-slides-insa/0.2.0/thumbnail.png differ diff --git a/packages/preview/silky-slides-insa/0.2.0/typst.toml b/packages/preview/silky-slides-insa/0.2.0/typst.toml new file mode 100644 index 0000000000..33d898664f --- /dev/null +++ b/packages/preview/silky-slides-insa/0.2.0/typst.toml @@ -0,0 +1,17 @@ +[package] +name = "silky-slides-insa" +version = "0.2.0" +entrypoint = "slides-template.typ" +authors = ["SkytAsul"] +license = "MIT" +description = "A template made for presentations of INSA, a French engineering school." +repository = "https://github.com/SkytAsul/INSA-Typst-Template" +keywords = ["insa", "school", "engineering", "presentation", "slides", "diaporama"] +disciplines = ["engineering", "computer-science", "mathematics", "physics", "education"] +categories = ["presentation"] +exclude = ["/thumbnail-*"] + +[template] +path = "template" +entrypoint = "main.typ" +thumbnail = "thumbnail.png"