A Typst package for reading and exporting Jupyter notebooks. It covers various use cases:
- Rendering: Convert a notebook to PDF using Typst styles.
- Extraction: Use the outputs of notebook cells in your document.
- Execution: Execute code from Typst raw blocks and include the results in the document.
Render Notebooks with Style
Render a full notebook:
|
|
Or include the notebook as a section of a larger document:
|
|
Extract Cell Code and Outputs
For each kind of item there’s a function to extract it:
|
|
Execute Raw Blocks from Typst
Export code blocks to a Jupyter notebook and render the results:
|
|
The export is done with typst eval, the execution with jupyter-nbconvert (see Execution tutorial below).
You can share the exported notebook together with your Typst file, it’s all one needs to recompile the document.
Tutorials
The following tutorials are meant to be read in order:
Reference Manual
See the reference manual for all functions, available settings and additional examples.
See Also
Here are some alternatives for the “execution” use case:
-
Quarto: An amazing system for producing PDF, HTML and more from Markdown sources that include executable code blocks. Can use Typst as PDF backend.
-
Calepin: A tool that works like a mini Quarto, where you write input files in Typst instead of Markdown.
-
Jlyfish: Typst and Julia packages that work together to execute Julia code blocks from Typst documents.
-
Prequery A more generic approach to getting data out of a Typst document and back in after some processing. Can be used for executing code blocks.