From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: org-ref code Date: Thu, 1 May 2014 13:07:35 -0400 Message-ID: References: <878uql7r7p.fsf@ucl.ac.uk> <87eh0d62ys.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b6d95d099a07804f859b359 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53872) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfuSR-0001Vq-6T for emacs-orgmode@gnu.org; Thu, 01 May 2014 13:07:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WfuSP-0002Pl-5a for emacs-orgmode@gnu.org; Thu, 01 May 2014 13:07:39 -0400 Received: from mail-pa0-x230.google.com ([2607:f8b0:400e:c03::230]:33302) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WfuSO-0002PW-Pw for emacs-orgmode@gnu.org; Thu, 01 May 2014 13:07:37 -0400 Received: by mail-pa0-f48.google.com with SMTP id hz1so3921359pad.35 for ; Thu, 01 May 2014 10:07:35 -0700 (PDT) In-Reply-To: <87eh0d62ys.fsf@ucl.ac.uk> 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: John Kitchin , "emacs-orgmode@gnu.org" --047d7b6d95d099a07804f859b359 Content-Type: text/plain; charset=UTF-8 I implemented some of this partially. I made it so you can specify the default cite link in a user variable, with a default of cite. When you type C-c ], this format will automatically be used. If you want to choose another format, type C-u C-c ] which will prompt you for a type, and then use the reftex-citation command to complete it. I added most of the citation types I know of to this. Most of those will not work with completion. I did make the cite link completion function use the default link type, so that it will at least do what you want. I might add completion functions for all the link types, it is just a lot of cut and pasting. and I do not use that much. I just wanted to see if I could do it ;) I also added addbibresource as a link type, and updated org-ref to be able to use that instead of bibliography. Thanks for the ideas! 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 Thu, May 1, 2014 at 9:30 AM, Eric S Fraga wrote: > On Thursday, 1 May 2014 at 08:47, John Kitchin wrote: > > [...] > > Hi John, > > thanks for your quick response! > > > an alternative would be to use a prefix command that gave you an option > to > > change the cite format, similar to the minibuffer menu for cite links. I > > have not written much prefix code before, but I will try that out. > > This would be good, with many a way of stating the default one would > like? For instance, for grant proposals, I often use autocite in > biblatex for generating citations as footnotes whereas for research > papers I use cite most often. > > > In the end, the link definitions can be as short as this: > > > > #+BEGIN_SRC emacs-lisp :tangle org-ref.el > > (org-add-link-type > > "cite" > > 'org-ref-cite-onclick-minibuffer-menu > > 'org-ref-cite-link-format) > > #+END_SRC > > My comment was not so much the definitions you used but that you were > overwriting those that I had already defined. Your definitions were > arguably better than mine so maybe I was being a bit picky here... :) > > > I wrote this for my research group to use, and eventually the links have > to > > be defined somewhere. I am not sure what the best place would be. It is > an > > interesting issue of reproducibility though. Two people with different > link > > definitions would get different results. > > Yes, this is true but there is so much that can be customised in org > that you will never have reproducibility at this level (e.g. handling of > latex snippets, code listings, even latex classes). I would leave > something like this to a separate set of code that is not part of > org-ref. > > > It should be easy enough to make an addbibresource link that does the > same > > thing as the bibliography link. And maybe to modify the find-bibliography > > code to check for that too. I have never used biblatex though, so I dont > > have any experience with it. > > I have only started using biblatex recently, and that was because I > wanted to use autocite. The only change I had to make was \bibliography > to \addbibresource. I still use the same bibtex files. Of course, > others may be making more effective use of biblatex... > > >>> 4. The customisation interface for org-ref-default-bibliography should > be > >>> list aware... > >> > > I think I fixed this. > > Thanks! > -- > : Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-923-g233c11 > --047d7b6d95d099a07804f859b359 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I implemented some of this partially. I made it = so you can specify the default cite link in a user variable, with a default= of cite. When you type C-c ], this format will automatically be used. If y= ou want to choose another format, type C-u C-c ] which will prompt you for = a type, and then use the reftex-citation command to complete it. I added mo= st of the citation types I know of to this. Most of those will not work wit= h completion. I did make the cite link completion function use the default = link type, so that it will at least do what you want. I might add completio= n functions for all the link types, it is just a lot of cut and pasting. an= d I do not use that much. I just wanted to see if I could do it ;)

I also added addbibresource as a link type, and updated org-ref t= o be able to use that instead of bibliography.

Thanks for the = ideas!

John

-----------------------------------
John Kitchin
Associate Profes= sor
Doherty Hall A207F
Department of Chemical Engineering
Carnegie= Mellon University
Pittsburgh, PA 15213
412-268-7803
http://kitchingroup.chem= e.cmu.edu



On Thu, May 1, 2014 at 9:30 AM, Eric S F= raga <e.fraga@ucl.ac.uk> wrote:
On Thursday, =C2=A01 May 2014 at 08:47, John Kitchin wrote:

[...]

Hi John,

thanks for your quick response!

> an alternative would be to use a prefix command that gave you an optio= n to
> change the cite format, similar to the minibuffer menu for cite links.= I
> have not written much prefix code before, but I will try that out.

This would be good, with many a way of stating the default one would<= br> like? =C2=A0For instance, for grant proposals, I often use autocite in
biblatex for generating citations as footnotes whereas for research
papers I use cite most often.

> In the end, the link definitions can be as short as this:
>
> #+BEGIN_SRC emacs-lisp :tangle org-ref.el
> (org-add-link-type
> =C2=A0"cite"
> =C2=A0'org-ref-cite-onclick-minibuffer-menu
> =C2=A0'org-ref-cite-link-format)
> #+END_SRC

My comment was not so much the definitions you used but that you were=
overwriting those that I had already defined. =C2=A0Your definitions were arguably better than mine so maybe I was being a bit picky here... :)

> I wrote this for my research group to use, and eventually the links ha= ve to
> be defined somewhere. I am not sure what the best place would be. It i= s an
> interesting issue of reproducibility though. Two people with different= link
> definitions would get different results.

Yes, this is true but there is so much that can be customised in org<= br> that you will never have reproducibility at this level (e.g. handling of latex snippets, code listings, even latex classes). =C2=A0I would leave
something like this to a separate set of code that is not part of
org-ref.

> It should be easy enough to make an addbibresource link that does the = same
> thing as the bibliography link. And maybe to modify the find-bibliogra= phy
> code to check for that too. I have never used biblatex though, so I do= nt
> have any experience with it.

I have only started using biblatex recently, and that was because I wanted to use autocite. =C2=A0The only change I had to make was \bibliograp= hy
to \addbibresource. =C2=A0I still use the same bibtex files. =C2=A0Of cours= e,
others may be making more effective use of biblatex...

>>> 4. The customisation interface for org-ref-default-bibliograph= y should be
>>> =C2=A0 =C2=A0 =C2=A0list aware...
>>
> I think I fixed this.

Thanks!
--
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.2, Org release_8.2.6-923-g233c11=

--047d7b6d95d099a07804f859b359--