provideChatMath

Turns on LaTeX math in chat markdown: inline $…$ / \(…\) and display $$…$$ / \[…\]. Without it, math shows as its raw source.

The loader runs the first time a message contains math, so chats that never do download nothing. The KaTeX stylesheet is the application's to include (katex/dist/katex.min.css); math renders without it, unstyled.

import { provideChatMath } from '@threadplane/angular/chat/math';

Declaration · overload 1

export declare function provideChatMath(load: ChatMathLoader): EnvironmentProviders;

Parameters

load · required
ChatMathLoader

Returns

EnvironmentProviders

Examples

import { provideChatMath } from '@threadplane/angular/chat/math';

export const appConfig: ApplicationConfig = {
  providers: [provideChatMath(() => import('katex'))],
};