From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: org-ref code Date: Mon, 12 May 2014 13:26:26 -0400 Message-ID: References: <878uql7r7p.fsf@ucl.ac.uk> <87eh0d62ys.fsf@ucl.ac.uk> <87lhu9ofqa.fsf@ucl.ac.uk> <871tvzm859.fsf@pinto.chemeng.ucl.ac.uk> <87zjimnccb.fsf@a-rx.info> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0118291439baeb04f9373fe0 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:37834) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wjtzg-0005sN-NX for emacs-orgmode@gnu.org; Mon, 12 May 2014 13:26:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wjtzf-0006TE-KB for emacs-orgmode@gnu.org; Mon, 12 May 2014 13:26:28 -0400 Received: from mail-we0-x236.google.com ([2a00:1450:400c:c03::236]:59180) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wjtzf-0006OV-1m for emacs-orgmode@gnu.org; Mon, 12 May 2014 13:26:27 -0400 Received: by mail-we0-f182.google.com with SMTP id t60so7100742wes.41 for ; Mon, 12 May 2014 10:26:26 -0700 (PDT) In-Reply-To: <87zjimnccb.fsf@a-rx.info> 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: Andreas Reuleaux Cc: "emacs-orgmode@gnu.org" --089e0118291439baeb04f9373fe0 Content-Type: text/plain; charset=UTF-8 that should work out of the box, and that link is defined in org-ref as (org-add-link-type "cite" 'org-ref-cite-onclick-minibuffer-menu 'org-ref-cite-link-format) I am not sure why it would not work out of the box. John ----------------------------------- John Kitchin Associate Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu On Mon, May 12, 2014 at 1:20 PM, Andreas Reuleaux wrote: > Eric S Fraga writes: > > > Is there some org variable I have not set that tells org to treat cite: > > plain text as a link on export? Obviously org already recognises it as > > a link but the export doesn't... org-link-protocols and org-link-types > > look fine. > > > > Being just a org-ref beginner, I don't know if there is a more > straightforward solution but, I have configured: > > > (org-add-link-type > "cite" > 'org-ref-cite-onclick-minibuffer-menu > ;; formatting > (lambda (keyword desc format) > (cond > ((eq format 'html) (format "(%s)" path)) > ((eq format 'latex) > (concat "\\cite{" > (mapconcat (lambda (key) key) > (org-ref-split-and-strip-string keyword) ",") > "}"))))) > > > and similarily for autocite and textcite (the citation types that I am > using), that works for me. Adapted (copied) from the org-add-link-type > for autocite given in the org-ref.org description. Not sure if this > should just work out of the box (without configuration), but then, it's > not that much code. > > -Andreas > > > > --089e0118291439baeb04f9373fe0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
that should work out of the box, and that link is defined = in org-ref as

(org-add-link-type
 "cite"
 'org-ref-cite-onclick-minibuffer-menu
 'org-ref-cite-link-format)

I am =
not sure why it would not work out of the box.


John

----------------------= -------------
John Kitchin
Associate Professor
Doherty Hall A207F
Department of = Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213<= br>412-268-7803
http://kitchingroup.cheme.cmu.edu



On Mon, May 12, 2014 at 1:20 PM, Andreas= Reuleaux <andreas@a-rx.info> wrote:
Eric S Fraga <e.fra= ga@ucl.ac.uk> writes:

> Is there some org variable I have not set that tells org to treat cite= :
> plain text as a link on export? =C2=A0Obviously org already recognises= it as
> a link but the export doesn't... =C2=A0org-link-protocols and org-= link-types
> look fine.
>

Being just a org-ref beginner, I don't know if there is a more straightforward solution but, I have configured:


=C2=A0 (org-add-link-type
=C2=A0 =C2=A0"cite"
=C2=A0 =C2=A0'org-ref-cite-onclick-minibuffer-menu
=C2=A0 =C2=A0;; formatting
=C2=A0 =C2=A0(lambda (keyword desc format)
=C2=A0 =C2=A0 =C2=A0(cond
=C2=A0 =C2=A0 =C2=A0 ((eq format 'html) (format "(<cite>%s&l= t;/cite>)" path))
=C2=A0 =C2=A0 =C2=A0 ((eq format 'latex)
=C2=A0 =C2=A0 =C2=A0 =C2=A0(concat "\\cite{"
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(mapconcat (lambda (= key) key) (org-ref-split-and-strip-string keyword) ",")
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"}")))))

and similarily for autocite and textcite (the citation types that I am
using), that works for me. Adapted (copied) from the org-add-link-type
for autocite given in the = org-ref.org description. =C2=A0Not sure if this
should just work out of the box (without configuration), but then, it's=
not that much code.

-Andreas




--089e0118291439baeb04f9373fe0--