Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

1) How can I make aspell cope with words containing special characters like F\"orster or \AA ngstrom? I can't simply add these to the dictionary.

2) How can I make aspell skip math mode? For example, in $a^bc$ it offers to replace bc.

share|improve this question
4  
If you don't have valid reasons to stick to the old and ugly input method you should consider switching to unicode and use utf-8 instead. Your spell checker will embrace the decision as well. –  Marco Sep 2 '12 at 17:43
    
Thanks, utf-8 works fine (I'm relatively new to latex). But the other thing about skipping math mode is still a bummer.. –  Raul Laasner Sep 2 '12 at 19:31
add comment

3 Answers

GNU Aspell comes with a dedicated TeX/LaTeX filter which can be activated with the --mode=tex command-line option. The functionality of this filter is, however, still limited. In essence, when Aspell is in TeX/LaTeX mode it skips control sequences and checks/ignores macro arguments according to a list of macro signatures which can be extended on the command line or in one of Aspell’s configuration files. Moreover, when in TeX/LaTeX mode, Aspell skips comments by default. Check out the Aspell manual for the details.

Aspell is presently not able to handle words containing special characters given in traditional ASCII notation such as F\"orster even though improving Aspell in this direction is a prominent item in the Aspell TODO list. Furthermore, it is not possible to tell Aspell to skip specific regions such as in-line formulae or selected LaTeX environments.

As for the latter issue, a capable front-end to Aspell might come to your rescue. An example is – what a surprise ;-) – the Emacs text editor. In fact, when Emacs visits a TeX/LaTeX input file the spellchecker (which can be customized to use Aspell as back-end by setting ispell-program-name appropriately) skips all regions matching the regular expressions specified in ispell-tex-skip-alists. By default, in-line formulae are not skipped, though. In order for this to happen, you have to extend ispell-tex-skip-alists in your Emacs initialization file, e.g. using the following form:

(setcar ispell-tex-skip-alists
        (append
         (car ispell-tex-skip-alists)
         '(("[^\\]\\$" . "[^\\]\\$"))))
share|improve this answer
add comment

Not quite answering the question, but ispell (rather than aspell) ignores most math environments (with the -t option). To get it to not be confused by new macros, see http://einstein.sc.mahidol.ac.th/~scmal/LaTeX/mspell/index.html .

share|improve this answer
add comment

Regarding your second question, there is a patch for aspell which, among other things, makes it skip inline and displayed math formulae.

The detailed description of the patch is here:

http://lists.gnu.org/archive/html/aspell-devel/2011-02/msg00000.html

Unfortunately the patch is not yet in the official repository. I'm using it anyway since I compiled aspell from the source+patch myself. And it works fine.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.