Update in template output, removed trailing \n if no TeX found