tex-fmt is a fast, opinionated command-line formatter for LaTeX source.
Written in safe Rust, it applies consistent indentation and line wrapping with little configuration, while retaining controls needed for automated checks and project-specific conventions.
This is free and open source software.
Key Features
- Formats LaTeX-related
.tex,.bib,.cls, and.styfiles. - Applies structured indentation to environments, lists, equations, and other common LaTeX constructs.
- Wraps long prose to a configurable target width, with separate minimum and maximum line-length settings.
- Can format table environments by aligning ampersands and inserting appropriate line breaks.
- Formats files in place, checks formatting without changing a file, or prints the proposed result to standard output.
- Reads from standard input, making it straightforward to use in editor integrations, pipes, and scripted workflows.
- Recursively discovers supported files and respects patterns in
.gitignoreand.ignore. - Uses TOML configuration at user, Git repository, or working-directory level; command-line arguments take precedence.
- Lets users configure indentation width, tabs or spaces, custom list and verbatim environments, non-indented environments, and wrapping characters.
- Supports line-level and block-level skip directives, and automatically leaves standard verbatim, listing, and minted environments untouched.
- Provides check and fail-on-change modes suited to pre-commit hooks and continuous integration pipelines.
- Generates shell completion scripts and a manual page directly from the command-line interface.
- Offers native Linux binaries for x86-64, AArch64, and ARMv7, plus an Alpine Linux build.
Website: github.com/WGUNDERWOOD/tex-fmt
Support:
Developer: William George Underwood
License: MIT License
tex-fmt is written in Rust. Learn Rust with our recommended free books and free tutorials.
Related Software
| LaTeX Tools | |
|---|---|
| LyX | The power and flexibility of TeX/LaTeX with an intuitive graphical interface |
| KBibTeX | Reference management software primarily for BibTeX |
| TeXstudio | Fully featured open source LaTeX editor |
| VimTeX | Vim and Neovim filetype and syntax plugin |
| TeXmacs | WYSIWYG mathematical text editor using TeX fonts |
| JabRef | Graphical frontend to manage BibTeX databases |
| Biber | BibTeX replacement for users of BibLaTeX |
| TeXmaker | Integrates many different tools |
| Tectonic | Modernised, self-contained TeX and LaTeX engine |
| TeXworks | Simple front-end modeled on TeXShop |
| Atom-LaTeX | Typesetting with GitHub's Atom text editor |
| SiSU | Documents - structuring, publishing in multiple formats and search |
| Kile | KDE Integrated LaTeX Environment |
| BibLaTex | Programmable bibliographies and citations |
| Enter TeX | Integrated LaTeX Environment for the GNOME desktop |
| AUCTeX | Environment for editing LaTeX, ConTeXt, docTeX, Texinfo, and TeX files |
| TexMaths | LaTeX equation editor for LibreOffice |
| Setzer | Full-featured LaTeX editor |
| Gummi | Simple LaTeX editor |
| TexLab | Cross-platform implementation of the Language Server Protocol for LaTeX |
| Pybliographer | Tool for managing bibliographic databases |
| LaTeXDraw | Graphical drawing editor for LaTeX |
| KLatexFormula | Useful utility for creating images from LaTeX equations |
| Hieroglyphic | Find LaTeX symbols |
| Hand TeX | Handwritten LaTeX symbol classifier |
Read our verdict in the software roundup.
Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk. You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more. Discovered a useful open source Linux program that we haven’t covered yet? Let us know by completing this form. |


Please read our Comment Policy before commenting.