I am trying to include a .png file in a file that I am rendering using bookdown. knitr::include_graphics()
should be the way to go.
The code:
```{r fig1, fig.cap='My Caption', echo=FALSE, message=FALSE, warning=FALSE}
knitr::include_graphics("./Figures/My Figure.png")
```
In the .Rmd file, I can run my r block, and it renders the image below. So, the path should be correct. However, when I knit the chapter, or render the entire book, the figure is not rendered.
Could it be that some of my other options are overriding the figure? Below are my YAML header of the index.Rmd file, and the code in my _output.yml file.
---
title: "My Title"
author: "My Name"
date: "`r Sys.Date()`"
output:
bookdown::gitbook:
split_by: section
bookdown::pdf_book:
keep_tex: no
documentclass: book
classoption: openany
bibliography: [Mybib.bib]
csl: Mycsl.csl
biblio-style: apalike
link-citations: yes
description: "My Description"
---
bookdown::gitbook:
config:
toc:
before: |
<li><a href="./">Short Title</a></li>
bookdown::pdf_book:
latex_engine: xelatex
citation_package: natbib
bookdown::epub_book: default