I am trying to run Asymptote code embedded in a tex file. The pdf generated has no asymptote figure but other latex stuff appear. I get a warning that file "filename-1.pdf" not found. I am using Texmaker 5.0.4 with MikTex 2.9. I ran the command PdfLatex+Asymptote+PdfLatex.
Edit: Since a code snippet was asked, I ran this file that Akira Kakuto suggested as filename.tex and I am still getting an error,
\documentclass{article}
\usepackage{graphicx}
\usepackage{asymptote}
\begin{document}
\begin{figure}[h]
\centering
\begin{asy}
size(200);
pen[] p={red,green,blue,magenta};
path g=(0,0){dir(45)}..(1,0)..(1,1)..(0,1)..cycle;
tensorshade(g,p);
dot(g);
\end{asy}
\immediate\write18{asy \jobname*.asy}
\end{figure}
\end{document}
pdflatex --shell-escape
twice on the input. You may need to edit your editor preferences to add--shell-escape
, or run the command in a terminal window.pdflatex
in a terminal (command line window)? (Works for me.)