As other users have advised, aspell is a good tool to use for this problem.
However, rather than configuring aspell's behaviour at the command line with --add-tex-command=<list>, --rem-tex-command=<list>, etc. I'd recommend creating project-level tex_conf and my_spelling files. These files are easier to manage and curate for larger projects and can also be version controlled (hopefully with the rest of your project files) and distributed with your content.
Typically, in my projects I would provision a simple shell script (check_spellings.sh):
#! /bin/bash aspell -c -t *.tex --conf=./tex_conf --add-extra-dicts=./my_spelling In this example I'm checking all files in the executed directory with a .tex file extension. I also have a file tex_conf and my_spelling in the same directory as my .tex files. (You may organise your project as you see fit so long as you adjust the paths to tex_conf, my_spelling, and the targeted .tex files in check_spellings.sh)
tex_conf is the place to add and remove tex commands for checking. An example tex_conf may contain:
add-tex-command cref p add-tex-command subref p add-tex-command textcite p add-tex-command parencitecaptionsetup pop add-tex-command captionsetupbegin oppop add-tex-command beginfrac poppp From the aspell documentation:
A ’p’ skips over a parameter while a ’P’ doesn’t. Similarly an ’o’ will skip over an optional parameter while an ’O’ doesn’t. The first letter on the list will apply to the first parameter, the second letter will apply to the second parameter etc
An example my_spelling may look like:
personal_ws-1.1 en 1 AIC Akaike autocorrelation HMC Stanislaw