MiniTOC in PDF without page numbers

This forum is for all Flare issues related to PDF, eBook, Microsoft Word, Adobe FrameMaker, XPS, and XHTML book targets.
Post Reply
ruthhoward
Sr. Propeller Head
Posts: 121
Joined: Tue Jul 24, 2012 12:38 am

MiniTOC in PDF without page numbers

Post by ruthhoward »

So recently a colleague and I were discussing miniTOCs in PDF and whether we should use them or not. As a result I started playing with the miniTOCProxy styles in the CSS and managed to get one with no page numbers. My colleague expressed surprise because he'd looked into this in the past and had found that no one on the forums had an answer.

So here's how I've done it:

Add this to the “@media print” section of the CSS:

Code: Select all

 p.MiniTOC1
{
       mc-auto-number-position: none;
       mc-leader-format: 'none';
       mc-leader-offset: 0;
       border-top-style: none;
       vertical-align: baseline;
       mc-pagenum-display: none;
}
                
p.MiniTOC2
{
       mc-auto-number-position: none;
       mc-leader-format: 'none';
       mc-leader-offset: 0;
       border-top-style: none;
       vertical-align: baseline;
       mc-pagenum-display: none;
}
I think its the

Code: Select all

mc-pagenum-display: none;
setting that's sorting this out. The CSS editing GUI in Flare (10.2.2 for me) isn't great for this because the property is there but there's no indication of what might be a valid value - its not a dropdown and isn't in the Edit Style dialog. You have to do it manually in the row of the CSS editor or edit the CSS in text view.

Note, that this is all or nothing (I think). Because p.MiniTOC# is used for all miniTOCProxy styles the above will remove page numbering for any miniTOCProxy that you have irrespective of any class that might be applied to it. However, I think something like this might work (I haven't tried this yet):

Code: Select all

MadCap|miniTocProxy.list > p.MiniTOC1
{
       mc-auto-number-position: none;
       mc-leader-format: 'none';
       mc-leader-offset: 0;
       border-top-style: none;
       vertical-align: baseline;
       mc-pagenum-display: none;
}
                
MadCap|miniTocProxy.pagenums > p.MiniTOC1
 {
       mc-auto-number-position: none;
       mc-leader-format: 'none';
       mc-leader-offset: 0;
       border-top-style: none;
       vertical-align: baseline;
       mc-pagenum-display: all;
 }
JenAllen
Jr. Propeller Head
Posts: 3
Joined: Mon Oct 14, 2019 1:40 pm

Re: MiniTOC in PDF without page numbers

Post by JenAllen »

Did you ever test this? Because I cannot get it to work in the PDF. In the HTML, I could get it to work when I Inspected the code in Chrome and found the right tags to use. So now I have one mini-TOC with bullets using display: list-item; and one without bullets by letting the display use the default. But in the PDF, both versions of the mini-TOC are identical.

In the CSS, I have defined MadCap|miniTocProxy.subTopics and MadCap|miniTocProxy.relatedTopics. To change the bullet display in HTML, the following works fine:

Code: Select all

div.MCMiniTocBox_subTopics_0 p.MiniTOC1 /* Note the _0 after the div class name -- that is required although I don't know why.  If you inspect the source, the p class is really p.MiniTOC1_0, but you don't need to specify the _0 on the p tag class name in the CSS to change the display. */
{
	display: list-item; /* Displays as a bullet list */
	margin-top: 5px;
	mc-hidden: hidden;
}
div.MCMiniTocBox_relatedTopics_0 p.MiniTOC1  /* Display defaults to no bullets. Note the _0 after the div class -- that is required.  */
{
	margin-top: 5px;
	mc-hidden: hidden;
}
But in the PDF, it does not want to let me change the p tag style using selectors. I tried changing the text decoration just to make it easier to see if anything really does change. Here's what I found:

First I tested this just to make sure I wasn't hallucinating:

Code: Select all

p.MiniTOC1 /* Changes all in PDF and HTML. */
{
   	text-decoration: overline;
}
As expected, all first-level mini-TOC entries in both PDF and HTML get an overline. I commented that line out and then tried the following one at a time:

Code: Select all

MadCap|miniTocProxy.subTopics > p.MiniTOC1 /* No effect in PDF or HTML */
{
   	text-decoration: overline;
}
div.MCMiniTocBox_subTopics p.MiniTOC1 /* No effect in PDF or HTML */
{
   	text-decoration: overline;
}
div.MCMiniTocBox_subTopics_0 p.MiniTOC1 /* Changes MiniTOC1 under miniTocProxy.subTopics in HTML but not PDF */
{
   	text-decoration: overline;
}
There should be a complex selector that lets me change p.MiniTOC1 in the PDF, but I can't find it. Any suggestions?

This is driving me crazy. I'm so close to having a really good CSS, but this one stumbling block may be a deal breaker for my group...

Thanks!

Jen Allen
Post Reply