Skip to content

Latest commit

Β 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TeXa Logo

Minimalist, Privacy-First, Local AI-Powered LaTeX Editor & Live Compiler

Python FastAPI React Vite PyTorch Monaco


πŸ“– Overview

TeXa is a modern, distraction-free LaTeX editor powered by local, on-device generative AI. Built with high performance and privacy in mind, TeXa allows you to compose documents, generate complex mathematical templates, diagnose compiler errors, and preview live-rendered PDFsβ€”all without sending a single line of your code or research data to external cloud APIs.

Whether you are writing academic papers, mathematical proofs, resumes, or lecture slides, TeXa combines the power of open-weight Large Language Models with the speed of hybrid LaTeX compilation.


✨ Key Features

  • 🧠 Zero-Cloud Local AI Inference

    • Runs Hugging Face models locally using PyTorch with full hardware acceleration:
      • ⚑ Apple Silicon (MPS) for M1/M2/M3/M4 Macs.
      • πŸš€ NVIDIA CUDA for GeForce/RTX/Tesla GPUs.
      • βš™οΈ Optimized Multi-Threaded CPU fallback.
    • Supports popular lightweight architectures like Qwen 2.5 Coder (1.5B / 3B / 7B), Google Gemma 3 (1B / 4B), Llama 3.2, or any custom CausalLM from Hugging Face Hub.
  • ⚑ Hybrid LaTeX Compilation & Instant PDF Viewer

    • Works with Tectonic (automatic on-the-fly package fetching), latexmk, or pdflatex.
    • Includes continuous validation that compiles your documents as you write.
    • Integrated full-featured PDF viewer with page navigation, zoom, and fit modes.
  • πŸ“ AI Code & Template Generation

    • Dedicated prompt-to-LaTeX generator with active document context awareness.
    • Instantly produces clean code for tables (booktabs), mathematical systems, TikZ flowcharts, and full document boilerplate.
    • Guardrailed to ensure clean, strictly compilation-ready LaTeX.
  • πŸ› οΈ Autonomous Compiler Diagnostic & Error Resolver

    • Automatically parses compilation logs and identifies the exact file and line number causing the issue.
    • Preprocesses line-numbered snippets and delivers root-cause explanations with 1-click copyable fixes.
  • πŸ’» VS Code-Grade Monaco Editor

    • Full syntax highlighting for LaTeX and TeX macros.
    • Integrated error squiggles and diagnostic markers.
    • Multi-tab document navigation with unsaved change badges and clean indentation.
  • πŸ“ Project Workspace & File Management

    • Nested directory tree navigation with file and folder creation, deletion, and renaming.
    • Configurable custom project directories.
  • 🎨 Minimalist Dark & Light Themes

    • Fully responsive, sleek UI with customizable dark and light modes.

πŸ› οΈ Required Tools & Prerequisites

Before installing TeXa, ensure you have the following prerequisites installed on your system:

Tool Minimum Version Description
Python 3.10+ Backend server, API, and PyTorch AI engine
Node.js & npm 18.0+ Frontend web interface and Vite asset pipeline
LaTeX Engine Any Tectonic (Highly Recommended), TeX Live, MacTeX, or MiKTeX
Git 2.0+ Version control for cloning and updates

πŸš€ Installation & Setup Guide

Follow the instructions below for your operating system:

🍎 macOS Setup

  1. Install Prerequisites via Homebrew (if not already installed):

    brew install python node tectonic git
  2. Clone the Repository:

    git clone https://github.com/K-692/TeXa.git
    cd TeXa
  3. Set Up Python Virtual Environment:

    python3 -m venv venv
    source venv/bin/activate
  4. Install Python Dependencies:

    pip install --upgrade pip
    pip install -r requirements.txt
  5. Install Frontend Dependencies & Build Assets:

    cd frontend
    npm install
    npm run build
    cd ..
  6. Launch TeXa:

    python run.py

    TeXa will start the backend server and automatically open http://localhost:8000 in your default browser.


πŸͺŸ Windows Setup

  1. Install Prerequisites via Winget or manual installers:

    winget install Python.Python.3.11
    winget install OpenJS.NodeJS.LTS
    winget install Git.Git
    winget install TectonicTypesetting.Tectonic

    (Alternative LaTeX: MiKTeX)

  2. Clone the Repository:

    git clone https://github.com/K-692/TeXa.git
    cd TeXa
  3. Set Up Python Virtual Environment:

    python -m venv venv
    .\venv\Scripts\Activate.ps1
  4. Install Python Dependencies:

    python -m pip install --upgrade pip
    pip install -r requirements.txt
  5. Install Frontend Dependencies & Build Assets:

    cd frontend
    npm install
    npm run build
    cd ..
  6. Launch TeXa:

    python run.py

🐧 Linux Setup (Ubuntu / Debian / Fedora / Arch)

  1. Install Prerequisites:

    • Ubuntu / Debian:
      sudo apt update
      sudo apt install -y python3 python3-venv python3-pip nodejs npm git
      # Install Tectonic (recommended fast standalone compiler)
      sudo apt install -y tectonic || curl --proto '=https' --tlsv1.2 -fsSL https://drop-sh.fullyjustified.net | sh
    • Fedora:
      sudo dnf install -y python3 python3-pip nodejs git tectonic
    • Arch Linux:
      sudo pacman -S python python-pip nodejs npm git tectonic
  2. Clone the Repository:

    git clone https://github.com/K-692/TeXa.git
    cd TeXa
  3. Set Up Python Virtual Environment:

    python3 -m venv venv
    source venv/bin/activate
  4. Install Python Dependencies:

    pip install --upgrade pip
    pip install -r requirements.txt
  5. Install Frontend Dependencies & Build Assets:

    cd frontend
    npm install
    npm run build
    cd ..
  6. Launch TeXa:

    python run.py

βš™οΈ Configuration & Environment Settings

TeXa comes with an environment configuration file: .env.

# Hugging Face Access Token
# Required only for gated models (e.g. google/gemma-3-1b-it, meta-llama/Llama-3.2-3B-Instruct)
# Create a free read token at: https://huggingface.co/settings/tokens
HF_TOKEN=

# Default LaTeX Workspace Directory
# Can be a relative path (./projects) or an absolute directory (~/TeXa_Projects)
WORKING_DIRECTORY=./projects

Tip: You can also configure your Hugging Face Token, selected model, and project directory directly within the TeXa user interface via the Settings (βš™οΈ) modal.


πŸ€– Recommended AI Models

TeXa supports any Hugging Face CausalLM model. For best performance on personal laptops and desktops:

Model ID VRAM / RAM Description
Qwen/Qwen2.5-Coder-1.5B-Instruct ~3 GB Ultra-fast, lightweight model ideal for quick syntax and equations.
Qwen/Qwen2.5-Coder-3B-Instruct ~5 GB Recommended. Outstanding LaTeX syntax and table generation.
google/gemma-3-1b-it ~2.5 GB Google's high-efficiency lightweight multimodal/text model.(Requires HF Token)
meta-llama/Llama-3.2-3B-Instruct ~5 GB Versatile general assistance and document debugging.(Requires HF Token)
Custom Model ID Variable Enter any Hugging Face model identifier in the UI model picker.

Downloaded weights are stored locally in the models/ directory for offline reuse.


πŸ“‚ Project Architecture

TeXa/
β”œβ”€β”€ backend/                  # FastAPI Application & AI Engines
β”‚   β”œβ”€β”€ main.py               # REST & WebSocket API Endpoints
β”‚   β”œβ”€β”€ ai_engine.py          # PyTorch / MPS / CUDA Model Inference & Prompts
β”‚   β”œβ”€β”€ latex_engine.py       # Tectonic / Latexmk Compiler & Log Diagnostics
β”‚   β”œβ”€β”€ file_manager.py       # Workspace File Tree & File I/O
β”‚   └── config.py             # Global State & .env Manager
β”œβ”€β”€ frontend/                 # React + Vite Web Application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/       # Monaco Editor, PDF Viewer, File Tree, AI Panel
β”‚   β”‚   β”œβ”€β”€ assets/           # Logo & Icons
β”‚   β”‚   β”œβ”€β”€ styles/           # CSS & Design System
β”‚   β”‚   └── App.jsx           # Main Application Layout
β”‚   β”œβ”€β”€ package.json          # Node Dependencies
β”‚   └── vite.config.js        # Vite Configuration
β”œβ”€β”€ models/                   # Local Hugging Face Models Cache (ignored in git)
β”œβ”€β”€ projects/                 # Default LaTeX Workspace
β”‚   └── main.tex              # Starter LaTeX Document
β”œβ”€β”€ run.py                    # Single-Command Cross-Platform Launcher
β”œβ”€β”€ requirements.txt          # Python Dependencies
β”œβ”€β”€ .env                      # Environment Variables Template
└── README.md                 # Project Documentation

⌨️ Shortcuts & Tips

  • Cmd / Ctrl + S : Save active document and trigger compilation.
  • Cmd / Ctrl + B : Manual compile document to PDF.
  • Continuous Validation: When enabled in Settings, TeXa compiles your document seamlessly in the background as you type.

πŸ’‘ Community-Driven Growth & Feature Requests

We want TeXa to grow and evolve with the community. You do not need to be a developer or know Git to help make TeXa better!

πŸ“ For Users & Non-Developers (Feature Requests & Bug Reports)

If you encounter an issue, bug, or have an idea for a feature or workflow enhancement:

πŸ“Š For Developers & Contributors (Community Wishlist & Tracker)

All community submissions are automatically organized in our live Google Sheet so contributors can easily see what users need most:

  • Browse user-submitted ideas, feature requests, and bug reports.
  • Note for Contributors: When you pick up and complete any update or fix, please add a comment in the Google Sheet to notify the community and keep the tracker up to date.
  • πŸ‘‰ View Community Responses & Feature Tracker (Google Sheet)

🀝 Contributing

Contributions, bug fixes, and feature implementations are warmly welcomed!

  1. Check the Community Feature Tracker (Google Sheet) or GitHub Issues to see what improvements users are requesting.
  2. Fork the repository.
  3. Create your feature branch (git checkout -b feature/amazing-feature).
  4. Commit your changes (git commit -m 'Add amazing feature').
  5. Push to the branch (git push origin feature/amazing-feature).
  6. Open a Pull Request and leave a comment on the corresponding row in the Google Sheet once merged!

πŸ“„ License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.

About

Offline LaTeX Assistant

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages