A Ruby utility to list all the citation keys in a BibTeX file
Clone or download
Latest commit 9eb10ab Feb 15, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin Display version number option Apr 11, 2013
lib Bump version number and release date Apr 11, 2013
.gitignore Use bunder tasks Apr 11, 2013
Gemfile Updated requirements Apr 11, 2013
Manifest Update gemspec Apr 11, 2013
README.md No longer supported Feb 15, 2017
Rakefile Use bunder tasks Apr 11, 2013
bibkeys.gemspec Bump version number and release date Apr 11, 2013
license.txt initial (working!) commit Nov 2, 2012

README.md

This software is no longer supported.

Bibkeys

A Ruby utility to list all the citation keys in a BibTeX file

Lincoln A. Mullen | lincoln@lincolnmullen.com | http://lincolnmullen.com

Installation

You can install bibkeys from RubyGems:

gem install bibkeys

If you don't have it installed already, you'll need to install bibtex-ruby, which does most of the heavy lifting. Using gem to install bibkeys should install that dependency for you.

Usage

To list all the keys in a BibTeX file:

bibkeys bibliography.bib

To sort the list of keys:

bibkeys -s bibliography.bib

To list all the keys in multiple files:

bibkeys bib1.bib bib2.bib etc.bib

This program functions as *nix-style utility. Accordingly, it can read from stdin:

cat bibliography.bib | bibkeys -

To save the keys to a file:

bibkeys bibliography.bib > keys.txt

Using Bibkeys with Vim

Bibkeys may be useful to you if you use BibTeX citation keys in your writing. I generate a file with citation keys automatically whenever I edit my BibTeX database. In my .vimrc, I've added the following lines:

set dictionary=$HOME/bib/citekeys.txt
set complete+=k

When writing a citation in a LaTeX or Pandoc document, typing the beginning of a citation and pressing Ctrl-X Ctrl-K or Ctrl-X Ctrl-N autocompletes the citation. (N.B. This only works if your citation keys do not contain characters like : or -. If you keys do have those characters, you'll need to user-completion or omni-completion, both of which are a pain.)