Search:   Help

Navigation

Groups

LyX documentation

Edit

Shared groups

Links

Mac /

MacSpelling

Categories: Spellchecking, Mac
<< | Page list | >>

There are several solutions for spell-checking on Mac OS X. As of LyX 2.0, the built-in OS X spell-checker is supported, built on the open source Hunspell. Both spell-checking and thesaurus should work as-is if LyX is configured by the standard installer.

One may alternatively perform a separate install of Hunspell or Aspell. (Hunspell is also the spell-checker for LibreOffice, and Aspell is produced by GNU.)

1.  Installing Hunspell on Mac OS X

Perhaps the easiest way to install Hunspell is with Mac Homebrew. To install Homebrew, see the homepage(approve sites) or type the following in the terminal command window (additional details here:

ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"

Then install hunspell with

brew install hunspell.

Finally, set the appropriate spell-checker in LyX Preferences -> Language Settings -> Spellchecker. Hunspell can also be installed with MacPorts.

2.  Installing aspell on Mac OS X

There are several ways to install aspell, including Homebrew, MacPorts, and CocoAspell. Homebrew and MacPorts will build aspell, and will take some extra effort. CocoAspell is compiled specifically for Mac, making it an easy solution, but has not been updated since 2009. To install, download CocoAspell first and then read the directions below.

Here are instructions for building and installing aspell on Mac OS X. They apply, mutatis mutandis, to ispell, and hspell as well.

If you use an open-source package system like Homebrew(approve sites), Fink, MacPorts, or Darwin Ports(approve sites), it is likely that aspell is already available to you as a ready-made package. Consult the appropriate website for information on installing those packages (don't forget to install the appropriate dictionary package as well).

Otherwise, you'll have to download the source files, compile and install them. It's not quite as easy as using a pre-made package, but it's really not hard.

Note: You must follow these instructions from an administrative account on your Mac, and you must have the developer tools installed. (Apple's most recent developer tools can be downloaded here; it's a large download, and you may want to use your OS X install CDs to install them instead.)

Download both aspell itself and the dictionaries you want from http://aspell.sourceforge.net/. (For a list of supported languages, go here. Make sure these files are decompressed. (If you don't see folders with the appopriate names, doubleclick on the .gz files (and, if that only leaves you with .tar files, on these as well) until you have the folders.) To avoid errors, make sure that the total path to these folders do not include any spaces (e.g. do not put them into "~/Library/Application Support/LyX/"; the directory "~/Library/Spelling/" works well, though, as should the Desktop). Then open Terminal.app, and do the following:

  1. Type cd , followed by a space, but don't hit <Return> yet.
  2. Drag the folder icon for the aspell program into the Terminal window (text will appear showing the directory the folder is in), and hit <Return>.
  3. Type ./configure, followed by <Return>. That will spew out some messages about what it's doing.

NOTE: In order to configure the files properly, and run the below "make" command, you need to have these packages installed first. You should install Xcode from connect.apple.com to get the gcc compilers.

  1. When that's done, type make, followed by <Return>. Again, you'll get more output.
  2. When that's done, type sudo make install, followed by <Return>. You'll be asked for your password, and you should type it (though nothing will appear on the screen), and then hit <Return>.

You'll need to repeat steps 1-5 for each of the dictionaries you want to install. (You'll get separate folders for each.)

That's it. Now from within LyX, select Tools > Reconfigure, restart LyX when it tells you to, double check that aspell is selected from LyX > Preferences > Spellchecker, make sure the space below that for designating a personal dictionary is blank (so you will get aspell's default), and you should be good to go.

If at this point you are unable to save new words to the personal dictionary you will need to edit the file at /usr/local/etc/aspell.conf. Remove the line "home-dir $HOME/Library/Preferences/aspell" (line 38 including blanks), or disable it by adding a "#" sign at the begining.

For those afraid of make or simply time-challenged, a related approach is to use fink (http://pdb.finkproject.org/pdb/package.php/aspell(approve sites)) or port (https://trac.macports.org/browser/trunk/dports/textproc/aspell/Portfile(approve sites)). Porticus (http://porticus.alittledrop.com/(approve sites)) is a graphical frontend to the port command which may be helpful for those running Mac OX 10.6 and earlier (it has not yet been ported to 10.7). All of these commands will check for any dependencies to aspell and make sure they are setup correctly first.

3.  Installing cocoAspell

If instead you download and install cocoAspell from http://cocoaspell.leuski.net/ you need to specify the exact path to the dictionary in LyX spellchecking preferences. For example paste the following line into the "Alternative language" field:

/Library/Application Support/cocoAspell/aspell6-en-6.0-0/english.alias

To use multiple dictionaries, navigate to /Library/Application Support/cocoAspell/aspell6-en-6.0-0/ , then inspect the .multi files (e.g. using TextEdit). Find one which is most similar to the selection you are after. Make a copy, then edit it. Add line(s), using syntax similar to the existing lines, with the file name of the relevant dictionary (e.g. "add en-variant_1.rws"). Select this modified .multi file in the LyX preference, e.g.:

/Library/Application Support/cocoAspell/aspell6-en-6.0-0/mynewselection.multi

If at this point you are unable to save new words to the personal dictionary you will need to edit the file at /usr/local/etc/aspell.conf. Remove the line "home-dir $HOME/Library/Preferences/aspell" (line 38 including blanks), or disable it by adding a "#" sign at the begining. If you are not sure how to edit or locate this file, check this link for a step-by-step guide using the terminal. Alternatively, to navigate into the invisible /usr/ folder in the Finder, select the menu item Go > Go to Folder…, then type in "/usr". Navigate to the relevant file, then drag it into the TextEdit application.

Spellchecking Mac

Edit - History - Print - Recent Changes - All Recent Changes - Search
Page last modified on 2012-10-20 22:58 UTC