Translating graphical output to LATEX

### 2.7.3 Translating graphical output to LATEX

You can see all of your graphic output at once on the DispG screen, which you can bring up with the command DispG(). (This screen can be cleared with the command line command erase().) On the DispG screen there will be a Print menu; the Print ▸ LaTeX print will give you several files DispG.tex, DispG.dvi, DispG.ps and DispG.png with the graphics in different formats. To save it without using the DispG() command use the graph2tex command.

The graph2tex command saves all current graphic output to a LATEX file.

- graph2tex takes filename.tex, the name of a file.
- graph2tex("filename.tex") saves all graphic output in LATEX form to the file filename.tex.

#### Example

The command line

graph2tex("myfile.tex")

creates a LATEX file myfile.tex with the graphs. To save a 3D graph, use the command graph3d2tex.

To save a single graph as a LATEX file, use the M menu to the right of the graph. Selecting M ▸ Export Print ▸ Print (with LaTeX) will save the current graph. You can also save a single graph by selecting that level, then use the menu item File ▸ LaTeX ▸ LaTeX print selection. This method will save the graph in several formats; sessionname.tex, sessionname.dvi, sessionname.ps and sessionname.png. If the session has not been saved and named, the files will begin with sessionn for some integer n.