When we download scans of old printings about math and physics, we usually see terrible typesetting like this:

The look of it is terrible, the text is not recognized correctly (when I copy it, it says "2 :: Apj{3p = p=l 0"), and it seems to be wasting space to store the details of the letter.
is there an auto program to make this into
$$\sum_{p=1}^{m}A_{pj}\beta_{p}=0$$
and do the same to the entire book?
