latexindent.pl is a highly configurable command-line formatter for LaTeX source. It can tidy indentation, align content, reshape line breaks, and perform controlled substitutions, with detailed YAML settings for adapting the result to an established document style.
This is free and open source software.
Key Features
- Adds and adjusts indentation inside environments, commands, headings, items, and other recognised LaTeX code blocks.
- Works with
.tex,.sty, and.clssources and supports nested document structures. - Aligns delimiters such as ampersands in environments and commands, with controls for spacing, line breaks, and column layout.
- Can modify line breaks, wrap text, and arrange prose using a one-sentence-per-line style.
- Supports literal string replacements and regular-expression substitutions as a separate, configurable processing stage.
- Uses YAML configuration, allowing users to layer default, user, project, and explicitly selected local settings.
- Provides fine-grained rules for indentation, additional indentation, verbatim content, special blocks, headings, commands, and environments.
- Can write changes back to the source, send formatted text to another file, or be used in workflows that inspect output before replacement.
- Integrates with the pre-commit framework so projects can apply or verify formatting before changes are committed.
- Is distributed through TeX Live and CTAN, with Conda and Docker alternatives for reproducible installation.
- Provides standalone Linux executables for x86-64 and ARM64 users who do not want to install Perl and its module dependencies.
- Ships a large test suite and comprehensive PDF and online documentation, including a quick-start section and worked configurations.
- Encourages safe adoption by supporting separate output files, making it easy to review changes visually or compare them with
latexdiff.
Website: github.com/cmhughes/latexindent.pl
Support:
Developer: Chris Hughes
License: GNU General Public License v3.0
latexindent.pl is written in Perl. Learn Perl 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.