-
Notifications
You must be signed in to change notification settings - Fork 46
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
tidy_bib_file does not find references #48
Comments
Thanks for the excellent reproducible example. This should now be fixed. Let me know if you find other examples where it doesn't work as expected. |
Confirmed: it now works again. Great work! devtools::install_github("crsh/citr")
#> Skipping install of 'citr' from a github remote, the SHA1 (aab8006e) has not changed since last install.
#> Use `force = TRUE` to force installation
download.file("https://github.com/ITSLeeds/stats19/raw/master/README.Rmd", "test.Rmd")
download.file("https://github.com/ITSLeeds/stats19/raw/master/vignettes/references.bib", "references.bib")
citr::tidy_bib_file(rmd_file = "test.Rmd", messy_bibliography = "references.bib")
#> Warning in do_read_bib(file, encoding = .Encoding, srcfile): encoding
#> 'native.enc' will be ignored
#> Removing 4 unneeded bibliography entries.
#> Writing 2 Bibtex entries ... OK
#> Results written to file 'references.bib' Created on 2019-02-06 by the reprex package (v0.2.1) |
Heads-up @crsh, sorry, but I've just found another edge case. Please try this: devtools::install_github("crsh/citr")
#> Skipping install of 'citr' from a github remote, the SHA1 (aab8006e) has not changed since last install.
#> Use `force = TRUE` to force installation
download.file("https://github.com/ITSLeeds/TDS/blob/master/slides/2-software.Rmd", "test.Rmd")
download.file("https://github.com/ITSLeeds/stats19/raw/master/vignettes/references.bib", "references.bib")
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) Note: if I move the reference from line 105 to line 30, for example, it no longer claims there are no references in there. Please try to reproduce and let me know. Thanks! |
Thanks, I'll take a look. |
Great. I realised the file was changing. Have re-added a reference that is not found - the test should work now. Thanks! |
This was due to overly aggressive sanitizing of the R Markdown file. I had not come across this issue because I hadn't tried it on |
Great fixes. They teach me lots about regex! |
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:
Created on 2019-02-06 by the reprex package (v0.2.1)
Session info
The text was updated successfully, but these errors were encountered: