Homework Number Two - Part One

 

Part One: Tex and Maple

 

We learn how to export TeX code from Maple and then import it into your own TeX documents.
  1. Start up Maple and use it to do some computations. For example you can just load the example worksheet from homework 1 and step through it executing all the Maple code.
  2. Select "File -> Export As -> Latex" and save with the filename "temp.tex".
  3. Look at the file temp.tex which you just created. You should see something with the same general form as the TeX documents we already saw, but containing lots of unfamiliar commands and environments like maplegroup and mapleinput.
  4. Try processing the TeX file temp.tex with "latex temp". You should see a lot of error messages. What is going on? If you look at the top of temp.tex you will see a line "\usepackage{maple2e}", this is an instruction to use a package containing definitions of a bunch of Maple-related TeX commands: unfortunately this package is not installed by default on most TeX systems.
  5. Download this file into the directory where you have put temp.tex, and unpack it with the command "tar -xzvf latex_pt.tar.gz". Try processing the file temp.tex again, you should now be able to process it and see that it is a TeX file containing the output of your computations.
  6. Suppose that you want to take some Maple output and include it into an existing TeX file of yours (say a set of homework solutions). Here is what you do. Suppose Maple has exported a file foo.tex and you want to include the Maple output in your file bar.tex; copy the part of foo.tex between the lines \documentclass{......} and \begin{document} and insert them in the corresponding part of bar.tex, then copy the part of foo.tex between \begin{document} and \end{document} to the point in bar.tex where you want the Maple output to appear. You don't need the \pagestyle command.

    Here is a tiny example. foo.tex was generated by Maple. bar.tex is a very short TeX document. foobar.tex contains the merged TeX code.