2

I am trying to render a pdf file using R markdown. I want to embed an image on the page and using the following syntax:

image: ![](logo.png)

While creating the pdf, I get an error saying

`pandoc.exe: Could not find image logo.png, skipping...
pandoc.exe: Error producing PDF from TeX source.
! Package pdftex.def Error: File logo.png not found.`

Error: pandoc document conversion failed with error 43

The image exists, and don't know why it is failing. I even gave the exact path with drive and folder names, but still fails.

My File is simple as:

---
title: 'Test'
author: "Foo"
date: "Wednesday, December 17, 2014"
output: pdf_document
---

```{r}
summary(cars) 
```

image: ![](logo.png)
Next Door Engineer
  • 2,818
  • 4
  • 20
  • 33
  • Please post any configuration you have in your rmd file. – zipp Dec 17 '14 at 15:39
  • @zipp I've updated my question. No configurations as such. – Next Door Engineer Dec 17 '14 at 17:01
  • Your example works for me (win7_64, R-3.1.2 64). Does `getwd()` give you the directory the logo is within? – r2evans Dec 17 '14 at 17:05
  • @NextDoorEngineer, thanks. Did you read the answer [here](http://stackoverflow.com/questions/10517020/how-to-import-local-image-using-knitr-for-markdown) ? – zipp Dec 17 '14 at 17:07
  • @zipp, It is the same thing that I've tried, but failing. – Next Door Engineer Dec 17 '14 at 17:12
  • What r2evan said is what would make the more sense since it is also working on my computer (win7_64, R-3.1.2 64 as well). Depending what you are looking at, you might be able to trick it by using this [answer](http://stackoverflow.com/questions/11096870/include-images-programmatically-in-md-document-from-within-r-chunk-using-knitr) – zipp Dec 17 '14 at 17:20
  • @zipp, still no luck! Even that's not working for me. – Next Door Engineer Dec 17 '14 at 17:31
  • Cannot reproduce on the same setup as @r2evans. You can also try fetching random picture by url like [this](http://rspatial.r-forge.r-project.org/Rlogo.jpg) to see if that's not related to your paths. – tonytonov Dec 22 '14 at 12:06
  • @tonytonov, I get the same error even when I have an url instead... – Next Door Engineer Dec 25 '14 at 05:55
  • Since no one can reproduce this, all I can advise is reinstalling all the necessary environment. Also there's a suggestion above about `getwd`. – tonytonov Dec 25 '14 at 07:18

0 Answers0