// readme

WasmTex

An embeddable LaTeX SDK with a headless compiler, optional Monaco editor and PDF preview, and editor-neutral language services. The headless compiler runs pdfLaTeX, XeLaTeX and LuaLaTeX in browser workers or on Node. The built-in WasmTex component provides a pdfLaTeX editor and PDF.js preview. TeX Live packages load on demand; engine assets are hosted separately.

Live Demo

Quick Start

Install from GitHub with Node 24+. The package includes a committed lib/ bundle; package managers may also run its prepare build. Pin a commit instead of #main for reproducible installs.

npm install github:corca-ai/wasmtex#main

Download and serve the engine assets under /wasmtex/2025/, then compile in your browser app:

import { WasmTexCompiler } from 'wasmtex/headless'

const compiler = new WasmTexCompiler({
  assetBaseUrl: '/',
  files: {
    'main.tex': String.raw`\documentclass{article}\begin{document}Hello!\end{document}`,
  },
})
try {
  await compiler.init()
  const result =โ€ฆ