如何在 xaringan 自包含幻灯片中嵌入 html 图像

问题描述

编织后可以预览以下幻灯片,但将幻灯片移动到其他位置后,图像不再显示

---
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) 等降价语法加载的图像可以加载到自包含幻灯片中的其他位置。

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

谢谢!

解决方法

由于我无权访问您的图片,这里是一个工作示例:

---
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

,

Chrome 还会显示一些 Firefox 中缺少的本地图片。

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...