Want to add chapter numbers in the TOC

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
ChoccieMuffin
Senior Propellus Maximus
Posts: 2634
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Want to add chapter numbers in the TOC

Post by ChoccieMuffin »

Afternoon all.

I want to add the chapter numbers to my printed TOC but I can't figure out which style in my stylesheet I need to edit.
I tried editing p.TOC1, p.TOC2 and p.TOC3 by adding this to my print medium:

mc-auto-number-format: 'CH:TOC1{chapnum} - ';

but to no effect.

Any suggestions? Point me in the right direction?
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
Rene Severens
Sr. Propeller Head
Posts: 210
Joined: Mon Sep 19, 2011 2:06 am
Location: Netherlands - Zoetermeer
Contact:

Re: Want to add chapter numbers in the TOC

Post by Rene Severens »

Hi,

Use MadCap|tocProxy instead ?

I do not define any format on p.TOCx but used a global counter on the h1:

h1
{ ...
mc-auto-number-format: 'GH:{n+} ';
...
}

and for a h2
{ ...
mc-auto-number-format: 'GH:{n}.{n+} ';
...
}

for p.TOCx I set mc-auto-number-position: outside-head (default I think)

and for each heading that must not to show up in the Printed toc I set the mc-heading-level to 0

This allows to define a h1.appendix with a new global counter (GM:...)to start numbering appendices from 1 again.

Greetings,
René Severens
"The numbers are strange today; they somehow do not seem to add up."
ChoccieMuffin
Senior Propellus Maximus
Posts: 2634
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Want to add chapter numbers in the TOC

Post by ChoccieMuffin »

Thanks for your reply.

Unfortunately a proxy wouldn't be appropriate, as I need to have a starting page before the TOC in my PDF

Also, the h1, h2, h3 styles don't have an auto number in them (I display the chapter number in a different way in the body of the document) but I DO want to display the chapter number in the TOC.
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
Nita Beck
Senior Propellus Maximus
Posts: 3672
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Want to add chapter numbers in the TOC

Post by Nita Beck »

ChoccieMuffin wrote:Also, the h1, h2, h3 styles don't have an auto number in them (I display the chapter number in a different way in the body of the document) but I DO want to display the chapter number in the TOC.
Choccie, I suspect the lack of autonumbering in your heading styles is the crux of your problem. I don't think you can accomplish what you're after viz a viz the generated table of contents if you aren't using autonumbering in headings.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
whunter
Sr. Propeller Head
Posts: 429
Joined: Thu Mar 12, 2009 4:49 pm
Location: Portland, OR

Re: Want to add chapter numbers in the TOC

Post by whunter »

I have a setup like this. On my h1s that I want to show with Chapter # in the TOC, I have applied an auto-number format to the h1 but the class of that format is set to display:none. So the h1s that start the chapter don't actually show the chapter number, because it's hidden there. But the TOC still picks it up.

I realize this is vague, but perhaps it will get you started.
Nita Beck
Senior Propellus Maximus
Posts: 3672
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Want to add chapter numbers in the TOC

Post by Nita Beck »

whunter wrote:I have a setup like this. On my h1s that I want to show with Chapter # in the TOC, I have applied an auto-number format to the h1 but the class of that format is set to display:none. So the h1s that start the chapter don't actually show the chapter number, because it's hidden there. But the TOC still picks it up.

I realize this is vague, but perhaps it will get you started.
O.M.Gosh, that is brilliant! I so love the collective Flare brain we have here on the forums. ;)
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: 2634
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Want to add chapter numbers in the TOC

Post by ChoccieMuffin »

Nita Beck wrote:
whunter wrote:I have a setup like this. On my h1s that I want to show with Chapter # in the TOC, I have applied an auto-number format to the h1 but the class of that format is set to display:none. So the h1s that start the chapter don't actually show the chapter number, because it's hidden there. But the TOC still picks it up.

I realize this is vague, but perhaps it will get you started.
O.M.Gosh, that is brilliant! I so love the collective Flare brain we have here on the forums. ;)
I second what Nita says! Thanks, whunter, that's just what I need to do.

:)
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
doc_guy
Propellus Maximus
Posts: 1979
Joined: Tue Nov 28, 2006 11:18 am
Location: Crossroads of the West
Contact:

Re: Want to add chapter numbers in the TOC

Post by doc_guy »

I'm banging my head on this wall right now too. The thing is, you shouldn't HAVE to put the autonumber on the H1 that starts the chapter, because you define a new chapter in the TOC entry. So the counting works, and if you insert the chapter number variable on the page layout it works. Thus, Flare KNOWS the chapter number that applies to that topic, and so it should be able to pull it into the print TOC without setting an autonumber format on the H1s. (Grumble, grumble.)

This shouldn't be this hard, is all I'm saying.
Paul Pehrson
My Blog

Image
ChoccieMuffin
Senior Propellus Maximus
Posts: 2634
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Want to add chapter numbers in the TOC

Post by ChoccieMuffin »

whunter wrote:I have a setup like this. On my h1s that I want to show with Chapter # in the TOC, I have applied an auto-number format to the h1 but the class of that format is set to display:none. So the h1s that start the chapter don't actually show the chapter number, because it's hidden there. But the TOC still picks it up.

I realize this is vague, but perhaps it will get you started.
I'm clearly being a bit "fick" here, I don't understand what you mean by "the class of that format".

Here's my H1 code from my Print medium, where I've already added the mc-auto-number-format, but I don't understand where, or how, to set display:none.

Code: Select all

	h1
	{
		background-image: none;
		font-family: Arial;
		border: none;
		font-weight: normal;
		font-style: normal;
		margin-bottom: 60pt;
		mc-hyphenate: never;
		font-size: 22pt;
		margin-right: 0;
		margin-left: 0;
		padding: none;
		color: #8dc63f;
		mc-auto-number-format: 'CH:{chapnum} - ';
		mc-heading-level: 2;
		page-break-inside: avoid;
		page-break-before: avoid;
		line-height: normal;
		mc-next-tag: p;
	}
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
whunter
Sr. Propeller Head
Posts: 429
Joined: Thu Mar 12, 2009 4:49 pm
Location: Portland, OR

Re: Want to add chapter numbers in the TOC

Post by whunter »

Sorry for the delay, I was out of town. For example, my H1 looks like:

Code: Select all

h1.StandardHeading
{
	mc-auto-number-position: outside-head;
	mc-auto-number-offset: 50px;
	mc-auto-number-class: white;
	mc-auto-number-format: 'CH:Chapter {chapnum}: ';
	page-break-before: always;
}
The mc-auto-number-class: white formats the auto-number. It corresponds to span.white, which looks like this:

Code: Select all

span.white
{
	display: none;
	color: #000000;
}
I think the white color corresponds to an earlier version of this solution, where I "hid" the numbers by making them white. It's made irrelevant by the display:none though.
ChoccieMuffin
Senior Propellus Maximus
Posts: 2634
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Want to add chapter numbers in the TOC

Post by ChoccieMuffin »

Thanks for filling in the holes in my knowledge. :)
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