On Sat, May 10, 2014 at 10:44 AM, Eric S Fraga <e.fr...@ucl.ac.uk> wrote:

> On Thursday,  1 May 2014 at 13:07, John Kitchin wrote:
> > 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
>
> Hi John,
>
> I am having problems with org-ref and am obviously missing something
> trivial.  I downloaded the latest version yesterday (Friday).  You don't
> say, in the above, what function you actually bound to C-c ] but I bound
> org-ref-insert-cite-link and that doesn't seem to work:
>

C-c ] should be bound by default to org-ref-insert-cite-link. It is defined
in a hook function in line 104 of org-ref.org.

I made a custom variable to store the key-binding, but I realized it
probably doesn't help, since the binding


>
> 1. C-u on it does not give me a choice of citation method
>

If you type C-u M-x  org-ref-insert-cite-link

do you get a choice?

I just tried this on a fresh pull and it does work for me. I am not sure
why this wouldn't work for you.  Do you tangle the .el file from the .org
file? I have this code somewhere else to build it when needed:
(if (or
     (not (file-exists-p "org-ref.el"))
     (< (float-time (nth 5 (file-attributes "org-ref.el")))
    (float-time (nth 5 (file-attributes "org-ref.org")))))
    (progn
      (org-babel-tangle-file (expand-file-name "org-ref.org"
starter-kit-dir))
      (load-file (expand-file-name "org-ref.el" starter-kit-dir)))
  (require 'org-ref))

That retangles the org file if the org-file is newer than the el file.


> 2. the link inserted "looks" like a link (it's blue) but there are
>      actually no [[...]] characters surrounding it.
>

There are no [[...]]. The links work fine without them for me. Are they
necessary for some reason? I can add them, but since they do not do
anything but disappear in this case, I leave them out.  That is actually
not totally true, if you write your link as [[cite:key][page 23]] the page
23 gets formatted in latex as \cite[page23]{key}.


>
> What am I missing?  Am I expected to type the [[]] or use C-c C-l?
>
> I don't think you need the [[]], and you do not have to use C-c C-l. The
only thing that C-c C-l offers is autocompletion on bibtex keys for the
cite link (I have not figured out a way to avoid a lot of cut and paste
code for the other types, and I rarely use this feature, but I am leaving
it in so I do not forget how I did it ;). I guess C-c C-l might help
entering the description too.



> I would like to C-u C-c ], choose autocite and my refs and have your
> code insert [[autocite:blah-2001,joe-2010,moe-2014]] into my org
> buffer.  I know I can change the default citation link type through
> org-ref-default-citation-link but I want the C-u functionality.
>

You should be able to do all those things. The C-u functionality works
independently of the default type, and it should let you get something
other than the default.


>
> Finally, looking at the code, it would appear that appending new
> citations will only work for "cite:" links as the "cite:" is hard-coded
> into the code?
>

This is correct in the version you have. The current workaround is to use
C-u C-c ], and select the "A" format, which will output a leading comma and
your selections. I have pushed a fix for this, that adds a requirement of
dash.el and checks of the link is in a list of cite types defined in
org-ref. Thanks for making me think of a solution to that!


> thanks again,
> eric
>
> PS - I'm a fellow Chemical Engineer but unfortunately have not yet had
> the opportunity to cite any of your papers but look forward to doing so
> sometime soon using org-ref ;-)
>

That would be great! I hope the comments above help!


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

Reply via email to