fuxialexander / org-pdftools

A custom org link type for pdf-tools
GNU General Public License v3.0
335 stars 36 forks source link

Exporting links to annotations with page and line number (or similar) #28

Closed tmalsburg closed 4 years ago

tmalsburg commented 4 years ago

I use this package for reviewing manuscripts. When I send my comments to the authors of those manuscripts, the links become useless because they typically don't use Emacs and the links in the exported PDF point to an absolute disk location. Would it be possible to export without links but with automatically added references like "(page 30, line 11)"?

Thanks for this package. Extremely useful for my work!

tmalsburg commented 4 years ago

This feature would be even more useful when exporting to plain text. 🙏

Currently I get quoted text followed by absolute path to PDF in parentheses which is not really useful.

fuxialexander commented 4 years ago

Should be possible, will take a look tomorrow.

fuxialexander commented 4 years ago

@tmalsburg emm a question: how could I know the which line the link is referring to? I cannot see obvious ways to get that..

tmalsburg commented 4 years ago

I'm not familiar with pdftools capabilities in this area, so I'm not sure. But giving at least the page number would be a very good start. Thinking about this a bit more, it might be good to allow users to configure the precise format. I'd prefer something like:

„This is a quote from a German manuscript“ (Seite 7)

Note the German quoting style. ("Seite 7" means page 7). But others obviously want something else.

And perhaps this format should actually be used when creating the org link, not when exporting. The benefit is that you can leave exporting untouched and all is handled during link creation. Plus, what we see in org is more faithful to what we get in the exported document.

fuxialexander commented 4 years ago

@tmalsburg That makes sense! I'll see what I can do

fuxialexander commented 4 years ago

@tmalsburg You can now use your own description generation function! One wild idea could be using the filename (which could also be a bibtex-key) to query bibtex-completion and get a formated citation! https://github.com/fuxialexander/org-pdftools/commit/4103f16e9c4a06a4d0951fc64da470330b832d5f

tmalsburg commented 4 years ago

Hi thank you so much. Love it!