TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there in existence packages that recreate the following environments: enter image description hereenter image description hereenter image description here

Some of the above have been discussed like in the How to present a vertical multiplication but what I am interested in is if there is a way to recreate the addition and division.

share|improve this question
Are you also interested in displaying the "result" of the operation, as in the linked post? Or just the display of the "problem". – Werner Feb 21 '12 at 19:40
@Werner Both if possible. I have seen how the longdiv package for division of polynomials works and its incredibly useful to me when am writing a tutorial for my students. The display is, I suppose, a first priority and the process well I guess that would require a lot more time but if it can be done I will be thankful. – azetina Feb 21 '12 at 19:44
There is the xlop package that however uses a different way to print the schemes. – egreg Mar 1 '12 at 22:04

The addition is fairly simple and examples can be found at Numbering Vertical Addition Problems.

For the long division in your style you can use an array environment.

enter image description here

The MWE is shown below.

% spacing round the bracket in long division
  & & \multicolumn{4}{r}{2500.}&(answer)\\
  & &                   50&&&&\\
  & &                   12&5&&&\\
  & &                   12&5&&&\\
  & &                     &0&0&&
share|improve this answer
Can this be automated like the longdiv package. – azetina Mar 24 '12 at 16:04
@azetina It can possibly with LuaLaTeX to ease the pain for calculations. It will need some decent effort though. – Yiannis Lazarides Mar 24 '12 at 16:07
Sincerely over the paste months I have been more interested in LuaTex and its variants but I still dont get the idea behind it and how to actually get to understand and even more how to use it. I here you guys here talk about it but I guess I am so much attached to just Latex that I have little effort to indulge in that area. – azetina Mar 24 '12 at 16:11
@azetina If you only going to have examples with integers, it is not too difficult via LaTeX only. If you are going to have decimals then I would use the fp package and life gets more complex. Glad to see these sort of things still being taught. At work at of 25 graduate Engineers none can do a square root by hand:) – Yiannis Lazarides Mar 24 '12 at 16:14
I guess that is the purpose of technology.... – azetina Mar 24 '12 at 16:23

The xlop package takes care of typesetting addition, subtraction, division, multiplication, and calculates easy functions such as gcd. However, the typesetting is French style only still (other styles are planned), for long division, stick with longdiv as suggested by azetina.





Output of the example:

enter image description here

share|improve this answer
Welcome to TeX.SX! While your answer might solve the problem, you should provide a visual output for a quick 'proof' as well. – Christian Hupfer Sep 8 '14 at 14:16
Done that (adding visual proof). Thanks to @ChristianHupfer for the hint. – Georg Jung Dec 1 '14 at 12:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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