Skip to content

How to convert Katex to latex or mathml? #3729

Answered by mbourne
arth17singh asked this question in Q&A
Discussion options

You must be logged in to vote

@arth17singh Any KaTeX output contains (1) MathML and (2) the original LaTeX, so you can get both.

Here's some typical KaTeX output:

   <span class="katex-mathml">
      <math>
         <semantics>
            <mrow>
             ...
            </mrow>
            <annotation encoding="application/x-tex">
              \displaystyle{b}_{n} = \frac{1}{L}{\int_{-{L}}^{L}} f{{\left({t}\right)}}\  \sin{{\left.\frac{{{n}\pi{t}}}{L}\right.}}{\left.{d}{t}\right.}
            </annotation>
         </semantics>
      </math>
   </span>
   <span class="katex-html" aria-hidden="true">
     ...
   </span>
  </span>

The MathML is contained in the span with class "katex-mathml" and the original LaTe…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@arth17singh
Comment options

@arth17singh
Comment options

@edemaine
Comment options

@arth17singh
Comment options

Answer selected by edemaine
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants