MathShield
MathShield is a Chrome extension that fixes broken math when translating webpages.
The problem
When using tools like Google Translate on pages with MathJax, formulas often break.
Example:
https://pho.rs/p/4191
After translation:
- units get mistranslated
- symbols get corrupted
- formulas overlap or duplicate
- spacing disappears, making expressions unreadable
Result: the problem becomes unusable.
The solution
MathShield fixes this by:
- Protecting rendered math from translation
- Translating only human-readable text inside LaTeX
- Converting units correctly using prefix + base logic
- Re-rendering MathJax safely after modifications
Features
- Works automatically on any site using MathJax
- Handles Cyrillic units and text
- Prevents layout break and overlapping formulas
- No setup required after installation
Installation
- Download or clone this repository
- Open Chrome and go to: chrome://extensions/
- Enable Developer mode
- Click Load unpacked
- Select the project folder
Usage
- Open a page with math (e.g. the example above)
- Use browser translation
- MathShield automatically fixes the formulas
Status
Core functionality is complete.
Tested on physics/math problem pages with heavy LaTeX usage.
Notes
- Some translation issues (like visually similar letters) come from Google Translate itself and cannot be fully fixed externally
- Future improvements may include support for MathJax v3