I cannot produce svg images with asymptote

50 Views Asked by At

I cannot compile asymptote code to output to svg. I have a minimal file

settings.outformat="svg";

size(10cm);
 
draw(unitsquare);

in my test.asy file and when I compile it using asy test.asy I get the following error:

/usr/include/c++/13.2.1/bits/stl_vector.h:1125: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = std::__cxx11::basic_string<char>; _Alloc = std::allocator<std::__cxx11::basic_string<char> >; reference = std::__cxx11::basic_string<char>&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
  _shipout(prefix,f,currentpatterns,format,wait,view,t);
          ^
/usr/share/asymptote/plain_shipout.asy: 116.11: runtime: Command exited abnormally: dvisvgm -n -v3 --optimize -otest.svg test_.dvi 

I have tried reinstalling dvisvgm, texlive and asymptote. When I change svg to pdf everything works as expected, and I get a pdf file with a square in it.

Whenever I run asy test.asy with svg output format I get a bunch of files created in the same directory like test_.aux, test_.dvi and with other extensions like .tex, .eps.

Any help?

0

There are 0 best solutions below