I've been using VS code with James Yu's LaTeX Workshop extension for all my TeX needs. I wanted to add a simple Asymptote figure from my days using Overleaf, and saw that it did not load. Looking at the auxiliary files it generates, there was a .asy file that contained my Asymptote code, with nothing else. I ran it through Asymptote (just by double clicking on it) so it generated the figure in another .pdf file. Building my project in VS Code again, nothing changed. I am quite unfamiliar with all the backend stuff of LaTeX since I started out with Overleaf, but here is what I am using:

  • LaTeX Workshop 8.15.0
  • Asymptote 2.68
  • GhostScript 9.53.3
  • Tex Live 2020

I saw an issue on the Github page for LaTeX Workshop about this, but I have no idea what a .latexmkrc file is and when I pasted the code listed there in a file simply called ".latexmkrc" it gave an error.

Edit: I just switched to MiKTeX, and now I am getting "plain.asy: 263.3: reading array of length 4 with out-of-bounds index 4". Still no fix. Any ideas for this?

Thanks in advance for any help.

  • In MiKTeX, It sounds like your Asymptote installation is older than your copy of the Asymptote plain module. In particular, the plain module expects 5 numbers from _cputime() but is getting only 4. See github.com/vectorgraphics/asymptote/commit/… Feb 18, 2021 at 22:42
  • How should I fix this? I just tried copying the contents of plain.asy in the GitHub link and it still did not work. I then tried removing the line referencing the fifth element in a 4 element array and it threw a series of errors. I have Asymptote installed through MiKTeX and it says it is version 2.68 and there are no updates available. Thanks! Feb 19, 2021 at 0:07
  • Unfortunately I don't know. Feb 19, 2021 at 1:15

1 Answer 1


You should uninstall the version of Asymptote provided by MiKTeK and any other versions. Then download a clean 2.69 version from https://sourceforge.net/projects/asymptote

  • Hi, I just reinstalled both Asymptote and MiKTeX and got errors with MiKTeX not seeing Asymptote. I followed this(tex.stackexchange.com/questions/83035/…) guide, and am now getting error: could not load module 'plain'. When I get this error it brings up the install package dialogue, which if I click it installs the Asymptote package in MiKTeX (v2.68) so I have to uninstall it and try again. I am also still getting the cusdep error after it. Thanks!. Feb 20, 2021 at 21:11
  • You can override problems with a broken installation by setting the environment variable ASYMPTOTE_DIR to point to the correct location of the Asymptote base files that you installed. For example on MSWindows, by default this is the directory %PROGRAMFILES%\Asymptote. If you use the official installer from sourceforge.net/projects/asymptote you won't need to do this. Feb 21, 2021 at 23:30
  • how can I uninstall the MikTeX asymptote?
    – Mike Smith
    Mar 9, 2021 at 1:21
  • @MikeSmith if you are using Texstudio you can go to options -> configure -> commands -> then in asymptote point towards asy.exe file in asymptote example; "C:/Program Files/Asymptote/asy.exe" ?m*.asy
    – forecaster
    Jan 6, 2022 at 17:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .