Question
I am generating a PDF target using the same TOC for both HTML5 and PDF output. The "front matter" pages are included in the TOC (conditioned for PDF output only) so that their content appears in my output, but I don't want them to show up in the printed TOC itself; nobody needs to know that the cover page is on page i, or what page the TOC, which they're presently viewing, starts on. My TOC page simply has a title and a toc proxy, and I can't find a way to tell the proxy to start with the first page of actual content. Is there an easy way to do this without creating a duplicate TOC for the proxy that doesn't include the front matter pages?
Solution
When I started to type this extra bit of information to help solve my problem, I figured out the solution myself: "Interestingly, the copyright page doesn't appear in the TOC, and I'm not sure why."
It turns out that the copyright page has no "title", while the cover and TOC pages are using h1 tags for their "titles". Since the TOC proxy generates the TOC based on heading levels (in my case, h1-h3 headings), the title and TOC pages are showing up there. The solution is to add a class to the h1 tags on those pages and then "style" that class so it doesn't get picked up by the proxy. Here's the code to do that:
HTML
Code: Select all
<h1 class="notoc">My PDF</h1> // on the Title page
<h1 class="notoc">Table of Contents</h1> // on the TOC page
Code: Select all
@media print
{
/* Leave h1 headings on the title and TOC pages out of the printed TOC */
h1.notoc
{
mc-heading-level: 0;
}
}