Chapter numbering using heading style autonumbers

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
Rona Kwestel
Sr. Propeller Head
Posts: 212
Joined: Wed Apr 04, 2007 11:50 am

Chapter numbering using heading style autonumbers

Post by Rona Kwestel »

I'm trying to set up chapter numbering using the mc-auto-number settings for my heading styles, and it's not working as I expect.

What I have set up in the @media print section of the CSS file is the following:

Code: Select all

	h1.Heading1
	{
		mc-auto-number-format: 'C:{chapnum} ';
	}

	h2.Heading2
	{
		mc-auto-number-format: 'C:{chapnum}.{n+} ';
	}

	h3.Heading3
	{
		mc-auto-number-format: 'C:{chapnum}.{n}.{n+} ';
	}

	h1.Appendix1
	{
		mc-auto-number-format: 'A:Appendix {chapnum} ';
	}

	h2.Appendix2
	{
		mc-auto-number-format: 'A:{chapnum}.{n+} ';
	}

	h3.Appendix3
	{
		mc-auto-number-format: 'A:{chapnum}.{n}.{n+}  ';
	}
I'm not sure if I need the 'C' and 'A' characters, or if they should be nested further inside the expression; it's not clear to me how Flare distinguishes between the two 'n' variables (as a former programmer, this makes little sense to me).

What I'm getting looks like this:

1 <heading1>
1.1 <heading2>
1.1.1 <heading3>
1.1 <heading2>
1.1 <heading2
1.1.1 <heading3>
1.1.2 <heading3>
2 <heading1>
2.1 <heading2>
2.1 <heading2>
2.1.1 <heading3>
2.1.2 <heading3>

So why is the heading 3 number incrementing as expected, but the heading 2 number is not? This is what I expected to see:

1 <heading1>
1.1 <heading2>
1.1.1 <heading3>
1.2 <heading2>
1.3 <heading2
1.3.1 <heading3>
1.3.2 <heading3>
2 <heading1>
2.1 <heading2>
2.2 <heading2>
2.2.1 <heading3>
2.2.2 <heading3>

If you look at the Auto-Number Format Examples help topic in Flare, I followed what they show exactly, except for the {chapnum} part in my case, but it doesn't work. Any idea why?
Nita Beck
Senior Propellus Maximus
Posts: 3669
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Chapter numbering using heading style autonumbers

Post by Nita Beck »

I'm taking a stab in the dark here... but should the "C" parameter be "CH"? As you did, I checked out the Flare Help to see some examples. Your auto-number definitions do indeed look identical to the Help examples... with the exception of "C". If you try "CH", what results do you get?

Nita
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
Rona Kwestel
Sr. Propeller Head
Posts: 212
Joined: Wed Apr 04, 2007 11:50 am

Re: Chapter numbering using heading style autonumbers

Post by Rona Kwestel »

Nita, that was it! Thanks so much!

And it turns out that for the Appendix chapters, it also required 'CH'. I was using the letter 'A' to distinguish those chapters, but that is not the magic letter. When I changed those to 'CH', they worked as well, and appear as follows:

Appendix A <name of appendix A>
A.1 <appendix heading2>
A.2 <appendix heading2>
A.2.1 <appendix heading3>
Appendix B <name of appendix B>
B.1

etc.

So, here is the working format for anyone else struggling with this:

Code: Select all

	h1.Heading1
	{
		mc-auto-number-format: 'CH:{chapnum} ';
	}

	h2.Heading2
	{
		mc-auto-number-format: 'CH:{chapnum}.{n+} ';
	}

	h3.Heading3
	{
		mc-auto-number-format: 'CH:{chapnum}.{n}.{n+} ';
	}

	h1.Appendix1
	{
		mc-auto-number-format: 'CH:Appendix {chapnum} ';
	}

	h2.Appendix2
	{
		mc-auto-number-format: 'CH:{chapnum}.{n+} ';
	}

	h3.Appendix3
	{
		mc-auto-number-format: 'CH:{chapnum}.{n}.{n+}  ';
	}
I still maintain that the documentation on this whole feature is not clear and could stand some re-writing. For people like me, it would help to understand what Flare is doing under the covers.
Nita Beck
Senior Propellus Maximus
Posts: 3669
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Chapter numbering using heading style autonumbers

Post by Nita Beck »

Glad I could help!

Nita
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Chapter numbering using heading style autonumbers

Post by LTinker68 »

If it helps, the C and G are the scope parameters. If you have a C then you're saying the sequence only has the scope of a chapter -- each chapter the sequence starts back at 1. If you have a G then you're saying the sequence has a global scope -- the sequence increments by 1 every time it's used, throughout the entire output, and never resets. I've never tested this, but I'm assuming if you leave off the scope letter then it defaults to a chapter scope. Or maybe it doesn't increment it at all (I tend to use the G scope for all my projects).

The second letter is an ID to differentiate sequences so they don't get mixed up. For instance, I have GF for a global sequence of figure numbers and GT for a global sequence of table numbers. If I go figure, figure, table, figure, the resulting numbers will be 1, 2, 1, 3, respectively. So my figure sequence (F) doesn't get mixed in with my table sequence (T).

You have to specify an ID, but you don't have to specify a scope. And I'm assuming your ID can't be a C or a G. And I believe the ID can only be a single letter. If those last two assumptions are correct, then you can have at most 24 different sequences in a project. Although I just realized that I never tested to see if CH is treated differently than GH, or if it considers them one sequence since they both have the ID of "H". I've never had anywhere near that many auto-number sequences to where it was a problem.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Post Reply