When working out of a limited authoring environment such as Microsoft® Word, you might be used to adding in manual page breaks. However, if you have ever changed that document later, you might find that manual page breaks can be a nuisance due to content changing. In MadCap Flare, there are several reasons that content will change due to the nature of Flare’s single-sourcing tools (Variables, Snippets, Conditions, Variable Conditions, Snippet Conditions, etc.) as well as the nature of topic-based authoring (topics may be removed or rearranged). So having a manual page-break in topics is a no-no.

An example of this below:

css-breaking-image-new

So what’s the best practice to controlling page breaks? My recommendation in Flare is to group items together and essentially tell Flare, “Everything within the selected group should not page break.”

Here’s how to do this in Flare.

We’ll do this using “divs”. Divs are used to group block-elements to format them with CSS.

I’ll create a div with a style class. While I called mine “nopagebreak”, you can name yours whatever you like. Once you’ve created the element, apply the correct styles. In the stylesheet, set “page-break-inside: avoid”.

page-breaks-madcap-flare-css

Once the div class is created in the stylesheet, wrap the div around elements that should remain together.

In order to wrap content in a div, take the following steps:

  1. Select all the items to be wrapped in a div.
    page-breaks-madcap-flare-css
  2. Press the “Group” button. (Home Ribbon > Paragraph Section > Group Button). Alternatively, you can press the “Tab” Key for the “Create Group” shortcut.
    page-breaks-madcap-flare-css
  1. A new window titled Create Group will appear. Select the div tag you’ve created.
    page-breaks-madcap-flare-css
  1. Press “OK”.

Now, elements wrapped in this div should avoid breaking across pages, and be ready for any of the changes from single-sourcing that may occur in documents.

Divs are a useful tool, and the applications go far beyond using them for page-break behavior. Other properties can be applied to divs such as background-colors and borders if you needed to group content together to create “note” boxes. Another suggestion is to use divs to control content for responsive designs. If you have any questions about divs or want to see this in action, feel free to reach out!

About The Author

Justin Bondoc

About Justin Bondoc

Justin Bondoc, Product Specialist, started at MadCap Software as a technical support engineer and turned to the evangelism team to promote the value of MadCap’s products and services to the community. In addition to spending his time educating potential and existing customers about all things MadCap Software, Justin likes listening to hip-hop, tackling his next art project, and exploring his creative side.

Last Modified: April 20, 2017

This entry was posted in MadCap Flare, Tips & Tricks. Bookmark the permalink.

Comments

  • Craig Prichard April 20, 2017 at 9:52 AM

    Divs work fine for non-MS Work targets. But MS Word doesn’t apply the properties of divs that come from Flare. Is there a solution that will work for a Flare topic sent to a Word target?

    • Justin Bondoc Justin Bondoc April 20, 2017 at 2:06 PM

      Hey Craig, we implemented this functionality in Flare V12, so it should be available to users on v12 and above. If you have any specific questions, I’d love to help. Feel free to reach out to me at jbondoc@madcapsoftware.com

  • Gary Appleton May 9, 2017 at 1:02 AM

    Great use of inherent HTML qualities. I find that paragraph-level page-break-before/inside is much better for controlling stray lines like “this picture shows…” and so on. Divs are overkill for two-line examples.
    But there’s one big problem: Flare completely ignores page-break properties inside dropdowns when producing printed output (even inside divs if I remember correctly). Kind of defeats the object of multi-target output at the press of a button. I logged this 3 years ago and I’m still having to use hard page breaks.

    • Justin Bondoc Justin Bondoc May 10, 2017 at 9:10 AM

      Hi Gary, thanks for the insight. I tested this out in Flare and it seems the bug you mentioned is still active (even when in a div). A quick workaround for this is to apply the “page-break-inside: avoid” property to the MadCap|Dropdown style.

  • Ashley June 23, 2017 at 11:36 AM

    This is the workaround that I was given by Madcap support to prevent having a section heading at the very bottom of a page. I had already set “page-break-after:” to “avoid” for the heading’s paragraph tag in the stylesheet, but it didn’t work.

    To use this method instead means I would have to create a div in every single topic that I’m using in my guide. I’m planning to create guides for multiple projects, so I will have to do this for hundreds of topics.

    Why is it that “page-break-inside: avoid” works for a div, but “page-break-after:avoid” does not work for a paragraph tag?

  • Anne Ramsey October 9, 2017 at 7:51 AM

    Can the div tags be used with table rows? There are specific rows I would like to keep together.

    • Justin Bondoc Justin Bondoc October 11, 2017 at 2:32 PM

      Hi Anne,
      Unfortunately you cannot group individual rows to behave this way. I’ve submitted a feature request for the ability to do this!

Have Something to Say?

Your email address will not be published. Required fields are marked *