"Alan E. Davis" <lngn...@gmail.com> writes: > Is it possible to use org babel to extract bibtex entries from file of > notes to a *.bib file? >
Yes, you can use babel's tangling facilities to extract bibtex entries enclosed in source blocks. #+begin_src bibtex :tangle history.bib @InCollection{levi2001_microhistory, author = {Levi, Giovanni}, title = {On Microhistory}, editor = {Peter Burke}, booktitle = {New Perspectives on Historical Writing}, address = {University Park, PA}, publisher = {Penn State Press}, year = 2001, } #+end_src Calling org-babel-tangle-file will put this entry in the file history.bib. > The stumbling point for me in saving bibtex sources is I don't see a > way to use the file as a bibtex *.bib file so as to use that as the > direct source for the publication. Perhaps this could be automated > with babel? There are a few other routes. 1. Bibtex discards anything outside of an entry so you could symlink your org file to something with a bib extension (e.g., notes.org -> notes.bib) and simply point latex/bibtex to that file. 2. You could instruct emacs to edit bib files with orgmode and use babel and source blocks to enter items (add-to-list 'auto-mode-alist '("\\.\\(org\\|bib\\)$" . org-mode)) 3. AFAICT, reftex is blissfully indifferent to non-bibtex data, so you could use reftex to query your org files for citation keys. Then, you could use reftex to generate a proper bib file with all entries cited in your paper. Best, Matt