Yes i need typeset equation in a webpage. I know about mathjax, i 
understand that there is a possibility to convert sympy tree expression to 
latex and then handle it on client web page and convert to svg with mathjax.
But is there any way to do this on server (not in client web page) in order 
to send svg result to the client then.

четверг, 17 ноября 2022 г. в 17:13:16 UTC+3, Oscar: 

> On Thu, 17 Nov 2022 at 14:01, Anton Makarov <antonv...@gmail.com> wrote:
> >
> > I need to convert sympy tree expression to svg, for instance:
> > a = sympify("1+2/3")
> > b = sympify("x+5/x+3*sin(x)")
> > c = a + b
> > and i need to convert c expression to svg string
>
> Your question is very ambiguous. Since SVG is an image format then
> this implies that you want an image of the expression somehow but
> there are many different ways that an expression could be represented
> as an image. Do you want an image of the tree or a typeset equation
> (like from LaTeX) or something else?
>
> > I don't want an svg file, i want the string. Something like this:
> > svg_string = <svg width="134" height="32" viewBox="-1 -1 134 32">
> > ...
>
> That's just the contents of an SVG file. If you had an SVG file then
> you could just read the file to get the string.
>
> An SVG file represents an image but you haven't said what you want an
> image of. Also you don't say *why* you want an SVG image. The usual
> reason for wanting SVG is to have an image in a webpage but the
> easiest and potentially best way to have a typeset equation in a
> webpage (assuming that is what you want) is to use Mathjax in which
> case you should just convert your expression to LaTeX:
>
> In [3]: latex(x**2)
> Out[3]: 'x^{2}'
>
> --
> Oscar
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/a87ca34f-5afe-4ebe-b9ba-e1e247239361n%40googlegroups.com.

Reply via email to