Exclude a chapter from autonumbering

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
Liduine
Jr. Propeller Head
Posts: 5
Joined: Wed Aug 24, 2022 8:19 am

Exclude a chapter from autonumbering

Post by Liduine »

Hello all,
Today I managed to get the autonumbering right; I made a new .css file, it is based on an existing one, since I took over a project that is already working, but I want to number the chapters and sections.

This is what I did:
for the chapters:
  • in the .css file: h1: mc-auto-number-format {chapnum}
    in the properties>Printed output: Chapter break
for the sections:
  • in the .css file: h2: mc-auto-number-format {chapnum}.{secnum}
    in the properties>Printed output: New section.
That works well. But the last chapter is the Index, and I don't want it to have a number, so I looked for a way to exclude the last chapter from autonumbering.

Is the procedure described above right?
What can I do to exclude the Index from autonumbering?

Regards,
Liduine
Nita Beck
Senior Propellus Maximus
Posts: 3669
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Exclude a chapter from autonumbering

Post by Nita Beck »

Welcome to the forums! ;)

I suggest that you not add the auto-numbering to the base h1 selector. In my own practice, I typically have h1.Chp and h1.Apx selectors in which I define auto-numbering for chapters and appendixes, respectively. That way, I can use the base h1 for things like the Index and Glossary (when I include a Glossary).

Hope this helps.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
Liduine
Jr. Propeller Head
Posts: 5
Joined: Wed Aug 24, 2022 8:19 am

Re: Exclude a chapter from autonumbering

Post by Liduine »

Thank you Nita!
I learned a lot today. I didn't know that these things are called selectors, I wasn't even aware that you can add your own :o .
Now I did as you recommended and it works. Wonderful! I made 2 new selectors under the h1., it seems they inherit all other variables from the h1 above.
Regards,
Liduine
Nita Beck
Senior Propellus Maximus
Posts: 3669
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Exclude a chapter from autonumbering

Post by Nita Beck »

I think "selector" is the official name per CSS, put authors also refer to them as styles. You can most definitely create your own selectors/styles.

To get the most out of Flare, you'll need to build up your CSS muscles. You might want to read through Flare's documentation about styles, starting here: https://help.madcapsoftware.com/flare20 ... Styles.htm

From there, you can access a PDF guide, which you might find easier than reading through Help topics.

Plus, there are videos for working with stylesheets.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
NorthEast
Master Propellus Maximus
Posts: 6365
Joined: Mon Mar 05, 2007 8:33 am

Re: Exclude a chapter from autonumbering

Post by NorthEast »

Sorry to butt in, but to avoid a lot of future confusion, this type of style is called "class" - not a "selector".

So a class in the CSS might look like this:

Code: Select all

h1.chap { mc-auto-number-format: '{chapnum}'; }
And when you use the class in the HTML code looks, it looks like this with a "class" attribute:

Code: Select all

<h1 class="chap">Chapter heading</h1>
A "selector" is just the bit at the start of the CSS line that specifies what you want to style, e.g.

Code: Select all

h1.chap {}
h1#banner {}
h1, h2, h3, h4, h5, h6 {}
div.note > p {}
See: https://www.w3schools.com/cssref/css_selectors.asp
Nita Beck
Senior Propellus Maximus
Posts: 3669
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Exclude a chapter from autonumbering

Post by Nita Beck »

You’re not butting in, my friend! You are rightly correcting my faulty tutelage, for which we are all better off. Plus, I violated a primary rule of tech writing: Accuracy!
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
ChoccieMuffin
Senior Propellus Maximus
Posts: 2632
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Exclude a chapter from autonumbering

Post by ChoccieMuffin »

Getting back to the question, if I have a selector (style) where most of them are a certain way but there are a couple of exceptions, I make the most common one the default. So in this case my h1 would have a chapter number, but then I'd make h1.NoChapNum that doesn't have a chapter number and only apply that style on the odd occasions where I need it.
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