Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

importing bib from doi and cross-ref, including pdf #758

Open
trembel opened this issue Mar 22, 2023 · 3 comments
Open

importing bib from doi and cross-ref, including pdf #758

trembel opened this issue Mar 22, 2023 · 3 comments
Labels

Comments

@trembel
Copy link

trembel commented Mar 22, 2023

As I'm using emacs for my bibliography management, so far I have to rely on org-ref for some features. org-ref has a very nice import functionality for bib entries (https://github.com/jkitchin/org-ref/blob/master/doi-utils.el). Using doi-utils-add-entry-from-crossref-query and doi-utils-add-bibtex-entry-from-doi one can easily search for papers on a lot of platforms. It automatically fills the bib informations into a configured bibtex file, and does download the pdf if possible.

I think porting this to citar wouldn't be a too big thing, as especially doi-utils.el is pretty standalone. If I find time, I will dig into this.

@trembel trembel added the enhancement New feature or request label Mar 22, 2023
@bdarcus
Copy link
Contributor

bdarcus commented Mar 22, 2023

I'm generally of the view that org-ref is like five packages in one. That's a perfect example of a piece of functionality that should be an independent package. While it could be easily installed as the single file with straight or elpaca, it has no independent melpa recipe.

Beyond that, a couple of things:

First, I'm a little unclear on the UI, and how much really needs to be tied to org-ref or to citar.

Can you clarify that, maybe with a screenshot or two to demonstrate?

Also, see:

https://github.com/emacs-citar/citar/wiki/Embark#embark-become

image

See the search string that yields no results there? If I choose an option, it pipes that string to the relevant function, and it opens.

How does that biblio-based solution compare?

Finally, see this new package (and his comparison list):

https://github.com/rougier/persid

I haven't tried it, but seemed promising. Notably, it offers no query capability.

@bdarcus
Copy link
Contributor

bdarcus commented Aug 24, 2023

@trembel just bumping this, as I realize this issue is waiting on your input ;-)

@pprevos
Copy link

pprevos commented Aug 31, 2024

The biblio package has functionality to extract BibTeX entries from databases. I wrote a function for EWS that integrates it with Citar. This is a more generalised version:

(defun ews--bibtex-combined-biblio-lookup ()
  "Combines `biblio-lookup' and `biblio-doi-insert-bibtex'."
  (require 'biblio)
  (let* ((dbs (biblio--named-backends))
         (db-list (append dbs '(("DOI" . biblio-doi-backend))))
         (db-selected (biblio-completing-read-alist
                       "Backend:"
                       db-list)))
    (if (eq db-selected 'biblio-doi-backend)
        (let ((doi (read-string "DOI: ")))
          (biblio-doi-insert-bibtex doi))
      (biblio-lookup db-selected))))

(defun ews-bibtex-biblio-lookup ()
  "Insert Biblio search results into curent buffer or select BibTeX file."
  (interactive)
  (if-let ((current-mode major-mode)
	   citar-bibliography
	   (bibfiles (length citar-bibliography))
	   (bibfile (cond ((eq bibfiles 1) (car ews-bibtex-files))
			  ((equal major-mode 'bibtex-mode)
			   (buffer-file-name))
			  (t (completing-read
			      "Select BibTeX file:" citar-bibliography)))))
      (progn (find-file bibfile)
	     (goto-char (point-max))
	     (ews--bibtex-combined-biblio-lookup)
	     (save-buffer))
    (message "No BibTeX file(s) defined.")))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants