asciidoctor-pdf: Can't control PDF TOC output location

I am unable to prevent the TOC coming out as the very first set of pages in the PDF. I want them in a controllable location later in the document (after Amendments table, Acknowledgements).

I tried :toc: macro at the top, and toc::[] at the desired location, but this has no effect. Ideally I need a solution that also enables the same source to generate an HTML output with TOC on the left. I don’t mind invoking asciidoctor with different command lines if need be to achieve this.

UPDATE: I discovered that if I put :toc: macro below the title heading (first = xxxx line), that no TOC at all comes out even with the toc::[] later on. No idea what is going on now. Why does it matter where the :toc: line goes?

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 18
  • Comments: 15 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Currently the location of the toc cannot be controlled in PDF. Part of the reason is that it’s very complicated to calculate the page offsets as it is, and moving it makes it even more complicated. We just need some better abstractions so that moving the toc around doesn’t break other things.