title: TexLab - Professional LaTeX Converter
emoji: 🧮
colorFrom: blue
colorTo: purple
sdk: docker
app_file: app.py
pinned: false
TexLab - Professional LaTeX Converter
TexLab is a cutting-edge platform that transforms handwritten mathematical expressions, scribbles, tables, and camera captures into clean, editable LaTeX code using advanced AI models.
Features
- Math Equation Recognition: Convert printed or handwritten mathematical equations to LaTeX
- Camera Capture: Take photos of equations and convert them to LaTeX in real-time
- Handwritten Notes: Draw equations directly on our digital canvas and convert them to LaTeX
- Table Detection: Automatically detect handwritten tables and convert them to LaTeX tables
- PDF Processing: Upload PDFs and extract mathematical content
- Graph Generation: Create beautiful mathematical graphs from text commands
- Subscription Plans: Flexible pricing options for individual and professional use
Setup Instructions
Install the required packages:
pip install -r requirements.txtSet up environment variables:
- Rename
.env.exampleto.env - Update the values with your own credentials
- Rename
Make sure you have MySQL running and create the database:
CREATE DATABASE IF NOT EXISTS email_verification; USE email_verification; CREATE TABLE IF NOT EXISTS users ( id INT AUTO_INCREMENT PRIMARY KEY, email VARCHAR(255) NOT NULL UNIQUE, password VARCHAR(255) NOT NULL, otp VARCHAR(6), is_verified TINYINT(1) DEFAULT 0, created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP );Update the database credentials in
config.pyif needed:DB_CONFIG = { 'host': 'localhost', 'user': 'root', 'password': '', 'database': 'email_verification' }Run the application:
python app.pyVisit
http://localhost:5000in your browser
Pricing Plans
TexLab offers three subscription plans to meet your needs:
Basic Plan - $9.99/month
- Convert up to 100 images per month
- Basic math equation recognition
- Email support
- Standard processing speed
Professional Plan - $24.99/month
- Unlimited image conversions
- Advanced math equation recognition
- Handwritten table detection
- Priority processing speed
- 24/7 customer support
- Early access to new features
Enterprise Plan - $49.99/month
- Everything in Professional Plan
- Team collaboration tools
- Custom API access
- Dedicated account manager
- SLA guarantee
- On-premise deployment option
File Structure
app.py: Main application filecontroller/: Route handlers for different featuresmodels/: Data models and database interactionstemplates/: HTML templatesstatic/: CSS, JavaScript, and other static filesutils/: Utility functionsrequirements.txt: Python dependencies.env: Environment variables
Payment Integration
TexLab uses SSLCommerce as its payment gateway. To configure payments:
- Sign up for an SSLCommerce merchant account
- Update the SSLCOMMERCE_STORE_ID and SSLCOMMERCE_STORE_PASS in your
.envfile - Configure your webhook URLs in the SSLCommerce dashboard
License
This project is licensed under the MIT License - see the LICENSE file for details.
Deployment to Hugging Face Spaces
This application is configured for deployment to Hugging Face Spaces using Docker.
Prerequisites
- A Hugging Face account
- A Space created on Hugging Face
Environment Variables
Set the following environment variables in your Hugging Face Space settings:
SECRET_KEY: A secure secret key for Flask sessionsDB_HOST: Database hostDB_USER: Database userDB_PASSWORD: Database passwordDB_NAME: Database nameSSLCOMMERCE_STORE_ID: Your SSLCommerce store ID (optional)SSLCOMMERCE_STORE_PASS: Your SSLCommerce store password (optional)GOOGLE_CLIENT_ID: Your Google OAuth client ID (optional)GOOGLE_CLIENT_SECRET: Your Google OAuth client secret (optional)SENDGRID_API_KEY: Your SendGrid API key (optional)MAIL_DEFAULT_SENDER: Your default email sender address (optional)
Deployment Steps
- Create a new Space on Hugging Face
- Select "Docker" as the SDK
- Connect your Git repository or upload the files
- Add the required environment variables in the Space settings
- The application will automatically build and deploy
Troubleshooting
If you encounter a ModuleNotFoundError: No module named 'controller' error:
- This has been fixed by installing the package in development mode in the Dockerfile
- The Dockerfile now uses
pip install -e .to install the package - All controller modules should now be correctly imported
If you still experience import issues, you can run the test_imports.py script to verify all modules can be imported correctly.