emacssyntax-highlightingauctex

Emacs AucTex Latex syntax prevents monospaced font


My emacs (Aquamacs with AucTex) changes font size (in e.g. LaTeX mode) to show the syntax - like this:

enter image description here

Unfortunately this ruins the point of a monospaced font - e.g. my comments do not align. How do I solve this problem?


Solution

  • For the specific example of sections, chapters, etc., add the following to your .emacs:

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

    Edit Here is the config I usually use to customise the AUCTeX formatting:

    ;; Only change sectioning colour
    (setq font-latex-fontify-sectioning 'color)
    ;; super-/sub-script on baseline
    (setq font-latex-script-display (quote (nil)))
    ;; Do not change super-/sub-script font
    (custom-set-faces
     '(font-latex-subscript-face ((t nil)))
     '(font-latex-superscript-face ((t nil)))
     )
    ;; Exclude bold/italic from keywords
    (setq font-latex-deactivated-keyword-classes
        '("italic-command" "bold-command" "italic-declaration" "bold-declaration"))