Skip to main content

A simple tool for checking complex LaTeX documents, e.g., dissertations.

Project description

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:

  1. Thanks to colored output, the highlighting works just as nice in CLI as in HTML. No need to switch to your browser.
  2. 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?

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 $EDITOR at 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.

TODOs

  • Reduce double-whitespace matches. They do not matter in LaTeX. Maybe clean the detexed file instead of just disabling the corresponding rules?

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

CheckMyTex-0.5.0-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file CheckMyTex-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: CheckMyTex-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.7

File hashes

Hashes for CheckMyTex-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d799594a10d7cb65b048d8629e9df7b9a685a038b3b3db007825fdd0f0eda0d0
MD5 306367773eab9490c56182cb4dee6597
BLAKE2b-256 6f458b29da7a88f324e8b795a29233c837701180e7d158806d9fb2e1fd999dc3

See more details on using hashes here.

Supported by

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