Skip to content
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

cr_cn: behave better when bibentry not valid #147

Closed
sckott opened this issue Nov 16, 2017 · 7 comments
Closed

cr_cn: behave better when bibentry not valid #147

sckott opened this issue Nov 16, 2017 · 7 comments
Milestone

Comments

@sckott
Copy link
Contributor

sckott commented Nov 16, 2017

via https://twitter.com/SVissault/status/931183793909780481

probably catch warning on invalid bibentry, but still return the object (and print warning)

@sckott
Copy link
Contributor Author

sckott commented Nov 16, 2017

hmm, tryCatch isn't really working - maybe because the read.bib fxn internally is using tryCatch? https://github.com/romainfrancois/bibtex/blob/master/R/bibtex.R#L258-L268

looks like do_read_bib would work, but not sure if that's meant for same purpose, though it is exported. e.g.,

tmpscratch.txt

bibtex::do_read_bib("tmpscratch.txt", srcfile = srcfile("tmpscratch.txt"))

cc @SteveViss

@sckott
Copy link
Contributor Author

sckott commented Nov 23, 2017

@SteveViss do you think that solution is a good one above?

@SteveViss
Copy link
Member

SteveViss commented Nov 23, 2017

@sckott, this is a solution. do_read_bib is more permissive and allows to read unvalid entries. Work for me. Thanks ! @beausoleilmo this related to your question you ask few weeks ago.

@sckott
Copy link
Contributor Author

sckott commented Nov 25, 2017

thanks @SteveViss will make change and see how it works

@beausoleilmo
Copy link

The question is more how to make a bib format for rcrossref::cr_cn("10.1038/46731",format="bibentry"). Or maybe I don't understand what you mean. it seems you resolved this by doing rcrossref::cr_cn("10.1038/46731",format="bibtex") and running bibtex::do_read_bib("tmpscratch.txt", srcfile = srcfile("tmpscratch.txt")). Right?

@sckott
Copy link
Contributor Author

sckott commented Nov 28, 2017

the problem is that if you request format="bibentry" you can sometimes get malformed bib data and then the bibtex package fails to parse it, so we're trying to get around that

@sckott sckott closed this as completed in 465b2f6 Jan 18, 2018
@sckott
Copy link
Contributor Author

sckott commented Jan 18, 2018

sorry for long wait on this @SteveViss @beausoleilmo

can you reinstall devtools::install_github("ropensci/rcrossref") and try bibtex egs again

@sckott sckott added this to the v0.9 milestone Jan 18, 2018
@sckott sckott modified the milestones: v0.9, v0.8.4 Feb 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants