Processing Maple Worksheets Exported as LaTeX ============================================= Contents of This Directory -------------------------- This directory contains two sub-directories, inputs209 - style files needed to process Maple worksheets exported as LaTeX from Maple V Release 4 in "LaTeX 2.09" format: o maple209.sty o psfig.sty inputs2e - style files needed to process Maple worksheets exported as LaTeX from Maple V Release 4 in "LaTeX 2e" format: o maple2e.sty (You don't need psfig.sty if you are using LaTeX2e because the standard LaTeX Graphics Package includes this functionality---see below.) Move these files in the "inputs" directory used by your version of LaTeX---see your LaTeX documentation for details. How to Process a ".tex" File ---------------------------- Printing a document using LaTeX requires two steps. First, you run a text file which includes special formatting instructions within the text (.tex file), through a "LaTeX" program. The result is a DeVice Independent output file (".dvi" file). The second step is to convert the device independent file into the format required by your printer (usually PostScript). Common conversion programs are "dvips" and "dvi2ps", but there are many others. The Maple Macros ---------------- Your document preamble should contain a command to use this package. For example, \documentclass[fullpage,11pt]{article} % a standard latex style \usepackage{maple2e} or for LaTeX 2.09, \documentstyle[fullpage,11pt,maple209]{article} The file "maple2e.sty" (or "maple209.sty" if you are using LaTeX 2.09) contains a set of macros which are specific to Maple. They define various environments used in the LaTeX document which Maple produced. This includes definitions for the special environments \begin{mapleinput} ... \end{mapleinput} \begin{maplettyout} ... \end{maplettyout} \begin{maplelatex} ... \end{maplelatex} and the macro \mapleplot{plotfilename} to facilitate the inclusion of plots, and a macro "\mapleinline" for handling inline 2-D display which Maple generates. For example, \mapleinline{inert}{2d}{sin(x^2);}{$\sin(x^2)$} Changing Layout Parameters -------------------------- The exported worksheet also has provision for defining styles. A macro appears in the preamble for each of the paragraph and character styles in use, including named user styles. This macro checks to see if LaTeX has defined such a style, and if not, defines it in a manner which defaults to the normal document style. You can easily override this effect by defining new latex environments or macros. Some examples of such definitions are shown below. % Named Maple Paragraph Styles \newenvironment{Normal}{\normalsize\rmfamily\mdseries}{} \newenvironment{Text Output}{\normalsize\ttfamily\mdseries}{} \newenvironment{Title}{\begin{center}\rmfamily\Large\bfseries\upshape}% {\end{center}} % Named Maple Character styles \newenvironment{Warning}{\ttfamily}{} \def\HyperLink#1{{\normalsize\rmfamily\itshape #1}} Character style names with blanks in them require special treatment: \expandafter\def\csname Help Heading\endcsname#1{% {\large\bfseries\sffamily\upshape #1}} You can modify the overall style of your latex document by creating or changing these macro definitions. Such changes should occur in the preamble of your document. The preamble to each of the Maple style files lists the various parameters which you may set. Including Plots with LaTeX 2e ----------------------------- When Maple encounters a plot while exporting a worksheet, it writes the plot into a file in Encapsulated PostScript format and inserts a macro call of the following form into the LaTeX file. \mapleplot{plot01.eps} In order to include such graphics in your document with LaTeX 2e, you must have one of the many "dvi" to PostScript conversion programs and the Graphics Package must be correctly installed. This package is a standard part of the LaTeX 2e distribution. The conversion program "dvips" is the default. If you have a specific "dvi" conversion program such as "dvipsone", then modify your preamble to include the name of your converter. For example, \usepackage[dvipsone]{maple2e} If you do not have a "dvi" to PostScript conversion program, you will not be able to include plots. Modify the your preamble to include the following line. \usepackage[noplots]{maple2e} Including Plots with LaTeX 2.09 ------------------------------- When Maple encounters a plot while exporting a worksheet, it writes the plot into a file in Encapsulated PostScript format and inserts a macro call of the following form into the LaTeX file. \mapleplot{plot01.eps} In order to include graphics in your document with LaTeX 2.09, you must have one of the many "dvi" to PostScript conversion programs. You must also have a macro package which is compatible with your particular converter. The macro package "psfig.sty", supplied, is compatible with "dvips". Move this style file to the "inputs" directory used by your version of LaTeX---see your LaTeX documentation for details. The "maple209.sty" package (maple209.sty) for LaTeX 2.09 is designed to work with dvips. No other ".dvi" to PostScript converters are supported by Waterloo Maple for this older version of LaTeX as there is no standard way of including graphics. You will need to customize the style file yourself. (Sorry!) Problems with Included Plots ---------------------------- Problems printing plots are a result of a lack of compatibility between the macros used by LaTeX to include the plot (for example, psfig.sty designed for LaTeX 2.09), and the program which you use to convert the .dvi files to PostScript (for example, dvips or dvi2ps). If these two are not matched, then plots may not appear or may appear at the wrong size, location, or orientation. One BIG advantage of the new LaTeX 2e is that the built-in "graphics" package provides a uniform way of including graphics. Any standard implementation of LaTeX 2e is fine. If someone is still using the old 2.09 version, suggest politely to them that NOW would be a wonderful time to upgrade. In LaTeX 2e all you do is use the command \usepackage[dvi2ps]{maple2e} (or replace dvi2ps with the name of your .dvi to PostScript converter.) to load the special Maple macros and indicate which converter you use. If you MUST still use the old LaTeX 209, then you will need to do the following. First, locate the macro package necessary to include PostScript graphics with your .dvi to PostScript converter. "psfig.sty" works for dvips, but for dvi2ps you may need "epsf.sty" or something else. Consult the documentation that came with your .dvi to PostScript converter for details. You will then need to edit the definition of the \mapleplot command found in the maple209.sty file to make it compatible with your converter. Of course, this may involve a little---possibly complicated---programming in LaTeX. In my experience, it may also involve trial and error. The "maple2e" style package (maple2e.sty) that we provide with Maple V Release 4 knows about the most popular conversion programs. Just specify which converter you are using, as described above. The "maple209.sty" package (maple209.sty) for LaTeX 2.09, on the other hand, is designed to work only with dvips. No other ".dvi" to PostScript converters are supported by Waterloo Maple for this older version of LaTeX as there is no standard way of including graphics. You will need to customize the style file yourself. (Sorry!)