ChatGPT Click Equation to Copy LaTeX

Klik equation ChatGPT untuk otomatis menyalin LaTeX

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

Um dieses Skript zu installieren, müssen Sie eine Erweiterung wie Tampermonkey oder Violentmonkey installieren.

Um dieses Skript zu installieren, müssen Sie eine Erweiterung wie Tampermonkey oder Violentmonkey installieren.

Um dieses Skript zu installieren, müssen Sie eine Erweiterung wie Tampermonkey oder Userscripts installieren.

Um dieses Skript zu installieren, müssen Sie eine Erweiterung wie Tampermonkey installieren.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

Um dieses Design zu installieren, müssen Sie eine Erweiterung wie Stylus installieren.

Um dieses Design zu installieren, müssen Sie eine Erweiterung wie Stylus installieren.

Um dieses Design zu installieren, müssen Sie eine Erweiterung wie Stylus installieren.

Um diesen Stil zu installieren, müssen Sie eine Erweiterung für den Benutzerstil Verwaltung installieren.

Um diesen Stil zu installieren, müssen Sie eine Erweiterung für den Benutzerstil Verwaltung installieren.

Um diesen Stil zu installieren, müssen Sie eine Erweiterung für den Benutzerstil Verwaltung installieren.

(Ich habe bereits einen Benutzerstil Verwaltung, ich möchte ihn installieren!)

Autor
afrzlfaiz
Installationen heute
0
Installationen gesamt
0
Bewertungen
0 0 0
Version
1.2.0
Erstellt am
01.09.2026
Letzte Aktualisierung
01.09.2026
Größe
3,84 KB
Lizenz
MIT
Wird angewandt auf

ChatGPT Copy Equation as LaTeX


This UserScript adds a dedicated copy button next to mathematical equations displayed in ChatGPT.
It is designed for users who frequently copy equations from ChatGPT into
Microsoft Word, Overleaf, LaTeX editors, Markdown documents, academic reports, or other applications that support LaTeX notation.

Features

  • Adds a copy button next to ChatGPT equations.
  • Supports equations rendered with KaTeX.
  • Copies the original LaTeX source instead of the visually rendered equation.
  • Automatically wraps copied equations with $...$.
  • Removes existing delimiters such as $...$, $$...$$, and \[...\].
  • Converts multiline LaTeX into a single line without breaking matrix row separators such as \\.
  • Improves simple fraction notation for better Microsoft Word compatibility.
  • Uses a large and clearly visible copy icon instead of the text label “LaTeX”.
  • Prevents button text from being copied when selecting the entire ChatGPT response.
  • Shows a checkmark after an equation has been successfully copied.
  • Automatically detects equations generated dynamically while ChatGPT is streaming a response.
  • Works with both ChatGPT light mode and dark mode.

Example


An equation such as:

\frac{x+1}{x-1}


will be copied as:

$\frac{x+1}{x-1}$


The script also converts compact fraction notation such as:

\frac12


into:

\frac{1}{2}


This format is generally safer when pasting equations into Microsoft Word.

How to Use

  1. Install a UserScript manager such as Tampermonkey, Violentmonkey, or Greasemonkey.
  2. Install this script from Greasy Fork.
  3. Open ChatGPT.
  4. Ask ChatGPT to generate a mathematical equation.
  5. A copy icon will automatically appear next to the equation.
  6. Click the icon to copy the LaTeX source to your clipboard.

Using the Copied Equation in Microsoft Word

  1. Open Microsoft Word.
  2. Create a new equation using Alt + =, or use Insert → Equation.
  3. Paste the copied LaTeX equation.
  4. If necessary, set the Word equation input format to LaTeX.


This workflow is especially useful for academic writing, reports, assignments, theses, and documents containing many mathematical expressions.

Supported Websites

https://chatgpt.com/*
https://chat.openai.com/*

How It Works


The script detects mathematical expressions using the following selectors:

[data-math-source], .katex


It attempts to retrieve the original LaTeX source from the
data-math-source attribute.
If that source is unavailable, it reads the KaTeX annotation:

<annotation encoding="application/x-tex">


A MutationObserver monitors newly generated page content, allowing the script to detect equations that appear while ChatGPT is generating a response.
No page refresh is required.

Copy Button Behavior


The copy control uses an SVG icon instead of visible text.
This avoids adding labels such as “LaTeX” to the selected text when a user highlights and copies an entire ChatGPT response.


The button is also configured with:

user-select: none;
-webkit-user-select: none;


This makes the button itself less likely to interfere with normal text selection.

Privacy


This script does not send data to external servers and does not use third-party APIs.

  • No conversation data is uploaded.
  • No external analytics are used.
  • No account information is collected.
  • No network requests are performed by the script.
  • The script only reads equation data already rendered on the current ChatGPT page.
  • Clipboard access is used only when the user clicks the copy button.


The only special UserScript permission used is:

@grant GM_setClipboard


This permission is required solely for copying the formatted LaTeX equation to the clipboard.

Compatibility Notes


ChatGPT's page structure may change over time.
If OpenAI changes the way mathematical equations are rendered, the script may require updates.


If you find an equation that is not detected correctly or a LaTeX expression that is copied incorrectly,
please report the issue through the Greasy Fork feedback section and include an example equation whenever possible.

Changelog

Version 1.1.0

  • Replaced the “LaTeX” text button with a copy icon.
  • Increased the button size for better visibility.
  • Prevented button labels from being included when copying selected ChatGPT text.
  • Added a temporary checkmark indicator after successful copying.
  • Improved button appearance for both light and dark themes.

Version 1.0.0

  • Initial release.
  • Added LaTeX copy buttons to ChatGPT equations.
  • Added dynamic equation detection using MutationObserver.
  • Added basic LaTeX formatting for improved Microsoft Word compatibility.