【问题标题】:bookdown Error 'CTeX fontset `mac' is unavailable in current mode.' when using output format pdf_book & pdf_document2bookdown 错误 'CTeX fontset `mac' 在当前模式下不可用。'使用输出格式 pdf_book & pdf_document2 时
【发布时间】:2018-09-15 23:59:15
【问题描述】:

我正在使用 bookdown 和 Rstudio + tinyTex + 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 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,它成功了。我也尝试在自己的文件中使用这个demo的模板,或者使用pdf_book的输出格式,但还是遇到了同样的问题。

那么有什么办法可以解决吗?

非常感谢您的帮助!

【问题讨论】:

    标签: r bookdown tinytex


    【解决方案1】:

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

    output: 
      bookdown::pdf_document2:
        latex_engine: xelatex
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-09
      • 2016-11-03
      • 2016-06-21
      • 2018-10-10
      • 2017-10-11
      相关资源
      最近更新 更多