I'm trying use the asymptote package with vimtex, it's the first time I try it. When I try to compile, the figure doesn't appear at all in the pdf. This is an example code I found to test:
\usepackage[inline]{asymptote} % I've also tried without [inline] but I get the same results
...
\begin{asy}
settings.outformat = "pdf";
defaultpen(fontsize(10pt));
label("Hello world!");
\end{asy}
The only warning I get is
Package asymptote Warning: file `***-1.pdf' not found on input line 30.
The myfile-*.asy
files do appear in the folder.
I found this issue in the vimtex github where they suggest using a latexmkrc file with
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");
I tried putting this file in the folder I'm working on but it makes the vimtex compilation fail inmediately.
Update:
Running asy myfile-1.asy
in the terminal returns this error:
no matching variable 'byteinv'
no matching variable '_schur'
To fix this I've manually updated to 2.85, because was using the MiKTeX version 2.81 which didn't work properly. Now it works if I run asy myfile-1.asy
manually, but vimtex doesn't do it automatically.
myfile-*.asy
type files in the working directory? Does latexmk generate any othermyfile-*
files with a different extension? What does runningwhich asy
in a terminal give you?myfile-*.asy
do generate in the folder, nothing else besides the usual.log
,.out
, etc. Runningwhich asy
returns "which" isn't recognized as a command. I tried in Windows cmd, not sure if that's the right placeGet-Command asy
in Windows PowerShell (not command prompt), it should give one hit, matchingGet-Command pdflatex
? If that looks good, try runningasy myfile-*.asy
from the prompt after navigating to your working directory and see what it does.asy myfile-*.asy
then latexmk/vimtex should just work