繁体   English   中英

如何禁用 auctex 字体化,而不会丢失颜色突出显示?

[英]How to disable auctex fontification, without losing color highlighting?

我喜欢 AucTeX 的最大语法高亮,但我不喜欢 AucTeX 搞乱 fonts。 例如,如果我使用斜体,它会在我的 emacs 缓冲区中显示斜体字母,并以小写字母(略高于或低于行)显示下标和上标。 无论我所处的 latex 环境如何,我都更喜欢使用固定宽度的字体。

我尝试更改变量 font-latex-deactivated-keyword-classes 的设置,但随后语法着色也消失了。

有人可以提出解决此问题的方法吗?

谢谢。

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

如果要更改 font-latex 使用的 colors 和 fonts 请参考上面解释中提到的面,并使用Mx customize-face RET <face> RET 由 font-latex 定义的所有面都可以通过自定义组通过键入来访问

Mx customize-group RET 字体-latex-highlighting-faces RET。


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

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

在您的示例中,您可以根据您的规格自定义Font Latex Italic Face Your.emacs 应包含

'(字体-乳胶-斜体-脸...)

到任何你设置它。 您可以类似地自定义上标、下标和其他所有字体。

在 AUCTeX 的最新版本中:

(setq font-latex-fontify-script nil)
(setq font-latex-fontify-sectioning 'color)

在 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))))

请参阅手册中的此页面Deactivating defaults of built-in keyword classes部分。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM