2

Given the density of the jargon in LaTeX files, it's much more convenient to spell in batch mode, rather than in an interactive "would-you-like-to-correct-this-word-by-that-one" mode.

After brew install ispell and brew install aspell, I can spell check using one of

aspell -c -t file.tex
ispell -t file.tex

but both are interactive.

What is the non-interactive variation? ispell -l -t file.tex used to work, but this may have been an entirely different ispell (from MacPorts).

Calaf
  • 1,471
  • @Andrew Nice.. If you're on macOS, can you mention which aspell you're running? It worked with an brew install aspell with which aspell reporting /usr/local/bin/aspell. But I've suspected there are multiple programs dubbed {a,i}spell. – Calaf Oct 24 '17 at 19:04
  • @Andrew lol... it's confused about its identity itself! Please add your comment as an answer. Also, what is the purpose of the "[[:upper:].[[:upper:]]."? Do you wish to remove acronyms or capitalized keywords? – Calaf Oct 24 '17 at 19:11

1 Answers1

2

I have the following two bash functions for spell-checking latex documents:

function check() {
detex "$1" | \aspell -t list --encoding utf-8 \
           | grep -v -f $HOME/.aspell_exclude \
           | egrep -v '[[:upper:].*:[[:upper:]].*' \
           | sort --ignore-case | uniq | more
}
function slow_check() {
  \aspell -t list --encoding utf-8 < "$1" \
           | egrep -v '[[:upper:].*:[[:upper:]].*'  \
           | sort --ignore-case | uniq | more
}

Although, I have to confess that I rarely use the second one.

The egrep -v '[[:upper:].*[[:upper:]].*' is there is there to remove the "spelling errors" caused by the \ref{...} labels that I use in my documents, which are typically of the form L:NiceLemma.

I am using aspell, installed from brew, and it reports its version as:

International Ispell Version 3.1.20 (but really Aspell 0.60.6.1)