Complete product and maintainer reference

Everything needed to use, run, build, deploy, and maintain LatexDo.

LatexDo is a LaTeX writing system made of a desktop editor, a local browser editor launched by a CLI, a public marketing and downloads site, and a Cloudflare-hosted editor backend. These docs explain the boundaries between those pieces and the workflows that keep them in sync.

System Overview

LatexDo at a glance

The core product lives in the latexdo repository. It contains the Electron desktop shell, the shared React and Monaco editor frontend, local file/project operations, LaTeX compilation through latexmk, PDF preview, diagnostics, Git tools, importers, and the source for the CLI and website assets that are synced downstream.

latexdo Main app, shared frontend, Electron APIs, CLI source, website source, tests, packaging, release automation.
latexdo.org Published static website, direct downloads, install script, update metadata, privacy and legal pages.
editor.latexdo.org Cloudflare Worker, static hosted editor frontend, Container backend, cloud project API, compile API, sharing API.
latexdo.org/docs This documentation. It explains the product, development process, operations, and API surface. It is served by the website, next to the blog at latexdo.org/blogpost and the extension store at latexdo.org/store.

Source of truth rule: product behavior starts in latexdo. Published site/download files and hosted editor frontend builds are downstream artifacts unless a repository-specific backend or deployment file owns the behavior.

Quickstart

Install or open the editor

Hosted web editor

Open editor.latexdo.org to create a cloud project in the browser. The hosted editor stores projects by browser session and uses the cloud API for files, sharing, compilation, and PDF retrieval.

Open hosted editor

Local browser editor

Install the latexdo command. It clones the app source into ~/.latexdo/app, installs npm dependencies, starts Vite on localhost, and opens a browser.

Read CLI docs

Desktop app

Use the desktop app when you need local folders, latexmk, PDF preview, SyncTeX, terminal access, Git tools, DOCX import, or Markdown import.

Downloads

Install the CLI
curl -fsSL https://latexdo.org/install.sh | bash
  latexdo doctor
  latexdo

Requirements

  • Node.js 20 or newer for development and the CLI-managed local editor.
  • Git and npm for the CLI cache/update flow.
  • A TeX distribution with latexmk for local desktop PDF compilation.
  • MacTeX on macOS, MiKTeX or TeX Live on Windows, TeX Live on Linux.

Product Matrix

Choose the right LatexDo surface

Capability Desktop app Local browser editor Hosted editor
Project storage Local folders selected through Electron dialogs. localStorage browser workspace. Container filesystem under LATEXDO_DATA_ROOT, keyed by browser session.
LaTeX compilation latexmk with pdflatex, xelatex, or lualatex. Not available. Shows a desktop-required diagnostic. Cloud backend runs latexmk with no shell escape.
PDF preview Available from local build output with PDF.js and SyncTeX. No generated PDF. Available after cloud compilation through the PDF API.
Terminal Real project shell through node-pty with a pipe fallback. Placeholder only. Disabled.
Git Status, stage, unstage, commit, diff, discard, history. Disabled with explanatory fallbacks. Disabled until auth and storage are hardened.
DOCX and Markdown import Available through local import handlers. Disabled. Backend route exists, but the current cloud frontend adapter marks import disabled.
Collaboration links Not available. Desktop tells users to use the hosted editor. Not available. Available through share tokens and presence heartbeats.

User Guide

Writing workflow

LatexDo is organized around a source-to-preview workflow. Open or create a project, edit .tex and .bib files in Monaco, choose the root .tex file and engine, compile, inspect diagnostics, then use the PDF preview and side panels to resolve paper-level issues.

1. Open Create a starter project or open an existing folder.
2. Edit Use Monaco with LaTeX completions, labels, citations, and file tabs.
3. Compile Run latexmk, read compiler output, and jump to diagnostics.
4. Review Use citation, structure, notation, PDF, and rebuttal panels.
5. Ship Export or use the generated PDF and project files.

Editor and paper tools

LaTeX intelligence

The editor builds an index from project .tex and .bib files for completions, labels, bibliography entries, citation commands, and project-aware analysis.

Labels BibTeX Completions

Diagnostics

Compiler diagnostics are parsed from latexmk output and enriched with source context. Additional checks inspect structure, citations, conference rules, reproducibility, acronyms, notation, and PDF compliance.

Error Doctor PDF compliance Conference checks

Review and rebuttal

Reviewer mode can create anchored review threads. Rebuttal mode tracks reviewer comments, author answers, manuscript changes, and can generate a rebuttal letter from tracked items.

Creation helpers

LatexDo includes a TikZ canvas, table-to-TikZ generation, equation and notation helpers, citation stubs, project search, history snapshots, and import helpers.

Default analysis checks

Tool What it checks
Conference checker Margins, font size, abstract length, keywords, figure/table references, bibliography style, page limit, author information, anonymous review, image resolution, embedded fonts, compiler suitability.
Citation assistant Missing citations, unused BibTeX entries, duplicate references, broken links, citation key suggestions, metadata gaps, old citations.
Structure assistant Abstract shape, introduction structure, related-work length, reproducibility in methods, results discussion, conclusion claims.
Reproducibility Code links, dataset links, license mentions, hyperparameters, hardware details, random seeds, evaluation metrics.
PDF compliance Page count, unreferenced figures, uncited citations, citation-free sections, Type 3 fonts, abstract word count.

Desktop App

Native local editing and compilation

The desktop app is an Electron shell around the shared React frontend. It exposes a secure preload API at window.latexdo and a terminal API at window.terminalApi. The renderer never reaches directly into Node APIs; project operations go through IPC handlers in electron/main.ts.

Local compile behavior

electron/compiler.ts searches for latexmk, preferring common macOS paths such as /Library/TeX/texbin/latexmk. It creates an isolated build directory under .latexdo/build/job-<uuid>, runs latexmk, enables SyncTeX, uses -file-line-error and -halt-on-error, then returns a CompileResult.

Desktop compile command shape
latexmk -pdf|-xelatex|-lualatex \
    -g \
    -synctex=1 \
    -interaction=nonstopmode \
    -file-line-error \
    -halt-on-error \
    -outdir=.latexdo/build/job-<uuid> \
    main.tex

Desktop-only capabilities

  • Open local folders and read/write real files.
  • Run latexmk with local TeX packages and fonts.
  • Read generated PDFs and use SyncTeX forward/backward jumps.
  • Use a real terminal in the project directory.
  • Inspect Git status, stage/unstage, commit, diff, discard, and history.
  • Import DOCX and Markdown through desktop import handlers.
  • Use local spellchecking and optional LanguageTool-compatible proofreading.

Desktop build commands

Develop and package
npm install
  npm run dev
  npm run typecheck
  npm test
  npm run build
  npm run package
  npm run dist

Web Editor

Browser, local, and cloud runtime modes

The shared frontend installs browser APIs when Electron does not provide window.latexdo. The runtime is selected by VITE_LATEXDO_RUNTIME. Without the cloud flag, the editor uses a browser workspace stored in localStorage. With cloud, it uses HTTP APIs served by editor.latexdo.org.

Browser runtime

Stores projects in latexdo.browser.workspace.v1 inside localStorage. It supports basic file and folder operations but cannot compile, run a shell, use Git, or import documents.

Cloud runtime

Stores session, client, and share token IDs in localStorage. It sends x-latexdo-session, x-latexdo-client, and x-latexdo-client-name headers to the backend.

Cloudflare hosting

The editor.latexdo.org repository deploys a Cloudflare Worker named editor-latexdo-org. Static assets come from dist/, and all /api/* requests are proxied to a Cloudflare Container running the Fastify backend. The Container image is built from Dockerfile and includes Node 22, latexmk, Pandoc, and TeX Live packages.

Browser Loads hosted React/Monaco frontend.
Worker Serves assets and routes /api/*.
Container Runs Fastify, Pandoc, latexmk, and TeX Live.
Session data Stores projects under LATEXDO_DATA_ROOT.
PDF output Returns compile logs, diagnostics, and PDFs.

The current cloud backend has import routes for DOCX and Markdown, but the current cloud frontend adapter intentionally reports those features as unavailable. Treat them as backend-ready but not exposed in the hosted UI.

Command Line

The latexdo CLI

The CLI installs one shell command. Running latexdo keeps a cached checkout of https://github.com/latexdo/latexdo.git in ~/.latexdo/app, updates it unless disabled, installs npm dependencies when package-lock.json changes, starts Vite, and opens the localhost URL.

Command Purpose
latexdo or latexdo open Start the local browser editor and open it.
latexdo update Fetch the configured branch and install dependencies.
latexdo doctor Print cache paths and check Git, Node, npm, curl, and latexmk.
latexdo path Print the cached app path.
latexdo reset Remove the cached app checkout and dependency state hash.

CLI environment variables

Variable Default Use
LATEXDO_HOME ~/.latexdo Base cache directory.
LATEXDO_APP_DIR $LATEXDO_HOME/app Checkout location for the app source.
LATEXDO_APP_REPO https://github.com/latexdo/latexdo.git Source repository to clone and update.
LATEXDO_APP_BRANCH main Branch to check out and reset to.
LATEXDO_HOST 127.0.0.1 Local Vite bind host.
LATEXDO_PORT 5173 Preferred local port. The CLI scans upward if busy.
LATEXDO_NO_OPEN 0 Set to 1 to print the URL without opening a browser.
LATEXDO_SKIP_UPDATE 0 Set to 1 to use the cached checkout as-is.

Website

latexdo.org and downloads

The website repository is the published static site. The source version also lives under latexdo/website. The main app sync script builds the TypeScript website, copies the CLI install script and command into the website, formats the generated assets, and rsyncs the result to the website repository.

Website responsibilities

  • Marketing and product explanation at latexdo.org.
  • Hosted installer script at https://latexdo.org/install.sh.
  • CLI binary script at https://latexdo.org/bin/latexdo.
  • Direct downloads under /downloads/.
  • Download manifest at /downloads/manifest.json.
  • Checksums at /downloads/SHA256SUMS.txt.
  • Update feed at /updates/latest.json.

Download manifest shape

Manifest fields
{
    "schemaVersion": 1,
    "product": "LatexDo",
    "version": "0.1.0",
    "publishedAt": "ISO timestamp",
    "commit": "git sha",
    "repository": "latexdo/latexdo",
    "downloadsPage": "https://latexdo.org/downloads/",
    "files": [
      {
        "id": "macos-arm64",
        "platform": "macos",
        "arch": "arm64",
        "filename": "LatexDo-macos-arm64.dmg",
        "sha256": "..."
      }
    ]
  }

The currently checked-in published website manifest has empty files and null version fields. That is expected before release artifacts are published by the release workflow.

Architecture

How the repositories fit together

latexdo is the active development repository. It can run as an Electron desktop application or as a Vite web application. The hosted editor is a cloud deployment of the same frontend built with VITE_LATEXDO_RUNTIME=cloud, paired with a backend in editor.latexdo.org.

Path Owner Purpose
src/ latexdo React app, Monaco editor, panels, checks, runtime adapters, tests.
electron/ latexdo Electron main process, preload bridge, compiler, terminal, imports, SyncTeX.
cli/ latexdo Source for the published latexdo command and installer.
website/ latexdo Source for the published marketing/downloads website.
server/src/index.ts editor.latexdo.org Fastify backend for cloud projects, files, imports, sharing, compile, PDF.
src/worker.ts editor.latexdo.org Cloudflare Worker entry point that serves assets and proxies /api/*.
dist/ editor.latexdo.org Committed hosted editor frontend assets built from latexdo.

Data boundaries

Desktop project ID
References a local folder selected through Electron. File access stays on the machine.
Browser project ID
References a project object in localStorage; suitable for draft editing, not durable storage.
Cloud project ID
References backend files under a session directory. Share tokens can grant another browser access to the same project.

Cloud API

Hosted editor backend reference

Cloud API requests are JSON unless the PDF route returns application/pdf. Most routes require the x-latexdo-session header. Collaboration-aware project routes can also accept x-latexdo-share-token.

Method Route Purpose
GET /api/health Returns { "ok": true }.
POST /api/projects/open Open the current session project or create one.
POST /api/projects Create a project. Optional body: { "folderName": "Paper" }.
GET /api/projects/:projectId/files Return the project file tree.
GET /api/projects/:projectId/files/content?path=main.tex Read a text file.
PUT /api/projects/:projectId/files/content?path=main.tex Write a text file with { "content": "..." }.
PUT /api/projects/:projectId/files/blob?path=figure.png Write binary content with { "contentBase64": "..." }.
GET /api/projects/:projectId/files/exists?path=main.tex Return whether a path exists.
POST /api/projects/:projectId/files Create a file or directory with { "relativePath": "...", "type": "file" }.
POST /api/projects/:projectId/files/move Move a file or directory.
POST /api/compile Compile a project root file with pdflatex, xelatex, or lualatex.
GET /api/projects/:projectId/pdf?path=main.pdf Return a generated PDF.
POST /api/import/:kind Backend DOCX or Markdown import through Pandoc. kind must be docx or markdown.
GET/POST /api/projects/:projectId/share Read or create a project share token.
POST /api/shares/:token/open Open a shared project from a token.
POST /api/shares/:token/presence Heartbeat collaborator presence and current file.

Compile request

POST /api/compile
{
    "projectId": "project-id",
    "rootFile": "main.tex",
    "engine": "pdflatex"
  }

Compile response

CompileResult
{
    "ok": true,
    "pdfPath": "main.pdf",
    "durationMs": 1240,
    "output": "latexmk output",
    "diagnostics": [],
    "error": null
  }

Development

Set up the repositories

Use Node.js 20 or newer for the app, website, and cloud backend. The app CI uses Node.js 22, so match that locally when debugging build or native-module issues.

Main app development
cd /Users/omar/Desktop/Github/latexdo
  npm install
  npm run dev
Run only the web editor
cd /Users/omar/Desktop/Github/latexdo
  npm run web
Cloud backend local development
cd /Users/omar/Desktop/Github/editor.latexdo.org
  npm install
  LATEXDO_DATA_ROOT=./storage/dev npm run server:dev

Quality commands

Repository Commands
latexdo npm run format:check, npm run lint, npm run typecheck, npm test, npm run test:coverage, npm run build.
latexdo.org npm run typecheck, npm run build, then ensure compiled assets/site.js is committed.
editor.latexdo.org npm run typecheck, npm run build, npm run dev, or npm run server:dev.
docs.latexdo.org npm run typecheck, npm run build, then open index.html.

Sync downstream repositories

Run npm run sync:downstream from the main app repository after changes to CLI, website source, or hosted frontend behavior. The script syncs ../latexdo-cli, ../latexdo.org, and ../editor.latexdo.org by default. Override target paths with LATEXDO_CLI_REPO, LATEXDO_WEBSITE_REPO, and LATEXDO_EDITOR_REPO.

Release And Deploy

Build, package, and publish LatexDo

The main app has two relevant workflows: latexdo-ci for validation and installer artifacts, and latexdo-release for publishing direct downloads to the website repository.

CI flow

  • Runs format, lint, typecheck, tests, coverage, and app build.
  • Packages an ad-hoc signed macOS Apple Silicon DMG.
  • Packages a Windows x64 NSIS installer.
  • Uploads latexdo-installers-<commit> with installers and checksums.

Release flow

  • Builds macOS Apple Silicon, macOS Intel, and Windows x64 artifacts.
  • Uses Developer ID signing and notarization if Apple secrets are present.
  • Falls back to ad-hoc signed macOS DMGs if signing secrets are missing.
  • Generates /downloads/manifest.json, /downloads/SHA256SUMS.txt, and /updates/latest.json.
  • Publishes to latexdo/latexdo.github.io when LATEXDO_WEBSITE_TOKEN is configured.

Required release secrets

Secret Purpose
LATEXDO_WEBSITE_TOKEN Write access to publish website downloads.
MACOS_CERTIFICATE_P12 Developer ID certificate as base64 or configured package link.
MACOS_CERTIFICATE_PASSWORD Password for the macOS signing certificate.
APPLE_API_KEY_P8 Base64-encoded Apple notarization .p8 content.
APPLE_API_KEY_ID, APPLE_API_ISSUER, APPLE_TEAM_ID Apple API and team metadata for notarization.

Cloud editor deploy

The current editor.latexdo.org repo is configured for Cloudflare Workers Builds. Build command: npm run build. Deploy command: npx wrangler deploy. If the build logs say Docker is unavailable, push a prebuilt image and update the container image in wrangler.jsonc.

Security

Trust boundaries and safeguards

LaTeX compilation can execute complex toolchains and consume large amounts of CPU, memory, and disk. Treat compile services as untrusted-input execution environments.

Desktop

The user runs compilation on their own machine against their own local TeX distribution. Electron renderer access is mediated through preload APIs and IPC handlers.

Cloud

The container runs as a non-root user and the cloud compile command injects -no-shell-escape into engine commands. Compile timeout is 45 seconds, and output buffer is capped at 10 MB.

Before a broad public cloud launch, add authentication, per-user quotas, rate limits, abuse monitoring, reviewed memory/disk limits, durable storage design, and a clear project retention policy.

Path safety

Backend project paths are normalized to relative paths, reject .., and are resolved under the project root before file operations. Project IDs and session/share tokens are constrained to safe character sets and lengths.

Troubleshooting

Common problems

latexmk was not found

Install a TeX distribution and restart the app. On macOS, MacTeX normally provides /Library/TeX/texbin/latexmk.

CLI starts on a different port

The CLI checks the preferred port and scans upward when busy. Set LATEXDO_PORT or pass --port to choose a different starting point.

Cloud deploy is unauthorized

Add CLOUDFLARE_ACCOUNT_ID and a deploy-capable CLOUDFLARE_API_TOKEN to the Cloudflare Worker build configuration.

Downloads page is empty

The checked-in manifest can be empty before release artifacts are published. Run the release workflow and ensure LATEXDO_WEBSITE_TOKEN is configured.

Hosted editor Git buttons do not work

Git is intentionally disabled in the hosted editor. Use the desktop app for repository operations.

Cloud compile times out

The backend compile timeout is 45 seconds. Reduce document complexity, remove expensive TikZ/pgfplots passes, or move the project to the desktop app for local compilation.

FAQ

Frequently asked questions

Which LatexDo surface should I use?

Use the desktop app when you need local folders, local latexmk, SyncTeX, Git, imports, or terminal access. Use the hosted editor for browser-first writing and collaboration links. Use the CLI when you want the local browser editor launched from one command.

Does LatexDo compile LaTeX in the browser?

The browser runtime can edit files stored in localStorage, but it cannot run a shell or compile locally. Compilation is available in the desktop app through the user machine's TeX distribution, and in the cloud runtime through the hosted backend.

What do I need installed for desktop compilation?

Install a TeX distribution that provides latexmk. On macOS, MacTeX normally exposes it at /Library/TeX/texbin/latexmk. Restart LatexDo after installing TeX so the app can detect the command.

Where does the CLI keep LatexDo?

The CLI stores its cached checkout under ~/.latexdo/app by default. Override the base path with LATEXDO_HOME, the app path with LATEXDO_APP_DIR, and the startup port with LATEXDO_PORT or --port.

Why are Git and import buttons disabled in the hosted editor?

Hosted Git operations are disabled until authentication and durable project storage are hardened. DOCX and Markdown import routes exist in the cloud backend, but the current cloud frontend intentionally reports imports as unavailable.

How are releases published to latexdo.org?

The release workflow builds platform installers, generates the downloads manifest, checksums, and update metadata, then publishes them to the website repository when LATEXDO_WEBSITE_TOKEN is configured.

How should maintainers keep these docs accurate?

Update the docs in the same branch as product, command, API, release, or deployment changes. Then run npm run build in the docs repository and verify the generated static site.

Maintenance

Keep docs accurate

Update these docs whenever a command, API route, runtime capability, release artifact, or deployment requirement changes. The safest maintenance pattern is to update docs in the same branch as the product change, then verify that all documented commands still match package.json, workflow files, and runtime adapters.

Documentation checklist

  • Check latexdo/package.json for command changes.
  • Check electron/preload.cts for desktop API changes.
  • Check src/browserApi.ts and src/cloudApi.ts for runtime boundaries.
  • Check editor.latexdo.org/server/src/index.ts for backend API changes.
  • Check editor.latexdo.org/wrangler.jsonc for deploy target changes.
  • Check latexdo/.github/workflows/*.yml for CI and release changes.
  • Check latexdo/scripts/sync-downstream-repos.sh for sync behavior.

This docs site is static, with browser behavior authored in TypeScript under src/site.ts. Run npm run build, then open index.html directly in a browser from the docs.latexdo.org repository.