Compile section title duplicates document heading — want TOC but no printed section title

I am compiling a long manuscript to PDF and I want to keep the Binder hierarchy for the PDF TOC / bookmarks.

However, my documents already contain styled headings inside the text (large font, color, highlight, etc.).

When I compile, Scrivener inserts the section title again from the compile layout, which creates duplicate headings.

Example from my PDF output:

• the red title is the compile section title
• the large blue title is the heading inside the document

I want the PDF TOC / bookmarks to continue using the Binder structure, but I do not want the compile section title printed on the page.

Ideally this could be controlled with an option such as:

☐ Print Binder titles in compiled text

If disabled:

• Binder titles still generate PDF bookmarks / TOC
• the compile section title is not printed on the page
• the document’s own heading controls the page layout

Is there a way to achieve this behavior in the current compile system?

Example from my compiled PDF (red title inserted by compile, blue title from document):

Someone can correct me if I am wrong, but I don’t see a way to do this. To achieve what you want, probably you will just want to let compile insert and style the section titles for you, instead of retaining them manually in the text – adjusting the section title styling in your compile settings to match your desired look for them. Alterrnatively, you can adjust your chosen compile format so that it does not superadd the section titles to yur text, but then you will have to add the desired bookmarks for your pdf yourself.

The bookmark outline you see in the compiled pdf is picking up the titling that is prefigured in your compile settings (for pdf) under Section Formats, for each section format (see figure 1). That section title gets there b/c you have Titles checked for inclusion, or (see figure 2), just maybe because you have used the <$title> placeholder in the Title Options area.

If there is no (section) title showing in these areas of your section formats, your pdf will not show bookmarks for those sections (even though you have the PDF outline option checked). The bottom line: the titles inseerted by compile into your text and the bookmarks generated for your pdf output appear to be inextricably tied together.

Of course, if you just let the section titles be inserted by compile, this area of your compile format is where you would specify what you want those section titles to look like in your text for the various types of section.

P.S. It does seem sensible to me that Scrivener should default to using the doc title for the PDF outline option, if nothing is specified in the Section Title area of the section format. Defaulting to nothing seems like it unnecessarily contravene’s the request made by enabling the Make PDF Outline checkbox. This might be a worthy wishlist item.

1 Like

My solution would be to make your in text headings into annotations, which can be excluded at compile time.

:slight_smile:
Mark

That could very well fill the PDF outline with spoilers, internal editing notes or whatever else one uses the outline title for when it isn’t orchestrating document structure.

I maybe don’t understand the ultimate need for the original request though, as I don’t understand why one would require the heading coming from within the text content area rather than from the outline heading in the binder—especially if the two are one and the same, as seems to be indicated in the screenshots.

I’d understand it a bit more if the outline is nothing but the type of stuff I mentioned above, where it’s all internal notation and you thus want to use a piece of text in the main editor as its formal title,[1] but if they are the same we might as well just have that information typed into the software once, no?

Well, one way of fixing this, I think, if one desires to have the text in the editor as a matter of preference, is to make the text essentially author-only. There is the solution of using inline annotations, as noted above, but it’s also worth noting that the text of any given style can be bulk excluded, too, as a high level formatting decision that doesn’t require modification of the original text.

  1. Open the compiler, and double-click on the Format in the left sidebar that is being used for this project.
  2. In the Styles pane, click the + button and add “Heading 1”, from the project’s style list (or whatever it is called).
  3. For this style’s options, on the right hand side, tick the Delete text of this style option, at the very top. The rest can be ignored.

  1. Though in that case, I would wonder if the Synopsis field wasn’t a better place for internal notes, so that the Title can remain a structural tool. ↩︎

1 Like

I think the OP is not thinking it would be super sensible to run two distinct (but matching!) headings in parallel, but is only thinking about dealing with the situation they are in.

I think we will probably find that the request arose because the OP simply thought putting their headings at the start of sections and styling them there was a natural thing to do. And now, some considerable manual labor invested, thought there ought to be a way to turn the insertion of headings by compile off (there is) – only to discover this removed their bookmarks in the resulting pdf.

2 Likes

Hmm. Yes, there is that.

Current Workaround (and its Problem? “easter egg.”)

At present, the only way to prevent Binder titles from appearing in the compiled output is to hide them manually.

My current workaround is to format the automatically inserted heading like this:

• Font size: 1 pt
• Font color: white
• Line spacing: 0.5

This visually hides the heading on a white page.

However, this method introduces a problem.

If a reader opens the PDF in dark mode or with inverted colors, the hidden white text becomes visible. This can make it appear as though the document contains strange tiny hidden text — almost like an unintended “easter egg.”

Readers may interpret this as:

• a formatting mistake
• hidden content
• corrupted text
• or a deliberate hidden message

Red Text on purpose for your view.

Currently, Scrivener allows font colors but does not support opacity/transparency. So I pick Font color: WHITE!

See as an example.

I choose Line spacing: 0.5

I choose Font size: 1 pt

RESULT!

It will work on the TOC (Table of Contents) in PDF.

If someone uses the “Dark Mode” theme… they will see white or black as an unintended “easter egg.”

I will not publish a printed book. I will publish it electronically as a PDF.

Response to “gr” … thank you for suggest… I did try to cause the TOC to disappear from the listing.

Solution?

☐ Print Binder titles in compiled text

When disabled:

• Binder titles remain visible inside Scrivener for navigation
• Binder titles can still generate PDF bookmarks/TOC
• Binder titles are not inserted into the page layout

That is good for publishing it electronically (not on paper).

Sorry, I did not explain the reason or why to do it that way…

So my reason is…

In my workflow:

• The Binder title is used for navigation and organization.
• The visible title inside the document text may differ in wording, formatting, length, or color.

This separation is necessary for several practical reasons:

  1. Binder readability
    I sometimes shorten the Binder title so the Binder remains easy to scan and navigate when many sections are present. Long titles can make the Binder difficult to read.

  2. Full descriptive headings in the document
    The visible heading inside the text may be longer or more descriptive than the Binder label. This allows the manuscript to use complete titles while keeping the navigation structure concise.

  3. Flexible typography
    I sometimes adjust the heading font size depending on the length of the title. For example, a normal heading may be 24 pt, but if a title is very long I may reduce it to 18 pt so it fits properly on the page.

  4. Selective word styling
    In some cases I color or emphasize specific words in a heading to highlight key concepts. This styling cannot be expressed through the Binder title.

  5. Custom line breaks and layout
    I may want different line breaks than the Binder allows. For example, I might split a long heading across two lines in the document for visual balance, while the Binder needs a single-line title for navigation.

Because of these reasons, the Binder title functions primarily as a structural navigation label, while the visible heading inside the manuscript functions as a designed typographic element.

Thanks for reading and your wonderful feedback.

Very clever with the easter-egg titles!

It seems to me a better integration with the options already offered would be the other way around, a default-off sub-option checkbox for Generate PDF outline to Use binder titles or something along those lines, as a way of overriding what would otherwise be the default behaviour of using the layout’s title, title prefix, etc. or leaving the outline empty if none of these are in use.

That would allow the current title settings in the section layouts to remain as they are while accommodating a simplified outline structure vs. more complex titles or the need for unique styling of title words in a specific project.

2 Likes

I give you a better picture by showing examples using ePUB.

I converted to the dark mode theme, that’s what I get…

As Mimetic Mouton suggests, “Generate PDF outline to Use binder titles” to solve our problems, not just for me, but for all future users. Also for ePUB, too.

Besides that, all TOC looks good on both PDF and ePUB.

I hope somebody engineers/programs to add new features in the future.

Thanks for reading.