emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric S Fraga <e.fraga@ucl.ac.uk>
To: "Thomas S. Dye" <tsd@tsdye.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>,
	Ali Tofigh <alix.tofigh@gmail.com>
Subject: Re: org-mode and ebib
Date: Sun, 12 Dec 2010 17:21:25 +0000	[thread overview]
Message-ID: <87d3p629gq.fsf@ucl.ac.uk> (raw)
In-Reply-To: <F9A28FCE-8036-4271-B7E6-8C971C2D429C@tsdye.com> (Thomas S. Dye's message of "Sat, 11 Dec 2010 15:06:22 -1000")

"Thomas S. Dye" <tsd@tsdye.com> 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	other threads:[~2010-12-12 17:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-10 17:19 org-mode and ebib Ali Tofigh
2010-12-12  1:06 ` Thomas S. Dye
2010-12-12 17:21   ` Eric S Fraga [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-05-10 15:21 Piter_
2011-05-10 16:15 ` Thomas S. Dye
2011-05-10 21:00   ` Christian Moe
2011-05-11  7:55     ` Rasmus
2011-05-15  6:02     ` Thomas S. Dye
2011-05-15 14:28       ` Christian Moe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d3p629gq.fsf@ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --cc=alix.tofigh@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tsd@tsdye.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).