← PhiTeX, the compiler

Get One line, one binary.

Linux and macOS, on x86-64 and ARM.

curl -fsSL https://phitex.org/install.sh | sh

Or the nightly build:

curl -fsSL https://phitex.org/install.sh | PHITEX_CHANNEL=nightly sh

Then, in your paper's folder:

phitex watch paper.tex
  • Updatephitex upgrade
  • PDF filephitex watch --write paper.tex
  • Removedelete ~/.local/bin/phitex
  • Windowscoming soon
  • No installtry it in your browser ↗ or use Overleaf

Your editor

Set it up where you write.

The same compiler and the same instant page in each. A project with several .tex files names its main one in phitex.toml: main = "paper.tex".

In Neovim, Emacs and other LSP editors, the diagnostics are TeX's errors, LaTeX's warnings (an undefined \ref or \cite, a font substituted) and every overfull and underfull box. The page's filter by kind reaches the editor soon.

Overleaf

Nothing to install: it runs in your browser

A browser extension adds a PDF | ⚡ Instant switch to Overleaf's PDF toolbar. Chrome, Edge, Brave and other Chromium browsers, and Firefox 142 or later.

  1. Add it to your browser:
  2. Open any project on overleaf.com and flip the PDF pane to ⚡ Instant (Alt+Shift+P).
  3. The first time, accept the short terms: it is unofficial and experimental.

PhiTeX for Overleaf, in full →

VS Code

VS Code 1.85+ · brings its own engine

PhiTeX ⚡ Instant (accl-kaust.phitex): a live page beside your editor, errors in the Problems panel, click-to-source both ways.

  1. Install it. The Marketplace and Open VSX listings are coming soon; until then, from a .vsix built from PhiTeX-frontends:
    code --install-extension phitex-1.0.2.vsix
  2. Open a .tex file and run PhiTeX: Open Preview from the Command Palette.
  3. Optional: with phitex installed, PhiTeX: Switch Engine runs phitex watch instead of the built-in engine.

Neovim

Neovim 0.11+ · needs phitex nightly 202611041513+

phitex.lua: the buffer is built as you type, TeX's errors are diagnostics, and the page follows your cursor.

  1. Add it with your plugin manager. With vim-plug, in init.vim:
    Plug 'accl-kaust/PhiTeX-frontends', { 'rtp': 'apps/editors/nvim' }
    With lazy.nvim:
    { "accl-kaust/PhiTeX-frontends",
      config = function(p) dofile(p.dir .. "/apps/editors/nvim/phitex.lua") end }
    With no plugin manager, as a Neovim package:
    git clone --depth 1 https://github.com/accl-kaust/PhiTeX-frontends ~/.local/share/phitex-frontends
    mkdir -p ~/.local/share/nvim/site/pack/phitex/start
    ln -s ~/.local/share/phitex-frontends/apps/editors/nvim ~/.local/share/nvim/site/pack/phitex/start/phitex
    Or just the one file, in your config:
    curl -fsSLo ~/.config/nvim/plugin/phitex.lua \
      https://raw.githubusercontent.com/accl-kaust/PhiTeX-frontends/main/apps/editors/nvim/phitex.lua
    Any other manager works the same way: add the repository with apps/editors/nvim on the runtimepath.
  2. Open a .tex file. <leader>lv opens the page; double-click it to jump back to the source.
  3. Optional, the build's state in your statusline:
    vim.o.statusline = "%f %m%=%{v:lua.PhitexStatus()} "
All options

The engine’s, in PhitexSettings

threadsone
The engine’s threads.
mainphitex.toml’s
The main file, from the project’s folder: "paper.tex". Without one, the .tex with a \documentclass.
follow"cursor"
When the page shows where you are: "cursor" as you move, "selection" only a visual selection’s, "dblclick" never.
files"texlive"
The engine reads TeX’s files from "texlive", your TeX installation, or "shelf", PhiTeX’s own, fetched as needed. The default is phitex config’s.

This Neovim’s own, in PhitexSettings

attach"auto"
Use a phitex watch already running, one started in a terminal: "auto" when there is one, "always", "never".
mark_selectiontrue
Text selected on the page is marked in its buffer (highlight PhitexSelection, linked to Visual) until the cursor moves.
dblclick_focustrue
A double-click on the page moves to the source’s window. false: shown there, the focus kept.
follow_delay30
Milliseconds after the cursor stops before its place is sent to the page.
viewer_key"<leader>lv"
The normal-mode key that opens the page. false: none.
command{ "phitex", "watch", "--lsp" }
How the watch is started.

The download (:PhiTeXInstall), in PhitexInstall

channel"stable"
Which releases: "stable", the latest release, or "nightly", rebuilt each night.
basenil
Where from. nil: the channel’s releases on GitHub.
keynil
The minisign key the download is checked against. nil: the channel’s.
prefix"~/.local"
The binary goes in its bin/.

In Vim, see Any LSP editor. Commands: :PhiTeXViewer, :PhiTeXRebuild, :PhiTeXSavePdf, :PhiTeXStop, :PhiTeXRestart. Settings in PhitexSettings, set before it loads, e.g. { threads = 4, follow = "selection" }. With no phitex on your PATH, it offers to download the latest release into ~/.local/bin (:PhiTeXInstall), checked against its minisign signature; it needs curl and minisign.

Emacs

Emacs 29+ · needs phitex nightly 202611041513+

phitex.el, a minor mode: it runs beside eglot or lsp-mode (or nothing), with diagnostics in flymake and the build's state in the mode line.

  1. Add it with use-package, Emacs 30's :vc:
    (use-package phitex
      :vc (:url "https://github.com/accl-kaust/PhiTeX-frontends"
           :lisp-dir "apps/editors/emacs" :rev :newest)
      :hook ((LaTeX-mode latex-mode) . phitex-mode)
      :custom (phitex-settings '(:follow "selection")))
    Or with straight.el (with straight as use-package's default, this one, not :vc):
    (use-package phitex
      :straight (phitex :type git :host github :repo "accl-kaust/PhiTeX-frontends"
                        :files ("apps/editors/emacs/*.el") :depth 1 :nonrecursive t)
      :hook ((LaTeX-mode latex-mode) . phitex-mode)
      :custom (phitex-settings '(:follow "selection")))
    Or download it:
    curl -fsSLo ~/.emacs.d/phitex.el \
      https://raw.githubusercontent.com/accl-kaust/PhiTeX-frontends/main/apps/editors/emacs/phitex.el
    and turn it on in TeX buffers, in your init file:
    (load "~/.emacs.d/phitex.el")
    (add-hook 'LaTeX-mode-hook #'phitex-mode)   ; and/or latex-mode-hook
  2. M-x phitex-open-viewer opens the page.
  3. Optional, when another program edits your files (a script, a coding agent, git pull): let the buffer follow the file on disk, so what you read is what is built:
    (global-auto-revert-mode 1)
    (setq auto-revert-verbose nil)
    A buffer with unsaved changes is never reverted.
All options

The engine’s, in phitex-settings (a plist)

:threadsone
The engine’s threads.
:mainphitex.toml’s
The main file, from the project’s folder: "paper.tex". Without one, the .tex with a \documentclass.
:follow"cursor"
When the page shows where you are: "cursor" as you move, "selection" only a region’s, "dblclick" never.
:files"texlive"
The engine reads TeX’s files from "texlive", your TeX installation, or "shelf", PhiTeX’s own, fetched as needed. The default is phitex config’s.

This Emacs’s own (setq, :custom, or M-x customize-group phitex)

phitex-attach'auto
Use a phitex watch already running, one started in a terminal: auto when there is one, always, never.
phitex-mark-selectiont
Text selected on the page is marked in its buffer (face phitex-selection) until the cursor moves.
phitex-dblclick-focust
A double-click on the page selects the source’s window. nil: shown there, the focus kept.
phitex-follow-delay0.03
Seconds Emacs is idle before the cursor’s place is sent to the page.
phitex-diagnostics-delay0.2
Seconds Emacs is idle before Flymake shows a build’s problems.
phitex-command("phitex" "watch" "--lsp")
How the watch is started.

The download (M-x phitex-install)

phitex-channel"stable"
Which releases: "stable", the latest release, or "nightly", rebuilt each night.
phitex-release-basenil
Where from. nil: the channel’s releases on GitHub.
phitex-release-keynil
The minisign key the download is checked against. nil: the channel’s.
phitex-install-prefix"~/.local"
The binary goes in its bin/.

With no phitex on your PATH, the mode offers to download the latest release into ~/.local/bin (M-x phitex-install), checked against its minisign signature; it needs curl and minisign.

Any LSP editor

Needs phitex

phitex watch --lsp is a language server: your buffers are built as you type, problems are published, and your cursor is shown on the page. Add it as a server for TeX files, beside any other. In Helix, for example (languages.toml):

[language-server.phitex]
command = "phitex"
args = ["watch", "--lsp"]

[[language]]
name = "latex"
language-servers = ["texlab", "phitex"]

In Vim, with vim-lsp (in your vimrc):

au User lsp_setup call lsp#register_server({
  \ 'name': 'phitex',
  \ 'cmd': {server_info->['phitex', 'watch', '--lsp']},
  \ 'allowlist': ['tex', 'plaintex'],
  \ })

A browser tab

Needs phitex

Beside any editor at all: the page lives in a tab and is rebuilt every time you save.

phitex watch paper.tex

It opens http://127.0.0.1 in your browser. Double-click the page to reach the source.

latexmk, scripts, CI

Needs phitex

One build does what latexmk does, BibTeX, biber and makeindex inside it.

phitex build paper.tex                 # the finished PDF, like latexmk -pdf
phitex --compat=pdflatex paper.tex     # one run, exactly as pdflatex

Under the name pdflatex, PhiTeX takes pdflatex's command line and makes one run, as pdflatex would.