Keep with next...please

This forum is for all Flare issues not related to any of the other categories.
Post Reply
Maya_t
Propeller Head
Posts: 12
Joined: Mon Apr 22, 2019 2:37 am

Keep with next...please

Post by Maya_t »

Hello people,

Im looking for a 'keep with next' option in Flare, where I can be sure the sentence sticks to the image after it...is there a way to do this in Flare?
TIA
Nita Beck
Senior Propellus Maximus
Posts: 3667
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Keep with next...please

Post by Nita Beck »

CSS doesn't have the concept of "keep with next." Rather, it has the concept of breaks before, inside, or after different HTML tags. You can design styles that always break or that avoid breaking. (There's no such concept as never breaking.)

To achieve the specific behavior you're after, you have a couple of options.

One way is to put the paragraph that holds the lead-in sentence and the paragraph that holds the image inside a div and assign the div class that includes the page-break-inside attribute set to "avoid". I use this exact div structure, with a class of div.Figure.

Code: Select all

div.Figure
{
   page-break-inside: avoid;
}
BTW, if you wanted to use a similar div structure for other kinds of content besides paragraphs with images, you could name the div more generally.

Code: Select all

div.NoBreakInside
{
   page-break-inside: avoid;
}
Another way is to have one CSS class for the lead-in paragraph that instructs Flare to avoid a page break after and another CSS class for the paragraph that holds the image that instructs Flare to avoid a page-break-before.

Code: Select all

p.FigureLeadin
{
   page-break-after: avoid;
}

p.Figure
{
   page-break-before: avoid;
}
In my own practice, the lead-in to a figure is always the figure title, so my code is:

Code: Select all

p.FigureTitle
{
   page-break-after: avoid;
}

p.Figure
{
   page-break-before: avoid;
}
In the p.FigureTitle CSS, I also set up an auto-number for the figure title, but that's a whole other discussion.

HTH
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
Maya_t
Propeller Head
Posts: 12
Joined: Mon Apr 22, 2019 2:37 am

Re: Keep with next...please

Post by Maya_t »

Thank you ! I created the new Div and it works great !!!
ChoccieMuffin
Senior Propellus Maximus
Posts: 2630
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Keep with next...please

Post by ChoccieMuffin »

I have p.KeepWithNext (which avoids break after) and p.Graphic (which avoids a break before).

One really consistent problem I can't get past is when I have these two paragraphs nested in the first <li> in a list, in which case they don't both jump onto the next page if there isn't enough space, the introductory paragraph stays on the first page and the graphic goes to the next. It's ONLY the first list item that misbehaves, any subsequent list items behave as expected. I've had this for years and it's annoying, and I don't know how to fix it, or even where to look to identify the cause. Any suggestions?
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Post Reply