Universal Inline & Display LaTeX Renderer (KaTeX)

Render inline and display LaTeX math on any website using KaTeX. Careful with input fields! Be sure to have rendering OFF when entering an input field, otherwise you can mess up your delimiters. I have made a fix button for this, but it might not be exactly correct.

These are versions of this script where the code was updated. Show all versions.

  • v2025-07-13.5.2 2025-07-13

    Previous hacks didn't fully work (the \left{ problem), and also added a \right} fix now

  • v2025-07-13.5 2025-07-13

    Hacked some problems with the \ character already being formatted on some websites. This way, when someone unfamiliar with these formatting problems tries to write LaTeX it still recognizes it most of the time. I hope this does not cause more bugs than it solves... Seems to work fine for me so far.

  • v2025-07-13.4 2025-07-13

    Added the option to automatically render when the page loads. Also added a double render so the user wouldn't need to click the button twice anymore (this is not obtrusive, as the render is nearly instant).

  • v2025-07-13.3.2 2025-07-13

    Just added a comment about the MathML part that I deleted in the last version.

  • v2025-07-13.3 2025-07-13

    Added configurable background and border for the rendered LaTeX.

  • v2025-07-13.2 2025-07-13

    Moved user defined input to the top and added color to indicate a rendered piece of LaTeX.

  • v2025-07-13 2025-07-13

    Replaced any \mbox with \textnormal since KaTeX did not seem to support mbox

  • v2025-07-12 2025-07-12