I have diagrams generated in Asymptote stored in external files. Is it possible to input the files into my current LaTeX document and to choose the scale factor within the current document?
The following naive approach does not work:
\documentclass{article}
\usepackage{asymptote}
\begin{document}
A unit sphere, 1/4 size:
\begin{asy}[width=0.25\textwidth]
\input{asyfile}
\end{asy}
\end{document}
Contents of asyfile:
import solids;
draw(unitsphere,gray);
(I use these diagrams in different contexts, so I do not want to pick the scaling within the Asymptote file.)
TeX\inputcommand inside theasyenvironment, instead of\input{asyfile}use theAsymptotecodeinclude asyfile;– g.kov Oct 21 '13 at 21:42includegraphics(no need for theasymptotepackage). You could make yourasyenvironment consist of something likesize(5cm, 0); include asyfile;which would set the sizing separately each time, but you can't use the\textwidthmacro this way. – Charles Staats Oct 22 '13 at 01:41