emaxima question



David Ronis <ronis@flu-guest-pc.eng.tau.ac.il> writes:

>  > > I've started playing around with emaxima and was wondering how to do
>  > > the following:
>  > >
>  > > 1.  Things like psi will render as \psi and psi[0] as \psi_0, that's
>  > >     great, but how would I get something like \tilde \psi or \dot
>  > >     \psi?  
>  > 
>  > What Maxima entities would you want to result in that?
>
> Good question.  Perhaps some default compound structure function could
> be introduced like
>
> 		   tildepsi : texquote(tilde psi);
>
> which would then be converted to { \tilde \psi } by the tex function.

The command
texput(tildepsi,"\\tilde \\psi")
will do that.

>  > >     Is the entire Greek alphabet implemented (both upper and
>  > >     lower case)?
>  > 
>  > Just lower case, I think.
>
> How hard would it be to implement the upper case variables?  

Not hard at all, once a convention for writing the upper case
variables is made.  Since Maxima is currently case insensitive, 
psi and Psi are indistiguishable.  It would be easy to make something
like CapitalPsi TeX up as \Psi.
Since Maxima may become case sensitive, it may be better to wait to do
something extensive about this, and just use texput as needed for
right now.

>  > > 2.  Can I suppress/hide the maxima code and/or raw tex of the maximaoutput?  
>  > 
>  > What do you mean?
>  > A cell that looks like
>  > \maximanoshow
>  > ...
>  > \endmaximanoshow
>
>  > will be evaluated in Maxima, but won't be TeXed up, if that's what you
>  > mean. 
>
> I hadn't tried that, but it's the reverse of what I want.  Basically,
> I'd like to preview the final document (e.g., without any of the
> maxima input commands/intermediate results showing).

So, for a cell like
\beginmaxima
2+2;
\maximatexoutput
\m  4 \\
\endmaxima
the 
2+2;
should be TeXed, but not the 4.  Right?

>  > > 3.  Finally, once I have everything done, I need to save the
>  > >     output into a regular latex (actually revtex) document, and be
>  > >     able to send it somewhere that doesn't have maxima/emaxima installed
>  > >     (e.g., a journal).  Is there some simple command to strip out
>  > >     everything but the tex output?
>
>  > Not yet, but one could be made.
>  > It should probably comment out the original cell, so the input will
>  > still be in the unprocessed document, and then insert some TeX
>  > statements that will result in the output.  The resulting *.tex file
>  > won't look very tidy, and changing the Maxima commands after this
>  > command is run would be a pain, hm, and the bars would be a minor
>  > pain, but something can be done.  Why type of cells are you interested
>  > in having this done to, to start?
>
> I like the comment idea.  How about a simple script or auctex function
> that simply comments or uncomments all but the output tex lines in a
> region/document?

It'd have to do a bit more, since emaxima.sty defines some TeX
commands that are used in a cell. 
So the script would have to have a cell like
  \beginmaximasession
  2+2;
  \maximatexsession
  \C4.  2+2; \\
  \D4.  4 \\
  \endmaximasession
and replace it by
  %\beginmaximasession
  %2+2;
  %\maximatexsession
  %\C4.  2+2; \\
  %\D4.  4 \\
  %\endmaximasession
  (C4) \verb~2+2;~ \\
  (D4) \[ 4 \]
(something better than that, actually, but you get the idea.)
For normal cells, like the 2+2; one above, it'd be different.
As a starting point, what kind of cells would be most useful?

Jay