Most of my docs are served as HTML5, but occasionally I need to publish a handful of pages in PDF as release notes.
The PDF TOC just contains a list of software configurations that have changes, and each topic has a seemingly cryptic heading (h3) related to the software. Each topic page also has a <title> tag providing a more human-readable explanation of the topic purpose.
When it comes to publishing the PDF, the TOC proxy builds a Contents page using the h3 instead of the <title> value, meaning the contents page is practically unreadable.
When I build the HTML5 output, which uses exactly the same topics, the TOCs and mini-TOCs show the <title> value. Is it possible to do the same in PDF output?
<title> tag in TOC?
-
Nita Beck
- Senior Propellus Maximus
- Posts: 3672
- Joined: Thu Feb 02, 2006 9:57 am
- Location: Pittsford, NY
Re: <title> tag in TOC?
I don't think it is possible.
A TOC file serves a different purpose for a PDF than for HTML5 output.
For the latter, the purpose of the TOC file is to populate navigation. However TOC entries are labeled is how their corresponding menus items will appear in navigation. This paradigm goes all the way back to the original Microsoft HTML Help Workshop for which a TOC file was used to populate a Contents panel that appeared at the left of the window. (We see this preserved in .CHM output.) A miniTOC also draws its headings from the TOC file.
By contrast for print output, the purpose of the TOC file is to identify which topics Flare is to draw on, in what order, and in what hierarchy, to include in the output. It is essentially an outline. Flare does not use the TOC file to generate the table of contents that appears within the PDF. For that, Flare extracts the headings that exist within the topics that have been selected for inclusion.
A TOC file serves a different purpose for a PDF than for HTML5 output.
For the latter, the purpose of the TOC file is to populate navigation. However TOC entries are labeled is how their corresponding menus items will appear in navigation. This paradigm goes all the way back to the original Microsoft HTML Help Workshop for which a TOC file was used to populate a Contents panel that appeared at the left of the window. (We see this preserved in .CHM output.) A miniTOC also draws its headings from the TOC file.
By contrast for print output, the purpose of the TOC file is to identify which topics Flare is to draw on, in what order, and in what hierarchy, to include in the output. It is essentially an outline. Flare does not use the TOC file to generate the table of contents that appears within the PDF. For that, Flare extracts the headings that exist within the topics that have been selected for inclusion.
Nita

RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
-
ChoccieMuffin
- Senior Propellus Maximus
- Posts: 2650
- Joined: Wed Apr 14, 2010 8:01 am
- Location: Surrey, UK
Re: <title> tag in TOC?
If you edit your TOC so that instead of having [system%title] (or whatever it puts by default - the thing with the blue text) edit the TOC entries to have what you actually want to appear. When you generate your PDF, it'll use what you put in the TOC rather than the cryptic h3s.
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
-
Nita Beck
- Senior Propellus Maximus
- Posts: 3672
- Joined: Thu Feb 02, 2006 9:57 am
- Location: Pittsford, NY
Re: <title> tag in TOC?
Are you sure about that for PDF output?ChoccieMuffin wrote:If you edit your TOC so that instead of having [system%title] (or whatever it puts by default - the thing with the blue text) edit the TOC entries to have what you actually want to appear. When you generate your PDF, it'll use what you put in the TOC rather than the cryptic h3s.
I just tested and did not get that result. I edited a TOC item so it read "NITA" instead of using the linked title. In the generated PDF, the PDF bookmark panel did not show "NITA" but showed the heading of the linked topic, and in the generated table of contents inside the PDF, I see listed the heading of the linked topic, not "NITA". What you say is definitely true of online output (as far as navigational items), but I don't think it's true for print output.
I'm totally OK with being shown I'm wrong about this...
Nita

RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
Re: <title> tag in TOC?
@ChoccieMuffin, can you confirm that? I haven't been able to modify any of the text shown in a PDF TOC except by changing in-topic headings.
-
ChoccieMuffin
- Senior Propellus Maximus
- Posts: 2650
- Joined: Wed Apr 14, 2010 8:01 am
- Location: Surrey, UK
Re: <title> tag in TOC?
I'm taking a look at that now.
EDIT: You're quite right, that works for online outputs but not for PDFs. Soz.
And now you've got me thinking how you can get over this - off to have another play!
EDIT: You're quite right, that works for online outputs but not for PDFs. Soz.
And now you've got me thinking how you can get over this - off to have another play!
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: <title> tag in TOC?
Right then, you are all right, and I was wrong.
Anyway, as a possible way to fix this, how about each topic having a heading conditioned as PrintOnly that contains the human-readable topic and another heading that contains the gobbledy-gook it currently contains?
If that's a possiblity, you'll need to do the following search and replace:
Note that I don't know how to include Returns in Flare's search and replace as I tend to do anything other than really simple in FAR. I'm sure someone will help with how to include CRLF in Flare's search, but if not, do it in a basic editor.
Assumption: you have a condition tag set called Primary that contains conditions PrintOnly and ScreenOnly. There isn't anything else at the start of your file (e.g. index markers) between the <body> tag and the first heading.
Search for:
<body>
<h3>
(include the CRLF)
Replace with:
<body>
<h3 MadCap:conditions="Primary.PrintOnly"><MadCap:variable name="System.Title" />
</h3>
<h3 MadCap:conditions="Primary.ScreenOnly">
(Again include CRLF)
When generating your PDFs, exclude Primary.ScreenOnly (unless you also want the gobbledy-gook to appear as well.)
When generating your HTML, exclude Primary.PrintOnly.
There, that should do the trick.
<CM takes a bow and exits stage left, pursued by a bear>
Anyway, as a possible way to fix this, how about each topic having a heading conditioned as PrintOnly that contains the human-readable topic and another heading that contains the gobbledy-gook it currently contains?
If that's a possiblity, you'll need to do the following search and replace:
Note that I don't know how to include Returns in Flare's search and replace as I tend to do anything other than really simple in FAR. I'm sure someone will help with how to include CRLF in Flare's search, but if not, do it in a basic editor.
Assumption: you have a condition tag set called Primary that contains conditions PrintOnly and ScreenOnly. There isn't anything else at the start of your file (e.g. index markers) between the <body> tag and the first heading.
Search for:
<body>
<h3>
(include the CRLF)
Replace with:
<body>
<h3 MadCap:conditions="Primary.PrintOnly"><MadCap:variable name="System.Title" />
</h3>
<h3 MadCap:conditions="Primary.ScreenOnly">
(Again include CRLF)
When generating your PDFs, exclude Primary.ScreenOnly (unless you also want the gobbledy-gook to appear as well.)
When generating your HTML, exclude Primary.PrintOnly.
There, that should do the trick.
<CM takes a bow and exits stage left, pursued by a bear>
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: <title> tag in TOC?
Cheers Choccie. Separate <hx> tags with conditions was the workaround I already implemented to bypass this. It's ugly but it works.
For those struggling to get the CRLF working in Find or Find and replace, search by Regular Expressions and include the text ([\s]*) , so <body>([\s]*)<h3>. That will find all instances of the initial heading.
Regex doesn't work in the Replace section unfortunately, but that shouldn't matter in this scenario.
For those struggling to get the CRLF working in Find or Find and replace, search by Regular Expressions and include the text ([\s]*) , so <body>([\s]*)<h3>. That will find all instances of the initial heading.
Regex doesn't work in the Replace section unfortunately, but that shouldn't matter in this scenario.