How to use asciimath-to-latex - 2 common examples

To help you get started, we’ve selected a few asciimath-to-latex examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github qilin-editor / qilin-app / src / scripts / plugins / markdown / latex.js View on Github external
md.renderer.rules.code_inline = (tokens, idx, options, env, slf) => {
        let code = tokens[idx].content;

        if (code.startsWith("math")) {
            code = `katex ${asciimath2latex(code.substr(4, code.length - 2))}`;
        }

        // inline math
        if (code.startsWith("katex")) {
            code = code.substr(5, code.length - 2);

            try {
                return katex.renderToString(code);
            } catch (err) {
                return `<code>${err}</code>`;
            }
        }

        return temp1(tokens, idx, options, env, slf);
    };
github qilin-editor / qilin-app / src / scripts / plugins / markdown / latex.js View on Github external
            return mathBlock(code.split(/(?:\n\s*){2,}/).map(item => asciimath2latex(item)).join("\n\n"));
        }

asciimath-to-latex

AsciiMath to LaTeX converter

MIT
Latest version published 3 years ago

Package Health Score

45 / 100
Full package analysis

Popular asciimath-to-latex functions