javac visual.java
echo \documentclass{article} > picture.tex
echo \usepackage{graphicx} >> picture.tex
echo \begin{document} >> picture.tex

for %%i in (tests\??) do (
	echo Test %%i
	java visual %%i %%i.a && mpost picture.mp && epstopdf picture.1 && move picture.pdf %%i.pdf
rem	echo \begin{figure}[t!] >> picture.tex
	echo \begin{center} >> picture.tex
	echo \includegraphics[width=\textwidth, height=\textheight, keepaspectratio=true]{tests/%%~ni}  >> picture.tex
	echo ~ >> picture.tex
	echo Test %%~ni >> picture.tex
rem	echo \caption{Test %%~ni} >> picture.tex
	echo \end{center} >> picture.tex
rem	echo \end{figure} >> picture.tex
	echo \pagebreak >> picture.tex
)

echo \end{document} >> picture.tex

pdflatex picture.tex
