Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

██╗      █████╗ ████████╗███████╗██╗  ██╗   ██████╗ ██████╗  █████╗ ███████╗████████╗
██║     ██╔══██╗╚══██╔══╝██╔════╝╚██╗██╔╝  ██╔════╝██╔══██╗██╔══██╗██╔════╝╚══██╔══╝
██║     ███████║   ██║   █████╗   ╚███╔╝   ██║     ██████╔╝███████║█████╗     ██║
██║     ██╔══██║   ██║   ██╔══╝   ██╔██╗   ██║     ██╔══██╗██╔══██║██╔══╝     ██║
███████╗██║  ██║   ██║   ███████╗██╔╝ ██╗  ╚██████╗██║  ██║██║  ██║██║        ██║
╚══════╝╚═╝  ╚═╝   ╚═╝   ╚══════╝╚═╝  ╚═╝   ╚═════╝╚═╝  ╚═╝╚═╝  ╚═╝╚═╝        ╚═╝

        ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

                         v4.0 · Multi-file architecture · UI overhaul

                         Premium browser-based LaTeX editor

        ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

LatexCraft is a modern, browser-based LaTeX writing environment designed for writing, editing, previewing, analyzing, and exporting LaTeX documents.

Features · Getting Started · Architecture · Shortcuts · Tech Stack


Architecture Build JavaScript Math License


About LatexCraft

LatexCraft is a feature-rich, browser-based LaTeX editor built to provide a focused and productive environment for technical and academic writing.

The application combines a professional code editor, live document preview, mathematical rendering, intelligent autocomplete, syntax analysis, document statistics, bibliography management, snapshots, multiple export formats, and customizable themes in a single browser-based workspace.

LatexCraft is designed around a client-side, multi-module architecture, allowing the editor, preview engine, storage layer, export system, statistics engine, and UI components to remain organized and independently maintainable.


What's New in v4.0

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃             v4.0 — MULTI-FILE ARCHITECTURE + UI OVERHAUL              ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

Architecture

  • Refactored into a modular ES-module architecture.
  • Organized application logic across dedicated JavaScript modules.
  • Clear separation between editor, preview, storage, export, statistics, UI, and utility systems.
  • Reduced coupling between application components.

User Experience

  • Complete interface overhaul.
  • Refined visual system and component styling.
  • Five dedicated application themes.
  • Focus Mode and Typewriter Mode.
  • Improved toolbar and sidebar organization.
  • Enhanced command palette and modal system.

Productivity

  • Document statistics.
  • Reading-time analysis.
  • Flesch reading ease.
  • Word-goal tracking.
  • Snapshot management.
  • Side-by-side document comparison.
  • Improved autocomplete.
  • Multi-cursor editing.

LaTeX Workflow

  • Live mathematical preview.
  • Equation hover previews.
  • Bibliography management.
  • Bidirectional editor/preview scrolling.
  • Multiple export formats.
  • Overleaf-compatible project ZIP generation.

Features

Editor Engine

Syntax Highlighting

LatexCraft includes a dedicated LaTeX tokenizer that provides syntax highlighting directly within the editor.

Intelligent Autocomplete

The autocomplete system supports:

  • LaTeX commands
  • Environments
  • References
  • Citations
  • Snippets
  • Tab stops
  • Context-aware suggestions

It includes more than 100 indexed commands and environment-related completions.

Inline Linting

The editor analyzes common LaTeX issues including:

  • Unbalanced environments
  • Mismatched braces
  • Math delimiter problems
  • Undefined references
  • Missing \documentclass
  • Other structural issues

Smart Editing

The editor provides:

  • Auto-closing brackets
  • Selection wrapping
  • Smart indentation
  • Block indentation/outdentation
  • Smart Enter
  • Automatic continuation of \item lists
  • Comment toggling
  • Multi-line editing
  • Multi-cursor editing
  • Grouped undo/redo

Find & Replace

Search functionality includes:

  • Standard search
  • Replace
  • Regular expressions
  • Case-sensitive matching
  • Live match count
  • Next/previous result navigation

Auto-Save

Document state can be persisted locally using browser localStorage, allowing work to be restored when returning to the application.


Live LaTeX Preview

LatexCraft provides a live preview environment for rendering LaTeX content while writing.

Mathematical Rendering

Powered by KaTeX, the preview supports mathematical expressions including:

$...$
\[...\]
equation
align
gather
multline

Preview Features

  • Real-time rendering
  • Brace-aware parsing
  • Nested command handling
  • Multi-argument command handling
  • Table-related syntax handling
  • Image embedding
  • Resizable preview panel
  • Preview zoom
  • Bidirectional scroll synchronization

Preview Zoom

Available zoom levels:

75% · 100% · 125% · 150%

Keyboard controls:

Ctrl + =    Zoom In
Ctrl + -    Zoom Out
Ctrl + 0    Reset Zoom

Document Statistics

LatexCraft includes a built-in document analysis system.

Writing Metrics

The statistics panel can provide:

  • Word count
  • Character count
  • Sentence count
  • Paragraph count
  • Reading time
  • Speaking time
  • Average words per sentence
  • Lexical diversity

Readability

LatexCraft calculates:

  • Flesch Reading Ease
  • Reading difficulty information

Document Structure

The application analyzes structural elements such as:

  • Sections
  • Subsections
  • Equations
  • Figures
  • Tables
  • Citations
  • Labels

Word Goals

Set a writing target and monitor progress through the integrated word-goal tracker.


Snapshots & Diff Viewer

LatexCraft provides document snapshots for preserving important versions of your work.

Snapshot Features

  • Manual snapshots
  • Up to 30 stored snapshots
  • Snapshot comparison
  • Side-by-side diff view
  • Myers-LCS based comparison

This makes it easier to review changes between different stages of a document.


Bibliography Manager

LatexCraft includes a dedicated bibliography management system.

Supported Operations

  • Create BibTeX entries
  • Edit entries
  • Delete entries
  • Import .bib data
  • Export bibliography data
  • Manage bibliography information alongside the document

Export System

LatexCraft supports multiple document and workspace export formats.

Format Output Description
Overleaf ZIP main.tex + images/ + .latexmkrc + README.txt Complete project bundle
PDF .pdf Browser print workflow
LaTeX .tex Raw LaTeX source
HTML .html Standalone HTML document
Markdown .md Markdown with embedded images
Plain Text .txt Plain document text
Workspace .json Code, images, snapshots, bibliography
Clipboard — Complete source copied to clipboard

Themes

LatexCraft provides five carefully designed visual themes.

Dark Editorial

Background: #0d0d12
Accent:     #e0713a

Light Paper

Background: #ffffff
Accent:     #d97706

Solarized Dark

Background: #002b36
Accent:     #b58900

Midnight Ocean

Background: #04111f
Accent:     #06b6d4

Warm Parchment

Background: #faf5e8
Accent:     #c0392b

Getting Started

LatexCraft is designed to run directly in a modern web browser.

Requirements

  • Modern web browser
  • JavaScript enabled
  • Internet connection for external CDN resources on initial load

Running Locally

Open the project using a local web server and load:

index.html

A local development server is recommended because the application uses native ES modules.

For example, with a simple local server:

python -m http.server 8000

Then open:

http://localhost:8000

The application does not require:

  • npm install
  • node_modules
  • package.json
  • A JavaScript bundler
  • A build pipeline

Project Structure

latexcraft/
│
├── index.html
│
├── css/
│   ├── variables.css       # Design tokens
│   ├── themes.css          # Application themes
│   ├── base.css            # Global reset and base styles
│   ├── components.css      # Buttons, inputs, badges, tooltips
│   ├── layout.css          # Topbar, toolbar, sidebar, statusbar
│   ├── editor.css          # Editor and syntax overlay
│   ├── preview.css         # Preview pane and document styling
│   └── modals.css          # Modals, autocomplete, toasts, diff UI
│
└── js/
    ├── constants.js        # Templates, snippets, symbols, toolbar groups
    ├── state.js            # Application state
    ├── storage.js          # LocalStorage persistence
    ├── highlighter.js      # LaTeX syntax tokenizer
    ├── linter.js           # Issue detection
    ├── autocomplete.js     # Completion engine
    ├── editor.js           # Editor and multi-cursor functionality
    ├── converter.js        # Conversion, statistics, diff, BibTeX
    ├── exporter.js         # Export and ZIP generation
    ├── toolbar.js          # Toolbar controls
    ├── sidebar.js          # Sidebar panels
    ├── preview.js          # Live preview and KaTeX
    ├── stats.js            # Document statistics
    ├── modals.js           # Modal interfaces
    ├── ui.js               # UI utilities and status controls
    └── app.js              # Application entry point

Architecture

                         ┌─────────────────────┐
                         │     index.html      │
                         │  Application Shell  │
                         └──────────┬──────────┘
                                    │
                         ┌──────────▼──────────┐
                         │       app.js        │
                         │ Application Boot &  │
                         │      Wiring         │
                         └──────────┬──────────┘
                                    │
               ┌────────────────────┼────────────────────┐
               │                    │                    │
        ┌──────▼──────┐      ┌──────▼──────┐      ┌──────▼──────┐
        │   state.js  │      │ Application │      │  storage.js │
        │    State    │      │    Events   │      │ Persistence  │
        └──────┬──────┘      └─────────────┘      └─────────────┘
               │
     ┌─────────┼──────────┬──────────┬──────────┬──────────┐
     ▼         ▼          ▼          ▼          ▼          ▼
  ┌──────┐ ┌──────┐  ┌────────┐ ┌────────┐ ┌─────────┐ ┌───────┐
  │Editor│ │  UI  │  │Toolbar │ │Sidebar │ │ Preview │ │ Stats │
  └──┬───┘ └──────┘  └────────┘ └────────┘ └────┬────┘ └───────┘
     │                                           │
     ▼                                           ▼
┌───────────────┐                        ┌────────────────┐
│ Highlighter   │                        │   Converter    │
│ Linter        │                        │ LaTeX → HTML   │
│ Autocomplete  │                        │ Diff / Stats   │
└───────────────┘                        │ BibTeX         │
                                         └────────────────┘

Architectural Principles

LatexCraft is organized around modular responsibilities.

State

state.js acts as the central application state layer.

Persistence

storage.js handles browser-based persistence.

Editor

Editor-specific behavior is isolated inside the editor modules.

Preview

Preview rendering and mathematical typesetting are handled independently from the editor.

Conversion

Conversion and analysis functionality is grouped into reusable processing modules.

Export

Export functionality is separated from the editor and preview systems.

UI

Interface components, dialogs, toolbars, sidebars, notifications, and application controls remain organized into dedicated modules.


Keyboard Shortcuts

Editor

Shortcut Action
Ctrl+B Bold
Ctrl+I Italic
Ctrl+U Underline
Ctrl+/ Toggle comment
Ctrl+D Duplicate line
Ctrl+L Select line
Ctrl+Z Undo
Ctrl+Y Redo
Tab Indent block
Shift+Tab Outdent block
Enter Smart newline
Alt+Click Add cursor
Esc Clear extra cursors
{ [ ( $ Auto-close pairs

File & Search

Shortcut Action
Ctrl+S Save
Ctrl+Shift+S Snapshot
Ctrl+F Find
Ctrl+H Find & Replace
F3 / Shift+F3 Next / Previous result
Ctrl+P Command palette
Ctrl+Shift+E Export
Ctrl+Shift+D Statistics
F11 / Shift+F Focus mode

Autocomplete

Shortcut Action
Ctrl+Space Trigger autocomplete
↑ / ↓ Navigate suggestions
Enter / Tab Accept suggestion
Esc Dismiss

Preview

Shortcut Action
Ctrl+= Zoom in
Ctrl+- Zoom out
Ctrl+0 Reset zoom

Press ? inside the application to open the shortcut reference.


Tech Stack

┌────────────────────────────────────────────────────────────┐
│                       LATEXCRAFT                           │
├────────────────────────────────────────────────────────────┤
│                                                            │
│  HTML5                                                     │
│  CSS3                                                      │
│  JavaScript ES Modules                                     │
│  Native Browser APIs                                       │
│                                                            │
│  React 18         → Minimal application support            │
│  KaTeX 0.16       → Mathematical typesetting              │
│  JSZip 3.10       → ZIP / Overleaf project generation      │
│  FileSaver.js 2.0 → Client-side file downloads             │
│                                                            │
└────────────────────────────────────────────────────────────┘

Core Technologies

  • HTML5
  • CSS3
  • JavaScript ES Modules
  • Native Browser APIs
  • React 18
  • KaTeX 0.16
  • JSZip 3.10
  • FileSaver.js 2.0
  • LocalStorage

Application Characteristics

LatexCraft is intentionally designed around a lightweight browser architecture.

No Build Pipeline

The application does not depend on a traditional bundler or compilation workflow.

No Package Installation

There is no requirement for:

node_modules/
package.json
npm install

Client-Side Processing

Core editing, previewing, analysis, and export functionality is performed in the browser.

Local Persistence

Application state can be persisted using browser localStorage.

CDN Dependencies

Selected libraries are loaded through CDN resources.


Browser Compatibility

LatexCraft is designed for modern browsers supporting:

  • JavaScript ES Modules
  • Modern JavaScript APIs
  • LocalStorage
  • File APIs
  • Clipboard APIs
  • Drag-and-drop APIs
  • Modern CSS features

Recommended browsers include current versions of:

  • Google Chrome
  • Microsoft Edge
  • Mozilla Firefox
  • Safari

Privacy

LatexCraft is primarily a client-side application.

Documents and application state may be stored locally within the browser through localStorage.

The core application does not require a traditional application backend for its primary editing workflow.

External CDN resources are used for selected third-party libraries.

Users should avoid storing sensitive information in browser-based applications when their organization's privacy or security requirements prohibit local browser storage or external CDN dependencies.


Development Guidelines

The modular structure makes individual features easier to maintain.

Area Primary Module
Syntax highlighting js/highlighter.js
Linting js/linter.js
Autocomplete js/autocomplete.js
Editor js/editor.js
Preview js/preview.js
Conversion js/converter.js
Export js/exporter.js
Toolbar js/toolbar.js
Sidebar js/sidebar.js
Statistics js/stats.js
Modals js/modals.js
UI js/ui.js
Application boot js/app.js
Themes css/themes.css

When extending LatexCraft:

  1. Keep functionality inside the appropriate module.
  2. Avoid unnecessary dependencies between modules.
  3. Preserve existing editor behavior.
  4. Test preview rendering after editor changes.
  5. Verify export functionality after conversion changes.
  6. Update documentation when introducing major features.

Project Highlights

┌───────────────────────────────────────────────────────────┐
│                        LATEXCRAFT                         │
├───────────────────────────────────────────────────────────┤
│                                                           │
│  ✓ Professional LaTeX Editor                             │
│  ✓ Live Mathematical Preview                             │
│  ✓ Syntax Highlighting                                   │
│  ✓ Intelligent Autocomplete                              │
│  ✓ Inline Linting                                        │
│  ✓ Multi-Cursor Editing                                  │
│  ✓ Find & Replace                                        │
│  ✓ Local Auto-Save                                       │
│  ✓ Document Statistics                                   │
│  ✓ Readability Analysis                                  │
│  ✓ Word Goal Tracking                                    │
│  ✓ Snapshot & Diff Viewer                                │
│  ✓ Bibliography Manager                                  │
│  ✓ Five Visual Themes                                    │
│  ✓ Focus Mode                                            │
│  ✓ Typewriter Mode                                       │
│  ✓ Multiple Export Formats                               │
│  ✓ Overleaf ZIP Generation                               │
│  ✓ PDF Export                                             │
│  ✓ Browser-Based Architecture                            │
│                                                           │
└───────────────────────────────────────────────────────────┘

License

LatexCraft is distributed under the MIT License.

See the LICENSE file for the complete license terms.


Author

Rachit Tyagi

Software Developer · Computer Science & Engineering

GitHub



LatexCraft

A modern browser-based LaTeX writing environment.


Built with HTML, CSS, JavaScript, KaTeX, and modern browser APIs.


© 2026 Rachit Tyagi · LatexCraft

About

A modern browser-based LaTeX editor with live preview, intelligent editing, document analytics, and multi-format export.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages