LaTeX Formatter: Indent Environments and Tidy Whitespace
Indents LaTeX environments and tidies whitespace.
Use the tool
Why this tool exists
LaTeX does not care about indentation, but readers do. Nested lists, tables and figures are much easier to follow when each environment is indented.
The tool indents lines between \begin{...} and \end{...} and between \[ and \], skips % comments when counting, and leaves verbatim, lstlisting, minted and comment environments exactly as written. The document environment is not indented unless you ask. Only whitespace changes.
How to use it
- Paste the LaTeX source.
- Pick the indent.
- Choose whether to indent inside the document environment.
- Copy the result.
Frequently asked questions
Does it wrap lines?
No.
Is $$...$$ handled?
No. Only \[ \] and environments.
Could it change the output?
Only inside environments where leading spaces matter, such as verbatim, which are skipped.
Is my input sent anywhere?
No. Everything runs in your browser and nothing is uploaded.