-
Notifications
You must be signed in to change notification settings - Fork 1k
blog: typst books, article layout, and typst-gather #1913
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
Open
gordonwoodhull
wants to merge
11
commits into
main
Choose a base branch
from
blog/typst-books-etc
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7ecaaa5
blog: typst books, article layout, typst-gather
gordonwoodhull 5d8920b
copy edits
gordonwoodhull 7d78992
blog: add missing article layout options, reframe intro
gordonwoodhull 11f7fa0
blog: lowercase "books" for consistency with other formats
gordonwoodhull ed0e903
blog: sentence case h2, add callout about book+article layout status
gordonwoodhull 34e1998
blog: reorder orange-book section to lead with default, then customiz…
gordonwoodhull 1d70ade
blog: add wrap-up paragraph connecting typst-gather to the headline f…
gordonwoodhull f03c643
blog: address review feedback - lightbox groups, alt text, brand demo…
gordonwoodhull f4c6680
add missing screenshot
gordonwoodhull 8c7bf45
update date for post
gordonwoodhull f72b9a9
add link to new post
gordonwoodhull File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 110 additions & 0 deletions
110
docs/blog/posts/2026-03-31-typst-books-and-more/index.qmd
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| --- | ||
| title: Typst Books, Article Layout, and `typst-gather` | ||
| author: Gordon Woodhull | ||
| date: 2026-03-31 | ||
| description: | | ||
| Quarto 1.9 adds Typst book projects, article margin layout via Marginalia, and offline package bundling with `typst-gather`. | ||
| image: typst-article-landscape.png | ||
| image-alt: A Typst article page showing code and a margin figure rendered with the Marginalia package | ||
| lightbox: true | ||
| --- | ||
|
|
||
|
Collaborator
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. If we publish before the release we should add a pre-release feature callout here. |
||
| Typst is a lightning-fast typesetting system that provides a modern alternative to LaTeX. | ||
|
|
||
| The Typst ecosystem is thriving, and Quarto 1.9 brings Typst much closer to feature parity with LaTeX: | ||
|
|
||
| * Typst books | ||
| * Article layout in Typst | ||
| * Bundling of Typst packages for offline rendering | ||
gordonwoodhull marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## Typst books | ||
|
|
||
| In Quarto 1.9, a project with type `book` and format `typst` is now rendered as a single document with multiple chapters and other book content. | ||
|
|
||
| ``` {.yaml filename="_quarto.yml"} | ||
| project: | ||
| type: book | ||
|
|
||
| book: | ||
| title: "My Book" | ||
| author: "Jane Doe" | ||
| chapters: | ||
| - index.qmd | ||
| - intro.qmd | ||
| - summary.qmd | ||
|
|
||
| format: typst | ||
| ``` | ||
|
|
||
| ::: {layout-ncol=4 group=book} | ||
| {fig-alt="A Typst book rendered with the orange-book extension, showing the part one page with a colored background and table of contents"} | ||
|
|
||
| {fig-alt="A Typst book rendered with the orange-book extension, showing the chapter one page with colored headers and sidebar navigation"} | ||
|
|
||
| {fig-alt="A Typst book rendered with the orange-book extension, showing the second page from chapter one with colored headers and sidebar navigation"} | ||
|
|
||
| {fig-alt="A Typst book rendered with the orange-book extension, showing the chapter two page with colored headers and sidebar navigation"} | ||
| ::: | ||
|
|
||
| All book features previously available in the LaTeX format are now available in Typst: | ||
|
|
||
| * Parts and Chapters | ||
| * Appendices | ||
| * Cross-references and chapter-based numbering | ||
| * Table of Contents | ||
|
|
||
gordonwoodhull marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| List-of-Figures and List-of-Tables support is [coming soon](https://github.com/quarto-dev/quarto-cli/issues/14081). | ||
|
|
||
| The default Typst book uses the bundled Quarto [quarto-orange-book](https://github.com/quarto-ext/orange-book) extension, which uses [`typst-gather`](#typst-gather) to bundle the Typst [orange-book](https://typst.app/universe/package/orange-book) package. Orange-book provides a textbook-style layout with colored chapter headers and sidebars. | ||
|
|
||
| The orange-book extension supports [brand.yml](/docs/authoring/brand.qmd) customization — it uses the `primary` color for chapter headers and sidebars, and the `medium` logo on the title page. The screenshots above were generated with this `_brand.yml`: | ||
|
|
||
| ``` {.yaml filename="_brand.yml"} | ||
| color: | ||
| primary: "#F36619" | ||
| secondary: "#2E86AB" | ||
|
|
||
| logo: | ||
| images: | ||
| test-logo: | ||
| path: logo.svg | ||
| alt: "Test Logo" | ||
| medium: test-logo | ||
| ``` | ||
|
|
||
| Since Typst books are implemented as Quarto [Format Extensions](/docs/extensions/formats.qmd), you can customize the appearance by creating your own extension. Typst partials define the overall book structure, while Lua filters handle the necessary AST transformations. | ||
|
|
||
| ## Article layout in Typst | ||
|
|
||
| Also in Quarto 1.9, all [Article Layout](/docs/authoring/article-layout.qmd) features now work in Typst, via the Typst [Marginalia](https://typst.app/universe/package/marginalia/) package. | ||
|
|
||
| Specifically: | ||
|
|
||
| * Figures, tables, code listings, and equations can be placed in the margin using the `.column-margin` class or the `column: margin` code cell option. | ||
| * You can also target specific output types with `fig-column: margin` or `tbl-column: margin`. | ||
| * Figure, table, and code listing captions can be placed in the margin with `cap-location: margin` (or `fig-cap-location: margin` and `tbl-cap-location: margin` for specific types). | ||
| * Footnotes and citations can be displayed in the margin with `reference-location: margin` and `citation-location: margin`. When margin citations are enabled, the bibliography is suppressed. | ||
| * Asides (`.aside` class) place content in the margin without a footnote number. | ||
|
|
||
| ::: {layout-ncol=3 group=article} | ||
| {group="article" fig-alt="A page of a Typst article with a margin note and a margin figure using the Marginalia package"} | ||
|
|
||
| {group="article" fig-alt="A page of a Typst article using margin captions"} | ||
|
|
||
| {group="article" fig-alt="A page of a Typst article using margin references"} | ||
| ::: | ||
|
|
||
| ::: {.callout-warning} | ||
| ## Books with article layout are functional, but need work | ||
| You can combine book and article layout, but there are some layout quirks when combining the two. We'll work with the orange-book author to integrate Marginalia into the book template. | ||
| ::: | ||
|
|
||
| ## `typst-gather` | ||
|
|
||
| Quarto 1.9 automatically stages Typst packages — from your extensions, from Quarto's bundled extensions, and from Quarto itself — into the `.quarto/` cache directory before calling `typst compile`. This means Typst documents render offline without needing network access. | ||
|
|
||
| To make this work, extension authors use the new [`typst-gather`](/docs/advanced/typst/typst-gather.qmd) tool, which scans their `.typ` files for `@preview` imports and downloads the packages into the extension directory. Authors run `quarto call typst-gather` and commit the results — users of the extension don't need to do anything. | ||
|
|
||
| This means [Custom Typst Formats](/docs/output-formats/typst-custom.qmd#custom-formats) can depend on Typst packages without copying and pasting Typst code, making them simpler and easier to maintain. | ||
gordonwoodhull marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| Both Typst books and article layout are built on `typst-gather` — orange-book depends on the Typst [orange-book](https://typst.app/universe/package/orange-book) package, and article layout depends on [Marginalia](https://typst.app/universe/package/marginalia/). As the Typst package ecosystem grows, we're excited to see what the community builds with Typst packages. | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+400 KB
docs/blog/posts/2026-03-31-typst-books-and-more/typst-article-landscape.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+226 KB
docs/blog/posts/2026-03-31-typst-books-and-more/typst-book-part-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.