# using Asymptote with Miktek, Texmaker, Windows7, ASYalign undefined

I'm am new to Latex and Texmaker, and loving it. I'm using the MikTek distribution on Windows 7.

Now I want to integrate Asymptote figures into my documents. I installed Asymptote from here: Asymptote download (keeping in mind I had already installed MikTek and Texmaker). I also installed Ghostscript as Asymptote kept asking for that.

My first attempt to embed Asy commands in a Latex file is this:

\documentclass[12pt]{article}

\usepackage{asymptote}

\begin{document}

\begin{asydef}
// Global Asymptote definitions can be put here.
import three;

usepackage("bm");
texpreamble("\def\V#1{\bm{#1}}");
// One can globally override the default toolbar settings here:
// settings.toolbar=true;
\end{asydef}

\begin{asy}
draw((0,0)--(50,0),BeginArrow);
draw((0,-10)--(50,-10),MidArrow);
draw((0,-20)--(50,-20),EndArrow);
draw((0,-30)--(50,-30),Arrows);
\end{asy}

\end{document}


When I first ran it, MikTek fetched a number of packages and installed them on the fly. However I am stuck on this error:

testAsymptote-1.tex ! Undefined control sequence \ASYalign


I see from browsing the web that this problem has come up before. Some of the posts are old, and in any there is no coherent view on where this comes from or how to solve it. Suggestions are all over the map and I don't understand most of them anyway. Any ideas?