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

Feature request: Integration with Zotra #799

Open
mpedramfar opened this issue Aug 18, 2023 · 3 comments
Open

Feature request: Integration with Zotra #799

mpedramfar opened this issue Aug 18, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@mpedramfar
Copy link
Contributor

I've written a package, Zotra, that adds the missing functionality of Zotero to Emacs by allowing the user to get bibliography entries and attachments from a url or a search identifier (DOI, ISBN, PMID, arXiv ID).

I don't personally use citar, but I thought this might be something you'd find interesting.

In the README file, I've described one possible way to seamlessly integrate bibtex-completion with it so that if zotra is installed, it will offer the option to use it when calling bibtex-completion-add-pdf-to-library and if it's not installed, it will behave as before. (Note that the last 4 lines in the function I've written there is for a separate extra functionality, i.e. to add the path to the newly added file to the bibtex-completion-pdf-field field in the bibtex entry) A similar approach could probably be used here.

@mpedramfar mpedramfar added the enhancement New feature or request label Aug 18, 2023
@bdarcus
Copy link
Contributor

bdarcus commented Aug 18, 2023

Thanks for the note.

So let me see if IUC:

The idea here is zotra can be used to add either:

  1. an entry, with metadata populated from the zotero translators
  2. a link to a PDF attachment to an already-existing entry; you're example is this

Is that correct?

On 2, we do have a broader command called citar-add-library-files. I'll need to think about this one a bit more. It might be that adding a hook here would be useful, but am not sure.

I think 1 is pretty much the same as using biblio with the embark-become example, so could just add another example to the wiki (and so, no particular integration code needed):

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

@mpedramfar
Copy link
Contributor Author

For 1, we have two functions. One is zotra-add-entry-from-search which might be similar to biblio since it populates a bibliographic entry (bibtex/biblatex/CSL json/CSV/etc) using a search identifier (DOI, ISBN, PMID, arXiv ID).

The other is zotra-add-entry-from-url which needs a url to a journal/repo/youtube video/whatever and populates the bibliography entry. I've described in the README how to use org-protocol to get a bookmarklet in the browser that acts similar to Zotero-connector so that you can visit a website in your browser, click on the bookmarklet and an entry will be added to your bibliography file.

I agree that, for this case, probably no particular integration code is needed.

For 2, that's mostly correct. The zotra-get-attachment function can get attachment urls (if there is more that one attachment, it'll either ask the user to choose a single one or return the list of all of them) from either search identifier or the url. The version of bibtex-completion-add-pdf-to-library that I've written in the README is using the url field of the bibtex entry and falls back to asking the user for a url when the bibtex entry doesn't have such a field.

There are also zotra-download-attachment (-from-search/-from-url) functions, but it might be easier to integrate if you use zotra-get-attachment instead

@bdarcus
Copy link
Contributor

bdarcus commented Aug 24, 2023

I can't predict when or if I'll have time to get this, given other priorities. But PR and/or wiki contribution would certainly be welcome.

FWIW, citar is designed to be pretty flexible in terms of integration with other packages, so much so that it's often better to spin off functionality like this into independent small packages.

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

No branches or pull requests

2 participants