crsh / citr

RStudio Addin to Insert Markdown Citations
Other
407 stars 46 forks source link

How do I connect my rMarkdown file with my Zotero library automatically? Every time I start a new Markdown file I get a error message that there is no *.bib file #47

Closed viniciusbrei closed 5 years ago

crsh commented 5 years ago

To connect to Zotero, you need to install the Better Bib(La)TeX Plugin for Zotero and start Zotero. If the installation was successful the addin should should offer an action link at the "Insert citation" tab to load the selected libraries ("Zotero connection available. Connect and load libraries"). Is this not the case for you?

viniciusbrei commented 5 years ago

Thank you for your answer. I have a few (maybe stupid) questions:

  1. In your tutorial (https://github.com/crsh/citr) there is a link to instal Better Bib(La)TeX extension. However, the informed link ("https://retorque.re/zotero-better-bibtex/) is to instal Better BibTeX, NOT Better Bib(La)TeX . Is this correct?
  2. When I started a new RMarkdown file, and I asked to insert citations, it read a previous "references.bib" file from my last opened RMarkdown file. However, I would like to link the new references to my whole Zotero Library. How do I do that?
  3. How to I generate the list of references at the end? I included a #References section at the end and ran the knit at Rstudio, but it did not run. Do I need any packages to generate the references automatically, such as Bookdown package? Thank you and congratulations for the package! Very useful!
crsh commented 5 years ago
  1. In your tutorial (https://github.com/crsh/citr) there is a link to instal Better Bib(La)TeX extension. However, the informed link ("https://retorque.re/zotero-better-bibtex/) is to instal Better BibTeX, NOT Better Bib(La)TeX . Is this correct?

Sorry for the imprecision. I've changed all instances of "Better Bib(La)TeX" to "Better BibTeX". The linked-to extension is correct.

  1. When I started a new RMarkdown file, and I asked to insert citations, it read a previous "references.bib" file from my last opened RMarkdown file. However, I would like to link the new references to my whole Zotero Library. How do I do that?

Hmm, the addin really does the opposite. It inserts references from your Zotero library into the bibliography file specified in the YAML front matter (e.g., bibliography: references.bib) whenever you insert a citation into the R Markdown document. If Better BibTeX is installed and Zotero is up and running, you should see "Zotero connection available. Connect and load libraries" at the "Insert Citation" tab. If you click the action link, you should be able to search and insert all references from the Zotero libraries specified at the "Settings" tab.

  1. How to I generate the list of references at the end? I included a #References section at the end and ran the knit at Rstudio, but it did not run. Do I need any packages to generate the references automatically, such as Bookdown package?

If you specify the bibliography file in the YAML front matter, R Markdown should take care of generating the reference section.

viniciusbrei commented 5 years ago

Thanks for your answer! #1 and #2 are solved. However, #3 (automatic list of references at the end) is not. Markdown does not find references.bib file and does not generate any HTML or PDF.

The YAML is as follows:

title: "test" author: "xxx" date: "1/30/2019" output: pdf_document: default html_document: default bibliography: references.bib

The error message is as follows:

"pandoc-citeproc: Could not find references.bib CallStack (from HasCallStack): error, called at src/Text/CSL/Pandoc.hs:224:39 in pandoc-citeproc-0.10.4-BdOyQb33rzG2TMOLj4Fbp9:Text.CSL.Pandoc pandoc: Error running filter /Applications/RStudio.app/Contents/MacOS/pandoc/pandoc-citeproc Filter returned error status 1 Error: pandoc document conversion failed with error 83 Execution halted".

Thank you!

crsh commented 5 years ago

The error message tells you that pandoc-citeproc cannot locate the reference.bib file. It's probably not located in the directory of the R Markdown file?

viniciusbrei commented 5 years ago

It's working! Thank you and congratulations for the great package!

ghost commented 4 years ago

Hi,

I am having trouble with using the Insert citations addin. I click Insert citations, then Connect and load libraries, and it attempts to load, showing a progress bar getting started, but then RStudio just spontaneously aborts. It happens every time. Any suggestions? My code looks like this:


title: "citr demonstration" author: "James Cutler" bibliography: Bibtex_Zotero_library.bib output: html_document

DNA microarrays are small glass slides containing thousands of spots (called "features") printed on them. Each spot contains millions to tens of millions of single-stranded DNA probes that are complementary to specific regions of the genome, like specific genes [I WOULD LIKE MY CITATIONS TO GO HERE].

ghost commented 4 years ago

Never mind. I tried exporting just a single collection in my zotero library as thesis_references.bib, and then with the following:

bibliography: thesis_references.bib

It worked. The new .bib file that just includes one collection from my zotero library is 9 KB. My entire library, Bibtex_Zotero_library.bib, is 694 KB. Not sure why R would completely crash just because I try to use my zotero library in the bibliography YAML header. It can't be the size of the file, for example, right?

crsh commented 4 years ago

Hi James, hmm, it's hard to tell what's going on without additional information. Could you post the error message? Could you also try exporting the entire bibliography to Bib(La)TeX and reading it into R using RefManageR::ReadBib()?

diatomm commented 4 years ago

Hello James, In regards to your most recent comment you've got the workflow that works for what you are trying to accomplish. From my experience you may run into instability with the shiny app if you are accessing a tonne of records at once which is why generating sub-collections is helpful. However, I'm not sure you will run into huge issues.

ghost commented 4 years ago

Thank you for getting back to me so quickly! I'm glad I was able to find an easy fix!

Thanks again,

James

On Tue, Jun 23, 2020 at 6:13 PM diatomm notifications@github.com wrote:

Hello James, In regards to your most recent comment you've got the workflow that works for what you are trying to accomplish. From my experience you may run into instability with the shiny app if you are accessing a tonne of records at once which is why generating sub-collections is helpful. However, I'm not sure you will run into huge issues.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/crsh/citr/issues/47#issuecomment-648475348, or unsubscribe https://github.com/notifications/unsubscribe-auth/AINUXL2VWVMIW6QIYQELGA3RYEZIHANCNFSM4GSFHJFQ .

owate commented 3 years ago

Thank you for getting back to me so quickly! I'm glad I was able to find an easy fix! Thanks again, James On Tue, Jun 23, 2020 at 6:13 PM diatomm @.***> wrote: Hello James, In regards to your most recent comment you've got the workflow that works for what you are trying to accomplish. From my experience you may run into instability with the shiny app if you are accessing a tonne of records at once which is why generating sub-collections is helpful. However, I'm not sure you will run into huge issues. — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#47 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AINUXL2VWVMIW6QIYQELGA3RYEZIHANCNFSM4GSFHJFQ .

I am experiencing the same issue @jcutler79. How did you fix it?

When I click the Connect and load libraries, it aborts. See image below. In my case I exported all the references within a collection from zotero, about 54KB. It was working fine yesterday. I'm not sure what the issue could be. P.S: I am a novice at R and very new to papaja and zotero.

Screen Shot 2021-04-06 at 8 29 14 PM