Correctly convert elements with trailing whitespace to LaTeX

This would fix issue #65.