0

I want to write a long division equation upside down in Mathjax.

However, googling with similar keywards like 'longdiv upside down' did not give me a good solution.

A solution in Write this division method in latex has vertical bar, but I want a bent bar.

I found another solution from the link and modified \longdiv form to )\underbar form. This is the most similar to what I wanted, but both \underline{sth} and \underline{\smash{sth}} have a little gap at the edge. Their edge don't fit as good as \longdiv.

This is my question. Can you tell me a grammar of this if it exist? Actually, I don't know whether this grammar exists.


The following is part of Mathjax code I made and the image of actual result.
Sorry for the wrong way of numbers written, as it is a prototype. Please focus on the division symbol.

$$ 
\require{enclose}
\begin{array}{rll}

4 \underline{\smash{)500\phantom{0}}} && \hbox{($4 \times 1 = 4$)} \[-3pt] 10\phantom{00} && \hbox{($5 - 4 = 1$)} \[-3pt] \underline{) \phantom{0}8\phantom{00}} && \hbox{($4 \times 2 = 8$)} \[-3pt] \phantom{00}20 \phantom{0} && \hbox{($10 - 8 = 2$)} \[-3pt] \underline{)\phantom{0}20 \phantom{0}} && \hbox{($4 \times 5 = 20$)} \[-3pt] \phantom{0}0 \phantom{0} \end{array} $$

enter image description here

Stephen
  • 3,826
  • Since the tag has been added, but you code does not seem to relate: Did you try the longdivision package? – Jasper Habicht Jul 05 '23 at 10:31
  • @JasperHabicht Thanks for your suggestion. The package may have it and I will try it. I hope I can use it. Actually, I just make Latex code and send to colleage, who treats it on HTML webpage. – JHyun Ahn Jul 06 '23 at 12:32
  • What does this mean? How is the LaTeX code being implemented in the HTML website? Do you need to use MathJax (which is not (La)TeX, but only uses a similar syntax)? Because then, you won't be able to use proper LaTeX packages, I fear. – Jasper Habicht Jul 06 '23 at 12:49
  • @JasperHabicht Yeah, that is why I memtioned in 1st line, tried not to use packages as possible, and made a symbol looking weird. It seems no basic option exists. Thanks for all your comments to help me. – JHyun Ahn Jul 09 '23 at 03:39
  • The problem is that MathJax is not (La)TeX. It uses a similar syntax, but the way it parses this syntax and outputs things is quite different from (La)TeX (although the output might look very similar). Actually, due to that, MathJax questions are being considered off-topic on this site. – Jasper Habicht Jul 09 '23 at 06:05

0 Answers0