Clean up the tex snippet