add ids to math elements