Added method to escape special LaTeX characters.
Used sanitizeLaTeX when converting test to string.