obsidian#renderMath TypeScript Examples

The following examples show how to use obsidian#renderMath. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LaTeXSuggester.ts    From quickadd with MIT License 6 votes vote down vote up
constructor(public inputEl: HTMLInputElement | HTMLTextAreaElement) {
        super(QuickAdd.instance.app, inputEl);
        this.symbols = Object.assign([], LaTeXSymbols);

        this.elementsRendered = this.symbols.reduce((elements, symbol) => {
            try {
                elements[symbol.toString()] = renderMath(symbol, true);
            } catch {} // Ignoring symbols that we can't use

            return elements;
        }, {});
    }
Example #2
Source File: MathModal.ts    From quickadd with MIT License 5 votes vote down vote up
private async mathjaxLoop(container: HTMLDivElement, value: string) {
        const html = renderMath(value, true);
        await finishRenderMath()

        container.empty();
        container.append(html);
    }