bookdown错误'CTeX fontset`mac'在当前模式下不可用.使用输出格式pdf_book& pdf_document2 [英] bookdown Error 'CTeX fontset `mac' is unavailable in current mode.' when using output format pdf_book & pdf_document2
问题描述
我正在使用带有Rstudio + tinyTex + pandoc的书本来编写中文报告.因为我需要使用交叉引用,所以我必须将输出格式设置为pdf_document2,但是我遇到了有关CTeX fontest的问题.
I'm using bookdown with Rstudio + tinyTex + pandoc to write a report in Chinese. Because I need to use cross reference, I have to set the output format to pdf_document2, but I got an issue about CTeX fontest.
首先,这是YAML部分:
First, here is the YAML part:
---
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'在当前模式下不可用.",这是整个错误信息:
And there's some wrong when build the book, which says 'CTeX fontset `mac' is unavailable in current mode.', and here's the whole error info:
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演示,它成功了.我也尝试在自己的文件中使用此演示的模板,或使用pdf_book的输出格式,但是仍然遇到相同的问题.
I'm not familiar with LaTeX, and don't know how to fix the issue. I've tried to build the bookdown-Chinese demo here, and it succeed. I also tried to use the template of this demo in my own file, or use the output format pdf_book, but I still got the same problem.
那么我有什么可以解决的吗?
So is there something I can do to fix it?
非常感谢您的帮助!
推荐答案
The bookdown-chinese demo uses XeLaTeX: https://github.com/yihui/bookdown-chinese/blob/master/_output.yml#L22 You could do the same like this:
output:
bookdown::pdf_document2:
latex_engine: xelatex
这篇关于bookdown错误'CTeX fontset`mac'在当前模式下不可用.使用输出格式pdf_book& pdf_document2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!