react-native-math-view icon indicating copy to clipboard operation
react-native-math-view copied to clipboard

The lib does not correctly render some latex types that are normally rendered by MathJax

Open dnlsilva opened this issue 2 years ago • 7 comments

Describe the bug If you pass the latex directly to lib via props, for example, the lib will crash. If you pass the latex manually, the lib works, but it renders the wrong latex.

LaTeX Latex: \[\tiny A\, \scriptsize A \, \small A \, \normalsize A \, \large A \, \Large A\, \LARGE A \, \huge A \, \Huge A\] Escaped Latex: \tiny A\, \scriptsize A \, \small A \, \normalsize A \, \large A \, \Large A\, \LARGE A \, \huge A \, \Huge A

Expected behavior 268870577-83ab3d13-0a06-450c-a3b4-89d574bf8263

What is rendered: Screenshot 2023-09-19 at 11 06 49

Error when i pass the value as prop: Screenshot 2023-09-19 at 11 08 03

Related: https://github.com/RocketChat/Rocket.Chat.ReactNative/issues/5215

dnlsilva avatar Sep 19 '23 14:09 dnlsilva

seems to me you are not escaping the values properly

https://github.com/ShaMan123/react-native-math-view#troubleshooting

ShaMan123 avatar Sep 19 '23 18:09 ShaMan123

In this example I sent, what would be the correct escaping? Because as I said, playing it directly on the web it returns correctly.

dnlsilva avatar Sep 19 '23 18:09 dnlsilva

I have attached the link that explain exactly what to do

ShaMan123 avatar Sep 19 '23 18:09 ShaMan123

I think you didn't understand what I said. Currently we already use your lib to render Katex, the escape of other katex works normally. Only this specific one that doesn't work.

dnlsilva avatar Sep 19 '23 19:09 dnlsilva

If mathjax manages then this repo should also because it uses mathjax. Maybe the version is outdated. Try updating and building

ShaMan123 avatar Sep 19 '23 19:09 ShaMan123

Also maybe you need to define these macros

ShaMan123 avatar Sep 19 '23 19:09 ShaMan123

will you please help me related to RNMathVIew not found in UI Manager error. what if the problem and what to do ?

AASHIK-2512 avatar Jan 21 '24 12:01 AASHIK-2512