‘Export to PDF’: export should include a document-TOC / use headings as bookmarks in the PDF / Table of content

Feature request: Notes exported to PDF should have a fully-functioning Table of Contents for PDF readers

Note that I am not referring to an internal compiled table of contents within the document itself. But @Klaas (see comment #1) pointed out this would also be a handy feature. This particular feature could be a part of a larger “export to PDF options” menu. (What other export options would be helpful? Could there be two option menus, a default and a pop-up per-note menu - or even a piece of YAML?)

Use case

I navigate PDFs religiously via the Table of Contents pane in most readers. Not only does a TOC provide quick access to all sections of a document, it provides an at-a-glance overview of the whole document. Without a table of contents, a document is like a scroll: to find your passage and be where you want to be is a linear path downwards. An auto-generated table of contents would vastly increase the accessibility with logical jumping off points available in the side-bar of any reader application. Your notes would be easily digestible and quick to navigate.

I can think of use cases beyond the traditional use of a table of contents, for Obsidian-exported notes. For example, headings could be questions to elicit active recall. The TOC in this instance would be used to test your remembrance and comprehension of information.

Proposed solution

The ‘Export to PDF’ feature for a note would automatically recognise headings and hierarchically include them for the PDF reader. This element of PDFs is a standard, industry-wide practice recognised by even the most basic of PDF reader applications (eg. Preview).

Current workaround

My current solution has been to use PDF Expert (purchased at the hefty price of $79.99) to manually add a Table of Contents, heading by heading.

Related feature requests

Make footnotes inside exported PDFs

Include File Outline or Table of Contents in file produced by “Export PDF”

54 Likes

I would like to add to your proposed solution that a ToC is also created for a PDF Reader’s ToC pane, a feature you mentioned in your use case.

Like you, I use ToCs a lot, even in my Obs notes, and a PDF version without a ToC is incomplete.

3 Likes

That’s a feature I hadn’t intended to request. Since I typically generate my own embedded table of contents, this feature is of lower importance to me. Plus, since formatting of a TOC can vary based on personal preference, it could require additional formatting options or to recognise any CSS code. But I’ve edited the post to include a mention of this kind of TOC which, I agree, would be a pleasant addition to Obsidian’s export capabilities.

1 Like

Thanks.

1 Like

I took a dive into book formatting with markdown a bit ago, I can’t remember everything, and I didn’t take notes.
But something like bookdown might help?
Especially this page


I’m not 100% sure on the syntax of R Markdown but thought this might give you something to go on (And maybe the wider R markdown system?)
I’ll try and let you know if I come across anything else that might help
1 Like

This feature would be very useful.

1 Like

I’m missing this feature so much. A vote from me!

1 Like

Yes please!

2 Likes

I hope this function can be realized, which will help me a lot.

2 Likes

I need this feature!

1 Like

+1 here

1 Like

Use case or problem

When exporting large markdown files, it’s easier to navigated the PDF file with bookmarks.

Proposed solution

Use headings to properly create hierarchical bookmarks in the exported PDF file.

Current workaround (optional)

Using Typora to export to PDF which generates the bookmarks from headings. Downside is that images and block embeddings are not exported properly.

14 Likes

I don’t use the pdf export often, but +1.

1 Like

I use pdf export heavily. Tried using pandoc plugin, but it is not rendering pdf correctly. I generate pretty long notes with dataview plugin, and need bookmarks for headings to navigate the generate pdf easily.

I use PDFs a lot and I think this feature would be very helpful.

6 Likes

I use pdf heavily, strongly recommend add this function

5 Likes

This is a quite useful feature.

2 Likes

My work around is using pandoc.

cd BASE_DIR_OF_INPUT_OBSIDIAN_MD_PATH
pandoc --pdf-engine=xelatex -s -o OUTPUT_PATH INPUT_OBSIDIAN_MD_PATH

The syntax of image should use this format.

![](../assets/media/sceenshoot_20221115091617.png){ width=30% height=30%}
2 Likes

I hope this function can be implemented as soon as possible. I really need this function for pdf export.

3 Likes

I agree, it would be great to have headings in the PDF that correspond with the headings in the content.

1 Like