ChatMathEquation

Select rendered equations in ChatGPT, Gemini, Claude, and similar sites to copy LaTeX, Markdown math, or visible equation text.

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

You will need to install an extension such as Tampermonkey to install this script.

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
作者
zihang-huang
1日のインストール数
1
累計インストール数
2
評価
0 0 0
バージョン
0.1.0
作成日
2026/04/26
更新日
2026/04/26
大きさ
14.6KB
ライセンス
MIT
対象サイト

ChatMathEquation

ChatMathEquation is a Tampermonkey userscript that helps you copy equations from AI chat interfaces such as ChatGPT, Gemini, and Claude.

When you select a rendered equation with your mouse, the script shows a floating toolbar near the equation. From that toolbar, you can copy:

  • The original LaTeX source when it is available in the page DOM
  • Markdown math syntax such as $...$ or $$...$$
  • The visible rendered equation text

Features

  • Works on common AI chat sites with rendered math
  • Detects KaTeX, MathJax, MathML, and similar equation markup
  • Shows a floating copy toolbar above or below the selected equation
  • Uses multiple clipboard strategies for better browser compatibility

Supported Sites

The current script metadata includes these matches:

You can expand the @match entries later if you want the script to run on more sites.

Installation

  1. Install a userscript manager such as Tampermonkey.
  2. Open Tampermonkey and create a new script.
  3. Replace the default template with the contents of tampermonkey-equation-copy.user.js.
  4. Save the script.
  5. Open or refresh ChatGPT, Gemini, Claude, or another matched site.

Usage

  1. Open a page containing a rendered math equation.
  2. Use your mouse to select part of the rendered equation.
  3. A floating toolbar will appear near the equation.
  4. Click one of the buttons:
  • Copy LaTeX
  • Copy Markdown
  • Copy Equation

If the page exposes the original TeX source, Copy LaTeX and Copy Markdown will use that source. If not, those options may be unavailable.

How It Extracts Equations

The script tries these sources in order:

  1. Hidden MathML or annotation nodes that store TeX
  2. KaTeX or MathJax assistive markup
  3. Data attributes such as data-latex, data-tex, aria-label, or title
  4. Nearby code or markdown text as a fallback

Limitations

  • Some sites do not preserve the original LaTeX in the DOM after rendering.
  • In those cases, Copy LaTeX may not be available.
  • Copy Equation depends on the rendered text being extractable from the visible equation markup.
  • Site DOM changes may require selector updates in the future.