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

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:

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:

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.

Craig Wright technical author

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.

Email help@straygoat.co.uk
Phone +44 07954141761

Straygoat Writing Services Ltd
26 Wheatlands Road
Wingerworth
Chesterfield
Derbyshire

Registered Number: 08029184

Straygoat logo design by Bristol graphic designer, Nik Jones.

© Straygoat Writing Services Ltd.