Giter VIP home page Giter VIP logo

citr's People

Contributors

batpigandme avatar crsh avatar gadenbuie avatar gegznav avatar ilsepit avatar milesmcbain avatar robinlovelace avatar tobiasheycke avatar yihui avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

citr's Issues

Using citr leaves warning message: readLines(parents_path[parents])

Hi @crsh ,

This is not a very urgent issue. And I'm sure it is just because of some issue with my R project files. Because this warning is not coming in my other R projects.

R output is running good. But somehow citr is leaving a warning message like this:

Listening on http://127.0.0.1:5358 Warning message: In readLines(parents_path[parents]) : incomplete final line found on '/home/ajay/PhD_Thesis_AJAY/index.Rmd

I hope that this warning will not create any issue in future.

a helpful warning screen-shot:
screenshot from 2018-02-01 23-41-04

citr addin not populated

Hi,
After citr installation the "insert citation" option is not found under Addin button. Package installation didn't give error so error might be beyond that.
How can I troubleshoot the problem? Is there any rstudio log file so that I can check what went wrong?
On the other side, I suspect that the problem might be home folder of user including non-ascii character "æ" , can this be the problem? I need to troubleshoot the problem but I don't have log file.

I'm suspecting about folder name issue because it caused trouble with Git integration, resulting in "Directory name is invalid" errors during commits in RStudio.

Crashes with very large Zotero libraries

I have a very large local Zotero database (>35,000 items including top-level items, attachments, and notes). When I have the default option to use the entire Zotero library enabled, citr is unable to load. It tries for several minutes, then eventually crashes.

scan bibliography

Many thanks for develop the citr package.
I have a question:
I deleted my bib file, now i would like scan the references from my document and import from zotero the bibtex and save in a new .bib file, it is possible?
I try to use:
citr::load_betterbiblatex_bib(encoding = "UTF-8")
But it import all bibliography from zotero and i can write it in a .bib file

many thanks

YAML front matter missing or no bibliography file(s) specified.

The attached zip file, Archive.zip,
Archive.zip
contains two files, Project_Notebook.Rmd and references.bib reside in the same directory. Yet citr gives me an error message, "YAML front matter missing or no bibliography file(s) specified."

Earlier I had 3 bibliographic entries in references.bib but was getting errors. So I removed them from the Zotero collection that generates the bib file. But even with only one item, citr has trouble.

Better approaches to importing of the Zotero database

It's frustrating when citr freezes your session so I thought I'd have a play with the future package. Results seem promising so far, so thought I'd report back, having alluded to the potential utility of having the initial bib read running in the background several months ago. Basic concept demonstrated in reprex below. Thoughts: welcome!

# exclude things to make reprex faster
exclude = c("My Library", "energy-and-transport")

# no future
tictoc::tic()
b = citr::load_betterbiblatex_bib(encoding = "UTF-8", exclude_betterbiblatex_library = exclude)
#> Importing 'LIDA-leeds'...
#> Importing 'tds'...
plot(1:9)
tictoc::toc()
#> 0.58 sec elapsed
tictoc::tic()
# do some other work
class(b)
#> [1] "BibEntry" "bibentry"
tictoc::toc()
#> 0.002 sec elapsed


# with future
tictoc::tic()
future::plan("multiprocess")
b = future::future(citr::load_betterbiblatex_bib(encoding = "UTF-8", exclude_betterbiblatex_library = exclude))
plot(1:9)

tictoc::toc()
#> 0.085 sec elapsed
tictoc::tic()
# do some other work
b = future::value(b)
#> Importing 'LIDA-leeds'...
#> Importing 'tds'...
class(b)
#> [1] "BibEntry" "bibentry"
tictoc::toc()
#> 0.322 sec elapsed

Created on 2019-10-16 by the reprex package (v0.3.0)

Bib File Not Found

I was able to get citr to work first time installed. However, I have an issue to load the bib file.

The symptom is as following: it can find the bib file from YAML, but not be able to load it in the citation.

Warning: Error in RefManageR::ReadBib: lex fatal error:
fatal flex scanner internal error--end of buffer missed

bib_issue

citr creates incorrect bib-file when there are diacritics

I have an issue with diacritics in the bib-file that citr creates from my Zotero references. I run Zotero and connect R to it directly. When I want to knit a pdf with a bib-file that includes diacritics, R throws the following error:

! Undefined control sequence.
l.93 (Ã…\nobreakspaceirok
                         ý et al. 2011) 

Error: Failed to compile citr-test.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See citr-test.log for more info.
Execution halted

However, when I paste the citation from a manual export, with unicode as plain-text latex commands, to the bib-file created by citr, the pdf is created perfectly.


The paper I use in this case can be found here, but it is the case with any publication with diacritics.


Here is the reference created by manual export:

@article{siroky2011,
  title = {Life Cycle of Tortoise Tick {{Hyalomma}} Aegyptium under Laboratory Conditions},
  volume = {54},
  issn = {01688162},
  doi = {10.1007/s10493-011-9442-8},
  abstract = {The tortoise tick Hyalomma aegyptium has a typical three-host life-cycle. Whereas its larvae and nymphs are less host-specific feeding on a variety of tetrapods, tortoises of the genus Testudo are principal hosts of adults. Ticks retained this trait also in our study under laboratory conditions, while adults were reluctant to feed on mammalian hosts. Combination of feeding larvae and nymphs on guinea pigs and feeding of adults on Testudo marginata tortoises provided the best results. Feeding period of females was on average 25~days (range 17-44), whereas males remain after female engorgement on tortoise host. Female pre-oviposition period was 14~days (3-31), followed by 24~days of oviposition (18-29). Pre-eclosion and eclosion, both together, takes 31~days (21-43). Larvae fed 5~days (3-9), then molted to nymphs after 17~days (12-23). Feeding period of nymphs lasted 7~days (5-10), engorged nymphs molted to adults after 24~days (19-26). Sex ratio of laboratory hatched H. aegyptium was nearly equal (1:1.09). The average weight of engorged female was 0.95 (0.72-1.12)~g. The average number of laid eggs was 6,900 (6,524-7,532) per female, it was significantly correlated with weight of engorged female. Only 2.8\% of engorged larvae and 1.8\% of engorged nymphs remained un-molted and died. Despite the use of natural host species, feeding success of females reached only 45\%. The whole life-cycle was completed within 147~days (98-215).},
  number = {3},
  journaltitle = {Experimental and Applied Acarology},
  date = {2011},
  pages = {277-284},
  keywords = {_not_in_zettelkasten},
  author = {{\v S}irok\'y, Pavel and Erhart, Jan and Petr{\v z}elkov\'a, Kl\'ara J. and Kamler, Martin},
  file = {C\:\\Users\\Raoul\\Zotero\\storage\\6US6QFQF\\Široký et al. - 2011 - Life cycle of tortoise tick Hyalomma aegyptium under laboratory conditions.pdf},
  isbn = {0168-8162},
  eprinttype = {pmid},
  eprint = {21431927}

Here is the reference created by citr:

@Article{siroky2011,
  title = {Life Cycle of Tortoise Tick {{Hyalomma}} Aegyptium under Laboratory Conditions},
  volume = {54},
  issn = {01688162},
  abstract = {The tortoise tick Hyalomma aegyptium has a typical three-host life-cycle. Whereas its larvae and nymphs are less host-specific feeding on a variety of tetrapods, tortoises of the genus Testudo are principal hosts of adults. Ticks retained this trait also in our study under laboratory conditions, while adults were reluctant to feed on mammalian hosts. Combination of feeding larvae and nymphs on guinea pigs and feeding of adults on Testudo marginata tortoises provided the best results. Feeding period of females was on average 25~days (range 17-44), whereas males remain after female engorgement on tortoise host. Female pre-oviposition period was 14~days (3-31), followed by 24~days of oviposition (18-29). Pre-eclosion and eclosion, both together, takes 31~days (21-43). Larvae fed 5~days (3-9), then molted to nymphs after 17~days (12-23). Feeding period of nymphs lasted 7~days (5-10), engorged nymphs molted to adults after 24~days (19-26). Sex ratio of laboratory hatched H. aegyptium was nearly equal (1:1.09). The average weight of engorged female was 0.95 (0.72-1.12)~g. The average number of laid eggs was 6,900 (6,524-7,532) per female, it was significantly correlated with weight of engorged female. Only 2.8\% of engorged larvae and 1.8\% of engorged nymphs remained un-molted and died. Despite the use of natural host species, feeding success of females reached only 45\%. The whole life-cycle was completed within 147~days (98-215).},
  number = {3},
  journal = {Experimental and Applied Acarology},
  doi = {10.1007/s10493-011-9442-8},
  author = {Pavel {{\r A}{\nobreakspace}irok\'y} and Jan Erhart and Kl{\~A}{\textexclamdown}ra J. Petr{\v z}elkov{\a'a} and Martin Kamler},
  year = {2011},
  keywords = {_not_in_zettelkasten},
  pages = {277-284},
  file = {C\:\\Users\\Raoul\\Zotero\\storage\\6US6QFQF\\Široký et al. - 2011 - Life cycle of tortoise tick Hyalomma aegyptium under laboratory conditions.pdf},
  pmid = {21431927},
}

As you can see, the latter contains a lot of extra characters, that even citr itself does not understand.

I would like to know how I can resolve this, because I like to create a new bib-file for each project I create, which then only contains the references used in that project.

Disable RefManageR check.entries prior to writing to bib file

Related to #28, I find that RefManageR's expected fields checker is a little bit too strict for me. Currently it seems the addin sets check.entries = FALSE, but after attempting to write to the local bib file.

citr/R/insert_citation.R

Lines 472 to 489 in c6143b0

if(!is.null(new_entries())) {
RefManageR::WriteBib(
new_entries()
, file = input$update_bib
, append = TRUE
)
options(citr.bib_file_last_modified = file.info(input$update_bib)$mtime)
# This is equivalent to check = FALSE for c.BibEntry()
old_BibOptions <- RefManageR::BibOptions(check.entries = FALSE)
options(
citr.bib_file_cache = c(
getOption("citr.bib_file_cache")
, RefManageR::as.BibEntry(new_entries())
)
)
RefManageR::BibOptions(old_BibOptions)
}

If RefManageR::WriteBib(), the addin crashes and the citation isn't written or inserted into the text. Moving this line

old_BibOptions <- RefManageR::BibOptions(check.entries = FALSE)

above RefManageR::WriteBib() would allow the bib entry to be written and the citation key to be inserted.

As another option, I see that check.entries in BibOptions() can take "warn" (see https://www.rdocumentation.org/packages/RefManageR/versions/1.2.0/topics/BibOptions), this may be desirable to alert the user but still add the entry/citekey.

In the mean time, calling RefManageR::BibOptions(check.entries = FALSE) in the global environment before running the addin does resolve the issue.

.bib-file not found: Error handling when reading file fails

Dear Fred if I may,

Thank you for building this useful addin! Yet, here's a problem when I tried to use it: when I activated the addin, it shows Bibliography file(s) found in YAML front matter: D:/Dropbox/Jabref.bib at the bottom, while in the searching window, a line of gray words appeared as ".bib-file(s) not found" and no result came out if I tried to search anything. I tried to locate the .bib file in the working directory and installed the developing version from Github. None of them fixed the problem. Do you have any hint what happened and how I can lead the addin to find the bib file?

Thanks,

Umlaute not correctly displayed in preview

When loading the following citation, the citr plugin does not correctly display the ü. The bib file is utf-8 encoded.

@article{hutter_dissociating_2012,
	title = {Dissociating contingency awareness and conditioned attitudes: {Evidence} of contingency-unaware evaluative conditioning.},
	volume = {141},
	issn = {1939-2222, 0096-3445},
	shorttitle = {Dissociating contingency awareness and conditioned attitudes},
	url = {http://doi.apa.org/getdoi.cfm?doi=10.1037/a0026477},
	doi = {10.1037/a0026477},
	number = {3},
	urldate = {2013-03-07},
	journal = {Journal of Experimental Psychology: General},
	author = {Hütter, Mandy and Sweldens, Steven and Stahl, Christoph and Unkelbach, Christian and Klauer, Karl Christoph},
	year = {2012},
	keywords = {*Associative Processes, *Attitude Formation, *Awareness, *Conditioning, *Evaluation, Affective Valence, Associative processes, Awareness, Conditioning, Contingency awareness, Evaluative conditioning, Attitude formation, Evaluation, Process-dissociation procedure, \_tablet, \_tablet\_modified, multinomial modeling},
	pages = {539--557},
	file = {Hütter_etal_2012.pdf:/home/theycke/Zotero/storage/48DPA3WI/Hütter_etal_2012.pdf:application/pdf;Hütter_etal_2012.pdf:/home/theycke/Zotero/storage/6HZQQ2HA/Hütter_etal_2012.pdf:application/pdf;Hütter_etal_2012.pdf:/home/theycke/Zotero/storage/7AFEWMN5/Hütter_etal_2012.pdf:application/pdf}
}

citr::tidy_bib_file doesn't find references

So, this happens:

I write:
citr::tidy_bib_file(rmd_file = "../_citr-test.Rmd", messy_bibliography = "baseline-visu.bib")

I get:
Error in citr::tidy_bib_file(rmd_file = "../_citr-test.Rmd", messy_bibliography = "baseline-visu.bib") :
Found no references in ../_citr-test.Rmd

Attached the bibliography and the Rmd file.
citr-test.zip

Session info:

  • Session info ------------------------------------------------------------------------------------------------------------
    setting value
    version R version 3.5.1 (2018-07-02)
    os Windows >= 8 x64
    system x86_64, mingw32
    ui RStudio
    language (EN)
    collate Finnish_Finland.1252
    ctype Finnish_Finland.1252
    tz Europe/Helsinki
    date 2019-03-29

  • Packages ----------------------------------------------------------------------------------------------------------------
    package * version date lib source
    abind 1.4-5 2016-07-21 [1] CRAN (R 3.5.0)
    acepack 1.4.1 2016-10-29 [1] CRAN (R 3.5.0)
    assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.5.3)
    backports 1.1.3 2018-12-14 [1] CRAN (R 3.5.1)
    base64enc 0.1-3 2015-07-28 [1] CRAN (R 3.5.0)
    BayesFactor 0.9.12-4.2 2018-05-19 [1] CRAN (R 3.5.0)
    bayesplot 1.6.0 2018-08-02 [1] CRAN (R 3.5.1)
    BDgraph 2.56 2019-03-19 [1] CRAN (R 3.5.3)
    BiasedUrn 1.07 2015-12-28 [1] CRAN (R 3.5.0)
    bitops 1.0-6 2013-08-17 [1] CRAN (R 3.5.0)
    boot 1.3-20 2017-08-06 [2] CRAN (R 3.5.1)
    bootnet 1.2 2019-01-24 [1] CRAN (R 3.5.2)
    brew 1.0-6 2011-04-13 [1] CRAN (R 3.5.0)
    bridgesampling 0.6-0 2018-10-21 [1] CRAN (R 3.5.1)
    brms * 2.8.0 2019-03-15 [1] CRAN (R 3.5.3)
    brmstools * 0.5.3 2018-11-16 [1] Github (mvuorre/brmstools@dc9c1dd)
    Brobdingnag 1.2-6 2018-08-13 [1] CRAN (R 3.5.1)
    broom 0.5.1 2018-12-05 [1] CRAN (R 3.5.1)
    broom.mixed 0.2.4 2019-02-21 [1] CRAN (R 3.5.1)
    broomExtra 0.0.1 2019-03-13 [1] CRAN (R 3.5.3)
    callr 3.2.0 2019-03-15 [1] CRAN (R 3.5.3)
    candisc 0.8-0 2017-09-19 [1] CRAN (R 3.5.1)
    car 3.0-2 2018-08-23 [1] CRAN (R 3.5.1)
    carData 3.0-2 2018-09-30 [1] CRAN (R 3.5.1)
    caTools 1.17.1.2 2019-03-06 [1] CRAN (R 3.5.3)
    cellranger 1.1.0 2016-07-27 [1] CRAN (R 3.5.0)
    checkmate 1.9.1 2019-01-15 [1] CRAN (R 3.5.2)
    citr 0.3.0 2018-12-18 [1] CRAN (R 3.5.2)
    class 7.3-15 2019-01-01 [2] CRAN (R 3.5.2)
    cli 1.1.0 2019-03-19 [1] CRAN (R 3.5.3)
    cluster 2.0.7-1 2018-04-13 [1] CRAN (R 3.5.0)
    cmprsk 2.2-7 2014-06-17 [1] CRAN (R 3.5.0)
    coda 0.19-2 2018-10-08 [1] CRAN (R 3.5.1)
    codebook 0.8.0 2019-02-21 [1] CRAN (R 3.5.1)
    codetools 0.2-16 2018-12-24 [2] CRAN (R 3.5.2)
    coin 1.3-0 2019-03-08 [1] CRAN (R 3.5.3)
    colorspace 1.4-1 2019-03-18 [1] CRAN (R 3.5.3)
    colourpicker 1.0 2017-09-27 [1] CRAN (R 3.5.0)
    corpcor 1.6.9 2017-04-01 [1] CRAN (R 3.5.0)
    corrgram * 1.13 2018-07-09 [1] CRAN (R 3.5.1)
    cowplot 0.9.4 2019-01-08 [1] CRAN (R 3.5.2)
    crayon 1.3.4 2017-09-16 [1] CRAN (R 3.5.0)
    crosstalk 1.0.0 2016-12-21 [1] CRAN (R 3.5.0)
    curl 3.3 2019-01-10 [1] CRAN (R 3.5.2)
    d3Network 0.5.2.1 2015-01-31 [1] CRAN (R 3.5.0)
    data.table 1.12.0 2019-01-13 [1] CRAN (R 3.5.2)
    data.tree 0.7.8 2018-09-24 [1] CRAN (R 3.5.1)
    dendextend 1.10.0 2019-03-15 [1] CRAN (R 3.5.3)
    DEoptimR 1.0-8 2016-11-19 [1] CRAN (R 3.5.0)
    desc 1.2.0 2018-05-01 [1] CRAN (R 3.5.1)
    DescTools 0.99.28 2019-03-17 [1] CRAN (R 3.5.3)
    devtools 2.0.1 2018-10-26 [1] CRAN (R 3.5.1)
    DiagrammeR 1.0.0 2018-03-01 [1] CRAN (R 3.5.0)
    digest 0.6.18 2018-10-10 [1] CRAN (R 3.5.1)
    diptest 0.75-7 2016-12-05 [1] CRAN (R 3.5.0)
    downloader 0.4 2015-07-09 [1] CRAN (R 3.5.0)
    dplyr * 0.8.0.1 2019-02-15 [1] CRAN (R 3.5.2)
    DT 0.5 2018-11-05 [1] CRAN (R 3.5.1)
    dygraphs 1.1.1.6 2018-07-11 [1] CRAN (R 3.5.1)
    eigenmodel 1.10 2018-06-03 [1] CRAN (R 3.5.0)
    ellipse 0.4.1 2018-01-05 [1] CRAN (R 3.5.0)
    ellipsis 0.1.0 2019-02-19 [1] CRAN (R 3.5.1)
    emmeans 1.3.3 2019-03-02 [1] CRAN (R 3.5.3)
    EMT 1.1 2013-01-29 [1] CRAN (R 3.5.2)
    Epi 2.35 2019-03-01 [1] CRAN (R 3.5.3)
    estimability 1.3 2018-02-11 [1] CRAN (R 3.5.0)
    etm 1.0.4 2018-07-11 [1] CRAN (R 3.5.1)
    evaluate 0.13 2019-02-12 [1] CRAN (R 3.5.1)
    expm 0.999-4 2019-03-21 [1] CRAN (R 3.5.3)
    ez 4.4-0 2016-11-02 [1] CRAN (R 3.5.3)
    fdrtool 1.2.15 2015-07-08 [1] CRAN (R 3.5.0)
    fit.models 0.5-14 2017-04-06 [1] CRAN (R 3.5.1)
    flexmix 2.3-15 2019-02-18 [1] CRAN (R 3.5.1)
    forcats * 0.4.0 2019-02-17 [1] CRAN (R 3.5.2)
    foreach 1.4.4 2017-12-12 [1] CRAN (R 3.5.0)
    foreign 0.8-71 2018-07-20 [1] CRAN (R 3.5.1)
    Formula 1.2-3 2018-05-03 [1] CRAN (R 3.5.0)
    fpc 2.1-11.1 2018-07-20 [1] CRAN (R 3.5.1)
    fs 1.2.7 2019-03-19 [1] CRAN (R 3.5.3)
    future 1.12.0 2019-03-08 [1] CRAN (R 3.5.3)
    gclus 1.3.2 2019-01-07 [1] CRAN (R 3.5.2)
    gdata 2.18.0 2017-06-06 [1] CRAN (R 3.5.0)
    GeneNet 1.2.13 2015-08-02 [1] CRAN (R 3.5.0)
    generics 0.0.2 2018-11-29 [1] CRAN (R 3.5.1)
    GGally 1.4.0 2018-05-17 [1] CRAN (R 3.5.0)
    ggcorrplot 0.1.2 2018-09-11 [1] CRAN (R 3.5.1)
    ggExtra 0.8 2018-04-04 [1] CRAN (R 3.5.0)
    ggm 2.3 2015-01-21 [1] CRAN (R 3.5.0)
    ggplot2 * 3.1.0 2018-10-25 [1] CRAN (R 3.5.1)
    ggrepel 0.8.0 2018-05-09 [1] CRAN (R 3.5.0)
    ggridges * 0.5.1 2018-09-27 [1] CRAN (R 3.5.1)
    ggsignif 0.5.0 2019-02-20 [1] CRAN (R 3.5.2)
    ggstatsplot * 0.0.10 2019-03-17 [1] CRAN (R 3.5.3)
    glasso 1.10 2018-07-13 [1] CRAN (R 3.5.1)
    glmnet 2.0-16 2018-04-02 [1] CRAN (R 3.5.0)
    globals 0.12.4 2018-10-11 [1] CRAN (R 3.5.1)
    glue 1.3.1 2019-03-12 [1] CRAN (R 3.5.3)
    GPArotation 2014.11-1 2014-11-25 [1] CRAN (R 3.5.2)
    gplots 3.0.1.1 2019-01-27 [1] CRAN (R 3.5.2)
    gridExtra 2.3 2017-09-09 [1] CRAN (R 3.5.0)
    groupedstats 0.0.6 2019-03-20 [1] CRAN (R 3.5.3)
    gtable 0.3.0 2019-03-25 [1] CRAN (R 3.5.1)
    gtools 3.8.1 2018-06-26 [1] CRAN (R 3.5.0)
    haven 2.1.0 2019-02-19 [1] CRAN (R 3.5.2)
    heplots 1.3-5 2018-04-03 [1] CRAN (R 3.5.1)
    highr 0.8 2019-03-20 [1] CRAN (R 3.5.3)
    Hmisc 4.2-0 2019-01-26 [1] CRAN (R 3.5.2)
    hms 0.4.2 2018-03-10 [1] CRAN (R 3.5.0)
    htmlTable 1.13.1 2019-01-07 [1] CRAN (R 3.5.2)
    htmltools 0.3.6 2017-04-28 [1] CRAN (R 3.5.0)
    htmlwidgets 1.3 2018-09-30 [1] CRAN (R 3.5.1)
    httpuv 1.5.0 2019-03-15 [1] CRAN (R 3.5.3)
    httr 1.4.0 2018-12-11 [1] CRAN (R 3.5.1)
    huge 1.3.1 2019-03-11 [1] CRAN (R 3.5.3)
    igraph 1.2.4 2019-02-13 [1] CRAN (R 3.5.2)
    influenceR 0.1.0 2015-09-03 [1] CRAN (R 3.5.0)
    inline 0.3.15 2018-05-18 [1] CRAN (R 3.5.0)
    insight 0.1.2 2019-03-05 [1] CRAN (R 3.5.3)
    IsingFit 0.3.1 2016-09-07 [1] CRAN (R 3.5.1)
    IsingSampler 0.2 2015-03-02 [1] CRAN (R 3.5.0)
    iterators 1.0.10 2018-07-13 [1] CRAN (R 3.5.1)
    jmv 0.9.6 2018-12-11 [1] CRAN (R 3.5.1)
    jmvcore 0.9.5.2 2018-12-10 [1] CRAN (R 3.5.1)
    jomo 2.6-7 2019-02-06 [1] CRAN (R 3.5.2)
    jpeg 0.1-8 2014-01-23 [1] CRAN (R 3.5.0)
    jsonlite 1.6 2018-12-07 [1] CRAN (R 3.5.1)
    kernlab 0.9-27 2018-08-10 [1] CRAN (R 3.5.1)
    KernSmooth 2.23-15 2015-06-29 [2] CRAN (R 3.5.1)
    knitr * 1.22 2019-03-08 [1] CRAN (R 3.5.3)
    labeling 0.3 2014-08-23 [1] CRAN (R 3.5.0)
    labelled 2.1.0 2019-02-25 [1] CRAN (R 3.5.3)
    later 0.8.0 2019-02-11 [1] CRAN (R 3.5.1)
    lattice 0.20-38 2018-11-04 [2] CRAN (R 3.5.1)
    latticeExtra 0.6-28 2016-02-09 [1] CRAN (R 3.5.0)
    lavaan 0.6-3 2018-09-22 [1] CRAN (R 3.5.2)
    lazyeval 0.2.2 2019-03-15 [1] CRAN (R 3.5.3)
    libcoin 1.0-4 2019-02-28 [1] CRAN (R 3.5.3)
    likert 1.3.5 2016-12-31 [1] CRAN (R 3.5.0)
    listenv 0.7.0 2018-01-21 [1] CRAN (R 3.5.0)
    lme4 1.1-21 2019-03-05 [1] CRAN (R 3.5.3)
    lmtest 0.9-36 2018-04-04 [1] CRAN (R 3.5.0)
    longitudinal 1.1.12 2015-07-08 [1] CRAN (R 3.5.0)
    loo 2.1.0 2019-03-13 [1] CRAN (R 3.5.3)
    lubridate 1.7.4 2018-04-11 [1] CRAN (R 3.5.0)
    magrittr 1.5 2014-11-22 [1] CRAN (R 3.5.0)
    manipulate 1.0.1 2014-12-24 [1] CRAN (R 3.5.0)
    markdown 0.9 2018-12-07 [1] CRAN (R 3.5.1)
    MASS 7.3-51.1 2018-11-01 [1] CRAN (R 3.5.2)
    Matrix 1.2-17 2019-03-22 [1] CRAN (R 3.5.3)
    matrixcalc 1.0-3 2012-09-15 [1] CRAN (R 3.5.0)
    MatrixModels 0.4-1 2015-08-22 [1] CRAN (R 3.5.0)
    matrixStats 0.54.0 2018-07-23 [1] CRAN (R 3.5.1)
    MBESS 4.4.3 2018-01-10 [1] CRAN (R 3.5.0)
    mc2d 0.1-18 2017-03-06 [1] CRAN (R 3.5.0)
    mclust 5.4.3 2019-03-14 [1] CRAN (R 3.5.3)
    memoise 1.1.0 2017-04-21 [1] CRAN (R 3.5.0)
    metafor 2.0-0 2017-06-22 [1] CRAN (R 3.5.2)
    mgcv 1.8-28 2019-03-21 [1] CRAN (R 3.5.3)
    mgm * 1.2-7 2019-03-28 [1] Github (jmbh/mgm@f93137a)
    mice 3.4.0 2019-03-07 [1] CRAN (R 3.5.3)
    mime 0.6 2018-10-05 [1] CRAN (R 3.5.1)
    miniUI 0.1.1.1 2018-05-18 [1] CRAN (R 3.5.0)
    minpack.lm 1.2-1 2016-11-20 [1] CRAN (R 3.5.0)
    minqa 1.2.4 2014-10-09 [1] CRAN (R 3.5.0)
    mitml 0.3-7 2019-01-07 [1] CRAN (R 3.5.2)
    mitools 2.3 2014-09-20 [1] CRAN (R 3.5.0)
    mnormt 1.5-5 2016-10-15 [1] CRAN (R 3.5.0)
    modelr 0.1.4 2019-02-18 [1] CRAN (R 3.5.1)
    modeltools 0.2-22 2018-07-16 [1] CRAN (R 3.5.1)
    multcomp 1.4-10 2019-03-05 [1] CRAN (R 3.5.3)
    multcompView 0.1-7 2015-07-31 [1] CRAN (R 3.5.0)
    munsell 0.5.0 2018-06-12 [1] CRAN (R 3.5.0)
    mvtnorm 1.0-10 2019-03-05 [1] CRAN (R 3.5.2)
    NetworkComparisonTest * 2.0.1 2016-10-29 [1] CRAN (R 3.5.0)
    NetworkToolbox 1.2.3 2019-01-31 [1] CRAN (R 3.5.2)
    networktools 1.2.0 2018-06-05 [1] CRAN (R 3.5.1)
    nlme 3.1-137 2018-04-07 [1] CRAN (R 3.5.0)
    nloptr 1.2.1 2018-10-03 [1] CRAN (R 3.5.1)
    nnet 7.3-12 2016-02-02 [2] CRAN (R 3.5.1)
    nnls 1.4 2012-03-19 [1] CRAN (R 3.5.0)
    nortest 1.0-4 2015-07-30 [1] CRAN (R 3.5.0)
    numDeriv 2016.8-1 2016-08-27 [1] CRAN (R 3.5.0)
    openxlsx 4.1.0 2018-05-26 [1] CRAN (R 3.5.0)
    pacman * 0.5.1 2019-03-11 [1] CRAN (R 3.5.3)
    paletteer 0.2.1 2019-02-13 [1] CRAN (R 3.5.2)
    pan 1.6 2018-06-29 [1] CRAN (R 3.5.0)
    pander 0.6.3 2018-11-06 [1] CRAN (R 3.5.1)
    papaja * 0.1.0.9842 2018-11-18 [1] Github (crsh/papaja@2e11aec)
    parcor 0.2-6 2014-09-04 [1] CRAN (R 3.5.0)
    patchwork * 0.0.1 2018-11-21 [1] Github (thomasp85/patchwork@fd7958b)
    pbapply 1.4-0 2019-02-05 [1] CRAN (R 3.5.2)
    pbivnorm 0.6.0 2015-01-23 [1] CRAN (R 3.5.0)
    pcaPP 1.9-73 2018-01-14 [1] CRAN (R 3.5.0)
    PerformanceAnalytics 1.5.2 2018-03-02 [1] CRAN (R 3.5.1)
    pillar 1.3.1 2018-12-15 [1] CRAN (R 3.5.1)
    pkgbuild 1.0.3 2019-03-20 [1] CRAN (R 3.5.3)
    pkgconfig 2.0.2 2018-08-16 [1] CRAN (R 3.5.1)
    pkgload 1.0.2 2018-10-29 [1] CRAN (R 3.5.1)
    plotrix 3.7-4 2018-10-03 [1] CRAN (R 3.5.1)
    plyr 1.8.4 2016-06-08 [1] CRAN (R 3.5.0)
    png 0.1-7 2013-12-03 [1] CRAN (R 3.5.0)
    polynom 1.4-0 2019-03-22 [1] CRAN (R 3.5.3)
    ppls 1.6-1.1 2018-07-20 [1] CRAN (R 3.5.1)
    prabclus 2.2-7 2019-01-17 [1] CRAN (R 3.5.2)
    prettyunits 1.0.2 2015-07-13 [1] CRAN (R 3.5.0)
    processx 3.3.0 2019-03-10 [1] CRAN (R 3.5.3)
    progress 1.2.0 2018-06-14 [1] CRAN (R 3.5.0)
    promises 1.0.1 2018-04-13 [1] CRAN (R 3.5.0)
    ps 1.3.0 2018-12-21 [1] CRAN (R 3.5.2)
    psych 1.8.12 2019-01-12 [1] CRAN (R 3.5.2)
    purrr * 0.3.2 2019-03-15 [1] CRAN (R 3.5.3)
    purrrlyr 0.0.5 2019-03-15 [1] CRAN (R 3.5.3)
    pwr 1.2-2 2018-03-03 [1] CRAN (R 3.5.0)
    qgraph 1.6.1 2019-02-13 [1] CRAN (R 3.5.1)
    quadprog 1.5-5 2013-04-17 [1] CRAN (R 3.5.0)
    R.methodsS3 1.7.1 2016-02-16 [1] CRAN (R 3.5.0)
    R.oo 1.22.0 2018-04-22 [1] CRAN (R 3.5.0)
    R.utils 2.8.0 2019-02-14 [1] CRAN (R 3.5.2)
    R6 2.4.0 2019-02-14 [1] CRAN (R 3.5.2)
    RColorBrewer 1.1-2 2014-12-07 [1] CRAN (R 3.5.0)
    rcompanion 2.1.1 2019-03-02 [1] CRAN (R 3.5.3)
    Rcpp * 1.0.1 2019-03-17 [1] CRAN (R 3.5.3)
    readr * 1.3.1 2018-12-21 [1] CRAN (R 3.5.2)
    readxl 1.3.1 2019-03-13 [1] CRAN (R 3.5.3)
    registry 0.5-1 2019-03-05 [1] CRAN (R 3.5.2)
    relaimpo 2.2-3 2018-03-10 [1] CRAN (R 3.5.0)
    remotes 2.0.2 2018-10-30 [1] CRAN (R 3.5.1)
    reshape 0.8.8 2018-10-23 [1] CRAN (R 3.5.1)
    reshape2 1.4.3 2017-12-11 [1] CRAN (R 3.5.0)
    rgexf 0.15.3 2015-03-24 [1] CRAN (R 3.5.0)
    rio 0.5.16 2018-11-26 [1] CRAN (R 3.5.1)
    rjson 0.2.20 2018-06-08 [1] CRAN (R 3.5.0)
    rlang 0.3.2 2019-03-21 [1] CRAN (R 3.5.3)
    rmarkdown 1.12 2019-03-14 [1] CRAN (R 3.5.3)
    robust 0.4-18 2017-04-27 [1] CRAN (R 3.5.1)
    robustbase 0.93-4 2019-03-19 [1] CRAN (R 3.5.3)
    Rook 1.1-1 2014-10-20 [1] CRAN (R 3.5.0)
    rpart 4.1-13 2018-02-23 [1] CRAN (R 3.5.0)
    rprojroot 1.3-2 2018-01-03 [1] CRAN (R 3.5.0)
    rrcov 1.4-7 2018-11-15 [1] CRAN (R 3.5.1)
    rsconnect 0.8.13 2019-01-10 [1] CRAN (R 3.5.2)
    rstan 2.18.2 2018-11-07 [1] CRAN (R 3.5.1)
    rstantools 1.5.1 2018-08-22 [1] CRAN (R 3.5.1)
    rstudioapi 0.10 2019-03-19 [1] CRAN (R 3.5.3)
    rvest 0.3.2 2016-06-17 [1] CRAN (R 3.5.0)
    sandwich 2.5-0 2018-08-17 [1] CRAN (R 3.5.1)
    scales 1.0.0 2018-08-09 [1] CRAN (R 3.5.1)
    SCRT 1.2.2 2018-03-07 [1] CRAN (R 3.5.0)
    seriation 1.2-3 2018-02-05 [1] CRAN (R 3.5.0)
    sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.5.1)
    shiny * 1.2.0 2018-11-02 [1] CRAN (R 3.5.1)
    shinyjs 1.0 2018-01-08 [1] CRAN (R 3.5.0)
    shinystan 2.5.0 2018-05-01 [1] CRAN (R 3.5.0)
    shinythemes 1.1.2 2018-11-06 [1] CRAN (R 3.5.1)
    sjlabelled 1.0.17 2019-03-10 [1] CRAN (R 3.5.3)
    sjmisc 2.7.9 2019-03-16 [1] CRAN (R 3.5.3)
    sjstats 0.17.4 2019-03-15 [1] CRAN (R 3.5.3)
    skimr 1.0.5 2019-02-25 [1] CRAN (R 3.5.3)
    sm 2.2-5.6 2018-09-27 [1] CRAN (R 3.5.1)
    smacof 1.10-8 2018-06-14 [1] CRAN (R 3.5.1)
    StanHeaders 2.18.1 2019-01-28 [1] CRAN (R 3.5.2)
    stringi 1.4.3 2019-03-12 [1] CRAN (R 3.5.3)
    stringr * 1.4.0 2019-02-10 [1] CRAN (R 3.5.2)
    SuppDists 1.1-9.4 2016-09-23 [1] CRAN (R 3.5.0)
    survey 3.35-1 2019-01-29 [1] CRAN (R 3.5.2)
    survival 2.43-3 2018-11-26 [1] CRAN (R 3.5.1)
    testthat 2.0.1 2018-10-13 [1] CRAN (R 3.5.1)
    TH.data 1.0-10 2019-01-21 [1] CRAN (R 3.5.2)
    threejs 0.3.1 2017-08-13 [1] CRAN (R 3.5.0)
    tibble * 2.1.1 2019-03-16 [1] CRAN (R 3.5.3)
    tidyr * 0.8.3 2019-03-01 [1] CRAN (R 3.5.3)
    tidyselect 0.2.5 2018-10-11 [1] CRAN (R 3.5.1)
    tidyverse * 1.2.1 2017-11-14 [1] CRAN (R 3.5.1)
    TMB 1.7.15 2018-11-09 [1] CRAN (R 3.5.1)
    trimcluster 0.1-2.1 2018-07-20 [1] CRAN (R 3.5.1)
    TSP 1.1-6 2018-04-30 [1] CRAN (R 3.5.0)
    ufs 0.2.0 2019-02-28 [1] gitlab (r-packages/ufs@13b4838)
    userfriendlyscience 0.7.2 2018-09-24 [1] CRAN (R 3.5.1)
    usethis 1.4.0 2018-08-14 [1] CRAN (R 3.5.1)
    viridis 0.5.1 2018-03-29 [1] CRAN (R 3.5.1)
    viridisLite 0.3.0 2018-02-01 [1] CRAN (R 3.5.0)
    visNetwork 2.0.6 2019-03-26 [1] CRAN (R 3.5.1)
    weights 1.0 2018-10-16 [1] CRAN (R 3.5.1)
    whisker 0.3-2 2013-04-28 [1] CRAN (R 3.5.0)
    withr 2.1.2 2018-03-15 [1] CRAN (R 3.5.0)
    wordcloud 2.6 2018-08-24 [1] CRAN (R 3.5.1)
    WRS2 0.10-0 2018-06-15 [1] CRAN (R 3.5.0)
    xfun 0.5 2019-02-20 [1] CRAN (R 3.5.1)
    XML 3.98-1.19 2019-03-06 [1] CRAN (R 3.5.2)
    xml2 1.2.0 2018-01-24 [1] CRAN (R 3.5.0)
    xtable 1.8-3 2018-08-29 [1] CRAN (R 3.5.1)
    xts 0.11-2 2018-11-05 [1] CRAN (R 3.5.1)
    yaml 2.2.0 2018-07-25 [1] CRAN (R 3.5.1)
    zip 2.0.1 2019-03-11 [1] CRAN (R 3.5.3)
    zoo 1.8-5 2019-03-21 [1] CRAN (R 3.5.3)

[1] C:/rlibs/3.4.2
[2] C:/Program Files/R/R-3.5.1/library

Sorting of citations

Reported by Karin Nilsson:

It seems like the addin automatically sorts them based on year because it always places the 2010-reference before the 2012-reference in the markdown file. However, when knitting the document it sorts in alphabetic order based on the name of the third author, which places the references in the reversed order.

@article{Danielsson2010,
abstract = {The aim of the present study was to investigate executive functions in adults with intellectual disability, and compare them to a closely matched control group longitudinally for 5 years. In the Betula database, a group of adults with intellectual disability (ID, n=46) was defined from measures of verbal and non-verbal IQ. A control group, with two people for every person with intellectual disability (n=92), was chosen by matching on the following criterion in order of priority: IQ higher than 85, age, sex, sample, level of education, and years of education. Three types of tasks of executive functions were included on two occasions, with 5 years between testing sessions: The Tower of Hanoi, executively loaded dual task versions of word recall, and verbal fluency. Adults with ID showed significant impairments on verbal fluency and on the executively loaded dual task word recall task (at encoding but not at recall). There were no group differences on the Tower of Hanoi. No significant differences between the two test occasions were found. The results are interpreted in terms of individuals with ID having problems with speed of accessing lexical items and difficulties with working memory-related executive control at encoding, which includes shifting between tasks. There are, however, not necessarily problems with inhibition. The dual task results additionally imply that the adults with intellectual disability were more sensitive to strategy interruptions at encoding, but that dividing attention at recall did not have such detrimental effects.},
author = {Danielsson, Henrik and Henry, Lucy A. and R{\"{o}}nnberg, Jerker and Nilsson, Lars-G{\"{o}}ran},
doi = {10.1016/j.ridd.2010.07.012},
isbn = {0891-4222},
issn = {08914222},
journal = {Research in Developmental Disabilities},
number = {6},
pages = {1299--1304},
pmid = {20728303},
title = {{Executive functions in individuals with intellectual disability}},
url = {http://linkinghub.elsevier.com/retrieve/pii/S089142221000168X},
volume = {31},
year = {2010}
}

@article{Danielsson2012,
abstract = {Children with intellectual disability (ID) were given a comprehensive range of executive functioning measures, which systematically varied in terms of verbal and non-verbal demands. Their performance was compared to the performance of groups matched on mental age (MA) and chronological age (CA), respectively. Twenty-two children were included in each group. Children with ID performed on par with the MA group on switching, verbal executive-loaded working memory and most fluency tasks, but below the MA group on inhibition, planning, and non-verbal executive-loaded working memory. Children with ID performed below CA comparisons on all the executive tasks. We suggest that children with ID have a specific profile of executive functioning, with MA appropriate abilities to generate new exemplars (fluency) and to switch attention between tasks, but difficulties with respect to inhibiting pre-potent responses, planning, and non-verbal executive-loaded working memory The development of different types of executive functioning skills may, to different degrees, be related to mental age and experience. {\textcopyright} 2011 Elsevier Ltd.},
author = {Danielsson, Henrik and Henry, Lucy A. and Messer, David and R{\"{o}}nnberg, Jerker},
doi = {10.1016/j.ridd.2011.11.004},
isbn = {0891-4222},
issn = {08914222},
journal = {Research in Developmental Disabilities},
keywords = {Executive functioning,Executive-loaded working memory,Fluency,Inhibition,Intellectual disability,Planning,Switching},
number = {2},
pages = {600--607},
pmid = {22155533},
title = {{Strengths and weaknesses in executive functioning in children with intellectual disability}},
volume = {33},
year = {2012}
}

Directly access Zotero via SQLite

I suspect that direct access to the Zotero database via SQLite will greatly improve the speed of the database connection and may enable access to group libraries (#9). It would also remove the dependency on BetterBib(La)Tex for the Zotero integration.

Error in finding path to .bib file

Hi,

I am using bookdown (0.12) for writing my thesis and I want to include the citations in an automated way using your package citr.

I have a file called references.bib which I exported from Mendeley and includes the citations. The index.Rmd file (which is on the /home/john/repos/my-phd-thesis dir) has in the yaml front mater the line: bibliography: references.bib. When I press the Rstudio addin button 'Insert Citations' I get this error:

> citr:::insert_citation()
Error in tools::file_path_as_absolute(file.path(rmd_path, yaml::yaml.load(yaml_front_matter)$bibliography)) : 
  file '/home/john/repos/my-phd-thesis/index.Rmd/references.bib' does not exist

Should be something on my part (config, etc.) or just a bug I don't know :) Let me know if you need something else from my part. The full code of the thesis is here

Better BibLaTeX has changed the localhost interface

With the latest release of Better BibLaTeX the interface to querying the library via localhost has changed. While the issue has been fixed citr needs a way to handle this issue for those who are using the current release version of the plugin.

doesnt work yet

Hi I love the idea that this package has, but I can't get it to work. The package
is installed and the shiny app is started when I click on it in rstudio.

However the app doesn't seem to open or recognize the bibtex file.

Inconsistent error when using citr with Zotero

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.

.bib-file(s) not found when full path specified in YAML header

Hi,
citr is not reading the .bib file when the full path is specified in the YAML header ("D:/TEST/citr_test/bib/library.bib").

image

I realized that it was working fine when I specified a relative path (e.g., bib/library.bib).

Any idea why I'm getting this behavior?

Thanks,
Kevin

Load database silently

Here's an idea related to #23 : instead of loading the database in the shiny app (which freezes the entire RStudio session) could you not make that part of it happen in silent, either in the current R session (with a loading bar?) before launching the app, or in a new process created by the future pkg or similar on the first time the link is made?

Error when trying to add citation from arXiv via Zotero

I'm attempting to insert a citation from my Zotero database that originally comes from arXiv. When I copy the raw bibtex from Zotero I get the following:

@article{tan2018a,
  archivePrefix = {arXiv},
  eprinttype = {arxiv},
  eprint = {1801.03147},
  primaryClass = {stat},
  title = {"{{Robust}}-Squared" {{Imputation Models Using BART}}},
  journal = {arXiv:1801.03147 [stat]},
  author = {Tan, Yaoyuan V. and Flannagan, Carol A. C. and Elliott, Michael R.},
  month = jan,
  year = {2018},
  keywords = {Statistics - Applications},
  file = {/Users/andrewmercer/Zotero/storage/EP3AHQZ6/Tan et al. - 2018 - Robust-squared Imputation Models Using BART.pdf;/Users/andrewmercer/Zotero/storage/I3ZV4QQ7/1801.html}
}

However, I get the following error in citr:

Writing 1 Bibtex entries ... Warning: Error in .BibEntryCheckBibEntry1: A bibentry of bibtype ‘Article’ has to specify the field: c("journaltitle", "journal")
Stack trace (innermost first):
    73: .BibEntryCheckBibEntry1
    72: $<-.BibEntry
    71: $<-
    70: toBiblatex
    69: writeLines
    68: RefManageR::WriteBib
    67: observeEventHandler
     3: shiny::runApp
     2: runGadget
     1: citr:::insert_citation
ERROR: [on_request_read] connection reset by peer

Clearly there is a journal field in the bibtex exported by Zotero. I assume this has something to do with the various eprint tags. Any idea what might be causing this or if there's a workaround?

Changing References Format

I do apologize for the introductory nature of this question. I installed that package once I saw its potential. I'm curious if anyone would know how to change the default reference format (shown below)

To another format such as IEEE. I prefer using something with numbers (similar to Wikipedia) when I'm writing because it takes up less space.

image

I'm using connected via Zotero.

Updating local bibliography file

It is often the case that bibliographic information needs updating because of typos, first names as initials rather then in full, etc. Currently bibliographic entries are added to the local .bib file when the reference is inserted in the text. It would be best to make such updates in Zotero (as a master source) and then update the relevant entry in the local .bib file.

Would it be feasible to have a function that looks at the local .bib file and "refreshes" the entries from Zotero?

Add support for pop-out windows

Currently I'm unable to use citr with Rmd documents in pop-out windows with RStudio 1.1.342. I don't know if there is a way to address this, but I just thought I would bring it to your attention.

Besides that, citr is really helpful for my workflow. Thanks!

group library errors

Thanks for 6730d5a! I really appreciate the fast implementation of this feature. Unfortunately I get errors when I try to load group libraries. Interesting enough there's a different error for each of the three group libraries I'm currently using. Nevertheless I decided to only create one issue here: I guess they are somehow related.

Edit: I just realized that the errors appear interchangeably. They are not database specific.

Library A: 9061 items

Listening on http://127.0.0.1:6537
Warning: Error in do_read_bib: lex fatal error:
input buffer overflow, can't enlarge buffer because scanner uses REJECT

Stack trace (innermost first):
    105: do_read_bib
    104: RefManageR::ReadBib
    103: import_bbt_piecewise
    102: load_betterbiblatex_bib
    101: eval
    100: eval
     99: shiny::withProgress
     98: <reactive>
     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: lex fatal error:
input buffer overflow, can't enlarge buffer because scanner uses REJECT

Stack trace (innermost first):
    61: <Anonymous>
    60: stop
    59: bibliography
    58: observerFunc
     3: shiny::runApp
     2: runGadget
     1: citr:::insert_citation
Warning: Error in do_read_bib: lex fatal error:
input buffer overflow, can't enlarge buffer because scanner uses REJECT

Stack trace (innermost first):
    91: <Anonymous>
    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

Library B: 10967 items

Listening on http://127.0.0.1:6537
Warning: Error in do_read_bib: lex fatal error:
fatal flex scanner internal error--end of buffer missed

Stack trace (innermost first):
    105: do_read_bib
    104: RefManageR::ReadBib
    103: import_bbt_piecewise
    102: load_betterbiblatex_bib
    101: eval
    100: eval
     99: shiny::withProgress
     98: <reactive>
     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: lex fatal error:
fatal flex scanner internal error--end of buffer missed

Stack trace (innermost first):
    61: <Anonymous>
    60: stop
    59: bibliography
    58: observerFunc
     3: shiny::runApp
     2: runGadget
     1: citr:::insert_citation
Warning: Error in do_read_bib: lex fatal error:
fatal flex scanner internal error--end of buffer missed

Stack trace (innermost first):
    91: <Anonymous>
    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

Library C: 19 items

Listening on http://127.0.0.1:6537
<simpleError in do_read_bib(file, encoding = .Encoding, srcfile): lex fatal error:
fatal flex scanner internal error--end of buffer missed
>
Warning: Error in if: argument is of length zero
Stack trace (innermost first):
    67: observeEventHandler
     3: shiny::runApp
     2: runGadget
     1: citr:::insert_citation

devtools::session_info()

setting  value                       
 version  R version 3.4.3 (2017-11-30)
 system   x86_64, linux-gnu           
 ui       RStudio (1.1.379)           
 language (EN)                        
 collate  en_US.utf8                  
 tz       Europe/Berlin               
 date     2018-01-09                  

Packages ------------------------------------------------------------------------------------------------------------------
 package    * version    date       source                            
 assertthat   0.2.0      2017-04-11 CRAN (R 3.4.0)                    
 backports    1.1.2      2017-12-13 CRAN (R 3.4.3)                    
 base       * 3.4.3      2017-11-30 local                             
 bibtex       0.4.2      2017-06-30 CRAN (R 3.4.1)                    
 bookdown     0.5.10     2017-12-03 Github (rstudio/bookdown@d78c661) 
 citr         0.2.0.9055 2018-01-06 Github (crsh/citr@6730d5a)        
 compiler     3.4.3      2017-11-30 local                             
 curl         3.1        2017-12-12 cran (@3.1)                       
 datasets   * 3.4.3      2017-11-30 local                             
 devtools     1.13.4     2017-11-09 CRAN (R 3.4.2)                    
 digest       0.6.13     2017-12-14 CRAN (R 3.4.3)                    
 evaluate     0.10.1     2017-06-24 CRAN (R 3.4.0)                    
 graphics   * 3.4.3      2017-11-30 local                             
 grDevices  * 3.4.3      2017-11-30 local                             
 htmltools    0.3.6      2017-04-28 CRAN (R 3.4.0)                    
 httpuv       1.3.5      2017-07-04 CRAN (R 3.4.1)                    
 httr         1.3.1      2017-08-20 cran (@1.3.1)                     
 jsonlite     1.5        2017-06-01 CRAN (R 3.4.0)                    
 knitr        1.18       2017-12-27 CRAN (R 3.4.3)                    
 lubridate    1.7.1      2017-11-03 CRAN (R 3.4.2)                    
 magrittr     1.5        2014-11-22 CRAN (R 3.4.3)                    
 memoise      1.1.0      2017-04-21 CRAN (R 3.4.2)                    
 methods    * 3.4.3      2017-11-30 local                             
 mime         0.5        2016-07-07 CRAN (R 3.4.0)                    
 miniUI       0.1.1      2016-01-15 CRAN (R 3.4.0)                    
 plyr         1.8.4      2016-06-08 CRAN (R 3.4.2)                    
 R6           2.2.2      2017-06-17 CRAN (R 3.4.0)                    
 Rcpp         0.12.14    2017-11-23 cran (@0.12.14)                   
 RefManageR   0.14.20    2017-08-17 CRAN (R 3.4.2)                    
 rmarkdown    1.8.3      2017-12-03 Github (rstudio/rmarkdown@07f7d8e)
 rprojroot    1.3-2      2018-01-03 CRAN (R 3.4.3)                    
 rstudioapi   0.7        2017-09-07 CRAN (R 3.4.2)                    
 shiny      * 1.0.5      2017-08-23 CRAN (R 3.4.2)                    
 stats      * 3.4.3      2017-11-30 local                             
 stringi      1.1.6      2017-11-17 CRAN (R 3.4.2)                    
 stringr      1.2.0      2017-02-18 CRAN (R 3.4.0)                    
 tools        3.4.3      2017-11-30 local                             
 utils      * 3.4.3      2017-11-30 local                             
 withr        2.1.1      2017-12-19 CRAN (R 3.4.3)                    
 xml2         1.1.1      2017-01-24 CRAN (R 3.4.0)                    
 xtable       1.8-2      2016-02-05 CRAN (R 3.4.1)                    
 yaml         2.1.16     2017-12-12 cran (@2.1.16)

Handling missing fields in bibtex

Currently, citr ignores bibtex entries that are missing certain fields when it loads the library in memory (e.g. if year is missing from a journal article). Citation management programs such as Mendeley or Zotero allow for missing fields. Bibtex itself will allow missing fields and simply omit them from the final rendered citation. Would it be possible to allow citr to allow missing fields, either by ignoring them or converting them to "missing" or an empty string?

citr error

citr:::insert_citation()
Error in Encoding<-(*tmp*, value = "UTF-8") :
a character vector argument expected

sessionInfo()
R version 3.2.3 (2015-12-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Linux Mint 18.2

locale:
[1] LC_CTYPE=en_IN.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_IN.UTF-8 LC_COLLATE=en_IN.UTF-8
[5] LC_MONETARY=en_IN.UTF-8 LC_MESSAGES=en_IN.UTF-8
[7] LC_PAPER=en_IN.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_IN.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached):
[1] shiny_1.0.5 R6_2.2.2 assertthat_0.2.0 htmltools_0.3.6
[5] tools_3.2.3 rstudioapi_0.7 yaml_2.1.14 Rcpp_0.12.12
[9] digest_0.6.12 citr_0.2.0 xtable_1.8-2 httpuv_1.3.5
[13] mime_0.5 miniUI_0.1.1

The name list field author cannot be parsed

was caused by the following bibtex entry:

@Article{10.1371/journal.pone.0109458,
author = {Liu, Yang-Yu AND Nacher, Jose C. AND Ochiai, Tomoshiro AND Martino, Mauro AND Altshuler, Yaniv},
journal = {PLOS ONE},
publisher = {Public Library of Science},
title = {Prospect Theory for Online Financial Trading},
year = {2014},
month = {10},
volume = {9},
url = {https://doi.org/10.1371/journal.pone.0109458},
pages = {1-7},
abstract = {Prospect theory is widely viewed as the best available descriptive model of how people evaluate risk in experimental settings. According to prospect theory, people are typically risk-averse with respect to gains and risk-seeking with respect to losses, known as the “reflection effect”. People are much more sensitive to losses than to gains of the same magnitude, a phenomenon called “loss aversion”. Despite of the fact that prospect theory has been well developed in behavioral economics at the theoretical level, there exist very few large-scale empirical studies and most of the previous studies have been undertaken with micro-panel data. Here we analyze over 28.5 million trades made by 81.3 thousand traders of an online financial trading community over 28 months, aiming to explore the large-scale empirical aspect of prospect theory. By analyzing and comparing the behavior of winning and losing trades and traders, we find clear evidence of the reflection effect and the loss aversion phenomenon, which are essential in prospect theory. This work hence demonstrates an unprecedented large-scale empirical evidence of prospect theory, which has immediate implication in financial trading, e.g., developing new trading strategies by minimizing the impact of the reflection effect and the loss aversion phenomenon. Moreover, we introduce three novel behavioral metrics to differentiate winning and losing traders based on their historical trading behavior. This offers us potential opportunities to augment online social trading where traders are allowed to watch and follow the trading activities of others, by predicting potential winners based on their historical trading behavior.},
number = {10},
doi = {10.1371/journal.pone.0109458}
}

insert_citation_cli()

When using citr in an environment that does not support shiny, it's hard to insert citations. I think a command line interface version of the excellent insert_citation() function would be possible and useful.

Describe the solution you'd like

A function for inserting citations that does not rely on shiny.

Describe alternatives you've considered

Currently I open the bib file(s) or Zotero and copy paste. There must be a better way!

Only first insertion works, then `Warning: Error in file.exists: invalid 'file' argument`

The first time I call citr to insert a citation in a session everything works perfectly fine. The second and all following times though it fails with the following error message:

> citr:::insert_citation()

Listening on http://127.0.0.1:4802
Warning: Error in file.exists: invalid 'file' argument
  95: file.exists
  91: <reactive>
  75: new_entries
  74: observeEventHandler
   3: shiny::runApp
   2: runGadget
   1: citr:::insert_citation

I have to reload the libraries before I can use it again. And even that often doesn't work. I have to restart RStudio then.

> sessioninfo::session_info()
─ Session info ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 setting  value                       
 version  R version 3.5.1 (2018-07-02)
 os       Manjaro Linux               
 system   x86_64, linux-gnu           
 ui       RStudio                     
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       Europe/Berlin               
 date     2018-11-30                  

─ Packages ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 package     * version    date       lib source                    
 assertthat    0.2.0      2017-04-11 [1] CRAN (R 3.5.1)            
 bibtex        0.4.2      2017-06-30 [1] CRAN (R 3.5.1)            
 citr          0.2.0.9055 2018-11-16 [1] Github (crsh/citr@68298af)
 cli           1.0.1      2018-09-25 [1] CRAN (R 3.5.1)            
 crayon        1.3.4      2017-09-16 [1] CRAN (R 3.5.1)            
 curl          3.2        2018-03-28 [1] CRAN (R 3.5.1)            
 digest        0.6.18     2018-10-10 [1] CRAN (R 3.5.1)            
 htmltools     0.3.6      2017-04-28 [1] CRAN (R 3.5.1)            
 httpuv        1.4.5      2018-07-19 [1] CRAN (R 3.5.1)            
 httr          1.3.1      2017-08-20 [1] CRAN (R 3.5.1)            
 jsonlite      1.5        2017-06-01 [1] CRAN (R 3.5.1)            
 later         0.7.5      2018-09-18 [1] CRAN (R 3.5.1)            
 lubridate     1.7.4      2018-04-11 [1] CRAN (R 3.5.1)            
 magrittr      1.5        2014-11-22 [1] CRAN (R 3.5.1)            
 mime          0.6        2018-10-05 [1] CRAN (R 3.5.1)            
 miniUI        0.1.1.1    2018-05-18 [1] CRAN (R 3.5.1)            
 plyr          1.8.4      2016-06-08 [1] CRAN (R 3.5.1)            
 promises      1.0.1      2018-04-13 [1] CRAN (R 3.5.1)            
 R6            2.3.0      2018-10-04 [1] CRAN (R 3.5.1)            
 Rcpp          1.0.0      2018-11-07 [1] CRAN (R 3.5.1)            
 RefManageR    1.2.0      2018-04-25 [1] CRAN (R 3.5.1)            
 rlang         0.3.0.1    2018-10-25 [1] CRAN (R 3.5.1)            
 rstudioapi    0.8        2018-10-02 [1] CRAN (R 3.5.1)            
 sessioninfo   1.1.1      2018-11-05 [1] CRAN (R 3.5.1)            
 shiny       * 1.2.0      2018-11-02 [1] CRAN (R 3.5.1)            
 shinyjs       1.0        2018-01-08 [1] CRAN (R 3.5.1)            
 stringi       1.2.4      2018-07-20 [1] CRAN (R 3.5.1)            
 stringr       1.3.1      2018-05-10 [1] CRAN (R 3.5.1)            
 withr         2.1.2      2018-03-15 [1] CRAN (R 3.5.1)            
 xml2          1.2.0      2018-01-24 [1] CRAN (R 3.5.1)            
 xtable        1.8-3      2018-08-29 [1] CRAN (R 3.5.1)            
 yaml          2.2.0      2018-07-25 [1] CRAN (R 3.5.1)            

[1] /home/clemens/R/x86_64-pc-linux-gnu-library/3.5
[2] /usr/lib/R/library

feature request: use existing citekey when it exists

Thanks for the great addin!
it would be even greater if it could use the existing citekey when it exists; the current one is difficult to read in my manuscript…
Alternatively, is there an option than can be used to define the citekey template?

`citr` not updating `references.bib` in subdirectory

I am using citr to generate bibliography for my citations but my references.bib is neither getting regenerated (if I delete the existing copy) nor is it getting updated with the new citations I add.

This is the yaml for my RMarkdown:

---
title: "xyz"
author: x, y, z
date: "`r Sys.Date()`"
output: 
  html_document:
    toc: true
  pdf_document:
    toc: true
    keep_tex: true
    keep_md: true
  latex_engine: xelatex
header-includes: 
  - \usepackage{amsmath}
  - \usepackage{amssymb}
  - \usepackage{longtable}
  - \usepackage{booktabs}
  - \usepackage{amsfonts}
  - \usepackage{hyperref}
  - \usepackage{booktabs}
  - \usepackage[dvipsnames]{xcolor}
  - \usepackage{fontawesome}
bibliography: references.bib
csl: apa.csl
---

If it makes any difference, this is the citr settings I have:

image

The entire folder where the paper is located can be found here for more info, if needed:
https://github.com/IndrajeetPatil/ggstatsplot/tree/paper_draft_wip/paper

A bit slow when adding refs from a moderate (2k) bib file

As shown below, it's not when firing-up the reference to choose from, but after 'Insert citation' has been clicked. Hoping this will help assess ideas to speed-it-up because citr is a really fantastic add-on that provides the missing piece in the jigsaw to provide the ultimate reproducible research environment.

Citr not parsing author surnames containing several words

I'm working on a document that I worked on a few weeks ago and am getting errors that I didn't get a few weeks back (i.e. before the update to R 3.5.1.) I am using citr with zotero and the better bibtex plugin. When citr loads my library direct from zotero it fails to parse any reference that has an author surname containing more than one word. For example, I get a string or errors like this in the console:

Ignoring entry ‘de_lijster_age_2017’ (line944) because: 
	The name list field author cannot be parsed

Ignoring entry ‘dagani_meta-analysis_2017’ (line962) because: 
	The name list field author cannot be parsed

The citations all have in common that the surname is made up of several words. For example, for these two the corresponding zotero export is:

@article{de_lijster_age_2017,
  title = {The Age of Onset of Anxiety Disorders},
  volume = {62},
  issn = {0706-7437},
  doi = {10.1177/0706743716640757},
  number = {4},
  journal = {Canadian Journal of Psychiatry. Revue Canadienne de Psychiatrie},
  author = {{de Lijster}, Jasmijn M. and Dierckx, Bram and Utens, Elisabeth M.W.J. and Verhulst, Frank C. and Zieldorff, Carola and Dieleman, Gwen C. and Legerstee, Jeroen S.},
  year = {2017},
  pages = {237-246},
  file = {/Volumes/Alpha Lacertae/Documents/Academic/Library/zotero/storage/LIDTTYVM/de Lijster et al. - 2017 - The Age of Onset of Anxiety Disorders.pdf},
  pmid = {27310233},
  pmcid = {PMC5407545}
}

@article{dagani_meta-analysis_2017,
  title = {Meta-Analysis of the {{Interval}} between the {{Onset}} and {{Management}} of {{Bipolar Disorder}}},
  volume = {62},
  issn = {0706-7437},
  doi = {10.1177/0706743716656607},
  number = {4},
  journal = {Canadian Journal of Psychiatry. Revue Canadienne de Psychiatrie},
  author = {Dagani, Jessica and Signorini, Giulia and Nielssen, Olav and Bani, Moira and Pastore, Adriana and {de Girolamo}, Giovanni and Large, Matthew},
  year = {2017},
  pages = {247-258},
  file = {/Volumes/Alpha Lacertae/Documents/Academic/Library/zotero/storage/NL8Y8BTG/Dagani et al. - 2017 - Meta-analysis of the Interval between the Onset an.pdf},
  pmid = {27462036},
  pmcid = {PMC5407546}
}

So the first contains {de Lijster} as surname and the second {de Girolamo}.

If I save the above zotero export as a .bib file (see test.txt), reference it in the YAML header, fire up citr and disconnect it from zotero then citr reads the file perfectly. This suggests to me that the issue is to do with the way citr communicates with zotero and gets it to export so that it can load the database. I have literally no idea how that works though so I don't know whether this is a zotero issue, a BetterBibtex issue or a Citr issue. Any ideas of how to fix it or who I should be directing this at?

thanks
andy

> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] shiny_1.1.0

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.17     rstudioapi_0.7   xml2_1.2.0       magrittr_1.5     MASS_7.3-50      gmodels_2.18.1   xtable_1.8-2    
 [8] R6_2.2.2         rlang_0.2.1      bibtex_0.4.2     stringr_1.3.1    httr_1.3.1       plyr_1.8.4       tools_3.5.1     
[15] miniUI_0.1.1.1   gtools_3.8.1     htmltools_0.3.6  yaml_2.1.19      assertthat_0.2.0 digest_0.6.15    RefManageR_1.2.0
[22] later_0.7.3      promises_1.0.1   curl_3.2         mime_0.5         gdata_2.18.0     stringi_1.2.3    compiler_3.5.1  
[29] citr_0.2.0       forcats_0.3.0    jsonlite_1.5     lubridate_1.7.4  httpuv_1.4.4.2  

tidy_bib_file does not find references

I noticed this issue a while back but thought it may have been a quirk with the particular .Rmd file I was using. However, I've reproduced the error message on many files since.

Please test the reproducible example below and see if you can reproduce the error:

# aim: test tidy_bib 

# install dev version
devtools::install_github("crsh/citr")
#> Skipping install of 'citr' from a github remote, the SHA1 (ecdb245b) has not changed since last install.
#>   Use `force = TRUE` to force installation

# download an Rmd file that contains references
download.file("https://github.com/ITSLeeds/stats19/raw/master/README.Rmd", "test.Rmd")

# download a bibliography
download.file("https://github.com/ITSLeeds/stats19/raw/master/vignettes/references.bib", "references.bib")

# clean the 'messy' bibliography
citr::tidy_bib_file(rmd_file = "test.Rmd", messy_bibliography = "references.bib")
#> Error in citr::tidy_bib_file(rmd_file = "test.Rmd", messy_bibliography = "references.bib"): Found no references in test.Rmd

Created on 2019-02-06 by the reprex package (v0.2.1)

Session info
devtools::session_info()
#> ─ Session info ──────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 3.5.1 (2018-07-02)
#>  os       Debian GNU/Linux 9 (stretch)
#>  system   x86_64, linux-gnu           
#>  ui       X11                         
#>  language (EN)                        
#>  collate  en_US.UTF-8                 
#>  ctype    en_US.UTF-8                 
#>  tz       Etc/UTC                     
#>  date     2019-02-06                  
#> 
#> ─ Packages ──────────────────────────────────────────────────────────────
#>  package     * version date       lib source                    
#>  assertthat    0.2.0   2017-04-11 [1] CRAN (R 3.5.1)            
#>  backports     1.1.2   2017-12-13 [1] CRAN (R 3.5.1)            
#>  base64enc     0.1-3   2015-07-28 [1] CRAN (R 3.5.1)            
#>  callr         3.0.0   2018-08-24 [1] CRAN (R 3.5.1)            
#>  citr          0.3.0   2019-02-06 [1] Github (crsh/citr@ecdb245)
#>  cli           1.0.1   2018-09-25 [1] CRAN (R 3.5.1)            
#>  crayon        1.3.4   2017-09-16 [1] CRAN (R 3.5.1)            
#>  curl          3.2     2018-03-28 [1] CRAN (R 3.5.1)            
#>  desc          1.2.0   2018-05-01 [1] CRAN (R 3.5.1)            
#>  devtools      2.0.1   2018-10-26 [1] CRAN (R 3.5.1)            
#>  digest        0.6.18  2018-10-10 [1] CRAN (R 3.5.1)            
#>  evaluate      0.12    2018-10-09 [1] CRAN (R 3.5.1)            
#>  fs            1.2.6   2018-08-23 [1] CRAN (R 3.5.1)            
#>  glue          1.3.0   2018-07-17 [1] CRAN (R 3.5.1)            
#>  htmltools     0.3.6   2017-04-28 [1] CRAN (R 3.5.1)            
#>  httpuv        1.4.5   2018-07-19 [1] CRAN (R 3.5.1)            
#>  knitr         1.20    2018-02-20 [1] CRAN (R 3.5.1)            
#>  later         0.7.5   2018-09-18 [1] CRAN (R 3.5.1)            
#>  magrittr      1.5     2014-11-22 [1] CRAN (R 3.5.1)            
#>  memoise       1.1.0   2017-04-21 [1] CRAN (R 3.5.1)            
#>  mime          0.6     2018-10-05 [1] CRAN (R 3.5.1)            
#>  miniUI        0.1.1.1 2018-05-18 [1] CRAN (R 3.5.1)            
#>  pkgbuild      1.0.2   2018-10-16 [1] CRAN (R 3.5.1)            
#>  pkgload       1.0.2   2018-10-29 [1] CRAN (R 3.5.1)            
#>  prettyunits   1.0.2   2015-07-13 [1] CRAN (R 3.5.1)            
#>  processx      3.2.1   2018-12-05 [1] CRAN (R 3.5.1)            
#>  promises      1.0.1   2018-04-13 [1] CRAN (R 3.5.1)            
#>  ps            1.2.1   2018-11-06 [1] CRAN (R 3.5.1)            
#>  R6            2.3.0   2018-10-04 [1] CRAN (R 3.5.1)            
#>  Rcpp          1.0.0   2018-11-07 [1] CRAN (R 3.5.1)            
#>  remotes       2.0.2   2018-10-30 [1] CRAN (R 3.5.1)            
#>  rlang         0.3.0.1 2018-10-25 [1] CRAN (R 3.5.1)            
#>  rmarkdown     1.10    2018-06-11 [1] CRAN (R 3.5.1)            
#>  rprojroot     1.3-2   2018-01-03 [1] CRAN (R 3.5.1)            
#>  sessioninfo   1.1.1   2018-11-05 [1] CRAN (R 3.5.1)            
#>  shiny         1.2.0   2018-11-02 [1] CRAN (R 3.5.1)            
#>  stringi       1.2.4   2018-07-20 [1] CRAN (R 3.5.1)            
#>  stringr       1.3.1   2018-05-10 [1] CRAN (R 3.5.1)            
#>  testthat      2.0.1   2018-10-13 [1] CRAN (R 3.5.1)            
#>  usethis       1.4.0   2018-08-14 [1] CRAN (R 3.5.1)            
#>  withr         2.1.2   2018-03-15 [1] CRAN (R 3.5.1)            
#>  xtable        1.8-3   2018-08-29 [1] CRAN (R 3.5.1)            
#>  yaml          2.2.0   2018-07-25 [1] CRAN (R 3.5.1)            
#> 
#> [1] /usr/local/lib/R/site-library
#> [2] /usr/local/lib/R/library

Focus

First, thanks for making this add-in available!
Feature request:
When you hit the shortcut you will always want to have the focus on "Search terms".
This is however not the default behaviour, you will have to click on the search box first.
That is unnecessary and is costing a lot of time in the course of writing an article or thesis.
So it would be great if the focus would be on the search box when hitting the shortcut key.

I cannot use citr addins for chinese citation

some citations like this, but I cannot use citr addins for corrputed character.

@article{Chung201901,
   author = {Chung, C. Y. and Kim, D. and Kim, K. S. and Lee, J. H. and Lee, K.},
   title = {Do Institutional Investors Enhance Accounting Earnings Attributes in the Korean Market?},
   journal = {Emerging Markets Finance and Trade},
   volume = {55},
   number = {1},
   pages = {39-58},
   ISSN = {1540-496X},
   DOI = {10.1080/1540496x.2018.1503081},
   url = {<Go to ISI>://WOS:000446108700004},
   year = {2019},
   type = {Journal Article}
}

@article{LiXL201809,
   author = {李小林 and 叶德珠 and 张子健},
   title = {CEO财务经历能否降低公司权益资本成本?},
   journal = {外国经济与管理},
   volume = {40},
   number = {09},
   pages = {96-111},
   ISSN = {1001-4950},
   year = {2018},
   type = {Journal Article}
}

The result like this:
default

I look forward to your reply. Thanks.

RStudio Server - Unsupported?

I use RStudio Server rather than RStudio Desktop. I'm struggling to get citr to work properly

To Reproduce

Install citr (0.3.0 from Cran or Dev from GitHub) on RStudio Server
Create .Rmd file with

---
title: "Title"
output: word_document
bibliography: reference.bib
---

Export a bib file and save it to reference.bib
Save the .Rmd File

Expected behavior

citr:::insert_citation()

Popup box appears. Should be able to select from list a reference.
But no references appear to select...

         falling back to manual path specification.

Listening on http://127.0.0.1:5352

Using:

citr:::insert_citation(bib_file = "reference.bib")

has same result

If the add-in is clicked directly with the Rmd file in context the message about Rmarkdown not being saved is not shown. Listening is still shown.
No references shown in popup.

If I enter:

md_cite("authorname 2017", bib_file = "reference.bib")
Authorname, Firstanme (2017). Article Name. Journal Name 

[1] "[@authornamefirstnameArticleName2017]"

So it seems the bib file is accessible - but the pop-up window doesn't seem to be able to access it.

The server does have Zotero Standalone installed - doesn't seem to matter if it is running or not to get the pop-up box to work. With Zotero not running:

> load_betterbiblatex_bib()
Error in curl::curl_fetch_memory(url, handle = handle) : 
  Failed to connect to localhost port 23119: Connection refused

With Zotero running:

> load_betterbiblatex_bib()
Importing 'My Library'...
Error in import_bbt(bib, betterbibtex_url_i, encoding) : 
  argument "encoding" is missing, with no default
load_betterbiblatex_bib(encoding = "UTF-8")
Importing 'My Library'...
Ignoring entry ‘zaveryburhanCouldLogarithmicDosing2011’ (line2) because: 
	The name list field author cannot be parsed

Importing 'DoseBanding'...
Error in .BibEntryCheckBibEntry1(x[[i]]) : 
  zotero-102: A bibentry of bibtype ‘Article’ has to specify the fields: author, title, c("journaltitle", "journal"), c("year", "date")

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.