January 10, 2018
Using styles to set spell-check options in Word
There are many reasons to use styles in Word, as I've noted before. One feature I find handy is using styles that have different spell-check options for different types of text. I'll explain a couple of examples: one where I set a non-default spell-check option (Spanish), and another where I disable spell check for code snippets.
Note: If you'd rather see this on video, see the links below.
Spell check for non-default languagesSuppose you're writing a document that has quotations in different languages. If you run spell check over the document, it'll barf when it gets to your citations in Spanish or French or Latin or whatever.
The hard way to solve this problem is to select the text of each citation, one by one, and then to set the proofing language (Review tab > Language > Set Proofing Language).
The easier way to do it is to define a style and set the language for that style. Then you can just apply the style to your citations.
Suppose I'm writing about One Hundred Years of Solitude by Gabriel Garcia-Marquez:
I run spell check, and uh-oh: if it's going to stop on every word of Spanish, it's going to be a long night proofing this doc:
Instead, I'll create a style just for my quotations in Spanish. In this case, I'll create a paragraph style, although I can set language options for character styles also, which is useful for cites in running text.
Here's the Create New Style dialog. The new style is named Quotation in Spanish. It's a paragraph style, based on Normal, and I've set an indent.
Then in the Format options (bottom left), I choose Language:
For the language, I choose Colombian Spanish:
Now I can apply this style to any citations in the document that are in Spanish. When spell check gets to the citations, it switches to checking spelling in Spanish. (Which is handy, since I'm a bad typist in multiple languages.)
If the document contains text in several languages, you create a different style for each non-default language that you're using and apply them as needed.
Disabling spell check for selected textI don't actually encounter a lot of Spanish citations in my work, but I do encounter a lot of snippets of program code and HTML. I also encounter filenames and URLs that are oddly spelled per English conventions. As with non-English text, this can throw spell check off. So I create a style for code and for HTML blocks and for filenames and for URLs. In those styles, I disable spell check altogether.
Skipping ahead, here's an example of what some sample text looks like when these styles have been applied:
There are 3 styles at work here. The green monospace marks a character style named Code. The blue italics mark a character style named Filename. And the indented block with gray background marks text that's styled using a paragraph style named Pre (a nod to the HTML element name for code blocks).
In addition to the various formatting settings that I defined for these styles (italics, blue, green, monospace, indented, etc.), in each case I chose the Language setting. Then in the Language dialog, I chose Do not check spelling or grammar:
When spell check runs, it skips over any text that has been styled using a style with this setting.
I should note that for code and HTML snippets, it can instead make sense to add the various keywords to your dictionary. (I do this for filenames that I encounter often.) However, defining a style that simply turns off spell check has been very handy for me in the code- and HTML-heavy documents that I work on.
Videos I made a couple of videos about this also and put them on YouTube: