[Tex/LaTex] How to have titles with normal font size with AUCTeX+Emacs

auctexemacs

I'm wondering how to modify the way AUCTeX show titles.

By defaut, the titles are too big for me and they take too much place in my screen.

enter image description here

(ignore the red underlining created by flyspell set with a dictionary which is not English).

I would like to have the same font size for everything in my document. I believe the color is sufficient to emphasize titles.

I tried to set font-latex-fontify-sectioning to 'color' according to AUCTeX manual:

User Option: font-latex-fontify-sectioning

Per default sectioning commands will be shown in a larger,
proportional font, which corresponds to a number for this variable.
The font size varies with the sectioning level, e.g. ‘\part’
(font-latex-sectioning-0-face) has a larger font than ‘\paragraph’
(font-latex-sectioning-5-face). Typically, values from 1.05 to 1.3 for
font-latex-fontify-sectioning give best results, depending on your
font setup. If you rather like to use the base font and a different
color, set the variable to the symbol ‘color’. In this case the face
font-lock-type-face will be used to fontify the argument of the
sectioning commands.

However, I obtained an error for the setting 'color':

custom-variable-set: This field should contain a number (floating point or integer)

I tried then to set this setting to 1. (the default is 1.1) with the idea that 1. should be the normal font size.

I obtained this error (I cannot see my titles anymore):
enter image description here

Best Answer

If you want to use the color value of the font-latex-fontify-sectioning variable add the following code to your .emacs

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

You must use 'color and not 'color' because the ' character is used to quote the next Lisp symbol and Emacs would interpret 'color' as the color' symbol, but AUCTeX doesn't accept that value for the font-latex-fontify-sectioning variable.

Instead, if you want to set font-latex-fontify-sectioning to 1 use

(setq font-latex-fontify-sectioning 1.0)

Setting font-latex-fontify-sectioning to 1. doesn't work because in Emacs Lisp 1. is an integer (see Integer Type on the GNU Emacs Lisp Reference Manual) and (setq font-latex-fontify-sectioning 1) doesn't work either due to a bug (now fixed) inside the current (11.87) stable version of AUCTeX.