question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to run renderMathInElement without the CDN?

See original GitHub issue

I’m building an electron app so I don’t want to use the CDN. Is there any way around this?

Secondly, how do I render a math block with multiple lines of code? the documentation only gives an example of rendering one like of code.

I tried rendering this,

\begin{vmatrix}
   a & b \\
   c & d
\end{vmatrix}

but the following does’t work.

        katex.render("\begin{vmatrix} a & b \\ c & d\end{vmatrix}", theorem, {
            throwOnError: false,
            displayMode: true
    });

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

6reactions
kevinbarabashcommented, Apr 22, 2019

If you’re using a build system like webpack or parcel you should be able to do

import katex from "katex";
import "katex/dist/katex.min.css";
import renderMathInElement from "katex/dist/contrib/auto-render.js";

in one of your source files. With webpack you’ll need to set up css-loader for this to work properly. While I’ve done this for just KaTeX, I haven’t tried this for auto-render yet.

1reaction
ylemkimoncommented, May 24, 2019

Documentation issues are followed in #1944.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Auto-render Extension - KaTeX
This is an extension to automatically render all of the math inside of text. It searches all of the text nodes within a...
Read more >
KaTeX does not render - Stack Overflow
KaTeX requires the use of the HTML5 doctype. Without it, KaTeX may not render properly --> <html> <head> <meta charset="UTF-8"> <link ...
Read more >
MathLive - CortexJS
To render a specific element, use renderMathInElement (). import { renderMathInDocument } from 'https://unpkg.com/mathlive?module'; document.
Read more >
katex - npm
KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web. Fast: KaTeX renders its math synchronously and doesn't ...
Read more >
katex - UNPKG
The CDN for katex. ... 19, Then, call the exposed `renderMathInElement` function in a script tag ... 38, you can use the following...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found