TOC with custom chapter title layout for print

Hi all! I’ve spent quite a few hours on this problem, using scrivener 3: I am trying to publish a book where the chapters’ first page have the following layout:

1
Chapter title
____

First paragraph

To do that, I have to set the Title Prefix for the “Chapter with Title” layout as <$n:chapter><$rst_scene>

The chapter documents are all on the same level under the Manuscript folder, there are no “Chapter Heading” folders.
The problem is that the TOC shows the entries as the numeric title prefix, instead of the actual document title:

1.......6
2.......10
3.......30

So it seems like the TOC is using the Section Layout setting as its value, but it seems like this would always be the incorrect way. A TOC entry has to always be the title of the document, ignoring any formatting placed on it no?

To add to my frustration, the TOC document shows the correct titles before compiling, meaning it clearly know where to get the titles. It also compiles properly when I compile only the TOC (of course the page numbers are question marks).

Either way, is there a way to have the TOC ignore the title prefix settings and just show the plain title?

Thanks in advance!

From the manual, I found:

Which apparently does exactly the opposite of what I need. I also realized that i can click on each title in the TOC before compilation, and “Remove Link”, thus leaving only the page numbers as links. This outputs the correct TOC.

I’d like to suggest the developer to add an option when pasting the TOC, to configure whether we want to use compiled or internal titles in the TOC.

I am not saying this will solve your problem, but there is a page about TOC at Scrivener Virgin (Not my site, not affiliated):

https://www.scrivenervirgin.com/2016/08/table-contents-scrivener-links/

See if that is applicable/ helpful.

The easiest way is to have an empty document with the chapter title for each chapter. Set that document as parent and convert it to a folder. Then you simply use a special Section Layout for the chapters where you specify how they should look and you change the section break to new line.

That way your ToC will get the correct titles withiut any extra coding or so.