A web application that converts LaTeX formulas from images to Typst format. The application uses SimpleTex API for OCR and offers two conversion methods: Pandoc and tex2typst.

latex-to-typst/
├── .env # Environment variables
├── package.json # Node.js dependencies
├── server.js # Main server file
├── public/ # Frontend files
│ ├── index.html
│ ├── style.css
│ └── script.js
└── pandoc-service/ # Pandoc conversion service
├── main.py # FastAPI application
├── requirements.txt # Python dependencies
├── Dockerfile # Docker configuration
└── run.sh # Local run script
- Node.js (v14 or higher)
- Python 3.9 or higher
- Pandoc (installed via the pandoc-service)
- SimpleTex API token
-
Install Node.js dependencies:
cd latex_to_typst npm install -
Create a
.envfile in the root directory:SIMPLETEX_API_TOKEN=your_simpletex_token_here -
Start the frontend server:
npm start
The server will run at http://localhost:3000
-
Install Python dependencies:
cd pandoc-service pip install -r requirements.txt -
Start the Pandoc service:
sh run.sh
The service will run at http://localhost:7999
- Open http://localhost:3000 in your browser
- Upload an image containing a LaTeX formula
- Choose your preferred conversion method (Pandoc or tex2typst)
- Click "Convert" to get the Typst output
- The frontend is configured for deployment on Vercel
- Set the
PANDOC_SERVICE_URLenvironment variable in Vercel to point to your deployed Pandoc service
- The service can be deployed to any platform that supports Docker
- Example platforms: Render, Fly.io, Heroku, Google Cloud Run
- Make sure to set the correct CORS settings if needed
ISC