r-markdown - 如何在 xaringan 独立幻灯片中嵌入 html 图像

标签 r-markdown xaringan

下面的幻灯片在编织后可以预览,但是将幻灯片移动到其他地方后,图像就无法再显示了。

---
title: "Journal club"
author: "Timing Liu"
date: "`r Sys.Date()`"
output:
  xaringan::moon_reader:
    lib_dir: libs
    css: 
      - default
      - default-fonts
    self_contained: true
    nature:
      highlightStyle: github
      highlightLines: true
      countIncrementalSlides: false
---

<img src = 2021-01-19-23-07-58.png />

?moon_reader 的文档显示以下内容:

should not contain the string "/>" when it is written with the syntax  <img src="PATH" />

我相信我的路径应该已经符合标准,因此我不确定为什么 html 图像没有渲染。使用 ![](2021-01-19-23-07-58.png) 等 Markdown 语法加载的图像可以加载到独立幻灯片中的其他位置。

尝试在 Windows 上使用 Firefox 和 Chrome 以及最新的 Xaringan。

谢谢!

最佳答案

由于我无权访问您的图像,因此这是一个有效的示例:

---
title: "Journal club"
author: "Timing Liu"
date: "`r Sys.Date()`"
output:
  xaringan::moon_reader:
    lib_dir: libs
    css: 
      - default
      - default-fonts
    self_contained: true
    nature:
      highlightStyle: github
      highlightLines: true
      countIncrementalSlides: false
---

<img src = "https://blog.hostonnet.com/wp-content/uploads/2014/07/galaxy.jpg" />

输出(第 2/2 页):enter image description here

关于r-markdown - 如何在 xaringan 独立幻灯片中嵌入 html 图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66190634/

相关文章:

css - 在 Flexdashboard 中更改激活页面的颜色

knitr - 如何在 Rmarkdown 中制作图形标题?

r - 如何使用knitr::kable在表的底部添加注释?

css - 如何在 xaringan 演示文稿中隐藏代码块?

css - Xaringan 标题幻灯片

reveal.js - Xaringan 幻灯片中的背景视频

r - 如何获取 R 包的 rmarkdown 小插图以逃避 Solaris 和 OSX 上的 CRAN 警告

r - 如何以程序方式将绘图嵌入到 RMarkdown 的选项卡中?

r - xaringan - 我可以为整个演示设置倒计时吗?

xaringan HTML5 演示文稿中的 R Autofit DT 表格宽度和高度