bibretrieve icon indicating copy to clipboard operation
bibretrieve copied to clipboard

Added feature: bibretrieve-from-csv

Open blairdrummond opened this issue 6 years ago • 6 comments

If you want to retrieve bibtex entries for several papers at once, this lets you prepare a list of papers in the format of a csv file containing Author and Keywords. bibretrieve-from-csv then takes this csv file and a .bib file, and loops through them.

2018-05-03_16 34 55

bibretrieve-from-csv, when called on the left csv file above, prompts for queries with those authors+keywords, and produces the bibtex file on the right.

blairdrummond avatar May 04 '18 00:05 blairdrummond

It should be easier to override bibretrieve-prompt-and-retrieve by something like (bibretrieve-retrieve author title bibretrieve-installed-backends) instead of duplicating a large portion of code. See https://www.gnu.org/software/emacs/emacs-paper.html#SEC18

pzorin avatar May 06 '18 01:05 pzorin

Ok, did that. Not sure if it's the most elegant though... The issue is that I had to pass parameters down a few levels. Because bibretrieve-write-bib-items-bibliography prompts for the bibfile on each call, I had to pass an option into it that prevented from doing that. It might make sense to decouple "interactive" and "non-interactive" functions so that I don't have to do hackish stuff like that, but I only sort-of understand the code, so I'd be nervous about tearing apart your functions and splitting them into seperate functions.

blairdrummond avatar May 06 '18 20:05 blairdrummond

I actually meant using dynamic binding to change the behavior of bibretrieve-prompt-and-retrieve without modifying the other parts of the code. Also, could you please rebase onto my current master? Thanks in advance. Finally, what is the intended workflow for your extension?

pzorin avatar May 08 '18 21:05 pzorin

I actually meant using dynamic binding to change the behavior of bibretrieve-prompt-and-retrieve without modifying the other parts of the code.

If you provide a bit of direction as to how to do that, I can take a look. But I must admit that I know how to make my elisp work, but I'm no artist with it.

With respect to the intended workflow, the idea is just that instead of running bibretrieve 10 times and inputting the author and title each time, you can write them all down at once, and then run this to process them as a batch. So, for instance, I'm collecting a pile of references for a thesis, and I'm going to be inputting a few dozen references at once. It's easier to just write them all down at once then run bibretrieve on the batch. The workflow is just running M-x bibretrieve-from-csv and then it prompts for a .csv file and a .bib file. It just loops through the former, running bibretrieve on each with the arguments coming from the csv file, and then inserts them into the .bib file.

blairdrummond avatar Jun 18 '18 16:06 blairdrummond

When I write something I know that I will be using biblatex, so I collect the references along the way (and keep them in one big .bib file for all my projects). However I have now found a case when batch processing would be also useful for me: coauthors that don't use bibtex and provide a manually created bibliography. So I agree that it should be possible to pass author/title as (optional) arguments. The only reason why this is not implemented this way seems to be that there is an event loop in which one can also choose to repeat the search with different data. I will think about a different way to implement this. On a different note, it would be nice to have mathscinet and zbmath backends in org-ref or helm-bibtex. I am not familiar with these packages, but they should be able to obviate bibretrieve.

pzorin avatar Jun 18 '18 18:06 pzorin

Today I turned on completion for author names. I think that this is an easier way to avoid repetition.

pzorin avatar Sep 01 '18 09:09 pzorin