Escape special characters in to_latex() output