If I render the following file to html, everything works. If I render to pdf, it throws the error
output file: test.knit.md ! LaTeX Error: Unknown graphics extension: .png?raw=true. Fehler: Failed to compile test.tex. See test.log for more info.
The reason is, that the Rmd is translated to
\begin{figure} \centering \includegraphics[width=4.16667in]{pics/myimage.png?raw=true} \caption{Some text here.} \end{figure} in test.tex and above code does not make sense of course.
Example:
--- title: "Untitled" author: "Myname" date: "5 April 2019" output: pdf_document: number_sections: yes toc: yes toc_depth: '2' html_document: keep_md: yes number_sections: yes toc: yes toc_depth: 2 --- ```{r setup, include=FALSE} knitr::opts_chunk$set(echo = TRUE) ``` text {width=400px} text I need the ?raw=TRUE for github, see here. You can also clone the example from here!
Edit: I also asked the developers here, because I have the feeling, something goes wrong with keep_md: yes...