Cocoa programs automatically inherit spell checking technology by Apple. TeXShop supports continuous spell checking, which can be toggled on or off with a menu command. A preference item selects the initial position of this toggle.
The Apple spell checker does not understand LaTeX commands and marks many such commands as misspelled. However, Apple's technology allows third parties to add extra spell servers to the operating system, which then become available as transparent extensions of Apple's system. One of these third party servers, cocoAspell, supports LaTeX and is often installed by TeX users. This speller was written by Anton Leuski, using Kevin Adkinson's ispell for Unix machines as a foundation. To obtain it, go to
and download the free installer which makes installing a breeze. The installer provides an English dictionary, but Leuski's site contains a link to a site with free dictionaries for over 90 extra languages.
After installing cocoAspell, it is important to configure it for TeX. That is done with the Spelling Preference Pane which the cocoAspell installer adds to Apple's System Preferences panel. Use this pane to select active cocoAspell dictionaries. For each selected dictionary, click the TeX/LaTeX filter switch in the Spelling Pane panel to turn on LaTeX filtering.
Once cocoAspell is installed and a dictionary in its spell preference pane is selected and configured, open TeXShop Preferences, select the source tab, and select this cocoAspell dictionary in the Dictionary pulldown menu of this section of Preferences.
If you do not use cocoAspell, then use the Dictionary section of TeXShop Preferenes to select a default dictionary. If you usually write in English, select an English dictionary; if you usually write in French, select a French dictionary. Or select "Automatic Spelling" and an appropriate dictionary will automatically be selected depending on the text.
The dictionary section of TeXShop Preferences selects the default dictionary used when new files are opened in TeXShop, but does not change the dictionary used by files that are already open.
Dictionaries are listed in Preferences using the ISO 639-1 and ISO 639-2 standards, rather than the localized names in Apple's "Spelling & Grammar" panel.
Once TeXShop Dictionary Preferences are set up, users can open several source files in TeXShop. Each will be assigned the Default Dictionary. But these dictionaries can be changed using the "Spelling & Grammar" menu item in the TeXShop Edit menu. If desired, each file can use a separate dictionary. For instance, a user might be writing customer letters in English, French, German, and Japanese and could assign such dictionaries to the four source files. In that case, click randomly among the source files and notice that the "Spelling and Grammar" panel switches to the appropriate dictionary each time the corresponding source file becomes active.
When files are closed, this association is lost, so users who write in multiple languages will need to reselect the appropriate dictionary when each file is opened.
However, it is possible to fix the dictionary used when a file is first opened with the magic comment
In this example, the magic states that a German dictionary should be used whenever this file is opened. The dictionary, however, can still be changed after the file opens by using "Spelling & Grammar." The next time the file is closed and opened again, it will use the German dictionary.
The line is recognized when the document is opened, so the first time it is added to a source file, the file must be saved and reopened before the line is recognized. In a project with a root document, each included source file must contain the line.
When using this command, Apple dictionaries are specified using either the ISO 639-1 or ISO 639-2 standards for determining language designations, and the ISO 3166-1 standard for regional designations. The regional designation is used to distinguish between a language as used in one part of the world and that same language in another part of the world. For instance, French is "fr" in ISO 639-1 and "fre" in ISO 639-2; French (France) has regional designation "FR" and French (Canadian) has regional designation "CA". So to select a French dictionary in Canada, "spellcheck = fr" will work, and "spellcheck = fr-CA" would be even better. Since these are ISO standards, similar commands will work on other platforms, although TeXShop only runs on the Mac. The language standards are described in
and the regional standards are at although this second site is difficult to use.Specifying a cocoAspell dictionary is slightly tricky. The Spelling Preference Pane installed by cocoAspell lists all cocoAspell dictionaries, including active dictionaries. Names in this list are the names to be used following "spellcheck". When these dictionaries appear in Apple's list in the Language & Text panel, they often have different names. Those names don't work.
For example, there is a ocoAspell dictionary named German. If the German dictionary is selected in the Spelling Preference Panel, then the resulting dictionary will be listed in Apple's panel as Deutch (Aspell). In this case
Similarly there is a cocoAspell dictionary named German (Germany) in the Spelling Preference Pane. To select it, the appropriate command is
Originally, TeXShop did nothing special for dictionaries and users just used "Spelling & Grammar." Later a partial implementation of the above design was introduced. Finally, the full implementation was introduced in TeXShop 3.81. A very small number of users prefer the original design in which TeXShop just accepted the default behavior of "Spelling & Grammar." If you are one of these users, you can switch back to the original behavior using the hidden default
An alternate LaTeX spell checker named Excalibur is sometimes used. This spell checker was written by Rick Zaccone; it can open TeXShop files. To obtain it, go to
Zaccone's program is not a spell service; instead source files are spell checked by opening them in this program as a separate step in the authoring process.