(cross posting my SO answer here)

Looks like the MathML that works is [presentation
MathML](https://en.wikipedia.org/wiki/MathML#Presentation_MathML),
whereas SymPy outputs [content
MathML](https://en.wikipedia.org/wiki/MathML#Content_MathML).
Unsurprisingly, Word is unable to convert from content to
presentation, as that requires some degree of mathematical knowledge
on the part of the software.

SymPy [probably ought to
support](https://github.com/sympy/sympy/issues/11893) outputting
presentation format, but until that is implemented, you might try to
find some other software that can convert between the two (I don't
know of any myself, unfortunately).

Aaron Meurer

On Thu, Dec 1, 2016 at 5:14 PM, Yuxiang Wang
<yuxiang.shawn.w...@gmail.com> wrote:
> (cross-posting between here and SO)
>
> Dear all,
>
> It seems that MathML works OK with my word with simple copy and paste for
> strings such as
>
> <math
> xmlns="http://www.w3.org/1998/Math/MathML";><mfrac><mn>1</mn><mn>2</mn></mfrac></math>
>
>
> But when I try to use sympy's mathml printer:
>
> from sympy import S
> from sympy.printing.mathml import mathml
> my_eqn = S(1) / 2
> print(mathml(my_eqn))
>
>
> The output is:
>
> <apply><divide/><cn>1</cn><cn>2</cn></apply>
>
>
> And I cannot copy and paste it into word to make it a Word equation.
>
>
> Could anyone please help?
>
>
> Thank you,
>
>
> Shawn
>
> --
> 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 post to this group, send email to sympy@googlegroups.com.
> Visit this group at https://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/7ffc6145-0c00-4911-86fb-db8bb6ade0a5%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 post to this group, send email to sympy@googlegroups.com.
Visit this group at https://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6LH63C4h9rm6HM8PSe3wU4ZuMoiA1Bjox1-%2BFV_gkpbKg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to