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

Losing reference to the local .bib file after connecting to Zotero #63

Open
dmi3kno opened this issue Feb 5, 2020 · 2 comments
Open
Labels

Comments

@dmi3kno
Copy link

dmi3kno commented Feb 5, 2020

First of all thank you for the awesome package! It changed the way I write academic papers and I am looking forward to converting my colleagues to the workflow involving citr/rmd and Zotero.

Describe the bug
After connecting to Zotero library, citr is losing reference to the local .bib file described in YAML and instead proceeds to create new references.bib in the working directory.

To Reproduce
Open new RMD document (I am using rticles template) with custom bib file defined in YAML. Launch Zotero in the background. Call citr Rstudio addin. It correctly identifies YAML's .bib file and suggests that Zotero is running, so it is possible to "connect and load" libraries. Click "connect and load", Zotero is now connected, but the reference to original .bib file is lost (it says "references are added to references.bib"). In order to cure it, switch temporarily to "Settings" tab, where reference to original .bib file is still stored. Do nothing and switch back to "Insert citation" tab. The local .bib is now recognized and properly linked.

Expected behavior
There should be no need to switch to "Settings" tab to correct the reference to .bib file

Screenshots
Open citr. YAML reference to ./intro_paper.bib is correctly recognized.
Screenshot 1 from 2020-02-05 09-35-08
Zotero library loaded and reference to ./intro_paper.bib is lost
Screenshot 2 from 2020-02-05 09-35-37
Flip to "Settings" tab. Everything looks like expected.
Screenshot 3 from 2020-02-05 09-36-12
Flip back to "Insert citation" tab. Reference to local .bib file is cured.
Screenshot 4 from 2020-02-05 09-36-33

@crsh
Copy link
Owner

crsh commented Feb 11, 2020

Thanks for taking the time to report this. I'll look into it the next chance I get.

@crsh crsh added the bug label Feb 11, 2020
@jrennstich
Copy link

I am not quite sure if this is connected to this, but I experience the following related problem.

In the YAML reference I need to provide the entire path for RStudio to correctly render the citations. citr on the other hand produces the following result when I do that:

> citr:::insert_citation()
Error in FUN(X[[i]], ...) : 
  file '/Users/jrennstich/Dropbox/websites/rennstich_com_v2/content/de/tutorials/online-lehre-praxis//Users/jrennstich/Dropbox/websites/rennstich_com_v2/references.bib' does not exist

Here's the odd thing. My workaround is as follows: I have two lines in the YAML

When I want to render the references, I comment-out the first one.

# bibliography: references.bib
bibliography:  /Users/jrennstich/Dropbox/websites/rennstich_com_v2/references.bib

Whenever I need to add citations using citr, I comment-out the second line.

bibliography: references.bib
# bibliography:  /Users/jrennstich/Dropbox/websites/rennstich_com_v2/references.bib

This won't allow me to render the references. As my set-up is correct according to the Settings:

screenshot_247

all the added references are being added to said .bib file, even though in YAML I only specify
bibliography: references.bib

The problem is, that when I use the correct full .bib file path YAML, I get the following error:

> citr:::insert_citation()
Error in FUN(X[[i]], ...) : 
  file '/Users/jrennstich/Dropbox/websites/rennstich_com_v2/content/de/tutorials/online-lehre-praxis//Users/jrennstich/Dropbox/websites/rennstich_com_v2/references.bib' does not exist

Is this related to this bug? Or should I open up a new case? And is there a way for me to avoid the workaround I am using now?

Thanks for your incredible work on this and the other packages!

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

No branches or pull requests

3 participants