我尝试通过Bookdown在数学模式下使用Unicode字符(U + 2685),我设置了mathfont: STIX Two Math
(包含此字符),但是生成的PDF包含空白。 (同时HTML是正确的。)
这里怎么了?
((我的最佳猜测是我应该使用unicode-math
程序包。不幸的是,我无法将其包含在preamble.tex
中,因为它与incompatible一起是mathspec
,但与此同时,我没有看到摆脱mathspec
的方法;在Bookdown中似乎硬编码了使用xelatex时mathspec
d为usepackage
d。)
最小的可复制示例(显示index.Rmd
,所有其他文件与RStudio创建的默认新项目相同:]
---
title: "A Minimal Book Example"
author: "Yihui Xie"
date: "`r Sys.Date()`"
site: bookdown::bookdown_site
documentclass: book
link-citations: yes
description: "This is a minimal example of using the bookdown package to write a book. The output format for this example is bookdown::gitbook."
mainfont: STIX Two Math
mathfont: STIX Two Math
---
# Prerequisites
In text: ⚀.
In math mode: $⚀$.
这是结果的样子:
此问题已解决(在更新到rmarkdown
之后,请参阅here。