create function of texcompile