I using KaTeX to render HTML formula display. How can I convert HTML to LaTeX or KaTeX again?

  • 3
    Welcome! What's KaTeX?
    – cfr
    Dec 18, 2015 at 3:51
  • I use this to render html display github.com/Khan/KaTeX
    – vxba
    Dec 18, 2015 at 3:53
  • 3
    don't you still have the tex-like input that you passed to katex? you can't really do a reverse translation from the html/css that the javascript produces. Dec 18, 2015 at 9:07
  • So do you know what solution in this demo of wiris :wiris.com/editor/demo/en/mathml-latex
    – vxba
    Dec 18, 2015 at 9:09
  • 1
    in what way is that related to your question? it isn't converting from html (its internal form is structured mathml0)and it doesn't use katex unless it's changed recently. Dec 18, 2015 at 9:58

1 Answer 1


How can I convert HTML to LaTeX?

You can use Pandoc. It does a good job if your HTML is clean, i.e. doesn't have many div's and span's.

About KaTeX, you first need to understand that KaTeX is only a Javascript library to convert the math subset of LaTeX to something that will be render at web browsers. If you have the original source code of your HTML page that has the LaTeX code instead of the KaTeX output I believe that Pandoc will solve your problem (and if not please report the issue at http://github.com/jgm/pandoc/). If you only have the KaTeX output Pandoc will not solve your problem.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .