I already set everything up so that I can use Asymptote in LaTeX (specifically, pdfTeX), but for some reason, my code doesn't output.
The entire LaTeX file creates a pdf, as usual, However, the Asymptote, which should have outputted a pdf just for each drawing, doesn't create the needed pdfs. The output pdf doesn't even show the pictures, it just skips to the LaTeX right after the Asymptote code.
I'm trying to draw 8 pictures in Asymptote. The first 2 and last 2 seem fine, but the other 4 (file-3, -4, -5, -6) are messed up. Here's what the console says when trying to parse the code:
...(other stuff that I don't think is helpful)
Output written on "file.pdf".
SyncTeX written on "file.synctex.gz"
Transcript written on "file.log".
Processing file-1
file-3.asy: 17.10: no matching variable 'graph'
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019)
(preloaded format=pdflatex)
...(more stuff that I don't think is helpful)
How can I fix this? I know my code works fine, I tried it online and it seems good.
EDIT: Thanks, everyone! I solved the problem with Schrödinger's cat's solution.
asymptote
code that runs on the command line. Give the complete code you compiled withpdftex
.asymptote
package and\begin{asy}
and\end{asy}
is fine, but one needs the exact code to reproduce the error. My code below does not yield an error, at least not when compiled on an updated TeXLive 2019 installation when compiled withpdflatex -shell-escape
.file-3.asy
? If so, why do you have\begin{asy}
? Or do you havefile.tex
, and the asymptote package pulls the part between{asy}
into a separate file that it callsfile-3.asy
? If so, please post a minimal example that has the error (and also has the documentclass and packages, just like with Schrödinger'scat's example). Don't tell us that you have to surround the code, just show us what you've done.