mdBook
mdBook copied to clipboard
feature request: Generate PDF with outlines intact
I think it would be awesome if we can generate PDF with outlines intact. Also a command to generate pdf with outlines intact. I hope this idea aligns with the mdbook team.
I'm not sure what you mean by "outlines"?

This is a screenshot I took from my pdf/ebook reader on my phone. What I meant by Outlines is exactly this. Page links with title for faster and efficient navigations within pdf/ebook files.
I'm not sure what you mean by "outlines"?
I think the other term is "Table of Contents" ToC.
I'm not sure what you mean by "outlines"?
Maybe adding a new keyword in output.html.print, like outline = true/false
[output.html.print]
enable = true
page-break = true
outline = true # new keyword to include the 'ToC' in pdf print.
I see. Where should the ToC be placed? Before any chapters, or after any prefix chapters?
How should it be formatted? Simple "transposition" of the ToC list as currently rendered, or something else?
I see. Where should the ToC be placed? Before any chapters, or after any prefix chapters?
How should it be formatted? Simple "transposition" of the ToC list as currently rendered, or something else?
Not referring to ToC placed in a page of the generated pdf. It should be in the metadata of the generated pdf. I'm not sure if the outlines are a part of the metadata, but It should be included upon generating the pdf, which will be visible inside the pdf reader.

I had to manually edit the pdf outlines which was very time consuming. Why not include it upon generating the pdf?
Considering that the PDF is generated by the browser, I don't think we have any control over this. The document outline is already provided by us via semantic HTML (h2 etc.), so I'm not sure what else we can do.
You way want to look into back-ends that directly render to PDF like mdbook-pdf, and see if those support that. That said, that specific back-end seems to use Chrome and should suffer from the same limitations, so maybe mdbook-latex may work better for this.
Considering that the PDF is generated by the browser, I don't think we have any control over this. The document outline is already provided by us via semantic HTML (
h2etc.), so I'm not sure what else we can do.You way want to look into back-ends that directly render to PDF like mdbook-pdf, and see if those support that. That said, that specific back-end seems to use Chrome and should suffer from the same limitations, so maybe mdbook-latex may work better for this.
okay, thanks for the insights. I'll look into those packages/libraries that you mentioned. Thanks again.
mdbook-pdf now supports Table of Content, see: https://github.com/HollowMan6/mdbook-pdf/issues/1#issuecomment-1366157949