Home | Tips | Library | Other Authors | Other WP Sites | Writer's Links | Contact | Site Map | Donate |
![]() Toolbox for WordPerfect |
||
Macros, tips, and
templates for Corel® WordPerfect® for Windows® |
Page updated Dec 4, 2021 |
|
WordPerfect
Tips Main tips page | Browse more tips |
||
Reduce spacing between a paragraph Heading style and the
following body text (and other paragraph style tips) Related tips - • For tips on double spacing or custom line spacing, and paragraph spacing and indentation see here. • For a macro that can add block protection (same as Format, Keep Text Together, Block Protect) to up to 5 of your user-specified or default paragraph styles (e.g., Heading 1 - Heading 5) found in a document to keep the style(s) and the next two lines of body text together on the same page see here. • To create outdented heading paragraph styles with a graphic line in the space below the headings as "separators" see the tip below. |
Method While you can adjust inter-paragraph spacing
throughout the entire document (or for selected paragraphs) in one step
with Format, Paragraph, Format, <Spacing between paragraphs>, you
might want to adjust just the space between paragraph styles
(e.g., Heading 2 or MyHeadingStyle 5) and the following paragraph's
body text.
The method below adopts the latter approach by reducing just the space between individual paragraph styles used as headings (NOT headers) and their immediately following paragraphs. Step 1.
Either create a new paragraph heading style with Format, Styles, Create ... or edit your existing style with Format, Styles, <stylename>, Edit. This brings up the Styles Editor dialog. [Note that your Styles Editor should show the Style name and Description filled in (they are left blank in these screen shots) and might have a different font name and/or point size]: ![]() Step 2. At the bottom of the Styles Editor dialog window, be sure to check (i.e., tick to enable) the checkbox, "Show off codes": ![]() Step 3. In the Contents window of the Styles Editor, place the cursor before all codes (as above). Then, on the Styles Editor menu, click on Format, Typesetting, Advance to bring up the Advance dialog: ![]() Click the "Down from insertion point" radio button, then set the Vertical distance to (for example) 0.15": ![]() Click OK to dismiss the Advance dialog. Step 4. Again, be sure the checkbox at the bottom of the dialog entitled "Show 'off codes'" is enabled (ticked); then position the cursor in the Contents window after all codes (especially after the [Codes to the left are ON, codes to the right are OFF] code, which is a sort of placeholder for the text to which the style will be applied). Again, click on Format, Typesetting, Advance to bring up the Advance dialog. This time, click the "Up from insertion point" radio button, then set the Vertical distance to the same as in Step 3 -- (e.g.) 0.15": ![]() Click OK to dismiss the Advance dialog. Step 5. You should now see something like this in the Styles Editor (but with your own Font and/or Font size, and with your own Style name and Description filled in): ![]() Click OK twice to return to the document. Note: Normal,
12-point text gives 6 lines per inch, or 0.167" between base lines. The
above method adjusts the inter-paragraph space to 0.017" (i.e., 0.167-0.150).
This setting assumes you will have a hard return (i.e., a
blank line) between the headings and the following paragraphs, so
it adjusts the amount of inter-paragraph blank space by reducing it. Be
sure to adjust the vertical advance down/up settings to match your particular
needs.
Optional: Save (copy) the style to your default template so that it can be used in any new (blank) document based on the default template: Click Format, Styles, <select the style from the list>, Options, Copy, Default template, OK. Other tips Tip 1
If you need
to mark a custom Heading style for automatic inclusion in a Table of
Contents, see here.
Tip 2 Some
paragraph formatting in the body text area of a document can be
"inherited" by a Paragraph Style further down in the document.
One type of such
formatting is using "First line indent" in Format, Paragraph, Format --
usually at the top of the document -- to automatically indent the first
line of all paragraphs (i.e., text ending with a hard return or
equivalent).
So, for example, if you had set this format to a non-zero amount (e.g., 0.3"), any Paragraph Style of the same type further down in the document (e.g., a Heading style) will also become indented that same amount -- which probably is not what you want for Headings. Moreover, if you try to set a Heading's "First line indent" back to 0" with Format, Paragraph, Format in the Heading's Styles Editor, you might notice that WordPerfect will not insert a code if it is the same as the current (or default) setting for that particular formatting. WordPerfect abhors using (some) duplicate format codes. Here's a way to overcome that limitation: In the Heading's Styles Editor, insert a "First line indent" setting (at the beginning of all codes in the Contents pane, with the Editor's Format, Paragraph, Format menu) that is greater than 0" -- and then immediately insert another one that is equal to 0". The second code ([First Ln Ind: 0"]) will take precedence since it is "downstream" from the first code. Then exit from the Styles Editor. (Bring up the Editor again and you should see a [First Ln Ind: 0"] code there. And all the Headings (of that format style) should now start at the left margin, not at the first line indent value the other paragraphs have.) Related tip: In a similar manner to that above, you can reset the Left (or Right) margin adjustments in the Heading style that you might have made in the document with Format, Paragraph, Format dialog. Create outdented section headings (i.e., NOT headers)
with graphic lines in the space under them that extend to the right
margin.
This will look something like this example on your document page (note the left page margin in this example is where the "officia..." line begins; the heading text and graphic line are outdented from it and from the following text):
This is easily done by creating a paragraph heading
style similar to the one created in the 5-step method above, but with some extra
formatting inside the style itself:
![]() But it's even more useful when the style is created and applied automatically with a macro such as the one below. [You can play the macro in a document to create the style and then double-click on the [Style] code to view the extra formatting in the Styles Editor's Contents pane. The specific dimensions of the formatting (e.g., Graph Line, VAdv code) can be seen by hovering the mouse over the codes.] To copy the following code into your WordPerfect program to create a working macro see here. Modifications: Notice the 8 variables (shown in bold) defined at the top of the macro code (v...). This is where you can make changes to the macro for your preferred heading style name and description, heading outdent dimension (in inches), heading font name and size, and whether to use SmallCaps for the heading and/or add bold, or add italics (but only if SmallCaps is not used). Suggestion: Play the macro in a new blank document (or a copy of your current document) first to see how it works before using it in a production document. // Macro code begins here // Name: Outdented section headings with graphic lines.wcm // Purpose: Creates a "section heading" paragraph style in the current // document with (by default) - // 1. the heading text in Small Caps, // 2. outdented a specified amount from the left margin, and // 3. a thin graphic (under)line extending to the right margin. // [This style is based on a heading style used in WordPerfect's // "Standard Resume" Project.] // The style can then be accessed anytime in that document from the // Select Style list on the text property bar (or with Format > Styles). // = = = = = = = = = = // Set your preferences for the style here: // Set the name of the style here, enclosed in double quote marks. // (12 characters maximum, including any optional underscores.) vStyName := "_SectionHead" // Set the description of the style here, enclosed in double quote marks. vStyDesc := "Section heading underlined to margin" // Set the amount to "outdent" the heading from the current left margin. // Use a minus sign (-) before the amount. (i = inches, c = centimeters) // Or you can use 0 (zero) for NO outdenting (e.g., vOutdent := 0). vOutdent := - 0.35i // Add a different font for these headings using the font name as shown // in the property bar's font list, enclosed in double quotes. (NOTE: You // can skip this formatting and use the current document font by using // vFontFace:="") vFontName := "Arial" // Set the font size for heading text in points (1 point = 1/72 inch) but // without double quotes. // Fractional sizes (e.g., 14.5p) are allowed. (NOTE: You can skip // this formatting and use the current document font size by using // vFontSize:="") vFontSize := 15p // Set these headings in SmallCaps (1=Yes, 0=No). vSmallCap := 1 // Add bold to these headings (1=Yes, 0=No). vBold := 0 // Add italics to these headings (1=Yes, 0=No). vItalic := 0 // [<-- NOTE: Italics is NOT compatible with SmallCaps] // = = = = = = = = = = // Main macro processing begins here: vHRt:=NToC(0F90Ah) // (<= used in messages to insert a hard return) // If a same-named style is already available, skip creating it (trying to // create a style with the same name creates an error condition): OnError (SkipApplyStyle@) // .....Create the basic style: StyleCreate (Name: vStyName; Type: AutoParagraphStyle!; Library: CurrentDoc!) StyleEditBegin (Style: vStyName; Library: CurrentDoc!) StyleDescription (Description: vStyDesc) StyleEnterKeySetting (Action: StyleOff!) StyleCodes (State: WithOffCodes!; Library: CurrentDoc!) // .....Set the hanging "outdent" amount from the left margin: MarginAdjustLeft (AmtToAdjust: vOutdent) // .....Create the balance of the style's text formatting: If (vFontName<>"") Font (vFontName) Endif If (vFontSize<>"") FontSize (vFontSize) Endif If (vSmallCap=1) AttributeAppearanceOn (SmallCaps!) Endif If (vBold=1) AttributeAppearanceOn (Bold!) Endif If (vItalic=1 and vSmallCap<>1) AttributeAppearanceOn (Italics!) Endif // .....Move to the bottom of the Styles Editor's Contents pane: PosDocBottom // .....Add a space for the graphics line: HardReturn // .....Create the graphics line: GraphicsLineCreate (HorizontalLine!) GraphicsLineStyle (SingleLine!) GraphicsLineThickness (0.001") GraphicsLineHorizontalPosition (FullAlign!) GraphicsLineVerticalPosition (Baseline!) GraphicsLineEnd (Save!) // .....Move down to position the next line of document text: Advance (Where: AdvanceDown!; Amount: 0.12") // .....Exit from Styles Editor; save the style (in current document only): SubstructureExit () StyleEditEnd (State: Save!) // .....Display an appropriate message and quit the macro: Messagebox(;"NOTE - Style has been created and saved"; "The style named" +vHRt+vHRt+" "+vStyName+vHRt+vHRt+ "is now stored in this document." +vHRt+vHRt+ "You can choose it from the Select Style list on the property bar"+vHRt+ " -or- with Format > Styles > Insert"+vHRt+vHRt+ "Then enter (or select) your desired heading text and press Enter.") Quit Label(SkipApplyStyle@) Messagebox(;"NOTE - Style already exists"; "The style named" +vHRt+vHRt+" "+vStyName+vHRt+vHRt+ "is ALREADY stored in this document." +vHRt+vHRt+ "You can choose it from the Select Style list on the property bar"+vHRt+ " -or- with Format > Styles > Insert"+vHRt+vHRt+ "Then enter (or select) your desired heading text and press Enter.") Quit // Macro code ends here Notes
•
When the macro is played it will pop a message after the style has been
created. [If the exact same-named style already exists in that
document, the macro will skip creating it.] You then need to manually apply the style in either an open area of the document or to some pre-selected text to be used as the heading. Choose
it from the Text property bar's Select Style drop list (or from Format
> Styles.) The macro, as written, just creates and stores the style
in the document, it doesn't apply it to any text.
• Once applied in a document, the style's text can be modified by simply selecting (just) the text to which the style was applied (or by just clicking on it) and applying the modification to that text. [Or you can use Format > Styles > [stylename] > Edit to directly modify the format codes.] All instances of the style's text in the document will be automatically updated. • If you need to modify the style itself (internally) after it has been created in a document you will need to delete it from that document first, then play the modified (and saved) macro to create the revised style. [The style can be deleted from the document with Format > Styles > [stylename] > Options button > Delete.] • Multiple copies of the macro, each with a different name in the macro's code (in the vStyName variable), can be used to create a batch of different heading styles. • If you apply this paragraph style to text that already has had a paragraph style applied to it, this style will replace the existing style at that location. |
|