Command-line reference
A formatter, linter, and language server for LaTeX
Usage: badness [OPTIONS] <COMMAND>
Options
--config <PATH>- Path to a
badness.tomlto use instead of discovering one. Applies toformatandlint; ignored byparse,lsp, andinit --no-config- Ignore any
badness.tomland use built-in defaults
badness format
Format LaTeX source.
With paths, formats each file in place. With no paths, reads stdin and writes the formatted result to stdout.
Usage: badness format [OPTIONS] [PATHS]...
Arguments
<PATHS>...- Files to format. Omit to read from stdin
Options
--check-
Report which files would change without writing them. Exits non-zero if any file is not already formatted
--stdin-filepath <PATH>-
Name the stdin buffer so its language is dispatched by extension (
.bib→ BibTeX, anything else → LaTeX). No file is read or written; only the extension is used. Ignored when paths are given --line-width <LINE_WIDTH>-
Maximum line width before the formatter breaks a line
--indent-width <INDENT_WIDTH>-
Number of spaces per indent step
--wrap <WRAP>-
How to lay out line breaks inside a paragraph
Possible values:
reflow: Greedy fill: wrap words to the line width (default)sentence: One sentence per line (line width ignored)semantic: Semantic line breaks (sembr.org): keep authored breaks and add breaks at sentence boundariespreserve: Leave authored line breaks untouched
--exclude <PATTERN>-
Gitignore-style pattern to skip during directory discovery (repeatable). Added on top of any
exclude/extend-excludefrombadness.toml
badness lint
Lint LaTeX source, reporting parse diagnostics.
With paths, lints each file. With no paths, reads stdin. Exits non-zero if any diagnostics are reported.
Usage: badness lint [OPTIONS] [PATHS]...
Arguments
<PATHS>...- Files to lint. Omit to read from stdin
Options
--fix- Apply safe autofixes in place, then report what remains. Requires path arguments; has no effect on stdin (there is nothing to write)
--unsafe-fixes- Also apply fixes that may change typeset output (requires
--fix) --stdin-filepath <PATH>- Name the stdin buffer so its language is dispatched by extension (
.bib→ BibTeX, anything else → LaTeX). No file is read or written; only the extension is used. Ignored when paths are given --exclude <PATTERN>- Gitignore-style pattern to skip during directory discovery (repeatable). Added on top of any
exclude/extend-excludefrombadness.toml --select <RULE>- Run only these rules (repeatable). Overrides
[lint] selectfrombadness.tomlwhen given --ignore <RULE>- Disable these rules (repeatable). Overrides
[lint] ignorefrombadness.tomlwhen given --explain <RULE>- Print the description and examples for a rule id, then exit. Ignores paths, config, and fixes
badness parse
Parse LaTeX source and print its concrete syntax tree (CST).
A debugging aid: prints the lossless parse tree as an indented KIND@range listing, with token text, followed by any parse errors. With a path, parses that file. With no path, reads stdin.
Usage: badness parse [PATH]
Arguments
<PATH>- File to parse. Omit to read from stdin
badness lsp
Run the language server over stdio
Usage: badness lsp
badness init
Write a commented starter badness.toml to the current directory
Usage: badness init [OPTIONS]
Options
--force- Overwrite an existing
badness.toml