amsmath默认就是加载的,并且会在mathspec之前。所以你这里手动再次加载amsmath反而会报错。
bm和extarrows本身是可以共存的,不过你这里如果只是需要\boldsymbol
的话那么默认加载的amssymb里就有,不需要再加载bm
编译的问题在于选择了xelatex引擎,如果换pdflatex就可以正常编译,但这样的话中文需求的满足就比较麻烦了。
------ 以下为一些更新 ------
参考 此处给出的一些模板,可以这么操作
---
title: "test bm and extarrows"
mathspec: no
documentclass: proc
output:
bookdown::pdf_book:
number_sections: yes
toc: yes
base_format: rmarkdown::pdf_document
latex_engine: xelatex
citation_package: natbib
dev: "cairo_pdf"
template: null
extra_dependencies:
ctex:
- heading=true
- UTF8
# bm:
unicode-math:
extarrows:
quote_footer: ["\\hspace*{\\fill} ", ""]
---
# bold 加粗
$$
\symbf{abc}\quad\symbfit{abc}\quad
\boldsymbol{abc}
$$
# long
$A \xlongequal[5mm]{\quad\quad}B$
主要修改了documentclass:proc
,另外输出类采用了bookdown::pdf_book
,而不是rticles::ctex
。
mathspecs:no
,这是因为后面自己加载的包,顺序都在mathspec
之后,而自己加载的extarrows
其代码里又再次加载amsmath,导致报错。
加载包都放到了extra_dependencies
里面,同时将负责加粗的bm
换成了unicode-math
。相应的加粗命令可以使用symbf
和symbfit