Improve formatting for LaTeX output

Mostly, all the text is now wrapped in \text{ ... }, so that everything
isn't italicized and the spacing works like it should.