fix tilde, caret and backslash escaping
fix tilde, caret and backslash escaping

According to this comment: <http://stackoverflow.com/a/16264094/391865>

jendas1/PyLaTeX,bjodah/PyLaTeX,JelteF/PyLaTeX,ovaskevich/PyLaTeX,ovaskevich/PyLaTeX,sebastianhaas/PyLaTeX,votti/PyLaTeX,bjodah/PyLaTeX,sebastianhaas/PyLaTeX,jendas1/PyLaTeX,JelteF/PyLaTeX,votti/PyLaTeX