8

(This question was originally posted on stackoverflow, but the audience there recommended to move this post here.)

I want to check the spelling in a huge mathematical document written in LaTeX. This document consists of multiple chapters split up into various files. Of course, I could check the various files one by one using

aspell --lang=en_GB -t -c file1.tex
aspell --lang=en_GB -t -c file2.tex
aspell --lang=en_GB -t -c file3.tex

etc. This yields to the following annoying problems:

  1. LaTeX-Code: Even though the -t option is in place, a lot of LaTeX commands are handelled poorly. For instance, aspell checks the labels in every occurence of \cref{MyLabel} and \eqref{MyLabel} and of course these labels are usually not orthographically correct. It also does not seem to be able to handle options very well. For instance in \nomenclature[NatNum]{$\mathbb{\N}$}{the natural numbers} it complains about the [NatNum]. Is there any way to tweak aspells abilities to detect LaTeX code?

  2. Mathematical Technical Terms: In the rest of the text body, a lot of mathematical terms are used. It is clear that some special terms are not known to aspell, but even very common words like "injective", "homomorphism", "adjoint" etc. are not recognized. Are there special dictionaries for this one could add?

  3. Multiple Files: A crude solution to the problems mentioned so far is to hit the ignore all option, whenever such a problem occurs. This works well until aspell hits the end of the file. When I run the next file, aspell has forgotten everything I told it to ignore before. I googled how to run aspell on multiple files. I came up with something like:

    find . -name "*.tex" -exec aspell --lang=en --mode=tex check "{}" \;
    

This only solves the problem that one does not have to invoke aspell manually for every TeX-file, which is the least of my concerns. This command automatically invokes aspell for all files, but when I trained aspell to ignore some technical terms, it nevertheless forgets them when the next file is checked. Is there any way to improve this?

I have the general feeling that I am doing it the wrong way, since 99 % of all the hundreds of "errors" reported by aspell are actually correct mathematical LaTeX code. What to do?

Meneldur
  • 953

0 Answers0