Format your source
Get consistent formatting for LaTeX and BibTeX, from papers and bibliographies to packages and expl3 code.
A fast formatter, linter, and language server for LaTeX and BibTeX. Keep your source tidy and get feedback as you write.
Install Badness for your platform, then format and lint a file:
curl --proto '=https' --tlsv1.2 -sSf https://badness.dev/install | shpowershell -NoProfile -ExecutionPolicy Bypass -Command "irm https://badness.dev/install.ps1 | iex"See the installation guide for Homebrew, npm, uv, Cargo, and other installation options.
After installation, you can run Badness from the command line:
badness format paper.tex
badness lint bibliography.bibUsing VS Code? Install the Badness extension, which includes Badness. For other editors and configuration, see the editor setup guide.
Badness parses your source into a lossless syntax tree and updates its analysis as you type. The formatter preserves non-trivia content, and formatting an already-formatted file changes nothing. The same parser powers the formatter, linter, and language server.
See the performance comparisons or try your own document in the playground.
I am grateful for the financial support offered by the TeX Users Group through the TeX Development Fund.