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

Error retriving bibtex from doi #6

Open
jsilve24 opened this issue Jun 9, 2022 · 11 comments · May be fixed by #7
Open

Error retriving bibtex from doi #6

jsilve24 opened this issue Jun 9, 2022 · 11 comments · May be fixed by #7

Comments

@jsilve24
Copy link

jsilve24 commented Jun 9, 2022

First, off, thank you for putting this package together!

My config

(use-package org-bib
  :straight `(org-bib :type git :host github :repo "rougier/org-bib-mode")
  :config
  (setq org-bib-library-paths '("~/Dropbox/org")
	org-bib-default-library "~/Dropbox/org/references.org"
	org-bib-unsorted-header "Unsorted"))

What I run to get the error

(org-bib--get-crossref-info "https://doi.org/10.7554/eLife.21887")

The error:

bibtex-autokey-get-year: Year or date field ‘’ invalid

Any idea how to fix this?

@jsilve24
Copy link
Author

jsilve24 commented Jun 9, 2022

Update, there doesn't seem to be any issue when I add a breakpoint to the function and step through it. If history is any lesson, I am going to guess this stems from a missing require statement.

@jsilve24 jsilve24 linked a pull request Jun 10, 2022 that will close this issue
@rougier
Copy link
Owner

rougier commented Jun 21, 2022

Yes, you need to remove the "https://doi.org/" part when you query a DOI. Note that I've pushed a new branch (org-imenu) that hopefully will make things easier. I intend to merge it soon. If you want to test and give some feedback that would be wonderful.

@jsilve24
Copy link
Author

jsilve24 commented Jun 22, 2022

Just tested the new branch. Not sure if it fixes the issues but I will note that I am now getting the following error on starting emacs.

Error (use-package): org-bib/:catch: Cannot open load file: No such file or directory, org-imenu Disable showing Disable logging

Also, would it be possible to add the unicode symbols on lines 341-343 of org-bib.el as defcustoms. They don't work with my current font (or some other issue) and I would prefer to replace them. I did this in my pull request: https://github.com/rougier/org-bib-mode/pull/7/files

(edit: I added them as defvars but that can be changed)

@rougier
Copy link
Owner

rougier commented Jun 23, 2022

I removed the symbols and instead, you have a simple function to write the header. Currently it is:

(defun org-bib-headline-format (entry)
  (format "%s (%s)" (cdr (assq :title entry))
                    (cdr (assq :year entry))))

But you can rewirte it any way you like.

For the org-imenu, did you install it (https://github.com/rougier/org-imenu/)? You'll also need pdf-drop-mode (https://github.com/rougier/pdf-drop-mode/)

@jsilve24
Copy link
Author

jsilve24 commented Jun 24, 2022 via email

@rougier
Copy link
Owner

rougier commented Jun 24, 2022

You can test the doi with:

(pdf-drop-validate-doi "10.1038/s41576-021-00434-9")
(pdf-drop--bibtex-from-doi "10.1038/s41576-021-00434-9")

Did you drag and drop the pdf ?

@jsilve24
Copy link
Author

(pdf-drop-validate-doi "10.1038/s41576-021-00434-9")

output: t

(pdf-drop--bibtex-from-doi "10.1038/s41576-021-00434-9")

output:

" @article{2021, title={Navigating the pitfalls of applying machine learning in genomics}, volume={23}, ISSN={1471-0064}, url={http://dx.doi.org/10.1038/s41576-021-00434-9}, DOI={10.1038/s41576-021-00434-9}, number={3}, journal={Nature Reviews Genetics}, publisher={Springer Science and Business Media LLC}, author={Whalen, Sean and Schreiber, Jacob and Noble, William S. and Pollard, Katherine S.}, year={2021}, month={Nov}, pages={169–181} }\n"

no I did not drag and drop the pdf, I just called org-bib-new-from-doi and then inserted

10.1038/s41576-021-00434-9

at the minibuffer prompt

@jsilve24
Copy link
Author

Ahhh... just realized, it does work if I have org-bib-mode active but it doesn't work when bound to a global key binding...

@rougier
Copy link
Owner

rougier commented Jul 11, 2022

Sorry for delay in my answer. org-bib-mode is kind of mandatory yes. Does that mean you would like to have an option to get the bibtex from a DOI from anywhere?

@jsilve24
Copy link
Author

Yes (sorry for delay)

@rougier
Copy link
Owner

rougier commented Sep 21, 2022

sorry for delay again, this will be a long thread. Now i'm a bit lost with the issue. Last point was to implement a bibtex-from-doi, right?

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

Successfully merging a pull request may close this issue.

2 participants