fixed text normalization bug; added proper TeX character escaping