Skip to main content
18-Opal
November 20, 2024
Question

Styler rule to combat when the Title of a topic is to close to the bottom of the page

  • November 20, 2024
  • 1 reply
  • 2511 views

We have an issue where we are often left with a level 2 or 3 title and short description stuck on the bottom of a page, while the rest of the topic is on the next page.

 

bfriesen_0-1732126964253.png

What are my options? My thought is to create a rule that would check the room left on the page, and if the title element was within the last 3 in. of the bottom of the page it would start the topic on a new page. Is that possible?

 

Bryon

1 reply

14-Alexandrite
November 21, 2024

Hi Bryon

You're going to need to use an APP source edit to test the baseline position of the title and, if it is greater than some threshold, output a page break or set the top margin to something large to force it over to the next page.

Something like

if (formatting.currentState.yBase > new fLength("200mm") {

  formatting.output(""); //For the page break or block.marginTop = "40mm" for the top margin

}

Put that edit in a property set and apply that to the title, then you can reuse it and it doesn't lock up your title from being styled.

Hope that helps

Simon

bfriesen18-OpalAuthor
18-Opal
November 25, 2024

Hello Simon, I added the following according to your sample above

 

bfriesen_0-1732553107990.png

 

A publish throws a whole page of warnings and errors. How do I decipher the errors?

 

Bryon

 

<Record date="Mon Nov 25 10:35:22 2024" millis="1732552522"
severity="error" suppress="0">
<Level>ERROR</Level><Message>Pg 15 Javascript&colon; ReferenceError: reference
to undefined property formatting.currentState.yBase onEnter([object
fBlock],[object Object])@stylesheet0:PropertySet:Page_Break:onEnter:1
onEnter([object fStreamPos])@stylesheet0:Element:title:title_in_procedure_in_division:onEnter:22
runMacro("sprint \"_app:spFormatWithIndex\"",true)@:0 @_app:FormatWithIndex:3
. [1500] (2:"stylesheet0:Element:title:title_in_procedure_in_division:onEnter"#105)
(1:"editorDom0"#{0;/RDStyle/ResolvedMap/techinfomap/division[1]/procedure[1]/title/#_app:Gentext})

</Message>
</Record><Record date="Mon Nov 25 10:35:22 2024" millis="1732552522"
severity="error" suppress="0">
<Level>ERROR</Level><Message>Pg 15 Javascript&colon; stylesheet0:PropertySet:Page_Break:onEnter:1:
ReferenceError: reference to undefined property formatting.currentState.yBase
. [1500] (2:"stylesheet0:Element:title:title_in_procedure_in_division:onEnter"#105)
(1:"editorDom0"#{0;/RDStyle/ResolvedMap/techinfomap/division[1]/procedure[1]/title/#_app:Gentext})

</Message>
</Record><Record date="Mon Nov 25 10:35:22 2024" millis="1732552522"
severity="error" suppress="0">
<Level>ERROR</Level><Message>Pg 15 Block end mismatch: Trying to end
(title_in_procedure_in_division) with current nesting (techinfomap_everywhere/division_everywhere_else/procedure_first_in_its_parent_anywhere_i7A22)
[1209] (2:"stylesheet0:Element:title:title_in_procedure_in_division:onExit"#0)
(1:"editorDom0"#{0;/RDStyle/ResolvedMap/techinfomap/division[1]/procedure[1]/titlealts})

</Message>
</Record><Record date="Mon Nov 25 10:35:22 2024" millis="1732552522"
severity="error" suppress="0">
<Level>ERROR</Level><Message>Pg 15 Block end mismatch: Trying to end
(procedure_first_in_its_parent_anywhere_i7A22) with current nesting
(techinfomap_everywhere/division_everywhere_else) [1209] (2:"stylesheet0:Element:procedure:procedure_first_in_its_parent_anywhere_i7A22:onExit"#122)
(1:"editorDom0"#{0;/RDStyle/ResolvedMap/techinfomap/division[1]/procedure[2]})
<Level>ERROR</Level><Message>Pg 22 Table Column 1 too narrow to fit
text - skipped to next col [1200] (3:"_s_h_o_w_22_"#2861) (2:"stylesheet0:Element:image:image_everywhere_else:onEnter"#4021)
(1:"editorDom0"#{1;/RDStyle/ResolvedMap/techinfomap/division[1]/procedure[7]/procbody/procsteps[3]/procstep/procinfo/fig/#_app:Gentext/_sfe:BeforeOrAfterText/image})

</Message>
</Message>
</Record>

14-Alexandrite
November 27, 2024

Hi Bryon
Sorry, I didn't get a notification that you'd had problems.

Did you try adding a big margin to the top of the block?

Simon