fixed creation of tex files