UNPKG

az-mathml-to-latex

Version:

A JavaScript tool to convert mathml string to LaTeX string

20 lines (19 loc) 862 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Math = void 0; var mathml_element_to_latex_converter_1 = require("../../../helpers/mathml-element-to-latex-converter"); var normalize_whitespace_1 = require("../../../helpers/normalize-whitespace"); var Math = /** @class */ (function () { function Math(mathElement) { this._mathmlElement = mathElement; } Math.prototype.convert = function () { var unnormalizedLatex = this._mathmlElement.children .map(function (child) { return mathml_element_to_latex_converter_1.mathMLElementToLaTeXConverter(child); }) .map(function (converter) { return converter.convert(); }) .join(' ').trim(); return normalize_whitespace_1.normalizeWhiteSpaces(unnormalizedLatex); }; return Math; }()); exports.Math = Math;