编译有生成tex文件,但是报错,是不是模板太老的原因?
! LaTeX Error: Command `\Bbbk' already defined.
错误: LaTeX failed to compile pku_zh.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See pku_zh.log for more info.
此外: Warning message:
In has_crop_tools() :
Tool(s) not installed or not in PATH: ghostscript
-> As a result, figure cropping will be disabled.
Please delete pku_zh.Rmd after you finish debugging the error.
停止执行
文件头:
site: bookdown::bookdown_site
output:
bookdown::pdf_book:
keep_tex: yes
dev: "cairo_pdf"
latex_engine: xelatex
citation_package: natbib
template: tex/template_pku_zh.tex
pandoc_args: --top-level-division=chapter
toc_depth: 2
toc_unnumbered: yes
toc_appendix: yes
quote_footer: ["\\begin{flushright}", "\\end{flushright}"]
documentclass: ctexbook
R markdown 模板文件获取途径:
bookdownplus::bookdownplus(template = "pku_zh") #获取模板
log文件
最近的错误总是出现在 Latex 那边,头大,想下载模板下来学习的,结果模板都编译不成功。
通过网上的方法修改了生成的tex文件
在\usepackage{amssymb}前加上\let\Bbbk\relax使得前面(即newtxmath包中)定义的Bbbk失效。
然后单独编译,错误变了。
tinytex :: latexmk("puk_zh.tex")
##错误: LaTeX failed to compile puk_zh.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips.
环境:
R version 4.0.4 (2021-02-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)
Matrix products: default
locale:
[1] LC_COLLATE=Chinese (Simplified)_China.936
[2] LC_CTYPE=Chinese (Simplified)_China.936
[3] LC_MONETARY=Chinese (Simplified)_China.936
[4] LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_China.936
attached base packages:
[1] stats graphics grDevices utils datasets
[6] methods base
loaded via a namespace (and not attached):
[1] Rcpp_1.0.6 bookdown_0.21.6
[3] digest_0.6.27 magrittr_2.0.1
[5] evaluate_0.14 xaringan_0.20
[7] stringi_1.5.3 rlang_0.4.10
[9] rstudioapi_0.13 magick_2.6.0
[11] rmarkdown_2.7.3 tools_4.0.4
[13] stringr_1.4.0 tinytex_0.30.1
[15] xfun_0.21 yaml_2.2.1
[17] compiler_4.0.4 bookdownplus_1.5.8
[19] htmltools_0.5.1.1 knitr_1.31