add spaces to TeX expressions