Skip to content

Instantly share code, notes, and snippets.

@jkitchin
Last active May 5, 2020 19:14
Show Gist options
  • Save jkitchin/4e96bca71ba1dd2dc5e82290063182c4 to your computer and use it in GitHub Desktop.
Save jkitchin/4e96bca71ba1dd2dc5e82290063182c4 to your computer and use it in GitHub Desktop.
Melpa setup for org-ref
(setq user-emacs-directory "./sandbox")
(require 'package)
(setq package-archives
'(("org" . "http://orgmode.org/elpa/")
("gnu" . "http://elpa.gnu.org/packages/")
("melpa" . "http://melpa.org/packages/")))
(package-initialize)
(package-refresh-contents)
(package-install 'org-ref)
(setq org-ref-bibliography-notes "./notes.org"
org-ref-default-bibliography '("./references.bib")
org-ref-pdf-directory "./bibtex-pdfs/")
(unless (file-exists-p org-ref-pdf-directory)
(make-directory org-ref-pdf-directory t))
(setq org-src-fontify-natively t
org-confirm-babel-evaluate nil
org-src-preserve-indentation t)
(org-babel-do-load-languages
'org-babel-load-languages '((python . t)))
(setq org-latex-pdf-process
'("pdflatex -interaction nonstopmode -output-directory %o %f"
"bibtex %b"
"pdflatex -interaction nonstopmode -output-directory %o %f"
"pdflatex -interaction nonstopmode -output-directory %o %f"))
(require 'org-ref)
(require 'org-ref-pdf)
(require 'org-ref-url-utils)
(require 'org-ref-latex)
(find-file "test-1.org")
(message "done")
EMACS ?= emacs
CASK ?= cask
CASK_EXEC ?= ${CASK} exec
all: clean test
test:
${EMACS} -Q -batch -l init.el
clean:
rm -fr sandbox
run:
${EMACS} -Q -l init.el test-1.org
new:
rm -fr sandbox
${EMACS} -Q -l init.el test-1.org
revtex:
${EMACS} -Q --eval="(setq jmax-load-user-dir nil)" --eval="(setq org-ref-completion-library 'org-ref-helm-reftex)" -l init.el test-1.org
helm-bibtex:
${EMACS} -Q --eval="(setq jmax-load-user-dir nil)" --eval="(setq org-ref-completion-library 'org-ref-helm-bibtex)" -l init.el test-1.org
helm-cite:
${EMACS} -Q --eval="(setq jmax-load-user-dir nil)" --eval="(setq org-ref-completion-library 'org-ref-helm-cite)" -l init.el test-1.org
ivy:
${EMACS} -Q --eval="(setq jmax-load-user-dir nil)" --eval="(setq org-ref-completion-library 'org-ref-ivy-bibtex)" -l init.el test-1.org
.PHONY: all test
@article{kitchin-2015-examp,
author = {Kitchin, John R.},
title = {Examples of Effective Data Sharing in Scientific Publishing},
journal = {ACS Catalysis},
volume = {5},
number = {6},
pages = {3894-3899},
year = 2015,
doi = {10.1021/acscatal.5b00538},
url = { http://dx.doi.org/10.1021/acscatal.5b00538 },
keywords = {DESC0004031, early-career, orgmode, Data sharing },
eprint = { http://dx.doi.org/10.1021/acscatal.5b00538 },
}
@article{jiang-2016-catal-funct,
author = {Qingqing Jiang and Zhenpan Chen and Jinhui Tong and
Min Yang and Zongxuan Jiang and Can Li},
title = {Catalytic Function of Iroxin the Two-Step
Thermochemical Co2-splitting Reaction At High
Temperatures},
journal = {ACS Catal.},
volume = {nil},
number = {nil},
pages = {1172-1180},
year = 2016,
doi = {10.1021/acscatal.5b01774},
url = {http://dx.doi.org/10.1021/acscatal.5b01774},
date_added = {Thu Jan 21 06:51:22 2016},
}
@article{vicario-2016,
author = {Michela Del Vicario and Alessandro Bessi and Fabiana
Zollo and Fabio Petroni and Antonio Scala and Guido
Caldarelli and H. Eugene Stanley and Walter
Quattrociocchi},
title = {The Spreading of Misinformation Online},
journal = {Proceedings of the National Academy of Sciences},
volume = {nil},
number = {nil},
pages = 201517441,
year = 2016,
doi = {10.1073/pnas.1517441113},
url = {http://dx.doi.org/10.1073/pnas.1517441113},
date_added = {Thu Jan 21 06:53:25 2016},
}
@periodical{some-proceeding,
author = {Kitchin, John R.},
title = {a periodical},
journal = {ACS Spring meeting},
year = 2015,
}
@conference{some-conference,
author = {Kitchin, John R.},
title = {a conference proceeding},
journal = {ACS Spring meeting},
year = 2015,}
@article{bechhofer13_why_linked_data_is_not_enoug_scien,
author = {Sean Bechhofer and Iain Buchan and David De Roure
and Paolo Missier and John Ainsworth and Jiten
Bhagat and Philip Couch and Don Cruickshank and Mark
Delderfield and Ian Dunlop and Matthew Gamble and
Danius Michaelides and Stuart Owen and David Newman
and Shoaib Sufi and Carole Goble},
title = {Why Linked Data Is Not Enough for Scientists},
journal = {Future Generation Computer Systems},
volume = 29,
number = 2,
pages = {599-611},
year = 2013,
doi = {10.1016/j.future.2011.08.004},
url = {http://dx.doi.org/10.1016/j.future.2011.08.004},
date_added = {Wed Mar 9 06:54:27 2016},
}
@article{xu15_tunin_oxide_activ_throug_modif,
author = {Zhongnan Xu and John R. Kitchin},
title = {Tuning Oxide Activity Through Modification of the
Crystal and Electronic Structure: From Strain To
Potential Polymorphs},
journal = {Phys. Chem. Chem. Phys.},
volume = 17,
number = 43,
pages = {28943-28949},
year = 2015,
doi = {10.1039/c5cp04840k},
url = {http://dx.doi.org/10.1039/c5cp04840k},
date_added = {Wed Mar 9 12:49:20 2016},
}
@article{xu15_relat_between_surfac_elect_chemic,
author = {Zhongnan Xu and John R. Kitchin},
title = {Relationships Between the Surface Electronic and
Chemical Properties of Doped 4d and 5d Late
Transition Metal Dioxides},
journal = {The Journal of Chemical Physics},
volume = 142,
number = 10,
pages = 104703,
year = 2015,
doi = {10.1063/1.4914093},
url = {http://dx.doi.org/10.1063/1.4914093},
date_added = {Wed Mar 9 21:42:32 2016},
}

cite:some-proceeding cite:some-conference

10.1021/acscatal.5b01774

10.1073/pnas.1517441113

(setq bibtex-completion-bibliography ‘(“test-1.bib”))

ebib:xu15_relat_between_surfac_elect_chemic, ebib:xu15_tunin_oxide_activ_throug_modif, ebib:bechhofer13_why_linked_data_is_not_enoug_scien

Links that should work

cite:kitchin-2015-examp

multiple cites: cite:xu-2015-relat,kitchin-2015-examp,xu-2015-tunin-oxide

Acronym entries: LVM and another one LVM

gls:son acrshort:lvm LVM

A computer is good for computing. Gls:computer is capitalized. We can also use a bunch of glspl:computer to make a cluster. Glspl:computer a re the wave of the future. They do not use up any glspl:tree.

(or-next-glossary-link nil)

tree fjdsa;fdsa

Labels and refs: label:one

label:two ref:two

Multiply defined label:one

ref:bad-label

\printglossaries

bibliographystyle:unsrt bibliography:test-1.bib

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment