pre encode for Tex