The Advanced Conditional Spacing event script enhances your ability to control spacing between paragraphs by adding conditional rules to Space Before and Space After. Conditional Spacing rules can be set to dynamically suppress Space Before and/or Space After when certain criteria are met, such as between paragraphs of the same style or stacked headings.
The module applies local overrides to the Space Before or Space After property of the affected paragraphs depending on the preceding or following paragraph.
Two conditional spacing options are provided:
- Suppress space before if preceding paragraph uses style . . .
- Suppress space after if following paragraph uses style . . .
How to configure Conditional Spacing in a workflow
Conditional Spacing is defined in a table in the InDesign template and is implemented by an Event Script. You can find the table on a Conditional Spacing master page in the template. If your template does not have the configuration table, see Adding a Configuration Table.
The Conditional Spacing script is a SpillEnd event. Your workflow should be configured to run SpillEnd scripts, and the script should be placed in the SpillEnd folder on the InDesign server.
Filling in the table
When a paragraph style is part of a group, the vertical bar character ‘|’ is used to separate the group name and the paragraph style name.
In the screenshot, ‘01-Common Elements|subhead2/crosshead b’ identifies the paragraph styles named ‘subhead2’ and ‘crosshead b’ in the group ‘01-Common Elements’.
Make sure you do not insert any space characters before or after the vertical bar character.
Adding a Configuration Table
- Download ConditionalSpacingTable.idms (attached below).
- Create a new master page in your InDesign template. Name it ‘Conditional Spacing’ with whatever prefix your template uses (Z, X, or XC usually).
- Choose File → Place and select the ConditionalSpacingTable.idms you downloaded previously.
- Place the snippet on the ‘Conditional Spacing’ master page. A ‘Conditional Spacing’ layer will be created.