UNPKG

@qtikit/mathml-to-latex

Version:

A JavaScript tool to convert mathml string to LaTeX string

19 lines (18 loc) 978 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MathMLToLaTeX = void 0; var mathml_element_to_latex_converter_adapter_1 = require("../data/usecases/mathml-to-latex-convertion/mathml-element-to-latex-converter-adapter"); var factories_1 = require("./factories"); var MathMLToLaTeX = /** @class */ (function () { function MathMLToLaTeX() { } MathMLToLaTeX.convert = function (mathml) { var mathmlElements = (0, factories_1.makeToMathElementsConverter)().convert(mathml); var mathmlElementsToLaTeXConverters = mathmlElements.map(function (mathMLElement) { return new mathml_element_to_latex_converter_adapter_1.MathMLElementToLatexConverterAdapter(mathMLElement).toLatexConverter(); }); return mathmlElementsToLaTeXConverters.map(function (toLatexConverters) { return toLatexConverters.convert(); }).join(''); }; return MathMLToLaTeX; }()); exports.MathMLToLaTeX = MathMLToLaTeX;