Question #2d1b5

2 Answers
Nov 2, 2015

Here's how I would do it.


The problem is in getting the numbers to line up.

I use "color(white)(X)" with as many Xs and other characters as needed to get the correct alignment.

For the horizontal lines I use "stackrel(—)" with as many m-dashes as needed for a proper line length.

Example: #425 -: 25#


It's a bit tedious, but it gives a reasonable answer..

I invite others to add their suggestions for formatting.

Dec 5, 2015

An alternative method using matrix structure


Here's what my version would look like. I find it easier to work with especially when adapting it for polynomial long division.

#{: (,,,1,7), (,,"---","---","---"), (25,")",4,2,5), (,,2,5,), (,,"---","---",), (,,1,7,5), (,,1,7,5), (,,"---","---","---"), (,,,,0) :}#

Without the opening and closing hashtags:


Use of the matrix structure avoids alignment problems but results in horizontal spacing that may appear unnatural.

You might also note that I've used separate lines for my horizontal strokes; this unfortunately (to my mind) increases the vertical spacing. The alternative, using stackrel, is possible:
#color(white)("XXX")#e.g. (25,")",stackrel("---")4,stackrel("---")2,stackrel("---")5
but can lead to some messy code:
#color(white)("XXX")#e.g. (,,stackrel("---")color(white)("X"),stackrel("---")color(white)("X"),stackrel("---")0)
if you want a line above spaces with no real characters.

Here's what it looks like with stackrel:
#{: (,,,1,7), (25,")",stackrel("---")4,stackrel("---")2,stackrel("---")5), (,,2,5,), (,,stackrel("---")1,stackrel("---")7,stackrel("---")5), (,,1,7,5), (,,stackrel("---")color(white)("X"),stackrel("---")color(white)("X"),stackrel("---")0) :}#