improved TeX layout
bugfixes