Two questions on Zotero integration plugin: outlines and page numbers

Hi, I have two questions re this amazing plugin:

  1. Is it possible to add outline elements of a pdf to the exported md file?
    That is so the structure on the first screenshot:

Would result in something like that?

  1. The second one is probably too difficult to tackle with Zotero data, but you never know: often the pages in a PDF don’t correspond to the pages of the book. An instance of that is in the first screenshot. It is the first page of the book, yet it is the 14th page of the PDF. Some pdf readers allow you to create custom page mappings, but this data doesn’t trickle down to Zotero. Still, maybe there is a way to make the plugin provide “true” page numbers one way or another.

Thanks in advance for your time and attention!

The PDF format makes a distinction between page numbers (how many pages since the beginning of the file) and page labels (what the PDF creator wants the page number to appear as). In your example, a kindly PDF creator would have given a page label of “1” to page number 14. (Or you could do it yourself in a PDF editor if the creator was too lazy.)

Zotero doesn’t throw the page labels away if they’re there. You can see them right in its PDF viewer, even before the page numbers, where it might say something like “1 (14 of 323)”. They’re saved along with annotations that you make in Zotero. And Zotero passes them along to Obsidian.

In your template, where it says something like annotation.page, try changing that to annotation.pageLabel and see if that works.

1 Like

Thank you so much, it worked

(in fact I was systematically changing page / adding outlines to my pdfs, so I was curious whether I can transfer the fruits of this labour to obsidian)

Any ideas or hints where I can check for the items outlined in the pdf?
But in any case, thanks again.

I don’t know if there’s a very simple way. But as a last resort, you could always select the PDF attachment in Zotero, see its outline in the right sidebar, then copy-and-paste that into a note on the parent item in Zotero. Some template-fu in Obsidian should let you get that Zotero note inside your Obsidian note. (I’ve never bothered with making notes inside Zotero.)

This workaround won’t give you the nice sorting of your annotations according to their section. But in my experience, you wouldn’t be able to rely on that anyway. The PDF reader that I use on my iPad tries to do exactly that, and it works on maybe half of my PDFs. In the other half of PDFs, the “outline” is really just a bunch of bookmarks that only point to the entire page where each section begins — so if the page has more than one section header, all the annotations end up piled up underneath the last one. In the few cases where I really, really want the kind of interleaved outline-and-annotations that you illustrate, I end up just highlighting the section headers in a colour that I use only for that, then turning those coloured highlights into markdown sections by hand.

Good luck.

1 Like

Thank you for sharing your experience. I considered the last option you mentioned, and most likely I’ll stick to it, for the more than one section per page problem.

There was an idea related to this shared by @pseudometa in the #mgmeyers-plugin-support thread under the #academic-tools channel on the Discord server, recently:

pdf.tocgen is a set of command-line tools for automatically extracting and generating the table of contents (ToC) of a pdf file. It uses the embedded font attributes and position of headings to deduce the basic outline of a pdf file.
https://krasjet.com/voice/pdf.tocgen/
Now I’d love to see that one integrated with the PDF annotation extraction workflow

Source: Discord

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.