Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Control toc position with toc-start attribute #278
Allow toc placement to be controlled with 'toc-start' attribute.
This fixes #233
If attribute is omitted, toc is placed immediately following the cover page (the same as it is now).
Changing the value to 3 allows for the an abstract or introduction or copyright notice to be placed prior to the table of contents.
An example adoc that puts the toc after the abstract would look like:
Thanks for submitting this PR!
I'll need to review this very carefully (testing against a bunch of different edge cases) since placing the toc into the document is a very tricky ordeal atm and the logic around it is...a little fragile to say the least. However, it's a great opportunity to get it cleaned up.
This was referenced
Oct 22, 2015
Until I can review this thoroughly, I can't be positive this doesn't break other use cases. The toc situation is very tricky because it has to work forwards and backwards.
Having said that, it is possible to use this code in your own project. You can see the InfoQ mini book as an example of how to override the code in Asciidoctor PDF to perform customizations similar to this one.