Automated recognition of handwritten mathematics