A simple and elegant online Typst formula editor with real-time preview.
- π¨ Real-time Preview - See your Typst formulas rendered instantly
- π Monaco Editor - Professional code editing experience with syntax highlighting
- π€ Auto Complete - Intelligent Typst symbol and function suggestions
- π Theme Support - Light, dark, and system theme modes
- π€ Multiple Export Formats
- PNG (transparent background)
- JPG (white background)
- SVG (vector graphics)
- HTML
- Typst source code
- π Clipboard Support - Copy images and code directly to clipboard
- π Image to Typst (Experimental) - Recognize a tightly cropped printed formula locally in your browser
- π Share Links - Generate shareable URLs with encoded formulas
- πΎ Formula Library - Save and manage your formulas locally
- Auto-save draft for seamless workflow
- Save, load, rename, and delete formulas
- βοΈ Customizable Settings
- Adjustable font size
- Line numbers toggle
- PNG export scale (1x-4x)
- Dark mode preview options
- Node.js 20+
- npm or yarn
# Clone the repository
git clone https://github.com/dbccccccc/TypstPad.git
# Navigate to project directory
cd TypstPad
# Install dependencies
npm install# Start development server
npm run devVisit http://localhost:5173 to see the application.
# Build for production
npm run build
# Preview production build
npm run previewPull and run the latest stable version from GitHub Container Registry:
# Pull the latest image
docker pull ghcr.io/dbccccccc/typstpad:latest
# Run the container
docker run -d -p 8080:80 --name typstpad ghcr.io/dbccccccc/typstpad:latest
# Access the application
# Open http://localhost:8080 in your browser# Pull a specific version
docker pull ghcr.io/dbccccccc/typstpad:v1.0.0
# Run the container
docker run -d -p 8080:80 ghcr.io/dbccccccc/typstpad:v1.0.0# Build the image
docker build -t typstpad .
# Run the container
docker run -d -p 8080:80 --name typstpad typstpad
# Stop the container
docker stop typstpad
# Remove the container
docker rm typstpadCreate a docker-compose.yml file:
version: '3.8'
services:
typstpad:
image: ghcr.io/dbccccccc/typstpad:latest
ports:
- "8080:80"
restart: unless-stoppedThen run:
docker-compose up -d- The Docker image includes Nginx with required CORS headers for SharedArrayBuffer support
- Default port is 80 inside the container, map it to any host port you prefer
- Currently supports linux/amd64 platform
- Frontend Framework: React 18
- Language: TypeScript
- Build Tool: Vite
- Styling: Tailwind CSS
- Editor: Monaco Editor
- Syntax Highlighting: Shiki
- Typst Rendering: Typst 0.14.2 via @myriaddreamin/typst.ts 0.7
- UI Components: Radix UI
- Icons: Lucide React
typstpad/
βββ src/
β βββ components/
β β βββ Editor/ # Monaco editor component
β β βββ Preview/ # Typst preview component
β β βββ ExportPanel/ # Export and share functionality
β β βββ SettingsDialog/ # Settings configuration
β β βββ Header/ # Application header
β β βββ ErrorDisplay/ # Error message display
β β βββ ui/ # Reusable UI components
β βββ contexts/
β β βββ ThemeContext.tsx # Theme management
β βββ services/
β β βββ typst.ts # Typst compilation service
β βββ utils/
β β βββ export.ts # Export utilities
β β βββ share.ts # Share URL generation
β β βββ shikiSetup.ts # Syntax highlighting setup
β βββ grammars/
β β βββ typst.tmLanguage.json # Typst language grammar
β βββ App.tsx # Main application component
β βββ main.tsx # Application entry point
β βββ index.css # Global styles
βββ public/ # Static assets
βββ index.html # HTML template
βββ package.json # Dependencies and scripts
βββ tsconfig.json # TypeScript configuration
βββ vite.config.ts # Vite configuration
βββ tailwind.config.js # Tailwind CSS configuration
-
Enter your Typst formula in the editor:
$ sum_(i=1)^n i = (n(n+1))/2 $
-
See the rendered preview in real-time
-
Export or share:
- Click "Export Image" to download as PNG/JPG/SVG
- Click "Export Code" to copy/download the source code
- Click "Share" to generate a shareable URL
Select Image to Typst in the input panel, then choose, drop, or paste a PNG, JPEG, or WebP image containing one tightly cropped printed formula. Recognition runs locally in the browser; the image is not uploaded. Review every generated token before placing the draft in the editor.
The included Phase 10 IBEM model is experimental and is substantially less
accurate on long or displayed formulas. It is not intended for handwriting,
full-page segmentation, photographs, or arbitrary screenshots. See the bundled
model card and third-party notices under public/im2typst for qualification,
provenance, and license details.
Access settings by clicking the gear icon in the header.
- Standard Monaco editor shortcuts apply
- See Monaco Editor documentation for complete list
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Typst - The typesetting system
- typst.ts - Typst WebAssembly compiler
- IBEM - Mathematical-expression training dataset (CC BY 4.0)
- ONNX Runtime - Local browser model execution
- Monaco Editor - Code editor
- Shiki - Syntax highlighter
- Radix UI - UI components
- Tailwind CSS - CSS framework
- latexlive.com - Part of the design is inspired by this tool
- Formula library for saving and managing formulas
- Multi-language support
- More export format support
Made with β€οΈ using Typst