citr icon indicating copy to clipboard operation
citr copied to clipboard

Error in callFun: argument "location" is missing

Open ogsteele opened this issue 5 years ago • 4 comments

Hi,

Hope you're able to help. Love the idea of the package, yet am struggling to integrate it successfully. I'm currently unable to get Citr to place any in-text citations within my Markdown documents

Citr nicely links to Zotero, sees my BetterBibTex keys and allows me to select the references of interest. However, when clicking Insert Citation I am met with the following error and no in-text citation.

Warning: Error in callFun: argument "location" is missing, with no default
  76: callFun`
  75: rstudioapi::insertText
  74: observeEventHandler
   3: shiny::runApp
   2: runGadget
   1: citr:::insert_citation
Error in execCallbacks(timeoutSecs, all, loop$id) : 
  invoke_wrapped: throwing std::runtime_error

May not be relevant, but Citr appears to correctly populate and update a references.bib file despite the lack of citation. I was obviously expecting an in-text citation and would really appreciate your help fixing this.

Installed BetterBibTex, RefManageR and bibtex this morning alongside Citr - so I'm assuming they're all up to date.

Let me know if you need any more information from me, really appreciate your time!

Cheers, Oli

ogsteele avatar Nov 11 '20 11:11 ogsteele

I had a similar problem. I found a temporary solution by including location = context$selection[[1]]$range in the call to rstudioapi::insertText (see here https://github.com/crsh/citr/compare/master...rmtrane:master).

I'm not sure this is the solution, but it is a solution that has worked for me so far.

rmtrane avatar Nov 15 '20 20:11 rmtrane

Hi Oli, which version of RStudio are you using?

Thanks, rmtrane, for chiming in. I'll take a look at your solution.

crsh avatar Nov 16 '20 20:11 crsh

@crsh No, thank you for this awesome package!

Also, I'm on version 1.4.953 of RStudio.

rmtrane avatar Nov 16 '20 20:11 rmtrane

Second that @rmtrane - thanks for the awesome package @crsh ! Also, thanks for the suggestion, I haven't had a chance to try and implement it but will try and get round to it in the next couple of days.

I'm on version 1.3.1073 which I think is the latest version available for OSX.

ogsteele avatar Nov 16 '20 23:11 ogsteele