https://github.com/tdegeus/texplain
Copy TeX-file and included figures to a separate (flattened) folder
https://github.com/tdegeus/texplain
formatter latex pre-commit python
Last synced: about 1 year ago
JSON representation
Copy TeX-file and included figures to a separate (flattened) folder
- Host: GitHub
- URL: https://github.com/tdegeus/texplain
- Owner: tdegeus
- License: mit
- Created: 2017-02-17T13:02:11.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2024-03-13T08:33:59.000Z (over 2 years ago)
- Last Synced: 2025-04-21T00:30:29.771Z (about 1 year ago)
- Topics: formatter, latex, pre-commit, python
- Language: Python
- Homepage: https://texplain.readthedocs.io
- Size: 273 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/tdegeus/texplain/actions)
[](https://texplain.readthedocs.io/en/latest/?badge=latest)
[](https://github.com/tdegeus/texplain/actions)
[](https://github.com/pre-commit/pre-commit)
[](https://anaconda.org/conda-forge/texplain)
**Documentation: [https://texplain.readthedocs.io](texplain.readthedocs.io)**
# Usage
## command-line
* [texindent](https://texplain.readthedocs.io/en/latest/tools.html#texindent):
Automatic indentation and formatting of a TeX-file.
* [texcleanup](https://texplain.readthedocs.io/en/latest/tools.html#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](https://texplain.readthedocs.io/en/latest/tools.html#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.
## pre-commit
* [texcleanup](https://texplain.readthedocs.io/en/latest/tools.html#texcleanup):
```yaml
repos:
- repo: https://github.com/tdegeus/texplain
rev: v0.8.0
hooks:
- id: texcleanup
args: [--format-labels, --use-cleveref]
```
* [texindent](https://texplain.readthedocs.io/en/latest/tools.html#texindent):
```yaml
repos:
- repo: https://github.com/tdegeus/texplain
rev: v0.8.0
hooks:
- id: texindent
args: []
```
## Python
All of these tools wrap around a
[Python module](https://texplain.readthedocs.io/en/latest/module.html)
that you can use just as well!
# Disclaimer
This library is free to use under the
[MIT license](https://github.com/tdegeus/texplain/blob/master/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](https://github.com/tdegeus/texplain).
As always, the code comes with no guarantee.
None of the developers can be held responsible for possible mistakes.
Download:
[.zip file](https://github.com/tdegeus/texplain/zipball/master) |
[.tar.gz file](https://github.com/tdegeus/texplain/tarball/master).
(c - [MIT](https://github.com/tdegeus/texplain/blob/master/LICENSE)) T.W.J. de Geus (Tom) |
tom@geus.me |
www.geus.me |
[github.com/tdegeus/texplain](https://github.com/tdegeus/texplain)
# Getting texplain
## Using conda
```bash
conda install -c conda-forge texplain
```
## Using PyPi
```bash
python -m pip install texplain
```
## From source
```bash
# Download texplain
git checkout https://github.com/tdegeus/texplain.git
cd texplain
# Install
python -m pip install .
```