From 9fd590231f78ec1e6a3d995f2da997f0d623148f Mon Sep 17 00:00:00 2001 From: Jakob Peters Date: Tue, 13 Aug 2024 10:23:07 -0700 Subject: [PATCH 1/2] Update Typstry.jl to v0.3.0 --- Project.toml | 2 +- docs/src/formats.md | 2 +- src/rendering/typst.jl | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Project.toml b/Project.toml index 6e11460..a4eca7b 100644 --- a/Project.toml +++ b/Project.toml @@ -35,7 +35,7 @@ Makie = "0.21.2" Poppler_jll = "21.9, 22, 23" Rsvg = "1" julia = "1.9" -Typstry = "0.2" +Typstry = "0.3" tectonic_jll = "0" [extras] diff --git a/docs/src/formats.md b/docs/src/formats.md index 0c7c12a..2652c00 100644 --- a/docs/src/formats.md +++ b/docs/src/formats.md @@ -63,7 +63,7 @@ fig ```@example main using MakieTeX, CairoMakie -typst_string = typst"$ integral_0^pi sin(x)^2 diff x $"; +typst_string = typst"$ integral_0^pi sin(x)^2 dif x $"; typst_document = TypstDocument(typst_string); cached_typst = CachedTypst(typst_document); diff --git a/src/rendering/typst.jl b/src/rendering/typst.jl index 2df9acf..4533fe6 100644 --- a/src/rendering/typst.jl +++ b/src/rendering/typst.jl @@ -14,12 +14,13 @@ Compile the given document as a String and return the resulting PDF (also as a S """ function compile_typst(document::AbstractString) #= - Typst_jll v0.11+ supports compiling from `stdin`. - It does not yet support compiling to `stdout`. + Typst_jll v0.11+ supports reading from `stdin`. + Typst_jll v0.12+ will likely support writing to `stdout`. See also: https://github.com/typst/typst/issues/410 https://github.com/typst/typst/pull/3339 + https://github.com/typst/typst/pull/3632 =# return mktempdir() do dir cd(dir) do @@ -39,7 +40,7 @@ function compile_typst(document::AbstractString) try # `pipeline` is not yet supported for `TypstCommand` redirect_stdio(stdout=out, stderr=err) do - run(ignorestatus(typst`compile temp.typ`)) + run(ignorestatus(addenv(typst`compile temp.typ`, "TYPST_FONT_PATHS" => julia_mono))) end close(out.in) From bae669c143120ac191e96372fadf9a9d477cf802 Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Tue, 13 Aug 2024 15:36:22 -0400 Subject: [PATCH 2/2] Clarify that `julia_mono` comes from Typstry.jl --- src/rendering/typst.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rendering/typst.jl b/src/rendering/typst.jl index 4533fe6..e982c40 100644 --- a/src/rendering/typst.jl +++ b/src/rendering/typst.jl @@ -40,7 +40,7 @@ function compile_typst(document::AbstractString) try # `pipeline` is not yet supported for `TypstCommand` redirect_stdio(stdout=out, stderr=err) do - run(ignorestatus(addenv(typst`compile temp.typ`, "TYPST_FONT_PATHS" => julia_mono))) + run(ignorestatus(addenv(typst`compile temp.typ`, "TYPST_FONT_PATHS" => Typstry.julia_mono))) end close(out.in)