12

Many scientific papers, especially in the life sciences, are published in pdf format.

I want to work as much as possible within emacs (org-mode especially). I am aware of DocView mode which at least lets me view pdfs within emacs. I suspect it can do more for me but I haven't gotten beyond simply viewing the image based rendering of a pdf file.

Can anyone recommend ways of working with pdfs, most especially linking to files, exerting text and adding annotations to pdfs (the electronic equivalent of writing in the margins)?

Edit: Just to clarify I am not looking to actually edit the pdf image. Rather I want hyperlinked or bookmarked annotations in an org-file. I hadn't seen the text mode of DocView before, that might give me what I want but I don't know if I can bookmark/hyperlink to it.

Luke Girvin
  • 13,221
  • 9
  • 64
  • 84
Alex Stoddard
  • 8,244
  • 4
  • 41
  • 61

4 Answers4

19

The pdf-tools, among other things, allow to annotate pdf files in emacs. Young but promising project!

https://github.com/politza/pdf-tools

user4715701
  • 201
  • 2
  • 2
  • I'd like to know why this answer was downvoted. Is there any drawback to pdf-tools ? – YoungFrog Mar 26 '15 at 11:28
  • 1
    I just installed pdf-tools and gave it a try on linux - worked as advertised. Was able to quickly view a pdf, make an annotation and save it. – Jeffrey DeLeo Mar 28 '15 at 17:47
  • 2
    A couple of years after this answer, I have to say that `pdf-tools` is the best way to go for managing annotations. Emacs can summarize all annotations for you. And if that's not good enough for your liking, check out `interleave-mode` to make notes directly in an org file. – KevinG Oct 06 '17 at 20:14
8

IMO, there's no one optimal workflow for managing publications in emacs. I personally simply store links to PDFs in org mode and have them open in the external viewer (evince or Acrobat, depending on the platform). There are solutions to annotate PDFs by literally writing in the margins of the PDF (in principle, Xournal, Jarnal, and some proprietary Windows software can do it), but I never found any of them very usable. When I take notes on the papers, I either store them as folded items within the org-mode structure, or as links to external files.

Other people have come up with similar workflows -- see for instance, a nice screencast here: http://tincman.wordpress.com/2011/01/04/research-paper-management-with-emacs-org-mode-and-reftex/

For me, an ideal paper-management environment would be org-mode interfaced to Mendeley. Unfortunately, the closed-source nature of Mendeley makes this rather improbable.

Leo Alekseyev
  • 12,893
  • 5
  • 44
  • 44
  • I second Xournal - looks good, and allows you to hand-annotate PDF docs if you're using LINUX on a tablet computer. – Tilo Nov 17 '11 at 04:21
4

DocView mode can toggle between editing and viewing. But from the info pages of doc-view-mode, PDF is not (readily) human editable and the docs don't talk anything about PDF annotating capabilities.

Otherwise, Xournal or such tools should be the way to annotate PDF unless you find a way to get it working under Emacs.

vpit3833
  • 7,817
  • 2
  • 25
  • 25
0

This is not really an answer, but in pdf-tools it's possible to attach handler functions with selected annotations. It's just that someone has to implement it.

;; Toy Example for custom annotations.

(require 'pdf-annot)

(add-hook 'pdf-annot-activate-handler-functions 'pdf-org-annotation-handler)
(add-hook 'pdf-annot-print-annotation-functions 'pdf-org-print-annotation)

(setq pdf-annot-activate-created-annotations t)

(defvar pdf-org-annot-label-guid "www.orgmode.org/annotation"
  "Unique annotation label used for org-annot annotations.")

(defun pdf-org-add-annotation (pos)
  (interactive
   (list (pdf-util-read-image-position "Click ...")))
  (pdf-util-assert-pdf-buffer)
  (pdf-annot-add-text-annotation
   pos
   "Circle"
   `((color . "orange")
     (label . ,pdf-org-annot-label-guid))))

(defun pdf-org-annotation-handler (a)
  (when (equal (pdf-annot-get a 'label)
               pdf-org-annot-label-guid)
    (pop-to-buffer (get-buffer-create
                    (format "%s-annotations.org"
                            (pdf-annot-get-buffer a))))
    ;; Do SOMETHING.
    t))

(defun pdf-org-print-annotation (a)
  (when (equal (pdf-annot-get a 'label)
               pdf-org-annot-label-guid)
    "Org annotation, click to do SOMETHING"))

(provide 'pdf-org)
politza
  • 101
  • 2