liao961120 / linguisticsdown

Easy Linguistics Document Writing with R Markdown
https://liao961120.github.io/linguisticsdown
Other
26 stars 3 forks source link

readPNG error in vignette #4

Open alapo opened 4 years ago

alapo commented 4 years ago

I have been trying to write a book which compiles to pdf, gitbook and epub. I sought a solution that would allow me to knit GIFs when I render as a gitbook while still rendering an image with pdf.

Found your function include_graphics2 which seems like it should help...but I am getting issues with your default code.

I created a blank RMarkdown file

---
title: "Untitled"
output: pdf_document
---

`{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(linguisticsdown)
library(knitr)
`

`{r, eval=TRUE, fig.cap = "Check your RStudio version"}
png_url <- 'https://commonmark.org/images/markdown-mark.png'
gif_url <- 'https://media.giphy.com/media/k3dcUPvxuNpK/giphy.gif'

## Not run: 
include_graphics2(gif_url, alt_path = png_url)
`

This document will result in the following error

img

If I change the png_url so that the extension is ".PNG instead of .png it will no longer give this error but then the image won't work (because the URL is case sensitive).

Any ideas on how to fix this?

liao961120 commented 4 years ago

It seems to work fine on my computer (test.pdf). (Note also your R code chunks are malformed)

Could provide your OS info?