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.

目前為 2025-07-13 提交的版本,檢視 最新版本

作者
ParaMigi
評價
0 0 0
版本
2025-07-13.3
建立日期
2025-07-12
更新日期
2025-07-13
尺寸
13.8 KB
授權條款
MIT
腳本執行於
所有網站

This vibe coded script renders LaTeX math expressions on any website using KaTeX, with inline delimiters and display delimiters. It provides a toggle button to switch rendering on/off.

Disclaimer: sometimes you might have to toggle a couple times for all the LaTeX to render.

Disclaimer: multiline code is not (yet?) supported.


🔧 Features:

  • Renders both inline and display math expressions

  • Supports multiple delimiter styles: [;...;], \(...\), and $...$ for inline and \[...\] and $$...$$ for display. You can easily edit the script to add your own or change which delimiter is used for what.

  • Toggle button lets you enable/disable rendering whenever you want

  • Auto-hides buttons when holding CTRL for unobtrusive editing

  • Only displays the button when a valid delimiter is detected on the page

  • Leaves <input>, <textarea>, and editable fields untouched while rendering is ON

  • Minimal and fast — scans efficiently and only activates when LaTeX is detected


⚠️ Caution: Always turn LaTeX rendering OFF before typing into input fields or rich text editors. Rendering changes the DOM and could interfere with form content if left on while editing.

  • "Fix Input Field" button restores LaTeX expressions from rendered KaTeX, useful if rendering was accidentally left ON while editing and the content got messed up

⚙️ Installation:

  • Get the Tampermonkey extension (Chrome, FireFox)

  • Install this script in Tampermonkey

  • Edit the script to your preferences. Most of the things you'd want to change are in lines 18-48.

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址