How can I use asymptote language inside an exsheets question?
For example, the code below will compile perfectly fine. But if the asypicture environment is moved inside the exsheets question environment, then errors happen.
(The same behavior is used if asy environment from asymptote package is used.)
\documentclass{article}
\usepackage{asypictureB}
\usepackage{exsheets}
\begin{document}
\begin{question}
How can I use asymptote inside a question?
\end{question}
\begin{asypicture}{}
import graph3;
import palette;
size3(400,400,200,IgnoreAspect);
currentprojection=orthographic(1,-3,50);
real f(pair r) {return r.x^3-3*r.x*r.y^2;}
real Arg(triple v) {return degrees(cos(v.z),warn=false);}
surface s=surface(f,(-4,-4),(4,4),20,Spline);
s.colors(palette(s.map(zpart),Rainbow()+opacity(0.75) ));
draw(s,render(compression=Low,merge=true),meshpen=black);
real xmin = -5;
real xmax = +5;
real ymin = -5;
real ymax = +5;
pen axisPen = red + 0.75;
draw(Label("$x$",1),(xmin,0,0)--(xmax,0,0),axisPen,Arrow3);
draw(Label("$y$",1),(0,ymin,0)--(0,ymax,0),axisPen,Arrow3);
pen p=fontsize(12pt);
pair P = (2.5,-2);
dot("$P$",(P.x,P.y,f(P)),N,p);
xaxis3("$x$",Bounds,InTicks);
yaxis3("$y$",Bounds,InTicks(beginlabel=false));
zaxis3("$f$",Bounds,InTicks);
\end{asypicture}
\end{document}

asypicturebe used as argument of a macro? Does it do catcode changes? – cgnieder Nov 10 '15 at 08:32asypictureenvironment usesverbatim-like setup to write its contents to a file, which is processed with the Asymptote program to produce an image. – Charles Staats Nov 10 '15 at 16:50