UNPKG

ng-katex-2

Version:

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

20 lines (18 loc) 1.52 kB
import { Component } from '@angular/core'; import { KatexOptions } from 'katex'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'], standalone: false, }) export class AppComponent { title: string = 'ng-katex'; url: string = 'https://github.com/garciparedes/ng-katex'; equation: string = 'c = \\pm\\sqrt{a^2 + b^2}'; options: KatexOptions = { displayMode: true, }; paragraph: string = "You can write text, that contains expressions like this: $x ^ 2 + 5$ inside them. As you probably know. You also can write expressions in display mode as follows: $$\\sum_{i=1}^n(x_i^2 - \\overline{x}^2)$$. In first case you will need to use \\$expression\\$ and in the second one \\$\\$expression\\$\\$. To scape the \\$ symbol it's mandatory to write as follows: \\\\$"; html: string = `<div>You can write html, that contains expressions like this: $x ^ 2 + 5$ inside them. As you probably know. You also can write expressions in display mode as follows: $$\\sum_{i=1}^n(x_i^2 - \\overline{x}^2)$$. In first case you will need to use \\$expression\\$ and in the second one \\$\\$expression\\$\\$. To scape the \\$ symbol it's mandatory to write as follows: \\\\$</div><p><button>I'm a button</button></p><strong>I'm strong</strong><div style="border: black 1px solid"><div style="display: inline-block; width:48%;">inner div left</div> | <div style="display:inline-block; color: blue; width:48%;">inner div right</div></div>`; }