Escape inline verbatim spaces in LaTeX output

This implements the proposed fix and addresses the problems described in #1694. The test reference has also been updated. (I note that the latex writer had an unrelated test failure before these changes, which I have not addressed.)