docx
    Preparing search index...

    Function latexToMath

    • Turns LaTeX math into docx's math, to go in a Math, as Word's own equations, which it shows and edits as it does those typed into it.

      It reads the math that LaTeX, MathJax and KaTeX write: fractions, scripts, roots, sums, integrals and other large operators, functions such as sin and lim, brackets that grow with \left and \right, accents, braces, boxes, fonts such as \mathbb and \mathrm, \text, Greek letters and symbols, and the environments for matrices, cases and aligned equations, with \tag for their numbers. The math can be given in $…$, $$…$$, \(…\) or \[…\], which are left out.

      Colours, sizes and spacing that Word works out for itself are left out.

      Parameters

      • latex: string

        The LaTeX, such as "\\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}"

      Returns readonly MathComponent[]

      The math, to be the children of a Math, or to go among other math components

      If the LaTeX has a command or an environment it doesn't know, or isn't well formed, such as a { with no }. The error says where

      new Math({ children: latexToMath("x = \\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}") });