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

I can't see a way to get Mathematica to check my spelling as I type. Is this feature not supported? I've done everything I can think of with my options:

enter image description here

Is there a setting I'm missing?

share|improve this question
Unless I am mistaken this syntax colouring is only for Input Cells. –  Mike Honeychurch Nov 15 '12 at 21:55
@MikeHoneychurch: So is there no "while you type" spelling error highlighting for basic text?! –  raxacoricofallapatorius Nov 15 '12 at 21:56
Not AFAIK ...but there is so much in Mathematica that I do not know. Someone else may know of this if it exists. –  Mike Honeychurch Nov 15 '12 at 22:00

1 Answer 1

This is almost a solution:

 checkPrevWord[char_] := (
   SelectionMove[nb, Previous, Word];
   SelectionMove[nb, All, Word];
   str = StringJoin[
     StringCases[NotebookRead[nb] /. StyleBox[a_, b___] :> a, 
   If[StringLength[str] =!= 0 && 
      Length[DictionaryLookup[str, IgnoreCase -> True]] === 0, 
     SetOptions[NotebookSelection[nb], FontColor -> Red]; 
     SelectionMove[nb, Next, Word];
     SetOptions[NotebookSelection[nb], FontColor -> Black],
     SetOptions[NotebookSelection[nb], FontColor -> Black];
     SelectionMove[nb, Next, Word]
    NotebookWrite[nb, char];);

 SetOptions[nb =  CreateDocument[], 
  NotebookEventActions -> ({"KeyDown", #} :> 
       checkPrevWord[#] & /@ {" ", ";", ".", "-", "!", "?", ",", "/"})];

I create a new notebook and check if the previous word you typed is in the dictionary (English). Unfortunately, I do not know how to test for being in a TextCell versus any other Cell, so the spell-checker will try to check the code too. Also, (BEWARE), this crashes Mathematica if you delete your text cell.

Note that you can replace CreateDocument with SelectedNotebook if you want to affect the current notebook.

Hopefully someone can help me identify what I'm missing, and then we'll have a spell-highlighter.

share|improve this answer
So does this mean that Mathematica, unlike every other text editing tool on the planet, doesn't have as-you-type spellchecking? –  raxacoricofallapatorius Nov 16 '12 at 20:06
@raxacoricofallapatorius None that I know of. However, it does seem to be implementable. I don't think Wolfram had Microsoft Word in mind when MMA was being made. –  VF1 Nov 16 '12 at 20:23

Your Answer


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.