*! version 2.1 12Jul2024
help getirefalso see: lianxh
https://github.com/arlionn/getiref

Title

getiref -- list reference in Results Window, and download PDF, .ris, .bibtex files for given .

Quick examples

. getiref 10.1257/aer.109.4.1197

. getiref 10.1257/aer.109.4.1197, cite

. getiref 10.1257/aer.109.4.1197, pdf bib

. getiref 10.3368/jhr.50.2.317, pdf bib md

Syntax

getiref DOI
[, path(str)
md
md1
md2
md3
latex
wechat
text
cite
cite1
c1
cite2
c2

disfn
all
pdf
blank(string)
notitle
altname(string)
bib

clean
clipoff
notip
nogoogle
doicheck
fastscihub
]

options Description

Searching Fields and Time Range

path(string) the directory to save PDF, .ris, bibtex files

Style of output

md Markdown: Reference. [Link], [PDF], [Google], [Appendix]
md1 Markdown: clean format. Only [Link], [PDF]
md2 Markdown: similar as 'md', but with blanks in links
md3 Markdown: similar as 'md1', but with blanks in links
latex Same as md, but with links in TeX format.
wechat Plain text format: Author, Year, title, URL
text Equivalent to wechat
cite 'Author (Year)', with links
cite1 'Author, Year', with links, in text format
c1 shortcut of cite1
cite2 'Author (Year)', plain text
c2 shortcut of cite2

Control and Save

disfn display filename of PDF document for saving by hand
pdf auto save PDF document, defult name: [Author_Year_Title]
blank(string) Deal with the 'blanks' of filename of PDF document. e.g.,
defult: 'Hansen_2023_Text_in_economics'
blank(keep): 'Hansen 2023 Text in economics'
blank(bar) : 'Hansen-2023-Text-in-economics'
notitle don't include article title in PDF filename: 'Hansen-2023'
altname(string) User specified PDF file name. Seldom use
bib download and list .ris and .bibtex files
used for reference managers (Endnote, Zotero, etc.)
clean Clean pattern: Display only [link] and [PDF], omit [Appendix], [Google]
clipoff don't send message to clipboard
notip don't display 'Tips: Text is on clipboard.'
nogoogle don't display google links
doicheck get using regular expression from text given by user.
e.g, get 'DOI' from 'xxx https://doi.org/DOI, xxx'.
fastscihub find the fast url of SCI-Hub. Seldom use. Time use: 1-2 seconds

Description

getiref make it easy to get meta data of most academic articles using their DOIs.
It gets information like Author name, Publication year, article Title, page range, and even provides links to PDFs, as well as .bibtex/.ris files associated with an anticle.

The citation information can be displayed and exported in various styles,
including Markdown, LaTeX, or Plain text.
This feature enables easy insertion or pasting into
.md, .docx, or .tex documents.
It proves highly practical for efficient literature note-taking,
significantly saving time on downloading, organizing PDF documents, and managing references.

Examples

basic usage

It is simple: a valid DOI is enough

. getiref 10.1257/aer.109.4.1197

:-->

Blanchard, O. (2019). Public Debt and Low Interest Rates. American Economic Review, 109(4), 1197–1229.

Link (rep)
PDF
Google
Appendix

Tips: Text is on clipboard. Press 'Ctrl+V' to paste, ^-^

Download PDF and .ris files

With option pdf, getiref can download PDF documents for most articles.
By default, a new folder named "_temp_getref_" will be created in current working directory and the PDF file will
be saved in this new folder (Note: you can copy, renanme or even delete this folder later). When path() is specified, the PDF files will be saved in user specified directory.

. getiref 10.1257/aer.109.4.1197, pdf bib

:-->

Blanchard, O. (2019). Public Debt and Low Interest Rates. American Economic Review, 109(4), 1197–1229. https://doi.org/10.1257/aer.109.4.1197

PDF: dir view_online Open

Citation: .
Bibtex
RIS

Notes: RIS - EndNote, ProCite, Mendeley

Bibtex - LaTeX, Zotero, Mendeley

Note that if you click 'Bibtex' or 'RIS' in the Results Window, the corresponding .bibtex or .ris file will be opened by your reference manager software, such as Endnote of Zotero.

List meta data in Markdown format

. getiref 10.3368/jhr.50.2.317, md

:-->

Colin Cameron, A., & Miller, D. L. (2015).
A Practitioner's Guide to Cluster-Robust Inference.
Journal of Human Resources, 50(2), 317–372.
[Link](https://doi.org/10.3368/jhr.50.2.317),
[PDF](http://sci-hub.ren/10.3368/jhr.50.2.317),
[Google](<https://scholar.google.com/scholar?q=A Practitioner's Guide to Cluster-Robust Inference>).

If you press shortcut 'Ctrl+V (Windows)' or 'Cmd+V (MacOSX)' in the Markdown editor, it will be rendered (converted) into the linked text as following:

Colin Cameron, A., & Miller, D. L. (2015).
A Practitioner's Guide to Cluster-Robust Inference.
Journal of Human Resources, 50(2), 317–372.
Link,
PDF,
Google

In text citation format:

. getiref 10.1257/aer.109.4.1197, cite

:-->

[Blanchard](https://doi.org/10.1257/aer.109.4.1197)
([2019](http://sci-hub.ren/10.1257/aer.109.4.1197))

It will be shown in Markdown editor as
'Blanchard
(2019)'.

version 2:

. getiref 10.1257/aer.109.4.1197, cite2

Similar as the cite case, but the text does not have a hyperlink.

Appendix: About DOI

What is DOI?

We always see reference in form 'Blanchard, O. (2019). Public Debt and Low Interest Rates. American Economic Review, 109(4), 1197–1229. https://doi.org/10.1257/aer.109.4.1197'.

Here, 10.1257/aer.109.4.1197 is called
DOI (Digital Object Identifier),
a persistent identifier used to uniquely identify this paper,
whereas its location and other metadata may change.

DOIs include a prefix (prefixes always start with 10.)
and a suffix, separated by a forward slash (/).
Prefacing the DOI with doi.org/
will turn it into an actionable link,
for example, https://www.doi.org/10.1257/aer.109.4.1197.
Clicking that link will 'resolve' it, i.e. redirect to the
latest information about the object it identifies,
even if the object changes or moves.

Some typical DOIs are list as follwoing:

o 10.48550/arXiv.2312.05400 (arXiv)

o 10.1177/1536867X231212453 (Stata Journal)

o 10.1162/rest.90.3.592 (RES)

o 10.3386/w31184 (NBER)

See DOI-1, DOI-2 or DOI-Handbook for details.

How to use DOI?

Inspite of prefacing the DOI with doi.org/ to redirect to the article page, we can also get more detailed information of the article using meta data.

There are two main DOI Registration Agencies, Crossref and Datacite.
They provide detail meta data
(crossref,
datacite)
for most paper with DOI. The meta data can be obtained easily using API.
See Searching DOI metadata for details.

Nowadays, there are many Open-access papers.
We can abtain their PDF documents using DOI.
For example, given 10.48550/arXiv.2312.05400, which has the form of 10.48550/arXiv.{ar_ID},
we can get the PDF document of this paper with URL: https://arxiv.org/pdf/.pdf,
i.e., https://arxiv.org/pdf/2312.05400.pdf

Saved results

getiref saves the following in r() in case of the following commands:

. getiref 10.1257/aer.109.4.1197, md pdf bib

. ret list

Scalars

r(got_pdf) 1 = got PDF document, 0 = failed. (Note: option pdf or all required)

r(got_bib) 1 = got .bibtex and .ris files, 0 = failed. (Note: option bib or all required)

r(with_rep) 1 = with replication codes/data, 0 = no.

r(with_app) 1 = with online appendix or supplementary documents, 0 = no.

Macros

Basic

r(doi) 10.1257/aer.109.4.1197 Mark as

r(author1) Blanchard

r(year) 2019

r(title) Public Debt and Low Interest Rates

r(filename) Blanchard_2019_Public_Debt_and_Low_Interest_Rates

r(link) https://doi.org/

r(refbody) Blanchard, O. (2019). Public Debt and Low Interest Rates. American Economic Review, 109(4), 1197–1229.

r(ref) r(refbody) + r(link)

r(pdf_web) http://sci-hub.ren/

Advanced: for programer

r(pdfurl) https://sci.bban.top/pdf/.pdf

r(refdis) r(refbody). Links ([Link], [PDF], [Google], [Appendix])

r(ref_link_pdf) r(refbody) + r(link) + r(pdf_web)

r(ref_link_pdf_full) r(refbody). [Link], r(pdfurl).

r(pdf_br) browse "http://sci-hub.ren/":PDF

r(pdf_br_full) browse "https://sci.bban.top/pdf/.pdf":PDF

r(au_yr_doi) Blanchard-2019-10.1257_aer.109.4.1197

r(ris) http://api.crossref.org/works//transform/application/x-research-info-systems

r(bibtex) http://api.crossref.org/works//transform/application/x-bibtex

You can display specific return value as following:

. `"dis `"`r(refdis)'"'"'

Moreover, if you have a long list of DOIs, say {DOI_i}
a loop on DOI_i can be used to get a reference list.

Authors

Yujun Lian* (连玉君) Lingnan College, Sun Yat-Sen University, China.

E-mail: arlionn@163.com

Blog: lianxh.cn

Questions and Suggestions

If you encounter any issues or have suggestions while using the tool,
we will address them promptly. Please email us at:
arlionn@163.com.

You can also submit your suggestions by filling out
Issues
in the project's GitHub repository.
For Chinese users, please visit the Gitee repository.

Also see

Online:
lianxh (if installed),
songbl (if installed),
cnssc (if installed)