UNPKG

ng-katex-2

Version:

Angular module to write beautiful math expressions with TeX syntax boosted by KaTeX library

15 lines (11 loc) 437 B
import { ElementRef, Injectable } from '@angular/core'; import { render, renderToString, KatexOptions } from 'katex'; @Injectable() 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); } }