UnTeX

Crates.io docs.rs Codacy Badge codecov

UnTeX is both a library and an executable that allows you to manipulate and understand TeX files.

NOTE: even though TeX and LaTeX are not the same, UnTeX assumes that TeX documents are written such that they will be parsed with some LaTeX engine. For "pure" TeX content, see the src/lib/tex module.

Executable

The most convenient way of using UnTeX is through its command-line interface (CLI).

Currently, you can install it with Cargo:

bash cargo install untex --all-features

NOTE: while using --features cli is sufficient to install UnTeX's CLI, using all features is recommend to take most benefits out of it!

Usage

UnTeX has multiple commands, each one with a specific application:

bash untex <COMMAND> [OPTIONS] [FILENAMES]...

A complete usage help can be obtained with untex [-h|--help] or with untex <COMMAND> [-h|--help] for a given command.

Examples

Highlighting text

bash untex hl -p math main.tex echo "% this is a comment\nthis is not a comment" | untex hl -t comment

Library

You can use UnTeX in your Rust project by adding to your Cargo.toml:

toml untex = "^0.4.0"

Documentation

Automatically generated documentation can be found found here.

Feature Flags

Default Features

Optional Features

Disclaimers

As this project is under active development, expect non backward compatible changes from version to version. Before reaching v1.x.x, UnTeX will be considered as unstable.

What is a valid (La)TeX document

Parsing La(TeX) documents is very complicated, and the main reasons are detailed in the header of the documentation. Because of this, UnTex does not aim to be an exact parser, but a relatively good parser.

If you are in a situation where you think UnTeX produces a wrong result, please reach out to me, preferably via a GitHub issue, and explain to me what you expected!

Contributing

Contributions are more than welcome! Making UnTeX a good and reliable TeX tool is a matter of time and work, so any kind of help is a step towards a better UnTeX!