Skip to content

readPNG error in vignette #4

@alapo

Description

@alapo

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions