Fix the method create file and the method latexFile