A Quarto format for making Typst slides with Polylux or Touying. This template tries to replicate the Quarto-side syntax for Beamer, PowerPoint, and Revealjs slides.
In order of importance:
-
Replicate the syntax of existing Quarto beamer slides so that
projectorcan be used as a drop-in extension for the beamer type, up to any additional LaTeX-specific styling. -
Support multiple Typst slide backends without changing the Quarto-facing syntax.
-
Minimize nonstandard defaults. By setting as few features up automatically as possible, this should be customizeable using a header
.typfile. When an option would be hard to control otherwise, it should be controlled via a YAML option in the Quarto doc.
quarto use template christopherkenny/projectorThis will install the format extension and create an example .qmd file
that you can use as a starting place for your slides.
This template includes several custom arguments that can be supplied in the YAML header.
mainfont: sets font (see options withquarto typst fonts)margin: sets page marginspapersize: the paper size to use (choices listed here)toc: whether to display the table of contentstoc-title: title of the table of contentsbackground-image: the path to an image to put as the backgroundhandout: display as a handout, removing incrementalstheme: a file name containing your customizationsbackend: the slide backend to use (polyluxis the default;touyingis also supported)touying-theme: an optional built-in theme for Touying
Theme hooks receive a backend-neutral api record. Use its slide functions
and toolbox fields instead of importing Polylux or Touying directly.
To customize a built-in backend theme, define projector-backend(api) in your
theme. It can return theme-args and theme-config; api.backend exposes the
selected backend and its backend-specific helpers.
For example, with Touying's simple theme, this moves the current section to
the top right:
#let projector-backend(api) = (
theme-args: (
header: none,
header-right: self => [
#(api.backend.utils.display-current-heading)(
level: 1,
depth: self.slide-level,
)
],
),
)To modify these three particular slides, you need to adjust them in your template file. Simply redefine the functions that produce them with your own version.
The function signatures should be as follows:
title-slide(api, title, subtitle, authors, date)toc-slide(api, toc_title)section-slide(api, name)
Projector uses Quarto's standard Typst brand processing. Brand colors, logos,
and typography are applied to the page, headings, links, and code; explicit
projector options such as mainfont and fontsize take precedence where they
are supplied. Quarto's brand-mode: dark selects the dark brand when rendering.
Custom themes can access the resolved brand through api.brand:
api.brand.colors: semantic and named colors fromcolorapi.brand.background-colors: lighter background variantsapi.brand.logos: resolvedsmall,medium, andlargelogosapi.brand.typography: normalized base, heading, and monospace settings
This extension comes preloaded with my typst-function Quarto extension to make it easy to use bits of Typst for formatting.
This feature is entirely optional, but may simplify making tweaks to your slides.
Divs and spans that match names listed in the functions key are translated to Typst functions of the same name.
Adding this to your metadata:
functions: alignAllows you to write:
::: {.align arguments="right"}
this
:::Spans function similarly, so you can style like:
[other text]{.align arguments=right}This template is licensed under the MIT License. See the LICENSE file for details.
I actually quite dislike beamer and similar slide styles that are automatically generated.
I find that they are (1) typically ugly and (2) encourage bad presenting habits.
If it's too easy to go from the paper to the presentation, people rarely think through the presentation.
My view is that presentations and papers have different goals.
A paper needs to convey all of the scientific components that support why your work advances knowledge.
A presentation is more of an infomercial for the paper.
That means you can tell the story of the paper.
It should be truthful and scientific, but it should also be interesting.
Tell the practical pieces, tell the hiccups along the way, make it clear how you came up with the project.
Finally, it's okay if it looks nice: don't be worried that an aesthetically pleasing presentation implies you spent a little time on form instead of just function.
Hopefully, this extension helps bridge the gap between form and function, by using the prettier polylux with the simplicity of beamer via Quarto.
The logo for this project (haha) is inspired by polylux's logo.
The name is also inspired bypolylux's name origin story, where to me, an updated "beamer" is a "projector".

