|
|
Purpose
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.
Instructions
To use it, either -
(1) type the desired fraction (without
a following space) -- e.g., 1 5/8 (one and five-eighths)
-- and play the macro;
or -
(2) place the cursor on an existing typed
fraction -- or just after the last number of the fraction --
and play the macro. [Note that QuickCorrect
fraction symbols or fractions inserted with Insert, Symbol (or
Ctrl+W) are not the same as typed fractions, so the macro
will not convert them.]
If you type the fraction (#1 above), don't
add a space or other character immediately after the last
number. While WordPerfect's QuickCorrect
requires this, the Fraction macro does not (and will not convert
the numbers to a fraction if you type a following space just
before playing the macro). If there is a following space, you
can move the cursor back to (or on top of) the fraction before
playing the macro (#2 above).
For compound fractions (i.e., mixed
numbers), such as 1 ½, type a normal space (i.e.,
not a hard space) between
the whole number (the integer) and the fraction. The macro needs
to know where the fractional part of the number begins, and the
space does that. (See also the Tips below about removing
this space, if desired.) Typing a hyphen
after the integer is okay (in WP9+):

Advantages
- Any typed fraction can be converted
-- 1/2, 3/4, 10/250, 10 5/16, etc.
- Note: In contrast,
WordPerfect's QuickCorrect
depends on a small set of built-in fraction symbols. These symbols
are used automatically by QuickCorrect (assuming it is enabled)
when you type one of the fractions in the set. 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
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.
- The fraction more closely resembles the fractions
created by WordPerfect's QuickCorrect
than if you simply usr 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.
- The macro can convert an existing typed 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
will not be converted.
Tips
- 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.
- (New in version 1.01) 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
- If you choose the option in the User Modification Area of the macro's code to remove spaces between any
whole number and the following fraction (e.g., the space between
1 and 3/4 in a number such as 1 3/4), and there are format
codes already applied to the whole number or the fraction, the
macro will not remove the spaces or may otherwise become confused.
(It cannot anticipate every possible thing you might do to format
the item.) Use regular spaces (press the <spacebar>) between
the whole number and the fraction, and without using additional
format codes.
- Playing the macro a second time on
a mixed number (an integer plus a fraction) where the space between
the integer and the fraction has been (1) removed or (2) replaced
with a hyphen can produce erroneous results: In the first case
the integer and the numerator will be combined; in the second
case, the integer might be bolded (if bold was used in the fraction).
However, if an intervening space or hyphen is present, the macro
should work properly no matter how often the macro is played
on that compound fraction.
- Typing a fraction on the first line of a
Header, Footer, Watermark or Text Box will cause the denominator
of the fraction to display slightly below the baseline. This
is apparently due to the way these items are structured. You
can add a vertical advance code (with Format, Typesetting) at
the beginning of the first line in these items to move all text
down a fraction of an inch (try 0.02") to compensate.
- The macro does not work in footnotes (but
it does work in endnotes). However, you can cut-and-paste a converted
fraction (with all its format codes) into a footnote.
|