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
\input
command inside theasy
environment, instead of\input{asyfile}
use theAsymptote
codeinclude asyfile;
– g.kov Oct 21 '13 at 21:42includegraphics
(no need for theasymptote
package). You could make yourasy
environment consist of something likesize(5cm, 0); include asyfile;
which would set the sizing separately each time, but you can't use the\textwidth
macro this way. – Charles Staats Oct 22 '13 at 1:41