【发布时间】:2019-07-24 21:13:14
【问题描述】:
我有一张看起来像这样的 Xaringan 幻灯片:
---
title: "Xaringan test"
output:
xaringan::moon_reader:
self_contained: false
chakra: 'assets/remark-latest.min.js'
css: 'assets/presentation.css'
---
### This is a heading
This is some text and numbers 01235.
`Here is some inline code`.
```
block code
```
```{r}
cat("Some R code")
```
$e^{i\pi} + 1 = 0$
呈现的 HTML 如下所示。自定义字体、CSS 样式和 mathjax 都渲染得很好。这就是它的预期外观。
使用 Pagedown 导出为 PDF。
pagedown::chrome_print("test.html",output="test.pdf")
保留自定义字体和 css 样式。默认代码字体已更改,并且未显示 mathjax 表达式。除了缺少的 mathjax 之外,它做得很好。
使用 webshot 导出为 PDF。
webshot("test.html","test.pdf")
不保留自定义字体和 css 样式。保留默认代码字体和 mathjax。
有人知道如何在通过函数导出为 PDF 时保留字体、CSS 样式和 mathjax 吗?
R version 3.5.2 (2018-12-20)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS
webshot_0.5.1
pagedown_0.1
xaringan_0.8
【问题讨论】:
-
我听说过关于
decktape的好消息,它被带入了 xaringan。 related discussion