Giter VIP home page Giter VIP logo

Comments (7)

yihui avatar yihui commented on September 24, 2024 1

That might be the reason. Just tested the current version, and it seems to be working now. Thanks a lot!

from citr.

crsh avatar crsh commented on September 24, 2024

Thanks for the suggestion!

I think I'll add a new option citr.parent_documents that contains the names of candidate R Markdown files to search for references (e.g., I personally often use a master.Rmd). By default, I would set the option to c("index.Rmd", "master.Rmd"). These files should probably only be used if the current document does not include a YAML front matter.

Would that work for your purposes?

from citr.

yihui avatar yihui commented on September 24, 2024

Yes that will work, but I'd like it to be as automated as possible. When _bookdown.yml or _site.yml is present, we are almost sure that the bib paths are in index.Rmd. Users will love "It Just Works ™️" :)

from citr.

crsh avatar crsh commented on September 24, 2024

I implemented the discussed changes in my last commit. Additionally, I enforced, that, even if index.Rmd is not included in the option citr.parent_documents, if either _bookdown.yml or _site.yml exist at the location of the current document index.Rmd will be searched for bibliographies.

Let me know what you think. There is one other change I want to make, but if this solution works for your purposes I would try to submit an update of the package to CRAN soon.

from citr.

yihui avatar yihui commented on September 24, 2024

Thanks, but it does not seem to work well. You can use this repo as an example: https://github.com/rstudio/bookdown-demo If I open any Rmd other than index.Rmd from a fresh R session, and insert citations, I don't see the correct bib files read from index.Rmd:

screen shot 2016-09-02 at 11 33 03 pm

However, if I click the addin again, the bib files are found.

screen shot 2016-09-02 at 11 35 24 pm

from citr.

crsh avatar crsh commented on September 24, 2024

Thanks for testing this. It seemed to work well for me, but I'll take a closer look.

from citr.

crsh avatar crsh commented on September 24, 2024

So, I have difficulty reproducing the problem on my machine, but I have now updated the addin to access the source editor context instead of active document (if the installed version of RStudio is up to date). Is it possible your cursor was in the console rather than inside the Rmd?

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.