Skip to content Accesskey=4Skip to sub-navigation Accesskey=3View our Accessibility Options MIT Information Systems Home About IS&T Contact IS&T Site Map Search Advanced Search
Getting StartedGetting Services by Topic or Alphabetically Getting Help

On This Page

[Help]

  

Quick Links

Top Level

Related Links

Ask OLC a question

Athena Consulting Homepage

Helpdesk Stock Answers (for Mac/PC questions)


How to SAVE and RESTORE information from Maple

You can save and restore, and export Maple information in a number of ways.
To save output from Maple (or later restore it) you have a number of choices:

1. Use the 'save' command.  "save filename" will write all assigned
   names in the current Maple session into the file specified by
   filename as a sequence of assignment statements.  The complementary
   command for reading information is "read filename".  If the
   filename ends with ".m" then the information is saved or read in
   "Maple internal format", otherwise the expressions are in readable
   text.  To save ALL your variables in a ".m" file named "foo.m",
   just do the following at the Maple ">" prompt:

	> save `foo.m`;

   To only save a particular variable, say "a" for example, just do:

	> save a, `foo.m`;

2. Use the "Save" or "Save As..." features from the File menu in the X
   version to save the current worksheet.  This saves the commands you
   have typed and the results in "Maple worksheet" format with the
   extension ".mws".  "Open" from the File menu will bring a worksheet
   file up without executing its contents; i.e., you will see the
   commands and results, but the variables aren't actually assigned.
   You can edit and execute the contents interactively (e.g., move to
   a line and hit Return), or execute the entire worksheet from to the
   Edit menu by choosing "Execute", then "Worksheet".


3. Use the 'writeto' routine.  All the future commands will have their
   results stored in a file and will not be displayed on the
   screen. This command is not generally used interactively since you
   can lose control of the session; it is useful in writing Maple
   programs. To restore output to the screen, use:

	> writeto(terminal);

   The 'appendto' command works in the same fashion, except the file
   is appended to instead of overwritten.

4. Use one of the "Export as" choices from the pull-down File menu:

   "Plain Text" saves the worksheet as a plain text dump.

   "Maple Text" saves the worksheet as specially marked text which
   distinguishes between comments, input, and output.  You can then
   read in or paste from such a file, and Maple will interpret lines
   beginning with "> " as input, "# " as text, and ignore the rest
   (i.e., output lines).  To read in the entire file, use File-->Open;
   to paste, use Edit-->Paste Maple Text.

   "LaTeX" generates a .tex file from the worksheet, with .eps files
   for any graphics.
	
   (LaTeX generated by Maple may require some specific .sty files,
   namely maple2e.sty.  As of Maple 10, these can be found in
   /mit/maple/maple_v10.0/distrib/etc/.  You should add that path to
   your TEXINPUTS in order to correctly process Maple-generated LaTeX)


   "HTML" generates HTML from the worksheet, with .gif files for
   equations and graphics.  (Note: it currently does this with frames,
   generating a couple of extra pages and putting the GIFS into an
   image subdirectory.)


5. For LaTeX users, Maple offers another method of formatting output
   in LaTeX math style.  To display an expression in LaTeX math format
   type:

	> latex(expression);
   or:
	> latex(expression, filename);

   For example:

	> latex(%);
	> latex((x^4 - y)/(y^2-3*x));
	> latex(sin(x^2), `/mit/joeuser/maplestuff.tex`);

6. There are also 'C' and 'fortran' functions which generate C or
   fortran code, and the 'eqn' command generates output for the
   troff/eqn processor.

   More information on the above Maple commands can be obtained by typing:

        > ?commandname

   or from the Help menu in the X version of Maple.


Help for features supplied in pull-down menus is available through
the pull-down Help menu.  Try selecting "On Context" and then click
on the menu that you want further information for.

last updated: 5/6/99

MIT Home | Getting Started | Getting Services | Getting Help | About IS&T | Accessibility
Ask a technology question or send a comment about this web page.