Note: TeXpresso is still in an early development phase. Changes and bug fixes are happening frequently, check the CHANGELOG.md.
Important: this repository uses submodules. Clone using git clone --recurse-submodules
.
TeXpresso provides a "live rendering" experience when editing LaTeX documents in a supported editor: change something in the .tex file, the render window will update almost immediately with your change. Write something invalid, you get an error message immediately.
This can radically improve the LaTeX editing experience compared to the usual rebuild-and-wait-for-viewer-to-update experience, especially for large documents.
See the screencasts at the end of this file for a visual demo of TeXpresso capabilities.
TeXpresso has been tested on Linux and macOS and should work with both AMD64 and Apple Silicon architectures. See INSTALL.md for dependency and build instructions.
The TeXpresso system is built of the following parts:
-
A TeX engine that renders LaTeX documents into PDF; we use a modified version of the Tectonic engine, modified to interact with the TeXpresso driver.
This is in the tectonic/ git-submodule, and it produces the
texpresso-tonic
helper binary -
A PDF renderer that renders PDF documents into images. We use MuPDF.
-
A viewer that shows the rendered images and allows simple user commands (see Viewer controls below), built with libSDL.
-
A driver program that talks to the editor to be notified of changes to the LaTeX document, maintains an incremental view of the document and the rendering process (supporting incrementality, rollback, error recovery, etc.), talks to the LaTeX engine to re-render the modified portions of the document, and synchronizes with the viewer.
The driver is where the "live" magic lives. It is the
texpresso
binary, whose sources are in this repository.
The driver sends information between the editor and the renderer in both directions. In particular, it is possible to ask the editor to jump to a specific place in the LaTeX document by clicking on the viewer window or, conversely, to refresh the viewer window to display the document at the editor position.
Keyboard controls:
←
,→
: change page↑
,↓
: move within the pagep
(for "page"): switch between "fit-to-page" and "fit-to-width" zoom modesc
("crop"): crop bordersq
("quit"): quiti
("invert"): dark modeI
: toggle themingt
("top"): toggle stay-on-top (keeping TeXpresso above the editor window)b
("border"): toggle window bordersF5
: start fullscreen presentation (leave withESC
)
Mouse controls:
- click: select text in window (TODO: move Emacs buffer with SyncTeX)
- control+click: pan page
- wheel: scroll page
- control+wheel: zoom
TeXpresso comes with an Emacs mode. The source can be found in
emacs/texpresso.el. Load this file in Emacs (using M-X load-file
; it is also compatible with require
).
Start TeXpresso with M-x texpresso
. The prompt will let you select the master/root TeX file.
It will try to start the texpresso
command. If it is not possible, it will open
(customize-variable 'texpresso-binary)
to let you set the path to texpresso
binary (<where you cloned the repository>/build/texpresso
).
To work correctly, texpresso
needs texpresso-tonic
helper; when copying them, make sure they are both in the same directory.
M-x texpresso-display-output
will open a small window listing TeX warnings and errors on the current page.
Use M-x texpresso-next-page
and M-x texpresso-previous-page
to move between pages without leaving Emacs.
A Neovim mode is provided in a separate repository texpresso.vim. It is not yet compatible with vanilla Vim, patches are welcome 🙇.
A vscode mode is being developed in texpresso-vscode, thanks to @DominikPeters. Look for TeXpresso in the marketplace.
Neovim integration. Launching TeXpresso in vim:
txp-start.mp4
Live update during edition:
txp-edit.mp4
Using Quickfix window to fix errors and warnings interactively:
txp-quickfix.mp4
Synchronization from Document to Editor (SyncTeX backward):
synctex-backward.mp4
Synchronization from Editor to Document (SyncTeX forward):
synctex-forward.mp4
Theming, Light/Dark modes: 😎
txp-theme.mp4
Emacs integration. Here is a sample recording of me editing and browsing @fabiensanglard Game Engine Black Book: Doom in TeXpresso (using my emacs theme):