我正在使用“bookdown”RStudio
, tinyTex
and pandoc
用中文写一份报告。因为我需要使用交叉引用,所以我必须将输出格式设置为“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 字体集‘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-中文演示 https://github.com/yihui/bookdown-chinese到这里,就成功了。我也尝试在自己的文件中使用这个演示的模板,或者使用输出格式pdf_book
,但我仍然遇到同样的问题。
那么我可以做些什么来解决它吗?
非常感谢您的帮助!
bookdown-chinese 演示使用 XeLaTeX:https://github.com/yihui/bookdown-chinese/blob/master/_output.yml#L22 https://github.com/yihui/bookdown-chinese/blob/master/_output.yml#L22你也可以这样做:
output:
bookdown::pdf_document2:
latex_engine: xelatex
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)