Latex-workshop: Asymptote Diagrams Not Loading

Created on 25 Dec 2017  路  2Comments  路  Source: James-Yu/LaTeX-Workshop

After installing texlive-full along with the asymptote package, any asymptote code still will not render in the preview mode. The /end{asy} will also show the following error: [LaTeX]: file "file-#.tex" not found. However, I think the program is mistaken because it automatically creates .asy files but the program is looking for a .tex file.

This issue can be reproduced fairly simply.

  1. Use default settings on VSCode and the plugin itself.
  2. Import latex code containing asymptote language and important the asymptote package in the header.
  3. Render and one can notice that the code is not rendering.

The code is suppose to render an asymptote diagram, but in reality there is just a bit of extra space.

The only error message shown is the following: "[LaTeX]: file "file-#.tex" not found."

I believe this is caused because the problem is looking for .asy files but its set to find .tex files.

Please fix these issues ASAP. This has been a great inconvenience but I'm still loving the rest of this extension. Keep up the great work!

Most helpful comment

You need to put the following into your .latexmkrc in your homefolder to make sure latexmk knows what to do with asy blocks in your latex code.

sub asy {return system("asy '$_[0]'");}
add_cus_dep("asy","eps",0,"asy");
add_cus_dep("asy","pdf",0,"asy");
add_cus_dep("asy","tex",0,"asy");

After this you should be able to build your latex project as it is.

All 2 comments

TBH I'm totally confused by your descriptions. Can you please pose full extension log? It can be accessed from the all action menu.

You need to put the following into your .latexmkrc in your homefolder to make sure latexmk knows what to do with asy blocks in your latex code.

sub asy {return system("asy '$_[0]'");}
add_cus_dep("asy","eps",0,"asy");
add_cus_dep("asy","pdf",0,"asy");
add_cus_dep("asy","tex",0,"asy");

After this you should be able to build your latex project as it is.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

iainmstott picture iainmstott  路  5Comments

kookma picture kookma  路  4Comments

BjoernDaase picture BjoernDaase  路  3Comments

fsonntag picture fsonntag  路  4Comments

seanmcbreen picture seanmcbreen  路  4Comments