Below is a screenshot of a typical instance. There aren't too many of them, but they're all cases where trying to make the content narrower would be... a challenge.
On Key Idea 9.8.9 (which is an #insight), without adjustments, the content runs out of the box (and off the page!)
So I inject some XSL that changes two tcolorbox settings (and only for this tcolorbox):
1. change the text width to fit the content
2. assign a negative value to the tcb setting 'enlarge left by' to
shift the box over so it stays on the page.
The second of these settings is only triggered if the content is on an even-numbered page.
But this is also an example where that doesn't happen! We are at the very top of an even-numbered page, and in this case, LaTeX takes its page count from the previous page, and I don't get a left shift.
Putting a pagebreak just above everything fixes the page count.
I have a solution for now: in my extra xsl, I created a pagebreak
element, and I can just use that.
i was hoping to deprecate it in favour of the <insertions
@pagebreak/> element in the pubfile, but it doesn't work in
this one edge case.
If I have time, I could:
- xerox the template for $latex-pagebreaks-string
- make similar variables for the horizontal stretch and shift
tcolorbox changes
- rewrite templates for theorem/definition/insight to use all of
these.
But that will make my XSL more vulnerable to upstream changes.
