Skip to content
thofmaPublic

About

Find BibTeX entries for mathematical literature from your terminal

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

bibi

bibi

bibi is a command-line tool for:

Table of Contents

Install

Install with Homebrew on macOS or Linux:

brew install thofma/tap/bibi

Prebuilt archives for macOS, Linux, and Windows are available from GitHub Releases.

Alternatively, install the latest tagged version with Go:

go install github.com/thofma/bibi@latest

Make sure your Go binary directory ($(go env GOPATH)/bin by default) is on your PATH so the bibi command is available.

Quick Start

Terminal demo of bibi search for serre local fields, selecting a result, and retrieving BibTeX

bibi search "serre local fields"

Choose a result when prompted. bibi prints its BibTeX entry in the terminal. To save it to a file, run bibi search "serre local fields" > entry.bib.

If you already have a DOI or arXiv link, retrieve it directly:

bibi get https://doi.org/10.1016/j.jnt.2016.05.016
bibi get https://arxiv.org/pdf/math/0303109

To save an entry directly into your bibliography:

bibi add "serre local fields" references.bib --bib mr

Usage

Use bibi --help to list commands and bibi <command> --help for command options and examples.

Get by identifier or URL

bibi get 2301.12345
bibi get arXiv:2301.12345v2
bibi get math/0303109
bibi get 10.1016/j.jnt.2016.05.016

get accepts DOI and arXiv identifiers or links. Use search when you have an author or title instead.

Retrieve several references at once, or read one identifier or link per line from a file:

bibi get math/0211159 10.1016/j.jnt.2016.05.016
bibi get < identifiers.txt > references.bib
# On macOS, copy a list of identifiers or links first:
pbpaste | bibi get > references.bib

arXiv inputs return a preprint entry by default. To retrieve the published article, use --published (requires a publication DOI listed by arXiv):

bibi get 1701.00340 --published

To request BibTeX from a particular service, use --bib zb, --bib mr, or --bib crossref:

bibi get 10.1016/j.jnt.2016.05.016 --bib mr

When using another service, you may be asked to confirm a match or a change from preprint to published article.

Search

bibi search "serre local fields 1979"
bibi search "serre local fields" --bib mr
bibi search "serre local fields" --discovery crossref --bib mr

Combine authors, titles, and years in your query, or search by DOI. By default, search uses zbMATH Open. You can choose where to search and where to retrieve BibTeX separately:

Option Purpose Choices Default
--discovery Search service zb, crossref zb
--bib BibTeX service zb, mr, crossref zb

You may be asked to confirm the entry if the match is uncertain or its edition differs. Review the displayed details before accepting.

Coverage varies by service; bibi reports an error if your chosen BibTeX service cannot supply the entry. Crossref BibTeX requires a DOI.

Add to a bibliography

bibi add "serre local fields" references.bib --bib mr
bibi add "10.1016/j.jnt.2016.05.016" references.bib --key Hofmann2016
bibi add "local fields" references.bib --dry-run

add takes a query and a destination file. Quote multiword queries. It uses the same search and BibTeX options as search, appends the entry, and reports its citation key. A missing file is created; existing entries and formatting are preserved.

Duplicates with matching DOIs or database identifiers are skipped. Use --key to choose your own citation key or resolve a key collision. Use --dry-run to preview the entry without changing the file. Cancelling or a failed lookup leaves the file unchanged.

Journal abbreviations

bibi abbr inventiones mathematicae
# Invent. Math.

bibi abbr theory number journal
bibi abbr "ann. math."

abbr works offline. Search by words or word beginnings from the journal title or abbreviation, in any order. Case, accents, and punctuation do not matter. A unique match prints immediately; multiple matches open a picker.

Other lookup commands

Search zbMATH Open directly:

bibi zb "zhang p-adic"

Search the free MR Lookup service by author, with an optional title and year:

bibi mr serre "a course in arithmetic" 1973

MR Lookup has more limited coverage than the full MathSciNet database. Use - to skip the title when searching by author and year: bibi mr serre - 1973.

Find a mathematician's thesis through the Mathematics Genealogy Project:

bibi phd "carl gauss"

BibTeX output

BibTeX exports preserve the journal names supplied by the provider.

Warnings about incomplete entries do not prevent exporting or saving the BibTeX.

Troubleshooting

BibTeX lookups require internet access. Temporary network failures are retried automatically; press Ctrl-C to cancel.

Some zbMATH records cannot be exported because of license restrictions. If the record has a DOI, try Crossref:

bibi search 10.2307/2306804 --discovery crossref --bib crossref

For more information about a lookup failure, add --debug, for example bibi search "local fields" --bib mr --debug. Debug messages do not appear in redirected BibTeX output. Set NO_COLOR=1 to disable colours.

Development

To build from a checkout, use the Go version declared in go.mod or newer:

go build -o bibi .

Run the local build with ./bibi. Check changes with:

go test ./...
go vet ./...
go build ./...
gofmt -l .

With BibTeX and pdfLaTeX installed, an optional rendering check verifies the generated output with the standard plain bibliography style:

BIBI_TEST_TEX=1 go test ./cmd -run TestBibTeXRendering

See the bundled journal data notes for catalog refresh instructions.

About

Find BibTeX entries for mathematical literature from your terminal

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages