Check for footnotes in math mode

We can use this python script more generally for checking whether stuff
happens in math mode that shouldn't happen.