I wonder what Mathematics is behind handwriting and symbol recognition.
I was using Detexify just now and it struck me that a distinction could be made between $\varsigma$ (a variant of the Greek letter sigma), $\zeta$ (the Greek letter zeta), and $\xi$ (the Greek letter xi).
I was thinking that it'd be some combination of Topology, Graph Theory, and Knot Theory.
How do such recognition things like Detexify work, mathematically speaking?
A detailed answer would be great.

Detexify's implementation is explained here: https://gist.github.com/kirel/149896 Briefly, it is a $k$-nearest neighbors classifier with hand-tuned features. Nothing fancy, no topology: