Consent

This site uses third party services that need your consent. Learn more

Skip to content

Blog

How to get a chapter heading to wrap on the next line in MadCap Flare

Headshot of Craig.

Craig Wright

Do you have mini-toc pages at the start of your chapters? Do you want to get the chapter title to appear under the chapter number, as if there was a <br /> between the chapter number and chapter title?

Well, this post will tell you how to do it.

Just in case you're wondering what I'm going on about, here's an example. Instead of 'Display Settings' starting on the same line as 'Chapter 4:' and then breaking ugly on the next line, I've put the entire title on the next line, like this:

A chapter page for a Flare document. The chapter heading is Chapter 4: Display Settings and it is highlighted by a callout ring.

I'll assume you already have your start of chapter page layout set up and ready to go. And you'll need a topic that contains the heading and a mini-toc proxy, like this:

MadCap Flare document. It has an h1 heading "Display Settings". The heading is highlighted.

For my example, I created a h1 class called section for the 'Display Settings' text and a p.chaptoctext class for the paragraph of text that appears above the mini-toc proxy.

Next, you need to make some CSS edits. For this, I'd use the text editor view rather than Flare's CSS editor, but that's entirely up to you.

The CSS you need to add is:

h1.Section { font-size: 30pt; color: #ffffff; left-margin: 0px; margin-bottom: 10px; padding-bottom: 12px; mc-auto-number-format: 'CH:Chapter {chapnum}: '; mc-auto-number-class: ChapAutoNum; mc-hyphenate: never; line-height: 1.5em; }

span.ChapAutoNum { color: #ffffff; font-size: 30pt; mc-hyphenate: never; line-height: 1.5em; display: block; }

The h1.Section stuff is for styling the 'Chapter n:' part. Note that it uses the mc-auto-number format and mc-auto-number-class to set the chapter number and the format.

The span.ChapAutoNum parts are for adding the line break. Note that mc-hyphenate is set to never, so the line doesn't break with a hyphen and the display is set to block. The block is important as it is what gives us the line break.

Before I go, I'd like to say a big thanks to Daniel, the rockandrollbot on the Write the Docs slack for helping with this. Nice one.

Posted under MadCap Flare

Last modified: 18 May 2024

Headshot of Craig.

Craig Wright is an experienced technical writer based in Chesterfield, UK.  He hates writing about himself in the third person, so I shall stop now.

Always interested in new content writing opportunities. Remote working preferred.

Get in touch

Let’s talk about your project

I’m here to help and offer my expertise as a technical writer. Get in touch and let me know what you need.