Skip to content

matthew29tang/tex-snip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LaTeX OCR

Version Python Updates Code style: black License: MIT

PDF to TeX

Flask server to convert PDF to TeX files. Limited to <5MB files.

Online usage: https://tex-snip.herokuapp.com/

Offline usage (requires API credentials): python src/main.py


TeX Snip

Python utility to take a screenshot of latex math equation and convert it to LaTeX. Supports text and math (but only one paragraph at a time). If the screenshot cannot be converted, nothing will be copied to your clipboard.

Handwritten conversion is in beta mode.

Usage

  1. Install python. Developed on Python 3.6, use any other verions at your own risk.
  2. Install python requirements pip install -r requirements.txt
  3. Create API credentials (see below)
  4. (Optional) Change keyboard config in src/config.py
  5. Run the program using python src/texSnip.py
  6. Start a screen cap, drag the dimensions, and release. The equation will be copied to your keyboard!
  7. To terminate, use SCROLL LOCK or a key of your choice in src/config.py

API Credentials

This utility uses MathPix as the OCR API. To create API credentials visit https://dashboard.mathpix.com/

Documentation can be found here.

Create a new file src/credentials.py in the following format:

APP_ID = "<APP_ID>"
APP_KEY = "<APP_KEY>"

Custom config

The default keybindings are:

  • ALT + P to begin a screen capture
  • ESC to cancel a screen capture
  • SCROLL LOCK to terminate the program

All of the keybindings can be changed in src/config.py. See the pynput documentation for details of each key.

About

Convert pictures of LaTeX equations to TeX

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published