mehdisadeghi / react-mathjax-preview

The MathJax React component you were looking for.
https://mehdisadeghi.github.io/react-mathjax-preview/
MIT License
49 stars 30 forks source link

Taking multiline matrix in MathJax but there is some issue in this module #3

Closed karnprem90 closed 6 years ago

karnprem90 commented 6 years ago

Please find the attached image screen shot 2017-10-26 at 5 02 46 pm

$If [\left| \begin{matrix} a & b-c & c+b \ a+b & b & c-a \ a-b & a+b & c \ \end{matrix} \right|=0,] =0 $

mehdisadeghi commented 6 years ago

@karnprem90 I can't tell the difference, this is my demo:

image

What are the issues that you are referring to?

karnprem90 commented 6 years ago

I am using react quill rich editor. Where I do copy paste of multiline equation which doesn't parse into latex equation? I am just passing equation in .It is not working for multiline only. Another example is Equation =

$\Delta =\left| \begin{matrix} a & b & c \ b & c & a \ c & a & b \ \end{matrix} \right|$

It is not working, but if I do something like this

$\Delta =\left| \begin{matrix}a & b & c \ b & c & a \c & a & b \\end{matrix} \right|$

It is working perfectly fine but for multiline it's not working.

mehdisadeghi commented 6 years ago

@karnprem90 If I understand correctly, you have an editor that you paste your math there and then you (programmatically) pass it to react-mathjax-preview and when your math is multi-line it does not work.

I think your editor is probably modifying line-feeds and replacing them or doing something similar that causes the problem. If you paste your above multi-line math inside the demo page of the component, you'll see that it displays correctly.

mehdisadeghi commented 6 years ago

As far as I can tell this is an editor problem (as described in the latest comment), therefore I close this issue. Feel free to reopen (or submit a PR) if you think the error is in this program.