AnkiWeb
- Rating
- 0 (π 0 Β· π 0)
- Updated
- 2026-04-20
- Anki versions
- 2.1.1~
- Description language
- en
AnkiWeb addon 1066972223
Fixes cloze conflicts where }} inside MathJax closes deletions too early by rewriting braces and removing non-breaking spaces.
Open on AnkiWeb GitHub Ask about alternatives
active
| Min Anki | Max Anki | Updated |
|---|---|---|
| 2.1.1 | + | 2026-04-20 |
Loadingβ¦
Removes cloze formatting around the cursor or within selections, handling nested clozes, MathJax, paste cleanup, AI hints, configurable backends, and live logs.
Edit, format, and cloze note fields directly in the reviewer via a floating toolbar, field editor, palettes, and remappable shortcuts.
Converts MathJax $β¦$ and $$β¦$$ delimiters to \(...\) and \[...\] in the Editor, selected Browser notes, and current Reviewer note while preserving formatting and undo.
Adds a { } toolbar button that spaces adjacent braces inside LaTeX/MathJax, preventing clashes with Anki cloze syntax and preserving existing cloze deletions.
Write Markdown flashcards with Shiki code highlighting, MathJax, cloze, AI generation, interactive choice cards, TTS, and cross-platform Anki support.
Critiques, rewrites and organises existing Anki cards via your own AI API key, with local review tools and approval before edits.
An Anki add-on that fixes cloze conflicts where }} inside MathJax (or other cloze text) is interpreted as the end of a cloze deletion.
Cloze deletions are terminated with }}. If }} appears inside cloze content, Anki may close the cloze too early.
{{c1::[$]\frac{foo}{\frac{bar}{baz}}[/$] blah blah blah.}}
{{c1::[$]\frac{foo}{\frac{bar}{baz} }[/$] blah blah blah.}}
LaTeX math mode ignores extra spaces, so rendering remains the same.
Alternative workaround (for cases where visible spaces matter):
{{c1::[$]\frac{foo}{\frac{bar}{baz}<!-- -->}[/$] blah blah blah.}}
The same idea also helps when :: needs to appear in cloze-deleted text, e.g.:
{{c1::std:<!-- -->:variant::~type~}} in C++ is a {{c2::type-safe union}}
This add-on applies the space workaround by default:
}} inside cloze content and hints with } }}}} boundary conflicts by rewriting them to safe output{{{c1::c}}} exclusively from MathJax tags to prevent rendering breakage.<img width="2083" height="1188" alt="Screenshot_20260307_232051" src="https://github.com/user-attachments/assets/5852640e-4bcf-4dab-ad47-58b95345969e" /> <img width="2083" height="1188" alt="Screenshot_20260307_232059" src="https://github.com/user-attachments/assets/7f0d622d-c714-4c73-888a-c8a875b9b21a" />
Open Tools -> Add-ons -> Fix MathJax in Cloze -> Config.
}}config.json:
{
"replacement": "} }",
"remove_nbsp_in_mathjax": true
}
replacement: string used to replace internal }} inside cloze content
Default: } }
If invalid (empty, non-string, or contains }}), the add-on falls back to } }
remove_nbsp_in_mathjax: boolean to enable scrubbing non-breaking spaces automatically generated by Anki's editor (e.g., from typing double spaces or pasting via web browser). This clears them exclusively inside MathJax blocks to avoid LaTeX compilation failures.
Default: true
}} found inside cloze content and at the immediate boundary before cloze termination.DEVELOPMENT.md.If this add-on helps, you can support it from the in-app Support tab or here:
from inside native MathJax limits (\() and (\[) and Anki tags to prevent rendering errors caused by Anki's rich-text editor defaults, configurable via remove_nbsp_in_mathjax option and available natively in the settings UI.bump.py and make_ankiaddon.py build/packaging scripts{{c3::\(\sin i_{{{c1::c}}} = ...\)}} so the add-on preserves {{c1::c}} and rewrites the outer brace boundary instead}}} cloze-boundary conflicts (for example, {{c1::\\mathbf{0}}} β {{c1::\\mathbf{0} }})}} replacement in cloze hints (not just cloze answers)replacement values}} β } })config.json