The magazine of the Melbourne PC User Group

Caret and P Help a Word User Out Of the Soup
Gordon Woolf
 
 

The text won't behave. You can't make the lines even. Gordon Woolf explains the problem when someone has used a computer as if it were a typewriter

The information Uncle Fred had written for us opened fine. But when you put the cursor in the text and clicked the toolbar button to make it justify, nothing happened. The lines stayed ragged. You could make them flush left, flush right, and centred, but they stayed doggedly uneven when you said "justify".

The problem is more common than you might think. Uncle Fred still thinks he is using a typewriter, and at the end of every line he presses the "Enter" key, which you now recall telling him is "the equivalent of a carriage return".

The answer, as with many word processor mysteries, is to get your program to show the hidden characters. Word does not have quite the detail of the venerable Word Perfect which had "show codes" with every tiny command appearing as strange characters, but Word still reveals a lot when you tell it to "show hidden characters".

You know the problem well:

You have a small boat, a wolf, a chicken and several large bags of chicken feed. You must get the animals and the feed from side A of a river to side B but can only take one load at a time (i.e. only the wolf, only the chicken...). In what sequence will you accomplish your task without exposing the chicken to the wolf and the feed to the chicken? (You need to prevent the chicken and the feed from being eaten — it can be done).

The answer will be at the end of this article, but it is easier to sort out the problem below in a Word file. Very much easier.

If you have the same setup to many, there is actually a Show/Hide button on the Standard Toolbar, but "standards" are a strange thing, and little on any toolbar is now standard.

So, let us go the long way round, to Tools then to Options and select the View tab. In the Nonprinting Characters section, select the check boxes of the characters you want to see, or just click on "all". (In Word XP, you'll find this under the Formatting Marks section.)

On screen the difference will be as between Figures 1 and 2 here, and you may see lots of those ancient paragraph symbols which look like a fancy P pointing the wrong way which monks used to inscribe in red on manuscripts even after the invention of movable type.

However, that reverse P thingummy which is used to show a paragraph cannot be typed in from the keyboard, so Word uses p. That's the caret, or the symbol above the 6 key in the top row of character keys and it's also the symbol used in many other programs including most of the page layout programs. (You can't use the Enter key because that would close the dialog box being what you can type to do whatever the highlighted button is).

If you searched for all instances of ^ p and replaced them with nothing, or a space, that would get rid of your paragraph marks OK but the whole file would be one long paragraph. Not exactly easy to read.

So we need a lesson from the man with boat, the wolf and the chicken. We have to do something just so we get to somewhere where we can undo it again.

The answer is to search for all instances of ^ p ^ p (the double paragraph mark which is the one difference between the end of 'a line and the end of a paragraph. Replace this with anything that is unlikely to occur in this article or any other. I like a string of "commercial at" symbols (also known as strudels), thus @@@@. This removes all of the genuine paragraph separations, but leaves a minor mess as it retains the end-of-line marks we need to remove next.

Lorem Ipsum

In the samples for this article, we've used the most common "nonsense" text used in typesetting, known as "Lorem Ipsum". It is intended to look like text but that the person the layout is produced for looks at the design and does not get waylaid into reading the content.

It looks like Latin, but, for example, the word Lorem does not exist in Latin. However, in response to a statement in a publishing magazine that it was just "nonsense", a Latin scholar, Richard McClintock, tracked it down to some words by Cicero on the theory of ethics, written in the year that we now call 45 BC.

The actual phrase which starts this filler text is contained in the original "Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit . . . ("There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain ...").

By repute it is thought to have been mixed up by a printer who did not understand Latin and got some text in the wrong order while moving things around, or possibly dropped it, around the year 1500.

What is most remarkable is that language has changed quite dramatically in the past 500 years, but this piece of filler text has stayed remarkably the same.

But do make sure your nonsense comes from a reliable source. Stories abound on the Internet of some of the samples having embarrassing phrases inserted, either in genuine Latin or in something which looks like Latin but which is not. This may be as innocuous as "Nil illegitimi carborundum" supposedly meaning "Do not let the bastards wear you down," after the abrasive powder invented in the past century.

For more info see http://www.straightdope.com/columns/010216.html or http://www.lipsum.com/

Then, Search for all instances of ^ p and replace with " " (a single space
with no quotes around it). This will remove all those incidental extra returns.

Finally, take your boat and chickens back to where they belong: Search for all instances of @@@@ (yes, the marker you inserted) and replace with ^ p ^ p (the double carets and p dish).

Amazingly, your article returns to looking as it should, with all the single lines gone, and paragraphs as they should be. They'll justify and words will move from line to line as you increase or reduce type sizes or margins.

This is just a start on how wonderful find and replace, or search and replace, is. You can also search on attributes, such as on font styles and colours, to differentiate between words which might seem identical, and on punctuation.

Taking this a step further you could enter the wonderful world of Grep —where you can differentiate between numbers and letters and even between some such items and others. Perhaps someone who understands Grep better than I do can take us on that journey.

Some useful help with find and replace:
http://accurapid.com/journal/l5msw.htm and on the MVPS site at  http://word.mvps.org/FAQs/General/FindingSpecialCharacters.htm.

Note that http://word.mvps.org/index.html is one of the best sources of information on how to use (and get over the annoyances of) Microsoft Word, a site kept by volunteers who use the program to its fullest, mostly as professionals.

The Answer

First you take the chicken from side A to side B of the river. Second, you take the wolf from side A to side B and pick up the chicken from side B and take it back to side A. Then you drop off the chicken on side A, pick up the feed and transport it to Side B. You drop off the feed on side B and go back to side A for the chicken — and successfully transport all three without the feed or the chicken being eaten.

More questions and answers like this can be found at http://webweevers.com/igtest.htm.

About the Author
Gordon Woolf is a long time Melb PC member who much prefers OpenOffice, but can't yet do this trick in that program! And never has been able to use oars and small boats very well.

Reprinted from the Jan / Feb 2006 issue of PC Update, the magazine of Melbourne PC User Group, Australia

[ About Melbourne PC User Group ]