3

I am writing my dissertation through LaTeX, and I want to insert the code from MAPLE, it is about 2 pages and I am not sure how to include the algorithm, do you have any idea how am I going to do it?

Vangelis
  • 121

1 Answers1

4

Maple (I assume you are talking about http://www.maplesoft.com/) has a built in style for including Maple code to the LaTeX environment.

What you do is simply locate you installation directory:

~/apps/maple15/

is my installation directory. If you are on a Windows machine it will be something like:

C:\Program Files\MapleSoft\Maple15

Within a folder named etc is located. In that style files and definitions used for Maple is located, you should see the following files:

maple2e.sty   
mapleenv.sty    
maplestd2e.sty  
mapletab.sty
mapleenv.def
mapleplots.sty
maplestyle.sty  
mapleutil.sty

if you use the built in Maple to LaTeX exporter you simply need to add these style files and definitions to your path.

I.e. copy them to your TeX file and compile.

I have attached a small output of an as-is output:

enter image description here

It has the last section folded in.

nickpapior
  • 17,275
  • thank's but I have a problem with the graphs,I can't see them into latex, and last how am I going to connect my dissertation file with the file that has the maple code – Vangelis Aug 21 '12 at 13:56
  • @Vangelis the graphs are in exported in eps format. So change them to whatever format you use. Then simply strip the Maple TeX file from the header and include it in your dissertation. Just remember to add the preamble from the Maple output to your dissertation as well. If in doubt please provide a full minimal example in your question. – nickpapior Aug 21 '12 at 15:08
  • @zeroth I have been trying to change the MapleFont size without success. Do you know how to achieve that? – pluton Aug 26 '12 at 15:51
  • @pluton look in the style files... for direct manipulation. Else you enclose the environments in a block which reduces the size of the font. Search around for having several default font sizes. – nickpapior Aug 26 '12 at 16:38
  • alright. Strangely, they define the \MapleSize and \MapleFont commands that are never used in the .sty files. – pluton Aug 26 '12 at 16:52
  • I have followed the steps above: chuck all the Maple files into the same directory and then for the images I followed " change them to whatever format you use" by using the epstopdf package. But... it doesn't work. – User 17670 Mar 13 '13 at 19:51
  • @User17670 you need to give me more information. What does the log information tell you? – nickpapior Mar 13 '13 at 19:55
  • @zeroth I get an overfull hbox but that's it. The file compiles and it shows the text in the document quite nicely. However, for the figure I have in my maple file, it just has the caption, with no actual plot. – User 17670 Mar 13 '13 at 20:02
  • @User17670 Check where in the file the includegraphics is and make sure that it refers to the correct file. Make sure that the file ending is correct (you could try and add/remove it). – nickpapior Mar 13 '13 at 20:04
  • @zeroth There is no includegraphics line in the code. Should there be? All I did was this: clicked File>Export>LaTeX. – User 17670 Mar 13 '13 at 21:57
  • @User17670 look for \mapleplot{figurename.eps} and change that to \mapleplot{figurename}, then pdflatex will automatically grab the PDF version of the file. Remember that you have to have runned eps2pdf on figurename.eps before. – nickpapior Mar 13 '13 at 22:06
  • I didn't remove the .eps but, but I did remove the spaces from the file name and add the graphicx package. I don't know which of these fixed it. This is what I hate about LaTeX. – User 17670 Mar 13 '13 at 22:34
  • @User17670 It was the space, please see: http://tex.stackexchange.com/questions/8422/how-to-include-graphics-with-spaces-in-their-path – nickpapior Mar 15 '13 at 17:40
  • When I export maple documents, they only show the output of the commands not the commands themselves. How do i fix this? – Abijah May 08 '18 at 13:09