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

Posted in Typesetting | Leave a comment

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

Posted in Typesetting | Leave a comment

Copying and Pasting Styles

If you frequently use styles (which you should) to format your documents or specify text levels for typesetting, you're probably aware that you can press CTRL + SHIFT + S to activate the style list. (Then you can scroll through the list to get the style you need.)

You may not be aware, however, that you can easily copy and paste styles (both paragraph and character styles), just as you can copy and paste text. If you've never done this before, it will make you smile. Here's the procedure:

1. Put your cursor on some text formatted with the style you want to copy (Heading 1, for example).

2. Press CTRL + SHIFT + C (just like the keyboard shortcut for copying text, but with the SHIFT key added).

3. Move your cursor to (or select) the text you want to format with the style you just copied.

4. Press CTRL + SHIFT + V (just like the keyboard shortcut for pasting text, but with the SHIFT key added).

The text will be formatted with the style you copied.

_________________________________________

READERS WRITE

Jeff Ross sent the following macro to clean up text copied into Word from an email message. Thanks, Jeff!


Sub CleanMyMessage()
' CleanMyMessage Macro
' Macro recorded 3/11/02 by Jeff Ross
'Remove angle brackets with spaces
With Selection.Find
.Text = "> "
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
'Remove other angle brackets
With Selection.Find
.Text = ">"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
'Remove spaces before paragraph breaks
With Selection.Find
.Text = " ^p"
.Replacement.Text = "^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
'Mark true paragraph breaks with unique character
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^p^p"
.Replacement.Text = "?"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
'Replace other (false) paragraph breaks with spaces
With Selection.Find
.Text = "^p"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
'Replace unique character with paragraph break
With Selection.Find
.Text = "?"
.Replacement.Text = "^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
'Turn double hyphens to em dashes
With Selection.Find
.Text = "--"
.Replacement.Text = "^+"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
'Turn straight single quotation marks into curly ones
'Note: For this to work, the AutoFormat option
'to replace straight quotes with curly quotes must be on
'(Click Tools > AutoCorrect > AutoFormat As You Type >
'Replace as you type > straight quotes with smart quotes)
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "'"
.Replacement.Text = "'"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
'Turn straight double quotation marks into curly ones
'Note: For this to work, the AutoFormat option
'to replace straight quotes with curly quotes must be on
'(Click Tools > AutoCorrect > AutoFormat As You Type >
'Replace as you type > straight quotes with smart quotes)
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = """"
.Replacement.Text = """"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub

If you don't know how to use macros like this one, you can learn how here.

_________________________________________

RESOURCES

Dan A. Wilson, expert online editor and proprietor of The Editor's Desktop, provides several useful resources for editors, including:

* a basic FTP tutorial (if you need to transmit electronic manuscripts to clients)

* suggestions for choosing anti-virus software

* a discussion of freelancers' rates

* a recommended list of reference works (printed and electronic) for editors

* a low-tech guide to Wintel computer maintenance

* information about installing a firewall on your computer

You can read Dan's articles here:

http://www.editorsdesktop.com/articles.html

And you can check out his editing services here:

http://www.editorsdesktop.com/index.html

Posted in Editing | Leave a comment

Repeating Macros

If you record macros to help automate your editing, you've probably bumped into a seemingly insurmountable problem: You can get a macro to find something, and then do something, but not more than once. For example, let's say you want a macro to do this:

1. Find text formatted with the Heading 1 paragraph style.

2. Move to the next paragraph.

3. Insert these characters: "Tip. "

4. Repeat steps 1 through 3 until there aren't any more Heading 1 paragraphs to find.

You can get a macro to do steps 1 through 3, just by recording those steps. But how do you get it to do step 4 (other than running the macro 587 times)?

Well, you can't just record that part. You have to go *into* the macro and insert the commands that will make it repeat. Here's how to proceed:

IN WORD 97 AND ABOVE

1. Record the steps you want your macro to take (find something, then do something). You can learn more about recording macros here:

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

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

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

2. After you've stopped the macro recorder, click "Tools > Macro > Macros."

3. Click the macro you just recorded (you may need to scroll down the list to find it).

4. Click "Edit." The macro editor will open on your screen, showing the commands you've recorded. For example, if you recorded steps 1 through 3, above (way above: "1. Find text formatted with the Heading 1 paragraph style," and so on), here are the commands you'd see:

Selection.Find.ClearFormatting

Selection.Find.Style = ActiveDocument.Styles("Heading 1")

With Selection.Find

.Text = ""

.Replacement.Text = ""

.Forward = True

.Wrap = wdFindContinue

.Format = True

.MatchCase = False

.MatchWholeWord = False

.MatchWildcards = False

.MatchSoundsLike = False

.MatchAllWordForms = False

End With

Selection.Find.Execute

Selection.MoveDown Unit:=wdParagraph, Count:=1

Selection.TypeText Text:="Tip. "

(Note: If your version of Microsoft Word inserts the following command as the third line in the macro--"Selection.Find.ParagraphFormat.Borders.Shadow = False"--take it out. As far as I can tell, this comes from a bug in Microsoft Word, and you don't want it in there.)

You can probably tell by reading these commands what they do. All but the last three set up the parameters for your search. The third command from the bottom executes the search. All of this constitutes the "find something" part of the macro.

The last two commands constitute the "do something" part. In this example, they move down one paragraph and type in the string of characters. Our challenge, of course, is to get these commands to repeat--and then get the Find command to repeat. And to keep repeating everything until there's nothing left to find.

So here's the secret: Just before the "do something" part of the macro, insert the following command:

Do While Selection.Find.Found

That tells Word to keep doing the "do something" part as long as ("While") Word finds the "find something" part.

Of course, you also want Word to keep doing the "find something" part, too. So, you have to include the following command at the end of the "do something" part:

Selection.Find.Execute

That tells Word to execute the Find command again--as long as something continues to be found.

Finally, to tell Word where to *stop* repeating, you have to insert this command:

Loop

When you're finished, the whole thing will look like this (except that I've added an X to show you each command we've added):

Selection.Find.ClearFormatting

Selection.Find.Style = ActiveDocument.Styles("Heading 1")

With Selection.Find

.Text = ""

.Replacement.Text = ""

.Forward = True

.Wrap = wdFindContinue

.Format = True

.MatchCase = False

.MatchWholeWord = False

.MatchWildcards = False

.MatchSoundsLike = False

.MatchAllWordForms = False

End With

Selection.Find.Execute

X Do While Selection.Find.Found

Selection.MoveDown Unit:=wdParagraph, Count:=1

Selection.TypeText Text:="Tip. "

X Selection.Find.Execute

X Loop

That's it. Click "File > Close and Return to Microsoft Word."

Now, when you run the macro, it will *keep* running until it's finished all of the paragraphs you specified.

IN WORD 6 AND 95

Here's the macro as it appears in Word 6 and 95, with an X marking each line I've added to the recorded macro:

EditFindStyle .Style = "Heading 1"

EditFind .Find = "", .Direction = 0, .MatchCase = 0, .WholeWord = 0, .PatternMatch = 0, .SoundsLike = 0, .Format = 1, .Wrap = 1, .FindAllWordForms = 0

X While EditFindFound()

ParaDown 1

Insert "Tip. "

X EditFind

X Wend

_________________________________________

RESOURCES

Jean Hollis Weber has done it again, with her new book, Taming Microsoft Word 2000. Subtitled "Hot tips and cool tricks for business and technical documents," this 120-page compendium of basic but useful knowledge will help you become an instant expert on:

* Setting up Word 2000 to work your way

* Editing and reviewing documents

* Controlling page layout

* Using templates and styles effectively

* Getting the most from fields

* Working with large or complex documents

* Working with graphics

* Creating Web pages and PDF documents from Word

I'm especially impressed with the book's crystal-clear explanations, annotated screen shots, and elegant formatting. If you've been looking for a systematic treatment on mastering Microsoft Word, look no further. You can download a copy of the book here:

http://www.jeanweber.com/books/tameword.htm

Jean's previous book on taming Microsoft Word (for Word 6, 95, and 97) is also available:

http://www.jeanweber.com/books/tamewd97.htm

If you like either of these books, please be sure to compensate Jean for her efforts. You'll find payment instructions here:

http://www.jeanweber.com/bookshop/payme.htm

Posted in Macros | Leave a comment

Removing Directly Applied Formatting

Last week I discussed the evils of directly applied formatting but didn't explain how to get rid of it. I know what you're going to say: "Just press CTRL + A to select all and then press CTRL + SPACE." That will remove it, all right. The problem is, it will also remove italics, bold, and other formatting that you want to *keep.*

For example, let's say you're editing a scholarly tome with acres and acres of footnotes. Nearly every one of those notes is going to cite a book or journal of some kind--with the title of each publication in italics (represented here with asterisks), like this:

39. G. B. Harrison, *The Profession of English* (New York: Anchor Books, 1967), p. 166.

But if you do the CTRL + SPACE thing, you're going to get this:

39. G. B. Harrison, The Profession of English (New York: Anchor Books, 1967), p. 166.

So what are you going to do? Go back and italicize everything by hand?

There *is* a better way. In general terms, here's the procedure:

1. Identify each kind of directly applied formatting you want to keep--italics, strikethrough, whatever. Maybe make a list.

2. Find and replace each kind of formatting with a unique code. For example, you might use |I| to indicate italic and |B| to indicate bold. (More on this in a minute.)

3. Press CTRL + A to select all and CTRL + SPACE to remove all directly applied formatting.

4. Find and replace your codes with the appropriate formatting.

Now let's get specific and say you're trying to preserve italics. Here's what you'd do:

1. Click Edit > Replace to open Word's Find and Replace dialog.

2. Leave the "Find What" box empty but press CTRL + I to specify italic formatting. The box will now say "Font: Italic" underneath.

3. In the "Replace With" box, enter this:

|I|^&|I|

That code in the middle, ^&, is the "Find What Text" wildcard, which tells Word to use whatever it *finds* (in this case, any italicized text) as the *replacement* between your italic codes. You can learn more about the "Find What Text" wildcard here:

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

4. Click the "Replace All" button. All of your italicized text will now be marked with codes, like this:

39. G. B. Harrison, |I|The Profession of English|I| (New York: Anchor Books, 1967), p. 166.

(If you wanted to preserve other kinds of formatting, such as bold, you'd repeat steps 1 through 4 here, with different codes for each kind of formatting.)

5. Press CTRL + A to select all and CTRL + SPACE to remove directly applied formatting. Woo-hoo! Pretty scary, no? (You did keep a backup, right?)

6. Click Edit > Replace to open Word's Find and Replace dialog.

7. In the "Find What" box, enter the formatting codes and the * wildcard (in parentheses) to represent any text between the codes, like this:

|I|(*)|I|

8. Click the "No Formatting" button. The "Font: Italic" notation will go away.

9. In the "Replace With" box, enter this:

1

That code tells Word to use any text it *finds* between italic codes as the *replacement* for the codes and the text between them. Clear as mud? You'll understand when you try it. You can learn more about the "Find What Expression" wildcard here:

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

10. With your cursor still in the "Replace With" box, press CTRL + I to specify italic formatting. The box will now say "Font: Italic" underneath.

11. Put a checkmark in the "Use wildcards" (or "Use pattern matching") box. You may need to click the "More" button before this is available.

12. Click the "Replace All" button. All of your italicized text will be restored to its former glory--and all of the directly applied formatting that you *didn't* want (such as 12-point Baskerville) will be gone!

If you need to do this kind of thing a lot, you can record the procedure in a macro that you can use over and over again. You can learn more about recording macros here:

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

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

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

Or, if you'd like a macro that will clean up directly applied formatting (but preserve character formatting such as italic) in a whole folder full of documents at the same time, you might try our FileCleaner program, which you can learn more about here:

http://www.editorium.com/14845.htm

_________________________________________

READERS WRITE

Last week Rich Shattenberg asked if it's possible to use wildcards in a custom spell-check dictionary. You can read his question here:

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

This week, expert Word-whacker Steve Hudson sent the definitive reply:

"No wildcards in dic entries. Badda badda boom."

Many thanks to Steve. It wasn't really the answer we wanted, but it's always good to know the facts.

_________________________________________

RESOURCES

The Office Letter

The Office Letter is a weekly email newsletter that provides a plethora of tips, tricks, tools, and techniques for using Microsoft Office. It's a *nice* publication, as you can see here:

http://www.officeletter.com/current.html

And hey, the current edition includes our NameSwapper macro!

The standard edition of The Office Letter is free. The premium edition includes access to all back issues, a fast search engine, and no advertising, all for just $12 a year. You can sign up for either edition here:

http://www.officeletter.com/sub/subscribe.html

Why not check it out?

Posted in Editing | Leave a comment

Frustrating Formatting

If you use Microsoft Word, I guarantee you've been frustrated by its formatting, especially if you edit someone else's documents. For example, you modify the Heading 1 style to use Palatino rather than Arial--but Arial it remains. What's going on here?

Consider my living room wall, which I daringly painted red. Then, coming to my senses, I painted it grayish green. But wait . . . What *was* I thinking? Finally, I covered it with an almond color that looked okay.

Microsoft Word's formatting works pretty much the same way. It's done in layers, like paint on a wall.

The underlying layer is the formatting of paragraph styles. For example, if you apply the Heading 1 paragraph style using Word's defaults, your text will be formatted in 16-point Arial bold. If you attach a new template to your document (and check the box labeled "Automatically Update Document Styles"), the formatting of Heading 1 will change to whatever is specified in the new template (18-point Baskerville italic, for example). Note that this doesn't change the style formatting in your Normal template. It just paints over that formatting *in your document.* And if you "detach" the new template, the formatting won't change back. Once the paint is on there, it's on there. Of course, you can always attach a *different* template or modify the styles in the document itself if you want to change the formatting yet again.

The next layer up is the formatting of character styles. You can use character styles to format text selections smaller than a paragraph. For example, you might use a character style called Book Title to format book titles in Times Roman italic. Like paragraph styles, character styles can be changed by attaching a different template or modifying the styles in the document itself.

Finally, on the topmost layer, your document could have directly applied formatting. That's what you get if you simply select some text and apply, say, 18-point Baskerville italic without using a style. In all but the simplest documents, this kind of formatting is of the devil. Why? Because you can't change it simply by modifying the underlying style--and that means you have no way to control it (or even identify it) *throughout* the document. So, if you modify the Heading 1 style to use Palatino rather than Arial--well, Arial it remains.

How can you avoid this problem in your documents?

1. Don't use directly applied formatting.

2. Use character styles to format text selections smaller than a paragraph.

3. Use paragraph styles to format everything else.

4. To change your formatting, modify the *style* that produces it.

But what if you're working on someone else's documents? You'll probably want to remove all that directly applied formatting and use styles instead. But that's a topic for another day.

_________________________________________

READERS WRITE

Rich Shattenberg (shatts@world.cbi.org) wrote:

"I don't have a hint but I have a question and a problem. I live in the country of Madagascar. There is no Word spell checker for the Malagasy language, or at least I have not yet been able to find one. I have made a custom dictionary with about 7,000 words to do spell checks in Malagasy. However, here is the challenge.

"The word 'mandeha' means 'to go' (present tense), 'Nandeha' is past tense, and 'handeha' is future tense. For the custom dictionary, I have to enter all three words. I have not yet been able to find wildcard symbols to use in the custom dictionary.

"For example, is there a way of telling the custom dictionary to accept the word 'andeha' if there is either a 'm' or 'n' or 'h' in front of the word. This would mean I only have to make one entry for the three words."

I'm researching this, but do you, gentle reader, have an answer (or other questions, hints, or comments you'd like to share)? If so, please send me an email message here: mailto:hints [at symbol] editorium.com

_________________________________________

RESOURCES

If you're not familiar with the Tech-whirl Web site (TECHWR-L), you should be. It presents some of the finest information on technical writing and editing on the planet. You may also be interested in subscribing to the TECHWR-L discussion list, which is one *active* list. Why not check it out?

http://www.raycomm.com/techwhirl/index.php3

Posted in Editing | Leave a comment

Nameswapper

Do you ever work with lists of personal names--authors, meeting lists, and so on? If so, you could probably use NameSwapper, our new add-in program that swaps last names and first names (or vice versa, if that makes sense) in a list of names. For example, if you've got a list of names like this--

Cather, Willa

Harrison, G. B., Ph.D.

Lewis, C. S.

Tolkien, J.R.R.

--but you want them to look like this--

Willa Cather

G. B. Harrison, Ph.D.

C. S. Lewis

J.R.R. Tolkien

--NameSwapper will do the job.

I'm giving this program away! Subscribers to Editorium Update will be the first to have it, but please feel free to share it with friends and colleagues who might find it useful.

To download NameSwapper for Word 97, 98, 2000, 2001, or 2002, click here:

http://www.editorium.com/ftp/nameswapper8.zip

To download NameSwapper for Word 6 or 7 (95), click here:

http://www.editorium.com/ftp/nameswapper6.zip

The program will work on PC and Macintosh.

Once you've downloaded and unzipped (or unstuffed) the proper version of the program, you'll see the documentation, which is named NameSwapper.doc. (Open it in Word to read it.) You'll also see the NameSwapper program template, which is named NameSwapper.dot. (If you need software to unzip or unstuff the program, you can download it from http://www.winzip.com or http://www.aladdinsys.com.)

To use the template (NameSwapper.dot), follow this procedure:

1. Open it in Microsoft Word by clicking File > Open. Don't just double-click the template to open it. If you do, you'll run into problems later.

2. Double-click the large button that says "Double-Click here to install."

3. Follow the prompts on your screen.

If you have trouble with the installation, just copy the program template to Word's Templates or Startup folder. You can learn more about this here:

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

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

After the program is installed, you'll see the NameSwapper menu at the top of your Microsoft Word window. To use the program, open your list of names in Microsoft Word. The list should look something like this (if last names are first):

Cather, Willa

Harrison, G. B., Ph.D.

Lewis, C. S.

Tolkien, J.R.R.

Or, it can look like this (if first names are first):

Willa Cather

G. B. Harrison, Ph.D.

C. S. Lewis

J.R.R. Tolkien

Each name, including the last one, should be followed by a carriage return.

To swap the names in your list, click the NameSwapper menu. Then click "Put First Names First" or "Put Last Names First," depending on your list. After NameSwapper is finished, you can use Word's Sort feature (Table > Sort) to sort your names alphabetically.

NameSwapper knows how to deal with the following name "suffixes": Jr., Jr, JR, Sr., Sr, SR, I, I, II, III, IV, V, VI, VII, VIII, IX, X, XI, XII, XIII, XIV, XV, Esq., Esq, Esquire, Ph.D., Ph.D, PhD., PhD, M.D., MD., MD, D.D.S., DDS., DDS., J.D., JD., JD, Ed.D., Ed.D, EdD., and EdD.

Be sure to use NameSwapper only on lists of names--with no other text in the document. *Please* don't use it on, say, your master's thesis. Also, be sure to keep backup copies of your lists in case you need something to go back to.

_________________________________________

READERS WRITE

My longtime friend Richard O'Regan (raor@bluewin.ch) wrote:

I have another of my long legal books to do. In this one the author, preparing his work in Word for Windows, has been inconsistent about how he punctuates at the footnote reference numbers. Sometimes he puts his comma or the period after the footnote reference number and sometimes he puts it before.

I want the comma or period to precede the reference number. I can't do it with search and replace because you can't put the footnote reference (^f) in the replace box.

I replied:

You can do it with a not-so-simple find-and-replace.

In the Find What box, put this:

(^02)([.!?])

The ^02 will find the note reference numbers. The characters in square brackets will find the closing punctuation you want to transpose. If you like, you can add other punctuation, such as commas, colons, and semicolons:

(^02)([.!?,:;])

The backslash on the ! and ? are necessary to tell Word that you're using them as characters and not as wildcards. The parentheses group the items so that you can switch them around in the Replace With box, which should have this in it:

21

That tells Word to put the second group (the punctuation) first, and the first group (the footnote number) last. Doesn't the Bible say something about that. 🙂

Finally, you'll need to put a checkmark in the box labeled "Use Wildcards" (you may need to click the "More" button before it's available).

If you'd like to know about searching with wildcards, see Editorium Update for March 25 through April 25, 2001:

http://editorium.com/EUIndex.htm

If you'd like to know more about searching with numeric codes (such as ^02), see the November 21, 2000 issue of Editorium Update:

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

_________________________________________

RESOURCES

This week, another Microsoft resource: Microsoft Office newsgroups. The Web site says you can "ask questions, share information, or exchange ideas with others who use Office products, including more than 750 Microsoft Most Valuable Professionals (MVPs) worldwide." To use the newsgroups, go here:

http://communities.microsoft.com/newsgroups/default.asp?icp=Prod_Office

Then select a newsgroup from the list on the left.

Posted in Editing | Leave a comment

Customizing Shortcut Menus

Don't you love Word's shortcut menus? You know--the ones you get when you click the right mouse button. (If you're a Mac user, you can access the shortcut menus by holding down the Control key while pressing the mouse button.)

But did you know can customize the shortcut menus, putting the features you use most within easy reach? Here's how:

IN WORD 97 OR LATER

1. Click the "Tools" menu.

2. Click "Customize."

3. Click the "Toolbars" tab.

4. Scroll down the "Toolbars" list until you see the entry for "Shortcut Menus." Put a check in the checkbox next to it.

At this point, you'll see the "Shortcut Menus" menu bar in your Word window. It includes three menus: "Text," "Table," and "Draw." For now, click the "Text" menu. You can play with "Table" and "Draw" later.

You'll see a long list of the various text shortcut menus. Boy, there are lots of them! To see the one you usually get if you just click in the text of a document, click the one labeled "Text." Look familiar? If you're using our Editor's ToolKit program, you'll see a bunch of useful editing features. If not, you'll see the regular old Microsoft Word standards. You can add all kinds of commands, however, including Word features, macros, styles, fonts, and a bunch of other stuff. To do so:

1. Click the "Commands" tab in the "Customize" dialog, which should still be open on your screen.

2. Use the "Categories" and "Commands" lists to explore the various commands you can put on the shortcut menus. If you see something that catches your eye, use the mouse to drag it over to the text shortcut menu. If you change your mind, drag it off into your open document, where it will vanish into electron limbo. Want to use a different shortcut menu, such as "Comment"? Feel free.

3. Right-click an item on the menu to change its name, image, and so on. You can learn more about these options here:

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

IN WORD 6 OR 95

1. Click the "Tools" menu.

2. Click "Customize."

3. Click the "Menus" tab.

4. Click the drop-down arrow in the box labeled "Change What Menu."

5. Use your mouse to scroll down the list and click the entry for "Text (Shortcut)" or one of the other shortcut menus.

6. Use the "Categories" and "Commands" lists to explore the various commands you can put on the shortcut menus. If you see something that catches your eye, select it with your mouse.

7. In the box labeled "Position on Menu," click an existing menu item below which to place your new command. (You can also click "Auto" [to let Word decide the position], "At Top," or "At Bottom.")

8. Click the button labeled "Add Below" (or "Add"). (To remove a command, click the "Remove" button.)

9. Click the "Close" button.

Now, when you click that right mouse button, you'll see the features *you* put there.

_________________________________________

RESOURCES

Well, look at that. Microsoft has a "Frequently Asked Questions" page for Microsoft Word. This resource is definitely worth checking when you have a question about you-know-what:

http://support.microsoft.com/support/word/faq

Posted in Customization | Leave a comment

Content Vs. Presentation

Last week I introduced a program that creates typographic spaces by changing a space's point size relative to the surrounding text. But why is that a good idea? If you save a document with such spaces in almost any other kind of format--HTML, XML, or even ASCII--those spaces are going to cause problems. For example, that hair space you so carefully placed in front of those closing quotation marks will turn into a full-fledged *space*--with no "thin" about it. That can't be good.

So what's the point of using special characters and formatting? To enhance the *presentation* of a document's content. Presentation is what the document looks like. It includes such things as typeface, point size, kerning, tracking, and all of the other paraphernalia of the typesetter's art.

*Content,* on the other hand, is a document's text--and its structure: words, sentences, paragraphs, block quotations, subheadings, and chapter headings--the kind of thing you should designate with paragraph styles. In fact, the whole point of a paragraph style is what it represents--not what it looks like. The fact that your chapter heading style is named "Chapter Head" is what's important. The fact that it's currently formatted as Baskerville 16-point bold is immaterial as far as content goes.

In today's publishing environment the distinction between content and presentation is especially important, because your Word document may end up as a Web page, a Help file, an electronic book, or some other kind of presentation document that hasn't been invented yet--each with different formatting than the others. For that reason, you need to keep your Word documents free from such tinkering as artificially created thin spaces.

But there is an exception. If your Word file itself will be the presentation document (to be printed or displayed in Word), then you can go ahead and put in those thin spaces, optional hyphens, and so on--whatever will make the document look good. Be aware, however, that this *is* a presentation document--a final product. So be sure to keep a backup of your *content* document safely in a separate file. Then, when it's time to create that Web page, you won't have to spend hours cleaning up the manual tweaking you did in your presentation document. Just open the content document and off you go.

Editors need to be concerned with both content and presentation. As a book editor, I look almost exclusively at content when editing a manuscript. I usually don't even know what typeface the designer will use. But after the book has been typeset, I look almost exclusively at presentation--widows, orphans, line breaks, and so on. The difference is that the manuscript is a content document. The galleys are a presentation document. And that distinction should be kept firmly in mind.

I do not know which to prefer,

The beauty of inflections

Or the beauty of innuendoes,

The blackbird whistling

Or just after.

--Wallace Stevens

_________________________________________

READERS WRITE

Martha Bowes wrote, "Is there a workaround to get Word to show custom heading styles in the document map?"

Microsoft Word's Document Map is a highly useful feature, especially for editors. To display it, click View > Document Map. Text formatted with Word's built-in Heading styles will be displayed in the map, and you can click one of them to go to that heading in your document.

Martha wants to know if there's a way to display text formatted with custom styles in the Document Map. And there is:

1. Put your cursor on some text formatted with the custom style.

2. Click the Format menu.

3. Click Style.

4. Click Modify.

5. Click Format.

6. Click Paragraph.

7. Click the Indents and Spacing tab.

8. In the Outline level box, select the level you want the heading to have. (This is the key to making this work.)

9. Click OK.

10. Click OK.

11. Click Close.

_________________________________________

RESOURCES

The Computer Tutor of San Francisco offers an excellent online tutorial on using styles in Microsoft Word:

http://www.geocities.com/w2css/styles/

You can read the complete text of Wallace Stevens's "Thirteen Ways of Looking at a Blackbird" here:

http://boppin.com/poets/stevens.htm

Posted in Editing | Leave a comment

SpaceCadet

Two weeks ago, I explained how to "roll your own" typographical spaces (thin spaces, hair spaces, and so on) in Microsoft Word. Last week I explained how to use typographical spaces with Unicode. But if you don't want to make typographical spaces by hand and your version of Word doesn't support Unicode, you might want to try SpaceCadet, our new add-in program that makes it easy to use typographical spaces in Microsoft Word. I'm giving it away! Subscribers to Editorium Update will be the first to have it, but please feel free to share it with friends and colleagues who might find it useful.

To download SpaceCadet for Word 97, 98, 2000, 2001, or 2002, click here:

http://www.editorium.com/ftp/SpaceCadet8.zip

To download SpaceCadet for Word 6 or 7 (95), click here:

http://www.editorium.com/ftp/SpaceCadet6.zip

The program will work on PC and Macintosh.

Once you've downloaded and unzipped (or unstuffed) the proper version of the program, you'll see the documentation, which is named SpaceCadet.doc. (Open it in Word to read it.) You'll also see the SpaceCadet program template, which is named SpaceCadet.dot. (If you need software to unzip or unstuff the program, you can download it from http://www.winzip.com or http://www.aladdinsys.com.) To use the template (SpaceCadet.dot), follow this procedure:

1. Open it in Microsoft Word by clicking File > Open. Don't just double-click the template to open it. If you do, you'll run into problems later.

2. Double-click the large button that says "Double-Click here to Install."

3. Follow the prompts on your screen.

After the program is installed, display the SpaceCadet toolbar by clicking View > Toolbars > SpaceCadet. Then click a toolbar button to insert the kind of space you need. Or, press CTRL + SPACEBAR and then the character that is underlined on one of the buttons. For example, pressing 3 would create a 3-to-em space. M means em space, N means en space, T means thin space, and H means hair space. For more information, see the program documentation or the January 24, 2002, issue of Editorium Update:

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

Please note, however, that if you *can* use Unicode, that's the better way to go. You can learn more about Unicode here:

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

____________________________________________________

_________________________________________

READERS WRITE

Leonard Will (L.Will@Willpowerinfo.co.uk) wrote:

"It might just be worth while adding the warning that you should not insert any additional spaces of any kind into character strings that might be used as URLs to access Internet resources. People may use these as active links or cut and paste them into an address bar. If the spaces are very small or invisible this might lead to irritating errors that are hard to track down.

"I presume, though, that your main concern is the appearance of text printed on paper, when additional spacing may make it look better, as long as people don't realise that there is a space there!"

Right! Thanks to Leonard for this important tip.

_________________________________________

RESOURCES

If you haven't yet seen Jean Hollis Weber's book on electronic editing, you owe it to yourself to take a look:

http://www.jeanweber.com/books/e-edit.htm

This 248-page book is titled Electronic Editing, with a subtitle of Editing in the Computer Age. Published by WeberWoman's Wrevenge, the book (ISBN 0-646-38037-0) is available for Adobe Acrobat Reader (PDF). The author describes it as "a quick start guide for editing students, experienced editors making the switch from paper to online, and anyone who needs to write or edit electronically."

A broad but detailed overview of electronic editing, this beautifully formatted book makes a nice complement to our book Total Word Domination (which gives a more in-depth look at various Word features--usually different from those in Electronic Editing). I'd recommend that you get them both. Jean Weber's book explains how to:

* Define your role as an electronic editor

* Work online

* Work remotely

* Edit using Microsoft Word, Lotus Word Pro, FrameMaker, and Adobe Acrobat

* Manage e-mail when traveling

* Back up data and programs

You can see a complete (and very tempting) contents listing here:

http://www.jeanweber.com/books/edbktoc.htm

If you like the book, be sure to pay Jean for her efforts. The Web site explains the procedure:

http://www.jeanweber.com/books/payme.htm

Posted in Editing | Leave a comment