#latex #bibtex #physics #inspire #inspirehep

bin+lib inspirer

For working with LaTeX, inspirehep.net, and BibTeX/BibLaTeX

4 releases

Uses old Rust 2015

0.1.1 Oct 1, 2017
0.1.0 Oct 1, 2017
0.1.0-beta Sep 27, 2017
0.1.0-alpha Jun 12, 2017

#4 in #bibtex

Apache-2.0

25KB
413 lines

Inspirer

crates.io Docs Badge crates.io

Travis build status AppVeyor build status Gitlab build status

For fetching BibTeX entries from INSPIRE and ADS.

This currently a rust clone of some features from inspiretools, with the added ability to fetch BibTeX entries from ADS.

Installation

snap

inspirer is available as a snap. This may be the easiest way to install inspirer and keep it updated.

Ubuntu 16.10+:

apt install snapd
snap install inspirer

Then you can run the binaries:

inspirer.aux2bib file.aux
inspirer.blg2bib file.blg

For convenience, you may wish to create shorter aliases. For example,

snap alias inspirer.aux2bib aux2bib.

allows one to simply run aux2bib instead of inspirer.aux2bib.

The snap should be updated daily by automatic builds on Launchpad. Enable the edge channel to get the latest, possibly less tested builds:

snap refresh inspirer --edge

From pre-compiled binaries

Binaries will be available to download from the GitHub release page. This would require manual updating.

From source

First, install rust.

To install from crates.io:

cargo install inspirer

To install the latest version from git:

cargo install --git https://github.com/musoke/inspirer
cargo install --git https://gitlab.com/musoke/inspirer

I haven't really tested with Windows, but do have minimal tests on Appveyor which seem to pass sometimes. AppVeyor build status

Usage

To read from file test_bibtex.aux (usually corresponding to a LaTeX file test_bibtex.tex) and write to stdout:

aux2bib test_bibtex.aux

Either of these will append the fetched BibTeX entries to a file:

aux2bib test_bibtex.aux bibliography.bib
aux2bib test_bibtex.aux >> bibliography.bib

This will check what references appear in test_bibtex.tex, check if they look like the style used by INSPIRE or ADS, and if so, fetch the corresponding BibTeX records.

blg2bib works analogously but takes a BibTeX or BibLaTeX log as input. This allows retrieval of only entries which are not currently in the database, which may be significantly faster if you have a lot of references.

blg2bib test_bibtex.blg bibliography.bib

There are some sample input files in example_files. If you have cargo & rustc installed you can test on them like so:

cargo run --bin aux2bib example_files/test_bitex.aux
cargo run --bin blg2bib example_files/test_bitex.blg
cargo run --bin blg2bib example_files/test_biber.blg

Things that are stupid

  • not yet parallelized
  • overly verbose logging
  • 7 MB binaries
  • haven't tried fuzzing

Licence

Apache Licence 2.0

Dependencies

~24MB
~543K SLoC