Running on 2023 M2 Pro Macbook pro, running MacOS Ventura 13.2.1
Hello, I'm unable to export any of my asymptote diagrams as an svg file, although I was able to easily on my old windows machine. This issue has been repeated on 3 different macs, with the same problems appearing every time. The following log illustrates the process I went through to produce these errors on a brand new machine with a fresh install of MacOS Ventura 13.2.1:
Installed MacTeX.pkg from tug.org/mactex/mactex-download.html and installed it on my machine. In install options, I selected customize and selected all options (ghostscript 10.00, ghostscript dynamic library, GUI applications, TEXLive 2023). Note that which asy returns /Library/TeX/texbin/tex
Then, in Desktop/Asy-test/ I made a file called test.asy, and opened it in VSCode (also downloaded the Asymptote extension on VSCode). The initial contents of test.asy were:
Settings.outformat = “svg”;
unitsize(fontsize());
Pair a = (0,0);
Pair b = (1,3);
Pair c = (2,4);
Pair d = (-1,1);
draw(a–b–c–d–cycle);
The output of asy test.asy (after cding into the correct directory) was:
Processing of PostScript specials is disabled (Ghostscript not found)
WARNING: 1 PostScript special ignored. The resulting SVG might look wrong.
The svg file was created and was correct. However, in previous attempts of recreating this problem, the svg output did in fact have issues when labels were included (especially if they were rotated).
Processing of PostScript specials is disabled (Ghostscript not found)
XML error: error in path data: number expected (premature end of data)
_shipout(prefix,f,currentpatterns,format,wait,view,t);
^
/usr/local/texlive/2023/texmf-dist/asymptote/plain_shipout.asy: 116.11: runtime:
Shipout failed
No svg output was created.
I ran the first version of test.asy (with a,b,c,d) again, and it now also had the XML error + ghostscript error and did not create any output.
Now, attempting to fix the ghostscript error, I ran dvisvgm -V1, noting that there was no ghostscript in the output. which gs returns /usr/local/bin/gs and I decided to homebrew install ghostscript. I ran brew install gs and now which gs returns /opt/homebrew/bin/gs.
I ran export LIBGS=/opt/homebrew/lib/libgs.dylib and now running dvisvgm -V1 shows ghostscript 10.1.2 Also, running asy test.asy now still has the XML error, but no ghostscript error.
Attempting to fix the XML error, I brew install asymptote, and now which asy returns /opt/homebrew/bin/asy, and running /opt/homebrew/bin/asy test.asy returns:
XML error: error in path data: number expected (premature end of data)
_shipout(prefix,f,currentpatterns,format,wait,view,t);
^
/opt/homebrew/Cellar/asymptote/2.86/share/asymptote/plain_shipout.asy: 116.11: runtime: shipout failed
All in all, I have no idea how to fix this XML issue, and why it only started after the second time ever running asy test.asy. I am quite certain that the contents of test.asy were not an issue, but perhaps something changed behind the scenes after the first time running asy? I'm really not sure, so any help would be appreciated. Thanks!
Running on 2023 M2 Pro Macbook pro, running MacOS Ventura 13.2.1
Hello, I'm unable to export any of my asymptote diagrams as an svg file, although I was able to easily on my old windows machine. This issue has been repeated on 3 different macs, with the same problems appearing every time. The following log illustrates the process I went through to produce these errors on a brand new machine with a fresh install of MacOS Ventura 13.2.1:
Installed MacTeX.pkg from tug.org/mactex/mactex-download.html and installed it on my machine. In install options, I selected customize and selected all options (ghostscript 10.00, ghostscript dynamic library, GUI applications, TEXLive 2023). Note that
which asy
returns/Library/TeX/texbin/tex
Then, in
Desktop/Asy-test/
I made a file calledtest.asy
, and opened it in VSCode (also downloaded the Asymptote extension on VSCode). The initial contents oftest.asy
were:The output of
asy test.asy
(aftercd
ing into the correct directory) was:The svg file was created and was correct. However, in previous attempts of recreating this problem, the svg output did in fact have issues when labels were included (especially if they were rotated).
Now, I changed the contents of
test.asy
to:The output of
asy test.asy
was:No svg output was created.
I ran the first version of
test.asy
(with a,b,c,d) again, and it now also had the XML error + ghostscript error and did not create any output.Now, attempting to fix the ghostscript error, I ran
dvisvgm -V1
, noting that there was no ghostscript in the output.which gs
returns/usr/local/bin/gs
and I decided to homebrew install ghostscript. I ranbrew install gs
and nowwhich gs
returns/opt/homebrew/bin/gs
.I ran
export LIBGS=/opt/homebrew/lib/libgs.dylib
and now runningdvisvgm -V1
shows ghostscript 10.1.2 Also, runningasy test.asy
now still has the XML error, but no ghostscript error.Attempting to fix the XML error, I
brew install asymptote
, and nowwhich asy
returns/opt/homebrew/bin/asy
, and running/opt/homebrew/bin/asy test.asy
returns:All in all, I have no idea how to fix this XML issue, and why it only started after the second time ever running
asy test.asy
. I am quite certain that the contents oftest.asy
were not an issue, but perhaps something changed behind the scenes after the first time runningasy
? I'm really not sure, so any help would be appreciated. Thanks!