1


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 https://github.com/vectorgraphics/asymptote/commit/d54e2ac82481e410ffa2bb52a1fb9d217d95eb98#diff-562369cfe16d24897249cc230cc5e91932942b0c66b9e0f1291f4079332f37fd – Charles Staats Feb 18 '21 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! – Charles Paxson Feb 19 '21 at 00:07
  • Unfortunately I don't know. – Charles Staats Feb 19 '21 at 01:15

1 Answers1

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

John Bowman
  • 878
  • 4
  • 5
  • Hi, I just reinstalled both Asymptote and MiKTeX and got errors with MiKTeX not seeing Asymptote. I followed this(https://tex.stackexchange.com/questions/83035/using-asymptote-with-miktex) 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!. – Charles Paxson Feb 20 '21 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 https://sourceforge.net/projects/asymptote you won't need to do this. – John Bowman Feb 21 '21 at 23:30
  • how can I uninstall the MikTeX asymptote? –  Mar 09 '21 at 01: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 06 '22 at 17:48