[Tex/LaTex] Better way to display long division

formatting

I'm currently in the process of trying to create a worksheet for my students with long division problems for them to practice. Unfortunately, the best I've been able to come up with so far in terms of displaying long division like how they write it is:

example

Which could work if need be, but I thought I'd see if anyone has tooled around with this and come up with something better. To create that, all I did was type:

$\overline{)12345}$

Any suggestions for ways of making that better (so it looks more like what'd you see when using \longdiv) would be awesome.

Best Answer

You can give a definition of a command inspired by the one used in longdiv.sty; something along these lines:

\documentclass{article}

\newcommand\Mydiv[2]{%
$\strut#1$\kern.25em\smash{\raise.3ex\hbox{$\big)$}}$\mkern-8mu
        \overline{\enspace\strut#2}$}

\begin{document}

\Mydiv{56}{3678}\quad\Mydiv{3}{37678}

\end{document}

enter image description here