Exporting citations with biblatex
Posted May 19, 2014 at 07:29 AM | categories: org-mode | tags:
Table of Contents
This post illustrates that org-ref works with biblatex. We create a simple document and export it to pdf, and HTML for this post. We also explore how to modify the export behavior of a link. You should look at the org-source at the bottom to see the whole setup; it does not all export to either format.
We need a simple export type with no default packages to avoid the natbib packages I have setup in my default list. Here is the setup. Just run C-c C-c in the block to temporarily add this to your setup.
(add-to-list 'org-latex-classes '("article-biblatex" "\\documentclass{article} [NO-DEFAULT-PACKAGES] [PACKAGES] [EXTRA]" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*a{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
Add some citations andriotis-2014-infor,armiento-2014-high,biskup-2014-insul-ferrom-films,chemelewski-2014-amorp-feooh,chen-2014-inter-effec and then a single citation chen-2014-inter-effec.
and a complicated latex \cite[pre text][post text]{chen-2014-inter-effec}. Note this one will export to LaTeX fine, but not to HTML.
I would like to create a citation link that exports that way. We will do it by using a parseable syntax in the description of a link. We will have to temporarily define a new format function to achieve this. Here it is, just for the autocite command.
(defun org-ref-format-autocite (keyword desc format) (when (eq format 'latex) (concat "\\autocite" (cond ((string-match "::" desc) (format "[%s][%s]" (car (setq results (split-string desc "::"))) (cadr results))) (desc (format "[%s]" desc))) (format "{%s}" keyword))))
This is the syntax:
a citation with post text: [[autocite:armiento-2014-high][post text]] a citation with pre and post text: [[autocite:andriotis-2014-infor][pre text::post text]]
a citation with post text: armiento-2014-high (the post text is not rendered in html).
a citation with pre and post text: andriotis-2014-infor (the pre/post text is not rendered in html).
The links in org-mode are no longer that readable when they are collapsed as descriptive links, but they are not too bad as literal links.
Here is the file and exporting-with-biblatex.pdf . One of those links is for the pdf, and one is for the HTML file.
1 Summary
org-ref seems to work pretty well with biblatex now.
We use a printbibliography link here. This exports to the latex command, or an html bibliography.
Bibliography
- [andriotis-2014-infor] Andriotis, Antonis N. and Mpourmpakis, Giannis and Broderick, Scott and Rajan, Krishna and Datta, Somnath and Sunkara, Mahendra and Menon, Madhu, "Informatics guided discovery of surface structure-chemistry relationships in catalytic nanoparticles", The Journal of Chemical Physics, 140:094705 (2014). link doi
- [armiento-2014-high] Armiento, R. and Kozinsky, B. and Hautier, G. and Fornari, M. and Ceder, G., "High-throughput screening of perovskite alloys for piezoelectric performance and thermodynamic stability", Phys. Rev. B, 89:134103 (2014). link doi
- [biskup-2014-insul-ferrom-films] Bi{\v{s}}kup, Neven and Salafranca, Juan and Mehta, Virat and Oxley, Mark P. and Suzuki, Yuri and Pennycook, Stephen J. and Pantelides, Sokrates T. and Varela, Maria, "Insulating Ferromagnetic \ce{LaCoO_{3-$\delta$}} Films: A Phase Induced by Ordering of Oxygen Vacancies", Phys. Rev. Lett., 112:087202 (2014). link doi
- [chemelewski-2014-amorp-feooh] Chemelewski, William D. and Lee, Heung-Chan and Lin, Jung-Fu and Bard, Allen J. and Mullins, C. Buddie, "Amorphous \ce{FeOOH} Oxygen Evolution Reaction Catalyst for Photoelectrochemical Water Splitting", Journal of the American Chemical Society, 136:2843-2850 (2014). link doi
- [chen-2014-inter-effec] Chen, Guangxu and Zhao, Yun and Fu, Gang and Duchesne, Paul N. and Gu, Lin and Zheng, Yanping and Weng, Xuefei and Chen, Mingshu and Zhang, Peng and Pao, Chih-Wen and Lee, Jyh-Fu and Zheng, Nanfeng, "Interfacial Effects in Iron-Nickel Hydroxide-Platinum Nanoparticles Enhance Catalytic Oxidation", Science, 344:495-499 (2014). link doi
Copyright (C) 2014 by John Kitchin. See the License for information about copying.
Org-mode version = 8.2.6