I threw together a somewhat hacky solution to get at least a sidebar table of contents in the pdfs that I dump out of obsidian. It’s not super important to me that the TOC is actually imbedded into the body text, I just wanted to have the navigation ability and it hasn’t been implemented into pdf exports from the editor yet.
If you’d like to work this to fit your exported document style you can do as I did as well and replace the toml recipe with the heading style from your own theme that you’re using.
I explain in a bit more detail on my repo how I did it and how it works. Perhaps somebody would like to take this and expand.
**Edit: Added a picture for clarity