How to disable auctex fontification, without losing color highlighting?
Asked Answered
G

4

6

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-latex-deactivated-keyword-classes, but then the syntax coloring also disappears.

Could someone suggest a way to fix this?

Thanks.

Grandchild answered 17/8, 2011 at 0:16 Comment(0)
O
2

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.

Ontina answered 6/10, 2011 at 11:55 Comment(0)
O
2

In recent versions of AUCTeX:

(setq font-latex-fontify-script nil)
(setq font-latex-fontify-sectioning 'color)
Oxtail answered 25/11, 2016 at 16:2 Comment(0)
M
0

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

Matusow answered 18/8, 2011 at 8:26 Comment(1)
This does not answer the question at all.Hardner
N
0

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))))
Nemertean answered 21/6, 2014 at 17:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.