fixed some annoying latex syntax bugs (like forgotten $)

or else it all would not compile