Fix LaTeX "no line here to end" problem with newlines within text commands

@maethu this fixes issues when having newlines within text commands, such as "bold" (`\textbf`).