At here Fanciest way to include Mathematica code in LaTeX we can include Mathematica in LaTeX. I want to include the code
restart:
with(geom3d):
eqS:=Equation(sphere(S,(x-1)^2 + (y-1)^2 +(z-1)^2 -121=0,[x,y,z],'centername'=T)):
L:=[]:
for x from -5 to 10 do
for y from -5 to 10 do
for z from -5 to 10 do if x<>xcoord(T) and y<>ycoord(T) and z <> zcoord(T) and type(x,integer) and type(y,integer)and type(z,integer) and eqS then
L:=[op(L), [x,y,z]] fi;
od: od: od:
nops(L);
I tried
\begin{lstlisting}[language=Maple,caption={}]
restart:
with(geom3d):
eqS:=Equation(sphere(S,(x-1)^2 + (y-1)^2 +(z-1)^2 -121=0,[x,y,z],'centername'=T)):
L:=[]:
for x from -5 to 10 do
for y from -5 to 10 do
for z from -5 to 10 do if x<>xcoord(T) and y<>ycoord(T) and z <> zcoord(T) and type(x,integer) and type(y,integer)and type(z,integer) and eqS then
L:=[op(L), [x,y,z]] fi;
od: od: od:
nops(L);
L;
\end{lstlisting}
How to include Maple code in LaTeX?
listings. You have to create your own style for that. – hpesoj626 Apr 17 '13 at 11:49