An American Editor

April 17, 2017

The Business of Editing: The AAE Copyediting Roadmap IX

In The Business of Editing: The AAE Copyediting Roadmap VIII, I began discussing the macros I use during editing. My discussion continues with the Enhanced Search, Count, and Replace (SCR) macro.

I use SCR frequently during editing. The macro searches the text looking for a selected word or phrase (in the example shown below, “Ebola virus disease (EVD)”) and tells me how many times it appears in the text and in what form. The first step is to select the word or phrase to be checked, as shown here (you can make this image, as well as other images in this essay, larger by clicking on the image):

Selecting the search term or phrase

Once I have selected the search term, I run SCR. The macro automatically will “create” search variations (see image below). I can choose to let the macro search for all (leave all of the “Include” checkboxes checked) or some (uncheck those I don’t want included in the search) of those variations and by clicking the “Add terms” button, I can add variations I want included in the search (e.g., I could add “eVD” or “ebola Virus disease”). Usually I just leave all of the items checked and do not add additional terms; occasionally I make additions and changes.

SCR’s options dialog

Tip: Be sure to check what the macro is going to search for and think about it. Macros are dumb and do exactly as instructed. Consequently, if your search phrase is “T-helper (Th)” the macro will find every word that begins “Th” or “th” or “TH”. The search has the same limitations as the standard Word search. Sometimes there is no avoiding getting a return with excess information, but other times a tweak in the search term (e.g., unchecking “Th” and adding “Th-1” and “Th1”) can accomplish what you want.

Clicking OK starts the the text search. SCR searches from the point of the selected text to the end-of-text bookmark (the remhigh or refs bookmark); the search begins with the first alphanumeric character following the selected term or phrase. In my work, I do not want it to search references, tables, or figure legends; I just want the main text searched. The search is quick, and produces a report similar to that shown here:

Search results

In this sample search, two instances of “EVD” and no instances of “Ebola virus disease” were found. Because this client has a general rule (I write “general” because there are times when the rule is not applied) that an acronym/initialism has to appear more than three times in the chapter (if it does not, then instances of the acronym/initialism have to be spelled out; if it does, then subsequent instances of the spelled out version need to be converted to the acronym/initialism), I know to convert “EVD” to “Ebola virus disease” in this chapter. I do so by entering the text in the replace field as shown here:

Replacing text

Clicking OK will cause the macro to replace those instances of “EVD” with “Ebola virus disease” as shown below. Note in the image that the change is automatically made with tracking on.

Replacing the text with tracking on

I repeat the procedure in the next images to show what happens when there are more than a few options found. In this next example, the chosen phrase is “World Health Organization (WHO)”:

Selecting the search term

The SCR macro automatically looks for the variations shown here:

SCR automatically searches for these variations

and returns the report shown here:

The search results

There are 75 instances of WHO (#1 in above image) and two instances of World Health Organization (#2) in the chapter. Applying the client’s rule, the 75 instances of WHO need to be highlighted (#3) and the two instances of World Health Organization need to be changed to WHO (#4).

Tip: The count that is returned by the SCR macro does not include the original selected text. In this example, the selection was “World Health Organization (WHO)” (see earlier image), so that instance was not included. What that means is that the true count is 76 instances of “WHO” and three instances of “World Health Organization” appear in the text. Had I selected only “World Health Organization” as the search text, “WHO” would not have been counted unless I manually added it as an additional search term, meaning that the search result would have been three instances of “World Health Organization”.

When searching, the macro (most of the time, but not always) ignores parentheses and square brackets. To make it easier to add additional variations or to enter replacement text, when I select the text to be searched for, I also copy it to the clipboard. That way I can paste the phrase into the appropriate blank field rather than type it and just make adjustments to the original search text to create additional search variations. Most of the time that works easily; sometimes it is easier to type what I want added.

To highlight the instances of WHO, I check the Highlight box (#3) for those that I want highlighted. The purpose of highlighting the text is so that as I edit the chapter, I can see that I have already made sure that the acronym/initialism has been spelled out and/or that the phrase has been checked (perhaps, e.g., I confirmed that the spelling or name is correct, such as “bevacizumab” or “chikungunya” or “Chinese National Biotec Group”). To change “World Health Organization” to “WHO”, I type “WHO” in the Replace Text field (#4).

Clicking OK causes SCR to do the designated tasks. When done, the results appear as shown here:

Highlighting and replacing text

Instances of “WHO” have been highlighted (#1, #3, and #4) and the two instances of “World Health Organization” (#2 and #3) have been deleted and replaced by “WHO.” Note, however, that the first instance of “World Health Organization” (#1), which is the instance that I had selected for the search term (see earlier image) remains. Note also that the deletions of “World Health Organization” and the additions of “WHO” are shown as tracked changes. If tracking is off, SCR turns tracking on, makes the changes, and turns tracking off; if tracking is on before it runs, it leaves tracking on when it is finished.

SCR performs another very valuable function in my editing: It helps me determine whether the acronym/initialism or the spelled-out version predominates. It is not unusual to get a report indicating the acronym/initialism appears, for example, five times and the spelled-out version appears six times. When that happens, as the editor I need to decide which form to use and which to replace. Of course, also entering the decision-making process is how I will justify my decision and whether I have an explicit instruction from the client that tilts the balance scales toward a particular response.

Tip: I also use SCR to determine whether a phrase appears in another form later in the text. For example, if I come across the phrase “tumor necrosis factor beta,” I will run SCR and add these 11 search terms using the “Add terms” feature:

  • tumor necrosis factor-beta [note the hyphen]
  • tumor necrosis factor–beta [note the en-dash]
  • tumor necrosis factor β
  • tumor necrosis factor-β
  • tumor necrosis factor–β
  • TNF-beta
  • TNF–beta
  • TNF-β
  • TNF–β
  • TNFβ
  • TNFbeta

When I get the report, I can determine whether any of the 12 phrases (the original selection plus the 11 added terms) appear later in the text and if they do, how often. That allows me to decide which form to use and which ones I need to change so that usage is consistent — and to make any necessary changes immediately. SCR is another tool in my consistency arsenal. Once I make the decision, assuming this is my first encounter with the phrase, I note my decision on the stylesheet and add the change to the Never Spell Word project-specific dataset (see The Business of Editing: The AAE Copyediting Roadmap V) so that the change is implemented in all subsequent chapters.

SCR is a more sophisticated form of Word’s Find & Replace function. Using Word’s Find & Replace requires multiple searches to be sure that most of the likely variations have been searched for. In addition, using Word’s Find & Replace doesn’t provide an easy way to mark text so that you know you have already checked it and it is okay.

Although the examples I use are nonfiction, SCR is a great tool for fiction editors. For example, you can search for character names and spelling variations (Mariah, Marya, and Maria are three spellings of the same name — although if the results came back Mariah = 100 and Maria = 63, I would query the author [and myself] whether these are the same character or different characters, and if the same character, which is the correct spelling).

Which leads us to…

It’s the rare manuscript that can go through editing and not have comments or queries inserted; in all of the hundreds of manuscripts I have edited, there have only been two or three. The Business of Editing: The AAE Copyediting Roadmap X discusses how I use, insert, and edit comments/queries during editing.

Richard Adin, An American Editor

February 13, 2013

Editing Tools: MultiFile F&R and Search, Count, Replace

As regular readers of this blog know, I occasionally discuss macros that are included in the EditTools package. I created EditTools to enhance my editing skills, and to increase my productivity and efficiency, and thus increase my effective hourly rate.

In past articles, I have discussed the Author Query (The Business of Editing: Author Queries), Never Spell Word and Toggle (The Business of Editing: Consistency), and Journals (The Professional Editor: Working Effectively Online IV — Mastering Macros) macros. In this article, I tackle two more of the macros in EditTools: MultiFile Find & Replace and Enhanced Search, Count, & Replace.

MultiFile Find & Replace

On occasion, while editing a chapter, I discover that I made an error in previous chapters or that a style decision I made in earlier chapters has met its nemesis in the current chapter and needs to be changed. In the olden days, this meant that I had to reopen each chapter I had previously edited and do a find-and-replace. This was time-consuming, and because I work on a per-page basis, potentially costly. Thus was born MultiFile Find & Replace (MFR).

When I have finished editing a chapter (document), I place it in a different directory than the directory that contains chapters yet to be edited and the chapter I am currently editing. Edited chapters that I have not yet sent to the client are placed in an MFR directory; once they are sent to the client and thus no longer subject to my revision, they are moved to the Done directory.

(My directory structure for a project is as follows: The parent directory is the name of the client [e.g., XYZ Publishers] and each project from this client has its own subdirectory, which is the name of the project or its author(s). The subdirectories within the project directory are Original, CE, Figures, Count, MFR, and Done. Original contains all of the files I receive from the client for the project. This assures me that I always have access to the base files. The files in Original are then sorted, with figure files copied [not moved] to the Figures directory and the text files to be edited copied to the Count directory. I next count the manuscript pages contained in the files in the Count directory. [I often do not receive all of the files for a project at the same time, which is why there is a Count directory.] Once a file has been counted, it is moved [not copied] to the CE directory for editing. After editing, the edited file is moved to the MFR directory, where it remains until it is added to a batch of files for shipping to the client. When sent to the client, the file is moved to the Done directory.)

MFR works just like the normal find-and-replace except that it works on every file in a directory and it automatically tracks changes. The same caution that you would exercise with Word’s find-and-replace, you need to exercise with MFR. MFR opens a file, does a search, replaces where appropriate, and then saves the newly revised file.

Before I created EditTools, I used MFR in a prospective fashion. I used it to make changes to files that are waiting to be edited. However, I rarely do this anymore, preferring to make use of EditTool’s Never Spell Word macro for prospective changes.

Enhanced Search, Count, & Replace

Enhanced Search, Count, & Replace (ESCR) is a workhorse macro for me. It is one of my most often used macros; perhaps the only macro I use more frequently is the Toggle macro.

As I have said in prior blog posts, I work on a lot of professional books. The one commonality to every professional book — regardless of subject matter — is that acronyms are used extensively. Acronyms are the shorthand language to which “insiders” of a profession are generally privy. Yet not all acronyms are commonly understood even by “insiders.” I daresay that most people know what is meant by AIDS, even if they cannot give the definition of the acronym, but do not know either the meaning or definition of CREST as used in CREST syndrome (for the curious, CREST means “calcinosis cutis, Raynaud phenomenon, esophageal motility disorder, sclerodactyly, and telangiectasis”).

Consequently, my clients generally have a rule that they want applied: Every acronym — except the most commonly understood acronyms — has to be spelled out at first use in a chapter (sometimes a book); to be kept as an acronym, it must be used at least three times in the chapter (otherwise spell it out); and subsequent spell outs of the acronym need to be changed to the acronym for consistency.

In olden days, this was a problem. It was a nightmare when editing was done on paper; it downgraded to a headache (albeit a severe one) with the advent of computers and increasingly sophisticated word-processing search functions. Yet even today this is a major headache in the absence of ESCR.

ESCR is not perfect by any means, but it is a significant improvement over other methods of searching for an acronym and its spelled out version, counting the number of times each appears, and replacing the miscreant versions. With ESCR, my process is greatly simplified and the time it takes to search, count, and replace is reduced to seconds.

By the way, although I am always talking about using ESCR for acronyms, the macro is not limited to acronyms. That is just how I primarily use it. ESCR will work on any word or phrase that you can select, so if you want to know whether the author excessively uses the phrase in order to, ESCR will do the job — and it will let you change the phrase to something else.

At the first appearance of an acronym, I ascertain whether it is spelled out; for example, does it appear as acquired immunodeficiency syndrome (AIDS) or just AIDS? If it doesn’t appear both spelled out and in acronym form, I add the spelled out version so that both appear. I then select both the spelled out phrase and the acronym, including the parens or brackets, and run ESCR. (How do I know that it hasn’t been spelled out previously? Because if it had been, it would have been highlighted, which is the signal to tell me that I already have checked this acronym and it has already been verified and spelled out.)

ESCR generates a report that tells me how many times, for example, each of AIDS, AIDs, Acquired immunodeficiency syndrome, acquired immunodeficiency syndrome, and Acquired Immunodeficiency Syndrome appears in the remainder of the open document. It excludes from the count the selected text; it only counts subsequent instances. I then have, for each item it reports, the option to have ESCR replace the existing text with different text or to highlight the existing text. So, if ESCR reports the following (the number following the text indicating the number of times the text appears subsequently in the document):

  1. AIDS     15
  2. AIDs     2
  3. Acquired immunodeficiency syndrome      5
  4. acquired immunodeficiency syndrome     10
  5. Acquired Immunodeficiency Syndrome     1

I can tell ESCR to highlight every instance of items 1 and 5, indicating they are OK as they are, and to change the text of items 2, 3, and 4 from what they currently are to AIDS. ESCR will then go through the document — and with track changes on — will highlight every instance of AIDS and Acquired Immunodeficiency Syndrome, but will change every instance of AIDs, Acquired immunodeficiency syndrome, and acquired immunodeficiency syndrome to AIDS. (The highlighting serves two purposes: [a] as already noted, it tells me that the acronym was spelled out earlier in the document, and [b] that the highlighted material is correct.)

What could be easier or more efficient? ESCR and MFR make my editing more productive, more efficient, and more accurate.

Blog at WordPress.com.

%d bloggers like this: