Fix a bug in the 'thm' tex snippet