├── slides.pdf ├── images ├── screenshot.png └── mark-harpur-unsplash.jpg ├── metadata.typ ├── typst.toml ├── README.md ├── LICENSE ├── slides.typ └── template.typ /slides.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlixCoder/typst-slides/HEAD/slides.pdf -------------------------------------------------------------------------------- /images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlixCoder/typst-slides/HEAD/images/screenshot.png -------------------------------------------------------------------------------- /images/mark-harpur-unsplash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FlixCoder/typst-slides/HEAD/images/mark-harpur-unsplash.jpg -------------------------------------------------------------------------------- /metadata.typ: -------------------------------------------------------------------------------- 1 | #let beamer_format = (16, 9) 2 | #let theme_background = blue.darken(30%) 3 | #let theme_text = white 4 | #let font = "Open Sans" 5 | 6 | #let presentation_title = "Creating Presentations" 7 | #let presentation_subtitle = "Using Typst and this template" 8 | 9 | #let author = "FlixCoder" 10 | #let date = "2023-09-19" 11 | -------------------------------------------------------------------------------- /typst.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "basic-slides" 3 | version = "0.1.0" 4 | entrypoint = "template.typ" 5 | authors = ["FlixCoder"] 6 | license = "MIT" 7 | description = "Basic slides template." 8 | repository = "https://github.com/FlixCoder/typst-slides" 9 | keywords = ["slides", "presentation"] 10 | categories = ["presentation"] 11 | compiler = "0.11.0" 12 | exclude = ["slides.pdf", "images/*"] 13 | 14 | [template] 15 | path = "." 16 | entrypoint = "slides.typ" 17 | thumbnail = "images/screenshot.png" 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Typst beamer slides template 2 | 3 | A simple to use template for creating presentation slides. 4 | 5 | ## Usage and Example 6 | 7 | Take a look at [`slides.pdf`](https://github.com/FlixCoder/typst-slides/blob/main/slides.pdf) and [`slides.typ`](https://github.com/FlixCoder/typst-slides/blob/main/slides.typ) to see how it looks like and how to use it. 8 | 9 | ![Screenshot](./images/screenshot.png) 10 | 11 | ## Typst version 12 | 13 | Made with Typst v0.8.0, compiles with v0.11.0 - v0.14.0, it is unclear whether future versions will break something. 14 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Flix 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /slides.typ: -------------------------------------------------------------------------------- 1 | #import "template.typ": * 2 | #show: doc => slides(doc) 3 | 4 | #show link: l => underline(l) 5 | 6 | #slide(title: "Motivation")[ 7 | - The template aims to make it easy to create pretty slides 8 | - Typst is great to use 9 | - Automatic styling of sections/chapters via headings 10 | - `#slide` function for creating slides 11 | ] 12 | 13 | = How to use 14 | 15 | #slide(title: "Starting with the template", pad(x: 2em)[ 16 | + Download or copy the `metadata.typ` and `template.typ` files to your project. 17 | + Adjust the metadata in the `metadata.typ` file to your needs. 18 | + Create a `slides.typ` or similar with the following starting content: 19 | 20 | ```typst 21 | #import "template.typ": * 22 | #show: doc => slides(doc) 23 | ``` 24 | ]) 25 | 26 | #slide(title: "Filling in content", pad(x: 2em)[ 27 | Next you can fill in content with headings for sections and `slide` functions for slides: 28 | 29 | ```typst 30 | = My Section 31 | 32 | #slide(title: "My Title")[ 33 | My slide content. 34 | ] 35 | 36 | #slide()[ 37 | #image("your-image.svg", width: 80%) 38 | ] 39 | ``` 40 | ]) 41 | 42 | = Examples 43 | 44 | #slide(title: "Image")[ 45 | #figure( 46 | image("./images/mark-harpur-unsplash.jpg", height: 90%), 47 | caption: [ 48 | #link("https://unsplash.com/de/fotos/K2s_YE031CA?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText")[Photo] by #link("https://unsplash.com/de/@luckybeanz?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText")[Mark Harpur] 49 | ] 50 | ) 51 | ] 52 | 53 | #slide(title: "Drawings")[ 54 | #circle(radius: 5em, fill: red) 55 | ] 56 | 57 | = Problems 58 | 59 | #slide(pad(x: 2em)[ 60 | - There is no thing similar to `\pause` sadly, at least I have not found a way to do it 61 | ]) 62 | -------------------------------------------------------------------------------- /template.typ: -------------------------------------------------------------------------------- 1 | #import "metadata.typ": * 2 | 3 | #let slides(doc) = { 4 | // Variables for configuration. 5 | let scale = 2cm 6 | let width = beamer_format.at(0) * scale 7 | let height = beamer_format.at(1) * scale 8 | 9 | // Setup. 10 | set document( 11 | title: presentation_title, 12 | author: author, 13 | ) 14 | set text( 15 | font: font, 16 | size: 25pt, 17 | ) 18 | set page( 19 | width: width, 20 | height: height, 21 | margin: 0pt, 22 | ) 23 | set align(center + horizon) 24 | 25 | show heading: title => { 26 | pagebreak(weak: true) 27 | rect( 28 | width: 100%, height: 100%, 29 | fill: gradient.radial(theme_background.lighten(15%), theme_background.darken(15%)), 30 | text(fill: theme_text, title) 31 | ) 32 | counter(page).update(x => x - 1) 33 | pagebreak(weak: true) 34 | } 35 | 36 | // Title page. 37 | rect( 38 | width: 100%, height: 100%, 39 | fill: gradient.radial(theme_background.lighten(15%), theme_background.darken(15%)), 40 | { 41 | set text(fill: theme_text) 42 | text(size: 50pt, weight: "bold", presentation_title) 43 | linebreak() 44 | text(size: 30pt, presentation_subtitle) 45 | v(2em) 46 | text(size: 25pt, author) 47 | linebreak() 48 | text(size: 15pt, date) 49 | } 50 | ) 51 | pagebreak(weak: true) 52 | counter(page).update(1) 53 | 54 | // Actual content. 55 | doc 56 | } 57 | 58 | #let slide(title: "", content) = { 59 | // Header with slide title. 60 | let header = context { 61 | let headers = query(selector(heading).before(here())) 62 | set align(left + top) 63 | set text(fill: theme_text, weight: "bold") 64 | rect(width: 100%, fill: theme_background, pad(x: 10pt, y: 10pt)[ 65 | #if headers == () { 66 | text(size: 30pt, title) 67 | } else { 68 | let section = headers.last().body 69 | if title == "" { 70 | text(size: 30pt, section) 71 | } else { 72 | text(size: 15pt, section) 73 | linebreak() 74 | text(size: 25pt, title) 75 | } 76 | } 77 | ]) 78 | } 79 | 80 | // Footer with left and right section. 81 | let footer = grid(columns: (1fr, auto), pad(x: 5pt, y: 8pt)[ 82 | // Presentation title and author. 83 | #set align(left) 84 | #set text(12pt) 85 | #presentation_title \ 86 | #set text(10pt) 87 | #author -- #date 88 | ], [ 89 | // Page counter. 90 | #rect( 91 | width: 60pt, 92 | height: 40pt, 93 | fill: theme_background, 94 | align( 95 | center + horizon, 96 | text(20pt, fill: theme_text, context counter(page).display()) 97 | ) 98 | ) 99 | ]) 100 | 101 | pagebreak(weak: true) 102 | grid(rows: (auto, 1fr, auto), { 103 | header 104 | }, { 105 | // Inner slide content. 106 | pad(x: 10pt, y: 10pt, box(align(left, content))) 107 | }, { 108 | footer 109 | }) 110 | pagebreak(weak: true) 111 | } 112 | --------------------------------------------------------------------------------