Page break after TOC?

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
oceanclub
Sr. Propeller Head
Posts: 277
Joined: Thu Oct 10, 2013 4:45 am
Location: Dublin

Page break after TOC?

Post by oceanclub »

I have a required for two stylesheets which are similar:

* The default one is for book-length printed works, with page breaks before chapters (h1s)
* The second is identical except that there are no page breaks before chapters

The simple fix initially was simply to page-break-before: avoid; to the h1 style. It works fine except there's no page break before the first chapter so it means the table of contents and first chapter run into each other.

Is there a CSS way to specify a page break _after_ the TOC? Not the TOC heading, the entire TOC?

Thanks

Paul
ChoccieMuffin
Senior Propellus Maximus
Posts: 2650
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Page break after TOC?

Post by ChoccieMuffin »

A clumsy way could be to create a special H1 class, say H1_First_Chapter, and add page-break-before: always; to your stylesheet for that class, then apply it only to the first H1 after your TOC. Would that work for you? Others might come up with a more flexible way, so don't take this as the only solution.
Started as a newbie with Flare 6.1, now using Flare 2024r2.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
oceanclub
Sr. Propeller Head
Posts: 277
Joined: Thu Oct 10, 2013 4:45 am
Location: Dublin

Re: Page break after TOC?

Post by oceanclub »

ChoccieMuffin wrote:A clumsy way could be to create a special H1 class, say H1_First_Chapter, and add page-break-before: always; to your stylesheet for that class, then apply it only to the first H1 after your TOC. Would that work for you? Others might come up with a more flexible way, so don't take this as the only solution.
Ah I can't do that as in this case I'm using Flare files autoimported from Markdown. So a H1 is always a H1 (that's why I can't simply apply a class to the heading for example.
doloremipsum
Sr. Propeller Head
Posts: 290
Joined: Mon Aug 26, 2019 2:11 pm

Re: Page break after TOC?

Post by doloremipsum »

I think you should be able to apply a page break to the TOC proxy itself. Try this in your stylesheet:

Code: Select all

MadCap|tocProxy
{
page-break-after: always;
}
Alternatively, in the TOC you might be able to apply a page layout break to the first topic, which would force it to start on a new page. However, this might run into the same issue as ChoccieMuffin's suggestion.
in hoc foro dolorem ipsum amamus, consectimur, adipisci volumus.
oceanclub
Sr. Propeller Head
Posts: 277
Joined: Thu Oct 10, 2013 4:45 am
Location: Dublin

Re: Page break after TOC?

Post by oceanclub »

doloremipsum wrote:I think you should be able to apply a page break to the TOC proxy itself. Try this in your stylesheet:

Code: Select all

MadCap|tocProxy
{
page-break-after: always;
}
Thanks, that's perfect!

P.
Post Reply