Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bibliography link not being detected? #1038

Open
joshbarrass opened this issue Sep 26, 2022 · 6 comments
Open

Bibliography link not being detected? #1038

joshbarrass opened this issue Sep 26, 2022 · 6 comments

Comments

@joshbarrass
Copy link

joshbarrass commented Sep 26, 2022

I have a bibliography link like so at the bottom of my document:

bibliography:references.bib
bibliographystyle:ieeetr

However, when I use C-] to insert a link, there are no references displayed in the list. If I put

#+BIBLIOGRAPHY: ./references.bib

at the top of the document and use helm-bibtex-with-local-bibliography, the references are detected with no problem. In addition, I can work around the problem by adding

# -*- bibtex-completion-bibliography: ("./references.bib"); -*-

to the top of the file, and then C-] detects my references as expected. It is just when I rely solely on the bibliography link at the bottom of my document that it doesn't work.

This is only something I've noticed recently; I've had org-ref working just like this in the past. In addition, helm-bibtex works fine in LaTeX mode, it's just in org-mode that it breaks.

Any ideas on how I could fix this?

EDIT: Additionally, I have just noticed that this also causes the LaTeX exporter not to work, so even this is not detecting the bibliography link. This was just because I hadn't set up my config properly. If I ensure bibtex is called in the LaTeX export command, the references are added to the document correctly.

@jkitchin
Copy link
Owner

hm. is the link active, i.e. is it blue, and can you click on the bibliography link to open it and there is a tooltip on it?

@joshbarrass
Copy link
Author

Yes, the link is blue, clicking it opens the file and hovering over it says either "Bibliography link" or "File exists at references.bib", dependent on where I hover.

@joshbarrass
Copy link
Author

I've just discovered that it seems to detect it fine without setting bibtex-completion-bibliography if I use org-ref-insert-cite-link rather than helm-bibtex; I can start typing the name of a reference and it autocompletes quite happily. It seems to just be helm-bibtex that isn't working. So perhaps more an issue on their end than with org-ref.

@jkitchin
Copy link
Owner

I see. if you have just updated from org-ref 2 to org-ref-3, there is probably some reconfiguration to do.

I think you need:

(require 'org-ref)
(require 'org-ref-helm)

The helm command is org-ref-cite-insert-helm, which I guess you need to put into

(setq org-ref-insert-cite-function 'org-ref-cite-insert-helm). Then I think the key binding should use helm.

@joshbarrass
Copy link
Author

I should already have these things in my config, The full configuration in my init.el is

(use-package org-ref
  :ensure t
  :config
  (require 'org-ref)
  (require 'org-ref-helm)
  (define-key org-mode-map (kbd "C-c ]") 'org-ref-insert-link)
  (setq org-ref-insert-link-function 'org-ref-insert-link-hydra/body
        org-ref-insert-cite-function 'org-ref-cite-insert-helm
        org-ref-insert-label-function 'org-ref-insert-label-link
        org-ref-insert-ref-function 'org-ref-insert-ref-link
        org-ref-cite-onclick-function (lambda (_) (org-ref-citation-hydra/body)))
  (message "org-ref is installed")
  )

@jkitchin
Copy link
Owner

I don't know what the issue is then. With that setup, C-c ] should insert a link from your bibliography. It should look like it comes from helm-bibtex, but I think it doesn't actually come from helm-bibtex. You can't do that directly from helm-bibtex I think.

It maybe used to be that way, I think in v2 I directly monkey-patched helm-bibtex actions to do this, but in v3, that is not the case I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants