A Chrome extension for seamlessly transferring math problems (text, LaTeX formulas, and images) to Google Gemini.
- Text: Plain text with preserved formatting
- LaTeX Formulas: Auto-detected and properly formatted
- Images: Diagrams, graphs, and geometric figures
- Automatically detects mathematical content
- Recognizes LaTeX in multiple formats (
$...$ ,$$...$$ , [...], etc.) - Extracts formulas from MathJax and KaTeX rendered content
- Classifies images (geometry, graphs, formulas)
- Right-click context menu
- Keyboard shortcut:
Ctrl+Shift+G(orCmd+Shift+Gon Mac) - Preview before sending
- Automatic tab management
- Maintains spatial relationships between text, formulas, and images
- Preserves document structure
- Extracts surrounding context for images
- Clone or download this repository
- Open Chrome and navigate to
chrome://extensions/ - Enable "Developer mode" in the top right
- Click "Load unpacked"
- Select the
smart-clipperdirectory - The extension icon should appear in your toolbar
The extension requires icon files. You can either:
- Use the provided icon generation script (coming soon)
- Create your own PNG icons in the following sizes and place them in
assets/icons/:- icon16.png (16x16)
- icon32.png (32x32)
- icon48.png (48x48)
- icon128.png (128x128)
For now, you can use any placeholder images with these dimensions.
- Select content on any webpage (text, formulas, images)
- Right-click and choose "Send to Gemini" OR press
Ctrl+Shift+G - Content automatically transfers to Gemini chat
- Review and submit in Gemini
1. Select entire problem area with mouse
2. Right-click → "Send to Gemini" OR Ctrl+Shift+G
3. Preview popup appears (optional)
4. Click "Send" → Content transfers to Gemini
1. Select content
2. Right-click
3. Choose "Send to Gemini" for instant transfer
OR "Capture and Preview" to review first
1. Select content
2. Press Ctrl+Shift+G (Cmd+Shift+G on Mac)
3. Content captures and preview appears
┌─────────────────────────────────────────────────┐
│ Content Script (Any Page) │
│ • Listens for selections │
│ • Captures text, LaTeX, images │
│ • Shows preview popup │
└──────────────────┬──────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────┐
│ Background Service Worker │
│ • Coordinates between tabs │
│ • Manages context menus │
│ • Handles keyboard shortcuts │
└──────────────────┬──────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────┐
│ Gemini Injector (Gemini Tab Only) │
│ • Inserts text into chat input │
│ • Uploads images │
│ • Handles multi-part messages │
└─────────────────────────────────────────────────┘
- LaTeX Detector (
lib/latex-detector.js): Detects and extracts LaTeX formulas - Image Extractor (
lib/image-extractor.js): Extracts and processes images - Content Assembler (
lib/content-assembler.js): Combines all content types - Content Script (
content/content-script.js): Handles user interaction - Gemini Injector (
content/gemini-injector.js): Inserts content into Gemini - Service Worker (
background/service-worker.js): Coordinates everything
Selected Content:
Find the area under the curve f(x) = x² from x=0 to x=2.
∫₀² x² dx
Sent to Gemini:
Find the area under the curve f(x) = x² from x=0 to x=2.
$$\int_0^2 x^2 dx$$
Selected Content:
- Text: "In triangle ABC: Angle A = 45°, Side AB = 10 cm, Side BC = 8 cm"
- Image: Triangle diagram
- Text: "Find the area of triangle ABC."
Sent to Gemini:
- All text preserved in order
- Triangle diagram attached as image
- Maintains problem structure
Selected Content:
The quadratic formula: x = (-b ± √(b²-4ac)) / 2a
Sent to Gemini:
The quadratic formula: $$x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}$$
-
Inline math:
$formula$,\(formula\) -
Display math:
$$formula$$,\[formula\] -
Environments:
\begin{equation}...\end{equation},\begin{align}...\end{align} - MathJax/KaTeX: Automatically extracts from rendered elements
- Unicode math: Converts to LaTeX when appropriate
- Standard images:
<img>tags - SVG: Converted to data URL
- Canvas: Captured as PNG
- All formats uploaded to Gemini
- ✅ Chrome (v88+)
- ✅ Edge (Chromium-based)
⚠️ Other Chromium browsers (should work, not tested)- ❌ Firefox (requires porting to WebExtensions)
- ❌ Safari (requires porting)
smart-clipper/
├── manifest.json # Extension configuration
├── background/
│ └── service-worker.js # Background processing
├── content/
│ ├── content-script.js # Page interaction
│ ├── content-style.css # Styles for injected UI
│ └── gemini-injector.js # Gemini-specific handler
├── lib/
│ ├── latex-detector.js # LaTeX detection
│ ├── image-extractor.js # Image processing
│ └── content-assembler.js # Content assembly
├── popup/
│ ├── popup.html # Extension popup
│ ├── popup.css # Popup styles
│ └── popup.js # Popup logic
├── assets/
│ └── icons/ # Extension icons
└── README.md
- Clone the repository:
git clone <repository-url>
cd smart-clipper-
Install dependencies (none currently - pure vanilla JS)
-
Load in Chrome:
- Navigate to
chrome://extensions/ - Enable "Developer mode"
- Click "Load unpacked"
- Select the project directory
- Navigate to
-
Test LaTeX Detection:
- Visit any page with math formulas (Khan Academy, Wikipedia math articles)
- Select formulas and test capture
-
Test Image Capture:
- Select content with embedded images
- Verify images transfer correctly
-
Test Gemini Integration:
- Ensure you're logged into Gemini
- Test transfer to chat input
- Verify images upload correctly
- ✅ Basic multi-modal capture
- ✅ LaTeX detection and formatting
- ✅ Image extraction
- ✅ Gemini integration
⚠️ Gemini UI selectors may need updates (Gemini is in active development)⚠️ Complex MathML conversion is simplified⚠️ No OCR for handwritten formulas (planned for Phase 5)⚠️ No edit capability yet (preview only)⚠️ No capture history
Phase 2 (v0.2.0):
- Enhanced LaTeX detection patterns
- Better image classification
- Improved error handling
Phase 3 (v0.3.0):
- Progressive capture mode
- Multi-part problem assembly
- Drag-to-reorder interface
Phase 4 (v0.4.0):
- Clipboard monitor
- Capture history
- Edit before send
- Template system
Phase 5 (v1.0.0):
- OCR integration
- Handwritten formula recognition
- Advanced formatting options
- Cloud sync
- Make sure you have content selected
- Check browser console for errors (F12)
- Try reloading the page
- Verify extension is enabled
- Make sure you're logged into Gemini
- Check if Gemini tab opened correctly
- Try manually opening Gemini first
- Check for Gemini UI updates (selectors may need adjustment)
- Verify images are within size limits
- Check browser console for errors
- Try with simpler images first
- Ensure Gemini supports image uploads
- Check if formulas use supported delimiters
- Try wrapping in
$...$or$$...$$ - Report patterns that should be detected
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
Smart Clipper:
- ✅ Processes all content locally
- ✅ Only sends to Gemini when you explicitly request
- ✅ No external servers or tracking
- ✅ No data collection
- ✅ Open source - audit the code yourself
MIT License - See LICENSE file for details
- Issues: Report bugs and request features via GitHub Issues
- Documentation: See this README and code comments
- Updates: Watch the repository for updates
- Initial release
- Multi-modal capture (text, LaTeX, images)
- Smart LaTeX detection
- Image extraction with context
- Gemini integration
- Preview popup
- Context menu and keyboard shortcuts
Built for enhanced learning with Google Gemini Guided Learning.
Special thanks to:
- MathJax and KaTeX for LaTeX rendering inspiration
- Chrome Extensions documentation
- The mathematical education community
Happy Learning with Smart Clipper! 📐✨