看了 @gynamics 的回答感觉这个问题搞清楚一些了,这个问题其实是在捣鼓org-mode的latex preview功能发现的(如下),也就是在使用modus-vivendi等背景为纯黑色的主题时生成的latex preview在Emacs中显示为白色方块。
问题大概是这样产生的:
- org-mode生成preview时先产生一个tex文件,在文件内定义文本使用Emacs主题的前景色和背景色
- tex文件被转为xdv后由dvisvgm处理。由于SVG1.1不支持背景颜色,所以背景是通过绘制颜色为Emacs主题色的矩形实现的(如下)。
bgcolor Special statements for changing the background/page color. Currently, dvisvgm only supports the
background
statement as specified in the dvips manual. Since SVG 1.1 doesn’t support background colors, dvisvgm inserts a rectangle of the chosen color into the generated SVG document. This rectangle always gets the same size as the selected or computed bounding box. This background color command is part of the color special set but is handled separately in order to let the user turn it off.
而dvisvgm会将纯黑色当作缺省值,因此SVG中颜色为纯黑色的元素是没有设定fill
的。而Emacs的svg库的颜色缺省值是前景色,所以在暗色中显示错误。
目前对于这个问题有什么比较好的解决方案吗?dvi是不支持中文的,xdv转为png的工具也没有,目前只能等Emacs或dvisvgm修BUG了吗?