fixed the generation of tex files