1

Help me to understand. How can I use latex in react in this way

\documentclass{article}
\usepackage{xlop}

\begin{document}
\opdiv{6000}{34}

\opdiv[maxdivstep=3]{6000}{34}
\end{document}

result/image

Maybe some extension for MathJax (I found longdiv.js and I can't connect it to MathJax config in react "use this package https://www.npmjs.com/package/better-react-mathjax" ) I can only render standart strings ($\frac{}{} \sqrt \cdot and etc..... $) and I don't understand how to use calculations and is it possible?

enhor
  • 11
  • 1
  • Mathjax and Latex are not the same thing. Mathjax implements specifically the math mode of Latex but not the rest. This is explained [here](https://stackoverflow.com/questions/21192606/can-i-add-latex-packages-to-mathjax). The `xlop` package is not part of basic math mode and each additional package needs a specific [extension](https://docs.mathjax.org/en/latest/input/tex/extensions.html) in Mathjax and I [don't think such exists for the `xlop` package](https://docs.mathjax.org/en/latest/input/tex/extensions/index.html). – fast-reflexes Apr 28 '22 at 04:17
  • 1
    If you can check the sources of the `xlop` package you could perhaps use that code directly with Mathjax (if it uses math mode to accomplish the results). But that is a bit of a hack... Otherwise I would write a JavaScript function that does the same thing using HTML and then add each number using Mathjax so that it looks the same as in your example; it's basically just a table with some cells missing digits and some borders transparent, the hard part might be to calculate the content :) – fast-reflexes Apr 28 '22 at 04:31

0 Answers0