PDF output TOC issue

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
Feebeegeebee
Sr. Propeller Head
Posts: 213
Joined: Wed Aug 08, 2012 8:38 am
Location: UK

PDF output TOC issue

Post by Feebeegeebee »

Hi,
I've generated Word files from Flare before (which I could PDF), but haven't needed to generate PDFs directly from Flare...until now.

So, on my first experiment, I've successfully generated a large PDF, with a front cover, TOC and Index. :)
However, the TOC includes lots of subheadings that don't appear in my project's TOC file. Why would it be including them?

In my PDF target I have "Generate TOC proxy" enabled, as well as "Use TOC depth for heading levels" option, so why is the generated PDF including lots of subheadings that aren't in my project's TOC file? The TOC becomes huge with those subheadings included. If I disable "Generate TOC proxy", I get no TOC, despite having my master TOC specified in the "General" tab of the print target.
I've tried tweaking all sorts of things, but to no avail. :cry: :(
Anyone able to enlighten me, as it's driving me mad?
Any help gratefully received.
Regards,
Feebeegeebee
-----------------------------------------------------
Using Flare 2022 on Windows 11 (64-bit)
-----------------------------------------------------
ChoccieMuffin
Senior Propellus Maximus
Posts: 2630
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: PDF output TOC issue

Post by ChoccieMuffin »

The TOC in a PDF isn't completely the same as the TOC in Flare, and its contents are controlled by the mc-heading-level attribute of the headings. So if your Flare TOC looks like this:
H1 topic
__H2 topic (containing lots of H3s)
__H2 topic (containing H3s and H4s)
H1 topic

you might expect to only have 4 entries in your TOC, but if H3 and H4 styles have mc-heading-level set in your stylesheet, then you'll end up with

H1 topic
__H2 topic
____H3
____H3
____H3
__H2 topic
____H3
______H4
______H4
____H3
H1 topic

So in your stylesheet, for any heading you don't want to appear in the TOC set mc-heading-level to 0.

To allow you to have a bit more control over where your TOC appears, instead of using the automatic "Generate TOC proxy" setting you might want to try creating a new topic and in that topic JUST insert a TOC proxy. You can then put that topic wherever you need it. This is particularly useful if you have a front cover, because using the automatic setting the TOC jsut gets plonked at the beginning but with the TOC topic, you can define where the TOC goes.
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
Feebeegeebee
Sr. Propeller Head
Posts: 213
Joined: Wed Aug 08, 2012 8:38 am
Location: UK

Re: PDF output TOC issue

Post by Feebeegeebee »

Ah. I see...
Thanks ChoccieMuffin!
At least I understand now. I couldn't find that info anywhere.
It's a pain, as I have some h2s that I do want to include and others that I don't - which isn't a problem in an online TOC.
I guess I will have to so some canny styling for the headings that I don't want included, so that I can then set those to mc-heading-level=0.
Thanks again for clarifying that! I was tearing my hair out!
Regards,
Feebeegeebee
-----------------------------------------------------
Using Flare 2022 on Windows 11 (64-bit)
-----------------------------------------------------
ChoccieMuffin
Senior Propellus Maximus
Posts: 2630
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: PDF output TOC issue

Post by ChoccieMuffin »

Feebeegeebee wrote:Ah. I see...
Thanks ChoccieMuffin!
At least I understand now. I couldn't find that info anywhere.
It's a pain, as I have some h2s that I do want to include and others that I don't - which isn't a problem in an online TOC.
I guess I will have to so some canny styling for the headings that I don't want included, so that I can then set those to mc-heading-level=0.
Thanks again for clarifying that! I was tearing my hair out!
Regards,
Feebeegeebee
If you only have a few headings (of any level) that you don't want to appear in your TOC, in your stylesheet create a generic style like this:

.NotInTOC
{
mc-heading-level: 0;
}

and apply that generic style to any heading you don't want to include in the TOC.

Tada!
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
Feebeegeebee
Sr. Propeller Head
Posts: 213
Joined: Wed Aug 08, 2012 8:38 am
Location: UK

Re: PDF output TOC issue

Post by Feebeegeebee »

Genius. Thank you, ChoccieMuffin.
That should work just fine.
Regards,
Feebeegeebee
-----------------------------------------------------
Using Flare 2022 on Windows 11 (64-bit)
-----------------------------------------------------
Post Reply