Offline TeX Editor

A LaTeX editor that runs on your own machine and opens in your browser: edit, recompile with latexmk, and preview the PDF side by side or in its own tab, with SyncTeX in both directions.

Fully offline: no accounts, no cloud, no internet connection needed. It runs as a small server on your computer, and goes online only when you sync with GitHub or share the project with your team through a WebDAV folder.

pip install offline-tex-editor

Published on PyPI: pypi.org/project/offline-tex-editor. Source code on GitHub: github.com/offline-tex-editor/offline-tex-editor (run it from a clone).

The editor with LaTeX source on the left and the compiled PDF on the right
Figure 1: The editor with LaTeX source on the left and the compiled PDF on the right

Highlights

Install

You need Python 3.9 or newer and a TeX distribution (see Requirements). Install the editor with pip, or run it straight from its source code.

With pip

pip install offline-tex-editor

Or install it with pipx, which keeps it apart from your other Python packages:

pipx install offline-tex-editor

To update later, run pip install --upgrade offline-tex-editor (or pipx upgrade offline-tex-editor).

From the source code

Clone the repository and start the editor from the clone. Nothing else needs to be installed:

git clone https://github.com/offline-tex-editor/offline-tex-editor.git
cd offline-tex-editor
./start.sh --root path/to/your/project --open

On Windows, run .\start.cmd instead of ./start.sh. Both take the same options as the offline-tex-editor command. To update later, run git pull in the clone. To get the offline-tex-editor command from the clone instead, run pip install . in it.

Run

Start it on your LaTeX project's folder:

offline-tex-editor --root path/to/your/project --open

(From a clone of the source code, run ./start.sh, or .\start.cmd on Windows, with the same options.)

--open opens the editor in your browser. Without it, open the address it prints, usually http://127.0.0.1:8765/. Stop the editor with Ctrl+C in the terminal.

Started without --root, it uses the current folder. If the shell says the offline-tex-editor command is not found, pip put it in a folder that is not on your PATH (pip prints a warning naming that folder). Run python -m offline_tex_editor instead, or install with pipx.

Requirements

Developed and tested on Linux. It is expected to work on macOS; on Windows it has not yet been tried with a real TeX installation, so reports are welcome.

Features

Writing

Grammar and spelling (optional)

The project

Compiling

The PDF

Git and GitHub

Teams: WebDAV (Nextcloud, ownCloud)

What's new

0.4.0 (2026-12-01)

0.3.2 (2026-11-23)

0.3.1 (2026-11-22)

0.3.0 (2026-11-22)

0.2.3 (2026-11-19)

0.2.2 (2026-11-19)

0.2.1 (2026-11-19)

0.2.0 (2026-11-19)

Options

OptionDefaultMeaning
--root DIRcurrent folderLaTeX project folder
--main FILEsee belowmain .tex file, relative to --root
--engine NAMEautopdflatex, xelatex or lualatex; see below
--jobname NAMEname of the main filePDF name in build/
--shell-escapeofflet the document run programs (minted before v3, svg, gnuplottex); only for projects you trust
--timeout N600stop a compile after N seconds
--port Nfirst free from 8765port; several projects can be open at once
--host ADDR127.0.0.1bind address; the default is reachable only from your machine
--openoffopen the editor in your browser
--no-initial-compileoffskip the compile at start-up
--grammaroffturn on the optional grammar checker, installed separately
--webdav URLget the project from this WebDAV folder first (or send it there), and stay connected to it
--webdav-user NAMEuser name for --webdav; the password is asked for, unless it is in ~/.netrc
--versionprint the version

The PDF and auxiliary files go to build/ in the project folder.

Main document and engine

Main document. --main if given; otherwise main.tex; otherwise the .tex file with \documentclass that looks most like a main file. A % !TEX root = ../thesis.tex comment in the chosen file is followed. To work on another document of the same project (slides, a cover letter), pick it in ⚙. LaTeX runs in the main document's folder, so a main document in a subfolder (such as paper/main.tex) finds the files next to it; the PDF still goes to build/ in the project folder.

Engine. In this order:

  1. --engine on the command line;
  2. a % !TEX program = xelatex (or lualatex, pdflatex) comment at the top of the main file, as used by TeXShop, TeXstudio and VS Code;
  3. $pdf_mode in the project's .latexmkrc or latexmkrc;
  4. otherwise pdfLaTeX.

⚙ shows which one is in effect and why.

Sharing a project over WebDAV

One person connects the project: in the WebDAV panel (the cloud icon on the left), enter the address of an empty folder on the server, your user name and your password, and press Sync to upload the project. Then share that folder with the team on the server. The address must start with https://. Nextcloud and ownCloud show the WebDAV address of your files in the Files app's settings (bottom left); it looks like https://cloud.example.org/remote.php/dav/files/USER/, and the folder's name goes at the end.

Each teammate then gets the project with the address of the shared folder in their own account:

offline-tex-editor --root thesis --webdav https://cloud.example.org/remote.php/dav/files/USER/Thesis/ --webdav-user USER --open

This creates the thesis folder, downloads the project into it, and opens the editor, connected to the server. After that, offline-tex-editor --root thesis is enough: the connection is remembered (in build/.editor-webdav/). Someone who already has a copy of the project can connect it in the WebDAV panel instead; the first sync compares the two, and keeps the server's version of any file that differs as a "(server copy)" next to theirs.

Grammar checker

The optional grammar checker, offline-grammar-checker, adds grammar and spelling suggestions to the editor. Like the editor, it runs on your machine: no account, no API key, and your text is not sent anywhere. It is installed separately, into the same Python environment as the editor:

pip install \
  git+https://github.com/offline-tex-editor/offline-grammar-checker.git
offline-tex-editor --grammar --root path/to/your/project --open

With pipx, add it to the editor's environment with pipx inject offline-tex-editor git+https://github.com/offline-tex-editor/offline-grammar-checker.git. From a clone of the editor, clone the checker into the same parent folder and run ./start.sh --grammar (or .\start.cmd --grammar); nothing needs to be installed. Without --grammar, the editor runs on its own.

Open Grammar with the A with a checkmark icon on the left. Check now checks the open file, unsaved edits included; Check project checks the project's .tex files. Click a suggestion to select its text, then apply its fix (Ctrl/Cmd+Z undoes it) or ignore the rule for this project. Files with suggestions get the same icon in the file tree. Add to dictionary accepts a word throughout the project (saved in this browser); choose English (US) or English (UK) for spelling.

The Grammar panel listing four suggestions for the introduction, each underlined in the source
Figure 2: The Grammar panel listing four suggestions for the introduction, each underlined in the source

Out of the box it uses 14 built-in grammar rules and no spelling dictionary. For spelling and much broader grammar checks, install Java and run python -m offline_grammar_checker.setup once: it downloads LanguageTool 6.6 (about 240 MiB, checked against a SHA-256 sum) into your cache folder. The editor then starts it at the first check, on 127.0.0.1 only, and stops it on exit; the panel shows which engine is in use. Integrating Offline Grammar Checker covers the setup with pipx, Windows, updating, and troubleshooting.

View options

Use the View selector above the document to choose:

Switching views keeps unsaved edits, the source cursor, and scroll positions. Your browser remembers the view mode and the selected tab. Sync → PDF, PDF search, zoom, and page navigation reveal the PDF tab; opening a source file, double-clicking the PDF, or showing an edit conflict reveals the Editor tab.

Separate view: the PDF tab uses the whole width, with the Editor tab next to it at the top right
Figure 3: Separate view: the PDF tab uses the whole width, with the Editor tab next to it at the top right

Keyboard shortcuts

KeysAction
Ctrl/Cmd+SSave (and recompile, if auto-compile is on)
Ctrl/Cmd+EnterRecompile
Ctrl/Cmd+JShow the cursor position in the PDF
Double-click the PDFJump to the source
Ctrl+SpaceComplete a command, label or citation key
Ctrl/Cmd+/Comment or uncomment lines
Ctrl/Cmd+B, Ctrl/Cmd+IPut the selection in \textbf{} or \textit{}, or take it out again
Ctrl/Cmd+FFind in the file (in the editor) or in the PDF (elsewhere)
Ctrl+H, Cmd+Option+FFind and replace in the file
Enter, Shift+EnterNext and previous match (also F3 and Ctrl/Cmd+G)
Ctrl/Cmd+Shift+FSearch and replace in all files

Security

The editor is meant for one person on their own machine. It has no login, so:

To report a security problem privately, see Contact.

Contributing

The source code is on GitHub. Bug fixes and improvements are welcome as pull requests; for a larger change, please open an issue first so that we can agree on the approach. CONTRIBUTING.md explains how to run the editor from a clone, run the tests, and the few rules the code follows.

License

MIT License; see LICENSE (the full text also comes with the package). Offline TeX Editor includes CodeMirror 5 (MIT) and pdf.js (Apache-2.0), which keep their own licenses.

TeX is a trademark of the American Mathematical Society.

Contact

For ideas, bug reports and questions, use the suggestion box below, or look through the issue tracker to see whether someone has asked already.

To report a security problem, use private vulnerability reporting instead, so it stays private until it is fixed.

Offline TeX Editor is made by KSMubasshir. Its source code is on GitHub, and pull requests are welcome.

Suggestion box

Ideas, bug reports and questions are all welcome. Sending opens a pre-filled issue on GitHub, where you can check it before you post it. You need a GitHub account.

What would you like to send?