How can I draw geometric constructions, sets, etc.?

The only thing that is not letting me leave Latex is its tikz feature. I want a complete repalcement of Tikz in Typst. So my question is how can I draw geometric constructions, sets, venn diagrams, curve, parametric curves, graphs, mind map etc in typst. My my friend who works in Physics, he was asking is it possible to draw pulley, spring, mass, electric circuits, resistance, capacitor etc.

3 Likes

cetz and libraries plus fletcher

should cover many of these. Obviously they’re not as mature as tikz, due to how new typst is.

As for circuits, I don’t think there is a non-manual way right now. There’s a WIP unpublished package called cirCeTZ, but I’m not sure if it’s in a usable state

5 Likes

In addition to what @Enivex said, these two packages might be of use for your friend: physica and Quill. Generally Typst Universe is the place to look for packages.

MiTeX lets you process LaTeX in Typst, but it doesn’t support something as complex as TikZ. If this is crucial for you, maybe there is a way to automate compiling LaTeX fragments with LaTeX and then inserting the result as an SVG file with #image(). If this is possible it can be a workaround until CeTZ or other packages will be able to match TikZ. Anyway, this can be done manually; use the standalone document type in your LaTeX template so you don’t have a margin around the drawing.

2 Likes

For drawing circuit diagrams, there are currently no available packages. There is a package called circetz that claims to be a work in progress, but it hasn’t been updated for the past 5 months.

1 Like

As a moderation note:

I have changed the title from " Drawing in Typst" to " How can I draw geometric constructions, sets, etc.?".

The question guidelines recommend this:

Good titles are questions you would ask your friend about Typst.

You already put this question in the body of your original post, it’s a good title that will make it easier for people to find this question in the future.

Also remember to mark the answer that helped you resolve your problem as a Solution using the :ballot_box_with_check: icon. Don’t feel pressed to do though if there hasn’t been a good solution so far!

1 Like

May I suggest Asymptote instead? I personally always preferred it to TikZ. It would be cool to be able to type the Asymptote code directly in the Typst document.

2 Likes

The drawback of Asymptote is that unlike Tikz or Cetz, its styling does not match the document without manual labor. It’s also another language to learn.

It should at least theoretically be possible to compile Asymptote to wasm and make a typst plugin, though.

1 Like