Copy an Equation Out of an AI Chat and the Backslashes Vanish: Which Math Delimiters Render Where
Chat answers often carry math as \(…\) and \[…\]. Paste one into a Markdown note and the parser reads \( as an escaped parenthesis, deletes the backslash, and leaves ( x^2 ) before any math engine runs. The fix is to convert to $…$ and $$…$$ on paste — before the note is saved, while the backslashes still exist.
The bug is quiet enough to hide inside its own bug report. In October 2023 an Obsidian forum user asked how to bring chat answers into their notes — the math arrived wrapped in backslash-parentheses. The raw source of that post and the page the forum rendered from it disagree on exactly one character:1
Raw source: The problem now is that chatGPT starts latex-code with '\(' and ends it with '\)'.
Rendered: The problem now is that chatGPT starts latex-code with ‘(’ and ends it with ‘)’.
The forum's own Markdown ate the backslashes in a question about backslashes disappearing. The user did nothing wrong.
The repair has since been built many times over. Twelve Obsidian community plugins exist mainly to repair or render \(…\) and \[…\] math, with 18,062 combined downloads as of 7 November 2026 — the two largest, Fix Math (9,381) and Math Indicator Changer (4,101), both convert to dollar signs.2 Four Stack Overflow questions on math in Markdown have drawn 802,176 views between them.3
None of this is news to the people who build math renderers. MathJax's own documentation explains the mechanism to site builders, workaround included.4 What it does not show is the note-taker's side — what a pasted answer turns into, app by app. That is the table below, with receipts.
Why does the backslash disappear when I paste math into Markdown?
In CommonMark-family Markdown, a backslash before any ASCII punctuation is an escape. \( means "a literal parenthesis," so the parser outputs ( and throws the backslash away. A page-level math engine runs later — on the finished HTML — and finds no delimiter left to recognise. The equation was lost one step before rendering began.
The rule is CommonMark §2.4.5 Our guide to the everyday text Markdown turns into formatting, and the backslash that stops it covers it as a fix.6 Here the same rule is the damage.
Order is the whole story. MathJax's documentation, in its section on content-management systems, warns that "Since Markdown is applied to the page first, it may convert your subscript markers into italics," and that a system using the backslash as its own escape "will remove the backslashes as part of its processing."4
The engine was built to read a finished page. As Davide P. Cervone described it in the Notices of the AMS in 2012, "MathJax will look through the page for math delimiters like \(…\) and $$…$$ to identify the mathematics to be typeset."7 By the time it looks, \( is already (.
Three independent Markdown parsers, with no math plugin loaded, agree on the output:8
Input: A \( x^2 + y^2 = z^2 \) B
Output: <p>A ( x^2 + y^2 = z^2 ) B</p>
Input: \[ E = mc^2 \]
Output: <p>[ E = mc^2 ]</p>
Tested: markdown-it 15.0.3 · commonmark.js 0.31.2 · marked 18.1.3
The loss is surgical. A backslash before a letter is not an escape, so \pi survives and \( \pi r^2 \) becomes ( \pi r^2 ) — the commands intact, the delimiters gone.9 That is why the damage looks like a typo rather than a failure — almost everything is still there.
Why do chat answers use \(…\) instead of dollar signs?
Because \(…\) is the form LaTeX itself prefers and the only inline default MathJax ships with. Markdown apps settled on $…$ instead. A chat interface that renders math in the browser and a note app that parses Markdown first follow two different, equally documented conventions — and the two meet on your clipboard.
The LaTeX2e reference manual lists three ways to set inline math — \( … \), $ … $, and \begin{math} — and ranks them plainly: "The first form is preferred and the second is quite common, but the third form is rarely used."10
MathJax and KaTeX agree. MathJax's default in-line delimiter list holds exactly one pair, inlineMath: [['\\(','\\)']], while its display list holds two, $$ and \[.11 KaTeX's auto-render extension ships a default list of eight delimiters — $$, \(, five \begin{…} environments, and \[ — and none of them is a single $.12
MathJax's documentation gives the reason single $ is off: "Note that the single dollar signs are not enabled by default because they are used too frequently in normal text, so if you want to use them for math delimiters, you must specify them explicitly."11
In everyday writing, a dollar sign usually means money.
KaTeX's default leaves single $ off as well, and its docs add an ordering trap for anyone who turns it on: "If you want to add support for inline math via $...$, be sure to list it after $$," because "putting a $ rule first would catch $$ as an empty math expression."12
What each chat app places on the clipboard was not tested for this piece. Plugin authors report the pattern. The Fix Math README says that math copied from AI assistants "often comes in LaTeX format using \(…\) for inline math and \[…\] for display math," and recommends the response's own copy button because "This ensures math expressions are copied with their LaTeX delimiters \( ... \) and \[ ... \]."13
Which math delimiters render where?
$$…$$ is the only delimiter that renders in every default math setup in this table, and $…$ works in every Markdown setup's default math mode. \(…\) and \[…\] render only where an engine reads the page directly or a non-default parser option is on. The table draws on first-party docs and our own runs on 7 November 2026.
| Setup | $…$ | $$…$$ | \(…\) | \[…\] |
|---|---|---|---|---|
GitHub (gfm, POST /markdown) | math | math | ( … ) | [ … ] |
| CommonMark parsers, no math plugin | literal | literal | ( … ) | [ … ] |
| Same, + math plugin (texmath default, remark-math) | math | math | ( … ) | [ … ] |
markdown-it-texmath, brackets option | literal | literal | math | math |
pandoc 3.13, markdown (default) | math | math | ( … ) | [ … ] |
pandoc, markdown+tex_math_single_backslash | math | math | math | math |
| MathJax, default config, reading HTML | off | on | on | on |
| KaTeX auto-render, default list, reading HTML | off | on | on | on |
| Obsidian (per its docs) | math | math | not documented | not documented |
Rows 1–6 are Markdown parsers: the cell is what reaches the page. Rows 7–8 are engines: the cell says whether the delimiter is recognised if it reaches the HTML intact. Row 9 is from documentation, not a test. Sources: own receipts,81415 MathJax,11 KaTeX,12 Obsidian Help.16
Read the last three rows together.
The engines' defaults favour the backslash form. The Markdown apps' convention is the dollar sign. The engines assume they are reading HTML — inside a Markdown app the parser runs first, and by then the backslash is gone.
GitHub adds a third inline form for exactly this collision. Its documentation says: "There are two options for delimiting a math expression inline with your text. You can either surround the expression with dollar symbols ($), or start the expression with $` and end it with `$. The latter syntax is useful when the expression you are writing contains characters that overlap with markdown syntax."17
The backtick form $`…`$ arrived on 8 May 2023, announced as "especially useful if the mathematical expressions you're writing contain characters that overlap with Markdown syntax."18 GitHub's documentation also offers a math code fence for display math.17
Obsidian documents dollar signs only. Its help page says "You can add math expressions to your notes using MathJax and the LaTeX notation," then: "To add a MathJax expression to your note, surround it with double dollar signs ($$)," and "You can also inline math expressions by wrapping it in $ symbols."16 We did not test Obsidian's reading or live-preview view with \( first-hand — the twelve repair plugins suggest the answer.
For typing equations by hand in the first place, Write the Equation, Not a Screenshot of It covers the $ syntax and its one spacing rule.19
Will turning on a math plugin fix \(…\)?
No. A math plugin teaches a Markdown parser to recognise dollar signs; it does not restore a backslash the parser already consumed. In our runs, markdown-it-texmath and remark-math rendered $…$ and $$…$$ and still printed ( x^2 + y^2 = z^2 ). The one option that reads \( stops reading dollar signs.
That option is markdown-it-texmath's delimiters: 'brackets' mode. It renders \(…\) and \[…\] as math — and in that mode $…$ and $$…$$ come out as literal text.8 You trade one convention for the other. You do not get both.
Pandoc is the most configurable case — and the most instructive. Across six pandoc 3.13 readers, five dropped the backslash: markdown, gfm, commonmark, commonmark_x, and markdown_mmd.14 Only markdown+tex_math_single_backslash rendered \(…\) and \[…\] as math. Pandoc's own extension list shows why: markdown, markdown_mmd and markdown_strict all ship with -tex_math_single_backslash, while gfm, commonmark and commonmark_x do not list it at all.14
The manual is candid about the cost. The extension "Causes anything between \( and \) to be interpreted as inline TeX math, and anything between \[ and \] to be interpreted as display TeX math. Note: a drawback of this extension is that it precludes escaping ( and [."20
Two readers do worse than leave literal text. Once the backslash is gone, the caret is free to mean superscript:14
commonmark_x \( x^2 + y^2 = z^2 \) → ( x<sup>2 + y</sup>2 = z^2 )
markdown_mmd \( x^2 + y^2 = z^2 \) → ( x<sup>2</sup> + y<sup>2</sup> = z<sup>2</sup> )
markdown_mmd \[ E = mc^2 \] → [ E = mc<sup>2</sup> ]
The first line is the cruel one: it looks like math and says something else. The other two look almost right — which hides that they are no longer math at all.
Fix it before you save — the loss can become permanent
Convert while the backslashes are still in the file. A renderer only hides them on screen; a Markdown serializer deletes them from the source. Re-saving A \( x^2 \) B through pandoc's own Markdown writer produced A ( x\^2 ) B — the escape before the parenthesis gone for good, and a new one added before the caret.14
The serializer is doing its job. It read \( as a literal parenthesis, so it wrote a literal parenthesis back; it read ^ as a possible superscript marker, so it escaped it. Each step is correct — and the equation is still destroyed.
Any tool that parses a note and writes it back out can make the same round trip. Editors that show formatted text while you type usually parse the Markdown first, as do export pipelines and converters between note formats. Check the raw source after the first save, not the rendered view.
Short version: convert on paste, not on reading.
How do I convert a pasted answer to dollar signs?
Replace \(…\) with $…$ and \[…\] with $$…$$, trim the spaces just inside each delimiter, and check two places a blind replace gets wrong: code blocks and real escaped parentheses in prose. Do it in raw text, before any editor parses the note. The example below is tested.
Here is a short pasted answer, saved as pasted.md. It includes two traps on purpose — a deliberately escaped parenthesis in prose, and a code block:
The area is \( \pi r^2 \), and the identity
\[
E = mc^2
\]
holds. A literal \(not math\) aside.
```
keep \( this \) in code
```
The one-line conversion, in Perl. The -0 flag reads the whole file at once, so display math can span lines:
perl -0pe 's/\\\[\s*(.+?)\s*\\\]/\$\$\n$1\n\$\$/gs; s/\\\(\s*(.+?)\s*\\\)/\$$1\$/g' pasted.md > note.md
The resulting note.md:
The area is $\pi r^2$, and the identity
$$
E = mc^2
$$
holds. A literal $not math$ aside.
```
keep $this$ in code
```
We rendered both files through GitHub's Markdown API.9 Before conversion: ( \pi r^2 ), then a bare [, E = mc^2 and ] on three lines. After: both equations rendered as math. So did the escaped aside, and the code block's source was rewritten — which is why the last step below exists.
What each part of the recipe catches:
- The
\s*trims.\( x^2 \)becomes$x^2$, not$ x^2 $. Pandoc's manual requires a non-space character right after the opening$,20 and the plain-text math guide shows the same spacing rule tripping up hand-typed equations. An untrimmed conversion fails silently. - The
-0flag. Display math often sits on its own lines, as in the sample. Without reading the whole file, a multi-line\[is never matched. - Lazy matching.
.+?stops at the first closing delimiter, so\( a \)and\( b \)on one line become$a$and$b$, not one long equation. The inline rule does not cross line breaks: an inline equation split over two lines is left for you to fix by hand. - The review step.
\(not math\)was a deliberate escape in prose, and the code block was meant to stay literal. A regex cannot read intent. Read the diff before saving.
The Math Indicator Changer plugin carries the same warning in its README: "Since the plugin is based on regular expressions, it may cause some unexpected results. It will change all \(, \), \[, \] to $, $, $$, $$ in the file."21 That honesty is the right model — a converter that admits it is a regex is safer than one that pretends not to be.
In Obsidian, several of the registry plugins do the same job at paste time; outside it, the one-liner above works on any plain-text Markdown file. For the full $, $$ and math-fence syntax, the Markdown cheat sheet has the reference.22
When is converting the wrong fix?
When you control the renderer, when the source must stay untouched, or when the text is a LaTeX document rather than a note. Each has a cleaner answer than a rewrite. Converting is the right default for notes that travel between apps — not a universal rule, and the trade-offs below are real.
You publish through pandoc and set the flags yourself. Turn on tex_math_single_backslash and keep the chat's delimiters as they are. Accept the manual's stated cost: you can no longer escape ( or [ in that document.20
You build the site. markdown-it-texmath's brackets mode reads \(…\) directly — at the cost of every dollar-sign equation already in your corpus.8
The note source must not change. Some Obsidian plugins render at display time instead of rewriting. LaTeX Delimiter Renderer's registry entry reads "Render \(…\) and \[…\] math without changing note source."2 The catch is portability: the file still says \(, and the next Markdown app that opens it without such a plugin will show ( … ).
The text is LaTeX, not Markdown. If the equation is headed for a .tex file, leave \( alone — LaTeX prefers it.10
Doubling the backslash. MathJax's documentation offers this for systems that escape: "Since the defaults are \(...\) and \[...\], if your system uses \ as an escape of its own, you may need to use \\(...\\) and \\[...\\] instead in order to get \(...\) and \[...\] into the page where MathJax can process it."4
It works only where a page-level engine scans the HTML for \(. GitHub is not one: \\( x^2 \\) came back as literal \( x^2 \) with no math renderer attached.15 We did not test doubling in Obsidian. Either way, it leaves a source no one wants to read.
Frequently Asked Questions
Pasting ChatGPT Latex output into Obsidian (auto-render as Latex)
Obsidian documents only $…$ and $$…$$ for math. Pasted answers that use \(…\) and \[…\] lose their backslashes to Markdown's escape rule before the math engine sees them. Convert the delimiters to dollar signs in raw text before saving, or use one of the registry plugins built to convert or render them at paste time.
Is there any plugin or setting that will allow me to use \( ... \) and \[ ... \] as LaTeX delimiters, in addition to the existing $ ... $ and $$ ... $$?
Not as a built-in Obsidian setting in its documentation. Twelve community plugins in the registry target exactly this, some converting the text and some rendering at display time without changing the source. Outside Obsidian, pandoc's tex_math_single_backslash extension reads both styles, at the cost of no longer being able to escape ( or [.
is there a way to automatically replace the symbol "backslash" with "$$"?
Yes — a regular-expression replace: \[…\] to $$…$$ and \(…\) to $…$, trimming the inner spaces. The one-liner in this post does it in Perl. Run it on raw text, then review the diff: a blind replace also rewrites code blocks and parentheses that were escaped deliberately in prose.
How to show math equations in general github's markdown(not github's blog)
Use $…$ for inline math and $$…$$ or a math code fence for display math. When an expression contains characters Markdown would interpret, use the inline form $`…`$, added on 8 May 2023. GitHub does not render \(…\): its Markdown parser turns it into plain parentheses first.
Latex rendering in README.md on Github
A README is a Markdown file, so GitHub's math rules apply: $…$, $`…`$, $$…$$, and math code fences render; \(…\) and \[…\] do not. Doubling the backslash prints \( … \) as literal text with no math renderer attached, so convert pasted equations to dollar signs before committing.
How can I mix LaTeX in with Markdown?
Write LaTeX math inside the delimiters your Markdown processor recognises — almost always $…$ and $$…$$. The Markdown parser runs before any math engine, so backslash-parenthesis delimiters lose their backslash first. In pandoc, the tex_math_single_backslash extension adds \(…\); for whole LaTeX documents, keep LaTeX's own preferred \(…\) and write a .tex file.
In a Markdown note the parser always reads first. Hand it math in a delimiter it will leave alone.
MNMNOTE keeps your notes as open Markdown on your own device — plain text you can carry to any renderer in the table above. mnmnote.com
Footnotes
-
Obsidian Forum, topic 69557, post #1 by Cytox_99, 2023-10-17. Raw source: https://forum.obsidian.md/raw/69557/1 · rendered page: https://forum.obsidian.md/t/69557, both accessed 2026-11-07. ↩
-
obsidianmd/obsidian-releases,
community-plugins.jsonandcommunity-plugin-stats.json(stats file commit 2026-11-07T00:13:21Z), own count of 12 delimiter-repair/render plugins; 10,044 plugins listed in total. https://github.com/obsidianmd/obsidian-releases, accessed 2026-11-07. ↩ ↩2 -
Stack Exchange API 2.3, questions 11256433 (404,989 views), 2188884 (228,824), 35498525 (147,008), 35259660 (21,355), site=stackoverflow. https://api.stackexchange.com/2.3/questions/11256433;2188884;35498525;35259660?site=stackoverflow, accessed 2026-11-07. ↩
-
MathJax Consortium, "TeX and LaTeX in HTML documents," MathJax documentation v4.0, §Interactions with Content-Management Systems. https://docs.mathjax.org/en/latest/input/tex/html.html, accessed 2026-11-07. ↩ ↩2 ↩3
-
CommonMark Spec 0.31.2, §2.4 Backslash escapes. https://spec.commonmark.org/0.31.2/#backslash-escapes, accessed 2026-11-07. ↩
-
On CommonMark backslash escapes as a fix for text Markdown would otherwise format: "Markdown Ate the Underscores in
__init__: The Everyday Text That Turns Into Formatting, and the Backslash That Stops It", MNMNOTE Blog. ↩ -
Davide P. Cervone, "MathJax: A Platform for Mathematics on the Web," Notices of the American Mathematical Society 59(2), February 2012, pp. 312–316, p. 314. doi:10.1090/noti794. https://doi.org/10.1090/noti794, accessed 2026-11-07. Wayback: https://web.archive.org/web/20250125170446/http://www.ams.org/notices/201202/rtx120200312p.pdf ↩
-
Own receipt, 2026-11-07: markdown-it 15.0.3, commonmark.js 0.31.2 and marked 18.1.3 with no math plugin; markdown-it-texmath 1.0.0 (default and
bracketsdelimiters) and remark-math 6.0.0. InputsA \( x^2 + y^2 = z^2 \) B,\[ E = mc^2 \],$…$,$$…$$. ↩ ↩2 ↩3 ↩4 -
Own receipt, 2026-11-07: a pasted sample converted with the Perl one-liner shown in the post, both versions rendered through GitHub's
POST /markdown(gfm mode). Before:( \pi r^2 ), bare[/]. After:<math-renderer>on both equations, on$not math$, and the fenced code block rewritten to$this$. ↩ ↩2 -
Karl Berry et al., LaTeX2e: An unofficial reference manual, §16 Math formulas. https://latexref.xyz/Math-formulas.html, accessed 2026-11-07. ↩ ↩2
-
MathJax Consortium, "TeX Input Processor Options," MathJax documentation v4.0,
inlineMath/displayMath. https://docs.mathjax.org/en/latest/options/input/tex.html, accessed 2026-11-07. ↩ ↩2 ↩3 -
KaTeX, "Auto-render Extension,"
delimitersoption (KaTeX 0.19.1). https://katex.org/docs/autorender, accessed 2026-11-07. ↩ ↩2 ↩3 -
Vladislav Sorokin (loglux), Fix Math for Obsidian, README, §Why This Plugin? and §Copying with math delimiters preserved. https://github.com/loglux/fix-math-for-obsidian, accessed 2026-11-07. ↩
-
Own receipt, 2026-11-07: pandoc 3.13, readers
markdown,gfm,commonmark,commonmark_x,markdown_mmd,markdown+tex_math_single_backslash;--list-extensions;-f markdown -t markdownround trip. ↩ ↩2 ↩3 ↩4 ↩5 -
Own receipt, 2026-11-07: GitHub REST API
POST /markdown, modegfm.\( x^2 + y^2 = z^2 \)→( x^2 + y^2 = z^2 ), no<math-renderer>;$x^2 + y^2 = z^2$wrapped in<math-renderer class="js-inline-math">;\\( x^2 \\)→ literal\( x^2 \), no<math-renderer>. https://api.github.com/markdown, accessed 2026-11-07. ↩ ↩2 -
Obsidian Help, "Advanced formatting syntax," §Math. https://help.obsidian.md/Editing+and+formatting/Advanced+formatting+syntax, accessed 2026-11-07. ↩ ↩2
-
GitHub Docs, "Writing mathematical expressions," §Writing inline expressions. https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/writing-mathematical-expressions, accessed 2026-11-07. ↩ ↩2
-
GitHub Changelog, "New delimiter syntax for inline mathematical expressions," 2023-05-08. https://github.blog/changelog/2023-05-08-new-delimiter-syntax-for-inline-mathematical-expressions/, accessed 2026-11-07. ↩
-
On typing equations as text with
$and$$, and the spacing rule: "Write the Equation, Not a Screenshot of It", MNMNOTE Blog. ↩ -
John MacFarlane, Pandoc User's Guide, §Extension:
tex_math_single_backslash. https://pandoc.org/MANUAL.html, accessed 2026-11-07. ↩ ↩2 ↩3 -
ori-replication, Math Indicator Changer, README, §Warnings. https://github.com/ori-replication/obsidian-math-indicator-changer, accessed 2026-11-07. ↩
-
On
$,$$andmath-fence syntax: "The Complete Markdown Cheat Sheet (2026)", MNMNOTE Blog. ↩