Typesetting Tools

latexindent.pl – highly configurable LaTeX formatter

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 .cls sources 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
LyXThe power and flexibility of TeX/LaTeX with an intuitive graphical interface
KBibTeXReference management software primarily for BibTeX
TeXstudioFully featured open source LaTeX editor
VimTeXVim and Neovim filetype and syntax plugin
TeXmacsWYSIWYG mathematical text editor using TeX fonts
JabRefGraphical frontend to manage BibTeX databases
BiberBibTeX replacement for users of BibLaTeX
TeXmakerIntegrates many different tools
TectonicModernised, self-contained TeX and LaTeX engine
TeXworksSimple front-end modeled on TeXShop
Atom-LaTeXTypesetting with GitHub's Atom text editor
SiSUDocuments - structuring, publishing in multiple formats and search
KileKDE Integrated LaTeX Environment
BibLaTexProgrammable bibliographies and citations
Enter TeXIntegrated LaTeX Environment for the GNOME desktop
AUCTeXEnvironment for editing LaTeX, ConTeXt, docTeX, Texinfo, and TeX files
TexMathsLaTeX equation editor for LibreOffice
SetzerFull-featured LaTeX editor
GummiSimple LaTeX editor
TexLabCross-platform implementation of the Language Server Protocol for LaTeX
PybliographerTool for managing bibliographic databases
LaTeXDrawGraphical drawing editor for LaTeX
KLatexFormulaUseful utility for creating images from LaTeX equations
HieroglyphicFind LaTeX symbols
Hand TeXHandwritten LaTeX symbol classifier

Read our verdict in the software roundup.


Best Free and Open Source Software 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.
Subscribe

Please read our Comment Policy before commenting.

Notify of
guest
0 Comments
Oldest
Newest Most Voted