3 unstable releases
|0.4.0-beta||Jan 27, 2023|
|0.4.0-alpha||Jan 25, 2023|
|0.3.0||Apr 17, 2022|
#3 in #tex
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
The most convenient way of using UnTeX is through its command-line interface (CLI).
Currently, you can install it with Cargo:
cargo install untex --all-features
NOTE: while using
--features cliis sufficient to install UnTeX's CLI, using all features is recommend to take most benefits out of it!
UnTeX has multiple commands, each one with a specific application:
checkfor checking that a document will compile without error*;
deps, for extracting dependencies from a TeX project;
expandfor expanding macros (e.g.,
hl, for highlighting parts (e.g., comments) of TeX documents;
formatfor pretty formatting your TeX files;
parsefor parsing and validating TeX documents*.
completionsto generate completions scripts for your shell (needs
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.
untex hl -p math main.tex echo "% this is a comment\nthis is not a comment" | untex hl -t comment
You can use UnTeX in your Rust project by adding to your
untex = "^0.4.0"
Automatically generated documentation can be found found here.
color: Adds support for output colorized text in the terminal with
strum_macros's capabilities to enhance
Enums all across the library.
cli: Adds command-line related methods for multiple structures. This feature is required to install UnTeX's CLI.
annotate: (Soon) Adds method(s) to annotate results from check request. If cli feature is also enabled, the CLI will by default print an annotated output.
cli-complete: Adds commands to generate completion files for various shells. This feature also activates the cli feature. Enter
untex completions --helpfor get help with installing completion files.
json: (Soon) Adds the
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!
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!