How to save Imaxima buffer as PostScript or LaTeX ??



> Does someone know a way to save the Imaxima buffer as a
> PostScript or LaTeX document?

imaxima rocks. very lightweight, a small number of useful commands.

(some of the following is unix-specific, but it
 can surely be done in other OSs)

 M-x imaxima-latex

produces a complete stand-alone latex document of
the imaxima buffer. If you are copying snippets into
a larger document, you can do this repeatedly and
cut and paste pieces. There are a few latex macros
at the top of the output that should be copied once
into your main latex output.

Inline plots from, say wxplot2d, will show up like
this:

\begin{dmath}[number={}]
 /home/lapeyre/maxout_1.eps\end{dmath}

which does not show the plot. you can fix this with

 cp ~/maxout_1.eps ~/mydocument/myplot.eps

and then edit the latex above to read

\begin{dmath}[number={\%o2}]
 \includegraphics[width=.5\linewidth]{myplot}
\end{dmath}

If you are using pdflatex, then you need to give
 
  epstopdf myplot.eps

on my system epstopdf is in the package texlive-extra-utils

You can put a pretty box around each chunk of output like this:

\usepackage{boxedminipage}

\newcommand{\bbm}{\vspace{5pt}\par\noindent\begin{boxedminipage}
{1.05\linewidth}\newcommand{\ebm}
{\end{boxedminipage}\vspace{5pt}\par\noindent}

Then bracket the output with \bbm \ebm

There are many other ways to box text in latex, but this is the only
one I found that worked with the macros used by imaxima-latex

If you are producing both pdf and html from the same tex source, you may find
this useful instead:

\html{ \newcommand{\bbm}{\vspace{5pt}\par\noindent\begin{boxedminipage}
{2.0\linewidth}} }
\latex{ \newcommand{\bbm}{\vspace{5pt}\par\noindent\begin{boxedminipage}
{1.05\linewidth}} }

An example of the result is at

  http://www.johnlapeyre.com/qinf/qinf.pdf

  and

  http://www.johnlapeyre.com/qinf/qinf_html/qinf.html

Cheers,
John