XiangyunHuang / ElegantBookdown

:book: A bookdown wrapper for ElegantBook
https://xiangyunhuang.github.io/ElegantBookdown/
Creative Commons Attribution 4.0 International
131 stars 26 forks source link

编译失败 #2

Closed perlatex closed 4 years ago

perlatex commented 4 years ago

报错 ! LaTeX Error: Command `\Bbbk' already defined.

不知道怎么修改

fyuniv commented 4 years ago

错误是因为调用的字体宏包有冲突。不知道你是不是自己加了字体包。如果没有,试试在index.Rmd的开头(yml之后)加上

```{r remove_amsthm,  include=FALSE}
options(bookdown.post.latex = function(x) {
    from <- grep("usepackage\\{amsthm\\}", x)
    to <- grep("newtheorem\\*\\{solution", x)
    x <- x[-c(from:to)]
  })
perlatex commented 4 years ago

XiangyunHuang升级到elegantbook 3.10版本,这个问题消失了

XiangyunHuang commented 4 years ago

本质是不要使用 unicode-math 包去渲染公式,它和上游的模版存在冲突,所以我启用了 mathspec 包

https://github.com/XiangyunHuang/ElegantBookdown/blob/a59a06f8bb2f3da05e0ea931ea8edfe773c4f877/index.Rmd#L18