| Barry MacDonnell's
Toolbox for WordPerfect
Macros, tips, and
templates for Corel® WordPerfect® for Windows®
| Page updated Jan 31, 2014
|Convert any typed fraction to super- and subscripted format like those created with QuickCorrect and the WordPerfect symbol set|
This WordPerfect 9+ macro automatically converts any typed fraction (e.g., 15/100) to a super- and subscripted number. (WordPerfect 8 users: See left sidebar for the early version of this macro.)
Fraction.wcm produces fractions very similar in appearance to those in the WordPerfect symbol set: 1/2, 1/3, 1/4, etc. That is, the fractions will be similar to the small set of fractions that are created with QuickCorrect (if turned on with Tools, QuickCorrect, Replace words as you type) or that can be inserted with Insert, Symbol (or Ctrl+W), Typographical Symbols.
This example compares "1/200" after it was converted by the macro, and "1/2" after it was automatically inserted as a WordPerfect symbol by QuickCorrect:
See Advantages below.
• Any typed fraction can be converted -- 1/2, 3/4, 10/250, 10 5/16, 12-1/32, etc.
Notes and related tips
¤ In contrast to the Fraction macro, WordPerfect's QuickCorrect depends on a small set of built-in fraction symbols: 1/8, 1/4, 1/3, 3/8, 1/2, 5/8, 2/3, and 7/8 (but curiously, not 3/4).
¤ WordPerfect's own fraction symbols can be used automatically by QuickCorrect (assuming it is enabled) when you type one of the fractions that is also in the symbol set (assuming the symbol has been included as an entry in the QuickCorrect list). They can also be inserted with Insert, Symbol, Typographical Symbols. If they are used in a document, they can be seen in Reveal Codes.
¤ These WordPerfect symbols will not be converted by the Fraction macro; instead, you must use typed fractions in the document if you want the Fracion macro to convert them.
¤ Since the Fraction macro can convert any typed fraction, you might wish to remove the aforementioned fraction symbols from the QuickCorrect entry list: Click on Tools, QuickCorrect; then highlight (left click on) the entry; then click Delete Entry.
• The fraction produced by the macro more closely resembles the fractions created by WordPerfect's QuickCorrect than if you simply used superscript and subscript formatting (i.e., Format, Font).
For example, the denominator "sits" on the text baseline when you use this macro, rather than below it. You can see this more exactly if you increase the document's View, Zoom setting (or simply hold down the <Ctrl> key while you rotate the mouse wheel).
• The macro can convert an existing fraction elsewhere in the text as well as the one just typed, with no need for a menu or other dialog. Just place the cursor on the existing fraction and play the macro.
Note that the existing fraction must have been typed; a WordPerfect symbol fraction (see Notes above) will not be converted.
☼ On some monitors at certain screen resolutions, the fraction may appear too small or "cramped". Try a test printout and see if the macro produces an acceptable printed fraction. The fraction looks best at font sizes in the range of about 10-14 points. With font sizes outside this range you may want to adjust the vertical and horizontal advance commands in the User Modification Area of the macro's code. There, you can also remove the [Small] relative font size attribute if you want the fraction to appear in normal size text.
☼ The macro can be assigned to a toolbar button or keystroke combination for easy access while typing.
☼ You can set an option in the redlined User Modification Area of the macro's code to have the macro automatically remove any spaces between a whole number and the fraction. You can also have the space replaced with a regular hyphen or a hard hyphen. (See limitations below.)
Known limitations and workarounds