3

Could it be that the Asymptote package in MiKTeX is broken?

I have installed all the updates and my asymptote package has the version 2.65 and my miktex-asymptote-bin-x64-2.9 has the version 2.67 and since the update of the latter package on 10/31 I can't compile any asymptote file.

C:\>"c:\Program Files\MiKTeX\miktex\bin\x64\miktex-asy.exe"
Welcome to miktex-asy version 2.67 (to view the manual, type help)
warning [version]: using possibly incompatible version 2.65 of plain.asy
>

If I try to compile the very simple example below I got the error message:

C:\test>"c:\Program Files\MiKTeX\miktex\bin\x64\miktex-asy.exe" hello.asy
warning [version]: using possibly incompatible version 2.65 of plain.asy

    pic.addBox(position,position,min(f),max(f));
              ^
c:\Program Files\MiKTeX/asymptote/plain_Label.asy: 321.15: runtime:

The hello.asy file is:

settings.outformat = "pdf";
defaultpen(fontsize(10pt));
label("Hello world!");

Does anybody else have the same issue? What am I missing here?

Thank you for your help.

4
  • Standard asymptote (by which I mean, what you get if you do not import anything) consists of the asymptote language together with the "plain" asy library, which is imported automatically behind the scenes. It looks like the asymptote language is for some reason finding the old version of the plain library rather than the version that came with the updated installation. For a quick-and-dirty solution, try copying the contents of github.com/vectorgraphics/asymptote/tree/2.67/base into C:\Program Files\MiKTeX\asymptote.... Commented Dec 2, 2020 at 14:39
  • You can alternatively get these contents by downloading asymptote-2.67.src.tgz from sourceforge.net/projects/asymptote/files/2.67 and unpacking the base folder within the archive. Commented Dec 2, 2020 at 14:40
  • @CharlesStaats: thank you for your comments. I have tried as you suggersted to copy the files from the base folder in the archive to the asymptote folder under MiKTeX but unfortunately it still does't work. I have also adjusted the version to 2.67 in the version.asy file. That removes the incompatibility warning but the asy file still can not be compiled.
    – Bence
    Commented Dec 3, 2020 at 7:55
  • You can't update the plain.asy file(s) just by overwriting the version number! You need to actually get the up-to-date versions. I suggest uninstalling the old version and reinstalling version 2.68. Commented Jan 28, 2021 at 6:13

1 Answer 1

1

This may help with debugging the issue.

Viewing asymptote program's version

$ asy --version
Asymptote version 2.87-25 [(C) 2004 Andy Hammerlindl, John C. Bowman, Tom Prince]

Viewing asymptote plain.asy library version

First, you can run asy -vv in order to show which plain.asy file is being used:

$ asy -vv
kpsewhich --var-value=TEXMFMAIN
kpsewhich --var-value=ASYMPTOTE_HOME
Using configuration directory /home/abc/.asy
Using history /home/abc/.asy/history
Welcome to Asymptote version 2.87-25 (to view the manual, type help)
cd /tmp
Loading plain from /usr/share/texmf-dist/asymptote/plain.asy
Including plain_constants from /usr/share/texmf-dist/asymptote/plain_constants.asy
Loading version from /usr/share/texmf-dist/asymptote/version.asy
Including plain_strings from /usr/share/texmf-dist/asymptote/plain_strings.asy
Including plain_pens from /usr/share/texmf-dist/asymptote/plain_pens.asy
Including plain_paths from /usr/share/texmf-dist/asymptote/plain_paths.asy
Including plain_filldraw from /usr/share/texmf-dist/asymptote/plain_filldraw.asy
Including plain_margins from /usr/share/texmf-dist/asymptote/plain_margins.asy
Including plain_picture from /usr/share/texmf-dist/asymptote/plain_picture.asy
Loading plain_scaling from /usr/share/texmf-dist/asymptote/plain_scaling.asy
Loading simplex from /usr/share/texmf-dist/asymptote/simplex.asy
Loading plain_bounds from /usr/share/texmf-dist/asymptote/plain_bounds.asy
Including plain_scaling from /usr/share/texmf-dist/asymptote/plain_scaling.asy
[...]
warning [version]: using possibly incompatible version 2.85 of plain.asy

You can also read from the output above, and print out the version file:

$ cat /usr/share/texmf-dist/asymptote/version.asy
string VERSION="2.85";

Pointing Asymptote to the correct location

In my case, I was installing Arch Linux's AUR package asymptote-git. The correct location for the files can be found by (this instruction is specific to Arch Linux, instruction varies per distribution and operating system):

$ pacman -Ql asymptote-git | grep plain
asymptote-git /usr/share/asymptote/plain.asy
asymptote-git /usr/share/asymptote/plain_Label.asy
asymptote-git /usr/share/asymptote/plain_arcs.asy
[...]

Then, I can point asy to the correct location by setting ASYMPTOTE_HOME environment variable:

$ ASYMPTOTE_HOME=/usr/share/asymptote/ asy -vv
kpsewhich --var-value=TEXMFMAIN
kpsewhich --var-value=ASYMPTOTE_HOME
Using configuration directory /usr/share/asymptote/
Using history /usr/share/asymptote//history
Welcome to Asymptote version 2.87-25 (to view the manual, type help)
cd /tmp
Loading plain from /usr/share/asymptote/plain.asy

There are other places to set the search path, as seen in the documentation:

documentation of asymptote package

About MikTeX

It appears that the issue is not that uncommon (e.g. https://sourceforge.net/p/asymptote/discussion/409349/thread/e026af8af6/ https://sourceforge.net/p/asymptote/discussion/409349/thread/b87f49efc9/ ), and the suggested solution is always to manually install newest version of Asymptote.

You must log in to answer this question.

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