About Arbortext Styler > Working with Properties > Applying Prespace and Postspace to Elements
  
Applying Prespace and Postspace to Elements
You can apply prespace and postspace to an element using the options in the Spacing category. Prespace is vertical space added before an element. Postspace is the amount of vertical space added after an element.
* 
Prespace and postspace settings applied to empty elements are ignored. If you wish to force a certain amount of vertical space in generated text, insert a User Formatting Element (UFE) that is styled as a Block, and specify the required Space Before or Space After setting for that UFE. The UFE must contain a space, however, for the setting to have an effect, which in turn means that the UFE's Line Spacing setting will also be effective. For this reason you should ensure that the value of the UFE's Space Before / Space After setting plus its value for Line Spacing add up to the required amount of vertical space.
For print and PDF output, spacing can be fixed or variable. Spacing is fixed when the Minimum and Maximum values for Allow space to vary are omitted or are the same as the Preferred value. Spacing is variable when the Minimum, Maximum, and Preferred values are different. Variable spacing is used for vertical justification, which is specified in the Columns category for a page set. Vertical justification allows you to bottom-align columns. Variable spacing is also used by the print composer to produce better looking pages when vertical justification is not set.
Refer to Justifying columns for more information on vertical justification.
Specifying Precedence
Arbortext Styler allows you to specify a precedence associated with an element's prespace and postspace. When one element applies prespace and an adjacent element applies postspace, in most cases, only one of the values is used. The precedence setting determines which element's spacing requirements are applied. When a conflict occurs, Arbortext Editor and Arbortext Publishing Engine use the value of the element with the highest precedence. If the precedences are equal, Arbortext Editor and Arbortext Publishing Engine use the larger preferred amount.
Precedence values are none, low, medium, high, and force. The following table describes the interaction between elements' prespace and postspace, and the role precedence plays in determining the spacing value that Arbortext Editor and Arbortext Publishing Engine apply.
Prespace Precedence
Value
Outcome
force
The element's prespace takes precedence over the preceding element's postspace.
* 
Arbortext Editor applies the combined preferred values for an element's prespace and the preceding element's postspace when both are set to force.
high
The element's prespace takes precedence when the preceding element's postspace precedence is set to none, low, or medium.
medium
The element's prespace takes precedence when the preceding element's postspace precedence is set to none or low.
low
The element's prespace takes precedence when the preceding element's postspace precedence is set to none.
none
The preceding element's postspace always takes precedence, unless its precedence is also none, in which case, the one with the larger Preferred value is used.
Postspace Precedence
Value
Outcome
force
The element's postspace takes precedence over the following element's prespace.
* 
Arbortext Editor applies the combined preferred values for an element's prespace and the preceding element's postspace when both are set to force.
high
The element's postspace takes precedence when the following element's prespace precedence is set to none, low, or medium.
medium
The element's postspace takes precedence when the following element's prespace precedence is set to none or low.
low
The element's postspace takes precedence when the following element's prespace precedence is set to none.
none
The following element's prespace always takes precedence, unless its precedence is also none, in which case, the one with the larger Preferred value is used.
When an element's postspace precedence and the following element's prespace precedence are the same, Arbortext Editor and Arbortext Publishing Engine apply the larger of the two Preferred values.
Example: Applying Prespace and Postspace
The following example walks through applying prespace and postspace.
1. Open the transport.xml document located at Arbortext-path/samples/styler, and then click Open.
2. Choose File > Save As to create a local copy of transport.xml.
3. Choose Styler > New Stylesheet.
4. In Arbortext Styler, select the formalpara element in the Elements list, and choose Formal Block from the Style list. The context title in formalpara is automatically created for the title element.
5. Click on the title in formalpara context in the Elements list.
6. Go to the Spacing category.
7. Specify 1in in the Preferred field in the Spacing after group.
8. Choose None in the Precedence list.
9. Choose Preview > Print.
10. In the Print Preview window, locate the title of the first formal paragraph. Note that there is one inch of white space between the title and the following paragraph.
11. In Arbortext Editor, click inside the para element following the title in the first chapter.
12. Select the para everywhere else context then go to the Spacing category.
13. Specify 3in in the Preferred field in the Spacing before group.
14. Choose None in the Precedence list.
15. Choose Preview > Print.
16. In the Print Preview window, locate the title of the first formal paragraph. Note that there is now three inches of white space between the title and the following paragraph. This is because an PTC Arbortext print publishing action uses the larger Preferred value if no precedence level is set.
17. With the title in formalpara context selected in Arbortext Styler, go to the Spacing category.
18. Set the Precedence field in the Spacing after group to low.
19. Choose Preview > Print.
20. In the Print Preview window, locate the title of the first formal paragraph. Note that there is now only one inch of white space between the title and the following paragraph. This is because an PTC Arbortext print publishing action uses the prespace value on the para everywhere else has a precedence of low while the postspace value on the title in formalpara context has no precedence level set.
21. With the title in formalpara context selected in Arbortext Styler, go to the Spacing category.
22. Set the Precedence field in the Spacing after group to force.
23. Select the para everywhere else context, and set the Precedence field in the Spacing before group to force.
24. Choose Preview > Print.
25. In the Print Preview window, locate the title of the first formal paragraph. Note that there is now four inches of white space between the title and the following paragraph. When an element's postspace precedence and the following element's prespace precedence are both set to force, PTC Arbortext print publishing applies the combined Preferred values.
Prespace in tables in RTF output
Microsoft Word does not apply prespace to tables, only to paragraphs. You may find that a table that has a prespace setting still runs into preceding content or tables when a RTF document is opened in Word. To ensure that prespace is maintained, apply it in the stylesheet to a paragraph in generated text before the table, using the following steps:
For the required table context, create generated text using the Before-text option.
Create or insert a User Formatting Element (UFE) as the generated text. The UFE must be styled as Block.
Apply the required prespace setting to the default context of the UFE.
When you publish the document, the prespace will be applied to the table in RTF output. Note that the total resulting space will be the height of the empty paragraph UFE, as determined by its line spacing setting plus the height of its prespace.
This solution applies to both standard and custom tables.