aboutsummaryrefslogtreecommitdiffstats
path: root/man/bib-fetch.1
blob: 0d41f78cfa5c73b472b0efaac892772721e1ee1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
.TH BIB-FETCH 1 "June 2026" "bibutils" "User Commands"
.SH NAME
bib-fetch \- fetch a bibtex entry for a pdf by DOI or arXiv id
.SH SYNOPSIS
.B bib-fetch
.RB [ \-d
.I doi
|
.B \-a
.IR arxiv-id ]
.RI [ file.pdf ]
.SH DESCRIPTION
.B bib-fetch
emits a bibtex entry, in canonical form and with a generated citation
key, for the document identified by a DOI or an arXiv id.
.PP
Unless an identifier is supplied with
.B \-d
or
.BR \-a ,
the first two pages of
.I file.pdf
are searched (using
.BR pdftotext (1))
for a DOI and, failing that, for an arXiv stamp of the form
.BR arXiv:2104.01234v2 .
Both modern and old-style
.RB ( cs/0101001 )
arXiv ids are recognized.
.PP
DOIs are resolved through doi.org content negotiation (crossref and
friends); arXiv ids through arxiv.org.
Note that arXiv reports the year of the latest revision of a preprint,
not of its first submission.
.SH OPTIONS
.TP
.BI \-d " doi"
Fetch by DOI; no pdf is read.
.TP
.BI \-a " arxiv-id"
Fetch by arXiv id; no pdf is read.
A leading
.B arXiv:
prefix is accepted and stripped.
.SH EXIT STATUS
0 on success, 1 if no identifier could be found or the fetch failed,
2 on usage error.
.SH DEPENDENCIES
.BR curl (1)
always;
.BR pdftotext (1)
(poppler) for identifier extraction from pdfs.
.SH EXAMPLES
.nf
bib-fetch paper.pdf | bib-add refs.bib
bib-fetch -a 1706.03762
.fi
.SH SEE ALSO
.BR bib-add (1),
.BR bib-key (1),
.BR bib-util (1)