Hi all
I am trying to generate a table of contents in a PDF, and at the moment it's putting in too many heading levels.
I have a document that uses h1.heading1 to h4.heading 4, and that's what's coming up in the generated TOC but I only want it to have H1 and H2 included.
This is what I have done so far:
1. Created a new topic, with p.Contents (so it doesn't show up in the TOC) followed by a TOC proxy with the style MadCap:tocProxy.
My Master TOC is very flat, and only contains topics that start with H1, though the topics beneath them do contain H2 etc. (I'm a Word and Frame user and I just can't get my head round this flipping program, and I couldn't get separate topics that start with H2 to follow on in the same page as the previous topic, or I would have done it differently. But my page layout issues are a different problem that I'm adding another question about in a separate thread.)
This is the code from that page.
"<?xml version="1.0" encoding="utf-8"?>
<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd" MadCap:lastBlockDepth="2" MadCap:lastHeight="60" MadCap:lastWidth="423">
<head>
</head>
<body>
<p class="Contents">Contents</p>
<MadCap:tocProxy />
</body>
</html>"
2. Edited h1 to h4 styles in the master stylesheet so that mc-heading-level for h1 and h2 (and also the sub-classes, just in case) are set to 1 and 2 respectively, and for h3 and h4 are set to 0.
3. In Primary Target, in Generated TOC, unchecked Use TOC depth for heading levels.
(This doesn't seem to make the slightest difference, I've generated the TOC with and without this option selected and it still shows 4 levels.)
4. Hunted through the thousands of pages of documentation, and I can't find what I've done wrong.
This is SOOO frustrating I HATE FLARE!!!
To save me from ripping more bald patches in my hair, can someone please make some helpful suggestions?
Thanks in advance.
p.s. I've notice that the bookmarks list in my PDF are also showing Heading 4 headings, which I don't want. I know I CAN bodge this by just making it a p class and not a h4 class, but there MUST be some way to do it properly, and I certainly don't want to have to go through the whole flipping book to change all the headings manually (I haven't figured out a way of automating anything in Flare, even search and replace.)
Another p.s.
For some reason or another, the change to mc-header-level that I thought I'd applied to H3 and H4 didn't seem to take, so I applied them again and it worked. Very od.
Thought I'd best report back in.
Have yet to figure out how to have 2 levels in the printed version and 3 levels in the PDF bookmarks though, so if anyone has any suggestions I'd love to hear them.
Too many headings in my printed TOC
-
ChoccieMuffin
- Senior Propellus Maximus
- Posts: 2650
- Joined: Wed Apr 14, 2010 8:01 am
- Location: Surrey, UK
Too many headings in my printed TOC
Started as a newbie with Flare 6.1, now using Flare 2024r2.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Re: Too many headings in my printed TOC
Glad you got it solved. I noodled over your problem yesterday and couldn't think of what else might be wrong. I hate that Flare is driving you crazy. If you're coming from a Word and Frame mindset, there is a learning curve. Stick with it, and definitely post here when you're stuck. If I can't find an answer in the Flare help quickly, I post here and usually have a response in a few hours or the next day.ChoccieMuffin wrote:For some reason or another, the change to mc-header-level that I thought I'd applied to H3 and H4 didn't seem to take, so I applied them again and it worked.
I have not tried to have a different level of heading in my TOC and my PDF bookmarks, but then my guide does not have that many heading levels. I thought that the PDF bookmarks pane would respect your mc-heading-level settings, but I guess that's not happening for you.
Maybe someone else will chime in with a suggestion.
-
ChoccieMuffin
- Senior Propellus Maximus
- Posts: 2650
- Joined: Wed Apr 14, 2010 8:01 am
- Location: Surrey, UK
Re: Too many headings in my printed TOC
Cheers bob, your encouragement is welcome. (And it's not so much a learning curve as a learning cliff - with overhang!)
I'm just going to give up with having different levels in PDF bookmarks and printed, it's just one too many problems to resolve. Unless of course anyone does know how to do it easily, I'm going to concentrate on the fatal problems I'm currently experiencing!
I'm just going to give up with having different levels in PDF bookmarks and printed, it's just one too many problems to resolve. Unless of course anyone does know how to do it easily, I'm going to concentrate on the fatal problems I'm currently experiencing!
Started as a newbie with Flare 6.1, now using Flare 2024r2.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Re: Too many headings in my printed TOC
We also use h1 for each topic, as each topic is an entry in the TOC. This is what I did to fix my headings for PDFs:
In my CSS, I created new heading subclasses exactly the way I want them for online (non-print) use. My new subheadings are called h2.NotInTOC, h3.NotInToc, h4.NotInToc. They are copies of the headings (h2, h3, h4).
Then I copied them and pasted them in the @media print section of the CSS file. There, I edited them for PDF output by adding mc-heading-level: 0; to prevent the subheadings from showing up in the PDF bookmark pane--only the h1 headings are listed there.
Now I can build my master TOC for online projects and use the same structure for my PDF TOC.
In my PDF target, I selected "Use TOC depth for heading levels" so now when I generate the PDF, the bookmarks look exactly like my TOC and all my headings are resized according to their hierarchy levels.
Even though I have to retag all my subheadings--I'm so happy! It works really well.
I hope this helps!
Diana
In my CSS, I created new heading subclasses exactly the way I want them for online (non-print) use. My new subheadings are called h2.NotInTOC, h3.NotInToc, h4.NotInToc. They are copies of the headings (h2, h3, h4).
Then I copied them and pasted them in the @media print section of the CSS file. There, I edited them for PDF output by adding mc-heading-level: 0; to prevent the subheadings from showing up in the PDF bookmark pane--only the h1 headings are listed there.
Now I can build my master TOC for online projects and use the same structure for my PDF TOC.
In my PDF target, I selected "Use TOC depth for heading levels" so now when I generate the PDF, the bookmarks look exactly like my TOC and all my headings are resized according to their hierarchy levels.
Even though I have to retag all my subheadings--I'm so happy! It works really well.
I hope this helps!
Diana
Re: Too many headings in my printed TOC
Just an FYI, you didn't need to do the manual copy-and-paste. If you create the styles in the default medium they'll show up under the print medium, although they won't actually be added to the print medium in the stylesheet file until you change an attribute. So after creating the styles, you switch the view to print medium, then select the styles and set the mc-heading-level to 0. Once you change that attribute, if you open the stylesheet in the Internal Text Editor, then you'll see your custom class and that one attribute in the @media print section of the stylesheet.Diana_BB wrote:In my CSS, I created new heading subclasses exactly the way I want them for online (non-print) use. My new subheadings are called h2.NotInTOC, h3.NotInToc, h4.NotInToc. They are copies of the headings (h2, h3, h4).
Then I copied them and pasted them in the @media print section of the CSS file. There, I edited them for PDF output by adding mc-heading-level: 0; to prevent the subheadings from showing up in the PDF bookmark pane--only the h1 headings are listed there.
In Advanced view, you'll see the mc-heading-level attribute if you set the stylesheet to "Show: Set Properties" or "Show: Alphabetical List" or "Show: Property Groups" (under the Unclassified group).
Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
Re: Too many headings in my printed TOC
Thanks for that tip, Lisa!
I will remember that next time.
Diana
I will remember that next time.
Diana
-
ChoccieMuffin
- Senior Propellus Maximus
- Posts: 2650
- Joined: Wed Apr 14, 2010 8:01 am
- Location: Surrey, UK
Re: Too many headings in my printed TOC
Thanks Diana, and yet again the lovely Lisa. What a helpful bunch!
Started as a newbie with Flare 6.1, now using Flare 2024r2.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
-
ChoccieMuffin
- Senior Propellus Maximus
- Posts: 2650
- Joined: Wed Apr 14, 2010 8:01 am
- Location: Surrey, UK
Re: Too many headings in my printed TOC
Update:
In a support call today it was suggested that if I want to have Heading 3s showing up in my PDF bookmarks but not in my main TOC, I should create bookmarks from all the Heading 3 headings and then in the PDF Options section of the PDF Target, check the checkbox "Include non-TOC bookmarks in the bookmarks pane".
I have yet to try it, but thought I'd share the advice in case it's of any use to others.
In a support call today it was suggested that if I want to have Heading 3s showing up in my PDF bookmarks but not in my main TOC, I should create bookmarks from all the Heading 3 headings and then in the PDF Options section of the PDF Target, check the checkbox "Include non-TOC bookmarks in the bookmarks pane".
I have yet to try it, but thought I'd share the advice in case it's of any use to others.
Started as a newbie with Flare 6.1, now using Flare 2024r2.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
Re: Too many headings in my printed TOC
I'm not sure that will work. We use bookmarks on some of our headings and have some experience with including bookmarks. When we included bookmarks in the PDF, they got generated at the bottom of the Bookmarks pane, not where the heading would be in the TOC.
Also, every bookmark in the document is listed exactly as they are named (not pretty for some of our bookmarks and meaningless for others).
Perhaps 6.1 does this differently--I haven't included bookmarks since 5.
It might be worth trying it on one topic--just to see. And, it's easy to remove the checkbox if it doesn't work.
Good luck!
Diana
Also, every bookmark in the document is listed exactly as they are named (not pretty for some of our bookmarks and meaningless for others).
Perhaps 6.1 does this differently--I haven't included bookmarks since 5.
It might be worth trying it on one topic--just to see. And, it's easy to remove the checkbox if it doesn't work.
Good luck!
Diana