Graph view for your typst notes

Quick start
-
Import the package and use the show rule in your typst document:
#import "@preview/graph-gen:0.1.0": * #show: graph-gen-rules -
Clone the graph-gen repository containing the python script for the graph viewer.
-
(Highly recommended) set up a virtual environment:
cd path/to/graph-gen python -m venv .venv .venv/Scripts/activateor with
uv:cd path/to/graph-gen uv venv .venv .venv/Scripts/activate -
Install dependencies:
pip install .with
uv:uv sync -
Open typst preview for your document (for preview sync feature).
-
Run the graph viewer. Use
-hto see all options.python graph-gen.py path/to/document.typIf you want to only scroll the preview and not the
.typsource, use the-sor--no-src-pointflag:python graph-gen.py path/to/document.typ -s -
Double-click any node to scroll to its location in typst preview.
-
The python script caches graphs in
graph-gen/. The cache should be manually deleted after updating this typst package.
Example
See example.typ for how to add support for theorem-type content (definitions, theorems, etc…) and tutorial questions.
Generate the graph for the example with:
python graph-gen.py example.typ