Skip to content

SakuraMathcraft/LaTeXSnipper

Repository files navigation

LaTeXSnipper ✨

A desktop math workspace for capture -> recognize -> handwrite -> edit -> compute

主界面-浅色

Stars Forks Issues License Version Platform Python

GitHub Release Last Commit Activity

Star History

Star History Chart


Overview

LaTeXSnipper is no longer just a "screenshot formula -> LaTeX" utility. It is a desktop workspace built for end-to-end math content workflows:

  • Capture and recognize mathematical content from screenshots
  • Continue editing and computing in the integrated math workbench
  • Handwrite expressions in a dedicated canvas and convert to LaTeX
  • Send results back to the main editor or copy to clipboard

Feature Walkthrough

Math Workbench

数学工作台-暗色

The v2.0 Math Workbench supports a complete workflow:

  1. Capture and recognize formulas from the main window
  2. Load results into the workbench in one click
  3. Edit expressions in the MathLive area
  4. Use the virtual math keyboard for fractions, superscripts, integrals, series, and more
  5. Run Compute / Simplify / Numeric / Expand / Factor / Solve
  6. Write results back to the editor or copy as LaTeX / MathJSON

Auto Typesetting Document Window

v2 3深色

The v2.3.2 Auto Typesetting Document Window supports source-level editing with synchronized preview:

  1. Open "Auto Typesetting" from the handwriting window
  2. Edit full source in the left TeX Document pane
  3. Insert complex expressions with the built-in formula editor
  4. Compile and preview PDF directly
  5. Navigate bi-directionally between source and PDF via SyncTeX
  6. Export .tex or PDF when needed

Handwriting Recognition

手写识别readme

The v2.1 handwriting window supports the following flow:

  1. Open "Handwriting Recognition" from the main window
  2. Write formulas directly on an isolated canvas
  3. Trigger pix2text recognition automatically after pen-up
  4. See live LaTeX output and rendered preview on the right
  5. Copy LaTeX directly or insert it back into the main editor

Core Features

Feature Description
📸 Formula recognition Screenshot-based recognition for formulas, text, and mixed content
✍️ Handwriting recognition Dedicated handwriting window with auto-recognition and live preview
🧮 Math workbench Separate workspace for editing, computation, and write-back
⌨️ Formula editing Integrated MathLive math-field with virtual math keyboard
🔄 Multi-format export LaTeX, Markdown, MathML, HTML, OMML, SVG
📐 Core computation Compute, simplify, numeric evaluate, expand, factor, solve
🧠 Advanced fallback Local SymPy/mpmath engine for harder expressions
🌙 Theme support Light/Dark adaptation across windows and tools
🔐 Offline-first Recognition and advanced solving can run locally for privacy

Computation Coverage

The workbench currently covers common scenarios such as:

  • Polynomial expansion
  • Factorization
  • Equation solving
  • Irrational/complex root fallback solving
  • Definite and improper integrals
  • Infinite series
  • Infinite products
  • Limits
  • Derivatives
  • Numeric approximation and constant recognition

For heavy expressions, the engine uses automatic fallback:

  1. Try frontend Compute Engine first
  2. Switch to local advanced engine on timeout/failure/unreliable results
  3. Use SymPy/mpmath for robust fallback
  4. Recover closed forms for selected known constants from numeric output

Quick Start

Option 1: Download the executable

  1. Visit the Releases page
  2. Download the latest LaTeXSnipper_setup_v2.3.2.exe
  3. Run the installer
  4. Complete environment setup via the dependency wizard on first launch
  5. Start capturing, handwriting, or using the math workbench

Option 2: Run from source

git clone https://github.com/SakuraMathcraft/LaTeXSnipper.git
cd LaTeXSnipper

python -m venv .venv
.\.venv\Scripts\activate

pip install -r requirements.txt
python src/main.py

Project Structure

LaTeXSnipper/
├── apps/
│   ├── android-client/
│   │   ├── src/
│   │   └── android/
│   └── tauri-client/
│       └── src-tauri/
├── contracts/
│   ├── daemon_rpc_contract.v1.json
│   └── events.v1.json
├── src/
│   ├── main.py
│   ├── deps_bootstrap.py
│   ├── settings_window.py
│   ├── updater.py
│   ├── backend/
│   │   ├── capture_overlay.py
│   │   ├── model.py
│   │   ├── torch_runtime.py
│   │   └── platform/
│   ├── editor/
│   │   ├── workbench_window.py
│   │   ├── workbench_bridge.py
│   │   └── advanced_cas.py
│   ├── handwriting/
│   │   ├── handwriting_window.py
│   │   ├── document_preview_window.py
│   │   ├── tex_document_utils.py
│   │   ├── pdf_view_poppler.py
│   │   ├── pdf_view_fitz.py
│   │   ├── ink_canvas.py
│   │   ├── stroke_store.py
│   │   ├── recognizer.py
│   │   ├── tools.py
│   │   └── types.py
│   ├── assets/
│   │   ├── MathJax-3.2.2/
│   │   └── mathlive/
│   │       ├── index.html
│   │       ├── app.css
│   │       ├── app.js
│   │       ├── bridge_panel.html
│   │       └── bridge_panel.js
│   ├── core/
│   ├── models/
│   └── ui/
├── build/
├── LaTeXSnipper.spec
├── requirements.txt
├── requirements-build.txt
├── version_info.txt
└── readme.md

Contributing

Contributions are welcome:

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push your branch
  5. Open a Pull Request

Recommended focus areas:

  • Handwriting UX
  • Math workbench UX
  • Advanced solver stability
  • Packaged runtime verification
  • Theme consistency across windows

License

This project is open-sourced under the MIT License.


Acknowledgements

Special thanks to:


Download Issues Discussions Wiki
Latest Release Open an Issue Discussions Project Wiki