TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
    
Can you include the information about the differences of Maple compared to Mathematica? It seems that same answers apply directly to any code up to style issues. – percusse Apr 17 '13 at 11:07
1  
Unfortunately, Maple is not one of the predefined languages in listings. You have to create your own style for that. – hpesoj626 Apr 17 '13 at 11:49
    
I was wondering if its possible to Matlab type publish/export maple code into latex although not good. – texenthusiast Apr 17 '13 at 17:24
    
This material may be helpful, or at least get you started: puszcza.gnu.org.ua/support/?153 – Jan Hlavacek May 22 '13 at 12:44
    
Maplesoft is not interested in Latex. They have latex bugs in their Latex code generation for decade and more now and these bugs have not been fixed. For Maple code, I simply using listings but language I use is just plain text. – Nasser 2 hours ago

Maplesoft provides a LaTeX package that helps include Maple code into a LaTeX document. Unfortunately, it is quite bad I think. You have to modify the files yourself if you want to have the Maple commands in red for instance, and the output in blue.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.