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

Due to odd circumstances, I need to present long division manually (in math mode). That is, without using a macro. Moreover, I cannot use \multicolumn or \cline. Normally, I would do:

& 0. & 7 & 5 \\ \cline{2-4}
\multicolumn{1}{c|}{4} & 3. & 0 & 0 \    & 2. & 8 & \\ \cline{2-3}
& & 2 & 0 \    & & 2 & 0 \\ \cline{3-4}
& & & 0

but is there a way to obtain similar results without \multicolumn or \cline? I'm also open to options using asymptote.

I'm not looking for a generator as they don't insert a 0 when the divisor does not go into the dividend. I'd like a manual way of doing this that looks half-way decent.

share|improve this question

closed as off-topic by egreg, Peter Jansson, mafp, Jubobs, Claudio Fiandrino Dec 21 '13 at 18:29

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center." – egreg, Peter Jansson, mafp, Jubobs, Claudio Fiandrino
If this question can be reworded to fit the rules in the help center, please edit the question.

@Close Voters: I would say just an edit is needed. A solution for this that works in LaTeX would (likely) work with MathJax as well. – Sean Allred Dec 20 '13 at 5:25
MathJax questions are generally considered off topic, but this one is a duplicate, anyway: Is there a long division macro? – Alan Munn Dec 20 '13 at 5:28
The duplicate questions get TeX answers (this is a TeX forum) but for something that works with mathjax you could look at dpcarlisle.blogspot.co.uk/2012/10/mathml-long-division.html – David Carlisle Dec 20 '13 at 11:03
Answer's to the question @AlanMunn points to need not, and in fact are not, answers to this question. I regard Mathjax markup questions as on topic for this site (as opposed to ones about installation, or problems with this or that browser), so I've voted to reopen. – Charles Stewart Dec 20 '13 at 17:23
Cf. meta.tex.stackexchange.com/questions/272/… - my opinion is pretty much what Martin Scharrer said there. – Charles Stewart Dec 20 '13 at 17:26

A feasible representation:

      \underline{0.75} \\[-2pt]
  4 | 3.00 \\
      \underline{2.8\phantom{0}} \\
        20 \\
        \underline{\phantom{0.}20} \\

as rendered on Math.SE:

enter image description here

share|improve this answer

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