Doing my first steps with Asymptote (seems to be a great tool) I ran into
the following problem. I usually try to put my graphics (tikz) into separate
files to be more flexible. So I would like to handle the asy-graphics as well.
But, the \ASYinput macro leads to the error message ! File ended while scanning use of \next. Is there any (simple) way to get this running?
\documentclass{scrartcl}
\usepackage{asymptote}
\newcommand{\ASYinput}[1]{%
\begin{asy}
\input{#1.asy}
\end{asy}
}
\newcommand{\ASYinputx}[1]{%
\input{#1.asy}
}
\begin{document}
blabla
\ASYinputx{test1}
blabla
\ASYinput{test2}
blabla
\end{document}
Here are the two test files.
// test2.asy
size(10cm);
draw((0,0)--(2,1));
and
// test1.asy
\begin{asy}
size(10cm);
draw((0,0)--(2,1));
\end{asy}

asymptotepackage, see Christian Hupfer's answer. I think you should accept his answer instead of mine. – CarLaTeX Mar 18 '18 at 14:34