"o.castillo.felis...@gmail.com" <o.castillo.felis...@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.

#+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
@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}
}
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

Reply via email to