9 ms·
We had a laser printer in our computer lab that would, once in a while, shift the subscript in a mathematical formula several centimeters to the right. This was
by hanche 4y ago
We had a laser printer in our computer lab that would, once in a while, shift the subscript in a mathematical formula several centimeters to the right. This was in a LaTeX-produced document. In those days, the path to print was LaTeX to dvi, dvi to PostScript, then send the PS file to the printer. I got hold of a LaTeX file exhibiting the problem. Oddly, if I made any change to the document before the problem spot, no matter how insignificant, the problem would go away.
So I dove into the generated PS file, located the code setting the subscript, noting that it placed the subscript using the rmoveto operator. The ‘r’ is for relative: It would take a pair of coordinates off the stack, add those to the current position, and move the current point to the new location.
So I added some code to the PS file, first to collect some information along the way, and then print it out at the bottom of the page. I turned out that the rmoveto operator got it wrong! So what to do?
I replaced the rmoveto operator by a few lines of PostScript reading the current position, do the addition, and then execute a moveto operator instead. That cured the problem! The next step was to put that code into a small job exectuting the magic operator exitserver (reads the printer password off the stack), followed by my redefined rmoveto operator. The effect is now global and applies to all print jobs until the printer is power cycled. So that print job went into a cron job running every 15 minutes. Problem solved! That hack was left in place until the printer was retired, years later.