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

Just signed up to add my +1 here. Four years in guys, come on!

Can’t imagine it being difficult (as a developer myself) - Obsidian already has the data structure from its own TOC. I’d contribute cash if there were a feature bounty.

1 Like

Please add this feature :slight_smile:

+1 here
I use Automatic Table of Content (TOC) plugin to generate in-page toc from headers.
It would be fantastic to have similar toc/bookmarks generated from MD headers into PDF via Obsidian’s built-in pdf export (or via some plugin).

I think it should be a general functionality, for all languages.
Anyway this functionality isn’t in the language level, it is more at the core level than than. So when implemented should cover for all languages as I would assume it.

How is it possible that after 4 years still nothing. No programmer available? Are we willing to pay for such an essential function

First, It’s possible to add a TOC to notes for PDF export, but there are two problems:

  1. links in exported PDFs won’t work, this requires an update/revision of Obsidians code relative to links, PDF export
  2. Also, because of the nature of markdown, creating a beautiful TOC is hard.

point one

Without working links, even the most beautiful looking TOC in a PDF becomes useless

point two

You can’t generate a nice looking TOC:
If page numbers are aligned perfectly to the right, Chapter indentations on the left will look messy.

A unconventional, but ok looking TOC (clean view and header indentation) would place numbers before headers. Like this:

To generate a classic TOC, you’d need to calculate the right amount of dots for each line between headers and page number, considering the level of indentation too.
But even if you calc the distance between headers and page number, the result won’t be exact but approximate, if we consider that characters are around the width of 2 typed dots.

Please consider adding this. If the markdown document has headings, the exported PDF could pick up those headings automatically and put them on a TOC.

Exporting to pdf with the table of content and sidebar headings is really fundamental for structured notes. And one of the strenghts of Obsidian is how well it handles headings.

Currently I’m forced to

  1. export to pdf
  2. open pdf with microsoft word
  3. publish to pdf including table of contents.

However the result is anything but perfect