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 `https://raw.githubusercontent.com/sjkiss/DMJN328/master/im
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"
output:
pdf_document:
fig_caption: yes
pandoc_args: ["--extract-media", "."]
header-includes:
- \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%"}
knitr::include_graphics('https://raw.githubusercontent.com/sjkiss/DMJN328/master/images/chapter_3_rproj.png')