|
How to create a character with a bar over itUsers often want to know how to create a bar or line over a character or word. There are several ways to do this; which way is best for you will depend on the application. Long vowelsOne reason for putting a “line,” “bar,” or “hyphen” over a character is to indicate a long sound. Although this could be done using an EQ field (as described below) and a hyphen, this is not necessary in recent versions of Word. Modern Unicode fonts contain characters (both upper and lowercase) with both the macron (long mark) and breve (short mark), as well as a variety of other accents. These are located in the Latin Extended-A character subset of the Insert | Symbol dialog, as shown in Figure 1. (In Word 2007 and above, access this dialog by clicking on Symbol in the Symbols group on the Insert tab of the Ribbon and selecting More Symbols...)
Figure 1. The Symbol dialog showing characters with long and short marks Note that if you need to use these characters frequently, you can assign shortcut keys to them. For more on using the Symbol dialog, see “How can I insert special characters, such as dingbats and accented letters, in my document?” Arithmetic mean, shorthand charactersAnother frequent request is for the “x bar” character (used to indicate the arithmetic mean in mathematics and statistics), shorthand characters such as c with a line over it (shorthand for “with”), and certain medical symbols. Two methods are presented here. Combining diacriticsErick Groot has pointed out a more elegant approach for creating these characters than the field solution described below. The Combining Diacritical Marks character subset in the Symbol dialog contains two characters that can be used to add a line over most alphanumeric symbols. Unicode character 0304, the Combining Macron, is suitable for lowercase letters, while U0305, the Combining Overline (highlighted in Figure 2 below), is suitable for uppercase characters and numbers.
Figure 2. The Symbol dialog showing combining diacritical marks As the name suggests, these characters combine with others; specifically, when one is inserted, it combines with the previous character. There are several ways to insert either character.
EQ fieldIf for some reason the combining diacritics described above are not satisfactory (or are not present in the font you are using), another way to create characters of this nature is to combine the character desired with the overbar character, which can be found in most fonts at ASCI 0175 or Unicode 00AF (in the Latin-1 character subset; see Figure 3). These characters can be combined using the EQ \O (overstrike) field. (As noted below, this method has other applications, which are elaborated further in the article on “Superimposing Characters.”)
Figure 3. The Symbol dialog showing the overbar (macron) character There are two ways to create an EQ field (or any other field). Direct compositionIf you are comfortable with creating fields “by hand,” press Ctrl+F9 to insert the field delimiters (the characters that look like braces but cannot be typed from the keyboard) and type the required text between them. The syntax of the EQ field is well documented in the “Field codes: Eq (Equation) field” Help topic. Even if you choose to use the Field dialog to begin with, once you have inserted and edited a number of fields and become comfortable with the syntax, you may find it more efficient to create them from scratch. The Field dialogUsing Insert | Field, you can select the EQ field and use the various buttons in the Field dialog to insert the required switch and arguments. Again, reference to the Help topic will guide you. In Word 2007 and above, access this dialog by choosing Field... from the Quick Parts menu on the Insert tab of the Ribbon. The appearance of the Field dialog varies among Word versions. Figure 4 shows how it looks in Word 2002, 2003, and 2007.
Figure 4. The Field dialog for the Eq field in Word 2002/2003 When using the Insert | Field dialog, you may be tempted to click the button for Equation Editor… Don’t! The Equation Editor is a very helpful applet, but (a) it may not be installed on your machine, and (b) it is overkill for this task. Instead, click the Field Codes button, which will open the dialog shown in Figure 5.
Figure 5. The Field dialog reached by clicking the Field Codes button for the Eq field In this dialog, click on the Options… button to reveal the dialog shown in Figure 6.
Figure 6. The Field Options dialog for the Eq field Click on the \O() switch as shown and click Add to Field, which will give the results shown in Figure 6. Between the parentheses, type the two characters you want superimposed, separated by a comma (semicolon if you use a comma as a decimal separator). In the case of the x bar, this will give the result shown in Figure 7.
Figure 7. The Field Options dialog for the Eq field with the \O switch and arguments entered Note that characters that cannot be entered from the keyboard (such as the overbar) can be inserted later by editing the field manually. You can also insert an overbar directly into the Field dialog by pressing Alt+0175 (using the keys on the numeric keypad only—not the top number row). Click OK to close the Options dialog and OK again to close the field dialog. The field shown in Figure 8 will be inserted in your document. (The top version is the field code; the bottom one is the result.)
Figure 8. Eq field code and result inserted by the Insert | Field dialog If you find that the overbar is too high or low to display properly, you can edit the field code by hand. Press Alt+F9 to display field codes, select just the overbar, and use the Format | Font dialog (as shown in Figure 9) to raise or lower the character. (In Word 2007 and above, access this dialog from the context (right-click, shortcut) menu or by using the dialog launcher arrow at the bottom right corner of the Font group on the Home tab.) Some trial and error will probably be required. Also see the Important Note below.
Figure 9. The Character Spacing tab of the Font dialog Other applicationsThe EQ \O field can be used to superimpose other characters besides the overbar. It is almost always possible to find a made-up font character for most accented letters, but if a nontraditional one is needed, it can be created with this field. Similarly, users sometimes want a slashed zero, which can be created by combining the zero and slash characters: { EQ \O (0,/) } The behavior of this field in mathematical calculations may not be as expected. A better solution is to find a font in which the zero is already slashed.
Upper borders on characters and wordsThe same EQ field can be used to create lines over characters and words in a different way by using a different switch, the \X switch. To get an idea of the results of this field, try this experiment:
Figure 10. The Borders and Shading dialog showing a box border around text
You will see that you have created a box around the selected text, as shown in Figure 11.
Figure 11. Text with a box border around it The Borders and Shading dialog is deceptive here; it appears that you can apply a border to selected sides of words, but in fact what you get is always a box. This can be very useful (for one application, see the “Other applications” section below), but it’s not always what you want. Using the EQ \X field, you actually can apply a border to selected sides. This field can be constructed in the same two ways described above, by direct composition or using the Insert | Field dialog. Refer to that section for instruction on using the dialog. There are only two things you do differently in constructing this field. Different argumentsWhat goes between the parentheses is the text to which you want to apply a border. You can copy and paste this into the dialog if desired (using Ctrl+V to paste). Extra switchesThe EQ \X field accepts four additional switches. \to Draws a border above the element \bo Draws a border below the element \le Draws a border to the left of the element \ri Draws a border to the right of the element If you do not include any of these switches, you will get a border on all four sides of the text (similar to the box you got using the Borders and Shading dialog). Obviously, if you want a line over a character or word, you need to use the \to switch. Note that the weight of the line and the distance from text cannot be changed (the distance from text cannot be changed in the Borders dialog, but the line weight and style can be edited). Other applicationsThe EQ \X field with the \bo switch offers an alternative to underlining for drawing a line under text. In some fonts where the underline is too close to the text, this can be helpful for text that needs to be underlined. Note, however, that headings underlined this way will not be picked up by an automatically generated table of contents (TOC field). One of the most useful applications of this field (which can also be accomplished, with some effort, using the Borders and Shading dialog) is to create an empty check box for a printed form. I find this much more satisfactory than any of the box characters available in any font. Approximately three spaces between the parentheses in the field will create a square box, but note that the trailing space will need to be removed from the field (see Important Note above). The secret to creating a similar box using the Borders dialog is to use at least one nonbreaking space (Ctrl+Shift+Spacebar) since Word will not put a border on ordinary spaces. Figure 12 shows the results of these two methods. Note that the box created using Borders is better proportioned to the font size and won’t affect line spacing; the point size of the box created with the EQ field will need to be reduced to maintain the line spacing.
Figure 12. Text borders created by the EQ \X field and the Borders dialog Saving your creations for reuseNo matter which method you use to create a character with a line over it, you can save the result as an AutoText or AutoCorrect entry for ease of future insertion. This article copyright © 2004, 2008, 2011, 2014, 2015 by Suzanne S. Barnhill. |