fast-reflexes / better-react-mathjax

MIT License
119 stars 15 forks source link

Sometimes the same latex doesn't render #65

Closed p-christ closed 3 days ago

p-christ commented 2 weeks ago

Sometimes the below latex renders fine and sometimes the /enclose part errors. By refreshing the page I can make it work or not work sometimes.

Do you know what I might be doing wrong?


image


<step>Factor out (x - 2) from the original expression</step>
<step>Identify the values of a, b, and c</step>

Let's begin with the first step:

## (1) Factor out (x - 2) from the original expression

To do this, we need to use polynomial long division or the factor theorem. Let's use polynomial long division:

<latex>\newline \begin{array}{r}\newline 3x^2+11x-5 \\\newline x-2 \enclose{longdiv}{3x^3+5x^2-27x+10} \\\newline \underline{3x^3-6x^2} \\\newline 11x^2-27x \\\newline \underline{11x^2-22x} \\\newline -5x+10 \\\newline \underline{-5x+10} \\\newline 0\newline \end{array}\newline </latex>

This shows that <latex>3x^3 + 5x^2 - 27x + 10 = (x-2)(3x^2+11x-5)</latex>```
fast-reflexes commented 2 weeks ago

Hi!

You seem to have some markup context in which you insert Latex? Then a lot depends on how you integrated better-react-mathjax into that markup library.

But for starters, what's in the latex component? And is that a React component or some other markup delimiter that you're using? I think your usecase might also be connected to some of the scenarios under https://github.com/fast-reflexes/better-react-mathjax?tab=readme-ov-file#general-considerations-dont-skip where literal content is mixed with MathJax content.

But all in all, your use-case seems a bit complex so I need a lot more info to look into it or perhaps access to the repo and instructions on how to reproduce the error :) The positive thing is that I think it's 100% solveable :) If you don't want to give me access to the repo, clone it and construct a simple toy scenario where I can reproduce the problem.

fast-reflexes commented 3 days ago

Closing this! You gotta be able to work with me for me to solve these things, if you can't put in some time, then I won't either :) Feel free to reopen if you can provide further info or work with me actively, in which case I'll gladly help you!