Document structure conversion clean up

Proper placement of newline characters in a TeX document is crucial for the
document structure.