I've tried really hard to look for all kinds of solutions but so far nothing seems to have helped.
\begin{figure}
\centering
\begin{asy}
include graph;
size(3inch);
pair A,B,C,D,E,F,G,H,I;
A = (0,0);
B = (12/11, 18/11);
C = (18/11, 27/11);
D = (24/7, 6/7);
E = (36/7, 9/7);
F = (1/10, 59/30);
G = (9/2, 1/2);
H = (7/10, 83/30);
I = (6, 1);
draw(F--G, Arrows, MidArrow);
draw(H--I, Arrows, MidArrow);
draw(E--A--C--D);
label("test",(0,0),N);
\end{asy}
\end{figure}
Everything seems to work fine until I add the last line with the label.
Even stranger, while it works with my setup in TeXnicCenter, nothing compiles correctly when I run it from the command line:
asy -vvv ".\filename.asy"
Using configuration directory C:/Users/b/.asy
Loading config.asy from C:/Users/b/.asy/config.asy
Using history C:/Users/b/.asy/history
Welcome to miktex-asy version 2.41
cd F:\Documents\Math\
Processing filename
Loading plain from C:\Program Files (x86)\Asymptote/plain.asy
Including plain_constants from C:\Program Files (x86)\Asymptote/plain_constants.asy
Loading version from C:\Program Files (x86)\Asymptote/version.asy
Including plain_strings from C:\Program Files (x86)\Asymptote/plain_strings.asy
C:\Program Files (x86)\Asymptote/plain_strings.asy: 235.16: no matching function 'format(<overloaded>, bool, string, real, <overloaded>)'
C:\Program Files (x86)\Asymptote/plain_strings.asy: 235.17: use of variable 'format' is ambiguous
C:\Program Files (x86)\Asymptote/plain_strings.asy: 235.53: use of variable 'locale' is ambiguousIncluding plain_pens from C:\Program Files (x86)\Asymptote/plain_pens.asy
Including plain_paths from C:\Program Files (x86)\Asymptote/plain_paths.asy
Including plain_filldraw from C:\Program Files (x86)\Asymptote/plain_filldraw.asy
Including plain_margins from C:\Program Files (x86)\Asymptote/plain_margins.asy
Including plain_picture from C:\Program Files (x86)\Asymptote/plain_picture.asy
Loading plain_scaling from C:\Program Files (x86)\Asymptote/plain_scaling.asy
Loading simplex from C:\Program Files (x86)\Asymptote/simplex.asy
Loading plain_bounds from C:\Program Files (x86)\Asymptote/plain_bounds.asy
Including plain_scaling from C:\Program Files (x86)\Asymptote/plain_scaling.asy
Including plain_prethree from C:\Program Files (x86)\Asymptote/plain_prethree.asy
C:\Program Files (x86)\Asymptote/plain_picture.asy: 175.48: no matching variable 'xasyKEY'
C:\Program Files (x86)\Asymptote/plain_picture.asy: 214.51: no matching variable 'xasyKEY'
C:\Program Files (x86)\Asymptote/plain_picture.asy: 702.7: no matching variable 'xasyKEY'
C:\Program Files (x86)\Asymptote/plain_picture.asy: 712.7: no matching variable 'xasyKEY'
C:\Program Files (x86)\Asymptote/plain_picture.asy: 978.9: no matching variable 'xasyKEY'Including plain_Label from C:\Program Files (x86)\Asymptote/plain_Label.asy
Including plain_shipout from C:\Program Files (x86)\Asymptote/plain_shipout.asy
C:\Program Files (x86)\Asymptote/plain_shipout.asy: 5.12: no matching field of name 'xasy' in 'settings'
C:\Program Files (x86)\Asymptote/plain_shipout.asy: 71.14: no matching function 'deconstruct(frame, frame, transform)'
C:\Program Files (x86)\Asymptote/plain_shipout.asy: 89.14: no matching field of name 'xasy' in 'settings'
C:\Program Files (x86)\Asymptote/plain_shipout.asy: 102.3: no matching variable '_shipout'
C:\Program Files (x86)\Asymptote/plain_shipout.asy: 102.37: use of variable 'format' is ambiguous
C:\Program Files (x86)\Asymptote/plain_shipout.asy: 102.49: use of variable 'view' is ambiguousIncluding plain_arcs from C:\Program Files (x86)\Asymptote/plain_arcs.asy
Including plain_boxes from C:\Program Files (x86)\Asymptote/plain_boxes.asy
Including plain_markers from C:\Program Files
(x86)\Asymptote/plain_markers.asy
Including plain_arrows from C:\Program Files (x86)\Asymptote/plain_arrows.asy
Including plain_debugger from C:\Program Files (x86)\Asymptote/plain_debugger.asy
Loading filename.asy from filename.asy
error: could not load module '.\filename.asy'
The last two lines of this log are mutually exclusive. Some of my files when compiled give the last line, others give the second to last line. Which one it is seems to be random, can't tell what causes one file to output one instead of the other.
I don't understand why other people have such clean outputs, but mine has this "xasy" stuff and errors out at the end. I've spent countless hours digging a rabbit hole and I'm completely out of ideas.
EDIT: MWE as requested.
\documentclass{article}
\usepackage{asymptote}
\begin{document}
\begin{figure}
\begin{asy}
include graph;
size(3inch);
pair A,B;
A = (0,0);
B = (2,1);
draw(A--B);
\end{asy}
\end{figure}
\end{document}
EDIT: @marmot, here's the log when I try your method.
Attempting to run asy on LaTeX2-labels.asy
! Package asypictureB Error:
Possible Asymptote error:
asy: warning: running with administrator privileges
warning: package 'asymptote' is not installed
run 'mpm --install asymptote' to install it
C:\Program Files (x86)\Asymptote/plain_strings.asy: 235.16: no matching function 'format(<overloaded>, bool, string, real, <overloaded>)'
C:\Program Files (x86)\Asymptote/plain_strings.asy: 235.17: use of variable 'format' is ambiguous
C:\Program Files (x86)\Asymptote/plain_strings.asy: 235.53: use of variable 'locale' is ambiguous
C:\Program Files (x86)\Asymptote/plain_picture.asy: 175.48: no matching variable 'xasyKEY'
C:\Program Files (x86)\Asymptote/plain_picture.asy: 214.51: no matching variable 'xasyKEY'
C:\Program Files (x86)\Asymptote/plain_picture.asy: 702.7: no matching variable 'xasyKEY'
C:\Program Files (x86)\Asymptote/plain_picture.asy: 712.7: no matching variable 'xasyKEY'
C:\Program Files (x86)\Asymptote/plain_picture.asy: 978.9: no matching variable 'xasyKEY'
C:\Program Files (x86)\Asymptote/plain_shipout.asy: 5.12: no matching field of name 'xasy' in 'settings'
C:\Program Files (x86)\Asymptote/plain_shipout.asy: 71.14: no matching function 'deconstruct(frame, frame, transform)'
C:\Program Files (x86)\Asymptote/plain_shipout.asy: 89.14: no matching field of name 'xasy' in 'settings'
C:\Program Files (x86)\Asymptote/plain_shipout.asy: 102.3: no matching variable '_shipout'
C:\Program Files (x86)\Asymptote/plain_shipout.asy: 102.37: use of variable 'format' is ambiguous
C:\Program Files (x86)\Asymptote/plain_shipout.asy: 102.49: use of variable 'view' is ambiguous
.
See the asypictureB package documentation for explanation.
Type H <return> for immediate help.
...
l.27 \end{asypicture}
I attempted to follow the instructions to install asymptote, but I got:
Sorry, but "MiKTeX Package Manager" did not succeed for the following reason:
Package "asymptote" is already installed
warning: package 'asymptote' is not installed
. And even if you do not getasypictureB
running for some reason, you can still addsettings.outformat = "pdf";
to your examples and runasy
.