From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: org-mode and ebib Date: Sun, 12 Dec 2010 17:21:25 +0000 Message-ID: <87d3p629gq.fsf@ucl.ac.uk> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from [140.186.70.92] (port=34561 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PRpcB-0000c4-1D for emacs-orgmode@gnu.org; Sun, 12 Dec 2010 12:21:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PRpc9-0007xW-Aw for emacs-orgmode@gnu.org; Sun, 12 Dec 2010 12:21:38 -0500 Received: from vscane-b.ucl.ac.uk ([144.82.108.141]:45957) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PRpc9-0007wE-6d for emacs-orgmode@gnu.org; Sun, 12 Dec 2010 12:21:37 -0500 In-Reply-To: (Thomas S. Dye's message of "Sat, 11 Dec 2010 15:06:22 -1000") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Thomas S. Dye" Cc: emacs-orgmode , Ali Tofigh "Thomas S. Dye" writes: > On Dec 10, 2010, at 7:19 AM, Ali Tofigh wrote: > >> Hi everyone, >> >> A while ago I asked on this list about connecting org-mode with ebib, >> which is a bibtex database manager for emacs. Thanks to Joost Kremers, >> there is now a solution. >> >> I asked the developer of ebib, Joost Kremers, if he could write a >> function that would start ebib on a given bibtex entry. He kindly >> added this functionality to the 'ebib' function (which starts ebib in >> emacs) and it is now available in the ebib git repository (see >> http://ebib.sourceforge.net). If you are using ebib and would like to >> get org-mode to open bibtex entries do the following: >> >> 1) Install the latest development version of ebib. >> >> 2) make sure ebib-preload-bib-files is set properly so that your .bib >> file is loaded by ebib when ebib starts >> >> 3) add the following lines to your .emacs: >> (org-add-link-type "ebib" 'ebib) >> >> Now you can insert ebib links in your documents like this: >> [[ebib:Jones1998][some paper title]]. Opening this link should now >> result in ebib starting, loading your default bibtex database, and >> highlighting the bibtex entry Jones1998. Alternatively, if you already >> have started ebib, then opening the link will get you to the bibtex >> entry in your opened ebib database. >> >> /Ali Tofigh >> > Aloha /Ali Tofigh, > > Thanks very much for this. It is a nice addition to Org-mode. > > Now it is also possible to add link types for LaTeX citation macros, > as the following link type for one of the natbib citation macros: > > (org-add-link-type > "citep" 'ebib > (lambda (path desc format) > (cond > ((eq format 'latex) > (format "\\citep[%s]{%s}" desc path))))) > > A link like [[citep:jones][35]] will export this to LaTeX: > \citep[35]{jones} Ali & Tom, thanks for this. This is brilliant. I have modified (well, copied and created an alternative) the last snippet to --8<---------------cut here---------------start------------->8--- (org-add-link-type "cite" 'ebib (lambda (path desc format) (cond ((eq format 'latex) (format "\\cite{%s}" path))))) --8<---------------cut here---------------end--------------->8--- as I tend to use =cite= much more than =citep=. This works like a charm although I must admit that citep with the description is prettier in an org context! In any case, no more \cite's in my org files and the link to ebib is ever so useful. Thanks again, eric -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 23.2.1 : using Org-mode version 7.4 (release_7.4.10.g93135f)