bookdown Error 'CTeX fontset `mac' is unavailable in current mode.' when using output

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.

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," ---

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.

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?

Thanks very much for your help!

Answer1:

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

人吐槽 人点赞

Recommend

Comment

用户名: 密码:
验证码: 匿名发表

你可以使用这些语言

查看评论:bookdown Error 'CTeX fontset `mac' is unavailable in current mode.' when using output