From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: How to use ox-bibtex Date: Sun, 26 Jan 2014 11:02:42 -0700 Message-ID: <871tzuy2k3.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7VG8-0006r7-4f for emacs-orgmode@gnu.org; Sun, 26 Jan 2014 14:20:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W7VG2-0007Yv-RO for emacs-orgmode@gnu.org; Sun, 26 Jan 2014 14:20:44 -0500 Received: from mail-pd0-x22f.google.com ([2607:f8b0:400e:c02::22f]:59373) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W7VG2-0007Y3-93 for emacs-orgmode@gnu.org; Sun, 26 Jan 2014 14:20:38 -0500 Received: by mail-pd0-f175.google.com with SMTP id w10so4905952pde.34 for ; Sun, 26 Jan 2014 11:20:37 -0800 (PST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "o.castillo.felisola@gmail.com" Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain "o.castillo.felisola@gmail.com" writes: > Dear community, > > I'm using org-mode to draft most of my activities, and day after day I get > closer to managing my paper writing. Nonetheless, there is a point still > drives me crazy. > > All over the web I find post about using such or what tool to get emacs > org-mode to work with Bibtex... all of them seems complex to execute. I > found the exported ox-bibtex.el [1] (included in my installation from git), > which 'It also introduces "cite" syntax for Org links.', but no examples of > the usage are included in this document. > > *Question* > > Can anyone provide a minimal example of the use to this tool, including the > configuration (if needed), and the necessary external (non-org) files? > The attached two files (.org and .bib) provide an example of usage. --=-=-= Content-Type: text/x-org Content-Disposition: attachment; filename=ox-bibtex-example.org #+Title: An Example Demonstrating ox-bibtex Usage #+Author: Eric Schulte #+Options: toc:nil ^:{} An example document demonstrating generation of bibliographies for LaTeX, HTML and ASCII export using Org-mode cite:dominik2010org with the =ox-bibtex= contributed package. Included code blocks are executable for reproducibility cite:schulte2012multi. (taken from the comments at the top of =ox-bibtex.el=) * Introduction and Requirements Use =cite= syntax for Org links (e.g., =cite:bibtexid=). For HTML and ascii it uses the bibtex2html software from http://www.lri.fr/~filliatr/bibtex2html/, and for ascii it uses the pandoc software from http://johnmacfarlane.net/pandoc/. * Usage The usage is as follows: : #+BIBLIOGRAPHY: bibfilebasename stylename optional-options e.g. given =foo.bib= and using style "plain": : #+BIBLIOGRAPHY: foo plain option:-d "stylename" can also be "nil", in which case no style will be used. Optional options are of the form: : option:-foobar pass '-foobar' to bibtex2html e.g., | =option:-d= | sort by date | | =option:-a= | sort as BibTeX (usually by author) *default* | | =option:-u= | unsorted i.e. same order as in .bib file | | =option:-r= | reverse the sort | See the bibtex2html man page for more. Multiple options can be combined like: : option:-d option:-r Limiting to only the entries cited in the document: : limit:t For LaTeX export this simply inserts the lines : \bibliographystyle{plain} : \bibliography{foo} into the TeX file when exporting. For HTML export it: 1) converts all =\cite{foo}= and =[[cite:foo=]] to links to the bibliography, 2) creates a =foo.html= and =foo_bib.html=, 3) includes the contents of =foo.html= in the exported HTML file. For ascii export it: 1) converts all =\cite{foo}= and =[[cite:foo=]] to links to the bibliography, 2) creates a =foo.txt= and =foo_bib.html=, 3) includes the contents of foo.txt in the exported ascii file. For LaTeX export it: 1) converts all =[[cite:foo=]] to =\cite{foo}=. * Emacs Configuration The =.emacs= configuration is simple. With path to Org-mode's =contrib/= repository in your load path, require =ox-bibtex= as in the following example. #+begin_src emacs-lisp (add-to-list 'load-path "~/.emacs.d/src/org-mode/contrib/lisp/") (require 'ox-bibtex) #+end_src #+BIBLIOGRAPHY: ox-bibtex-example plain --=-=-= Content-Type: text/x-bibtex Content-Disposition: attachment; filename=ox-bibtex-example.bib @book{dominik2010org, title={The Org Mode 7 Reference Manual-Organize your life with GNU Emacs}, author={Dominik, Carsten}, year={2010}, publisher={Network Theory Ltd.} } @article{schulte2012multi, title={A multi-language computing environment for literate programming and reproducible research}, author={Schulte, Eric and Davison, Dan and Dye, Thomas and Dominik, Carsten}, journal={Journal of Statistical Software}, volume={46}, number={3}, pages={1--24}, year={2012}, publisher={American Statistical Association} } --=-=-= Content-Type: text/plain Best, > > Thank you! > > [1] > http://orgmode.org/w/?p=org-mode.git;a=blob_plain;f=contrib/lisp/ox-bibtex.el;hb=HEAD -- Eric Schulte https://cs.unm.edu/~eschulte PGP: 0x614CA05D --=-=-=--