开发者

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. 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). I prefer to use a fixed width font regardless of the latex environment I am in.

I tried changing the settings for the variable font-开发者_StackOverflowlatex-deactivated-keyword-classes, but then the syntax coloring also disappears.

Could someone suggest a way to fix this?

Thanks.


From 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 M-x customize-face RET <face> RET. All faces defined by font-latex are accessible through a customization group by typing

M-x customize-group RET font-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:

'(font-latex-sectioning-5-face ((((class color) (background light)) (: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. Your .emacs should then contain

'(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:

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


See this page in the manual and the section Deactivating defaults of built-in keyword classes.


Tested on Emacs 24.3. Put the following in your ~/.emacs file:

(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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜