emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-mode and ebib
@ 2010-12-10 17:19 Ali Tofigh
  2010-12-12  1:06 ` Thomas S. Dye
  0 siblings, 1 reply; 9+ messages in thread
From: Ali Tofigh @ 2010-12-10 17:19 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: org-mode and ebib
  2010-12-10 17:19 Ali Tofigh
@ 2010-12-12  1:06 ` Thomas S. Dye
  2010-12-12 17:21   ` Eric S Fraga
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas S. Dye @ 2010-12-12  1:06 UTC (permalink / raw)
  To: Ali Tofigh; +Cc: emacs-orgmode

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}

And of course the link will jump to the bibtex entry with a single  
click.

Thanks again for making this happen.

All the best,
Tom

> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: org-mode and ebib
  2010-12-12  1:06 ` Thomas S. Dye
@ 2010-12-12 17:21   ` Eric S Fraga
  0 siblings, 0 replies; 9+ messages in thread
From: Eric S Fraga @ 2010-12-12 17:21 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: emacs-orgmode, Ali Tofigh

"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)

^ permalink raw reply	[flat|nested] 9+ messages in thread

* org-mode and ebib
@ 2011-05-10 15:21 Piter_
  2011-05-10 16:15 ` Thomas S. Dye
  0 siblings, 1 reply; 9+ messages in thread
From: Piter_ @ 2011-05-10 15:21 UTC (permalink / raw)
  To: emacs-orgmode

Hi all.
There was a discussion about integration of ebib and org mode. And it
is possible to open ebib on selected link like this
[[citep:jones1999][35]] .
But I cannot manage to insert such link from ebib into org-mode.
Have anybody made a function for it?
Thanks.
Petro.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: org-mode and ebib
  2011-05-10 15:21 org-mode and ebib Piter_
@ 2011-05-10 16:15 ` Thomas S. Dye
  2011-05-10 21:00   ` Christian Moe
  0 siblings, 1 reply; 9+ messages in thread
From: Thomas S. Dye @ 2011-05-10 16:15 UTC (permalink / raw)
  To: Piter_; +Cc: emacs-orgmode

Piter_ <x.piter@gmail.com> writes:

> Hi all.
> There was a discussion about integration of ebib and org mode. And it
> is possible to open ebib on selected link like this
> [[citep:jones1999][35]] .
> But I cannot manage to insert such link from ebib into org-mode.
> Have anybody made a function for it?
> Thanks.
> Petro.
>
>

Aloha Petro,

Here's how I insert those links (perhaps someone else has a better way):

[[citep: (type this in the org-mode buffer)

M-x ebib (find desired reference in ebib buffer)

P Ret Ret Z (push the reference to the default buffer without using one
of the ebib format functions, then submerge ebib)

][XX]] (close the link, optionally adding a page number)

hth,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: org-mode and ebib
  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
  0 siblings, 2 replies; 9+ messages in thread
From: Christian Moe @ 2011-05-10 21:00 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: emacs-orgmode

I use Reftex for inserting -- from the .bib file, not from ebib -- 
thanks to the setup tips here:

http://article.gmane.org/gmane.emacs.orgmode/2406/match=bibliography

http://www.mfasold.net/blog/2009/02/using-emacs-org-mode-to-draft-papers/

Yours,
Christian


On 5/10/11 6:15 PM, Thomas S. Dye wrote:
> Piter_<x.piter@gmail.com>  writes:
>
>> Hi all.
>> There was a discussion about integration of ebib and org mode. And it
>> is possible to open ebib on selected link like this
>> [[citep:jones1999][35]] .
>> But I cannot manage to insert such link from ebib into org-mode.
>> Have anybody made a function for it?
>> Thanks.
>> Petro.
>>
>>
>
> Aloha Petro,
>
> Here's how I insert those links (perhaps someone else has a better way):
>
> [[citep: (type this in the org-mode buffer)
>
> M-x ebib (find desired reference in ebib buffer)
>
> P Ret Ret Z (push the reference to the default buffer without using one
> of the ebib format functions, then submerge ebib)
>
> ][XX]] (close the link, optionally adding a page number)
>
> hth,
> Tom
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: org-mode and ebib
  2011-05-10 21:00   ` Christian Moe
@ 2011-05-11  7:55     ` Rasmus
  2011-05-15  6:02     ` Thomas S. Dye
  1 sibling, 0 replies; 9+ messages in thread
From: Rasmus @ 2011-05-11  7:55 UTC (permalink / raw)
  To: emacs-orgmode

Christian Moe <mail@christianmoe.com> writes:

> I use Reftex for inserting -- from the .bib file, not from ebib --
> thanks to the setup tips here:
>
> http://article.gmane.org/gmane.emacs.orgmode/2406/match=bibliography
>
> http://www.mfasold.net/blog/2009/02/using-emacs-org-mode-to-draft-papers/

I agree, reftex is very nice and Org will understand the
citations just fine.

Here is my setup, which might be (read `probably is') stolen from
somewhere:

,----[ Reftex ]
| It is nice to be able to access reftex to insert citations 
| 
| #+begin_src emacs-lisp
| 
| (defun org-mode-reftex-setup ()
|   (load-library "reftex")
|   (and (buffer-file-name)
|        (file-exists-p (buffer-file-name))
|        (reftex-parse-all))
|   (define-key org-mode-map (kbd "C-c )") 'reftex-citation))
| (add-hook 'org-mode-hook 'org-mode-reftex-setup)
| 
| #+end_src 
`----

–Rasmus

-- 
Sent from my Emacs

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: org-mode and ebib
  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
  1 sibling, 1 reply; 9+ messages in thread
From: Thomas S. Dye @ 2011-05-15  6:02 UTC (permalink / raw)
  To: mail; +Cc: emacs-orgmode

Aloha Christian,

I like RefTeX, too, when I'm using AucTeX, but I've found it has a few
annoying habits in the Org-mode environment.  Can I ask how you deal
with these?

How do you pass the master file name to RefTeX?

Do you let RefTeX parse all your Org-mode buffers?  If not, how do you
direct it to the buffers you want parsed?

All the best,
Tom

Christian Moe <mail@christianmoe.com> writes:

> I use Reftex for inserting -- from the .bib file, not from ebib -- 
> thanks to the setup tips here:
>
> http://article.gmane.org/gmane.emacs.orgmode/2406/match=bibliography
>
> http://www.mfasold.net/blog/2009/02/using-emacs-org-mode-to-draft-papers/
>
> Yours,
> Christian
>
>
> On 5/10/11 6:15 PM, Thomas S. Dye wrote:
>> Piter_<x.piter@gmail.com>  writes:
>>
>>> Hi all.
>>> There was a discussion about integration of ebib and org mode. And it
>>> is possible to open ebib on selected link like this
>>> [[citep:jones1999][35]] .
>>> But I cannot manage to insert such link from ebib into org-mode.
>>> Have anybody made a function for it?
>>> Thanks.
>>> Petro.
>>>
>>>
>>
>> Aloha Petro,
>>
>> Here's how I insert those links (perhaps someone else has a better way):
>>
>> [[citep: (type this in the org-mode buffer)
>>
>> M-x ebib (find desired reference in ebib buffer)
>>
>> P Ret Ret Z (push the reference to the default buffer without using one
>> of the ebib format functions, then submerge ebib)
>>
>> ][XX]] (close the link, optionally adding a page number)
>>
>> hth,
>> Tom
>>
>
>
>

-- 
Thomas S. Dye
http://www.tsdye.com

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: org-mode and ebib
  2011-05-15  6:02     ` Thomas S. Dye
@ 2011-05-15 14:28       ` Christian Moe
  0 siblings, 0 replies; 9+ messages in thread
From: Christian Moe @ 2011-05-15 14:28 UTC (permalink / raw)
  To: Thomas S. Dye; +Cc: emacs-orgmode

On 5/15/11 8:02 AM, Thomas S. Dye wrote:
> Aloha Christian,
>
> I like RefTeX, too, when I'm using AucTeX, but I've found it has a few
> annoying habits in the Org-mode environment.  Can I ask how you deal
> with these?

Uhm... I probably don't deal with them, and I probably don't even know 
what I'm missing, since I don't have much of a LaTeX background. I 
have used Reftex solely for inserting citations.

I'll be watching with interest to see if others can answer your 
questions, though.

> How do you pass the master file name to RefTeX?

If I understand your question, the issue hasn't come up, so I don't 
know. The longest thing I've authored in Org so far was a 40-odd-page 
report, without co-authors, so I haven't had any need yet to manage 
master files and included files.

> Do you let RefTeX parse all your Org-mode buffers?

Yes, via org-mode-hook. For my uses, the overhead is negligible. So I 
haven't looked at how to do this selectively.

Yours,
Christian

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-05-15 14:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-10 15:21 org-mode and ebib 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
  -- strict thread matches above, loose matches on Subject: below --
2010-12-10 17:19 Ali Tofigh
2010-12-12  1:06 ` Thomas S. Dye
2010-12-12 17:21   ` Eric S Fraga

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).