Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can Typstry be used in the same way as LaTeX for setting up plotting libraries like Makie? #11

Closed
kenggua211 opened this issue Dec 15, 2024 · 3 comments

Comments

@kenggua211
Copy link

For example, in GLMakie, use syntax like ax = Axis(f[1, 1], xlabel=L'Iter', ylabel=L'\log (\mathbf{r} ^ \mathrm{T} \mathbf{r})') to set the parameters of Axis.
I tried
f = Figure()
ax = Axis(f[1, 1],
title = "Experimental data and exponential fit",
xlabel = "Time (seconds)",
ylabel =typst"$\e^x$",
)
but dosen't work.

@jakobjpeters
Copy link
Owner

Hi, does this example using MakieTeX.jl work for you? MakieTeX.jl hasn't updated to support Typstry.jl v0.4 yet though. See also this Makie.jl discussion.

@jakobjpeters
Copy link
Owner

I haven't been able to get a working example yet, but am working on seeing if it's possible. There's also another example in the MakieTeX.jl documentation.

@jakobjpeters
Copy link
Owner

Here's an answer from @asinghvi17:

Unfortunately that isn't directly possible with MakieTeX - you can use an LTeX block as a fake ylabel though, if you rotate it by 90 degrees to the left and place it at fig[axis_layout_idx..., Left()] for example

And an example:

using Pkg: add
add(["GLMakie", "MakieTeX", "Typstry"])
f = Figure()
LTeX(f[2, 1], TypstDocument(typst"#set text(64pt); $e^x$"))
scatter(f[1:3, 2], 0, 0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants