Math Delimiters Replacer Plus

AnkiWeb addon 699086701

Converts MathJax $…$ and $$…$$ delimiters to \(...\) and \[...\] in the Editor, selected Browser notes, and current Reviewer note while preserving formatting and undo.
AI-generated summary; may contain mistakes.

note-managementformattingshortcutsfork-or-reupload

Open on AnkiWeb GitHub Ask about alternatives

AnkiWeb

Rating
6 (👍 5 · 👎 1)
Updated
2026-04-09
Anki versions
2.1.1~
Description language
en

Maintenance

active

  • Last update or commit was 175 days before the snapshot (2026-04-09).
  • The repository has 2 test files.

Will it work on my Anki?

Version branches
Min AnkiMax AnkiUpdated
2.1.1+2026-04-09
History across monthly snapshots

Loading…

Similar addons

README

Math Delimiters Replacer Plus

Install via ankiweb

This add-on converts MathJax delimiters while editing notes, batch-updating selected notes in the Browser, and updating the current note from the Reviewer More menu, using the same matching logic as the original project it builds on (Supports Bulk update)

What it does

  • Replace display math: $$ … $$ → \[ … \] without altering the inner TeX content
  • Replace inline math: $ … $ → \( … \) with the same guarantees as above
  • Adds a toolbar button labelled \(...\) in the Editor for one‑click conversion of the current selection
  • Adds a Browser action named \(...\) that processes all fields of all selected notes, with a single undo group for Ctrl+Z
  • Adds a Reviewer More-menu action named \(...\) that converts delimiters in the current review note
  • Adds an option in the add-on config to automatically convert delimiters upon pasting text into the editor (disabled by default)
  • In Editor selection and full-field modes, preserves existing HTML formatting (<b>, <i>, <u>, spans, etc.) and only rewrites delimiter text
  • Skips already rendered MathJax nodes so rendered equations are not modified

giphy

Installation

  • Install from AnkiWeb by opening Tools → Add‑ons → Get Add‑ons and entering the code 699086701

Usage

  • Editor: select text containing $…$ or $$…$$, then click the \(...\) toolbar button or press the configured shortcut to convert delimiters in place in the active field
  • Browser: select any cards, open the Edit menu, choose \(...\), and the add‑on will convert delimiters in every field of the selected notes with one undo entry for the whole run
  • Reviewer: while reviewing a card, open the More menu, choose \(...\), and the add‑on will convert delimiters in the current note and refresh the reviewer view <img width="726" height="1011" alt="Screenshot_20260409_201516" src="https://github.com/user-attachments/assets/94dd50c2-b9c0-489e-b3d8-c48566d340cd" />

Editor behavior details

  • The editor command rewrites affected text nodes in place (selection or full field) and does not flatten rich text formatting
  • Full-field mode includes both "no selection, cursor in field" and "select all inside a single field" workflows
  • Full-field replacement no longer propagates first-line formatting (for example bold or font size) to remaining lines
  • Existing rendered MathJax (for example anki-mathjax/MathJax render containers) is intentionally ignored
  • Editor replacement uses a native editable-command path so Ctrl+Z in the card editor restores previous delimiters
  • Scope is delimiter normalization only: $...$/$$...$$ to \(...\)/\[...\]

Keyboard shortcut

  • The shortcut is read from config.json key "hotkey" and is applied to both the Editor action and the Browser menu action on startup
  • Reviewer integration is exposed in the More menu (no dedicated reviewer hotkey)
  • If a plain Alt+letter collides with menu mnemonics on your platform, set "hotkey" to a combination like Shift+Alt+M in config.json and reload add‑ons to take effect

Compatibility

  • Tested on Anki 25 with Qt 6, with Browser/Editor integrations registered through modern hooks and with fallbacks for older APIs where practical
  • Reviewer menu integration uses the reviewer_will_show_context_menu hook when available
  • Undo is supported for Browser/Reviewer actions on modern Anki, with compatibility fallbacks on older builds
  • Editor undo for selection replacement is integrated with the editor’s own undo stack (Ctrl+Z in the field)

Notes on MathJax delimiters

  • Anki’s manual documents MathJax inline \(...\) and display \[...\] delimiters, which this add‑on standardizes from $ and $$ sources used in some notes
  • For equations that include backslashes or non‑breaking spaces, insertion uses a safe transport so the literal \[/\( sequences appear as intended in the field text before rendering

Attribution and credits

Support and source pointers

  • For usage instructions, updates, and issue reporting, consult the maintained add‑on’s AnkiWeb page under code 401047458
  • For background, screenshots, and original documentation, refer to the legacy add‑on page under code 211799575

Developer-oriented workflows and versioning commands are documented in DEVELOPMENT.md.

If you find this add-on useful, please consider supporting its development:

ko-fi

Changelog

  • 2026-04-09
    • Added an option in config to auto-replace math delimiters upon paste (disabled by default)
  • 2026-03-22
    • Fixed editor full-field replacement so multi-line fields keep per-line formatting instead of inheriting first-line style
    • Updated full-field processing to avoid style bleed while still converting delimiters in place
    • Fixed full-field detection for "select all in field" (Ctrl+A) so it follows the same formatting-safe path
    • Consolidated version tooling by removing new_version.py and moving sync/validation helpers into bump.py
    • Updated build flow so make_ankiaddon.py <version> sets explicit version without bumping, while no-arg mode still auto-bumps
  • 2026-03-19
    • Added Reviewer More-menu action to convert delimiters in the current review note
    • Fixed Browser/Reviewer replacement undo behavior on modern Anki by using custom undo entry merging
    • Fixed card editor replacement undo so Ctrl+Z restores previous delimiters after replace
  • 2026-02-20
    • Added support for full-field replacement: if no text is selected, clicking the button now replaces all math delimiters in the currently focused field.
    • Maintained existing behavior where only the selected text is processed if a selection exists.
  • 2026-02-18
    • Editor conversion now preserves existing rich text formatting (bold, italics, underline, spans, etc.)
    • Editor conversion now skips already rendered MathJax content
    • Delimiter normalization scope clarified: only $...$ and $$...$$ are converted to \(...\) and \[...\]