bibcom

A simple tool for generate missing BibTeX entries.

https://github.com/sebhoof/bibcom

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org, zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.3%) to scientific vocabulary

Keywords

automation bibliography bibtex latex publishing referencing science
Last synced: 6 months ago · JSON representation ·

Repository

A simple tool for generate missing BibTeX entries.

Basic Info
  • Host: GitHub
  • Owner: sebhoof
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 87.9 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 2
Topics
automation bibliography bibtex latex publishing referencing science
Created almost 4 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

BibCom – a BibTeX bibliography creator

DOI Licence: MIT Code style: black

BibCom simplifies the creation of a BibTeX bibliography for scientific papers, specifically in physics. The tool automatically generates BibTeX entries from ADS or INSPIRE for missing citations in LaTeX documents. The new BibTeX entries are copied to the clipboard (useful for online tools such as Overleaf) or appended to a local BibTeX file.

Introduction

Creating a BibTeX bibliography is necessary but tedious. Databases such as NASA/ADS or HEP INSPIRE provide an immense help, but adding new entries a few at a time is still time-consuming. The same is true for adjusting the bib file accordingly to match the preferred citation key style.

Enter BibCom! This tool automatically generates bib entries for missing citations from the “missing citation” entries from the .log file. New bib entries will be copied to the clipboard or appended to a local bib file. The only requirement is that the citation keys correspond to any combination of the following persistent identifiers:

  • an arXiv preprint number (with or without arXiv: in front)
  • a DOI (with or without doi: in front)
  • a HEP INSPIRE key
  • a NASA/ADS key

The recommended database for queries is ADS, but INSPIRE can be used as a fallback option. To query ADS, you need to create a free account and generate an API token, as explained below.

Installation

Clone the repository and ensure that the following Python packages are installed: numpy, pyperclip, and requests. If in doubt, run python -m pip install numpy pyperclip requests

Recommended additional steps

Create an ADS account here. You can then generate the API token under Account -> Settings -> API Token. Paste it into a plain text such as my.token in your local BibCom folder. As an added benefit, you may be intersted in creating custom email alerts for new arXiv preprints with ADS.

How to use BibCom

Compiling your LaTeX paper [main].tex creates a log file named [main].log in the in the same folder. If you are using Overleaf, it can be downloaded after clicking on the “Logs and output files”, scrolling down and clicking on “Other logs and files”.

Then simpliy update your bibliography as needed with Bibcom until you are ready to submit. At that point, you may want to check your bibliography for duplicates (see Complete overview).

Quickstart

To query the INSPIRE database, simply run python compile_bib.py [main].log and paste the results into your bib file (using Ctrl+V, Cmd+V, or right click -> paste). If you provide your ADS API in a file my.token or via the environment variable ADS_API_TOKEN, the ADS database will be queried instead.

Complete overview

The full range of options for compile_bib.py also allows for adding the name of a bib file /some/folder/to/my.bib and/or the name of a file my.token containing your ADS API: python compile_bib.py [main].log my.token /some/folder/to/my.bib In this case, the new bib entires will be additionally appended to the file. If the file /some/folder/to/my.bib does not exist, it will be created. When providing a bib file name, BibCom will automatically check for duplicates.

Note that the order of the arguments and the names of the files do not matter as long as the files end in .log, .bib, and .token. For example, any of the below will work: python compile_bib.py my.token [main].log python compile_bib.py [main].log my.token python compile_bib.py /some/folder/to/my.bib [main].log my.token

ADS BibTeX entries use LaTeX macros for some journal names, as described here. This contains the file jdefs.tex, which you can download and include in your LaTeX preamble via \include{jdefs} to replace the macros. Alternatively, you can supply jdefs.tex — or any other .tex file in the same format — as an argument. BibCom will then replace all macros in the bibliography accordingly: python compile_bib.py [main].log jdefs.tex

To check an exiting bib file /some/folder/to/my.bib for duplicates, run python check_bib.py /some/folder/to/my.bib The check is based on arXiv/eprint IDs and DOIs. The code will print the names of any duplicates that the user needs to fix.

Owner

  • Name: Sebastian Hoof
  • Login: sebhoof
  • Kind: user
  • Location: Padua, Italy
  • Company: Università degli Studi di Padova

Citation (CITATION.cff)

cff-version: 1.2.0
message: If you use this software, please cite it using the DOI provided.
title: BibCom -- a BibTeX bibliography creator
abstract: BibCom provides easy-to-use Python scripts for generating and checking bibliographies in the physical (and possibly other) sciences. It can submit requests to the popular NASA/ADS and INSPIRE databases using ADS, arXiv, DOI or INSIPIRE identifiers.
authors:
  - family-names: Hoof
    given-names: Sebastian
    orcid: "https://orcid.org/0000-0002-3517-2561"
version: 0.5
date-released: "2023-08-17"
identifiers:
  - description: This is a reference to the collection of archived snapshots of BibCom
    type: doi
    value: "10.5281/zenodo.6579665"
license: MIT
repository-code: "https://github.com/sebhoof/bibcom"

GitHub Events

Total
Last Year