Auto-numbering and Appendices

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
Paul Griffiths
Sr. Propeller Head
Posts: 261
Joined: Wed Apr 18, 2007 2:25 am
Location: Nottingham, UK

Auto-numbering and Appendices

Post by Paul Griffiths »

I need to set up autonumbering so that I get headings numbered as follows:

Appendix A (for H1)
A.1 (for H2)
A.2
A.2.1 (for H3)
A.2.2
A.3

Appendix B
B.1
B.2
B.3

etc, etc.

I'm sure this should be straightforward. Can anyone help?
Nita Beck
Senior Propellus Maximus
Posts: 3666
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Auto-numbering and Appendices

Post by Nita Beck »

You'll need only to set up one heading style, for the h1, using the {chapnum} autonumber. Here's what mine looks like:

Code: Select all

h1.Appendix
{
	mc-auto-number-format: 'Appendix {chapnum}. ';
}
Then, for the TOC item for the first appendix, on the (TOC) Properties window's Auto-numbers tab under Chapter Number, reset to 1 and use the format of ALPHA (A,B,C).

For the other appendixes' TOC items, do the same, except don't reset to 1 but instead increment the number.

You won't need to have any special h2s and h3s, assuming that the current h2s and h3s you have are picking up the {chapnum}. They will pick up the appendix letter.

HTH. Post back if this is not enough details for you.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
Paul Griffiths
Sr. Propeller Head
Posts: 261
Joined: Wed Apr 18, 2007 2:25 am
Location: Nottingham, UK

Re: Auto-numbering and Appendices

Post by Paul Griffiths »

Thanks Nita. I had hoped I could do this in a similar way to my normal section numbering (see below), but my current attempts are not working so I may have to resort to chapnum after all.

Code: Select all

	h1
	{
		mc-auto-number-format: 'A:Section {Gn+}:{ =0} ';
	}

	h2
	{
		mc-auto-number-format: 'A:{Gn}.{Gn+} ';
	}

	h3
	{
		mc-auto-number-format: 'A:{Gn}.{Gn}.{Gn+} ';
	}

	h4
	{
		mc-auto-number-format: 'A:{Gn}.{Gn}.{Gn}.{Gn+} ';
	}
	
	body.appendix h1
	{
		mc-auto-number-format: 'O:Appendix {A+}:{ =0} ';
	}

	body.appendix h2
	{
		mc-auto-number-format: 'O:{A}.{n+} ';
	}

	body.appendix h3
	{
		mc-auto-number-format: 'O:{A}.{n}.{n+} ';
	}	
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Auto-numbering and Appendices

Post by LTinker68 »

body.appendix wouldn't do anything unless you're actually applying a class called "appendix" to the body tag in the topic, which also wouldn't work, because it would get stripped out at build time and replaced with the body tag from the masterpage. Unless you've added a second masterpage and added the appendix class to the body tag in that masterpage and specified that masterpage for the appendix topics. Not sure if that would work or not.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
tomthemoth
Jr. Propeller Head
Posts: 3
Joined: Thu Nov 19, 2020 12:46 pm

Re: Auto-numbering and Appendices

Post by tomthemoth »

Nita Beck wrote:You'll need only to set up one heading style, for the h1, using the {chapnum} autonumber. Here's what mine looks like:

Code: Select all

h1.Appendix
{
	mc-auto-number-format: 'Appendix {chapnum}. ';
}
Then, for the TOC item for the first appendix, on the (TOC) Properties window's Auto-numbers tab under Chapter Number, reset to 1 and use the format of ALPHA (A,B,C).

For the other appendixes' TOC items, do the same, except don't reset to 1 but instead increment the number.

You won't need to have any special h2s and h3s, assuming that the current h2s and h3s you have are picking up the {chapnum}. They will pick up the appendix letter.

HTH. Post back if this is not enough details for you.
Nita- I have run across many of your posts in hunting for solutions to MCF questions as I work to learn the software. This one was so succinct and clear, I thought I'd just take the opportunity to say "thanks."

Set this problem (lettered Appendices) aside last week because it was driving me crazy; started fresh today and after finding your post had it square in less than 5 minutes. Thanks again.
Nita Beck
Senior Propellus Maximus
Posts: 3666
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Auto-numbering and Appendices

Post by Nita Beck »

Thanks for that feedback, Tom. So glad that I could help, even 7 years after my post!
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
88Schwind
Propeller Head
Posts: 20
Joined: Mon Sep 20, 2021 8:05 am

Re: Auto-numbering and Appendices

Post by 88Schwind »

I have an appendix numbering issue that is making me crazy. I tried the aforementioned method with chapnum, and it didn't work for me. Here's what I have.
h1.Appendix1: mc-auto-number-format: 'GN:Appendix {A+}{ =0}: ' ;
h2.Appendix2: mc-auto-number-format: 'GN:{A}.{n+}{ =0}: ';

However, when I go to the text editor for one of the H2.Appendix2 sections, I see this. <h2 class="Appendix2" MadCap:autonum="0.1: ">. and the 0.1 is what's being applied in the document. I have tried cutting that 0.1 code. I have tried entering a different value. It always reverts to auto-numbering of 0.1. What can I do to fix this?
Nita Beck
Senior Propellus Maximus
Posts: 3666
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Auto-numbering and Appendices

Post by Nita Beck »

Welcome to the forums! ;)

Any idea why {chapnum} didn't work? It works for me reliably. In the TOC properties for the first topic of the first appendix, have you set it to use a chapter break and then set the chapter number format to ALPHA (A,B,C) instead of the default decimal format. (Re)set it to start at "1" again too. For subsequent appendices, set their first topics' TOC properties to ahve a chapter break but have the chapter number increment.

Sorry, I may not be answering your question...
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
88Schwind
Propeller Head
Posts: 20
Joined: Mon Sep 20, 2021 8:05 am

Re: Auto-numbering and Appendices

Post by 88Schwind »

I have no idea why chapnum doesn't work. I'm a contractor that's new to this company, so I don't know the ins and outs of the documentation. I followed your instructions (page break, reset to 1 ALPHA). I even deleted the auto-numbering for h2.Appendix and h3.Appendix.
Now my h1.Appendix shows Appendix 1 and my first h2.Appendix shows 0.1.
Nita Beck
Senior Propellus Maximus
Posts: 3666
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Auto-numbering and Appendices

Post by Nita Beck »

88Schwind wrote:I have no idea why chapnum doesn't work. I'm a contractor that's new to this company, so I don't know the ins and outs of the documentation. I followed your instructions (page break, reset to 1 ALPHA). I even deleted the auto-numbering for h2.Appendix and h3.Appendix.
Now my h1.Appendix shows Appendix 1 and my first h2.Appendix shows 0.1.
I suspect, then, that the CSS for the h2 and h3 needs to be adjust so that the first bit in their auto-number formats also uses {chapnum}. I suspect they are using something like {n}.

Here're some bits from one of my stylesheets, to use as inspiration:

Code: Select all

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

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

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

h3
{
	mc-auto-number-format: 'CH:{chapnum}.{n}.{n+} ';
}
You can find examples of auto-numbering here: https://help.madcapsoftware.com/flare20 ... amples.htm. Looks like my CSS is straight out of some of the examples.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
88Schwind
Propeller Head
Posts: 20
Joined: Mon Sep 20, 2021 8:05 am

Re: Auto-numbering and Appendices

Post by 88Schwind »

h1.Appendix still displays Appendix 1. Each subsequent h2.Appendix now displays 1.1 despite the instruction to reset to 1 Alpha in the TOC properties.
toc_properties.png
You do not have the required permissions to view the files attached to this post.
Nita Beck
Senior Propellus Maximus
Posts: 3666
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Auto-numbering and Appendices

Post by Nita Beck »

88Schwind wrote:h1.Appendix still displays Appendix 1. Each subsequent h2.Appendix now displays 1.1 despite the instruction to reset to 1 Alpha in the TOC properties.
Where are you seeing the 1.1, in your output or in your source in Flare's XML Editor (and the internal text editor, too)?

If you are talking about what you see in source, then this is normal. Flare will calculate the actual section numbers when it builds your print output. But in the source file, Flare is just showing you the format, as it does not "know" (sorry to anthropromorphize Flare) what the numbers will be in output. Consider how you might have the same topic on two different TOCs with different organizations and hierarchy of topics. In other words, the topic mighr appear in Appendix A in one output but in Appendix C in another.

If you are seeing the numbers in ouptut, then perhaps show us what your CSS looks like.

EDIT: Ah, I see in your original question, you mentioned looking in the text editor. Don't worry about what the numbers look like there. Do you get the right numbers in your output? That's the proof of the pudding.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
88Schwind
Propeller Head
Posts: 20
Joined: Mon Sep 20, 2021 8:05 am

Re: Auto-numbering and Appendices

Post by 88Schwind »

All is well now. Thanks for guiding me through that.
88Schwind
Propeller Head
Posts: 20
Joined: Mon Sep 20, 2021 8:05 am

Re: Auto-numbering and Appendices

Post by 88Schwind »

There's nothing wrong with the numbering in my appendices. We use the auto-numbering format CH:Appendix {chapnum} and then we use alphabetical characters so we have Appendix A, etc. However, one of my colleagues pointed out that in our Help files, users are not able to search for the term appendix. Is there a way to make an auto-numbered heading searchable in Help files?
bwofficer
Propeller Head
Posts: 57
Joined: Tue May 12, 2020 2:16 am

Re: Auto-numbering and Appendices

Post by bwofficer »

Nita Beck wrote:You'll need only to set up one heading style, for the h1, using the {chapnum} autonumber. Here's what mine looks like:

Code: Select all

h1.Appendix
{
	mc-auto-number-format: 'Appendix {chapnum}. ';
}
Then, for the TOC item for the first appendix, on the (TOC) Properties window's Auto-numbers tab under Chapter Number, reset to 1 and use the format of ALPHA (A,B,C).

For the other appendixes' TOC items, do the same, except don't reset to 1 but instead increment the number.

You won't need to have any special h2s and h3s, assuming that the current h2s and h3s you have are picking up the {chapnum}. They will pick up the appendix letter.

HTH. Post back if this is not enough details for you.
Does this style needs to be applied manually to every top-level topic in the appendices? Or is there some clever way to tell Flare "use h1 to begin with but substitute h1.Appendix once you've passed point Z in the TOC"?
Nita Beck
Senior Propellus Maximus
Posts: 3666
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Auto-numbering and Appendices

Post by Nita Beck »

bwofficer wrote:Does this style needs to be applied manually to every top-level topic in the appendices? Or is there some clever way to tell Flare "use h1 to begin with but substitute h1.Appendix once you've passed point Z in the TOC"?
You have to apply h1.Appendix to the h1 in each appendix's first topic. That way, you'll get the "Appendix " bit before the appendix letter.

The TOC settings are used to tell Flare where to add a chapter break and then to set the starting counter. For example, for your Appendix A, set its TOC properties's Printed Output to apply a chapter break and then set its Auto-numbers to reset the chapter number to 1 and use the format Alpha (A,B,C). Then, for the remaining appendixes, have each also apply a chapter break but set the auto-numbers to increment the number (that is, the letter).
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
Post Reply