Using out.width with include_graphics()

I am trying to generate a pdf document with Rmarkdown with some images embedded from URLs. The help documentation for include_graphics() seems to suggest I can set the image size with the out.width= and out.height= arguments:

" Chunk options related to graphics output that work for normal R plots also work for these images, such as out.width and out.height ."

However, the code below generates the error

! LaTeX Error: File `
ages/chapter_3_rproj' not found.

However, removing the out.witdh and out.height arguments lets me compile the documents fine.

title: "Test"
author: "Test"
date: "23/01/2020"
    fig_caption: yes
    pandoc_args: ["--extract-media", "."]
- \usepackage{caption}


See \ref{fig:test}. 

```{r test, fig.cap="\\label{fig:test} Finding the .rproj file for Chapter 3", out.width="50%", out.height="50%"}

have you tried

![alt text here](path-to-image-here)

you will should be able to edit width of the image as well

1 Like

With Latex output, I think you can include graphics from a url (it is using \includegraphic.) It needs to be a local path. So you need to download the file before rendering.

See this comment

or this recent blogpost

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.