I was wondering what the most efficient way is to typset this:

enter image description here

My first thought was doing this with tabular but seems quite messy to me.

  • xlop package does this
    – touhami
    Mar 7, 2015 at 11:52
  • This is just multiplication of integers; there are no fractions, right? (Though one is visible just on the left edge of the image.) Mar 7, 2015 at 18:23

2 Answers 2


enter image description here

first test:
 second test:
 last test:

In addition to xlop(a great package) there is also basicarith, which does some of the same things in a much more manual way. (Disclaimer: I'm the author of basicarith and therefore have the expected opinions about its usefulness.) It was designed for basic arithmetic textbooks, so it allows for independent styling of individual rows or columns. Your problem:


\nextpline{....213067\ }
\nextpline{...300504\ \ }
\opline{}{......63\ \ \ }

This will produce the following:

basicarith typeesetting example

Which, other than any transcription errors, seems pretty close to your handwritten example.

basicarith is manual, while xlop will do the work for you; in basicarith, as you can see, you must tell the package how wide your problem is in number of characters (the \probline macro), and manually say when you want an underline drawn (\opline, which takes the operation symbol as a first argument) or an overline (\soluline), and the answer is not calculated for you. xlop avoids all this unpleasantness. basicarith provides macros for Anglo-American style division, though (xlop only for European-style division, which is the primary reason I wrote basicarith).

basicarith also has lots of configuration options for customizing appearance; for example, you can step through a problem digit by digit, highlighting the appropriate lines or rows as you do so. And you can solve as far as you want and then stop, allowing individual steps to be explained; you can resume the problem whenever you want.

I'd encourage you to examine these options and decide which is more appropriate for your purposes.

  • @dgoomaniii good work (basicarith)
    – touhami
    Mar 7, 2015 at 16:49
  • Thanks! I like it; but I am biased. Mar 7, 2015 at 16:51
  • This is also a great solution for me. Thanks.
    – Epsilon
    Mar 7, 2015 at 20:44
  • My compiler complains that "basicarith.sty" cannot be found. Does someone of you know how to fix this ?
    – Epsilon
    Mar 7, 2015 at 22:34
  • 1
    Oh, I see. When I've done this, it's been in custom macros, b7t I think it should work in an enumerate. Just wrap each problem in a \problembox. If this doesn't work, email me, and we'll see if we can improve the package. Jun 7, 2015 at 0:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .