-
Notifications
You must be signed in to change notification settings - Fork 1k
bypst:0.2.0 #4529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bypst:0.2.0 #4529
Changes from all commits
5671b1a
7c115d2
b44cdf4
6af9605
e49fd1f
63ba370
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to this project will be documented in this file. | ||
|
|
||
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). | ||
|
|
||
| ## [Unreleased] | ||
|
|
||
| ## [0.2.0] - April 2026 | ||
|
|
||
| ### Added | ||
| - `title-align` parameter on `bips-theme()` for horizontal alignment of slide titles (left, center, right) | ||
| - `base-size` parameter on `bips-theme()` to scale all text proportionally; headings, page numbers, `#small[]`, and `#tiny[]` adjust automatically via em-based sizing | ||
| - Size override parameters on `bips-theme()`: `slide-title-size`, `slide-subtitle-size`, `heading-1-size`, `heading-2-size`, `heading-3-size`, `page-number-size`, `small-size`, `tiny-size` | ||
| - `#huge[]`, `#large[]`, `#small[]`, and `#tiny[]` text size utility functions that scale proportionally with `base-size` | ||
| - `#compact[]` utility for tighter list/enum spacing (applies recursively to nested lists) | ||
| - `#vfill` shorthand (equivalent to `#v(1fr)`) | ||
| - Color helpers: `#blue[]`, `#orange[]`, `#green[]`, `#gray[]` | ||
| - `callout()` blocks with types note, tip, warning, important and optional `title:` parameter | ||
| - `two-columns[][]` and `three-columns[][][]` layout helpers with customizable widths and gutter | ||
| - `content-align` parameter on `bips-slide()` for body content alignment (e.g. `center + horizon`) | ||
| - Per-slide overrides: `text-size`, `title-size`, `subtitle-size`, `code-block-scale`, `code-inline-scale` on `bips-slide()` | ||
| - Code scaling parameters `code-block-scale` and `code-inline-scale` on `bips-theme()` | ||
| - Heading show rules for levels 1, 2, and 3 in BIPS blue with em-based sizing (1.11em, 1em, 0.89em) | ||
| - `bibliography-slide()` for reference lists | ||
| - `empty-slide[]` for minimal slides without branding | ||
| - tytanic test suite with 10 compile-only tests covering all slide types and features | ||
| - typstyle formatting for consistent code style | ||
| - GitHub Actions workflow to compile gallery demos and deploy previews to GitHub Pages | ||
|
|
||
| ### Changed | ||
| - Renamed built-in institute name variables to kebab case for consistency: `bips_en` -> `bips-en`, `bips_de` -> `bips-de`. | ||
| - **Upgraded Touying from 0.6.1 to 0.7.0** with new API for aspect ratios, config parameters, and page setup | ||
| - Page numbers use Touying's logical slide counter rendered in slide content via `place()`, fixing off-by-one errors on animated slides | ||
| - Slides without page numbers (`title-slide`, `section-slide`, `thanks-slide`, `empty-slide`) freeze the slide counter so numbering is sequential without gaps | ||
| - Page background overrides use `config: config-page(...)` instead of `set page()` in `setting:` callbacks (Touying 0.7.0 requirement) | ||
| - Aspect ratio uses `utils.page-args-from-aspect-ratio()` instead of `paper: "presentation-..."` | ||
| - Font size overrides use a state bridge (`_bips-sizes`) to pass computed values from `bips-theme()` to slide functions | ||
| - `thanks-slide` uses the `setting:` callback pattern consistently with other slide types | ||
| - `empty-slide` simplified from variadic `..content` to single `body` parameter | ||
| - `title-slide` no longer redundantly re-sets the page background | ||
| - **Renamed package from `bips-typst` to `bypst`** for Typst Universe naming compliance | ||
| - Multi-author title slides separate names with horizontal space instead of commas | ||
| - Gallery condensed from 13 demos to 5 focused examples (basic, complete, bibliography, aspect-ratio, lecture-demo) | ||
| - Emphasis (`_text_`) renders as blue italic; strong (`*text*`) renders as blue bold | ||
| - List/enum styling uses ascender/descender edges for consistent bullet alignment | ||
| - Nested lists use tighter spacing | ||
| - Gallery and test files use relative imports instead of versioned `@local` imports | ||
|
|
||
| ### Removed | ||
| - Dead `show-page-number` parameter from `section-slide` (was accepted but silently ignored) | ||
| - Unused typography variables: `font-weight-base`, `font-color-small`, `font-weight-small`, `font-color-tiny`, `font-weight-tiny`, `font-size-heading-*` | ||
| - 8 redundant gallery demos (animations, callouts, columns, content-elements, customization, font-customization, multi-author, qr-code) — all covered by `complete.typ` | ||
|
|
||
| ### Fixed | ||
| - Size override parameters in `bips-theme()` were silently ignored — now functional | ||
| - Heading levels 1–3 had no styling (rendered as default black text) — now styled globally with BIPS blue (h1/h2) and gray (h3) | ||
| - Page numbers remain stable across `#pause` subslides | ||
| - Content overflow on animated slides no longer creates blank pages for all subslides | ||
|
|
||
| ## [0.1.1] - 2025 | ||
|
|
||
| ### Changed | ||
| - Restructured project layout: moved theme files from `lib/` to project root | ||
| - Improved slide number logic to handle presentations with or without title slide | ||
| - Expanded and consolidated test suite into single `test-suite.typ` | ||
|
|
||
| ### Fixed | ||
| - Slide counter properly adjusts numbering based on title slide presence | ||
|
|
||
| ## [0.1.0] - 2025 | ||
|
|
||
| ### Added | ||
| - Initial release of BIPS Typst presentation template | ||
| - Core slide types: title-slide, bips-slide, section-slide, thanks-slide, empty-slide | ||
| - Multi-author support with institute affiliations via `inst()` | ||
| - QR code generation for contact slides via codetastic | ||
| - Animation support via Touying (`#pause`, `#uncover`, `#only`, `#alternatives`, `#meanwhile`) | ||
| - Bibliography slide helper | ||
| - Customizable font sizes and styling | ||
| - BIPS branding (colors, logo, Fira Sans / Fira Mono fonts) | ||
| - 16:9 and 4:3 aspect ratio support | ||
| - Gallery of example presentations | ||
| - Test suite for validation | ||
|
|
||
| [Unreleased]: https://github.com/bips-hb/bips-typst/compare/v0.2.0...HEAD | ||
| [0.2.0]: https://github.com/bips-hb/bips-typst/compare/v0.1.1...v0.2.0 | ||
| [0.1.1]: https://github.com/bips-hb/bips-typst/compare/v0.1.0...v0.1.1 | ||
| [0.1.0]: https://github.com/bips-hb/bips-typst/releases/tag/v0.1.0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| MIT License | ||
|
|
||
| Copyright (c) 2025 Lukas Burk | ||
|
|
||
| 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. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,278 @@ | ||
| # bypst — BIPS Presentation Template | ||
|
|
||
| A 16:9 presentation template for [BIPS](https://www.leibniz-bips.de/) using [Typst](https://typst.app/) and [Touying](https://touying-typ.github.io/). Based on the institutional style from [bips-beamer](http://github.com/bips-hb/bips-beamer). | ||
|
|
||
| ## Quick Start | ||
|
|
||
| ```typst | ||
| #import "@preview/bypst:0.2.0": * | ||
| #show: bips-theme | ||
|
|
||
| #title-slide( | ||
| title: "Your Presentation Title", | ||
| author: "Your Name", | ||
| institute: bips-en, // or bips-de | ||
| date: datetime.today().display(), | ||
| ) | ||
|
|
||
| #bips-slide(title: "Introduction")[ | ||
| - Bullet points | ||
| - *Bold* and _italic_ in BIPS blue | ||
| - Math: $s^2 = 1/(n-1) sum_(i=1)^n (x_i - overline(x))^2$ | ||
|
|
||
| #pause | ||
|
|
||
| - Revealed on click | ||
| ] | ||
|
|
||
| #thanks-slide( | ||
| contact-author: "Your Name", | ||
| email: "your.email@leibniz-bips.de", | ||
| qr-url: "https://link-to-slides.example.com", | ||
| ) | ||
| ``` | ||
|
|
||
| ## Installation | ||
|
|
||
| Available from the [Typst package registry](https://typst.app/universe/package/bypst) — no installation needed: | ||
|
|
||
| ```typst | ||
| #import "@preview/bypst:0.2.0": * | ||
| ``` | ||
|
|
||
| ### Local development | ||
|
|
||
| To work on the theme itself, clone and install locally: | ||
|
|
||
| ```sh | ||
| git clone https://github.com/bips-hb/bips-typst.git | ||
| cd bips-typst | ||
| just install | ||
| ``` | ||
|
|
||
| Then use the local import instead: | ||
|
|
||
| ```typst | ||
| #import "@local/bypst:0.2.0": * | ||
| ``` | ||
|
|
||
| ## Slide Types | ||
|
|
||
| | Function | Purpose | | ||
| |---|---| | ||
| | `#title-slide()` | Opening slide with author, institute, date | | ||
| | `#bips-slide()` | Content slide with optional title/subtitle | | ||
| | `#section-slide()` | Section divider | | ||
| | `#thanks-slide()` | Closing slide with contact info and optional QR code | | ||
| | `#bibliography-slide[]` | References | | ||
| | `#empty-slide[]` | Blank slide without branding | | ||
|
|
||
| ### Content slide options | ||
|
|
||
| ```typst | ||
| #bips-slide( | ||
| title: "Slide Title", | ||
| subtitle: "Optional Subtitle", | ||
| content-align: center + horizon, // center content vertically and horizontally | ||
| text-size: 16pt, // override text size for this slide | ||
| )[ | ||
| Content here | ||
| ] | ||
| ``` | ||
|
|
||
| `content-align` accepts any Typst alignment: `center`, `horizon`, `center + horizon`, etc. | ||
|
|
||
| ### Multi-author title slides | ||
|
|
||
| ```typst | ||
| #title-slide( | ||
| title: "Collaborative Research", | ||
| authors: ( | ||
| "Jane Doe" + inst(1,2), | ||
| "John Smith" + inst(1), | ||
| ), | ||
| institutes: ( | ||
| "BIPS", | ||
| "University of Bremen", | ||
| ), | ||
| ) | ||
| ``` | ||
|
|
||
| ### Section slides | ||
|
|
||
| ```typst | ||
| #section-slide("Results") | ||
| #section-slide("Methods", show-logo: false) | ||
| ``` | ||
|
|
||
| ## Layout Helpers | ||
|
|
||
| ```typst | ||
| // Two columns (equal by default) | ||
| #two-columns[Left][Right] | ||
| #two-columns(columns: (2fr, 1fr), gutter: 2em)[Wide][Narrow] | ||
|
|
||
| // Three columns | ||
| #three-columns[A][B][C] | ||
| ``` | ||
|
|
||
| ## Utilities | ||
|
|
||
| ### Color helpers | ||
|
|
||
| ```typst | ||
| #blue[text] #orange[text] #green[text] #gray[text] | ||
| ``` | ||
|
|
||
| ### Callout boxes | ||
|
|
||
| ```typst | ||
| #callout(type: "note")[Information] | ||
| #callout(type: "tip")[Helpful hint] | ||
| #callout(type: "warning")[Caution] | ||
| #callout(type: "important")[Critical] | ||
| #callout(type: "tip", title: "Custom Title")[With a title] | ||
| ``` | ||
|
|
||
| ### Compact list spacing | ||
|
|
||
| For dense layouts (e.g. multi-column slides), use `#compact` to tighten list spacing: | ||
|
|
||
| ```typst | ||
| #compact[ | ||
| - Item A | ||
| - Item B | ||
| - Item C | ||
| ] | ||
| ``` | ||
|
|
||
| Adjustable: `#compact(spacing: 0.2em, leading: 0.2em)[...]` | ||
|
|
||
| For lighter adjustments, `#set list(spacing: 0.4em)` works as a local override. | ||
|
|
||
| ### Vertical fill | ||
|
|
||
| ```typst | ||
| #vfill // shorthand for v(1fr) | ||
| ``` | ||
|
|
||
| ### Institutional names | ||
|
|
||
| ```typst | ||
| #bips-en // Leibniz Institute for Prevention Research and Epidemiology — BIPS | ||
| #bips-de // Leibniz-Institut für Präventionsforschung und Epidemiologie — BIPS | ||
| ``` | ||
|
|
||
| ## Animations | ||
|
|
||
| The theme re-exports Touying's animation functions: | ||
|
|
||
| ```typst | ||
| #pause // reveal on click | ||
| #uncover(2)[On second click] // show on specific subslide | ||
| #only(1)[First click only] // only on specific subslide | ||
| #alternatives[Version A][Version B] // swap content | ||
| ``` | ||
|
|
||
| **Note**: Do not use `#pause` inside `#two-columns` / `#three-columns`. Use `#uncover()` or `#only()` instead. | ||
|
|
||
| ## Global Customization | ||
|
|
||
| ### Logo | ||
|
|
||
| The theme ships with a placeholder logo. Replace it with your own: | ||
|
|
||
| ```typst | ||
| #show: bips-theme.with( | ||
| logo: image("my-logo.png"), | ||
| ) | ||
| ``` | ||
|
|
||
| Set `logo: none` to hide the logo entirely. | ||
|
|
||
| ### Fonts and sizes | ||
|
|
||
| ```typst | ||
| #show: bips-theme.with( | ||
| aspect-ratio: "16-9", // default | ||
| // Font families (string or array with fallbacks) | ||
| font: "Fira Sans", | ||
| code-font: "Fira Mono", | ||
| math-font: "New Computer Modern Math", | ||
| // Font sizes | ||
| base-size: 20pt, // scales headings, small/tiny proportionally | ||
| slide-title-size: 28pt, // explicit pt overrides take precedence | ||
| slide-subtitle-size: 22pt, | ||
| heading-1-size: 22pt, | ||
| heading-2-size: 20pt, | ||
| heading-3-size: 18pt, | ||
| small-size: 16pt, | ||
| tiny-size: 14pt, | ||
| page-number-size: 16pt, | ||
| code-block-scale: 0.9, | ||
| code-inline-scale: 1, | ||
| ) | ||
| ``` | ||
|
|
||
| ### Text size utilities | ||
|
|
||
| ```typst | ||
| #huge[Largest text for emphasis] | ||
| #large[Larger text for subheadings] | ||
| #small[Smaller text for captions or notes] | ||
| #tiny[Even smaller text for fine print] | ||
| ``` | ||
|
|
||
| ## Examples | ||
|
|
||
| The `gallery/` directory contains example presentations: | ||
|
|
||
| - `basic.typ` — starter template | ||
| - `complete.typ` — comprehensive feature showcase | ||
| - `bibliography.typ` — citations and references | ||
| - `aspect-ratio.typ` — 4:3 format | ||
| - `lecture-demo.typ` — realistic 100-slide scale test | ||
|
|
||
| ## Development | ||
|
|
||
| ```sh | ||
| just install # install package locally | ||
| just all # compile all gallery demos | ||
| just test # run test suite | ||
| just clean # remove generated PDFs | ||
| ``` | ||
|
|
||
| After editing theme files, run `just install` before compiling. | ||
|
|
||
| ### Project Structure | ||
|
|
||
| ```txt | ||
| bypst.typ # package entrypoint | ||
| theme.typ # theme implementation | ||
| logo.png # placeholder logo (replace with your own) | ||
| typst.toml # package metadata | ||
| template/ # Typst Universe templates | ||
| gallery/ # example presentations | ||
| tests/ # test suite | ||
| ``` | ||
|
|
||
| ## Fonts | ||
|
|
||
| The theme uses [Fira Sans](https://fonts.google.com/specimen/Fira+Sans) for body text and [Fira Mono](https://fonts.google.com/specimen/Fira+Mono) for code, with automatic fallbacks if they are not installed: | ||
|
|
||
| | Role | Preferred | Fallback | | ||
| |------|-----------|----------| | ||
| | Body text | Fira Sans | Noto Sans | | ||
| | Code | Fira Mono | DejaVu Sans Mono (Typst built-in) | | ||
| | Math | New Computer Modern Math | (Typst built-in) | | ||
|
|
||
| For the best results, install the Fira fonts. Override with the `font:`, `code-font:`, and `math-font:` parameters on `bips-theme()`. | ||
|
|
||
| ## Requirements | ||
|
|
||
| - Typst >= 0.12.0 | ||
| - Dependencies: touying 0.7.1, codetastic 0.2.2 (resolved automatically) | ||
|
|
||
| ## License | ||
|
|
||
| MIT | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you have the rights to distribute this logo? If so, can you please specify that it is not under the same license as the rest of the package and under which terms it can be used, for example at the end of your README?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm i am not sure about the licensing, I think the easiest approach might be a "bring your own logo" setup with a global theme parameter and users point it to a file path, with the package itself just shipping a placeholder image? I assume then I'd have to update the thumbnail as well 😅
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried it like this, not optimal but I guess it.. works?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A lot of other packages are doing that, it's a bit more effort for the user but it works fine in practice. If in the future you learn that you can actually distribute it, you can always publish a new version of the template :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar remark regarding this section: it should be made clear that this is an alternative installation method, and that the preferred way is to just use a
@preview/import.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I clarified this now and differentiate between using the package and local development/installation.