Recommendations for how to annotate PDFs while working within Emacs?

5.7k views Asked by At

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.

4

There are 4 answers

1
Leo Alekseyev On BEST ANSWER

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.

0
vpit3833 On

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.

3
user4715701 On

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

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

0
politza On

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)