PDF TOC for hierarchical numbering

I have created a manual using a template that uses <$hn> for numbering and is nested up to 4 levels. If I want a single-level TOC it is no big deal to create. However, if I expand the folders and containers in my Binder and select the whole thing I have issues:

  1. It looks good when I paste and is indented correctly on the left.
  2. It even works most of the time on 8.5x11" paper, but problems appear when I drop the page-settings to 6x9"
  3. The tab-stop for the page number is past the 4.5" width of the text, so I need to move it back.
  4. As soon as I drag the right-hand tab stop, I lose all of the indentings at the left. Scrivener did that indenting by adjusting the margins not by using tab-stops.
  5. The only way to re-align the left is to put in 3 tabs on the left (1/8" apart) and manually add the correct number of tabs for each of the 100+ lines. Then compile and print. When fix up the few right-hand alignment issues.

Has anyone successfully followed the Scrivener manual’s (page 326) instructions for PDF when using nested hierarchically binder?
Does anyone have a better idea how to do this?

I think I now have a good answer

TOC for PDF Output or Paperback Book
For printed output, as the final step before publication, you must create it manually. Traditionally all Front Matter pages, except for Copyright page, start on odd-numbered right-hand Recto pages. The Copyright page is always on the back of the Title page. Many authors add blank pages to the front matter to force pages to start on a recto page. See section Front Matter vs Recto Pages for a better way to do this.
These are the steps to generate the TOC manually:
1. Go to File => Page Setup and make sure that your page size is set to the size of your actual planned output! Warning: Compile => Page Settings => Page Setup looks the same but appears not cause the TOC to be generated for the current page size when using Edit => Copy Special => Copy as TOC.
2. In your Front Matter folder, create a blank text document called Table of Contents, add a title and format it at the top then add couple blank lines, making sure that these paragraphs are left aligned and are of the font and type size of your body text. Make sure that the new page has Include in Compile, Page Break Before, and Compile As-IS checked in the Inspector Pane.
3. In the Binder, select the items you want in the TOC. You may need to expand folders and containers if you want a multi-level nested TOC. You can select one-at-a-time, or select the first thru the last. The contents of unexpanded folders will not show in the TOC.
4. Go to Edit => Copy Special => Copy Documents as ToC
5. Go to the recently created TOC page, position yourself at the bottom and paste using Edit => Paste and Match Style.
6. If you want the Front Matter pages in your TOC, you will have to copy-and-paste twice.
7. Do a compile and check the results. If you drag the tab-stop for the page number to the left, you will loose the indenting at the left. Then you will have to add your own tab stops and re-indent each line. I set my tab stops at 3/16, 3/8, 9/16”. For 100 items it is not fun, but it works.
8. Look for any lines where the page-number tag requires and extra tab to be properly aligned and fix.
Warning: Because the process of making the TOC is decoupled from the compile-process, it is possible to have one or more entries where page numbers are shown as “??”. This is likely because they don’t have “Include in Compile” checked or have been renamed or deleted since they were pasted.