fuxialexander / org-pdftools

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

Is org-pdftools supposed to be a replacement for org-pdfview? #13

Closed fpopineau closed 4 years ago

fpopineau commented 4 years ago

Hi,

Thanks for org-pdftools. I wish it could act as a replacement for org-pdfview. When I export some org subtree to latex, then I compile it, I was used to org-pdfview opening the resulting PDF. It is not the case with org-pdftools.

With org-pdfview, I am able to open a PDF file like this: (org-open-file "~/pdf/TD3-BN.pdf") but with org-pdftools, it seems that the path does not match the link, hence nothing is opened.

I set org-file-apps accordingly in both cases and tried to edebug through org-pdftools-open.

Any insight about the differences and what is expected?

Regards,

fuxialexander commented 4 years ago

org-pdftools is supposed to be used with pdftools, not other system pdf viewers.

fpopineau commented 4 years ago

Hi,

Unfortunately, I am using pdftools as my pdf viewer. (And I don't understand why you inferred that it might not be the case ?)

Regards,

fuxialexander commented 4 years ago

For opening "pdftools:" links, is that working fine? For (org-open-file "some.pdf"), I suppose pdf-tools itself can handle that? What's the use of org-pdfview here? If you are talking about org-file-apps, you can set it to ("pdf" . emacs) to let pdf-tools handle it.

fpopineau commented 4 years ago

Ok, it does work with the minimum link being: pdftools://:: . Now I see your point and I have been fooled by some instruction from the pdfview package, which said:

;; If you want, you can also configure the org-mode default open PDF file function.
;; (add-to-list 'org-file-apps '("\\.pdf\\'" . (lambda (file link) (org-pdfview-open link))))

And I replaced pdfview by pdftools whithout further thinking. This is what is not expected to work. Thanks,

hyiltiz commented 3 years ago

Hmm, so how should one adjust a config like

;; If you want, you can also configure the org-mode default open PDF file function.
;; (add-to-list 'org-file-apps '("\\.pdf\\'" . (lambda (file link) (org-pdfview-open link))))

so that it works with org-pdftools?

wiessall commented 10 months ago

I know it's been a long time, but me as a newbie I was wondering the same thing. To achieve '(org-file-apps '(("\\.pdf\\'" . emacs))) it is enough to use customize-variable org-file-apps and select 'Visit with Emacs'. This indeed let's org-pdftools handle everything automatically.