Positioning TOC for both HTML and PDF?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Positioning TOC for both HTML and PDF?

wolandscat
I have the TOC coming out on the left, with desired number of levels in HTML, using the following in the header section.

:doctype: book
:toc: left
:toclevels: 4

But for PDF, and any other linear output, I need it in the expected location, i.e. quite a few pages in, after the Amendment history table (this is a large tech spec book style document).

If I use :toc: macro, and toc::[] in the required location, I get a linear style HTML with the TOC where I expect it, but the PDF generated by asciidoctor-pdf seems to ignore the placement, and just puts a TOC (which does have the right levels, so the PDF-generator appears to have read the toclevels attribute value) as the first thing in the output - above everything else...

Part of this problem is that asciidoctor-pdf is doing the wrong thing in terms of placement, but my main requirement is to have one .adoc source that can generate both linear and interactive output.

Is there a current solution to this problem?

Clearly to get the right behaviour for generating a linear source and also an interactive source (i.e. anything like two-pane HTML) with a single set of directives is a bit tricky.

I think dealing with this properly means a command-line 'linear-output' or similar option is needed to tell the back-end processor to generate linear output or not, and if so, pay attention to the toc::[] location; if not, interpret the toc:location attribute in a meaningful way.

I can imagine the same argument applying to an index.
Reply | Threaded
Open this post in threaded view
|

Re: Positioning TOC for both HTML and PDF?

wolandscat
I've done some further experimenting on the PDF output. So far I cannot make the TOC appear anywhere other than right at the beginning, i.e. before the title page. Using :toc: macro and toc::[] have no effect on the PDF output, although they do affect the HTML output.

Is there an obvious setting I am missing here?
Reply | Threaded
Open this post in threaded view
|

Re: Positioning TOC for both HTML and PDF?

mojavelinux
Administrator

On Thu, Jun 25, 2015 at 5:18 PM, wolandscat [via Asciidoctor :: Discussion] <[hidden email]> wrote:
So far I cannot make the TOC appear anywhere other than right at the beginning, i.e. before the title page.

That's the current restriction.

I'll follow-up with more details when I get a chance.

Reply | Threaded
Open this post in threaded view
|

Re: Positioning TOC for both HTML and PDF?

Connor
I assume there is no fix for this yet? When generating a PDF or HTML I want my ToC to appear after the title page and copyright/legal notice.
We are using a custom style (for PDF at the moment, HTML soon) but haven't been able to find a workaround using the style.
Thanks,
Reply | Threaded
Open this post in threaded view
|

Re: Positioning TOC for both HTML and PDF?

habamax
Connor wrote
I assume there is no fix for this yet? When generating a PDF or HTML I want my ToC to appear after the title page and copyright/legal notice.
We are using a custom style (for PDF at the moment, HTML soon) but haven't been able to find a workaround using the style.
Thanks,
Well there actually is a fix for this. https://github.com/asciidoctor/asciidoctor-pdf/issues/1030