Code Monkey home page Code Monkey logo

Comments (2)

roniemartinez avatar roniemartinez commented on July 24, 2024

@Sun-ZhenXing

I found issues here while testing:

  1. Your latex string are missing "\" in-between matrix rows.
  2. Even MathJax cannot render it correctly. (see image below)
    image
  3. The correct string should be r"\left[\begin{matrix}1 & 0 & 0 & 0\\0 & 1 & 0 & 0\\0 & 0 & 1 & 0\\0 & 0 & 0 & 1\end{matrix}\right]"
  4. latex2mathml can correctly generate the corresponding MathML as seen below:
<math xmlns="http://www.w3.org/1998/Math/MathML"><mrow><mrow><mo fence="true" form="prefix" stretchy="true">[</mo><mrow><mtable><mtr><mtd><mn>1</mn></mtd><mtd><mn>0</mn></mtd><mtd><mn>0</mn></mtd><mtd><mn>0</mn></mtd></mtr><mtr><mtd><mn>0</mn></mtd><mtd><mn>1</mn></mtd><mtd><mn>0</mn></mtd><mtd><mn>0</mn></mtd></mtr><mtr><mtd><mn>0</mn></mtd><mtd><mn>0</mn></mtd><mtd><mn>1</mn></mtd><mtd><mn>0</mn></mtd></mtr><mtr><mtd><mn>0</mn></mtd><mtd><mn>0</mn></mtd><mtd><mn>0</mn></mtd><mtd><mn>1</mn></mtd></mtr></mtable></mrow><mo fence="true" form="postfix" stretchy="true">]</mo></mrow></mrow></math>

Rendering

Trying to view it on MathJax viewer correctly renders it:
image

It is possible that you are missing the right styling for these:

  1. <mo fence="true" form="prefix" stretchy="true">[</mo>
  2. <mo fence="true" form="postfix" stretchy="true">]</mo>

from latex2mathml.

Sun-ZhenXing avatar Sun-ZhenXing commented on July 24, 2024

Thank you for your help.
But, the string is this r"\left[\begin{matrix}1 & 0 & 0 & 0\0 & 1 & 0 & 0\0 & 0 & 1 & 0\0 & 0 & 0 & 1\end{matrix}\right]", and this was created by SymPy. When I type it into textbox, it was somehow converted to \. And the string which I tested is r"\left[\begin{matrix}1 & 0 & 0 & 0\0 & 1 & 0 & 0\0 & 0 & 1 & 0\0 & 0 & 0 & 1\end{matrix}\right]".
The problem is I need a big "[", not just a "[".
Then I find the problem is Word, not latex2mathml or SymPy.

from latex2mathml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.