ng-katex-2
Version:
Angular module to write beautiful math expressions with TeX syntax boosted by KaTeX library
15 lines (11 loc) • 437 B
text/typescript
import { ElementRef, Injectable } from '@angular/core';
import { render, renderToString, KatexOptions } from 'katex';
()
export class KatexService {
render(equation: string, element: ElementRef, options?: KatexOptions) {
return render(equation, element.nativeElement, options);
}
renderToString(equation: string, options?: KatexOptions): string {
return renderToString(equation, options);
}
}