improve latex code generation
improve latex generator script