# [Maxima] How to save Imaxima buffer as PostScript or LaTeX ??

Leo Butler l.butler at ed.ac.uk
Sat Aug 30 14:00:31 CDT 2008


On Sat, 30 Aug 2008, Robert Dodier wrote:

< Hello,
<
< Does someone know a way to save the Imaxima buffer as a
< PostScript or LaTeX document?
<
< "Save (current buffer)" in the File menu of Emacs saves the
< buffer as a mix of plain text (inputs) and LaTeX (outputs).
< I guess I could mogrify that stuff into a LaTeX document but
< that would require wrapping all the input in \verbatim or something.
< I was just hoping to avoid the trouble. Thanks for any advice.
<
< Many thanks to Yasuaki Honda for maintaining Imaxima.
< It certainly is a great program.

Robert,
Probably you have thought of this, but, try the following: execute

(replace-regexp "\$$(%i.+\$$" "\\\\begin{verbatim}
\\1
\\\\end{verbatim}" nil nil nil)

in your emacs maxima buffer, then save the file.

You can write a more robust regexp if your input lines include linebreaks in
them.

Leo

--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.