Consider the following MWE. Sorry, I cannot provide the simpler one.
% spiral.tex
\documentclass[preview]{standalone}
\usepackage[inline]{asymptote}
\begin{document}
\begin{asy}
settings.tex="pdflatex";
settings.prc=false;
settings.render=0;
import graph3;
import math;
size(200);
size3(150,180,100);
defaultpen(fontsize(10pt));
currentprojection=orthographic(camera=(8,6,4),up=Z,target=O,zoom=1);
real x(real t) {return t*cos(2pi*t*3);}
real y(real t) {return t*sin(2pi*t*3);}
real z(real t) {return t;}
real xMax=3, yMax=3, zMax=4;
path3 p=graph(x,y,z,0,2.735,operator ..);
triple P=relpoint(p,0.986);
triple Q=(P.x,P.y,0);
pen spiPen=deepcyan+1.2bp;
draw(p,spiPen,Arrow3(size=3));
dot(P);
label("$P$",P,Z+X);
guide3 h=P--Q;
guide3 rho=O--1.2Q;
draw(h, dashed+0.7bp);
draw(rho,dashed+0.7bp);
real arcd=1.5;
guide3 garc=arc(O,arcpoint(O--X,arcd),arcpoint(rho,arcd));
draw(garc,gray,Arrow3(size=3));
label("$z$",h,E);
label("$\rho$",rho,SW);
label("$\phi$",garc,NE);
pen xyzPen=darkblue+1bp;
xaxis3(0,xMax,xyzPen,Arrow3(size=3));
zaxis3("",0,zMax,xyzPen,Arrow3(size=3));
label("$Z$",zMax*Z,SW);
shipout(bbox(Fill(lightyellow)));
\end{asy}
\end{document}
Compiling with Asymptote.bat spiral
produces the following.
where my batch Asymptote.bat
is defined as follows.
rem Asymptote.bat
echo off
rem %1 TeX input filename without extension
if exist "%~1.pdf" del "%~1.pdf"
if exist "%~1.tex" pdflatex "%~1.tex"
if exist "%~1-*.asy" asy -f pdf %~1-*.asy
if exist "%~1.tex" pdflatex "%~1.tex"
for %%x in (pdf tex asy pre) do (if exist "%~1-*.%%x" del "%~1-*.%%x")
for %%x in (aux log pre) do (if exist "%~1.%%x" del "%~1.%%x")
I noticed that the characters in PDF output are not searchable because of conversion. Can we make them still searchable?
Bonus question:
I CAN use asy -f pdf %~1-*.asy
and why can't I use double quotes in asy
command, i.e., asy -f pdf "%~1-*.asy"
?
asy -f pdf %~n1-*.asy
? – g.kov Sep 14 '13 at 3:403d
-labels have to be replaced with projected2d
-labels, likelabel("$Z$",project(zMax*Z),SW);
instead oflabel("$Z$",zMax*Z,SW);
. – g.kov Sep 14 '13 at 4:20asy
command with double quoted file names asasy -f pdf "%~n1-"*.asy
. – g.kov Sep 14 '13 at 13:26batch.bat filename.tex
. – g.kov Sep 14 '13 at 13:46