2

我正在使用带有 Rstudio + tinyTex + pandoc 的 bookdown 来编写中文报告。因为我需要使用交叉引用,所以我必须将输出格式设置为 pdf_document2,但是我遇到了关于 CTeX fontest 的问题。

首先,这里是 YAML 部分:

---
title: "title"
author:
  - author
documentclass: ctexart
site: bookdown::bookdown_site
output:
  bookdown::pdf_document2
bibliography: bib_v1.bib
csl: chinese-author-date.csl
link-citations: yes
colorlinks: yes
classoption: "hyperref,"
---

并且在构建这本书时出现了一些错误,上面写着“CTeX fontset `mac' is available in current mode.”,这是整个错误信息:

tlmgr search --file --global '/mac'
TeX Live 2017 is frozen forever and will no
longer be updated.  This happens in preparation for a new release.

If you are interested in helping to pretest the new release (when
pretests are available), please read     http://tug.org/texlive/pretest.html.
Otherwise, just wait, and the new release will be ready in due time.
! Critical ctex error: "fontset-unavailable"
! 
! CTeX fontset 'mac' is unavailable in current mode.
! 
! See the ctex documentation for further information.
! 
! For immediate help type H <return>.
!...............................................  

! 
! CTeX fontset 'mac' is unavailable in current mode.
! 
! See the ctex documentation for further information.
! 
! For immediate help type H <return>.
!...............................................  

! CTeX fontset 'mac' is unavailable in current mode.
! 
! See the ctex documentation for further information.
! 
! For immediate help type H <return>.
!...............................................  

! 
! See the ctex documentation for further information.
! 
! For immediate help type H <return>.
!...............................................  

! See the ctex documentation for further information.
! 
! For immediate help type H <return>.
!...............................................  

! 
! For immediate help type H <return>.
!...............................................  

! For immediate help type H <return>.
!...............................................  

Error: Failed to compile _main.tex. See _main.log for more info.
In addition: Warning message:
In parse_packages(logfile, quiet = c(TRUE, FALSE, FALSE)) :
  Failed to find a package that contains mac
Please delete _main.Rmd after you finish debugging the error.
Execution halted

Exited with status 1.

我不熟悉 LaTeX,也不知道如何解决这个问题。我已经尝试在这里构建bookdown-Chinese 演示,并且成功了。我也尝试在自己的文件中使用这个demo的模板,或者使用输出格式pdf_book,但还是遇到了同样的问题。

那么我可以做些什么来解决它吗?

非常感谢您的帮助!

4

1 回答 1

2

bookdown-chinese 演示使用 XeLaTeX:https ://github.com/yihui/bookdown-chinese/blob/master/_output.yml#L22你可以这样做:

output: 
  bookdown::pdf_document2:
    latex_engine: xelatex
于 2018-04-06T09:26:03.277 回答