Using place keepers. For example: #0x^2#
# color(white)("ddddddddddddddddd")-x^4+6x^3+0x^2+8x+12#
# color(magenta)(-x^2)(x^2-5x+2)-> ul(-x^4+5x^3-2x^2 larr" Subtract"#
# color(white)("dddddddddddddddddddd")0+ color(white)("d")x^3+2x^2+8x+12#
# color(magenta)(+x)(x^2-5x+2)-> color(white)("ddddd")ul(+color(white)("d")x^3-5x^2+2x larr" Subtract") #
# color(white)("ddddddddddddddddddddddd")0 color(white)("d")+ color(white)(".")7x^2 +color(white)("d")6x+12 #
# color(magenta)(+7)(x^2-5x+2)-> color(white)("dd..dddddd")ul( +color(white)("d")7x^2-35x+14 larr" Sub.")#
#color(magenta)("Remainder "-> color(white)("ddddddddddddddddd") 0 color(white)("d")+41x-2)#
#color(magenta)( -x^2+x+7+(41x-2)/(x^2-5x+2) )#