CheckMyTex
A tool to comfortably check complex LaTeX documents, e.g., dissertations, for common errors. There are already pretty good correction tools for LaTex, e.g., TeXtidote, YaLafi, or LaTeXBuddy (in which I was involved and of which I copied some things), but they had shortcomings with complex documents, and they also did not fit my workflow. CheckMyTex builds upon YaLafi, but provides a simple CLI with some additional magic and tricks to deal with hopefully any document.
Primary concepts are
- not just listing problems but also their exact locations,
- working on the whole document, not just individual files (because otherwise, you forget to check some files)
- simple extension of further checking modules,
- ability to whitelist found problems and share this whitelist,
- edit the errors directly (in Vim with automatic jump to line), and
- having a single, simple command that you can easily run before every commit.
This tool does not have a fancy HTML-output (like the other tools), even though I first designed it that way. The reason for sticking to a CLI are simple:
- Thanks to colored output, the highlighting works just as nice in CLI as in HTML. No need to switch to your browser.
- The CLI can use your favourite editor (currently, only (n)vim and nano have full support) without switching context.
What does CheckMyTex currently check for you?
- Spelling errors using pyspellchecker
- Grammar errors using languagetool
- LaTeX-smells using ChkTeX
- Raw numbers instead of siunitx (simple regex, showing you how easy new modules can be added)
- Additional advise from proselint
The sources are detexed before applying grammar or spelling checking using YaLafi.
Further checks may be added in the future. I do a lot of collaborative writing on papers and am constantly confronted with bad LaTeX that I try to detect automatically.
Install
You can install CheckMyTex using pip
pip install checkmytex
You additionally need to install languagetool and a LaTeX-distribution (which should contain ChkTeX).
Currently, this tool will only work on Unix!
Usage
checkmytex main.tex
CheckMyTex will now guide you through your document and show you all problems, skipping over good parts. For each problem, you will be asked what to do
[s]kip,[S]kip all,[w]hitelist,[I]gnore all,[n]ext file,[e]dit,[l]ook up:
- skip will skip this concrete problem, but ask you again next time you run CheckMyTex.
- Skip all will skip this problem and all identical problems, but ask you again on the next run of CheckMyTex.
- whitelist will whitelist the problem and never ask you about it again (for this document).
- Ignore will ignore all problems that belong to the same rule, but ask you again next time you run CheckMyTex.
- next file will jump to the next file.
- edit will open you
$EDITORat the location of the problem. It tries to keep track of line changes without reprocessing the document. - look up will google the problem for you (if available). E.g., you can check for rare technical terms.
This all works with nice coloring, which I cannot directly show in this markdown file.
Whitelisted problems are by default saved in .whitelist.txt (document root) and are human-readable.
You can copy it to use also for other documents or change the path using the -w argument with a path when calling
CheckMyTex.
This tool will have problems with some areas of you document. You can exclude these areas by adding lines with
%%PAUSE-CHECKING and %%CONTINUE-CHECKING. This may be easier than whitelisting all the problems.
The time to check a 300-page dissertation is around a few seconds. A better spell checking would be available but drastically increase the runtime.
Development Status
This tool is still under development but already usable. Just expect some imperfections. Ideas are welcome.
Metadata
Release files for CheckMyTex 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| CheckMyTex-0.4.1-py3-none-any.whl | Python 3 | none | any | Details for CheckMyTex-0.4.1-py3-none-any.whl |
Release files / CheckMyTex-0.4.1-py3-none-any.whl
| Download URL | CheckMyTex-0.4.1-py3-none-any.whl |
|---|---|
| Size | 22.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a15115b9a003f5a00fdcbf08e3073912d6e286362b92f13f98a34e47962c61ed
|
|
BLAKE2b-256 checksum How to use checksums |
9a8026bafcd6f73270c08a5765606930328c2a5face32d0327b2c889225b9e4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.9.7
|
Security for CheckMyTex 0.4.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.