bibdoiadd(1)

πŸ“¦ version 2026.0, in alpine 3.24

πŸ’– bibdoiadd β€” the manual, but make it cute πŸ’–

okay bestie, welcome to bibdoiadd.pl from LATEX CROSSREFWARE β€” the little script that goes and hunts down DOI numbers for every paper in your BibTeX file so you don't have to do it by hand like a Victorian orphan. it's giving "academic fairy godmother" fr fr ✨


🌸 NAME 🌸

bibdoiadd.pl β€” add DOI numbers to papers in a given bib file πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

bibdoiadd [-c config_file] [-C 1|0] [-e 1|0] [-f] [-o output] bib_file

that's it, that's the whole vibe. one bib file in, one bib file out, DOIs sprinkled on top like edible glitter πŸ’…


✨ OPTIONS ✨

  • -c config_file β€” the configuration file, bestie. if this file isn't there, some defaults get used instead. the format is down below, keep reading πŸ‘‡
  • -C 1|0 β€” whether to canonicalize names in the output (1) or not (0). default is 1, so yes, we're canonizing. slay πŸ’…
  • -e 1|0 β€” if 1 (which is the default), it adds an empty doi when a doi can't be found. why? because it stops you from re-searching the exact same entries over and over when you add new stuff to the file. very "don't do the same task twice" of it. calling -e 0 suppresses this behavior. your call, queen.
  • -f β€” force checking the doi number even if one is already present. no cap, it will re-check. πŸ”₯
  • -o output β€” the output file. if you don't use this option, the output filename gets made by adding _doi to the input file name. cute and automatic πŸŽ€

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the tea: the script reads a BibTeX file. it checks whether the entries have DOIs. if not, it tries to contact http://www.crossref.org to get the corresponding DOI. the result is a BibTeX file with the fields doi=... added. periodt. πŸ’–

the name of the output file is either set by the -o option or is derived by adding the suffix _doi to the output file.

every BibTeX record in the input gets parsed, using BibTeX::Parser, but only the ones that do not have the doi field (or mrnumber or zblnumber for the sibling scripts) are processed. these entries without the requested field are written back, as described in BibTeX::Parser::Entry.

the bib records that are not processed (because they already have the requested field) are written back as-is, without any reformatting. untouched, unbothered, living their truth πŸ™ˆ

now for the slightly messy part, and I'm just relaying what the manpage says, bestie β€” there are (were?) two options for making queries with Crossref: free account and paid membership. in the first case you still must register with Crossref and are limited to a small number of queries, see the agreement at http://www.crossref.org/01company/free_services_agreement.html. in the second case you have a username and password, and can use them for automatic queries. the manpage literally says "I am not sure whether the use of this script is allowed for the free account holders." at any rate, if you want to add DOIs to a large number of entries, you should register as a paid member. πŸ’€ so yeah, big batch = paid membership, no shortcuts.

🧚 CONFIGURATION FILE 🧚

the configuration file relates to the Crossref queries, and it's mostly self-explanatory: it has comments (starting with #) and assginments in the form

$field = value ;

(yes, "assginments" β€” that's the original spelling, I'm keeping it, we don't correct the queen 🫢)

the important parameters are $mode ('free' or 'paid'), $email (for free users) and $username & $password for paid members. 🌈


⭐ EXAMPLES ⭐

bibdoiadd -c bibdoiadd.cfg -o - citations.bib > result.bib
bibdoiadd -c bibdoiadd.cfg -o result.bib citations.bib

first one pipes to stdout (that -o -), second one writes straight to result.bib. iconic behavior, both of them ✨


πŸ’œ AUTHOR πŸ’œ

Boris Veytsman β€” we stan πŸ‘‘


Copyright (C) 2014-2024 Boris Veytsman

This is free software. You may redistribute copies of it under the terms of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law.

read that again, bestie: NO WARRANTY. it's free and it's generous and it's also absolutely not liable if your bib file catches feelings. 😭

and that's the whole page, mwah πŸ’‹ this was bibdoiadd(1) from LATEX CROSSREFWARE, dated 2024-09-02 β€” go forth and DOI-ify your bibliography, you absolute main character πŸ¦‹πŸ’–πŸŽ€

πŸ“¦ where this page comes from