Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
320 views
in Technique[技术] by (71.8m points)

r - 在Bookdown(xelatex)的数学模式下使用Unicode字符(Using Unicode characters in math mode with Bookdown (xelatex))

I try to use a Unicode character (U+2685) in math mode with Bookdown, I set mathfont: STIX Two Math (which contains this character), yet the resulting PDF contains an empty space.

(我尝试在Bookdown的数学模式下使用Unicode字符(U + 2685),并设置mathfont: STIX Two Math (包含此字符),但生成的PDF包含空白。)

(At the same time the HTML is correct.)

((同时HTML是正确的。))

What's wrong here?

(怎么了)

(My best guess is that I should perhaps use the unicode-math package. Unfortunately I can't include it in the preamble.tex as it is incompatible with the mathspec , but at the same time I see no way to get rid of mathspec ; it seems to be hardcoded in Bookdown that mathspec is usepackage d when xelatex is used.)

((我的最佳猜测是,我也许应该使用unicode-math软件包。不幸的是,由于它与mathspec 不兼容 ,因此我无法将其包含在preamble.tex中,但与此同时,我也看不到摆脱mathspec ;在Bookdown中似乎硬编码为使用xelatex时mathspecusepackage d。))

Minimal reproducible example (showing index.Rmd , all other file is the same as with the default new project created with RStudio):

(最小的可重现示例(显示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: $?$.

This is how the result looks like:

(结果如下所示:)

在此处输入图片说明

  ask by Tamas Ferenci translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

现在(在更新rmarkdown )已解决此问题,请参见此处


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...