jkitchin / org-ref

org-mode modules for citations, cross-references, bibliographies in org-mode and useful bibtex tools to go with it.
GNU General Public License v3.0
1.36k stars 244 forks source link

Citations not showing up after selecting #634

Closed vnckppl closed 5 years ago

vnckppl commented 5 years ago

I am currently running emacs 26.1, org mode 9.1.14, and org-ref 1.1.1 (via melpa).

When I select a citation from my bib file via C-c ] the citation does not show up in my org document. When I manually type in the citation in the org file (e.g., cite:my_citation) the link that is being created works and the exported pdf file shows the correct citation.

Is there a way to fix this?

jkitchin commented 5 years ago

Is this a new problem?

Can you run M-x org-ref-debug and post the output (or email it to me if you don't want it posted)?

vnckppl commented 5 years ago

It is a fresh install of org-ref and I am a new user, so this issue has been there from the start. Here is the output:

+TITLE: org-ref debug

org-ref: Version 1.1.1

  • Variables

    1. org-ref-completion-library: org-ref-helm-bibtex
    2. org-ref-bibliography-notes: ~/Dropbox/Documents/Bibliography/notes.org (exists nil)
    3. org-ref-default-bibliography: (~/Dropbox/Docuemnts/Bibliography/references.bib) (exists (nil)) (listp t)
    4. org-ref-pdf-directory: ~/Dropbox/Documents/Bibliography/bibtex-pdfs/ (exists nil)
  • System system-type: System: darwin system-configuration: x86_64-apple-darwin16.7.0 window system: Window system: ns Emacs: GNU Emacs 26.1 (build 1, x86_64-apple-darwin16.7.0, NS appkit-1504.83 Version 10.12.6 (Build 16G1314)) of 2018-05-30 org-version: 9.1.14

  • about org-ref org-ref installed in /Users/vincent/.emacs.d/elpa/org-ref-1.1.1/org-ref.elc.

** Dependencies helm-bibtex /Users/vincent/.emacs.d/elpa/helm-bibtex-2.0.0/helm-bibtex.elc

  • org-ref-pdf (loaded: t) system pdftotext: /usr/local/bin/pdftotext You set pdftotext-executable to pdftotext (exists: /usr/local/bin/pdftotext)

  • org-ref-url-utils (loaded: nil)

  • export variables org-latex-pdf-process: ("latexmk -shell-escape -bibtex -f -pdf %f")

jkitchin commented 5 years ago

Is the problem that when you type C-c ] you don't see any references to insert?

If you are using a default bibliography, maybe there is a type in the definition of org-ref-default-bibliography, the debug info shows that file does not exist.

vnckppl commented 5 years ago

I do see the list of references when I type C-c ]

At the top of my org file I have:

#+BEGIN_SRC emacs-lisp :exports none
(setq org-latex-pdf-process (list "latexmk -shell-escape -bibtex -f -pdf %f"))
#+END_SRC

At the bottom of my org file I have:

bibliography:/Users/vincent/references.bib
bibliographystyle:unsrt

Also, emacs tells me that /Users/vincent/references.bib exists.

Also, it is true that the default files that I specify in my .emacs file do not exist (yet), but I am not using them.

jkitchin commented 5 years ago

ok, I guess this is an issue with the order of helm-actions. If you type C-c ], select a citation, and the press tab, what do you see as the first action. If it isn't "Insert citation" then somehow the order of actions isn't correct for org-ref.

vnckppl commented 5 years ago

The list of actions is:

[f1] Open PDF file (if present)
[f2] Insert citation
....

How can I change the order?

jkitchin commented 5 years ago

org-ref should be reordering them for you. Do you have:

(require 'org-ref-helm-bibtex)

in an init file?

vnckppl commented 5 years ago

I have added (require 'org-ref-helm-bibtex) to my .emacs and completely closed and restarted emacs, but the order of actions has not changed.

jkitchin commented 5 years ago

I am not sure why that could be possible, that library should reorder them when it is required. If you aren't committed to helm-bibtex, an alternative is

(require 'org-ref-ivy-cite)

It uses ivy, and is the one I use all the time.

vnckppl commented 5 years ago

That works! Thanks!