Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rougier/pdf-drop-mode

Get DOI from PDF files dropped onto a Emacs buffer
https://github.com/rougier/pdf-drop-mode

Last synced: about 1 month ago
JSON representation

Get DOI from PDF files dropped onto a Emacs buffer

Awesome Lists containing this project

README

        

* Documentation

~pdf-drop-mode~ is a convenient mode that search for the [[https://en.wikipedia.org/wiki/Digital_object_identifier][DOI]] of any file that is
dropped onto a buffer. To do that, the mode searches the DOI using several
different methods (whose order can be specified):

1. Look at the file metadata to check if a DOI is attached using exiftool
(whose path can be specified).

2. Search the content of the file to try to locate a DOI regex on the first
page (PDF is transformed into text using the pdftotext utility).

3. Search again the metadata to try to find the title and query the crossref
database to get a corresponding DOI.

4. Ask the user to enter the title of the file and query the crossref database
to try to get a correspondong DOI.

If all methods failed, then the search has failed. When search finishes, a user-defined function is called with the filename and
the DOI as arguments.

** Installation

#+begin_src emacs-lisp

(straight-use-package
'(pdf-drop-mode :type git :host github :repo "rougier/pdf-drop-mode"))

#+end_src

* Usage

#+begin_src emacs-lisp
(require 'pdf-drop-mode)

(defun my/pdf-process (file doi)
(message "%s : %s" file doi))

(setq pdf-drop-search-hook #'my/pdf-process)
(pdf-drop-mode)

#+end_src

You can then drag and drop a PDF onto the buffer and the DOI should be displayed.