Package Interoperability

This guide illustrates how to use Typstry.jl in compatible notebooks and packages.

Notebooks

IJulia.jl, Pluto.jl, and QuartoNotebookRunner.jl each render Typsts and TypstTexts. Pluto.jl and QuartoNotebookRunner.jl also render TypstStrings, whereas IJulia.jl will support them in its next feature release.

Typst Packages

Compiling a document which imports a Typst package can be achieved in exactly the same manner as compiling a standard Typst source file with the command-line interface. For example, typst"#import \"@namespace/name:version\"".

Julia Packages

Literate.jl

MakieTeX.jl

Note

This package re-exports @typst_str and TypstString.

julia> using CairoMakie, MakieTeX

julia> f = Figure(; size = (100, 100))

julia> LTeX(f[1, 1], TypstDocument(typst"$ 1 / x $"))

julia> save("makie_tex.svg", f)

TypstJlyfish.jl

#import "@preview/jlyfish:0.1.0": *
#read-julia-output(json("typst_jlyfish.json"))
#jl-pkg("Typstry")
#jl(`using Typstry; typst"$1 / x$"`)
julia> using TypstJlyfish, Typstry

julia> TypstJlyfish.compile("typst_jlyfish.typ"; evaluation_file = "typst_jlyfish.json")