Skip to content

Instantly share code, notes, and snippets.

@pmiddend
Created October 1, 2015 18:38
Show Gist options
  • Save pmiddend/b93264cbd7b360c578ca to your computer and use it in GitHub Desktop.
Save pmiddend/b93264cbd7b360c578ca to your computer and use it in GitHub Desktop.
; The workflow is really simple: Open the pdf file with emacs using
; pdf-tools (instructions on that are below). If you see something
; noteworthy, just call M-x org-store-link (I have this set to C-c l),
; then paste it into your "paper-notes.org" file using
; M-x org-insert-link (set to C-c C-l on my machine). The link created
; thusly will contain the pdf file as well as the page number, so when
; you later open your paper-notes.org file and do C-c C-o, the pdf file
; will open at the correct page.
; Installation instructions:
;
; I'm using "use-package" to automatically install and configure emacs
; packages from (m)elpa. If you don't use that, just do
;
; M-x package-install<RET>foo
;
; instead of
;
; (use-package foo)
;
; The code after ":init" you can just paste into your .emacs file.
;
; With that set, you need pdf-tools first. You might need some
; additional packages ("server prerequisites"), see
;
; https://github.com/politza/pdf-tools
;
; You can now open pdf files with emacs and do cool stuff with them
; (like view the pdf outline, create and edit annotations, ...)
(use-package pdf-tools)
; Then, you need org-pdfview to open and create org links from pdfs:
(use-package org-pdfview
:init
(pdf-tools-install)
(delete '("\\.pdf\\'" . default) org-file-apps)
(add-to-list 'org-file-apps '("\\.pdf\\'" . org-pdfview-open))
(add-to-list 'org-file-apps '("\\.pdf::\\([[:digit:]]+\\)\\'" . org-pdfview-open)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment