如何禁用AUCTeX的字体突出显示,而不失去颜色高亮?

6
我喜欢AucTeX的最大语法高亮,但我不喜欢AucTeX搞乱字体。例如,如果我使用斜体,在我的emacs缓冲区中显示出斜体字母,并且在小字母中显示下标和上标(略微在或下线之上)。无论我处于任何latex环境中,我都倾向于使用等宽字体。 我试图更改变量font-latex-deactivated-keyword-classes的设置,但这样语法颜色也会消失。
请问有人能提供一种解决方法吗?
谢谢。
4个回答

2
在最近版本的AUCTeX中:
(setq font-latex-fontify-script nil)
(setq font-latex-fontify-sectioning 'color)

2

http://www.gnu.org/software/auctex/manual/auctex/Faces.html#Faces

如果您想更改font-latex使用的颜色和字体,请参考上述说明中提到的faces,并使用M-x customize-face RET <face> RET。通过输入以下命令,可以访问font-latex定义的所有face:

M-x customize-group RET font-latex-highlighting-faces RET.


上述命令将打开设置缓冲区,您可以在其中设置适当的字体。一旦保存更改,您的.emacs文件将包含类似于以下行:

'(font-latex-sectioning-5-face ((((class color) (background light)) (:inherit variable-pitch :foreground "blue4" :weight normal :foundry "outline" :family "Century Gothic")

在您的示例中,您可以根据自己的要求自定义Font Latex Italic Face。然后,您的.emacs应该包含以下内容

'(font-latex-italic-face ...)

以您所设定的任何值。同样,您可以自定义上标、下标和其他大量字体。


0

在Emacs 24.3上测试通过。将以下内容放入您的~/.emacs文件中:

(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(font-latex-bold-face ((t nil)))
 '(font-latex-doctex-documentation-face ((t nil)))
 '(font-latex-doctex-preprocessor-face ((t nil)))
 '(font-latex-italic-face ((t nil)))
 '(font-latex-math-face ((t nil)))
 '(font-latex-sectioning-0-face ((t nil)))
 '(font-latex-sectioning-1-face ((t nil)))
 '(font-latex-sectioning-2-face ((t nil)))
 '(font-latex-sectioning-3-face ((t nil)))
 '(font-latex-sectioning-4-face ((t nil)))
 '(font-latex-sectioning-5-face ((t nil)))
 '(font-latex-sedate-face ((t nil)))
 '(font-latex-slide-title-face ((t nil)))
 '(font-latex-string-face ((t nil)))
 '(font-latex-subscript-face ((t nil)))
 '(font-latex-superscript-face ((t nil)))
 '(font-latex-verbatim-face ((t nil)))
 '(font-latex-warning-face ((t nil))))

0

1
这完全没有回答问题。 - James Howard

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接