emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] org-mode and ebib


From: Eric S Fraga
Subject: Re: [Orgmode] org-mode and ebib
Date: Sun, 12 Dec 2010 17:21:25 +0000
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux)

"Thomas S. Dye" <address@hidden> 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]