[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX] preview-latex and emaxima
From: |
Mosè Giordano |
Subject: |
Re: [AUCTeX] preview-latex and emaxima |
Date: |
Sat, 8 Mar 2014 15:34:19 +0100 |
Hi Tamas,
2014-03-08 12:08 GMT+01:00 Tamas Papp <address@hidden>:
> Hi,
>
> I would like to use preview-latex with the Emaxima LaTeX
> package. A self-contained example file looks like this:
>
> --8<---------------cut here---------------start------------->8---
> %-*-EMaxima-*-
> \documentclass[a4paper,12pt]{article}
> \usepackage[inline]{emaxima}
> \begin{document}
> \begin{maxima}[]
> solve(a*x^2+b*x+c=0,x);
> \maximaoutput*
> \m \left[ x=-\frac{\sqrt{b^2-4 a c}+b}{2 a} , x=\frac{\sqrt{b^2-4 a c}-b}{2
> a} \right] \\
> \end{maxima}
> \end{document}
> --8<---------------cut here---------------end--------------->8---
Since the `emaxima' package isn't on CTAN nor it's shipped with common
TeX distributions, it would have been a good idea to point us where we
could have found it. Anyway, Debian provides it in the `maxima-emacs'
package and I installed it.
> The part from \maximaoutput* to \end{maxima} was generated by maxima,
> not written by hand, and I have no control over it (I can't replace it
> by an equation environment, for example).
>
> I tried to preview it with preview-latex, but the equation does not
> replace the math: it follows it instead. A screenshot is attached.
>
> Is there any way I can fix this? I looked at PreviewMacro in the
> manual, but I don't know how to use it for this specific case.
>From the `preview-latex' manual:
--8<---------------cut here---------------start------------->8---
If you have a certain macro or environment that you want to
preview, first check if it can be chosen by cutomizing
preview-default-options-list in the Preview Latex group.
If it is not available there, you can add it to
preview-default-preamble also in the Preview Latex group, by
adding a \PreviewMacro or \PreviewEnvironment entry (see Provided
commands) after the \RequirePackage line.
--8<---------------cut here---------------end--------------->8---
In your case you can add the following code to your `.emacs':
--8<---------------cut here---------------start------------->8---
(eval-after-load "preview"
'(progn
(add-to-list 'preview-default-preamble
"\\PreviewEnvironment{maxima}" t)))
--8<---------------cut here---------------end--------------->8---
Bye,
Mosè