Coder Social home page Coder Social logo

Comments (4)

cderv avatar cderv commented on June 19, 2024 1

I believe this is not an issue with jss_article() - this is broader and will happen with any vignettes built with rmarkdown engine with format not embeding the image (as html_vignette() or other format is doing.

This is directly related to rstudio/rmarkdown#2024 where fig.path will be set to absolute path when outpur_dir is used. and IMO is an hidden issue with vignette since knitr 1.27 as the vignette engine is using output.dir yihui/knitr@b80ece1

Definitely something we should fix somehow.

As a workaround for you need, you can customize the fig path in a setup chunk

```{r include = FALSE}
knitr::opts_chunk$set(
  fig.path = "figures/"
)
```

This will correctly use relative paths, and should not be a problem. Though you need to pay attention to chunk name for figures if you have several Rmds and one global folder, or use something like fig.path = "figures/foo-"

I'll add more insight in rstudio/rmarkdown#2024 based on this report as I see vignettes issue more clearly now.

Thanks for the report. i'll close as we need to handle this in rmarkdown


BTW about vignette building

See this discussion r-lib/devtools#2488 where devtools::build_vignettes() is no more recommended.
The recommended workflow is now the following: https://r-pkgs.org/vignettes.html#sec-vignettes-workflow-writing

This doesn't solve the issue but could be helpful with resources handling.

from rticles.

GFabien avatar GFabien commented on June 19, 2024 1

Thank you! The workaround works like a charm!

from rticles.

cderv avatar cderv commented on June 19, 2024

Great. You just need to make sure that resources in vignettes/ are correctly included for your R CMD CHECK to pass.
Useful R-HUB blog post

HTML vignettes does not have such issue because images are embeded inside the HTML and not are external resources

from rticles.

github-actions avatar github-actions commented on June 19, 2024

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

from rticles.

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.