With the 6300 version of MikTeX
, which did not include Asymptote
, it was possible to compile all .asy
extension files without any problem on the command line. When they were ready, they could then be included in a TEX
file to obtain a pdf.
Since the 6400 version of MikTeX which includes Asymptote, I can no longer compile .asy
extension files using the three
module directly via the command line.
The code below that produces a cube in 3D manipulable with the mouse. It gives the following error when compiled in command line:
C:\Program Files\MiKTeX 2.9/asymptote/three.asy: 2905.13: runtime: to support onscreen rendering, please install glut library, run ./configure, and recompile
import three;
currentlight=nolight;
settings.tex="latex"; // Moteur LaTeX utilisé pour la compilation (latex, pdflatex, ...)
settings.outformat="pdf"; // Format de sortie ; eps par défaut
settings.prc=true; // Format PRC de la figure ; vrai par défaut
settings.render=4; // Rendu des figures ; -1 par défaut
currentprojection=orthographic(
camera=(11.8235956621239,4.72943826484957,7.09415739727435),
up=(-0.014547132307495,-0.005818852922998,0.0281244557944903),
target=(1.90038956793259e-15,8.63024929298462e-16,2.51968584885631e-16),
zoom=0.7);
size(2.5cm,0);
real a = 0.05;
draw(box(O, 84a*(-X+Y+Z)), heavycyan);
But the same code included in a .tex
file does not pose any problem after a triple compilation PDFLaTeX -> Asymptote -> PDFLaTeX
as it should be done with Asymptote.
\documentclass[10pt]{article}
\usepackage{graphicx}
\usepackage[inline]{asymptote}
\begin{document}
\begin{asy}
import three;
currentlight=nolight;
settings.tex="latex";
settings.outformat="pdf"; // Format de sortie ; eps par défaut
settings.prc=true; // Format PRC de la figure ; vrai par défaut
settings.render=4; // Rendu des figures ; -1 par défaut
currentprojection=orthographic(
camera=(11.8235956621239,4.72943826484957,7.09415739727435),
up=(-0.014547132307495,-0.005818852922998,0.0281244557944903),
target=(1.90038956793259e-15,8.63024929298462e-16,2.51968584885631e-16),
zoom=0.7);
size(2.5cm,0);
real a = 0.05;
draw(box(O, 84a*(-X+Y+Z)), heavycyan);
\end{asy}
\end{document}
Output:
[Edit]
The odd thing is that after installing Asymptote on Windows like we used to do with the .exe
extension file, we can compile without errors from TeXmaker, both the .asy
file and the .tex
file, but this is still impossible in Windows command line.
[\Edit]
It is very convenient to be able to compile Asymptote
files on the command line before including them in a TeX
file because the compilation is really much faster.
So, how to install the glut library on windows?
.exe
extension file, we can compile without errors from TeXmaker, both the.asy
file and the.tex
file, but this is still impossible in Windows command line.import threes
. It probably works in texmaker but not in cmd on your system because of difference in the PATH-variable.