Formatting long division in LaTeX in an Obsidian note?

Hi, I am trying to format a long division problem in an Obsidian note. The finished product should look like this:
image

All of the LaTeX approaches for doing this that I have seen, involve extensions and packages which AFAIK can’t be used in Obsidian. Is there a way to get this formatting to work in an Obsidian note (without typesetting it elsewhere and adding an image for example)?

Could the following be adapted to your situation?

$$
\require{enclose}
\begin{array}{rll}
    125 && \hbox{(Explanations)} \\[-3pt]
   4 \enclose{longdiv}{500}\kern-.2ex \\[-3pt]
      \underline{4\phantom{00}} && \hbox{($4 \times 1 = 4$)} \\[-3pt]
      10\phantom{0} && \hbox{($5 - 4 = 1$)} \\[-3pt]
      \underline{\phantom{0}8\phantom{0}} && \hbox{($4 \times 2 = 8$)} \\[-3pt]
      \phantom{0}20 && \hbox{($10 - 8 = 2$)} \\[-3pt]
      \underline{\phantom{0}20} && \hbox{($4 \times 5 = 20$)} \\[-3pt]
      \phantom{00}0
  \end{array}
$$

It’s lifted from a Google search on “mathjax long division”, and this response: latex - Way to show long division symbol )‾‾‾‾‾‾ in MathJax - Stack Overflow

It works on mobile, it seems.

1 Like

Thank you! I think that might have been the one web page I didn’t Google.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.