简体   繁体   English

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

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

I like maximum syntax highlighting of AucTeX, but I don't like AucTeX messing with fonts.我喜欢 AucTeX 的最大语法高亮,但我不喜欢 AucTeX 搞乱 fonts。 For example, if I use italics, it shows italicized letters in my emacs buffer, and shows subscripts and superscripts in small letters (slightly above or below the line).例如,如果我使用斜体,它会在我的 emacs 缓冲区中显示斜体字母,并以小写字母(略高于或低于行)显示下标和上标。 I prefer to use a fixed width font regardless of the latex environment I am in.无论我所处的 latex 环境如何,我都更喜欢使用固定宽度的字体。

I tried changing the settings for the variable font-latex-deactivated-keyword-classes, but then the syntax coloring also disappears.我尝试更改变量 font-latex-deactivated-keyword-classes 的设置,但随后语法着色也消失了。

Could someone suggest a way to fix this?有人可以提出解决此问题的方法吗?

Thanks.谢谢。

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

In case you want to change the colors and fonts used by font-latex please refer to the faces mentioned in the explanations above and use Mx customize-face RET <face> RET .如果要更改 font-latex 使用的 colors 和 fonts 请参考上面解释中提到的面,并使用Mx customize-face RET <face> RET All faces defined by font-latex are accessible through a customization group by typing由 font-latex 定义的所有面都可以通过自定义组通过键入来访问

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


The above command opens the settings buffer where you can set the appropriate font face.上面的命令打开设置缓冲区,您可以在其中设置适当的字体。 Once you save changes, your.emacs file will contain a line similar to:保存更改后,您的 .emacs 文件将包含类似于以下内容的行:

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

In your example, you can customize the Font Latex Italic Face to your specifications.在您的示例中,您可以根据您的规格自定义Font Latex Italic Face Your.emacs should then contain Your.emacs 应包含

'(font-latex-italic-face...) '(字体-乳胶-斜体-脸...)

to whatever you set it to.到任何你设置它。 You can similarly customize superscript, subscript and whole host of other font faces.您可以类似地自定义上标、下标和其他所有字体。

In recent versions of AUCTeX:在 AUCTeX 的最新版本中:

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

Tested on Emacs 24.3.在 Emacs 24.3 上测试。 Put the following in your ~/.emacs file:将以下内容放入您的 ~/.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))))

See this page in the manual and the section Deactivating defaults of built-in keyword classes .请参阅手册中的此页面Deactivating defaults of built-in keyword classes部分。

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

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