Graph view for your typst notes
-
Import the package and use the show rule in your typst document:
#import "@preview/graph-gen:0.1.0": * #show: graph-gen-rulesYou may also use this repository directly as a local typst package.
-
Clone this repository (path to repo will be referred to below as
path/to/graph-gen). -
(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.typ
If 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.
See 0.1.0/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 0.1.0/example.typ