Skip to main content

TeX file formatting

Project description

ci Documentation Status pre-commit pre-commit Conda Version




  • texindent: Automatic indentation and formatting of a TeX-file.

  • texcleanup: Apply any of the following options to a TeX-file:

    • Remove all comments or comment-lines.
    • Modify all occurrences of a command, for example to change \TG{deleted}{inserted} to inserted.
    • Rename a label.
    • Ensure common prefixes for all labels.
    • Ensure usage of \cref instead of \ref.
  • texplain: Create a directory with a TeX-file and only its dependencies (those figure-files and references that are actually included). This is particularly useful to create a clean version to submit to a journal.


  • texcleanup:

    - repo:
      rev: v0.8.0
      - id: texcleanup
        args: [--format-labels, --use-cleveref]
  • texindent:

    - repo:
      rev: v0.8.0
      - id: texindent
        args: []


All of these tools wrap around a Python module that you can use just as well!


This library is free to use under the MIT license. Any additions are very much appreciated, in terms of suggested functionality, code, documentation, testimonials, word-of-mouth advertisement, etc. Bug reports or feature requests can be filed on GitHub. As always, the code comes with no guarantee. None of the developers can be held responsible for possible mistakes.

Download: .zip file | .tar.gz file.

(c - MIT) T.W.J. de Geus (Tom) | | |

Getting texplain

Using conda

conda install -c conda-forge texplain

Using PyPi

python -m pip install texplain

From source

# Download texplain
git checkout
cd texplain

# Install
python -m pip install .

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

texplain-0.8.9.tar.gz (141.0 kB view hashes)

Uploaded source

Built Distribution

texplain-0.8.9-py3-none-any.whl (23.5 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page