crsh / citr

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

Inconsistent error when using citr with Zotero #29

Closed chriscastille6 closed 6 years ago

chriscastille6 commented 6 years ago

When I attempt to load a library, I get the following message:

Warning in do_read_bib(file, encoding = .Encoding, srcfile) :

8e1COZH0yPnDdpDyz3zpK6kKzqwx3pio.bib:2:0 syntax error, unexpected $end Dropping the entry CascioInvestingPeopleFinancial2008 (starting at line 28) Warning: Error in do_read_bib: unprotect_ptr: pointer not found Stack trace (innermost first): 105: do_read_bib 104: RefManageR::ReadBib 103: import_bbt 102: load_betterbiblatex_bib 101: eval 100: eval 99: shiny::withProgress 98: 87: bibliography 86: force 85: need 84: lapply 83: sapply 82: validate 81: renderText 80: func 79: origRenderFunc 78: output$read_error 3: shiny::runApp 2: runGadget 1: citr:::insert_citation Warning: Error in do_read_bib: unprotect_ptr: pointer not found Stack trace (innermost first): 91: 90: stop 89: bibliography 88: tag 87: tags$a 86: actionLink 85: tag 84: tags$span 83: span 82: helpText 81: renderUI 80: func 79: origRenderFunc 78: output$zotero_status 3: shiny::runApp 2: runGadget 1: citr:::insert_citation Warning: Error in do_read_bib: unprotect_ptr: pointer not found Stack trace (innermost first): 61: 60: stop 59: bibliography 58: observerFunc 3: shiny::runApp 2: runGadget 1: citr:::insert_citation ERROR: [on_request_read] connection reset by peer

Please advise.

crsh commented 6 years ago

Hi Christopher, judging from the error message it seems you are trying to import references from you Zotero bibliography, is that correct? Are you using the current development version of citr available from this repository (devtools::install_github("crsh/citr")) or the CRAN version? If the latter is the case, try updating to see if the error persists. If it does, please provide the .bib file for your Zotero bibliography available at http://localhost:23119/better-bibtex/library?library.bibtex when Zotero is running.

chriscastille6 commented 6 years ago

Hi there. I'm trying to import references from my Zotero library. I followed your advice and downloaded the developer version. Unfortunately the following error is still persisting. "Warning: Error in do_read_bib: unprotect_ptr: pointer not found"

Please advise.

crsh commented 6 years ago

I need to see the bibliography file you are trying to import. Please provide the .bib file for your Zotero bibliography available at http://localhost:23119/better-bibtex/library?library.bibtex when Zotero is running.

chriscastille6 commented 6 years ago

Happy to, but the file simply has:

translation failed

Written in it.

If you like, I could invite you to my Zotero library. Would that help?

chriscastille6 commented 6 years ago

Note: this happens for both my personal and online library.

chriscastille6 commented 6 years ago

Bibfile.txt

I'm sorry – I just realized what you were asking for. Please see the attached bibfile, which I've uploaded as a .txt file. Hopefully, this doesn't cause a problem.

I should note that this file does not appear to have the files from my group/shared Zotero library in it, which is the library that I'd like to draw upon when using citr.

Thanks in advance for your help in diagnosing the problem.

crsh commented 6 years ago

I'm not sure what's going on here, but it is certainly not a citr-problem. The exported .bib-file is faulty. All braces and newlines are escaped with \ and there is some additional stuff at the top of the file that should not be there:

{\rtf1\ansi\ansicpg1252\cocoartf1561\cocoasubrtf400
{\fonttbl\f0\fmodern\fcharset0 Courier;}
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;}
{\*\expandedcolortbl;;\cssrgb\c0\c0\c0;}
\margl1440\margr1440\vieww10800\viewh8400\viewkind0
\deftab720
\pard\pardeftab720\partightenfactor0

\f0\fs26 \cf0 \expnd0\expndtw0\kerning0

If this file was generated by Better Bib(La)TeX you may want to check your settings or reach out to the developer at their GitHub repository.

I should note that this file does not appear to have the files from my group/shared Zotero library in it, which is the library that I'd like to draw upon when using citr.

This is currently not possible with the version available from CRAN, but if you install citr from this repository you will be able to access all shared and group libraries.

chriscastille6 commented 6 years ago

Ok – thanks for the advice. It does seem to be working now, but I have not yet taken the advice you gave, which is weird.

Basically, when I restarted my Zotero session, everything worked.