我正在使用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'在当前模式下无法使用。',以及此处的错误信息:
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,但我仍然遇到同样的问题。
那么我可以做些什么来解决它?
非常感谢你的帮助!
答案 0 :(得分:1)
bookdown-chinese演示使用XeLaTeX:https://github.com/yihui/bookdown-chinese/blob/master/_output.yml#L22你也可以这样做:
output:
bookdown::pdf_document2:
latex_engine: xelatex