replaced toLaTeX with an implementation using prettyRender