9.3.1 Keep conditionsYou can prevent information from separating over line, column, or page contexts, by using
Overriding widows and orphans with the keep-together property:
Injecting context breaks with the keep-with-previous and keep-with- next properties:
Relative strengths of keeps can be specified to ensure "more important" areas are kept together when "less important" areas cannot be kept together.
9.3.2 Examples of keepsConsider the "before and after" comparison of using keeps and not using keeps shown in Figure 9-3. Figure 9-3. Examples of keeps
The markup in Example 9-1 illustrates controlling the keeps for descendants. Of note:
Consider the "before and after" comparison of not using keeps of siblings and then using keeps shown in Figure 9-4. Figure 9-4. Examples of sibling keeps
Note that the space at the head of each reference area is conditional and is therefore discarded. The markup in Example 9-2 illustrates controlling the keeps for siblings. Of note:
Example 9-1 Keeping a group of areas together in a reference area Line 01 <layout-master-set> 02 ... 03 <region-body region-name="frame-body" column-count="2" .../> 04 ... 05 </layout-master-set> 06 ... 07 <flow flow-name="frame-body" font-size="40pt"> 08 <block break-before="page">New page</block> 09 <block>This is a test</block> 10 ... 11 <block>This is a test</block> 12 <block>This is a block 13 <block>Block in block</block> 14 ... 15 <block>Block in block</block> 16 End block</block> 17 <block>This is a test</block> 18 ... 19 <block>This is a test</block> 20 <block break-before="page">New page</block> 21 <block>This is a test</block> 22 ... 23 <block>This is a test</block> 24 <block keep-together.within-column="always" >This is a block 25 <block>Block in block</block> 26 ... 27 <block>Block in block</block> 28 End block</block> 29 <block>This is a test</block> 30 ... 31 <block>This is a test</block> 32 </flow> 9.3.3 Keep strengthThe strength of a keep is specified in the corresponding property's value.
A keep is attempted to be fit first into what remains within the context.
Example 9-2 Keeping a group of areas together in a reference areaLine 01 <block space-before="1.5cm" space-after="1.3cm" 02 font-weight="bold">L</block> 03 <block space-before=".2em">Lee, Nancy</block> 04 <block space-before=".2em">Lee, Ian</block> 05 <block space-before=".2em">Lee, Mathew</block> 06 <block space-before=".2em">Lee, Allison</block> 07 08 <block space-before="1.5cm" space-after="1.3cm" 09 font-weight="bold">P</block> 10 <block space-before=".2em">Prole, Diane</block> 11 <block space-before=".2em">Prole, Mark</block> 12 <block space-before=".2em">Prole, Connor</block> 13 <block space-before=".2em">Prole, Sydney</block> 14 ... 15 <block space-before="1.5cm" space-after="1.3cm" 16 keep-with-next.within-column="always" 17 font-weight="bold">L</block> 18 <block space-before=".2em">Lee, Nancy</block> 19 <block space-before=".2em">Lee, Ian</block> 20 <block space-before=".2em">Lee, Mathew</block> 21 <block space-before=".2em">Lee, Allison</block> 22 23 <block space-before="1.5cm" space-after="1.3cm" 24 keep-with-next.within-column="always" 25 font-weight="bold">P</block> 26 <block space-before=".2em">Prole, Diane</block> 27 <block space-before=".2em">Prole, Mark</block> 28 <block space-before=".2em">Prole, Connor</block> 29 <block space-before=".2em">Prole, Sydney</block> The size of the flow for a keep doesn't affect the choice of page geometry.
Explicit break conditions are stronger than any keep conditions.
Consider two situations in Figure 9-5 where keeps are allowed to be ignored and not allowed to be ignored. Figure 9-5. Keep strength
Of note:
In this example, each labeled block includes an area with that label plus the areas of the labeled blocks found therein. Using a numeric value allows the keep to be ignored.
Using " always " does not allow the keep to be ignored.
|