You might try using pandoc to do the PDF conversion. I don't know where it would put the TOC or whether there is some option to control the location.
Another possibility is using pandoc to convert to asciidoc format, then use either asciidoc or asciidoctor to make the PDF.
It has been a long time since I have used pandoc, asciidoc, or asciidoctor. All of these have had a lot of development since then. The last time I generated a PDF with asciidoc, the in document TOC was near the front with a link to each entry and a TOC which PDF viewers with TOC support can use.
|