Shifting Styles, Part 2

Here's the scenario: You've just opened a new document from a client, and you italicize the first paragraph, which is a short quotation introducing the chapter. But suddenly *all* of the chapter text is italicized. What in the world is going on?

You've just bumped into Word's "Automatically update" feature for styles. (This is different from the "Automatically update document styles" feature discussed in last week's newsletter.) If you don't know about the "Automatically update" feature, you can spend hours trying to adjust formatting, only to have everything in sight messed up beyond belief.

To turn the feature off, do this:

1. Click the "Format" menu.

2. Click "Style" (in Word 2002, that's "Styles and Formatting").

3. Click the style that's giving you fits (such as Heading 1). (In Word 2002, click the drop-down arrow to the right of the style in the Task Pane.)

4. Click "Modify."

5. Remove the checkmark from the box labeled "Automatically update."

6. Click the "OK" button.

7. If necessary, click the "Close" button.

Now, when you modify some formatting in your document, you'll change only the local selection and not everything that's formatted in the same style. But really, you should avoid using directly applied formatting anyway. Using paragraph and character styles is much more efficient--the True Way--and avoids a multitude of problems.

So what's the point of the "Automatically update" feature? It allows you to modify styles without drilling down, down, down through the Styles dialog. Well hey, that's good! It means you can change formatting directly, see the result immediately, and have the styles updated automatically to reflect that formatting. Pretty neat!

So here's my recommendation:

1. If you're *designing* a document, use the "Automatically update" feature with a bunch of junk text to set your styles exactly the way you want them (be sure to select the whole paragraph before changing the format). Once you've got them set, turn off "Automatically update." Then copy the styles to your real document, or save the junk document as a template that you attach to your real document. You can learn more about this here:

http://www.topica.com/lists/editorium/read/message.html?mid=1704544112

2. If you're *writing* or *editing* a document, make sure the "Automatically update" feature is turned off. You'll have a happier day.

_________________________________________

READERS WRITE

Rhana Pike (Rhana@ctc.usyd.edu.au) wrote:

"I was interested to read the tip on automatic updating of styles. A related issue is the box that appears sometimes when I try to apply a style to a paragraph: it says something like 'Update the style to match selection?' (I can't get it to appear now). Is there a way of getting rid of this or applying a default, because I set styles through the menu and never want to update the style to match the selection."

Here's how this works: When you apply direct formatting to a paragraph (such as formatting it in bold with CTRL + B), and then immediately click the paragraph style (such as Heading 1) in the Styles list on the Formatting toolbar, Word asks if you want to:

1. Update the style to reflect recent changes, or

2. Reapply the formatting of the style to the selection.

If you click option 1, Word will modify the style to match the manual formatting you've applied to the paragraph. This is a quick way to modify styles--similar to the technique explained in the main article in today's newsletter.

If you click option 2, Word will override all of that lovely manual formatting you've just done and reapply the existing formatting of the style.

Is there a way to get rid of these options and just apply the style? The only way I know of is not to click the Styles list after applying formatting directly--or, better yet, to avoid using directly applied formatting altogether.

Thanks to Rhana for her question.

_________________________________________

RESOURCES

Mark Pool (mark913@earthlink.net) wrote:

I really like the Google toolbar. It's a free download at

http://toolbar.google.com/

It occupies no more space than the address bar. Whenever I'm online and want to do a search it's always handy. Some of the advanced features are pretty cool, too, such as "Highlight".

Thanks to Mark for this helpful hint.

Shifting Styles

Scene 1: You go through your document, fine-tuning its style formatting to the peak of perfection. Then you carefully save your document for posterity.

Scene 2: A week later, you open your document. What the . . . ? All of your styles have shifted back to their original formatting. You'll have to do all of that work over again! And how can you be sure it will stick?

Here's the secret:

1. Open the document.

2. Click "Tools > Templates and Add-Ins."

3. *Remove* that dadburned checkmark in the box labeled "Automatically update document styles."

4. Resave your document.

The next time you open the document, your exquisite style formatting will remain intact.

So what's the point of the "Automatically update document styles" feature? Well, let's say that your boss just loves to tinker with the look of your company's forms and stationery, mandating Helvetica one week and Comic Sans the next. If you turn on "Automatically update document styles" for every company document you create, changing the formatting is a snap. Just open the template on which the documents are based, modify the styles, and resave the template. The next time you open one of those documents, its styles will automatically update to match those of the template.

It's a slick feature, as long as you know when--and when not--to use it. And now you do!

_________________________________________

READERS WRITE

After reading about the fraction macro in last week's newsletter, Bill Rubidge (william.rubidge.es.80@aya.yale.edu) wrote:

The fraction macro is an excellent start, but I suspect many of your readers would need to add an additional search process at the beginning of the macro, to search for dates formatted with slashes and mark those so that they do not get converted to these fancy fractions.

Without much thought, I would imagine you would need to run a wildcard search for:

([0-9]{1,2})/([0-9]{1,2})/([0-9]{1,4}) (Note that the last item, the year, has space for up to four digits, being used a lot lately as we turn centuries.)

I would then (probably crudely) replace with 1DATESLASH2DATESLASH3DATESLASH

Then run the macro you provide, but add a final replace at the end to replace DATESLASH with / to get back my XX/XX/XX dates.

It's worth reminding readers that the most challenging part of writing any of these search and replace macros is making sure that you write your search criteria and/or mark out items that might otherwise be unintentionally replaced.

Many thanks to Bill for this important caveat.

_________________________________________

RESOURCES

If you don't subscribe to Woody's Office Watch, a free email newsletter from Woody Leonhard, the Grand Poobah of Microsoft Office, you're missing out on advice, tips, and news that no Office user should be without:

http://www.woodyswatch.com

Why not sign up today? While you're there, check out Woody's books and software. You might find just what you need to make your life easier and more productive.

Fraction Macro

Last week's newsletter explained how to make your own typographical fractions in Microsoft Word. You can read about the technique here:

http://www.topica.com/lists/editorium/read/message.html?mid=1709983687

But if your document is full of plain-text fractions, like these--

1/3 2/3 5/8

--why not let a macro do the work? I owe my thanks to Wordmeister Steve Hudson for the idea. Steve would probably take a more elegant approach, but this macro will definitely work. Enjoy! If you don't know how to use macros like this one, you can learn how here.

And now, the macro:

'THE MACRO STARTS HERE
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "([0-9]@)/([0-9]@)"
.Replacement.Text = "|sp|1|sp|" + ChrW(8260) + "|sb|2|sb|"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find.Replacement.Font
.Superscript = True
.Subscript = False
End With
With Selection.Find
.Text = "|sp|([0-9]@)|sp|"
.Replacement.Text = "1"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find.Replacement.Font
.Superscript = False
.Subscript = True
End With
With Selection.Find
.Text = "|sb|([0-9]@)|sb|"
.Replacement.Text = "1"
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
'THE MACRO ENDS HERE

What's basically going on here is that Word uses a wildcard search to find all numbers that have a slash between them:

Find What: ([0-9]@)/([0-9]@)

Then it replaces those numbers with *themselves* surrounded by arbitrary codes denoting superscript (|sp|) and subscript (|sb|). It also replaces the slashes with the fraction bar character, Unicode number 8260:

Replace With: "|sp|1|sp|" + ChrW(8260) + "|sb|2|sb|"

(If you were doing this by hand, you could insert the fraction bar into your document using Insert > Symbol [as explained in last week's newsletter], then copying it, and then pasting it into the Replace dialog's "Replace With" box. The result would look something like this: |sp|1|sp|/|sb|2|sb|)

Finally, the macro uses parentheses to group the numbers so that after they and their surrounding codes are found, the numbers can be replaced by *themselves,* properly formatted and without the codes, using the "Find What Expression" wildcard:

Find What: |sp|([0-9]@)|sp|

Replace With: 1 [formatted as superscript]

Find What: |sb|([0-9]@)|sb|

Replace With: 1 [formatted as subscript]

You can learn more about wildcard searches here:

http://www.topica.com/lists/editorium/read/message.html?mid=1705963026

http://www.topica.com/lists/editorium/read/message.html?mid=1706069286

http://www.topica.com/lists/editorium/read/message.html?mid=1706167662

http://www.topica.com/lists/editorium/read/message.html?mid=1706267069

http://www.topica.com/lists/editorium/read/message.html?mid=1706365638

http://www.topica.com/lists/editorium/read/message.html?mid=1706458823

_________________________________________

READERS WRITE

Gentle reader, I've run into a fairly serious problem that I'm hoping you may have some ideas about. The problem is that QuarkXPress doesn't import Unicode characters--the old 256 are all it will deal with. Several people have asked me if there's a way to find and replace Unicode characters in Word with other lower-level characters that Quark could deal with. For example, if you type a, b, c in Quark and then format it with a Greek font, you get alpha, beta, gamma. Maybe a similar approach could be taken with Unicode characters, if you could figure out what to replace them with in Word (and actually do the replacing) before importing the Word document into Quark. I don't know--this looks like an almost insurmountable problem to me. If you are successfully importing Unicode characters into QuarkXPress, especially using XPress Tag files, I'd love to hear from you. Please write to me here: mailto:editor [at symbol] editorium.com

Sage Rountree (srountree@dukeupress.edu) wrote:

"When we insert notes to compositor and authors in electronic manuscript files, we want those inserts to be bold and in either angle brackets (for coding and notes to compositor) or curly brackets (for queries to authors). Sometimes, our freelance copyeditors neglect to toggle on the bold for these queries, and we go through and manually convert them to boldface. (By manually, I mean we search for the opening bracket, highlight, and toggle--a big waste of time.)

"I'm able to figure the search-and-replace for toggling short coding with fixed letters (, ) to boldface, but how can I replace all text between the brackets <> and {} *with the brackets themselves* and the text they contain in bold? The substance of the note can sometimes be a few sentences long, and I don't know how to denote that with wildcards. It's like the opposite of the process you outlined in the 10/25/2000 newsletter on replacing with "find what text."

"This has been an interesting mental puzzle for me, but I'm ready to throw in the towel.

Minutes later, before I could respond, Sage wrote again:

"Jack, I spoke too soon about throwing in the towel, and I added the backslash so Word would recognize the angle brackets as characters, not as the start and end of words. To that end, I wrote this macro:

Selection.HomeKey Unit:=wdStory

Selection.Find.ClearFormatting

Selection.Find.Replacement.ClearFormatting

Selection.Find.Replacement.Font.Bold = True

With Selection.Find

.Text = "<*>"

.Replacement.Text = "^&"

.Forward = True

.Wrap = wdFindContinue

.Format = True

.MatchCase = False

.MatchWholeWord = False

.MatchWildcards = True

.MatchSoundsLike = False

.MatchAllWordForms = False

End With

Selection.Find.Execute Replace:=wdReplaceAll

Many thanks to Sage for this useful macro (which I edited slightly). I'd add that if your comments are between curly brackets, you could replace the sixth line with this:

.Text = "{*}"

_________________________________________

RESOURCES

So, you kind of like all this programming stuff, eh? Want to learn more? There's an excellent tutorial, "Getting to Grips with VBA Basics in 15 Minutes," by Word expert Bill Coan, at the MVPS Web site. You'll find the tutorial here:

http://www.mvps.org/word/FAQs/MacrosVBA/VBABasicsIn15Mins.htm

Fractions

Using fractions has always been a challenge in Microsoft Word. A few (1/2, 1/4, and 3/4) have been readily available. But what about 1/3, 2/3, and other common ones?

Microsoft recommends creating additional fractions by using equation fields or the Equation Editor. You can learn more about these methods here:

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q137734

Unfortunately, these methods are inadequate, for a couple of reasons:

1. They're ugly. The fractions they create are typographically unacceptable.

2. They're clunky. Using them is a chore, and they create fields or graphics, not actual text.

Fortunately, better methods are available.

ROLL YOUR OWN

The "roll your own" method consists of creating a fraction by hand, using a superscript number, a fraction bar, and a subscript number. Here's how it works:

1. Type the top number of your fraction (the dividend, if you're mathematically inclined).

2. Insert a fraction bar (which is different from [more slanted than] the virgule, diagonal, solidus, slash, or whatever you want to call that character below the question mark on your keyboard). To do this:

a. Click Insert > Symbol.

b. Click the Font list

c. Select "Symbol."

d. Find the number 4 on the top row and count down five squares. See the fraction bar? (ANSI 164.)

e. Click the square containing the fraction bar.

f. Click the "Insert" button.

g. Click the "Close" button.

3. Type the bottom number of your fraction (the divisor). Your fraction should now look like this: 2/3.

4. Select the top number and format it as superscript (Format > Font > Superscript).

5. Select the bottom number and format it as subscript (Format > Font > Subscript).

That's it! Not a bad-looking fraction, if you ask me. And once it exists, you can turn it into an Autocorrect or Autotext entry so you don't have to create it from scratch the next time you want to use it.

UNICODE

Unicode fonts include *lots* of characters, including quite a few fractions. So why not use them? You can learn more about Unicode characters here:

http://www.topica.com/lists/editorium/read/message.html?mid=1709529895

Here's the easiest way to insert Unicode fractions (if your fonts, operating system, and version of Word support it):

1. Click the Insert menu.

2. Click "Symbol."

3. In the Font list, select a Unicode font, which will display the Subsets list to the right of the Font list and have lots of subsets available (such as Latin-1, Spacing Modifier Letters, and so on).

4. In the Subset list, select "Number Forms."

5. Somewhere in the characters displayed, you should see some fractions. Click the one you want to use.

6. Click the "Insert" button.

7. Click the "Close" button.

There's your fraction. Again, you can turn it into an Autocorrect or Autotext entry for easy access.

If you like entering Unicode characters directly (using ALT + X in Word 2002), here are the Unicode numbers you'll need:

1/3: 2153

2/3: 2154

1/5: 2155

2/5: 2156

3/5: 2157

4/5: 2158

1/6: 2159

5/6: 215A

1/8: 215B

3/8: 215C

5/8: 215D

7/8: 215E

Thanks to Maggie Brown for suggesting this topic.

_________________________________________

READERS WRITE

Jeffrey White wrote:

I am an attorney who writes appellate briefs. That often involves cutting and pasting from other sources. I need to make sure that case names appear in italic. For instance, General Motors Corp. v. Ford Motor Co., 123 F.2d 456 (1990).

It occurs to me that I could use search-replace. Using your discussion of wildcard searching, I have tried to construct a command that will find the most common pattern: One or more words beginning with an initial capital letter, followed by "v. ", followed by one or more capitalized words, ending with a comma.

I have been able get one capitalized word, followed by "v. " Is there any way to ask Word 2000 to find a string of one or more capitalized words?

I responded:

The following string will find three capped words in a row (including any periods, commas, and spaces):

([A-Z][a-z.,]@ [A-Z][a-z.,]@ [A-Z][a-z.,]@ )

However, when you put in the "v. " and then *repeat* the string, like this--

([A-Z][a-z.,]@ [A-Z][a-z.,]@ [A-Z][a-z.,]@ )v. ([A-Z][a-z.,]@ [A-Z][a-z.,]@ [A-Z][a-z.,]@ )

--Word will tell you that the string is "too complex." (Theoretically what you want to do should be possible, but in practice it's not. MS Word just ain't that smart, unfortunately.) I haven't been able to get variations to work either. For example, you'd think that you could use this string to find from 1 to 4 occurrences of a capped word followed by a space:

([A-Z][a-z]@ ){1,4}

But no--at least not in Word 2000. And this *should* work. The wildcard search and replace definitely has some minor bugs, especially with complex searches. I've also tried using the "start of word" and "end of word" wildcards (<, >) without success.

There is a workaround you may be able to use, however:

1. Identify all of the names used in the case names in your document (General Motors Corp., Ford Motor Co., etc.).

2. Find and Replace them with uppercase abbreviations (GMC, FMC, etc.).

3. Use a wildcard Find and Replace to italicize the abbreviations. To do so, put this (possibly with some tweaking to fit your situation) in the "Find What" box:

(<[A-Z]{2,}>) v. (<[A-Z]{2,}>)

Put this (possibly with some tweaking) in the "Replace With" box:

1 v. 2

Format the "Replace With" box as italic (CTRL + I).

4. Click the "Replace All" button.

5. Find the abbreviations and Replace them with the actual names.

Jeffrey then responded:

Building on your suggestion, the following will select the one capitalized word preceding the v. , along with the rest of the case name.

[A-Z][a-z]@ v. [A-Z]*,

That probably does the job for 90% of my case names. If I replace one at a time, instead of Replace All, I can keep an eye out for preceding words that also need italics. That's still a time savings over a wholly manual edit. Or I can make a second pass, repeating the initial string to find case names beginning with 2 words:

[A-Z][a-z]@ [A-Z][a-z]@ v. [A-Z]*,

And then 3, and so on. It's hard to know when to stop, because some case names are quite lengthy.

Slowly but surely, many law offices have moved from WordPerfect to Word. Those of us who appreciate the value of working smarter appreciate your newsletter and tools.

Thanks to Jeffrey for sending this interesting challenge. To learn more about wildcard searching, see these back issues of

Editorium Update:

http://www.topica.com/lists/editorium/read/message.html?mid=1705963026

http://www.topica.com/lists/editorium/read/message.html?mid=1706069286

http://www.topica.com/lists/editorium/read/message.html?mid=1706167662

http://www.topica.com/lists/editorium/read/message.html?mid=1706267069

http://www.topica.com/lists/editorium/read/message.html?mid=1706365638

http://www.topica.com/lists/editorium/read/message.html?mid=1706458823

_________________________________________

RESOURCES

Webopedia bills itself as "the only online dictionary and search engine you need for computer and Internet technology." If you're doing technical editing, you'll probably find it useful:

http://www.webopedia.com