On Fri, 6 Nov 2009 02:24:53 -0800 (PST)
"ma...@mendelu.cz" <ma...@mendelu.cz> wrote:
>
> Hello, this topis has been started on september on sage-support (no
> answer yet). I think that sage-devel is more suitable for this
> problem. I repost it here with some comments (workaround and minimal
> example for the bug)
>
> On 4 zář, 12:11, "ma...@mendelu.cz" <ma...@mendelu.cz> wrote:
> > Hello, this code give "doubleexponent error".
> >
> > var('a x b gamma p')
> > f(x)=a*x^((gamma-p))+b*x^((-p))
> > (f((b*p/((gamma-p)*a))^(1/gamma))).show()
> >
>
> Since another user reported similar behavior to me, I am sending more
> comments.
>
> workaround is to simplify like this
> maxima(f((b*p/((gamma-p)*a))^(1/gamma))).radcan().sage().show()
>
> minimal example for the problem is
> sage: latex((x^pi)^e)
> {(x)}^{\pi}^{e} --- this is not valid TeX expression and jsmath
> does not render it.
>
>
> I tried to fix it ad it seems that this has to be fixed in
> /libs/ginac/decl.pxi
> somewhere close to
> object GEx_to_str_latex "_to_PyString_latex<ex>"(GEx *s) except +
> but i do not uderstand the format and the purpouse of this file.
>
> Perhaps somebody else has better idea and more experiences with this.
Thanks for taking the time to isolate the issue. The code for printing
symbolic expressions is in pynac (C++). The fix can be as simple as
printing an extra set of braces around power objects.
If anybody wants to try fixing this, the relevant function is
power::do_print_latex() in power.cpp. To get to the file (using the
instructions I wrote in another message just now), go to your SAGE_ROOT
and do:
./sage -f -s spkg/standard/pynac-0.1.9.p0.spkg
cd spkg/build/pynac-0.1.9/src/ginac
Edit power.cpp. To compile and make your changes effective, go to your
SAGE_ROOT again, and do
./sage -sh
cd spkg/build/pynac-0.1.9/src
make install
Of course, another option is to open a ticket for this if there isn't
one already and I'll take a look at it when I find some time.
Thanks.
Burcin