3

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 '15 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.) – ShreevatsaR Mar 7 '15 at 18:23
6

enter image description here

\documentclass{article}
\usepackage{xlop}
\begin{document}
first test:
\opmul[displayshiftintermediary=all]{15248}{3445}
 second test:
\opmul[displayintermediary=all]{15248}{3445}
 last test:
\opmul[displayintermediary=None]{15248}{3445}
\end{document}
6

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:

\documentclass{article}
\usepackage{basicarith}
\begin{document}

\probline{12}{....912563}
\opline{$\times$}{....601894}
\nextpline{.....650252}
\nextpline{....213067\ }
\nextpline{...300504\ \ }
\opline{}{......63\ \ \ }
\soluline{.......4322}
\end{document}

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 '15 at 16:49
  • Thanks! I like it; but I am biased. – dgoodmaniii Mar 7 '15 at 16:51
  • This is also a great solution for me. Thanks. – Epsilon Mar 7 '15 at 20:44
  • My compiler complains that "basicarith.sty" cannot be found. Does someone of you know how to fix this ? – Epsilon Mar 7 '15 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. – dgoodmaniii Jun 7 '15 at 0:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.