Giter VIP home page Giter VIP logo

Comments (20)

RMHogervorst avatar RMHogervorst commented on September 23, 2024 1

Yes this is nicer way to work with the references.

However If i use my complete library (because I could) with 2207 references there seems to be an error like in the ohter refmanager:

Warning in RefManageR::ReadBib(file) :

totallibrary.bib:4952:0
    syntax error, unexpected TOKEN_LITERAL, expecting TOKEN_COMMA
    Dropping the entry `na` (starting at line 4952) 
Warning in `reactive reactive({\n    if (!yaml_found || is.null(yaml_bib_file)) {\n        options(bibliography_path = input$bib_file)\n        tryCatch(RefManageR::ReadBib(file = input$bib_file), \n            error = function(e) NULL)\n    }\n    else if (yaml_found & !is.null(yaml_bib_file)) {\n        if (length(yaml_bib_file) == 1) {\n            tryCatch(RefManageR::ReadBib(file = yaml_bib_file), \n                error = function(e) NULL)\n        }\n        else {\n            bibs <- lapply(yaml_bib_file, function(file) tryCatch(RefManageR::ReadBib(file), \n                error = function(e) NULL))\n            not_found <- sapply(bibs, is.null)\n            if (any(not_found)) \n                warning("Unable to read bibliography file(s) ", \n                  paste(paste0("'", yaml_bib_file[not_found], \n                    "'"), collapse = ", "))\n            do.call(c, bibs[!not_found])\n        }\n    }\n})`(...) :
  Unable to read bibliography file(s) 'totallibrary.bib'

From line 4952:

@article{na;_abstracts_2014,
  title = {Abstracts from the 2014 {{Annual Scientific Meeting}} of the {{American Psychosomatic Society}} are available online only with this issue at www.psychosomaticmedicine.org.:},
  volume = {76},
  issn = {0033-3174},
  shorttitle = {Abstracts from the 2014 {{Annual Scientific Meeting}} of the {{American Psychosomatic Society}} are available online only with this issue at www.psychosomaticmedicine.org.},
  doi = {10.1097/PSY.0000000000000057},
  language = {en},
  timestamp = {2014-12-19T08:38:45Z},
  number = {3},
  urldate = {2014-12-19},
  journal = {Psychosomatic Medicine},
  author = {{\&Na;}},
  month = apr,
  year = {2014},
  pages = {1},
  file = {&Na\; - 2014 - Abstracts from the 2014 Annual Scientific Meeting .pdf:C\:\\Users\\roel\\AppData\\Roaming\\Zotero\\Zotero\\Profiles\\aw40nx7l.default\\zotero\\storage\\DPPDSW4J\\&Na\; - 2014 - Abstracts from the 2014 Annual Scientific Meeting .pdf:application/pdf}
}

from citr.

RMHogervorst avatar RMHogervorst commented on September 23, 2024

It says : no bibtex file found: and in console:

references.BIB:7790:0
    syntax error, unexpected TOKEN_LITERAL, expecting TOKEN_COMMA
    Dropping the entry `de_bienestar_relaxation_` (starting at line 7790) 
Warning in bibtex::read.bib(file = input$bib_file) :

references.BIB:7936:0
    syntax error, unexpected TOKEN_LITERAL, expecting TOKEN_COMMA
    Dropping the entry `fine_epidemiology_` (starting at line 7936) 
Warning in bibtex::read.bib(file = input$bib_file) :

references.BIB:8017:0
    syntax error, unexpected TOKEN_LITERAL, expecting TOKEN_COMMA
    Dropping the entry `arroll_screening_` (starting at line 8017) 
Warning in bibtex::read.bib(file = input$bib_file) :

references.BIB:8236:0
    syntax error, unexpected TOKEN_LITERAL, expecting TOKEN_COMMA
    Dropping the entry `bargh_substitutability_` (starting at line 8236) 

from citr.

RMHogervorst avatar RMHogervorst commented on September 23, 2024

The syntax error is a bibtex problem in issue ropensci/bibtex#9

where apparently nothing has happened since 2015.

But I still see no references in my list

from citr.

RMHogervorst avatar RMHogervorst commented on September 23, 2024

Let me add some information: using windows 8.1 64bit r 3.3.0

from citr.

crsh avatar crsh commented on September 23, 2024

Hi @RMHogervorst, thanks for reporting this (and sorry for the late reply, I wasn't watching my own repository 😆 ). I have encountered similar problems whenever my reference key ended on ?, that is, when the year was missing in Zotero. Could you provide me with a copy of your bib-file for testing purposes?

from citr.

crsh avatar crsh commented on September 23, 2024

I have already asked about a resubmission of bibtex to CRAN as the current development version on Github fixes some of the current problems. I'm a little reluctant to switch to RefManageR::ReadBib as the package has many more dependencies...

from citr.

RMHogervorst avatar RMHogervorst commented on September 23, 2024

Great idea, you could also add some tests to the repo?
I personally love testthat.
I have tried several bibtex files from my zotero reference manager (also
without questionmarks) and none really worked, kept giving the message
that no file was found but when it checked with option(), the correct path
was saved.

Kind regards
Roel
Op 5 jul. 2016 16:40 schreef "Frederik Aust" [email protected]:

I have already asked for a resubmission of bibtex to CRAN as the current
development version on Github fixes some of the current problems. I'm a
little reluctant to switch to RefManageR::ReadBib as the package has many
more dependencies...


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#1 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AJGJ-ATIjXTocS2UwoIOaVjmp23X8Floks5qSmzCgaJpZM4JDFKE
.

from citr.

crsh avatar crsh commented on September 23, 2024

That's odd. I can't reproduce that problem. Is this problem related to the above mentioned issue or does this happen independently? Are you using an absolute or relative path to the bib-file? If it's relative, is your working directory set correctly?

from citr.

RMHogervorst avatar RMHogervorst commented on September 23, 2024

I use rstudio projects so the wd is set to that directory (confirmed with getwd() ). I will enclose a file that doesn't load. It was saved as test.bib and if I set test.bib under Path to [...] It says

in the top (search) bar : BibTex file not found

below in the gray bar: no reference selected

Using a absolute path doesn't work either

@article{drummond_reproducible_2012,
    title = {Reproducible Research: a Dissenting Opinion},
    url = {http://cogprints.org/8675/},
    shorttitle = {Reproducible Research},
    author = {Drummond, Chris},
    urldate = {2016-02-15},
    date = {2012},
    note = {00001},
    file = {Drummond - 2012 - Reproducible Research a Dissenting Opinion.pdf:C\:\\Users\\roel\\AppData\\Roaming\\Zotero\\Zotero\\Profiles\\aw40nx7l.default\\zotero\\storage\\MRQKSNKZ\\Drummond - 2012 - Reproducible Research a Dissenting Opinion.pdf:application/pdf}
}

@article{wilson_best_2014,
    title = {Best Practices for Scientific Computing},
    volume = {12},
    issn = {1545-7885},
    url = {http://dx.plos.org/10.1371/journal.pbio.1001745},
    doi = {10.1371/journal.pbio.1001745},
    pages = {e1001745},
    number = {1},
    journaltitle = {{PLoS} Biology},
    author = {Wilson, Greg and Aruliah, D. A. and Brown, C. Titus and Chue Hong, Neil P. and Davis, Matt and Guy, Richard T. and Haddock, Steven H. D. and Huff, Kathryn D. and Mitchell, Ian M. and Plumbley, Mark D. and Waugh, Ben and White, Ethan P. and Wilson, Paul},
    editor = {Eisen, Jonathan A.},
    urldate = {2016-02-15},
    date = {2014-01-07},
    langid = {english},
    note = {00109},
    file = {Wilson et al. - 2014 - Best Practices for Scientific Computing.pdf:C\:\\Users\\roel\\AppData\\Roaming\\Zotero\\Zotero\\Profiles\\aw40nx7l.default\\zotero\\storage\\VZC52475\\Wilson et al. - 2014 - Best Practices for Scientific Computing.pdf:application/pdf;Wilson et al. - 2014 - Best Practices for Scientific Computing.PDF:C\:\\Users\\roel\\AppData\\Roaming\\Zotero\\Zotero\\Profiles\\aw40nx7l.default\\zotero\\storage\\PG56GMC6\\Wilson et al. - 2014 - Best Practices for Scientific Computing.PDF:application/pdf}
}

@article{baumer_r_2014,
    title = {R Markdown: Integrating a reproducible analysis tool into introductory statistics},
    url = {http://arxiv.org/abs/1402.1894},
    shorttitle = {R Markdown},
    journaltitle = {{arXiv} preprint {arXiv}:1402.1894},
    author = {Baumer, Ben and Cetinkaya-Rundel, Mine and Bray, Andrew and Loi, Linda and Horton, Nicholas J.},
    urldate = {2016-02-15},
    date = {2014},
    note = {00022},
    file = {Baumer et al. - 2014 - R Markdown Integrating a reproducible analysis to.pdf:C\:\\Users\\roel\\AppData\\Roaming\\Zotero\\Zotero\\Profiles\\aw40nx7l.default\\zotero\\storage\\Q86U3MPD\\Baumer et al. - 2014 - R Markdown Integrating a reproducible analysis to.pdf:application/pdf}
}

from citr.

RMHogervorst avatar RMHogervorst commented on September 23, 2024

I found one problem, once there is a file called references.bib, it seems to ignore any other file. I renamed that file and I recieve the following errors in the console:

ignoring entry 'drummond_reproducible_2012' (line 1) because :
    A bibentry of bibtype ‘Article’ has to specify the fields: journal, year

ignoring entry 'wilson_best_2014' (line 12) because :
    A bibentry of bibtype ‘Article’ has to specify the fields: journal, year

ignoring entry 'baumer_r_2014' (line 30) because :
    A bibentry of bibtype ‘Article’ has to specify the fields: journal, year

from citr.

crsh avatar crsh commented on September 23, 2024

Okay, thanks for digging into this. I'll take a closer look.

from citr.

RMHogervorst avatar RMHogervorst commented on September 23, 2024

oh this is weird, I tried several ways to output the same articles from zotero.
some create valid and other invalid bibtex files.

  • better-bibtex 👍
  • betterbiblatex 👎
  • biblatex 👎
  • bibtex 👍

So it does seem to work!

'better bibtex' in zotero:

@article{baumer_markdown_2014,
  title = {R {{Markdown}}: {{Integrating}} a reproducible analysis tool into introductory statistics},
  shorttitle = {R {{Markdown}}},
  timestamp = {2016-02-15T09:16:13Z},
  urldate = {2016-02-15},
  journal = {arXiv preprint arXiv:1402.1894},
  author = {Baumer, Ben and Cetinkaya-Rundel, Mine and Bray, Andrew and Loi, Linda and Horton, Nicholas J.},
  year = {2014},
  note = {00022},
  file = {Baumer et al. - 2014 - R Markdown Integrating a reproducible analysis to.pdf:C\:\\Users\\roel\\AppData\\Roaming\\Zotero\\Zotero\\Profiles\\aw40nx7l.default\\zotero\\storage\\Q86U3MPD\\Baumer et al. - 2014 - R Markdown Integrating a reproducible analysis to.pdf:application/pdf}
}

from citr.

crsh avatar crsh commented on September 23, 2024

I see. I use better-bibtex myself. That explains why it was working for me. I think I'll try switching to RefManageR::ReadBib to see if that works better.

from citr.

crsh avatar crsh commented on September 23, 2024

As of the latest commit I have switched from bibtex::read.bib to RefManageR::ReadBib. I tried all the above excerpts of your bibliography files and they work for me with the exception of drummond_reproducible_2012, which is missing a required field for the journal title. Even RefManageR::ReadBib doesn't accept that.

If you still have the other bibtex files generated by Zotero (betterbiblatex, etc.) handy, it would be really helpful if you could either pass them along to me for testing purposes or give them a quick try yourself. You should now be able to simply place them in the working directory and list all of them in the YAML header of your R Markdown like this:

bibliography:
  - bib1.bib
  - bib2.bib

citr should read and import all references.

from citr.

crsh avatar crsh commented on September 23, 2024

Yes this is nicer way to work with the references.

Indeed, this is very handy for single file documents. I had originally decided to use the specified file path because I often work with R Markdown documents that are split into multiple files. The automatic use of bibliographies from the YAML header cannot work in this situation. So specifying a file path is still a possible fall back solution.

This reference is an interesting case. I tested adding the entry to my bibliography via the Zotero plug-in and it produced the same entry you have (including the author name with ; that is causing the problem). Is there a reason that you keep author = {{\&Na;}} or could you simply set it to {}?

from citr.

crsh avatar crsh commented on September 23, 2024

If you do that you also have to use a different entry type (e.g., @misc). author is a required field for articles.

from citr.

RMHogervorst avatar RMHogervorst commented on September 23, 2024

I don't think it was intentional to give the name NA; It is also not necessary. strange thing

from citr.

crsh avatar crsh commented on September 23, 2024

Alternatively, you could use a different citation key format in better-bibtex.

from citr.

crsh avatar crsh commented on September 23, 2024

Unless there are any other difficulties I'll close this issue for now. Feel free to reopen it if you experience any other difficulties. And again thanks a lot for the detailed and helpful feedback! 🙇

from citr.

RMHogervorst avatar RMHogervorst commented on September 23, 2024

Yeah sure, I'll close it for you

from citr.

Related Issues (20)

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.