How to Stop the TOC Page from Being Included in TOC?

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
CathyT
Propeller Head
Posts: 26
Joined: Tue Aug 19, 2008 1:02 pm

How to Stop the TOC Page from Being Included in TOC?

Post by CathyT »

Hi All,

I am generating print output and don't want my TOC page in my TOC. I've tried making the TOC head be a subclass of h1, h2, h3, and its own h6 (we only generate TOC as far as h2). In each case, I changed the MC Heading level to 0 for my print output (and default output as well, just to be sure). I really don't understand how it's appearing when it's a class of h3, because the other h3 heads aren't getting included.

Anyway, no matter what I do, the TOC page shows up in my TOC. When I was outputting to Word, I could remove the entry, but with PDFs, it's not so easy to do. The leader dots are on a separate layer, so when I delete that entry, the leaders are all misaligned, and I can't get to them to remove the top line. I've got almost perfect PDF output, but this is driving me nuts.

Following is the code for my h6 head:

h6
{
font-family: Verdana;
margin-top: 0pt;
margin: 0;
font-weight: bold;
margin-left: 0pt;
font-size: 14pt;
mc-heading-level: 0;
page-break-before: always;
widows: never;
orphans: never;
margin-bottom: 12pt;
page-break-inside: avoid;
column-break-inside: avoid;
column-break-before: avoid;
column-break-after: avoid;
page-break-after: avoid;
}

I would be grateful for any suggestions as to what I might be doing wrong. If it's a bug, I'll submit a bug report.

Thanks in advance.
DoCo
Propeller Head
Posts: 47
Joined: Tue May 26, 2009 3:18 am
Location: Belgium

Re: How to Stop the TOC Page from Being Included in TOC?

Post by DoCo »

Hi there,

To avoid such kind of troubles, we have replaced the TOC page title <h> with a specific <p> class that mimics a h1.

HTH

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

Re: How to Stop the TOC Page from Being Included in TOC?

Post by Nita Beck »

Cathy,

I've done what you've done. I've got two such heading classes (I call 'em "h2.NotInContents" and "h3.NotInContents") that use mc-heading-level: 0. In fact, that attribute is the only one that distinguishes them from h2 and h3. Any headings set with either of those classes are excluded from the TOC in my PDF output.

I'm using Flare 5. Which version are you using? Maybe it is indeed a bug in older versions of Flare.

A hunch, though I haven't explored it yet (not enough coffee)... Perhaps your problem stems from whether your target is using TOC depth for heading levels. I'll explore this a little and report back.

Nita
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
Nita Beck
Senior Propellus Maximus
Posts: 3669
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: How to Stop the TOC Page from Being Included in TOC?

Post by Nita Beck »

Well... I'm a little mystified about just why my setup works, but it does.

Near the top of my TOC for my PDF output, I've got a title page, several miscellaneous pages that I don't want to be in the generated table of contents, and the contents page itself that holds the TOC proxy. I have the headings for the several miscellaneous pages and the contents page set to "h2.NotInContents" (where I've got mc-heading-level: 0). Everywhere else in the project, I've got most topic headings set to h2 (using h1 only for chapter titles). In my PDF target, I have selected "Use TOC depth for heading levels" so that topic headings will be reset to h3, h4, etc. based on how deeply they are nested in the TOC.

Now, according to Flare's Help, those "h2.NotInContents" headings, being at the top level of my TOC, should end up being reset to h1's, but they're not. They are staying as I want them -- h2NotInContents -- and those pages are not listed in the generated table of contents. Now, is this a bug or an "undocumented feature," that headings at the topmost level stays as assigned rather than being reset at build? Doesn't matter to me, 'cause I get the result I want!

So Cathy, perhaps there's some interplay you can explore regarding the structure of your TOC and the "Use TOC depth for heading levels" option in the target.

But in the end, DoCo's simple solution may be your best bet.

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: How to Stop the TOC Page from Being Included in TOC?

Post by LTinker68 »

Nita Beck wrote:Now, according to Flare's Help, those "h2.NotInContents" headings, being at the top level of my TOC, should end up being reset to h1's, but they're not. They are staying as I want them -- h2NotInContents -- and those pages are not listed in the generated table of contents. Now, is this a bug or an "undocumented feature," that headings at the topmost level stays as assigned rather than being reset at build? Doesn't matter to me, 'cause I get the result I want!
I'm thinking it's because you have the mc-heading-level set to 0. That's kind of like inline formatting -- it overrides what Flare would normally do because it's specifically taking it out of the scope of the generated TOC. To test it (and for basic curiosity) set your h3 tags to have mc-heading-level set to 0. If I'm right then those topics will stay at h3, even if they're two or four levels deep in the TOC.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Nita Beck
Senior Propellus Maximus
Posts: 3669
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: How to Stop the TOC Page from Being Included in TOC?

Post by Nita Beck »

LTinker68 wrote:I'm thinking it's because you have the mc-heading-level set to 0. That's kind of like inline formatting -- it overrides what Flare would normally do because it's specifically taking it out of the scope of the generated TOC. To test it (and for basic curiosity) set your h3 tags to have mc-heading-level set to 0. If I'm right then those topics will stay at h3, even if they're two or four levels deep in the TOC.
I don't quite get your test... but I tried anyway :wink:, although with my h2s. Here's the setup in my TOC:

First level topic - heading set to h1
---Second level topic - heading set to h2
------Third level topic a - heading set to h2
------Third level topic b - heading set to h2.NotInContents
------Third level topic c - heading set to h2

The target is set to "Use TOC depth for heading levels. Here's how (weirdly) the generated PDF looks:

First level topic - heading rendered as h1
---Second level topic - heading rendered as h2
------Third level topic a - heading rendered as h3
---------Third level topic b - heading rendered as h4 (yes, h4!) but correctly excluded from the table of contents
------Third level topic c - heading rendered as h3

I fear that we are not helping Cathy, and I don't mean to appear to have hijacked her original question.
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: How to Stop the TOC Page from Being Included in TOC?

Post by LTinker68 »

CathyT wrote:I would be grateful for any suggestions as to what I might be doing wrong. If it's a bug, I'll submit a bug report.
It's not a bug. In order for a topic to appear in the generated output, you need to include the topic in your TOC file. If you want that topic in your generated output but you don't want the topic (or rather it's heading) to appear in the generated TOC, then you do what Nita said. I generally create a new class for h1 (or h2 if I'm using h1 for chapter titles), and set its mc-heading-level attribute to 0. I then apply that custom class to the heading in the topic containing the tocProxy. In the TOC file you add the tocProxy topic. When you build the output, the tocProxy is generated but it won't include the heading from the toxProxy because of the mc-heading-level attribute. You could do the same to your h6 tag if you want and if the TOC is the only topic that has the h6 tag. I tend to do it for a class under the h1 tag because I want it to inherit all the other style attributes of my h1 tag, with the exception of the mc-heading-level attribute.

The mc-heading-level attribute is normally under the "Unclassified" category, although that might vary, depending on the view you have the Stylesheet Editor set to. Note that you only need to set that attribute in the print medium, but it won't do any harm if you set it in the default medium, since you're probably going to exclude the tocProxy topic from your online help output anyway.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
ljs_tech
Jr. Propeller Head
Posts: 7
Joined: Tue Dec 18, 2007 5:46 am
Location: Atlanta, GA

Re: How to Stop the TOC Page from Being Included in TOC?

Post by ljs_tech »

DoCo wrote:Hi there,

To avoid such kind of troubles, we have replaced the TOC page title <h> with a specific <p> class that mimics a h1.

HTH

DoCo
Here, the <p> class mimicing the TOC h1 worked for the smaller files (<100 pages), but failed miserably on the largest files (>200 pages) when I realized the <p> class wasn't showing up in the header of the PDF TOC pages because I had set global print headers to show [any heading].

So, being a lazy person, instead of fiddling around with the global css and pagelayouts we use because it solves a problem here but creates a problem there, I created a TOCPageLayout and applied it only to the TOC topic. In the TOCPageLayout, I cheated and typed "Table of Contents" in the same location as [any heading] in the ChapterLayout. So far so good (until the next oddity occurs).
CathyT
Propeller Head
Posts: 26
Joined: Tue Aug 19, 2008 1:02 pm

Re: How to Stop the TOC Page from Being Included in TOC?

Post by CathyT »

Thank you all for your input. I moved the TOC head to an h3, which is set to zero (we only go two levels for our TOC), and it still did not work. Flare's help specifically says to use a zero value in the MCHeading print support, but alas...no go.

Now here's the kicker. Since posting this question, I put the same exact styles in a new project that I just started, and they worked as I wanted. Go figure. I still have to get them working for my initial project, and want my styles the same everywhere, so I am going to try your suggestions in turn, and see which gives me the most consistent results.

I appreciate everyone's time and generosity. Thank you again.
KevinDAmery
Propellus Maximus
Posts: 1985
Joined: Tue Jan 23, 2007 8:18 am
Location: Darn, I knew I was around here somewhere...

Re: How to Stop the TOC Page from Being Included in TOC?

Post by KevinDAmery »

CathyT wrote:Thank you all for your input. I moved the TOC head to an h3, which is set to zero (we only go two levels for our TOC), and it still did not work. Flare's help specifically says to use a zero value in the MCHeading print support, but alas...no go.
Make sure that you're applying the mcheading level to the correct medium (i.e. to the print medium, not to Default or Non-Print). If it's applied to the wrong medium, it won't work as you expect.
Until next time....
Image
Kevin Amery
Certified MAD for Flare
CathyT
Propeller Head
Posts: 26
Joined: Tue Aug 19, 2008 1:02 pm

Re: How to Stop the TOC Page from Being Included in TOC?

Post by CathyT »

KevinDAmery wrote:
CathyT wrote:Thank you all for your input. I moved the TOC head to an h3, which is set to zero (we only go two levels for our TOC), and it still did not work. Flare's help specifically says to use a zero value in the MCHeading print support, but alas...no go.
Make sure that you're applying the mcheading level to the correct medium (i.e. to the print medium, not to Default or Non-Print). If it's applied to the wrong medium, it won't work as you expect.

Thanks, I have been doing that. I've looked at the code also, and it all reads as it should. I've done a search in the code for h6 and the mcheading level to see if I have something different somewhere that's overriding what I THINK I've done, and I can't find anything amiss. I've done the same with the TOC topics to see if there's an additional heading assignment or local formatting that I've missed, and there's nothing there either. I'm ready to chalk it up to poltergeists. :)

Seriously, I think I'm going to try copying the CSS from one of the projects that's working correctly just in case something got corrupted in the errant project. Ahh, sweet mystery of life...
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: How to Stop the TOC Page from Being Included in TOC?

Post by LTinker68 »

If all else fails, open the stylesheet file in the Internal Text Editor, scroll through and delete all h6 style declarations. Scroll through because you might have multiple instances of the h6 declarations. Generally it should combine them, but you never know. Once you've deleted all those references, save the stylesheet file, and close it in the Internal Text Editor. You now have the h6 style set completely back to the default styles. Without setting anything else, go into the Stylesheet Editor and set the mc-heading-level for h6 and build the output and see if that works. There might be a conflict in the stylesheet. Also, try setting that parameter in the target about using TOC levels to the opposite of what it is now (i.e. if it's enabled, disable it). That shouldn't really matter to the generated TOC -- it should only affect the heading in the topic -- but who knows.
Image

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