Create trainfunction.tex