Generating your bibliography in another file

| categories: bibtex | tags:

It has been proposal season. This particular round of proposals had a requirement to print the references in a separate file from the proposal. Usually I just build a pdf from org-mode, and then manually separate the references. That is not very fun if you have to do it several times. Here we examine a way to avoid this issue by using a new nobibliography link from org-ref with the bibentry LaTeX package.

We wrote this paper mehta-2014-ident-poten and this one xu-2014-relat.

Bibliography

Here is the resulting pdf, with no references: separate-bib.pdf.

1 Getting the references in another file

Now, we need to get the reference file. We create a new file, in org-mode, mostly for the convenience of exporting that to a pdf. Here is the code that does that.

(let* ((base (file-name-sans-extension
              (file-name-nondirectory (buffer-file-name))))
       (bbl (concat base ".bbl"))
       (orgfile (concat base "-references.org"))
       (pdffile (concat base "-references.pdf")))
  (with-temp-file orgfile
    (insert
     (format "#+LATEX_CLASS: cmu-article
#+OPTIONS: toc:nil

#+BEGIN_LaTeX
\\input{%s}
#+END_LaTeX
" bbl)))

  (find-file orgfile)
  (org-latex-export-to-pdf)
  (org-open-file pdffile))

And, here is the reference file: separate-bib.pdf

I think this would be integrated into a noexport build section of a document that would generate the pdf and references.

Copyright (C) 2014 by John Kitchin. See the License for information about copying.

org-mode source

Org-mode version = 8.2.7c

Discuss on Twitter