vectorgraphics / asymptote

2D & 3D TeX-Aware Vector Graphics Language
https://asymptote.sourceforge.io/
GNU General Public License v3.0
549 stars 90 forks source link

Suggestion: integrate with Typst? #453

Open user202729 opened 5 months ago

user202729 commented 5 months ago

Is this a reasonable proposal? (I may be interested in implementing it)

Typst is another typesetting engine that also allows math mode.

Unlike TeX, it is written in Rust and I think more amenable to directly linking to it instead of interface through clunky command-line. Which should also provide some speed boost.

charlesstaats commented 5 months ago

I'm not sure I understand exactly what you are proposing. Here is my best guess:

  1. Create a version of Asymptote that uses Typst internally instead of TeX. (Any file with labels would probably need to be specialized for either the TeX or Typst backend, since their notations are not compatible.)
  2. Create some way to use Asymptote from Typst, analogous to the asymptote or asypictureB package.

Is one or both of these what you have in mind?

user202729 commented 5 months ago

I'm mostly thinking of the former one. The latter can be implemented "easily" from the existing facilities.

The remark is true.

knuesel commented 4 months ago

Typst supports WebAssembly plugins... Maybe Asymptote could be compiled to wasm, replacing the pieces that use TeX by code that communicates with the typst instance through the plugin API? Then things would work transparently for the user without the need to install anything (just write import "asymptote:version" in the typst document and typst would download and run the wasm plugin when compiling the document).