LaTeX AI Editor
nishant9083/ai-latex-editor
Editor LaTeX com IA para escrever, debugar e aperfeiçoar documentos
Ver no GitHubEditor web moderno para LaTeX com assistência de IA integrada, suportando múltiplos provedores (Gemini, OpenAI, Claude, Ollama). Oferece compilação em tempo real, preview de PDF, correção automática de erros e sugestões inteligentes com diff side-by-side.
Instalação
npx convez-ai nishant9083/ai-latex-editor1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Escrever documentos acadêmicos e teses com assistência de IA
- Debugar erros de compilação LaTeX com explicações automáticas
- Gerar código LaTeX a partir de descrições em linguagem natural
- Revisar e melhorar estrutura de documentos com sugestões inteligentes
Veredito

Solução robusta que democratiza a criação de documentos LaTeX com IA. Interface polida (Monaco Editor, layout tipo Overleaf) e suporte multi-provedor (local via Ollama ou cloud) o torna flexível, mas requer configuração inicial de chaves de API.
README
A tradução para o português deste README ainda está na fila.
LaTeX AI Editor
Features • Installation • Usage • AI Providers • Contributing
🚀 Overview
LaTeX AI Editor is a powerful, modern web-based LaTeX editor with integrated AI assistance. Write, compile, and perfect your LaTeX documents with real-time preview and intelligent AI suggestions from multiple providers.
✨ Features
📝 Editor Capabilities
- Monaco Editor Integration: Professional code editing with syntax highlighting, autocomplete, and IntelliSense
- Multi-file Support: Work with multiple
.texfiles, bibliography (.bib), and images - Real-time Compilation: Instant PDF preview with error highlighting
- Overleaf-style Interface: Familiar three-panel layout with file manager
- Tabbed Preview: Switch between PDF preview and compilation logs
- Syntax Highlighting: Custom LaTeX language support with syntax coloring
🤖 AI Assistance
- Multi-Provider Support: Choose from Google Gemini, OpenAI, Anthropic Claude, or Ollama (local)
- Smart Commands:
- 💡 Write: Generate LaTeX code from natural language descriptions
- 🔍 Debug: Identify and explain compilation errors
- 🔧 Fix: Automatically fix LaTeX errors with AI suggestions
- ✏️ Improve: Get AI suggestions with side-by-side diff preview
- Floating AI Assistant: LinkedIn-style draggable chat widget
- Diff Preview: Review AI suggestions before applying changes
- Abort Control: Cancel long-running AI requests
🎨 User Interface
- Resizable Panels: Customize your workspace layout
- Fullscreen Modes: Focus on editing or preview
- Dark Theme: Eye-friendly interface optimized for long sessions
- File Manager: Organized folders for LaTeX files, bibliography, and images
- Image Preview: View images with LaTeX include code snippets
- Responsive Design: Works seamlessly on desktop and tablets
💾 Persistence & State
- Auto-save: All work automatically saved to localStorage
- Session Persistence: Editor preferences, panel layouts, and API keys persist across sessions
- Compilation History: View logs of past compilations (latest 50)
- Multi-file Projects: Full project state saved including all files and images
⚙️ Advanced Features
- Compilation Modes: Auto-compile on save or manual compilation
- Editor Preferences: Customizable font size, minimap, line numbers, word wrap
- Layout Presets: Quick switching between different workspace layouts
- Keyboard Shortcuts: Efficient workflow with keyboard navigation
- Export: Download compiled PDFs
📦 Installation
Prerequisites
- Node.js v18 or higher
- npm or yarn
Quick Start
-
Clone the repository
git clone <repository-url> cd latex_editor -
Install dependencies
npm install cd server npm install cd .. -
Start development servers
Option 1: Run both servers together (recommended)
npm run dev:allOption 2: Run separately
# Terminal 1 - Backend server cd server npm start # Terminal 2 - Frontend npm run dev -
Open your browser Navigate to
http://localhost:5173
Production Build
# Build frontend
npm run build
# Serve production build
npm run preview
The built files will be in the dist directory.
🎯 Usage
Getting Started
- Open the editor at
http://localhost:5173 - Configure AI provider (click Settings icon ⚙️)
- Start writing LaTeX in the editor
- Compile to see PDF preview (auto or manual mode)
- Use AI commands for assistance
AI Commands
💡 Write
Ask AI to generate LaTeX code:
"Create a table with 3 columns showing student names, grades, and remarks"
"Write the quadratic formula with proper formatting"
🔍 Debug
Get explanations for compilation errors:
- AI analyzes error logs
- Provides clear explanation of issues
- Suggests potential fixes
🔧 Fix
Automatically fix compilation errors:
- AI reads error messages
- Generates corrected code
- Applies fixes to your document
✏️ Improve
Get AI suggestions with preview:
- Request improvements or modifications
- View side-by-side diff of changes
- Accept or reject suggestions
Multi-file Projects
- Add files: Click "+" button in File Manager
- Supported types:
.tex,.bib, images (PNG, JPG, etc.) - Include files: Use standard LaTeX commands
\input{chapters/introduction.tex} \bibliography{references.bib} \includegraphics{figures/diagram.png}
Keyboard Shortcuts
Ctrl+S/Cmd+S: Compile documentCtrl+Enter/Cmd+Enter: Send AI messageShift+Enter: New line in AI inputF11: Toggle fullscreen
🤖 AI Providers
Google Gemini
- Get API key: Google AI Studio
- Free tier: 60 requests/minute
- Model:
gemini-pro
OpenAI
- Get API key: OpenAI Platform
- Pay-per-use pricing
- Model:
gpt-3.5-turboorgpt-4
Anthropic Claude
- Get API key: Anthropic Console
- Pay-per-use pricing
- Model:
claude-3-sonnetorclaude-3-opus
Ollama (Local)
- Install: Ollama.ai
- Run server:
ollama serve - Pull model:
ollama pull llama2 - Endpoint:
http://localhost:11434 - Advantage: Free, private, runs offline
🏗️ Architecture
Tech Stack
Frontend
- React 18.3 with TypeScript 5.3
- Vite 5.0 (build tool)
- Monaco Editor (code editing)
- Zustand (state management)
- Tailwind CSS (styling)
- Lucide React (icons)
Backend
- Express.js (proxy server)
- LaTeX.Online API (compilation)
- tar-stream (multi-file bundling)
AI Integration
- Axios (HTTP client)
- Multiple provider APIs
- AbortController (request cancellation)
Project Structure
latex_editor/
├── public/ # Static assets
│ └── logo.svg # Application logo
├── server/ # Backend proxy server
│ ├── server.js # Express server
│ └── package.json # Server dependencies
├── src/
│ ├── components/ # React components
│ │ ├── AIAssistant.tsx # AI chat widget
│ │ ├── Editor.tsx # Monaco editor wrapper
│ │ ├── Preview.tsx # PDF preview + logs
│ │ ├── FileManager.tsx # File explorer
│ │ ├── Toolbar.tsx # Top toolbar
│ │ └── Settings.tsx # Settings modal
│ ├── services/ # API services
│ │ ├── aiService.ts # AI provider integrations
│ │ └── latexCompiler.ts # LaTeX compilation
│ ├── store/ # State management
│ │ └── editorStore.ts # Zustand store
│ └── main.tsx # App entry point
├── index.html # HTML template
└── package.json # Dependencies
🔒 Security & Privacy
- API Keys: Stored locally in browser (localStorage)
- No Server Storage: All data stays in your browser
- Secure Transmission: HTTPS for API requests
- Local Option: Use Ollama for complete privacy
- No Tracking: No analytics or telemetry
🤝 Contributing
We welcome contributions! Please see CONTRIBUTING.md for details on:
- Code of Conduct
- Development setup
- Pull request process
- Coding standards
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- LaTeX.Online for compilation API
- Monaco Editor by Microsoft
- AI Providers for making intelligent assistance possible
- Open Source Community for amazing tools and libraries
📧 Contact & Support
- Issues: [GitHub Issues](/issues)
- Discussions: [GitHub Discussions](/discussions)
- Author: Nishant Verma
🗺️ Roadmap
- Real-time collaboration
- GitHub integration
- Template library
- Custom themes
- Plugin system
- Mobile app
- Self-hosted option
- LaTeX package manager
⭐ Star us on GitHub — it helps!