TOC depth level issue

This forum is for all Flare issues not related to any of the other categories.
Post Reply
Iziris
Propeller Head
Posts: 11
Joined: Mon Nov 28, 2016 7:35 am

TOC depth level issue

Post by Iziris »

Hi everyone, i'm a new MadCapFlare user. :)
I've been looking around the forum but couldn't find any solution.

I have created a project where several H1,H2,H3 and H4 are contained.
I have also inserted a TOC proxy.
That is what my Master TOC looks like :

Title
TOC proxy
Chapter 1 H1
Part 1 H2
intro 1 H3
text 1 H4

Unfortunately I can only see up to 2 heading levels in my PDF print based output. Beyond the level 2 I can't see any title.
Generate Toc proxy is selected
Use TOc depth for heading levels is selected

I don'tt know what to do, please can somebody help me ?
ajturnersurrey
Sr. Propeller Head
Posts: 346
Joined: Fri Nov 05, 2010 3:30 am

Re: TOC depth level issue

Post by ajturnersurrey »

I am guessing your TOC tree looks something like:

Title (h1)
-TOC proxy (h2)
-Chapter 1 (h2)
-Part 1 (h2)
-Intro 1 (h2)
-Text 1 (h2)

Getting only h1 and h2 there would be consistent with choosing to 'use TOC depth for heading levels'. This setting will disregard that you might have started the Text 1 topic with H4 and and choose the right level for to fit the place it is used in your TOC structure.

If you want to see all those levels, but still choose 'use TOC depth for heading levels' your TOC tree would need to look like:

Title (h1)
TOC proxy (h1)
Chapter 1 (h1)
-Part 1 (h2)
--Intro 1 (h3)
---Text 1 (h4)

Alternatively turn off 'use TOC depth for heading levels' and the document will follow the heading levels you put in your topics.
Iziris
Propeller Head
Posts: 11
Joined: Mon Nov 28, 2016 7:35 am

Re: TOC depth level issue

Post by Iziris »

Thank you for the reply :)
My toc tree looks exactly like that :
Title (h1)
TOC proxy (h1)
Chapter 1 (h1)
-Part 1 (h2)
--Intro 1 (h3)
---Text 1 (h4)

i tried to turn off 'use TOC depth for heading levels'
But my TOC tree in the output still looks like that :

TITLE (h1)
chapter 1 (h1)
-Part 1 (h2)

all title that contains a h3 or more are still ignored ....
Is that clear ?
thanks again for your patience .
devjoe
Sr. Propeller Head
Posts: 337
Joined: Thu Jan 23, 2014 1:43 pm

Re: TOC depth level issue

Post by devjoe »

To clarify:
Does the content of Intro 1 (h3) and Text 1 (h4) appear in the body of the PDF?
Do these headings appear in the printable table of contents in the PDF?
Do these headings appear in the bookmarks of the PDF?
Iziris
Propeller Head
Posts: 11
Joined: Mon Nov 28, 2016 7:35 am

Re: TOC depth level issue

Post by Iziris »

yes, the text appears in body of the PDF
these two headings do not appear in the pdf's TOC
And they do not appear in the bookmark either
mpaquette
Propeller Head
Posts: 12
Joined: Thu May 22, 2014 1:35 pm
Location: Montreal
Contact:

Re: TOC depth level issue

Post by mpaquette »

Hi Iziris,

Does your stylesheet specify the mc-heading-level attribute for the h1, h2, ..., or h6 elements?

From your description, I'm guessing that mc-heading-level is set to 0 (zero) for h3 and h4 in your stylesheet. A value of 0 means that the element will be excluded from the toc-proxy in the final output.

Note that the mc-heading-level attribute applies to the heading level in the final output, not the heading level in your source.

Side note: on our team, we consider it bad form to hard-code the heading level in a topic; all our topics start with an h1 element. To specify heading levels in the final output, we choose to use the Flare TOC and the Flare target's Use TOC Depth for Heading Levels option. Our rationale: easier maintenance, and content is clearly separated from hierarchy. We can quickly and safely shuffle topics around in the Flare TOC without also editing topic content.

Marc.
Marc Paquette | Technical Writer
FlareLint is open source software to reduce production time and improve quality: https://flarelint.github.io/
Iziris
Propeller Head
Posts: 11
Joined: Mon Nov 28, 2016 7:35 am

Re: TOC depth level issue

Post by Iziris »

WAAAAA thank you Marc
that was exactly that, h3 and h4 mc heading levels were set to 0
now it works just fine !

MadCapFlare is so complex, thank you all for your answers.
Paul_N
Propeller Head
Posts: 54
Joined: Mon Feb 09, 2015 5:57 am
Location: Yorkshire, UK

Re: TOC depth level issue

Post by Paul_N »

Iziris wrote:WAAAAA thank you Marc
that was exactly that, h3 and h4 mc heading levels were set to 0
now it works just fine !

MadCapFlare is so complex, thank you all for your answers.
I'll second the above thanks to Marc: I had the same problem with PDF ToC levels being too deep, and it was fixed by setting mc-heading-level = 0 for h3 and h4.
seropes
Jr. Propeller Head
Posts: 4
Joined: Fri Aug 04, 2017 10:57 am

Re: TOC depth level issue

Post by seropes »

Yep, this fixed worked for me too. Marc rocks!
DavidJGross
Propeller Head
Posts: 17
Joined: Thu Mar 12, 2020 6:54 am

Re: TOC depth level issue

Post by DavidJGross »

I know I'm waking up a very old thread, but this is a problem. What if I want to use the same topic on different outputs, and in one topic I want to have my TOC show four levels and on the other I want it to show two levels. I could create a new medium I guess, but do I really want to create a whole new medium for a single output? Why in the world can't I just define in the target how many levels deep I want the TOC to show?

I will probably cross-post something similar to this comment as a standalone thread.
EileenP
Propeller Head
Posts: 78
Joined: Thu Jun 12, 2014 4:34 am

Re: TOC depth level issue

Post by EileenP »

DavidJGross wrote:I know I'm waking up a very old thread, but this is a problem. What if I want to use the same topic on different outputs, and in one topic I want to have my TOC show four levels and on the other I want it to show two levels. I could create a new medium I guess, but do I really want to create a whole new medium for a single output? Why in the world can't I just define in the target how many levels deep I want the TOC to show?

I will probably cross-post something similar to this comment as a standalone thread.
This is my issue, as well. Did you resolve this? Is there another way besides creating a new medium??
Thank you.
NorthEast
Master Propellus Maximus
Posts: 6359
Joined: Mon Mar 05, 2007 8:33 am

Re: TOC depth level issue

Post by NorthEast »

There's not a neat way to have different styles per target - the options are to use mediums or different stylesheets.

I use mediums to define styles used in types of targets (help, PDF, etc.), but not for individual targets - as that isn't going to work well in most cases.

Anyway, you could handle it using different stylesheets like this:

(1) Keep your regular styles together in one stylesheet, e.g. Styles.css.

(2) Create a new stylesheet for each target that require some specific styles, e.g. Target_A.css.
This would contain something like this:

Code: Select all

@import url('Styles.css');

/* styles for target A - overrides what's in styles.css */

h3, h4 
{ 
  mc-heading-level: 0; 
}
This imports everything in styles.css, and you just add what's different for that target.

(3) Set Target A to use Target_A.css, rather than Styles.css.
Post Reply