From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: How to use ox-bibtex Date: Tue, 28 Jan 2014 09:32:47 +0100 Message-ID: <52E76B2F.1040109@krugs.de> References: <871tzuy2k3.fsf@gmail.com> <87r47tv5tq.fsf@gmail.com> Reply-To: Rainer@krugs.de Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060009010600060903060908" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W846M-00057X-1x for emacs-orgmode@gnu.org; Tue, 28 Jan 2014 03:33:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W846H-0007Dn-Dx for emacs-orgmode@gnu.org; Tue, 28 Jan 2014 03:32:57 -0500 Received: from mail-wg0-f54.google.com ([74.125.82.54]:38099) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W846H-0007DO-4O for emacs-orgmode@gnu.org; Tue, 28 Jan 2014 03:32:53 -0500 Received: by mail-wg0-f54.google.com with SMTP id x13so154811wgg.9 for ; Tue, 28 Jan 2014 00:32:52 -0800 (PST) In-Reply-To: <87r47tv5tq.fsf@gmail.com> 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: Eric Schulte , "o.castillo.felisola@gmail.com" Cc: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------060009010600060903060908 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 01/27/14, 15:36 , Eric Schulte wrote: > "o.castillo.felisola@gmail.com" > writes: > >> Hello Eric. I finally try the examples you attached above, and >> I'm getting a problem. The file is not imported, because of an >> error "Wrong type argument arrayp, nil". >> >> Does anyone know what I am missing? >> >> Cheers >> > > My guess is that something is messed up in either your version of > Org-mode or your personal config. Please try the following to > reproduce. > > 1. launch a version of Emacs with Org-mode loaded but without your > personal config, this may be conveniently done by running > > make vanilla > > from the base of your Org-mode installation. > > 2. evaluate the following > > (add-to-list 'load-path "contrib/lisp/") (require 'ox-bibtex) > > 3. open the example .org file attached previously (with the example > .bib file in the same directory), and export to latex. > > You should now see appropriate \cite{ref} and \bibliography > elements in the exported latex. This all works for me, if you get > an error please send the whole debug trace along with version info > for your Org-mode and Emacs. Thanks for this thread - very interesting. Just one correction (or is it a bug?): Even the export to text - ASCII aborts the bibtex2htlm installation. But also: I don't get it to work. I evaluated (require 'ox-bibtex) which worked, but export to te4xt and html gives the following error: org-babel-exp process emacs-lisp at line 78... if: Executing bibtex2html failed but bibtex2html is installed (homebrew) Export to LaTeX gives the attached .tex file, but the pdf contains corrupt citations "[?]" and no bibliograhy. Is this my setup? Bibliographies work in LaTex here. Cheers, Rainer > > Best, > >> >> >> On Sun, Jan 26, 2014 at 4:37 PM, o.castillo.felisola@gmail.com < >> o.castillo.felisola@gmail.com> wrote: >> >>> Thank you Eric, I'll try it asap! Cheers! On Jan 26, 2014 4:20 >>> PM, "Eric Schulte" wrote: >>> >>>> "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. >>>> >>>> >>>> >>>> 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 >>>> >>>> > - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Stellenbosch University South Africa Tel : +33 - (0)9 53 10 27 44 Cell: +33 - (0)6 85 62 59 98 Fax : +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer@krugs.de Skype: RMkrug -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.22 (Darwin) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJS52svAAoJENvXNx4PUvmCQeIH/2H0k9onPCLugYkcY5v2kF7b lD1KEDPK6oMwvvjbP7BpX/nf5SjnNi8F5vV/VMTfcxgTrq8Nzn+Vacyh7JmkGQVO bKBl6LyyZjHVobUzLxWzGeaIKX8WHmsssMnIu3GAvyuQw9sniYdwz2T45SpEXNjn t6+2mf/3tczO3OiBG0DR32lUnCFdkxDR6y24MQ4eVxaPpn3j4wSev/B+n+td6Hij EafRF9ElP4wt5xOkeCFfliqG6sxNkZ7m4q7lwsoMn3sEXiGbZ55KZDtbvuAtzngt SKvqXHly2OMEcexzlsIzpzHXx9Ah90tq2Ydxipo6Fi39h4OOVFhcUOonRc6mahs= =TE2t -----END PGP SIGNATURE----- --------------060009010600060903060908 Content-Type: application/x-tex; name="ox-bibtex-example.tex" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ox-bibtex-example.tex" % Created 2014-01-28 Tue 09:29 \documentclass[11pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{fixltx2e} \usepackage{graphicx} \usepackage{longtable} \usepackage{float} \usepackage{wrapfig} \usepackage{rotating} \usepackage[normalem]{ulem} \usepackage{amsmath} \usepackage{textcomp} \usepackage{marvosym} \usepackage{wasysym} \usepackage{amssymb} \usepackage{hyperref} \tolerance=1000 \usepackage{color} \usepackage{listings} \author{Eric Schulte} \date{\today} \title{An Example Demonstrating ox-bibtex Usage} \hypersetup{ pdfkeywords={}, pdfsubject={}, pdfcreator={Emacs 24.3.1 (Org mode 8.2.5g)}} \begin{document} \maketitle An example document demonstrating generation of bibliographies for \LaTeX{}, HTML and ASCII export using Org-mode \cite{dominik2010org} with the \texttt{ox-bibtex} contributed package. Included code blocks are executable for reproducibility \cite{schulte2012multi}. (taken from the comments at the top of \texttt{ox-bibtex.el}) \section{Introduction and Requirements} \label{sec-1} Use \texttt{cite} syntax for Org links (e.g., \texttt{cite:bibtexid}). For HTML and ascii it uses the bibtex2html software from \url{http://www.lri.fr/~filliatr/bibtex2html/}, and for ascii it uses the pandoc software from \url{http://johnmacfarlane.net/pandoc/}. \section{Usage} \label{sec-2} The usage is as follows: \begin{verbatim} #+BIBLIOGRAPHY: bibfilebasename stylename optional-options \end{verbatim} e.g. given \texttt{foo.bib} and using style "plain": \begin{verbatim} #+BIBLIOGRAPHY: foo plain option:-d \end{verbatim} "stylename" can also be "nil", in which case no style will be used. Optional options are of the form: \begin{verbatim} option:-foobar \end{verbatim} pass '-foobar' to bibtex2html e.g., \begin{center} \begin{tabular}{ll} \texttt{option:-d} & sort by date\\ \texttt{option:-a} & sort as BibTeX (usually by author) \textbf{default}\\ \texttt{option:-u} & unsorted i.e. same order as in .bib file\\ \texttt{option:-r} & reverse the sort\\ \end{tabular} \end{center} See the bibtex2html man page for more. Multiple options can be combined like: \begin{verbatim} option:-d option:-r \end{verbatim} Limiting to only the entries cited in the document: \begin{verbatim} limit:t \end{verbatim} For \LaTeX{} export this simply inserts the lines \begin{verbatim} \bibliographystyle{plain} \bibliography{foo} \end{verbatim} into the \TeX{} file when exporting. For HTML export it: \begin{enumerate} \item converts all \texttt{\textbackslash{}cite\{foo\}} and =\cite{foo=} to links to the bibliography, \item creates a \texttt{foo.html} and \texttt{foo\_bib.html}, \item includes the contents of \texttt{foo.html} in the exported HTML file. \end{enumerate} For ascii export it: \begin{enumerate} \item converts all \texttt{\textbackslash{}cite\{foo\}} and =\cite{foo=} to links to the bibliography, \item creates a \texttt{foo.txt} and \texttt{foo\_bib.html}, \item includes the contents of foo.txt in the exported ascii file. \end{enumerate} For \LaTeX{} export it: \begin{enumerate} \item converts all \texttt{[[cite:foo=]] to =\textbackslash{}cite\{foo\}}. \end{enumerate} \section{Emacs Configuration} \label{sec-3} The \texttt{.emacs} configuration is simple. With path to Org-mode's \texttt{contrib/} repository in your load path, require \texttt{ox-bibtex} as in the following example. \lstset{language=Lisp,numbers=none} \begin{lstlisting} (add-to-list 'load-path "~/.emacs.d/src/org-mode/contrib/lisp/") (require 'ox-bibtex) \end{lstlisting} \bibliographystyle{plain} \bibliography{ox-bibtex-example} % Emacs 24.3.1 (Org mode 8.2.5g) \end{document} --------------060009010600060903060908--