Pullbib
provides commands to pull your Zotero library to any file,
i.e. a .bib
file, updating its content. Basically, it means you can
trigger an export of your Zotero libraries to your bibliograpy files
from within Emacs.
For these commands to work, you have to install the BetterBibtex extension in Zotero.
You will currently have to clone this package with quelpa
or straight
.
Here’s an example:
(use-package pullbib
:quelpa (pullbib
:fetcher github
:repo "publicimageltd/pullbib")
:config
;; Obligatory for pullbib to work, see below:
(setq pullbib-url-map <some-value>))
As you see in the example, for pullbib
to work, you must set up a list
which maps library URLs to associated bibliography files. Here’s a
real world example:
(setq pullbib-url-map
'(("http://127.0.0.1:23119/better-bibtex/export/library?/1/library.biblatex" . "~/my-bibfile.bib")))
It makes sense to export to a bibliography file which is also used by
other Emacs packages, e.g. bibtex-completion
.
To find the correct URL, open Zotero (with BetterBibTex installed) and right-click on the library you want to export. See also https://retorque.re/zotero-better-bibtex/exporting/pull/.
Just call pullbib-pull
, interactively or non-interactively (e.g. in a
hook). It will pull all libraries defined in pullbib-url-map
.
If pullbib-url-map
contains multiple entries, interactive calls of
pullbib-pull
prompts the user to select the target file. The idea is
that you usually don’t want to update all files at once.
If called non-interactively, however, pullbib-pull
does pull all
files. The idea is that if used in a hook, you don’t want to be
disturbed by being prompted to select the target.
- Add interactive selection of export target
- Expand filename before passing it to curl
- Initial commit.