系统为Mac os,升级到28.2 后,发现用dvisvgm处理org-mode中的latex公式变得非常耗资源,查了一下,发现似乎每处理一个公式,系统都会自动启动一个叫“Emacs 网页内容”的后台进程,再查看此进程,是“Apple webkit”。多处理几个公式就造成系统负载高,风扇狂响…
相关配置如下。好像mac下的svg用webkit渲染,话说28.1也是这个配置,用得好好的…
(setq org-preview-latex-process-alist
'(
(dvisvgm
:programs ("xelatex" "dvisvgm")
:description "xdv > svg"
:message "you need to install the programs: xelatex and dvisvgm."
:image-input-type "xdv"
:image-output-type "svg"
:image-size-adjust (1.4 . 1.3)
:latex-compiler ("xelatex --no-pdf -interaction nonstopmode -output-directory %o %f")
:image-converter ("dvisvgm %f --libgs=/usr/local/Cellar/ghostscript/9.56.1_1/lib/libgs.dylib -e -n -b min -c %S -o %O"))
(imagemagick
:programs ("latex" "convert")
:description "pdf > png"
:message "you need to install the programs: xelatex and imagemagick."
:image-input-type "pdf"
:image-output-type "png"
:image-size-adjust (1.4 . 1.3)
:latex-compiler ("xelatex -interaction nonstopmode -output-directory %o %f")
:image-converter
("convert -density %D -trim -antialias %f -quality 100 %O"))
(dvipng
:progams ("xelatex" "dvipng")
:discription "dvi > png"
:message "you need install the programs: xelatex and dvipng."
:image-input-type "dvi"
:image-output-type "png"
:image-size-adjust (1.4 . 1.3)
:latex-compiler ("xelatex --no-pdf -interaction nonstopmode -output-directory %o %f")
:image-converter ("dvipng -D %D -T tight -bg Transparent -o %O %f"))))
;;换用 dvisvgm 生成矢量图预览
(setq org-preview-latex-default-process 'dvisvgm)