JuliaTeX / TikzPictures.jl

Creating PGF/TikZ pictures and saving them in various formats
Other
89 stars 28 forks source link

Add Tectonic #76

Closed rikhuijzer closed 3 years ago

rikhuijzer commented 3 years ago

In response to https://github.com/JuliaTeX/TikzPictures.jl/issues/75.

Let's have it as the default if lualatex -v fails, and make it switchable as well

Unfortunately, it's gonna take me quite a lot of time to figure out the logic to make Tectonic as an optional back end. I would personally not bother with supporting so many backends and focus on one good one, but that might be my naivety. I have no idea who uses this package.

In this draft PR, I've added Tectonic and confirmed that it works with

tp = TikzPicture("\\draw (0,0) -- (10,10);\n\\draw (10,0) -- (0,10);\n\\node at (5,5) {tikz \$\\sqrt{\\pi}\$};", options="scale=0.25", preamble="")
save(PDF("test"), tp)

Note that Tectonic doesn't support the --enableWrite18 flag, so that is why I disabled it in the code.

Maybe, you could decide whether this Tectonic addition is still the way to go forward and pick up this PR?

mykelk commented 3 years ago

Great! I'll take a look at this and see if I can get it working. I might start on a separate PR but based on what you have here.

rikhuijzer commented 3 years ago

I might start on a separate PR but based on what you have here.

That's absolutely fine :+1: This PR is very very basic.

When looking at the CI job for Julia 1.0, it seems that Tectonic introduces compatibility issues. Related discussion on those issues is at https://discourse.julialang.org/t/compatibility-with-previous-versions-of-julia-how-much-makes-sense-for-a-new-package/59920.

mykelk commented 3 years ago

Yeah, Tectonic.jl requires Julia 1.3 or later. I'm okay with that. BTW, the most recent version of Tectonic.jl does support write18, but through the -Z shell-escape option. I'm still working on this update, but I think it will be very nice to have so that folks don't have to do a massive install. One issue is that tectonic doesn't seem to support lua---I think because it is based on xelatex instead of lualatex. This is an issue for the graphlayout package associated with tikz.

rikhuijzer commented 3 years ago

Yeah, Tectonic.jl requires Julia 1.3 or later. I'm okay with that. BTW, the most recent version of Tectonic.jl does support write18, but through the -Z shell-escape option. I'm still working on this update, but I think it will be very nice to have so that folks don't have to do a massive install. One issue is that tectonic doesn't seem to support lua---I think because it is based on xelatex instead of lualatex. This is an issue for the graphlayout package associated with tikz.

Wow. You seem to know some details about LaTeX backends :smile:

mykelk commented 3 years ago

Done on 5e334504de3356a07afc8736504e8e2c47d6a876

rikhuijzer commented 3 years ago

Great! I'll try to migrate my blog soon :+1: