mathpix-markdown-it
Version:
Mathpix-markdown-it is an open source implementation of the mathpix-markdown spec written in Typescript. It relies on the following open source libraries: MathJax v3 (to render math with SVGs), markdown-it (for standard Markdown parsing)
126 lines (125 loc) • 3.61 kB
TypeScript
import { TAccessibility } from "../mathpix-markdown-model";
import { Label } from 'mathjax-full/js/input/tex/Tags.js';
export interface IOuterData {
mathml?: string;
mathml_word?: string;
asciimath?: string;
asciimath_tsv?: string;
asciimath_csv?: string;
asciimath_md?: string;
latex?: string;
svg?: string;
speech?: string;
labels?: {
[key: string]: Label;
};
height?: number;
heightAndDepth?: number;
width?: string;
widthEx?: number;
heightEx?: number;
}
export declare const OuterHTML: (data: any, outMath: any, forPptx?: boolean) => string;
export declare const MathJax: {
assistiveMml: boolean;
nonumbers: boolean;
checkAccessibility: (accessibility?: TAccessibility, nonumbers?: boolean) => void;
Stylesheet: () => unknown;
TexConvert: (string: any, options?: any, throwError?: boolean) => IOuterData;
TexConvertToAscii: (string: any, options?: any) => string;
/**
* Typeset a TeX expression and return the SVG tree for it
*
* @param string {string}
* @param options {}
*/
Typeset: (string: any, options?: any, throwError?: boolean) => {
html: string;
labels: {
[key: string]: Label;
};
ascii: string;
ascii_tsv: string;
ascii_csv: string;
ascii_md: string;
data: {
mathml?: string;
mathml_word?: string;
asciimath?: string;
asciimath_tsv?: string;
asciimath_csv?: string;
asciimath_md?: string;
latex?: string;
svg?: string;
speech?: string;
labels?: {
[key: string]: Label;
};
height?: number;
heightAndDepth?: number;
width?: string;
widthEx?: number;
heightEx?: number;
};
};
TypesetSvgAndAscii: (string: any, options?: any) => {
html: string;
ascii: string;
labels: {
[key: string]: Label;
};
ascii_tsv: string;
ascii_csv: string;
ascii_md: string;
data: {
mathml?: string;
mathml_word?: string;
asciimath?: string;
asciimath_tsv?: string;
asciimath_csv?: string;
asciimath_md?: string;
latex?: string;
svg?: string;
speech?: string;
labels?: {
[key: string]: Label;
};
height?: number;
heightAndDepth?: number;
width?: string;
widthEx?: number;
heightEx?: number;
};
};
/**
* Typeset a MathML expression and return the SVG tree for it
*
* @param string {string}
* @param options {}
*/
TypesetMathML: (string: any, options?: any) => {
html: string;
data: {
mathml?: string;
mathml_word?: string;
asciimath?: string;
asciimath_tsv?: string;
asciimath_csv?: string;
asciimath_md?: string;
latex?: string;
svg?: string;
speech?: string;
labels?: {
[key: string]: Label;
};
height?: number;
heightAndDepth?: number;
width?: string;
widthEx?: number;
heightEx?: number;
};
};
AsciiMathToSvg: (string: any, options?: any) => string;
Reset: (n?: number) => void;
GetLastEquationNumber: () => any;
};