How to migrate between math delimiter conventions
- Step 1Confirm the destination renderer's convention — Look at the target platform's math config. KaTeX/remark-math →
$/$$. MathJax with TeX delimiters →\(/\[. This determines the Target style, not the source platform. - Step 2Export and open one source file — Export a
.md/.mdxfrom the old system, then paste it or drop it into the tool. Start with one representative file before batch-migrating. - Step 3Set Target style to the destination convention — Choose
$ inline / $$ block (KaTeX)to migrate INTO KaTeX, or\( \) inline / \[ \] block (MathJax)to migrate into a TeX-delimiter setup. - Step 4Convert and review the output — Run the pass and diff the result against the source. Verify inline and display equations both flipped to the destination form.
- Step 5Watch the tex direction for stray dollars — When targeting
tex, scan prose for currency or$VARshell examples — consecutive literal dollars can be mis-paired. Convert those files individually or escape the dollars first. - Step 6Repeat or batch with Pro — Process remaining files one at a time on Free, or upgrade to Pro to queue up to 10 files per run for a faster migration.
Migration direction matrix
Pick the Target style that matches the destination platform. The 'from' column is just what the source happens to use.
| Migrating into | Set Target style to | Inline becomes | Display becomes |
|---|---|---|---|
| KaTeX / remark-math / GitHub math | dollar | \(x\) → $x$ | \[x\] → $$x$$ |
| MathJax (TeX delimiters) | tex | $x$ → \(x\) | $$x$$ → \[x\] |
Already $-style content | dollar | unchanged (no double-up) | unchanged |
Already \(-style content | tex | unchanged (no double-up) | unchanged |
Conversion behavior details
Specifics that matter when scripting a migration around this tool.
| Aspect | Behavior |
|---|---|
| Direction per run | One only — converts the non-target family toward the target |
Display \[...\] → dollar | Becomes $$...$$ with a blank line before and after |
Display $$...$$ → tex | Becomes \[...\] (no extra blank lines added) |
| Greediness | Non-greedy — each $$...$$ / \[...\] pair matched independently |
Fenced code (``` ```) | Skipped — delimiters inside preserved |
Inline code / ~~~ fences | NOT skipped — delimiters inside are converted |
| Idempotency | Re-running with same target makes no further change |
Tier limits for batch migrations
How many files and how large per run, by plan. charLimit is enforced independently of file size.
| Tier | Max file size | Max characters | Files per run |
|---|---|---|---|
| Free | 1 MB | 500,000 | 1 |
| Pro | 10 MB | 5,000,000 | 10 |
| Pro-media | 50 MB | 20,000,000 | 50 |
| Developer | 500 MB | Unlimited | Unlimited |
Cookbook
Real migration fragments. The Target style is always the DESTINATION platform's convention, regardless of what the source used.
MathJax wiki → KaTeX docs site
Old wiki used \(/\[. The new Docusaurus site uses KaTeX. Target dollar migrates every equation to the destination convention.
SOURCE (MathJax wiki export):
The gradient \( \nabla f \) points uphill, and
\[ \nabla f = \left( \frac{\partial f}{\partial x}, \frac{\partial f}{\partial y} \right) \]
TARGET: dollar
DESTINATION (KaTeX-ready):
The gradient $ \nabla f $ points uphill, and
$$ \nabla f = \left( \frac{\partial f}{\partial x}, \frac{\partial f}{\partial y} \right) $$KaTeX content → TeX-delimiter MathJax
Reverse migration. Source uses $/$$; the destination MathJax is configured for \(/\[. Target tex flips both.
SOURCE (KaTeX):
Bayes: $P(A\mid B) = \frac{P(B\mid A)P(A)}{P(B)}$ and
$$ P(B) = \sum_i P(B\mid A_i)P(A_i) $$
TARGET: tex
DESTINATION:
Bayes: \(P(A\mid B) = \frac{P(B\mid A)P(A)}{P(B)}\) and
\[ P(B) = \sum_i P(B\mid A_i)P(A_i) \]Partial migration leaves new-style math alone
A file someone already half-converted to $. Running target dollar only touches the remaining \(/\[, no doubling.
SOURCE (partly migrated): Already-new $y = mx + b$ plus old \( z = ax^2 \). TARGET: dollar DESTINATION: Already-new $y = mx + b$ plus old $ z = ax^2 $.
Migration guide quoting syntax stays intact
The migration runbook itself documents the old/new delimiters inside fenced blocks. Those are skipped; only live prose math converts.
SOURCE: Replace old style with new, e.g. convert: ```text \( a + b \) -> $a + b$ ``` Note inline math like \( c \) in body text also moves. TARGET: dollar DESTINATION: Replace old style with new, e.g. convert: ```text \( a + b \) -> $a + b$ ``` Note inline math like $ c $ in body text also moves.
Tex direction with a stray currency dollar
A migration into a TeX-delimiter platform where one paragraph mentions a price. The pass mis-pairs the dollars — convert that file with dollar instead, or escape currency before running.
SOURCE: The model $W$ costs about $50 to train. TARGET: tex RESULT (mis-paired — review needed): The model \(W\) costs about \)50 to train. FIX: migrate this file targeting dollar, or replace '$50' before converting.
Edge cases and what actually happens
Choosing target by source instead of destination
Wrong directionThe Target style must match the destination platform, not the source. Migrating a \(-style wiki INTO KaTeX means target dollar. Picking tex would leave it unchanged (since \( is already TeX) and the migration would do nothing.
Currency / `$VAR` mis-pairing on tex target
Invalid pairingTarget tex pairs consecutive $, so prose dollars ($50, $HOME) get swept into a \(...\). For files with literal dollars, migrate them with the dollar target instead, or replace the literals before running.
Inline backtick code gets migrated too
EditedOnly triple-backtick fences are protected. A migration note like 'use $x$ here' has its inline-code delimiter converted. Put quoted syntax inside ``` ``` fenced blocks to keep it literal.
Tilde-fenced code is converted
Edited~~~ fences are not recognized by the skip logic, so math inside them migrates like prose. Convert old-style ~~~ blocks to ``` ``` if they must be preserved verbatim.
Display spacing differs by direction
Expectedtex→dollar adds blank lines around the new $$ block; dollar→tex does NOT add blank lines around the new \[ block. If your destination wants display math isolated, the dollar direction handles it for free; the tex direction may need a manual blank line.
Already-destination math is left as-is
By designRe-running with the same target on already-migrated content produces no change — the tool never re-touches delimiters already in the target form. This makes the migration safely repeatable across a folder.
Multi-line inline math not migrated
PreservedAn inline $...$ that spans a newline is skipped (the rule forbids newlines inside inline math). If a source wiki wrapped inline math across lines, join it before migrating or it stays in the old style.
`\begin{align}` / `\begin{equation}` not converted
PreservedOnly \(, \[, $, $$ are recognized. AMS environments pass through untouched on either direction. If the destination needs them wrapped, do that step separately.
Batch limit on Free tier
RejectedFree converts one file per run. A multi-hundred-file migration on Free means one-at-a-time; Pro queues up to 10 files per run (Pro-media 50). Each file still must stay under its character limit.
Frequently asked questions
How do I migrate from MathJax to KaTeX?
Set Target style to $ inline / $$ block (KaTeX) (the dollar target). Every \(...\) becomes $...$ and every \[...\] becomes a blank-line-surrounded $$...$$. Existing $ math, if any, is left alone, so the file is safely re-runnable.
How do I migrate from KaTeX to MathJax?
If the destination MathJax is configured for TeX delimiters, set Target style to \( \) inline / \[ \] block (MathJax) (the tex target). $...$ becomes \(...\) and $$...$$ becomes \[...\]. If your MathJax accepts $, you may not need to convert at all.
Does the target depend on the source or the destination?
The destination. Pick the convention the new platform's renderer expects. The source style is irrelevant — the tool simply rewrites whatever delimiters aren't already in the target form.
Can I migrate a whole folder at once?
Free processes one file per run. Pro accepts up to 10 files per run, and Pro-media up to 50, which speeds a bulk migration. Each file must still fit the per-file character limit.
Will it create duplicate delimiters on a partially-migrated file?
No. The tool only converts the non-target family, so equations already in the destination style are skipped. Running it on a half-migrated document only finishes the remaining ones.
Why did a paragraph with a price get mangled?
On the tex target the inline rule pairs consecutive $ signs, so $50 style currency in prose can be swept into math. Migrate files containing literal dollars with the dollar target instead, or replace the currency before converting.
Are my code samples preserved during migration?
Triple-backtick ``` fenced blocks are skipped, so quoted delimiter syntax in migration guides survives. Inline backtick spans and ~~~` fences are NOT protected — use triple-backtick fences for anything that must stay literal.
Does it handle `\begin{equation}` blocks?
No. Only the four delimiter forms are recognized; AMS environments pass through untouched in either direction. Wrap or convert those manually if the destination requires it.
Is the conversion lossless for the math itself?
Yes — only the delimiter characters change. The LaTeX content and its internal spacing are preserved exactly, so no equation is altered, only its wrapping.
Does the migration upload my files?
No. Everything runs in the browser, so even a confidential internal wiki export is converted locally with nothing leaving your machine.
What if some equations span multiple lines inline?
Inline $...$ containing a newline is skipped by design. Display math ($$, \[) spans lines fine and is converted; for inline math accidentally split across lines, join it first.
What tools complement a docs migration?
Pair this with md-gfm-to-commonmark for syntax portability, md-image-path-rewriter to fix asset paths during the move, and md-link-validator to catch links broken by the new URL structure.
Privacy first
All Markdown processing runs locally in your browser using JavaScript. No file is ever uploaded to JAD Apps servers — only metadata counters are saved for signed-in dashboard stats.