Sorting Index Entries Letter by Letter

If you’ve used Microsoft Word’s Index feature, you know that Word alphabetizes index entries word by word, like this:

New Deal

New World

Newborn

News release

Most indexers and publishers, however, prefer to sort index entries letter by letter, like this:

Newborn

New Deal

News release

New World

Is there a way to get Word to sort entries in this way? Yes–with some manual intervention. (If you’ve never used Word’s indexing feature, you might want to read about it in Word Help before continuing.)

A typical Word index entry looks like this–

{XE “New Deal”}

–and it will sort in word-by-word order.

However, if you add a semicolon to the entry, followed by a letter-by-letter spelling (in other words, a spelling that omits the space between words), you can make the entry sort letter by letter. (In case you’re wondering, this feature isn’t documented in Word Help; you have to dig for it on Microsoft’s Web site.)

The edited entry should look like this:

{XE “New Deal;NewDeal”}

So for our other examples above, the edited entries would look like this:

{XE “New World;NewWorld”}

{XE “Newborn”}

{XE “News release;Newsrelease”}

(“Newborn” doesn’t need editing, since it’s already just one word.)

If we then have Word generate an index using those entries, they’ll be sorted letter by letter, like this:

Newborn

New Deal

News release

New World

Neat!

But now I’m wondering: Is there an automated way to edit those index entries?

[Offstage, right: Loud clanks and clunks as your correspondent rifles through his toolbox.]

Hmmm. Here’s something that *might* do the job. I’ll try it and get back to you in about a week.

_________________________________________

READERS WRITE

After reading last week’s article “Glorious Color,” Word expert Steve Hudson wrote:

I *knew* I had an unsettled feeling about your post. It’s gelled.

#1: H9 sure – but yellow on white?

#2: Printing on a black and white printer…

After reading Steve’s note, I could see where it might be easy to miss what I had in mind, so here’s a clarification:

#1: H9 sure – but yellow on white?

DARK yellow, which looks pretty good on screen. Regular yellow, as Steve points out, doesn’t work well.

#2: Printing on a black and white printer…

The point is that you use the colors only while editing on-screen. When you’re ready to print, you attach the *real* template for the final look–and then print.

Thanks to Steve for helping me clarify things.

After reading our article about making punctuation big and bold, Phil Rabichow wrote:

I enjoyed your technique for making punctuation stand out for those of us, er uh, those whose eyes may not be the sharpest (or to avoid eyestrain). I took your idea and expanded on it. I created a macro that would:

1. Create a character style called Standout that was Times New Roman, 18 points, bold, and red.

2. Handle the error in case the style already existed.

3. Replace all punctuation marks in one fell swoop with the new style.

Because of the error handling in 2. above, you can run the macro, add text with additional punctuation, and run the macro again. Also, instead of doing successive Find/Replace operations, it uses wildcards and Finds: [.,:;”‘””?!] i.e., all types of punctuation. The backslash in front of the question and exclamation marks finds those characters. The macro also finds all quotes (“) and apostrophes. Although it doesn’t show in an email, what appears to be 7 apostrophes are really 1 set of quotes, 1 apostrophe, 1 opening smart quote (Alt+0147) and 1 closing smart quote (Alt+0148). [On a Macintosh, the character numbers would be 210 and 211.] Replace contains: ^& (the operator for Find What Text) and is formatted for the Standout character style.

The macro is:


Sub BigPunctuation()
' BigPunctuation Macro
' Macro recorded 8/11/02 by Phil Rabichow
' Creates Standout style & replaces punctuation
' of selection with large red bold font
'
On Error Resume Next
ActiveDocument.Styles.Add Name:="Standout", _
Type:=wdStyleTypeCharacter
ActiveDocument.Styles("Standout").BaseStyle = _
"Default Paragraph Font"
With ActiveDocument.Styles("Standout").Font
.Name = "Times New Roman"
.Size = 18
.Bold = True
.Color = wdColorRed
End With
With ActiveDocument.Styles("Standout").Font
With .Shading
.Texture = wdTextureNone
.ForegroundPatternColor = wdColorAutomatic
.BackgroundPatternColor = wdColorAutomatic
End With
.Borders(1).LineStyle = wdLineStyleNone
.Borders.Shadow = False
End With
' Selection.HomeKey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
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.ClearFormatting
Selection.Find.Replacement.ClearFormatting
Selection.Find.Replacement.Style = _
ActiveDocument.Styles("Standout")
With Selection.Find
.Text = _
"[.,:;""" & ChrW(8220) & ChrW(8221) & "'?!]"
.Replacement.Text = "^&"
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub

Note that this macro will apply to a selection in case you only want to change some of the punctuation. If you remove the apostrophe before the line

Selection.HomeKey Unit:=wdStory

the macro will work on the entire document.

Thank you again for your time and a wonderful publication.

Thanks to Steve for the terrific macro! If you don’t know how to use macros like this one, you can find out here.

And you can learn more about improving the visibility of punctuation (including how to get the big, bold punctuation back to normal) here:

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

_________________________________________

RESOURCES

The American Society of Indexers is “the only professional organization in the United States devoted solely to the advancement of indexing, abstracting, and database building.” Their site has lots of links to indexing and publishing resources and, of course, tons of information about indexing:

http://www.asindexing.org/site/index.html

This entry was posted in Indexing. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

You must be logged in to post a comment.

  • The Fine Print

    Thanks for reading Editorium Update (ISSN 1534-1283), published by:

    The EDITORIUM, LLC
    http://www.editorium.com

    Articles © on date of publication by the Editorium. All rights reserved. Editorium Update and Editorium are trademarks of the Editorium.

    You may forward copies of Editorium Update to others (but not charge for it) and print or store it for your personal use. Any other broadcast, publication, retransmission, copying, or storage, without written permission from the Editorium, is strictly prohibited. If you’re interested in reprinting one of our articles, please send an email message to editor@editorium.com

    Editorium Update is provided for informational purposes only and without a warranty of any kind, either express or implied, including but not limited to implied warranties of merchantability, fitness for a particular purpose, and freedom from infringement. The user (you) assumes the entire risk as to the accuracy and use of this document.

    The Editorium is not affiliated with Microsoft Corporation or any other entity.

    We do not sell, rent, or give our subscriber list to anyone.