artelse / org-bib-mode

An Emacs minor mode for literate & annotated bibliography

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Literate & annotated bibliography — Nicolas P. Rougier

./bibliography.png

NOTE This literate and annotated bibliography is an adaptation of the idea Managing my Annotated Bibliography with Emacs’ Org Mode by Gregory J Stein.

Introduction

The core idea behind literate bibliography is to have a single structured file where each entry corresponds to a reference. Information concerning an entry is stored as properties and two subsections allow to enter abstract and notes. To ease the manipulation, org-bib-mode provides a sidebar menu that displays the list of bibliograpic entries and provide tools to ease navigation. Under the hood, the org-bib-mode is the union of two modes:

  • pdf-drop-mode that allow to drag and drop a file in order to add it to the bibliography using its doi that is searched automatically.
  • org-imenu that allow to easily nagivate among entries and allowing various operations such as filtering entries, moving entries, etc.

org-bib mode is meant to be simple and robust (it is simple but not yet robust). If you need somethign more elaborated, have a look at the amazing org-ref mode by John Kitchin.

Installation

org-bib mode depends on pdf-drop-mode and org-imenu that needs to be installed. For example using straight.el:

(straight-use-package
 '(org-imenu :type git :host github :repo "rougier/org-imenu"))

(straight-use-package
 '(pdf-drop-mode :type git :host github :repo "rougier/pdf-drop-mode"))

Configuration

The minimal document structure is a document with a single level headline that is used to store new entries. It is configurable via the org-bib-unsorted-header variable (default is “Unsorted”).

#+LIBRARY-PATH: ~/Documents
#+LIBRARY-FILE: ~/Documents/my-bibliography.bib

* Unsorted

You need to ensure pdf-drop-exiftool-path and pdf-drop-pdftotext-path points to relevant binaries (these are needed to extract information from PDF metadata (exiftool) or PDF content (pdftotext)). Last step is to tell org-bib where to store PDFs. This is done via the #+LIBRARY-PATH keyword that you can set at the top of your org-file. If you don’t, the current directory will be used. PDF will be copied and renamed automatically if you set the corresponding options.

Key bindings

KeyDescriptionKeyDescription
iShow org entryv iSet view mode to org entry
aShow abstractv aSet view mode to abstract
nShow notesv nSet view mode to notes
=Show previewv pSet view mode to preview
bShow bibtexv bSet view mode to bibtex
uShow URLv uSet view mode to URL
pShow PDFv pSet view mode to PDF
v <return>Exit view mode
eExport to bib filefFilter entries
tTag entrymMove entry (refile)
?Mark entry unread!Mark entry read
M-<down>Move entry downM-<up>Move entry up
<tab>Toggle current sectionS-<tab>Toggle all sections
S-<left>Next page (PDF view)S-<right>Prev page (PDF view)

Adding an entry

The simplest way to add a new entry is to drag and drop a PDF file onto the org buffer. The PDF will be parsed to try to identify a DOI and the corresponding bibtex item will be collected from the crossref.org server. The new entry will then be created below the Unsorted header (whose name is configurable) and the file will be renamed and copied to the library folder.

If this procedure fails for some reason, you can also enter a new entry manually or using the org-bib-from-pdf, org-bib-from-doi or org-bib-from-bibtex helper functions. In the latter case, no file will be automatically associated but you can later add a file into the library folder and rename it to “year - title.pdf” (replacing year and title with the actual year and title from the entry).

Edit an entry

An entry is made of a properties block with two sub headlines (Abstract and Notes). You can edit any properties and add or remove them. But be careful to not remove bibliographic properties or else, the conversion to bibtex may fail because of some missing fields that are required.

Export the bibliography

To export the library to a bib file, you can use the org-bib-export command (that is bound to the e key on the sidebar). The export filename will be deduced from the org filename unless a #+LIBRARY-FILE: is defined at the top of the org file.

Filter view

You can filter the sidebar view (f) usin any kind of filtes. Here are some example searches (note the absence of spaces):

  • Articles published in 1984: YEAR=1984
  • Articles published between 2000 & 2010: YEAR>1999+YEAR<2011
  • Journal articles: TYPE={article}
  • Papers by Knuth: AUTHOR={Knuth}
  • Article published in a journal: JOURNAL={The Computer Journal}

See also Advanced searching from the org website.

About

An Emacs minor mode for literate & annotated bibliography

License:GNU General Public License v3.0


Languages

Language:Emacs Lisp 76.8%Language:TeX 23.2%